diff --git a/epmet-admin/epmet-admin-server/Dockerfile b/epmet-admin/epmet-admin-server/Dockerfile index 63927bad16..c2df4971cd 100644 --- a/epmet-admin/epmet-admin-server/Dockerfile +++ b/epmet-admin/epmet-admin-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./epmet-admin.jar EXPOSE 8082 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml index 6b4803d4d8..152e65a3e0 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml +++ b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /sys @@ -127,3 +128,9 @@ hystrix: ribbon: ReadTimeout: 300000 ConnectTimeout: 300000 + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-auth/Dockerfile b/epmet-auth/Dockerfile index 207ac66a19..60c6be4331 100644 --- a/epmet-auth/Dockerfile +++ b/epmet-auth/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./epmet-auth.jar EXPOSE 8081 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index 69713f1908..5af5eae312 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,17 @@ SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + http://101.206.141.251:21006 + soXDEoM1 + V7ea0KnlYt7eSyzc + + http://101.206.141.219:21006 + xSMONWwP + UUCnxLyXiB4eBF4p + + https://epmet-cloud.elinkservice.cn @@ -237,6 +253,17 @@ SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + http://101.206.141.251:21006 + soXDEoM1 + V7ea0KnlYt7eSyzc + + http://101.206.141.219:21006 + xSMONWwP + UUCnxLyXiB4eBF4p + + https://epmet-cloud.elinkservice.cn @@ -276,6 +303,17 @@ SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + http://101.206.141.251:21006 + soXDEoM1 + V7ea0KnlYt7eSyzc + + http://101.206.141.219:21006 + xSMONWwP + UUCnxLyXiB4eBF4p + + https://epmet-cloud.elinkservice.cn @@ -319,6 +357,17 @@ SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + + + https://jcytc.lzjczl.com:21009 + 2cy0a9lA + 6hU3PQgxLcXr27SE + + http://101.206.141.219:21006 + xSMONWwP + UUCnxLyXiB4eBF4p + + https://epmet-cloud.elinkservice.cn 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/BackDoorController.java b/epmet-auth/src/main/java/com/epmet/controller/BackDoorController.java index b87e071a50..d4edbb0b56 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/BackDoorController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/BackDoorController.java @@ -11,8 +11,8 @@ import java.util.Set; * @author jianjun liu * @date 2020-06-04 20:39 **/ -@RestController -@RequestMapping("opback") +//@RestController +//@RequestMapping("opback") public class BackDoorController { @Autowired private CustomerAppWxServiceUtil customerAppWxServiceUtil; diff --git a/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java b/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java index e096c6a65a..8a85cb9da4 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java @@ -1,19 +1,22 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.RSASignature; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.GovWebLoginFormDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.service.GovWebService; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + /** - * @Description PC工作端-登陆服务 * @author sun + * @Description PC工作端-登陆服务 */ @RestController @RequestMapping("govweb") @@ -21,7 +24,10 @@ public class GovWebController { @Autowired private GovWebService govWebService; - + @Value("${epmet.login.publicKey}") + private String publicKey; + @Value("${epmet.login.privateKey}") + private String privateKey; /** * @param formDTO @@ -32,8 +38,30 @@ public class GovWebController { @PostMapping("login") public Result workLogin(@RequestBody GovWebLoginFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); + + try { + if (formDTO.getPassword().length() > 50) { + String newPassword = RSASignature.decryptByPrivateKey(formDTO.getPassword(), privateKey); + formDTO.setPassword(newPassword); + } + + } catch (Exception e) { + e.printStackTrace(); + } return new Result().ok(govWebService.login(formDTO)); } + /** + * desc: 获取前端密码加密 公钥 + * + * @return com.epmet.commons.tools.utils.Result + * @author LiuJanJun + * @date 2021/3/8 5:07 下午 + */ + @PostMapping("getKey") + public Result getPubKey() { + return new Result().ok(publicKey); + } + } diff --git a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java index 45c8950d9c..f70495eb51 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java @@ -12,6 +12,7 @@ import com.epmet.dto.form.ResiWxPhoneFormDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.service.CaptchaService; import com.epmet.service.LoginService; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -28,6 +29,7 @@ import java.io.IOException; * @Author yinzuomei * @Date 2020/3/14 13:58 */ +@Slf4j @RestController @RequestMapping("login") public class LoginController { @@ -47,15 +49,20 @@ public class LoginController { **/ @GetMapping("captcha") public void captcha(HttpServletResponse response, String uuid) throws IOException { - //uuid不能为空 - AssertUtils.isBlank(uuid, ErrorCode.IDENTIFIER_NOT_NULL); - //生成图片验证码 - BufferedImage image = captchaService.create(uuid); - response.setHeader("Cache-Control", "no-store, no-cache"); - response.setContentType("image/jpeg"); - ServletOutputStream out = response.getOutputStream(); - ImageIO.write(image, "jpg", out); - out.close(); + try { + //uuid不能为空 + AssertUtils.isBlank(uuid, ErrorCode.IDENTIFIER_NOT_NULL); + //生成图片验证码 + BufferedImage image = captchaService.create(uuid); + response.reset(); + response.setHeader("Cache-Control", "no-store, no-cache"); + response.setContentType("image/jpeg"); + ServletOutputStream out = response.getOutputStream(); + ImageIO.write(image, "jpg", out); + out.close(); + } catch (IOException e) { + log.error("获取登陆验证码异常", e); + } } /** 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..6f19f29e62 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/controller/SsoController.java @@ -0,0 +1,92 @@ +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.SsoWorkLoginFormDTO; +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 ssoResiLogin(@RequestBody SsoLoginFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, SsoLoginFormDTO.SsoLoginForm.class); + return new Result().ok(ssoService.ssoResiLogin(formDTO)); + } + + /** + * @Description 0、第三方系统跳转至 运营平台登陆接口 + * @Param formDTO + * @author zxc + * @date 2021/1/18 下午4:59 + */ + @PostMapping("oper/third/login") + public Result thirdLoginOper(@RequestBody SsoLoginOperFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SsoLoginOperFormDTO.ThirdPlatformLoginForm.class); + return new Result().ok(ssoService.thirdLoginOperWork(formDTO)); + } + + @PostMapping("test") + public Result testssoLogin() { + ThirdPlatUserInfo userInfoByTicket = null; + try { + userInfoByTicket = jcetApiService.getCUserInfoByTicket("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 SsoWorkLoginFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, SsoWorkLoginFormDTO.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..d74deaf828 --- /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 {} + /** + * sso票据,有效期为300秒 + */ + @NotBlank(message = "ssotoken不能为空",groups = SsoWorkLoginFormDTO.SsoLoginForm.class) + private String token; + + /** + * 手机号 + */ + @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..2084287984 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginOperFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * @Author zxc + * @DateTime 2021/1/18 下午4:43 + */ +@Data +public class SsoLoginOperFormDTO extends LoginCommonFormDTO { + + private static final long serialVersionUID = -4215746830030486659L; + + public interface ThirdPlatformLoginForm { + } + + /** + * 上游系统token + */ + @NotBlank(message = "token不能为空", groups = {ThirdPlatformLoginForm.class}) + private String thirdToken; + + /** + * 上游系统标识 + * + * @see com.epmet.enums.ThirdPlatformEnum + */ + @NotBlank(message = "平台标识不能为空", groups = {ThirdPlatformLoginForm.class}) + private String platform; +} diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/SsoWorkLoginFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/SsoWorkLoginFormDTO.java new file mode 100644 index 0000000000..32ff9aa00b --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/SsoWorkLoginFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/18 下午4:43 + */ +@Data +public class SsoWorkLoginFormDTO implements Serializable { + + private static final long serialVersionUID = -6543952487970013031L; + + public interface SsoLoginForm{} + + /** + * sso票据,有效期为300秒 + */ + @NotBlank(message = "ssotoken不能为空",groups = SsoLoginForm.class) + private String token; + + /** + * 三方平台应用AppId + */ + @NotBlank(message = "三方平台应用AppId不能为空",groups = SsoLoginForm.class) + private String appId; + + /** + * app类型 resi;居民段,gov:工作端 + */ + @NotBlank(message = "app不能为空",groups = SsoLoginForm.class) + private String app; + + /** + * app;居民段,app:工作端 + */ + @NotBlank(message = "client不能为空",groups = SsoLoginForm.class) + private String client; +} diff --git a/epmet-auth/src/main/java/com/epmet/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..4cc9c93ba7 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/SsoService.java @@ -0,0 +1,47 @@ +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.form.SsoWorkLoginFormDTO; +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 ssoResiLogin(SsoLoginFormDTO formDTO); + + /** + * @param formDTO + * @Author sun + * @Description 1、ticket自动登录获取内部token + **/ + UserTokenResultDTO ssoWorkLogin(SsoWorkLoginFormDTO 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 thirdLoginOperWork(SsoLoginOperFormDTO formDTO); +} diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java index 9631436b98..bf0689b2b7 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -10,10 +10,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.GovWebLoginFormDTO; import com.epmet.dto.form.GovWebOperLoginFormDTO; -import com.epmet.dto.form.LoginByPassWordFormDTO; -import com.epmet.dto.form.PasswordLoginUserInfoFormDTO; import com.epmet.dto.result.GovWebOperLoginResultDTO; -import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.jwt.JwtTokenProperties; @@ -65,7 +62,7 @@ public class GovWebServiceImpl implements GovWebService { //2.验证码校验 boolean flag = captchaService.validate(formDTO.getUuid(), formDTO.getCaptcha()); if (!flag) { - logger.error(String.format("用户%s登录,验证码输入错误,暂时放行", formDTO.getPhone())); + logger.warn(String.format("用户%s登录,验证码输入错误", formDTO.getPhone())); //开启验证码校验 throw new RenException(EpmetErrorCode.ERR10019.getCode()); } @@ -84,7 +81,7 @@ public class GovWebServiceImpl implements GovWebService { //4.密码是否正确 //密码错误 if (!PasswordUtils.matches(formDTO.getPassword(), resultDTO.getPassWord())) { - logger.error("登陆密码错误"); + logger.warn("登陆密码错误"); throw new RenException(EpmetErrorCode.ERR10004.getCode()); } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java index adadb9b626..27f7e71fe5 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java @@ -293,9 +293,9 @@ public class LoginServiceImpl implements LoginService { //1、验证码是否正确 boolean flag = captchaService.validate(formDTO.getUuid(), formDTO.getCaptcha()); if (!flag) { - logger.error(String.format("用户%s登录,验证码输入错误,暂时放行",formDTO.getPhone())); - //2020-05-21去除验证码校验 TODO - //return new Result().error(EpmetErrorCode.ERR10019.getCode()); + logger.warn(String.format("用户%s登录,验证码输入错误", formDTO.getPhone())); + //2020-05-21去除验证码校验 + return new Result().error(EpmetErrorCode.ERR10019.getCode()); } //2、账号是否存在 //获取用户信息 diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java new file mode 100644 index 0000000000..3f77b56af1 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java @@ -0,0 +1,552 @@ +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.beans.factory.annotation.Value; +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; + + @Value("${epmet.third.urlPrefix}") + private String epmetThirdUrlPrefix; + + /** + * @Description 0、入口:得到token + * @Param formDTO + * @author zxc + * @date 2021/1/18 下午4:59 + */ + @Override + public SsoLoginResultDTO ssoResiLogin(SsoLoginFormDTO formDTO) { + String customerId = getCustomerId(formDTO.getAppId()); + //String customerId = "3a4f923665a7a07701bcb311aac9a156"; + 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.getCUserInfoByTicket(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 thirdLoginOperWork(SsoLoginOperFormDTO formDTO) { + ThirdPlatUserInfo thirdUser; + try { + ThirdPlatformEnum platformEnum = ThirdPlatformEnum.getEnum(formDTO.getPlatform()); + String apiService = platformEnum.getApiService(); + AbstractApiService apiServiceImpl = (AbstractApiService) SpringContextUtils.getBean(apiService); + thirdUser = apiServiceImpl.getGUserInfoBySSOToken(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 = epmetThirdUrlPrefix + "/api/third/customermp/getcustomermsg/"; + String data = HttpClientManager.getInstance().sendPostByJSON(customerMsgUrl + appId, JSON.toJSONString(jsonObject)).getData(); + log.info("调用third服务,根据appId查询客户信息:httpclient->url:" + customerMsgUrl + ",结果->" + data); + JSONObject toResult = JSON.parseObject(data); + 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(SsoWorkLoginFormDTO formDTO) { + + //1.根据appId查询客户id + String customerId = getCustomerId(formDTO.getAppId()); + //String customerId = "3a4f923665a7a07701bcb311aac9a156"; + + //2.客户Id换取第三方apiService,根据ticket换取华为Id + Result apiServiceResult = operCrmOpenFeignClient.getApiServiceByCustomerId(new ApiServiceFormDTO(customerId)); + 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.getGUserInfoBySSOToken(formDTO.getToken()); + } 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_APP); + 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 enterOrg】调用OperCrm获取ApiService接口失败:", apiServiceResult.getInternalMsg()); + } + if (apiServiceResult.getData() == null || StringUtils.isBlank(apiServiceResult.getData().getApiServiceName())) { + throw new RenException("【SSO enterOrg】调用OperCrm获取ApiService,查询到的结果为空:", apiServiceResult.toString()); + } + ThirdPlatUserInfo userInfo; + try { + AbstractApiService apiService = (AbstractApiService) SpringContextUtils.getBean(apiServiceResult.getData().getApiServiceName()); + userInfo = apiService.getGUserInfoBySSOToken(formDTO.getToken()); + } catch (Exception e) { + throw new RenException(e.getMessage()); + } + if (null == userInfo){ + throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), + "【SSO enterOrg】调用第三方平台查询用户信息失败,用户信息为空"); + } + + //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/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 9e50e6b796..d1cc70552e 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -86,7 +86,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { String token = this.generateToken(formDTO, userId); //4.存放Redis - this.saveTokenDto(formDTO, userId, userWechatDTO, token); + this.saveTokenDto(formDTO, userId, userWechatDTO, token, userWechatDTO.getCustomerId()); //5.接口返参 UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); @@ -111,9 +111,10 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { /** * @Description 将token存入redis **/ - private String saveTokenDto(LoginCommonFormDTO formDTO, String userId, UserWechatDTO userWechatDTO, String token) { + private String saveTokenDto(LoginCommonFormDTO formDTO, String userId, UserWechatDTO userWechatDTO, String token, String customerId) { int expire = jwtTokenProperties.getExpire(); TokenDto tokenDto = new TokenDto(); + tokenDto.setCustomerId(customerId); tokenDto.setApp(formDTO.getApp()); tokenDto.setClient(formDTO.getClient()); tokenDto.setUserId(userId); diff --git a/epmet-auth/src/main/resources/bootstrap.yml b/epmet-auth/src/main/resources/bootstrap.yml index d8526d89e6..edab1bde4e 100644 --- a/epmet-auth/src/main/resources/bootstrap.yml +++ b/epmet-auth/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /auth @@ -126,3 +127,33 @@ dingTalk: robot: webHook: @dingTalk.robot.webHook@ secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 + +# 调用第三方平台相关参数 +thirdplat: + jcetCend: + domain: @thirdplat.jcet.c.domain@ + appkey: @thirdplat.jcet.c.appkey@ + appsecret: @thirdplat.jcet.c.appsecret@ + jcetGend: + domain: @thirdplat.jcet.g.domain@ + appkey: @thirdplat.jcet.g.appkey@ + appsecret: @thirdplat.jcet.g.appsecret@ + pyld: + domain: https://epmet-ext9.elinkservice.cn/platform + appId: 7a5aec009ba4eba8e254ee64fe3775e1 + appKey: 14faef9af508d1c253b720ea5a43f9de + appSecret: 38e7c2604c8dd33c445705d25eebbfc12a2f7ed8a87111e9e10a40312d3a1595 + +epmet: + login: + publicKey: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAKjgDaHWqWgquoatbC4zzQCgqE8C425VIOyzJVVgH1HUYCHpuNUnGCv3HBAl2RsziWQqQgd1xxl0C3a5J4J69o8CAwEAAQ== + privateKey: MIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEAqOANodapaCq6hq1sLjPNAKCoTwLjblUg7LMlVWAfUdRgIem41ScYK/ccECXZGzOJZCpCB3XHGXQLdrkngnr2jwIDAQABAkAyYaWvgrtHuHetdk+v+QRQC54q9FGluP/5nfilX+f4IUf8j92o/ZohTtmJn9qcDiAP4wxCLIsfy4IW3psST78BAiEA0A/E0WvtI7spWnjfw+wMDhdVMIbIJvDbj/cqMwRZInUCIQDPyO2sbXpwDjmAvyn0jpGJJxU5POWYdI37rTf9fScMcwIhAMkWNHbjBHKANVuHb10ACjakPmWEHnXkW5AspdBg53TxAiARPbzq99KXBbcjxbj3f/T3inSqYTEz60f0wDTLJd1dnQIhAIFe6Jd1TduIxGk1PDh/b/3q0jNGgVXkFnUBnKWDaL9N + # third服务的相关配置 + third: + urlPrefix: @epmet.third.urlprefix@ diff --git a/epmet-auth/src/main/resources/logback-spring.xml b/epmet-auth/src/main/resources/logback-spring.xml index 734c4114a1..0152e72505 100644 --- a/epmet-auth/src/main/resources/logback-spring.xml +++ b/epmet-auth/src/main/resources/logback-spring.xml @@ -139,7 +139,7 @@ - + diff --git a/epmet-commons/epmet-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-mybatis/src/main/java/com/epmet/commons/mybatis/service/BaseService.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/service/BaseService.java index a42cd2ca84..c82dce8253 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/service/BaseService.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/service/BaseService.java @@ -122,4 +122,6 @@ public interface BaseService { * @param idList 主键ID列表 */ boolean deleteBatchIds(Collection idList); + + } diff --git a/epmet-commons/epmet-commons-rocketmq/pom.xml b/epmet-commons/epmet-commons-rocketmq/pom.xml new file mode 100644 index 0000000000..a3761c000f --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/pom.xml @@ -0,0 +1,21 @@ + + + + epmet-commons + com.epmet + 2.0.0 + + 4.0.0 + + epmet-commons-rocketmq + + + + org.apache.rocketmq + rocketmq-spring-boot-starter + 2.0.1 + + + \ No newline at end of file diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java new file mode 100644 index 0000000000..9c332a6626 --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/ConsomerGroupConstants.java @@ -0,0 +1,21 @@ +package com.epmet.commons.rocketmq.constants; + +/** + * 消费者组常量 + */ +public interface ConsomerGroupConstants { + + /** + * 初始化客户角色消费者组 + */ + String INIT_CUSTOMER_ROLES_GROUP = "init_customer_roles_group"; + /** + * 初始化客户自定义消费者组 + */ + String INIT_CUSTOMER_COMPONENTS_GROUP = "init_customer_components_group"; + /** + * 初始化客户组织机构信息分组 + */ + String INIT_CUSTOMER_ORG_ROLES_GROUP = "init_customer_org_roles_group"; + +} diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java new file mode 100644 index 0000000000..7687136498 --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/constants/TopicConstants.java @@ -0,0 +1,5 @@ +package com.epmet.commons.rocketmq.constants; + +public interface TopicConstants { + String INIT_CUSTOMER = "init_customer"; +} diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/InitCustomerMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/InitCustomerMQMsg.java new file mode 100644 index 0000000000..104d77581c --- /dev/null +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/InitCustomerMQMsg.java @@ -0,0 +1,148 @@ +package com.epmet.commons.rocketmq.messages; + +public class InitCustomerMQMsg { + + private String customerId; + + private InitCustomerAgency agency; + + private InitCustomerStaff staff; + + public static class InitCustomerStaff { + private String agencyId; + private Integer gender; + private String mobile; + private String name; + private String workType; + + public String getAgencyId() { + return agencyId; + } + + public void setAgencyId(String agencyId) { + this.agencyId = agencyId; + } + + public Integer getGender() { + return gender; + } + + public void setGender(Integer gender) { + this.gender = gender; + } + + public String getMobile() { + return mobile; + } + + public void setMobile(String mobile) { + this.mobile = mobile; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getWorkType() { + return workType; + } + + public void setWorkType(String workType) { + this.workType = workType; + } + } + + public static class InitCustomerAgency { + private String agencyId; + private String organizationName; + private String level; + private String areaCode; + private String province; + private String city; + private String district; + + public String getAgencyId() { + return agencyId; + } + + public void setAgencyId(String agencyId) { + this.agencyId = agencyId; + } + + public String getOrganizationName() { + return organizationName; + } + + public void setOrganizationName(String organizationName) { + this.organizationName = organizationName; + } + + public String getLevel() { + return level; + } + + public void setLevel(String level) { + this.level = level; + } + + public String getAreaCode() { + return areaCode; + } + + public void setAreaCode(String areaCode) { + this.areaCode = areaCode; + } + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getDistrict() { + return district; + } + + public void setDistrict(String district) { + this.district = district; + } + } + + public String getCustomerId() { + return customerId; + } + + public void setCustomerId(String customerId) { + this.customerId = customerId; + } + + public InitCustomerAgency getAgency() { + return agency; + } + + public void setAgency(InitCustomerAgency agency) { + this.agency = agency; + } + + public InitCustomerStaff getStaff() { + return staff; + } + + public void setStaff(InitCustomerStaff staff) { + this.staff = staff; + } +} 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..1b874efc82 --- /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("ssoTicket-jGOAW66udmRtUWBKgs3q7k1w7prGxd5I"); + + 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..aa59cf52ef --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/AbstractApiService.java @@ -0,0 +1,52 @@ +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 getCUserInfoByTicket(String ticket) throws Exception; + + /** + * G端用户token获取用户信息 + * @param token + * @return + * @throws Exception + */ + public abstract ThirdPlatUserInfo getGUserInfoBySSOToken(String token) 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..f499156947 --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/jcet/JcetApiService.java @@ -0,0 +1,147 @@ +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.JcetCUserInfoResultDTO; +import com.epmet.commons.thirdplat.dto.result.jcet.JcetGUserInfoResultDTO; +import com.epmet.commons.thirdplat.encrypt.SignUtils; +import com.epmet.commons.thirdplat.properties.JcetThirdplatProps; +import com.epmet.commons.thirdplat.properties.ThirdplatProps; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import java.io.UnsupportedEncodingException; +import java.util.HashMap; +import java.util.Map; + +public class JcetApiService extends AbstractApiService { + + Logger logger = LoggerFactory.getLogger(getClass()); + + private JcetThirdplatProps jcetThirdplatCendProps; + private JcetThirdplatProps jcetThirdplatGendProps; + + public JcetApiService(ThirdplatProps props) { + this.thirdplatProps = props; + jcetThirdplatCendProps = props.getJcetCend(); + jcetThirdplatGendProps = props.getJcetGend(); + } + + /** + * @return + * @Description 通过第三方平台ticket获取用户信息 + * @author wxz + * @date 2021.01.19 10:26 + */ + public ThirdPlatUserInfo getCUserInfoByTicket(String ticket) throws UnsupportedEncodingException { + + logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口开始>>>>>>>>>>>>"); + logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口入参 ticket:{}", ticket); + + SsoTicketFormDTO ssoTicket = new SsoTicketFormDTO(); + ssoTicket.setSsoTicket(ticket); + + String domain = jcetThirdplatCendProps.getDomain(); + Result result = HttpClientManager.getInstance().sendPost( + domain.concat(JcetConstants.URL_GET_USER_BY_TICKET), + domain.startsWith("https://"), + JSON.toJSONString(ssoTicket), + getHeaders(JSON.toJSONString(ssoTicket).getBytes("utf-8").length, jcetThirdplatCendProps.getAppkey(), jcetThirdplatCendProps.getAppsecret())); + + try { + logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口返回:{}", result.getData()); + } catch (Exception e) { + //e.printStackTrace(); + } + logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口结束<<<<<<<<<<<<"); + + JcetCUserInfoResultDTO resultDTO = parseResult(result, JcetCUserInfoResultDTO.class); + + ThirdPlatUserInfo userInfo = new ThirdPlatUserInfo(); + userInfo.setOpenId(resultDTO.getId()); + userInfo.setName(resultDTO.getName()); + userInfo.setMobile(resultDTO.getMobile()); + return userInfo; + } + + @Override + public ThirdPlatUserInfo getGUserInfoBySSOToken(String token) throws Exception { + + logger.info("【请求酒城e通第三方平台】getGUserInfoBySSOToken()接口开始>>>>>>>>>>>>"); + logger.info("【请求酒城e通第三方平台】getGUserInfoBySSOToken()接口入参 ticket:{}", token); + + HashMap params = new HashMap<>(); + params.put("ssoToken",token); + + String domain = jcetThirdplatGendProps.getDomain(); + Result result = HttpClientManager.getInstance().sendGet( + domain.concat(JcetConstants.URL_GET_USER_BY_TOKEN), + domain.startsWith("https://"), + params, + getHeaders(0, jcetThirdplatGendProps.getAppkey(), jcetThirdplatGendProps.getAppsecret())); + + try { + logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口返回:{}", result.getData()); + } catch (Exception e) { + //e.printStackTrace(); + } + logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口结束<<<<<<<<<<<<"); + + JcetGUserInfoResultDTO resultDTO = parseResult(result, JcetGUserInfoResultDTO.class); + + ThirdPlatUserInfo userInfo = new ThirdPlatUserInfo(); + userInfo.setOpenId(resultDTO.getUid()); + userInfo.setName(resultDTO.getName()); + userInfo.setMobile(resultDTO.getMobile()); + return userInfo; + } + + /** + * @return + * @Description 通过token获取用户信息 + * @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; + //} + + /** + * 获取请求所需要的头信息 + * + * @return + * @throws UnsupportedEncodingException + */ + private Map getHeaders(int bodyLength, String appKey, String appSecret) throws UnsupportedEncodingException { + + Map headers = new HashMap(); + long timestamp = System.currentTimeMillis(); + headers.put(JcetConstants.PLAT_HEADER_OPEN_TIMESTAMP, timestamp); + headers.put(JcetConstants.PLAT_HEADER_OPEN_APP_ID, appKey); + String encryptContent = appKey + timestamp + bodyLength; + headers.put(JcetConstants.PLAT_HEADER_OPEN_SIGN, SignUtils.generate(encryptContent, appSecret)); + 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..b5307c2951 --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/pyld/PyldApiService.java @@ -0,0 +1,128 @@ +package com.epmet.commons.thirdplat.apiservice.pyld; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.thirdplat.apiservice.AbstractApiService; +import com.epmet.commons.thirdplat.bean.ThirdPlatUserInfo; +import com.epmet.commons.thirdplat.constants.PyldConstants; +import com.epmet.commons.thirdplat.dto.result.jcet.PyldUserInfoResultDTO; +import com.epmet.commons.thirdplat.properties.PyldThirdplatProps; +import com.epmet.commons.thirdplat.properties.ThirdplatProps; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; + +/** + * desc: 平阴联动指挥平台sso登陆服务类 接入文档:http://note.youdao.com/noteshare?id=167ad65365f9eccf7925e8c2629d2021&sub=555AE50510344CB5AACD5C06B9AA3B3B + * + * @author LiuJanJun + * @date 2021/2/25 1:43 下午 + */ +@Service +public class PyldApiService extends AbstractApiService { + + Logger logger = LoggerFactory.getLogger(getClass()); + + private PyldThirdplatProps pyldThirdplatProps; + + public PyldApiService(ThirdplatProps props) { + this.thirdplatProps = props; + pyldThirdplatProps = props.getPyld(); + } + + @Override + public ThirdPlatUserInfo getCUserInfoByTicket(String ticket) throws Exception { + return null; + } + + /** + * @return + * @Description 通过第三方平台ticket获取用户信息 + * @author wxz + * @date 2021.01.19 10:26 + */ + @Override + public ThirdPlatUserInfo getGUserInfoBySSOToken(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/JcetCUserInfoResultDTO.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetCUserInfoResultDTO.java new file mode 100644 index 0000000000..765126025d --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetCUserInfoResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.commons.thirdplat.dto.result.jcet; + +import lombok.Data; + +@Data +public class JcetCUserInfoResultDTO { + 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/JcetGUserInfoResultDTO.java b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetGUserInfoResultDTO.java new file mode 100644 index 0000000000..24f2faf27c --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/JcetGUserInfoResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.commons.thirdplat.dto.result.jcet; + +import lombok.Data; + +@Data +public class JcetGUserInfoResultDTO { + private String uid; + /** + * 手机号码 + */ + private String mobile; + /** + * 姓名 + */ + private String name; + /** + * 账号 + */ + private String account; + + /** + * 用户编码 + */ + private String code; +} 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/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..441d1f0839 --- /dev/null +++ b/epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/ThirdplatProps.java @@ -0,0 +1,21 @@ +package com.epmet.commons.thirdplat.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +@Data +@ConfigurationProperties(prefix = "thirdplat") +public class ThirdplatProps { + + // C端 + private JcetThirdplatProps jcetCend; + + // G端 + private JcetThirdplatProps jcetGend; + + /** + * 平阴联动指挥平台 + */ + private PyldThirdplatProps pyld; + +} diff --git a/epmet-commons/epmet-commons-tools/pom.xml b/epmet-commons/epmet-commons-tools/pom.xml index e2fd786edf..10b76c6f11 100644 --- a/epmet-commons/epmet-commons-tools/pom.xml +++ b/epmet-commons/epmet-commons-tools/pom.xml @@ -149,6 +149,11 @@ commons-httpclient 3.1 + + + com.aliyun + alibaba-dingtalk-service-sdk + diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ApplicationFailedEventListener.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ApplicationFailedEventListener.java new file mode 100644 index 0000000000..5c219ab095 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ApplicationFailedEventListener.java @@ -0,0 +1,84 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.commons.tools.aspect; + +import com.alibaba.fastjson.JSON; +import com.dingtalk.api.DefaultDingTalkClient; +import com.dingtalk.api.DingTalkClient; +import com.dingtalk.api.request.OapiRobotSendRequest; +import com.dingtalk.api.response.OapiRobotSendResponse; +import com.epmet.commons.tools.enums.EnvEnum; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.taobao.api.ApiException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.event.ApplicationFailedEvent; +import org.springframework.cloud.commons.util.InetUtils; +import org.springframework.context.ApplicationListener; +import org.springframework.stereotype.Component; + +/** + * 应用 启动健康检查 通知类 + * CustomerApplicationRunner + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Component +public class ApplicationFailedEventListener implements ApplicationListener { + private static Logger logger = LogManager.getLogger(ApplicationFailedEventListener.class); + @Value("${spring.application.name}") + private String appName; + @Value("${server.version}") + private String version; + + @Override + public void onApplicationEvent(ApplicationFailedEvent applicationFailedEvent) { + Throwable exception = applicationFailedEvent.getException(); + EnvEnum currentEnv = EnvEnum.getCurrentEnv(); + logger.info(currentEnv); + if (!EnvEnum.DEV.getCode().equals(currentEnv.getCode()) && !EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())) { + sendDingMarkDownMsg(exception); + } + } + + + private String getServerIp() { + InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class); + return inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + } + + private void sendDingMarkDownMsg(Throwable exception) { + DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/robot/send?access_token=ffd7c972b0525e249283df1a16b65a8b9d0012601f3a458dfc588c2eac497bb5"); + OapiRobotSendRequest request = new OapiRobotSendRequest(); + request.setMsgtype("markdown"); + OapiRobotSendRequest.Markdown markdown = new OapiRobotSendRequest.Markdown(); + markdown.setTitle("部署失败通知"); + + markdown.setText("部署失败通知 \n" + + "> 服务:" + appName + "\n\n" + + "> 版本:" + version + "\n\n" + + "> 环境:" + EnvEnum.getCurrentEnv().getName() + "\n\n" + + "> IP: " + getServerIp() + "\n\n" + + "> 异常:" + exception.getMessage() + "\n\n" + ); + request.setMarkdown(markdown); + OapiRobotSendRequest.At at = new OapiRobotSendRequest.At(); + at.setIsAtAll(true); + request.setAt(at); + try { + OapiRobotSendResponse execute = client.execute(request); + logger.info("=====通知结果===>" + JSON.toJSONString(execute)); + } catch (ApiException e) { + logger.error("sendDingMarkDownMsg exception", e); + } + } + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ApplicationReadyEventListener.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ApplicationReadyEventListener.java new file mode 100644 index 0000000000..901163e7ac --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/ApplicationReadyEventListener.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.commons.tools.aspect; + +import com.alibaba.fastjson.JSON; +import com.dingtalk.api.DefaultDingTalkClient; +import com.dingtalk.api.DingTalkClient; +import com.dingtalk.api.request.OapiRobotSendRequest; +import com.dingtalk.api.response.OapiRobotSendResponse; +import com.epmet.commons.tools.dto.form.DingTalkTextMsg; +import com.epmet.commons.tools.enums.EnvEnum; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.taobao.api.ApiException; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.context.event.ApplicationReadyEvent; +import org.springframework.cloud.commons.util.InetUtils; +import org.springframework.context.ApplicationListener; +import org.springframework.stereotype.Component; + +/** + * 应用 启动健康检查 通知类 + * CustomerApplicationRunner + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Component +public class ApplicationReadyEventListener implements ApplicationListener { + private static Logger logger = LogManager.getLogger(ApplicationReadyEventListener.class); + @Value("${spring.application.name}") + private String appName; + @Value("${server.version}") + private String version; + + @Override + public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) { + EnvEnum currentEnv = EnvEnum.getCurrentEnv(); + logger.info(currentEnv); + if (!EnvEnum.DEV.getCode().equals(currentEnv.getCode()) && !EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())) { + //sendDingTextMsg(); + sendDingMarkDownMsg(); + } + } + + private void sendDingTextMsg() { + //发送启动成功消息 + InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class); + String serverIp = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + + //开发小组 群机器人地址 + String url = "https://oapi.dingtalk.com/robot/send?access_token=ffd7c972b0525e249283df1a16b65a8b9d0012601f3a458dfc588c2eac497bb5"; + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append(EnvEnum.getCurrentEnv().getName()) + .append("【") + .append(appName) + .append("】") + .append("ip地址: ") + .append(serverIp) + .append("部署完毕!"); + DingTalkTextMsg msg = new DingTalkTextMsg(); + msg.setWebHook(url); + msg.setAtAll(true); + msg.setContent(stringBuilder.toString()); + Result stringResult = HttpClientManager.getInstance().sendPostByJSON(url, msg.getMsgContent()); + logger.info(stringResult); + } + + private String getServerIp() { + InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class); + return inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); + } + + private void sendDingMarkDownMsg() { + DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/robot/send?access_token=ffd7c972b0525e249283df1a16b65a8b9d0012601f3a458dfc588c2eac497bb5"); + OapiRobotSendRequest request = new OapiRobotSendRequest(); + request.setMsgtype("markdown"); + OapiRobotSendRequest.Markdown markdown = new OapiRobotSendRequest.Markdown(); + markdown.setTitle("部署成功通知"); + + markdown.setText("部署成功通知 \n" + + "> 服务:" + appName + "\n\n" + + "> 版本:" + version + "\n\n" + + "> 环境:" + EnvEnum.getCurrentEnv().getName() + "\n\n" + + "> IP: " + getServerIp() + "\n\n" + ); + request.setMarkdown(markdown); + OapiRobotSendRequest.At at = new OapiRobotSendRequest.At(); + at.setIsAtAll(true); + request.setAt(at); + try { + OapiRobotSendResponse execute = client.execute(request); + logger.info("=====通知结果===>" + JSON.toJSONString(execute)); + } catch (ApiException e) { + logger.error("sendDingMarkDownMsg exception", e); + } + } + + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java index 8dd819e4b7..4b3496ee36 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java @@ -1,6 +1,7 @@ package com.epmet.commons.tools.aspect; import com.epmet.commons.tools.constant.AppClientConstant; +import com.epmet.commons.tools.constant.ThreadLocalConstant; import com.epmet.commons.tools.exception.*; import com.epmet.commons.tools.utils.Result; import org.apache.commons.lang3.StringUtils; @@ -12,6 +13,7 @@ import org.springframework.dao.DuplicateKeyException; import javax.servlet.http.HttpServletRequest; import java.time.Duration; import java.time.LocalDateTime; +import java.util.Arrays; /** * 日志切面 @@ -61,12 +63,18 @@ public abstract class BaseRequestLogAspect { try { Object[] args = point.getArgs(); + ThreadLocalConstant.requestParam.set(Arrays.toString(point.getArgs())); log.info(">>>>>>>>请求信息>>>>>>>>:事务流水号:{},url:{} ,method:{},请求参数:{}", transactionSerial, requestURI, method, objectsToString(args)); result = point.proceed(); resultInfoLog(transactionSerial, getExecPeriod(startTime), result); } catch (RenException e) { result = handleRenException(e); - resultErrorLog(transactionSerial, getExecPeriod(startTime), result, e.getInternalMsg(), ExceptionUtils.getErrorStackTrace(e)); + if (e.getCode() > 8000) { + resultWarnLog(transactionSerial, getExecPeriod(startTime), result, e.getInternalMsg(), ExceptionUtils.getErrorStackTrace(e)); + } else { + resultErrorLog(transactionSerial, getExecPeriod(startTime), result, e.getInternalMsg(), ExceptionUtils.getErrorStackTrace(e)); + } + return result; } catch (ValidateException e) { result = handleValidateException(e); resultErrorLog(transactionSerial, getExecPeriod(startTime), result, e.getMsg(), ExceptionUtils.getErrorStackTrace(e)); @@ -95,7 +103,7 @@ public abstract class BaseRequestLogAspect { } /** - * 异常信息 + * 异常错误级别日志 * @param transactionSerial * @param execTimeMillis * @param result @@ -107,6 +115,19 @@ public abstract class BaseRequestLogAspect { transactionSerial, execTimeMillis, result == null ? result : result.toString(), exceptionMsg, exceptionDetail); } + /** + * 异常警告级别日志 + * @param transactionSerial + * @param execTimeMillis + * @param result + * @param exceptionMsg + * @param exceptionDetail + */ + private void resultWarnLog(String transactionSerial, Long execTimeMillis, Object result, String exceptionMsg, String exceptionDetail) { + log.warn("<<<<<<<<异常响应<<<<<<<<:事务流水号:{}, 执行时长:{}ms, 响应数据:{}, 异常信息:{}, 堆栈信息:{}", + transactionSerial, execTimeMillis, result == null ? result : result.toString(), exceptionMsg, exceptionDetail); + } + /** * 计算执行周期 * @param startTime diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java deleted file mode 100644 index 4500453213..0000000000 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/CustomerApplicationRunner.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) 2018 人人开源 All rights reserved. - *

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

- * 版权所有,侵权必究! - */ - -package com.epmet.commons.tools.aspect; - -import com.epmet.commons.tools.dto.form.DingTalkTextMsg; -import com.epmet.commons.tools.enums.EnvEnum; -import com.epmet.commons.tools.utils.HttpClientManager; -import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.utils.SpringContextUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.ApplicationArguments; -import org.springframework.boot.ApplicationRunner; -import org.springframework.cloud.commons.util.InetUtils; -import org.springframework.core.annotation.Order; -import org.springframework.stereotype.Component; - -/** - * 应用 启动健康检查 通知类 - * CustomerApplicationRunner - * - * @author Mark sunlightcs@gmail.com - * @since 1.0.0 - */ -@Component -@Order(value = 99) -public class CustomerApplicationRunner implements ApplicationRunner { - private static Logger logger = LogManager.getLogger(CustomerApplicationRunner.class); - @Value("${spring.application.name}") - private String appName; - - @Override - public void run(ApplicationArguments args) { - //发送启动成功消息 - EnvEnum currentEnv = EnvEnum.getCurrentEnv(); - logger.info(currentEnv); - if (!EnvEnum.DEV.getCode().equals(currentEnv.getCode()) && !EnvEnum.LOCAL.getCode().equals(currentEnv.getCode())) { - InetUtils inetUtils = SpringContextUtils.getBean(InetUtils.class); - String serverIp = inetUtils.findFirstNonLoopbackHostInfo().getIpAddress(); - - //开发小组 群机器人地址 - String url = "https://oapi.dingtalk.com/robot/send?access_token=ffd7c972b0525e249283df1a16b65a8b9d0012601f3a458dfc588c2eac497bb5"; - StringBuilder stringBuilder = new StringBuilder(); - stringBuilder.append(EnvEnum.getCurrentEnv().getName()) - .append("【") - .append(appName) - .append("】") - .append("ip地址: ") - .append(serverIp) - .append("部署完毕!"); - DingTalkTextMsg msg = new DingTalkTextMsg(); - msg.setWebHook(url); - msg.setAtAll(true); - msg.setContent(stringBuilder.toString()); - Result stringResult = HttpClientManager.getInstance().sendPostByJSON(url, msg.getMsgContent()); - logger.info(stringResult); - } - } - -} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/RequirePermissionAspect.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/RequirePermissionAspect.java index 3b5858b805..da3cab475e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/RequirePermissionAspect.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/RequirePermissionAspect.java @@ -11,9 +11,6 @@ package com.epmet.commons.tools.aspect; import com.epmet.commons.tools.annotation.RequirePermission; import com.epmet.commons.tools.constant.ThreadLocalConstant; import com.epmet.commons.tools.dto.form.HasSpecifiedPermissionFormDTO; -import com.epmet.commons.tools.dto.form.LoginUserInfoFormDTO; -import com.epmet.commons.tools.dto.form.LoginUserInfoResultDTO; -import com.epmet.commons.tools.dto.form.RoleOpeScopeResultDTO; import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; @@ -30,11 +27,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - /** * 每次请求,过滤Api中配置的权限key出来,并且判断是否具有该功能权限 * @Author wxz @@ -89,8 +81,9 @@ public class RequirePermissionAspect { throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); } Boolean data = result.getData(); + if (data == null || !data) { - log.error("操作权限不足"); + log.warn("操作权限不足,key:{}", requirePermission); throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode()); } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownConfig.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownConfig.java new file mode 100644 index 0000000000..143fce4f7f --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownConfig.java @@ -0,0 +1,24 @@ +package com.epmet.commons.tools.config.shutdown; + +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; +import org.springframework.boot.web.servlet.server.ServletWebServerFactory; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * 优雅停机配置 + * matchIfMissing:当缺少shutdown.graceful.enable配置的时候,是否加载该配置类。true:缺少也加载,false:默认的,缺少配置不加载,即不生效 + */ +@Configuration +@ConditionalOnProperty(prefix = "shutdown.graceful", name = "enable", havingValue = "true", matchIfMissing = false) +public class GracefulShutdownConfig { + + @Bean + public ServletWebServerFactory servletContainer(GracefulShutdownTomcat gracefulShutdownTomcat) { + TomcatServletWebServerFactory tomcat = new TomcatServletWebServerFactory(); + tomcat.addConnectorCustomizers(gracefulShutdownTomcat); + return tomcat; + } + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownTomcat.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownTomcat.java new file mode 100644 index 0000000000..58ac781efe --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/GracefulShutdownTomcat.java @@ -0,0 +1,52 @@ +package com.epmet.commons.tools.config.shutdown; + +import org.apache.catalina.connector.Connector; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer; +import org.springframework.context.ApplicationListener; +import org.springframework.context.event.ContextClosedEvent; +import org.springframework.stereotype.Component; + +import java.util.concurrent.Executor; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +@EnableConfigurationProperties(ShutdownProperties.class) +@Component +@ConditionalOnProperty(prefix = "shutdown.graceful", name = "enable", havingValue = "true", matchIfMissing = false) +public class GracefulShutdownTomcat implements TomcatConnectorCustomizer, ApplicationListener { + + private static final Logger logger = LoggerFactory.getLogger(GracefulShutdownTomcat.class); + + @Autowired + private ShutdownProperties shutdownProperties; + + private volatile Connector connector; + + @Override + public void customize(Connector connector) { + this.connector = connector; + } + @Override + public void onApplicationEvent(ContextClosedEvent contextClosedEvent) { + this.connector.pause(); + Executor executor = this.connector.getProtocolHandler().getExecutor(); + long waitTimeSecs = shutdownProperties.getGraceful().getWaitTimeSecs(); + if (executor instanceof ThreadPoolExecutor) { + try { + ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executor; + threadPoolExecutor.shutdown(); + if (!threadPoolExecutor.awaitTermination(waitTimeSecs, TimeUnit.SECONDS)) { + String msg = String.format("Tomcat在【%s】秒内优雅停机失败,请手动处理", waitTimeSecs); + logger.error(msg); + } + } catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + } + } + } +} \ No newline at end of file diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/ShutdownProperties.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/ShutdownProperties.java new file mode 100644 index 0000000000..1561f197be --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/config/shutdown/ShutdownProperties.java @@ -0,0 +1,17 @@ +package com.epmet.commons.tools.config.shutdown; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +@ConfigurationProperties(prefix = "shutdown") +@Data +public class ShutdownProperties { + + private GracefulShutdownProperties graceful; + + @Data + public static class GracefulShutdownProperties { + private long waitTimeSecs = 30; + } + +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index 59e3ce4bdc..a9cc07d7a4 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -26,6 +26,7 @@ public interface NumConstant { int TEN = 10; int ELEVEN = 11; int TWELVE = 12; + int THIRTEEN = 13; int SEVENTEEN = 17; int FIFTEEN = 15; int FOURTEEN=14; diff --git a/epmet-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/constant/StrConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java index 03233b7c47..41302f5e32 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/StrConstant.java @@ -81,4 +81,6 @@ public interface StrConstant { String MIN="MIN"; String MAX="MAX"; + + String SPECIAL_CUSTOMER = "150282ed25c14ff0785e7e06283b6283"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ThreadLocalConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ThreadLocalConstant.java index 2dad0d6dba..6a2b304cfa 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ThreadLocalConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ThreadLocalConstant.java @@ -1,7 +1,5 @@ package com.epmet.commons.tools.constant; -import com.epmet.commons.tools.dto.form.LoginUserInfoResultDTO; - /** * ThreadLocal常亮 */ @@ -16,4 +14,9 @@ public class ThreadLocalConstant { * 用于向DataFilterInterceptor传递权限过滤的sql片段(需要在Controller相关的AOP中进行清理,防止变量残留) */ public static final ThreadLocal sqlFilter = new ThreadLocal(); + + /** + * 用于本次的获取请求参数 + */ + public static final ThreadLocal requestParam = new ThreadLocal(); } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/DistributedLock.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/DistributedLock.java index 6bfb25fe48..85a2e61c84 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/DistributedLock.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/distributedlock/DistributedLock.java @@ -37,21 +37,21 @@ public class DistributedLock { } /** - * @Description - * @Param name 锁名 - * @Param leaseTime 持锁时间 单位:min - * @Param waitTime 获取锁最长等待时间 单位:min - * @author zxc - * @date 2020/10/29 9:04 上午 + * 取锁 + * @param name 锁key + * @param leaseTime 持有锁的时长 + * @param waitTime 取锁等待时长 + * @param timeUnit 持锁时长的时间单位 + * @return */ - public RLock getLock(String name,Long leaseTime,Long waitTime){ + public RLock getLock(String name, Long leaseTime, Long waitTime, TimeUnit timeUnit) { RLock lock = null; - if (StringUtils.isNotBlank(name) && leaseTime > 0 && waitTime > 0 ){ + if (StringUtils.isNotBlank(name) && leaseTime > 0 && waitTime > 0) { lock = redissonClient.getLock(name); Boolean lockStatus; try { - lockStatus = lock.tryLock(waitTime,leaseTime,TimeUnit.MINUTES); - if (!lockStatus){ + lockStatus = lock.tryLock(waitTime, leaseTime, timeUnit); + if (!lockStatus) { throw new RenException("获取锁🔒失败了......"); } } catch (InterruptedException e) { @@ -62,14 +62,14 @@ public class DistributedLock { } /** - * @Description 释放锁🔒 + * @Description 释放锁🔒 * @Param rLock * @author zxc * @date 2020/10/28 2:52 下午 */ - public void unLock(RLock rLock){ - if (null != rLock){ - if (rLock.isHeldByCurrentThread()){ + public void unLock(RLock rLock) { + if (null != rLock) { + if (rLock.isHeldByCurrentThread()) { rLock.unlock(); } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java index ec14e7c812..6f371a1e09 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/mq/eventmsg/BasePointEventMsg.java @@ -3,6 +3,7 @@ package com.epmet.commons.tools.dto.form.mq.eventmsg; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * desc:积分相关事件消息体 @@ -57,4 +58,15 @@ public class BasePointEventMsg implements Serializable { * 业务id eg:活动id */ private String sourceId; -} + + /** + * 计算积分上限时的计算日期,可以为空 + * 场景: 通过分享链接申请入组,在组长审核完成后要给邀请人添加积分,若被邀请人是已注册居民, + * 给邀请人添加积分有上限,计算上限的日期不能是组长审核的日期,而是被邀请人发送入组审核的日期 + * 对应的事件编码为:invite_resident_into_group + * 只针对[邀请已注册的用户入组]事件生效 + */ + private Date targetDate; + + private String eventTag; + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java index d0df724665..31d5faaa34 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java @@ -11,11 +11,14 @@ import org.springframework.core.env.Environment; * @date 2020-07-03 11:14 **/ public enum EnvEnum { - LOCAL("local", "本地环境","http://localhost:8080/api/"), - DEV("dev", "开发环境","http://192.168.1.130:8080/api/"), - TEST("test", "体验环境","https://epmet-dev.elinkservice.cn/api/"), - PROD("prod", "生产环境","https://epmet-cloud.elinkservice.cn/api/"), - UN_KNOWN("un_known", "未知","https://epmet-dev.elinkservice.cn/api/"), + /** + * 环境变量枚举 + */ + LOCAL("local", "本地环境", "http://localhost:8080/api/"), + DEV("dev", "开发环境", "http://192.168.1.130:8080/api/"), + TEST("test", "体验环境", "https://epmet-dev.elinkservice.cn/api/"), + PROD("prod", "生产环境", "https://epmet-cloud.elinkservice.cn/api/"), + UN_KNOWN("un_known", "未知", "https://epmet-dev.elinkservice.cn/api/"), ; private String code; @@ -33,7 +36,7 @@ public enum EnvEnum { public static EnvEnum getEnum(String code) { EnvEnum[] values = EnvEnum.values(); for (EnvEnum value : values) { - if (code != null && value.getCode().equals(code)) { + if (value.getCode().equals(code)) { return value; } } @@ -44,7 +47,7 @@ public enum EnvEnum { try { Environment environment = SpringContextUtils.getBean(Environment.class); String[] activeProfiles = environment.getActiveProfiles(); - if (activeProfiles != null && activeProfiles.length > 0) { + if (activeProfiles.length > 0) { return getEnum(activeProfiles[0]); } } catch (Exception e) { diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java index 68347c29f9..c1409342d6 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EventEnum.java @@ -10,6 +10,13 @@ public enum EventEnum { ACTIVE_SEND_POINT("active_send_point", "epmet_heart", "活动发放积分"), REGISTER_VOLUNTEER("register_volunteer", "epmet_heart", "认证志愿者"), ACTIVE_INSERT_LIVE("active_insert_live", "epmet_heart", "添加活动实况"), + INVITE_NEW_RESIDENT_INTO_GROUP("invite_new_into_group","resi_group","拉新用户入组"), + INVITE_RESIDENT_INTO_GROUP("invite_resi_into_group","resi_group","邀请已注册的用户入组"), + PUBLISH_ONE_TOPIC("publish_one_topic","resi_group","发布话题"), + PARTICIPATE_ONE_TOPIC("participate_one_topic","resi_group","对小组内话题进行15字以上评论"), + TOPIC_SHIFTED_TO_ISSUE("topic_to_issue","resi_group","话题被转为议题(小组中发布的话题被组长转为议题)"), + SHIFT_TOPIC_TO_ISSUE("shift_topic_to_issue","resi_group","转话题为议题(将自建小组中话题转为议题)"), + TOPIC_SHIFTED_TO_PROJECT("topic_to_project","resi_group","话题被转为项目"), ; private String eventClass; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java index d48669325b..60c16f0c01 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java @@ -107,7 +107,12 @@ public enum RequirePermissionEnum { WORK_PROJECT_TRACE_CLOSE("work_project_trace_close","项目跟踪:结案","结案"), WORK_PROJECT_TRACE_TRANSFER("work_project_trace_transfer","项目跟踪:转其他部门","转其他部门(选择处理部门api也需要添加此校验)"), WORK_PROJECT_TRACE_RETURN("work_project_trace_return","项目跟踪:退回","退回"), + WORK_PROJECT_TRACE_ALL("work_project_trace_all","项目跟踪:全部","只有各级组织的【管理员】和【单位领导】角色才可见该tab页,其他角色不可见"), + /** + * 工作-居民热议 + */ + WORK_HOT_ISSUE_ALL("work_hot_issue_all","居民热议:全部","居民热议:全部"), /** * 党务工作-党建声音 */ 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 102be5a3b7..d771565080 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 @@ -20,6 +20,7 @@ public enum EpmetErrorCode { ERR10006(10006, "登录超时,请重新登录"), ERR10007(10007, "当前帐号已在别处登录"), ERR10019(10019, "验证码不正确"), + SYSTEM_MQ_MSG_SEND_FAIL(10020, "MQ消息发送失败"), ERR401(401, "未授权"), INTERNAL_VALIDATE_ERROR(7000, "内部数据校验异常"), SERVER_ERROR(8000, "服务器开小差了..."), @@ -71,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,"该手机号已注册"), @@ -144,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/filter/LogMsgSendFilter.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java index 4e2f0d16ab..942e4a6570 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java @@ -6,6 +6,7 @@ import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.classic.spi.IThrowableProxy; import ch.qos.logback.classic.spi.StackTraceElementProxy; import ch.qos.logback.core.spi.FilterReply; +import com.epmet.commons.tools.constant.ThreadLocalConstant; import com.epmet.commons.tools.dto.form.DingTalkTextMsg; import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.utils.DingdingMsgSender; @@ -15,9 +16,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.commons.util.InetUtils; import org.springframework.core.env.Environment; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import javax.servlet.http.HttpServletRequest; import java.text.SimpleDateFormat; -import java.util.Arrays; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -64,14 +68,26 @@ public class LogMsgSendFilter extends LevelFilter { stringBuilder.append("IP地址:" + serverIp); stringBuilder.append("\n"); } + stringBuilder.append("故障时间:" + formatLongTime2Str(event.getTimeStamp())); stringBuilder.append("\n"); stringBuilder.append("TraceId:" + Thread.currentThread().getName()); stringBuilder.append("\n"); + + HttpServletRequest request = getRequest(); + if (request != null) { + String requestURI = request.getRequestURI(); + stringBuilder.append("请求路径:" + requestURI); + stringBuilder.append("\n"); + + stringBuilder.append("请求参数:" + ThreadLocalConstant.requestParam.get()); + stringBuilder.append("\n"); + } + String formattedMessage = event.getFormattedMessage(); IThrowableProxy throwableProxy = event.getThrowableProxy(); if (throwableProxy == null && formattedMessage.length() > 1000) { - formattedMessage = formattedMessage.substring(0, getCharacterPosition(formattedMessage, baseProjectPackage, 5)); + formattedMessage = formattedMessage.substring(0, getCharacterPosition(formattedMessage, baseProjectPackage, 5)); } stringBuilder.append("告警信息:" + formattedMessage); stringBuilder.append("\n"); @@ -159,105 +175,19 @@ public class LogMsgSendFilter extends LevelFilter { } } - public static void main(String[] args) { - String msg = "<<<<<<<<异常响应<<<<<<<<:事务流水号:na1597027822634, 执行时长:59ms, 响应数据:{\"code\":8102,\"internalMsg\":\"验证码错误\",\"msg\":\"验证码错误\"}, 异常信息:验证码错误, 堆栈信息:com.epmet.commons.tools.exception.RenException: \n" + - " at com.epmet.service.impl.VolunteerInfoServiceImpl.authenticate(VolunteerInfoServiceImpl.java:91)\n" + - " at com.epmet.service.impl.VolunteerInfoServiceImpl$$FastClassBySpringCGLIB$$7babb2e8.invoke()\n" + - " at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)\n" + - " at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:750)\n" + - " at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\n" + - " at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)\n" + - " at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)\n" + - " at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n" + - " at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)\n" + - " at com.epmet.service.impl.VolunteerInfoServiceImpl$$EnhancerBySpringCGLIB$$f78b4778.authenticate()\n" + - " at com.epmet.controller.ResiVolunteerController.authenticate(ResiVolunteerController.java:59)\n" + - " at com.epmet.controller.ResiVolunteerController$$FastClassBySpringCGLIB$$e023fb55.invoke()\n" + - " at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)\n" + - " at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:750)\n" + - " at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)\n" + - " at org.springframework.aop.framework.adapter.MethodBeforeAdviceInterceptor.invoke(MethodBeforeAdviceInterceptor.java:56)\n" + - " at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n" + - " at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)\n" + - " at com.epmet.commons.tools.aspect.BaseRequestLogAspect.proceed(BaseRequestLogAspect.java:66)\n" + - " at com.epmet.aspect.RequestLogAspect.proceed(RequestLogAspect.java:26)\n" + - " at sun.reflect.GeneratedMethodAccessor195.invoke(Unknown Source)\n" + - " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" + - " at java.lang.reflect.Method.invoke(Method.java:498)\n" + - " at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)\n" + - " at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)\n" + - " at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)\n" + - " at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n" + - " at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)\n" + - " at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)\n" + - " at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689)\n" + - " at com.epmet.controller.ResiVolunteerController$$EnhancerBySpringCGLIB$$1c0751c0.authenticate()\n" + - " at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\n" + - " at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\n" + - " at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\n" + - " at java.lang.reflect.Method.invoke(Method.java:498)\n" + - " at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)\n" + - " at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)\n" + - " at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)\n" + - " at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:893)\n" + - " at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:798)\n" + - " at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)\n" + - " at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)\n" + - " at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)\n" + - " at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)\n" + - " at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)\n" + - " at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)\n" + - " at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)\n" + - " at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n" + - " at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n" + - " at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:88)\n" + - " at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n" + - " at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)\n" + - " at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n" + - " at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)\n" + - " at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n" + - " at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:94)\n" + - " at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n" + - " at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:114)\n" + - " at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:104)\n" + - " at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n" + - " at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)\n" + - " at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\n" + - " at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\n" + - " at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)\n" + - " at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)\n" + - " at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526)\n" + - " at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)\n" + - " at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)\n" + - " at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)\n" + - " at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)\n" + - " at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367)\n" + - " at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)\n" + - " at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860)\n" + - " at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1591)\n" + - " at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\n" + - " at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n" + - " at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n" + - " at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n" + - " at java.lang.Thread.run(Thread.java:745)"; + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + if (sra == null){ + return null; + } + return sra.getRequest(); - String substring = msg.substring(0, getCharacterPosition(msg, "com.epme1t", 5)); - System.out.println(substring); } @@ -274,7 +204,7 @@ public class LogMsgSendFilter extends LevelFilter { } return slashMatcher.start(); } catch (Exception e) { - logger.warn("getCharacterPosition no matche"); + logger.warn("getCharacterPosition no matche", e); return 0; } } 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 444077098f..098dd1c14d 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 @@ -360,4 +360,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/redis/RedisUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java index de481f10fd..2fcabf5d57 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java @@ -50,6 +50,10 @@ public class RedisUtils { * 过期时长为1小时,单位:秒 */ public final static long HOUR_ONE_EXPIRE = 60 * 60 * 1L; + /** + * 过期时长为4小时,单位:秒 + */ + public final static long HOUR_FOUR_EXPIRE = 60 * 60 * 4L; /** * 过期时长为6小时,单位:秒 */ 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/param/VoiceScanParamDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VoiceScanParamDTO.java new file mode 100644 index 0000000000..e315848ec1 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VoiceScanParamDTO.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; + +/** + * 语音检测入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/18 10:15 + */ +@Data +public class VoiceScanParamDTO implements Serializable { + + /** + * 是否开启回调 + */ + @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/VoiceTaskDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VoiceTaskDTO.java new file mode 100644 index 0000000000..a0abe2303a --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/param/VoiceTaskDTO.java @@ -0,0 +1,31 @@ +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 2020/12/18 10:21 + */ +@Data +public class VoiceTaskDTO implements Serializable { + /** + * 不必填 + * 要检测的数据id 非必填 + * 检测对象对应的数据ID。 + * 由大小写英文字母、数字、下划线(_)、短划线(-)、英文句号(.)组成,不超过128个字符,可以用于唯一标识您的业务数据。 + * */ + @NotBlank(message = "dataId不能为空") + private String dataId; + + /** + * 必填 + * 需要检测的音频文件或语音流的下载地址。 + */ + @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 new file mode 100644 index 0000000000..6f8c33aa5c --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanResult.java @@ -0,0 +1,49 @@ +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/18 10:09 + */ +@Data +public class AsyncScanResult implements Serializable { + private static final long serialVersionUID = -939433332419948118L; + + /** + * 随机字符串,该值用于回调通知请求中的签名。 + */ + 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; + } + + public void setAllSuccess(boolean allSuccess) { + isAllSuccess = allSuccess; + } +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanTaskDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanTaskDTO.java new file mode 100644 index 0000000000..e09ed9ae5d --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/AsyncScanTaskDTO.java @@ -0,0 +1,25 @@ +package com.epmet.commons.tools.scan.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 语音异步检测 -返回的task集合 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/18 10:31 + */ +@Data +public class AsyncScanTaskDTO implements Serializable { + /** + * 检测对象对应的数据ID。 + * 由大小写英文字母、数字、下划线(_)、短划线(-)、英文句号(.)组成,不超过128个字符,可以用于唯一标识您的业务数据。 + */ + private String dataId; + + /** + * 任务id + */ + private String taskId; +} 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/scan/result/VoiceResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VoiceResultDTO.java new file mode 100644 index 0000000000..a826f5b66d --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/scan/result/VoiceResultDTO.java @@ -0,0 +1,56 @@ +package com.epmet.commons.tools.scan.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 检测成功(检测成功+检测失败的)的任务详情 + * 处理中的该接口不返回,继续轮询即可 + * @author yinzuomei@elink-cn.com + * @date 2020/12/18 13:10 + */ +@Data +public class VoiceResultDTO implements Serializable { + private static final long serialVersionUID = 8006827312407034344L; + /** + * 检测对象对应的数据ID。 + */ + private String dataId; + + /** + * 检测任务的ID + */ + private String taskId; + + /** + * 建议您执行的后续操作。取值: + * pass:结果正常,无需进行其余操作。 + * review:结果不确定,需要进行人工审核。 + * block:结果违规,建议直接删除或者限制公开。 + */ + private String suggestion; + + /** + * 检测结果的分类。取值: + * normal:正常文本 + * spam:含垃圾信息 + * ad:广告 + * politics:涉政 + * terrorism:暴恐 + * abuse:辱骂 + * porn:色情 + * flood:灌水 + * contraband:违禁 + * meaningless:无意义 + * customized:自定义(例如命中自定义关键词) + */ + private String label; + + /** + * labelDesc是对label的说明,包含两种特殊说明: + * (1)如果检测任务失败labelDesc:智能检测任务失败,结果已失效,需要人工审核 + * (2)如果检测结果失效labelDesc:智能检测任务失败,需要人工审核 + */ + private String labelDesc; +} 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 8b5a691891..2481664829 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 @@ -227,7 +251,8 @@ public class HttpClientManager { try { HttpPost httppost = new HttpPost(url); httppost.setConfig(requestConfig); - httppost.addHeader(HEADER_CONTENT_TYPE, HEADER_APPLICATION_JSON); + httppost.addHeader(HEADER_CONTENT_TYPE, "application/json"); + //httppost.addHeader(HEADER_CONTENT_TYPE, HEADER_APPLICATION_JSON); if (StringUtils.isNotEmpty(jsonStrParam)) { StringEntity se = new StringEntity(jsonStrParam, UTF8); httppost.setEntity(se); @@ -249,8 +274,8 @@ public class HttpClientManager { */ public Result sendAlarmMsg(String content) { Long timestamp = System.currentTimeMillis(); - String url = "https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c"; - String secret = "SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19"; + String url = "https://oapi.dingtalk.com/robot/send?access_token=c40055ed85e45fdaafea00f3218928794262ff15163e09ad5c89764433b69806"; + String secret = "SEC220eafdcb39ab5dd6cffa9f11b0e5de7178ddac9812d40fdceb6b1dda2963186"; try { String stringToSign = timestamp + "\n" + secret; @@ -324,6 +349,33 @@ 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) -> { + if (StringUtils.isNotBlank(k)) { + httpGet.addHeader(k, v == null ? null : v.toString()); + } + }); + } + 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/RSASignature.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/RSASignature.java new file mode 100644 index 0000000000..6de665f7eb --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/RSASignature.java @@ -0,0 +1,251 @@ +package com.epmet.commons.tools.utils; + +import javax.crypto.Cipher; +import java.security.*; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; +import java.util.Base64; + +/** + * @author jianjun liu + * @date 2020-06-05 16:48 + **/ + +public class RSASignature { + + + //非对称密钥算法 + private static final String KEY_ALGORITHM = "RSA"; + //密钥长度,在512到65536位之间,建议不要太长,否则速度很慢,生成的加密数据很长 + private static final int KEY_SIZE = 512; + //字符编码 + private static final String CHARSET = "UTF-8"; + + /** + * 生成密钥对 + * + * @return KeyPair 密钥对 + */ + public static KeyPair getKeyPair() throws Exception { + return getKeyPair(null); + } + + /** + * 生成密钥对 + * + * @param password 生成密钥对的密码 + * @return + * @throws Exception + */ + public static KeyPair getKeyPair(String password) throws Exception { + //实例化密钥生成器 + KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(KEY_ALGORITHM); + //初始化密钥生成器 + if (password == null) { + keyPairGenerator.initialize(KEY_SIZE); + } else { + SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG"); + secureRandom.setSeed(password.getBytes(CHARSET)); + keyPairGenerator.initialize(KEY_SIZE, secureRandom); + } + //生成密钥对 + return keyPairGenerator.generateKeyPair(); + } + + /** + * 取得私钥 + * + * @param keyPair 密钥对 + * @return byte[] 私钥 + */ + public static byte[] getPrivateKeyBytes(KeyPair keyPair) { + return keyPair.getPrivate().getEncoded(); + } + + /** + * 取得Base64编码的私钥 + * + * @param keyPair 密钥对 + * @return String Base64编码的私钥 + */ + public static String getPrivateKey(KeyPair keyPair) { + return Base64.getEncoder().encodeToString(getPrivateKeyBytes(keyPair)); + } + + /** + * 取得公钥 + * + * @param keyPair 密钥对 + * @return byte[] 公钥 + */ + public static byte[] getPublicKeyBytes(KeyPair keyPair) { + return keyPair.getPublic().getEncoded(); + } + + /** + * 取得Base64编码的公钥 + * + * @param keyPair 密钥对 + * @return String Base64编码的公钥 + */ + public static String getPublicKey(KeyPair keyPair) { + return Base64.getEncoder().encodeToString(getPublicKeyBytes(keyPair)); + } + + /** + * 私钥加密 + * + * @param data 待加密数据 + * @param privateKey 私钥字节数组 + * @return byte[] 加密数据 + */ + public static byte[] encryptByPrivateKey(byte[] data, byte[] privateKey) throws Exception { + //实例化密钥工厂 + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + //生成私钥 + PrivateKey key = keyFactory.generatePrivate(new PKCS8EncodedKeySpec(privateKey)); + //数据加密 + Cipher cipher = Cipher.getInstance(KEY_ALGORITHM); + cipher.init(Cipher.ENCRYPT_MODE, key); + return cipher.doFinal(data); + } + + /** + * 私钥加密 + * + * @param data 待加密数据 + * @param privateKey Base64编码的私钥 + * @return String Base64编码的加密数据 + */ + public static String encryptByPrivateKey(String data, String privateKey) throws Exception { + byte[] key = Base64.getDecoder().decode(privateKey); + return Base64.getEncoder().encodeToString(encryptByPrivateKey(data.getBytes(CHARSET), key)); + } + + /** + * 公钥加密 + * + * @param data 待加密数据 + * @param publicKey 公钥字节数组 + * @return byte[] 加密数据 + */ + public static byte[] encryptByPublicKey(byte[] data, byte[] publicKey) throws Exception { + //实例化密钥工厂 + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + //生成公钥 + PublicKey key = keyFactory.generatePublic(new X509EncodedKeySpec(publicKey)); + //数据加密 + Cipher cipher = Cipher.getInstance(KEY_ALGORITHM); + cipher.init(Cipher.ENCRYPT_MODE, key); + return cipher.doFinal(data); + } + + /** + * 公钥加密 + * + * @param data 待加密数据 + * @param publicKey Base64编码的公钥 + * @return String Base64编码的加密数据 + */ + public static String encryptByPublicKey(String data, String publicKey) throws Exception { + byte[] key = Base64.getDecoder().decode(publicKey); + return Base64.getEncoder().encodeToString(encryptByPublicKey(data.getBytes(CHARSET), key)); + } + + /** + * 私钥解密 + * + * @param data 待解密数据 + * @param privateKey 私钥字节数组 + * @return byte[] 解密数据 + */ + public static byte[] decryptByPrivateKey(byte[] data, byte[] privateKey) throws Exception { + //实例化密钥工厂 + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + //生成私钥 + PrivateKey key = keyFactory.generatePrivate(new PKCS8EncodedKeySpec(privateKey)); + //数据解密 + Cipher cipher = Cipher.getInstance(KEY_ALGORITHM); + cipher.init(Cipher.DECRYPT_MODE, key); + return cipher.doFinal(data); + } + + /** + * 私钥解密 + * + * @param data Base64编码的待解密数据 + * @param privateKey Base64编码的私钥 + * @return String 解密数据 + */ + public static String decryptByPrivateKey(String data, String privateKey) throws Exception { + byte[] key = Base64.getDecoder().decode(privateKey); + return new String(decryptByPrivateKey(Base64.getDecoder().decode(data), key), CHARSET); + } + + /** + * 公钥解密 + * + * @param data 待解密数据 + * @param publicKey 公钥字节数组 + * @return byte[] 解密数据 + */ + public static byte[] decryptByPublicKey(byte[] data, byte[] publicKey) throws Exception { + //实例化密钥工厂 + KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); + //产生公钥 + PublicKey key = keyFactory.generatePublic(new X509EncodedKeySpec(publicKey)); + //数据解密 + Cipher cipher = Cipher.getInstance(KEY_ALGORITHM); + cipher.init(Cipher.DECRYPT_MODE, key); + return cipher.doFinal(data); + } + + /** + * 公钥解密 + * + * @param data Base64编码的待解密数据 + * @param publicKey Base64编码的公钥 + * @return String 解密数据 + */ + public static String decryptByPublicKey(String data, String publicKey) throws Exception { + byte[] key = Base64.getDecoder().decode(publicKey); + return new String(decryptByPublicKey(Base64.getDecoder().decode(data), key), CHARSET); + } + + /** + * 测试加解密方法 + * + * @param args + * @throws Exception + */ + public static void main(String[] args) throws Exception { + //生成密钥对,一般生成之后可以放到配置文件中 + KeyPair keyPair = RSASignature.getKeyPair(); + //公钥 + String publicKey = RSASignature.getPublicKey(keyPair); + //私钥 + String privateKey = RSASignature.getPrivateKey(keyPair); + + System.out.println("公钥:\n" + publicKey); + System.out.println("私钥:\n" + privateKey); + + String data = "RSA 加解密测试!"; + { + System.out.println("\n===========私钥加密,公钥解密=============="); + String s1 = RSASignature.encryptByPrivateKey(data, privateKey); + System.out.println("加密后的数据:" + s1); + String s2 = RSASignature.decryptByPublicKey(s1, publicKey); + System.out.println("解密后的数据:" + s2 + "\n\n"); + } + //===== + { + System.out.println("\n===========公钥加密,私钥解密=============="); + String s1 = RSASignature.encryptByPublicKey(data, publicKey); + System.out.println("加密后的数据:" + s1); + String s2 = RSASignature.decryptByPrivateKey(s1, privateKey); + System.out.println("解密后的数据:" + s2 + "\n\n"); + } + + } + +} diff --git a/epmet-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 ef7a3257a6..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 @@ -2,14 +2,17 @@ package com.epmet.commons.tools.utils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.TypeReference; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.scan.param.ImgScanParamDTO; -import com.epmet.commons.tools.scan.param.TextScanParamDTO; -import com.epmet.commons.tools.scan.param.TextTaskDTO; +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; +import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; @@ -75,7 +78,139 @@ public class ScanContentUtils { } } + /** + * desc:语音异步检测任务提交 + * + * @return 返回检测对象对应的任务id + */ + public static Result voiceAsyncScan(String url, VoiceScanParamDTO param){ + log.debug("voiceAsyncScan 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("voiceAsyncScan 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("voiceAsyncScan exception:", e); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); + } + } + + /** + * desc:语音异步检测结果查询 + * + * @param taskIds 数组中的元素个数不超过100个。 + * @return 注意该接口只返回检测任务完成的(即检测成功或失败的);任务正在处理中的不返回,继续轮询即可。 + */ + public static Result> voiceResults(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("voiceResults 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()); + } + } + + /** + * @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) { + //测试文本检测 + // testTextSyncScan(); + //测试语音检测 + // testVoiceAsyncScan(); + //语音检测结果 + // testVoiceResults(); + //视频检测任务提交 + // testVideoAsyncScan(); + //查询视频检测结果 + testVideoResults(); + } + + public static void testTextSyncScan(){ String url = "http://localhost:8107/epmetscan/api/textSyncScan"; TextTaskDTO p = new TextTaskDTO(); p.setDataId("1"); @@ -95,6 +230,60 @@ public class ScanContentUtils { result.getFailDataIds().addAll(imgSyncScanResultData.getFailDataIds()); System.out.println("================"+JSON.toJSONString(result)); } + } + } + + public static void testVoiceAsyncScan(){ + String url = "http://localhost:8107/epmetscan/api/voiceAsyncScan"; + VoiceTaskDTO p = new VoiceTaskDTO(); + p.setDataId("1"); + p.setUrl("https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20201208/6480bd6be9f14a458162218cea84dfa5.aac"); + List list = new ArrayList<>(); + list.add(p); + VoiceScanParamDTO param = new VoiceScanParamDTO(); + param.setTasks(list); + param.setOpenCallBack(false); + Result asyncScanResultResult = ScanContentUtils.voiceAsyncScan(url, param); + System.out.println(JSON.toJSONString(asyncScanResultResult)); + AsyncScanResult result = new AsyncScanResult(); + if (asyncScanResultResult != null) { + AsyncScanResult asyncScanResult = asyncScanResultResult.getData(); + if (asyncScanResultResult.success()) { + result.setAllSuccess(asyncScanResult.isAllSuccess()); + result.getSuccessTasks().addAll(asyncScanResult.getSuccessTasks()); + result.getFailTasks().addAll(asyncScanResult.getFailTasks()); + System.out.println("================" + JSON.toJSONString(result)); } } + } + + public static void testVoiceResults(){ + String url = "http://localhost:8107/epmetscan/api/voiceResults"; + List taskIds=new ArrayList<>(); + taskIds.add("vc_f_6CXRk1VcAwM6u0FMA@CfoW-1tDgIp"); + 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 dede8d5706..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 @@ -28,87 +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/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java index 08a96295ac..1f44eb4333 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java @@ -35,14 +35,14 @@ public class IdCardNoValidatorUtils { try { //判断号码的长度 15位或18位 if (idCardNo.length() != 15 && idCardNo.length() != 18) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证号码长度应该为15位或18位")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证号码长度应该为15位或18位")); return false; } if (idCardNo.length() == 18) { String lastStr = idCardNo.substring(idCardNo.length() - 1); if (!Character.isDigit(lastStr.charAt(0))) { if (Character.isLowerCase(lastStr.charAt(0))) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "18身份证号最后一位字母需要大写")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "18身份证号最后一位字母需要大写")); return false; } } else { @@ -55,7 +55,7 @@ public class IdCardNoValidatorUtils { iDCardNo = idCardNo.substring(0, 6) + "19" + idCardNo.substring(6, 15); } if (isStrNum(iDCardNo) == false) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证15位号码都应为数字;18位号码除最后一位外,都应为数字")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证15位号码都应为数字;18位号码除最后一位外,都应为数字")); return false; } //判断出生年月 @@ -63,27 +63,27 @@ public class IdCardNoValidatorUtils { String strMonth = iDCardNo.substring(10, 12);// 月份 String strDay = iDCardNo.substring(12, 14);// 月份 if (isStrDate(strYear + "-" + strMonth + "-" + strDay) == false) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日无效")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日无效")); return false; } GregorianCalendar gc = new GregorianCalendar(); SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd"); if ((gc.get(Calendar.YEAR) - Integer.parseInt(strYear)) > 150 || (gc.getTime().getTime() - s.parse(strYear + "-" + strMonth + "-" + strDay).getTime()) < 0) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日不在有效范围")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日不在有效范围")); return false; } if (Integer.parseInt(strMonth) > 12 || Integer.parseInt(strMonth) == 0) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证月份无效")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证月份无效")); return false; } if (Integer.parseInt(strDay) > 31 || Integer.parseInt(strDay) == 0) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证日期无效")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证日期无效")); return false; } //判断地区码 Hashtable h = GetAreaCode(); if (h.get(iDCardNo.substring(0, 2)) == null) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证地区编码错误")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证地区编码错误")); return false; } //判断最后一位 @@ -96,12 +96,12 @@ public class IdCardNoValidatorUtils { iDCardNo = iDCardNo + strVerifyCode; if (idCardNo.length() == 18 && !iDCardNo.equals(idCardNo)) { - logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证无效,不是合法的身份证号码")); + logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证无效,不是合法的身份证号码")); return false; } } catch (Exception e) { - logger.error(String.format("校验身份证号方法异常")); + logger.warn(String.format("校验身份证号方法异常")); e.printStackTrace(); } return true; diff --git a/epmet-commons/pom.xml b/epmet-commons/pom.xml index d4b8e270b4..636480c48f 100644 --- a/epmet-commons/pom.xml +++ b/epmet-commons/pom.xml @@ -23,6 +23,8 @@ epmet-commons-tools-wx-mp epmet-commons-service-call epmet-commons-extapp-auth + epmet-commons-thirdplat + epmet-commons-rocketmq diff --git a/epmet-gateway/Dockerfile b/epmet-gateway/Dockerfile index fad72ba2ca..bb6890eefc 100644 --- a/epmet-gateway/Dockerfile +++ b/epmet-gateway/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./epmet-gateway.jar EXPOSE 8080 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-gateway/deploy/docker-compose-prod.yml b/epmet-gateway/deploy/docker-compose-prod.yml index ed023d3b8c..ebcdc7eafc 100644 --- a/epmet-gateway/deploy/docker-compose-prod.yml +++ b/epmet-gateway/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-gateway:0.3.39 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-gateway:0.3.43 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index f67d250648..08eda7167e 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.39 + 0.3.43 com.epmet epmet-cloud @@ -205,6 +205,13 @@ lb://epmet-ext-server + + lb://data-aggregator-server + + + + lb://epmet-openapi-adv-server + @@ -324,6 +331,14 @@ lb://epmet-ext-server + + + lb://data-aggregator-server + + + + lb://epmet-openapi-adv-server + @@ -416,6 +431,11 @@ lb://epmet-point-server lb://epmet-ext-server + + lb://data-aggregator-server + + + lb://epmet-openapi-adv-server @@ -505,6 +525,11 @@ lb://epmet-point-server lb://epmet-ext-server + + lb://data-aggregator-server + + + lb://epmet-openapi-adv-server 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..15406173b2 100644 --- a/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java +++ b/epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java @@ -105,19 +105,30 @@ 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")) {//工作端 - if(StringUtils.isNotBlank(customerId)){ - exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId); + + 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(customerId)){ + if (StringUtils.equalsAny(baseTokenDto.getApp(), AppClientConstant.APP_GOV, AppClientConstant.APP_RESI, "public")) {//工作端/居民端 + builder.header(AppClientConstant.CUSTOMER_ID, customerId); } - } else if (StringUtils.equals(baseTokenDto.getApp(), "public")) {//公众号端 - exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId); } + + //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); + // } + //} else if (StringUtils.equals(baseTokenDto.getApp(), "public")) {//公众号端 + // exchange.getRequest().mutate().header(AppClientConstant.CUSTOMER_ID, customerId); + //} ServerHttpRequest build = exchange.getRequest().mutate().build(); return exchange.mutate().request(build).build(); } diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 53ec286911..7a6c236128 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -2,6 +2,7 @@ server: tomcat: max-swallow-size: 100MB port: @server.port@ + version: @version@ servlet: context-path: /api spring: @@ -323,6 +324,24 @@ spring: filters: - StripPrefix=1 - CpAuth=true + # 多数据源服务 + - id: data-aggregator-server + uri: @gateway.routes.data-aggregator-server.url@ + order: 35 + predicates: + - Path=${server.servlet.context-path}/data/aggregator/** + filters: + - StripPrefix=1 + - CpAuth=true + # 宣传服务 + - id: epmet-openapi-adv-server + uri: @gateway.routes.epmet-openapi-adv-server.url@ + order: 35 + predicates: + - Path=${server.servlet.context-path}/adv/** + filters: + - StripPrefix=1 + - CpAuth=true nacos: discovery: server-addr: @nacos.server-addr@ @@ -450,7 +469,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/pom.xml b/epmet-module/data-aggregator/data-aggregator-client/pom.xml new file mode 100644 index 0000000000..4e8beca881 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/pom.xml @@ -0,0 +1,22 @@ + + + + data-aggregator + com.epmet + 2.0.0 + + 4.0.0 + + data-aggregator-client + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java new file mode 100644 index 0000000000..70f42dc1e2 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java @@ -0,0 +1,26 @@ +package com.epmet.dataaggre.constant; + +/** + * 数据源常量 + */ +public interface DataSourceConstant { + + String GOV_ORG = "govorg"; + String GOV_ISSUE = "govissue"; + + /** + * 项目 + */ + String GOV_PROJECT = "govproject"; + + /** + * 小组 + */ + String RESI_GROUP = "resigroup"; + + /** + * 用户 + */ + String EPMET_USER = "epmetuser"; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/GroupConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/GroupConstant.java new file mode 100644 index 0000000000..ba879a3fee --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/GroupConstant.java @@ -0,0 +1,8 @@ +package com.epmet.dataaggre.constant; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午10:55 + */ +public interface GroupConstant { +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/IssueConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/IssueConstant.java new file mode 100644 index 0000000000..644b680ea5 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/IssueConstant.java @@ -0,0 +1,27 @@ +package com.epmet.dataaggre.constant; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午10:54 + */ +public interface IssueConstant { + + /** + * 议题状态(表决中:voting 已转项目:shift_project 已关闭:closed 待处理:auditing 已驳回:rejected) + */ + String ISSUE_STATUS_VOTING = "voting"; + String ISSUE_STATUS_SHIFT_PROJECT = "shift_project"; + String ISSUE_STATUS_CLOSED = "closed"; + String ISSUE_STATUS_AUDITING = "auditing"; + String ISSUE_STATUS_UNDER_AUDITING = "under_auditing"; + String ISSUE_STATUS_REJECTED = "rejected"; + + String NOT_EXISTS_ISSUE_TYPE = "议题类型不能为空......"; + + String GET_AGENCY_FAILURE = "根据userId查询组织ID失败......"; + + String GET_GRID_LIST_FAILURE = "获取网格ID列表失败......"; + + String NOT_EXISTS_PROJECT_INFO = "未查询到项目信息......"; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java new file mode 100644 index 0000000000..987c2a2697 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java @@ -0,0 +1,8 @@ +package com.epmet.dataaggre.constant; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午10:55 + */ +public interface OrgConstant { +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/ProjectConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/ProjectConstant.java new file mode 100644 index 0000000000..ea55a2ccc2 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/ProjectConstant.java @@ -0,0 +1,24 @@ +package com.epmet.dataaggre.constant; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午10:47 + */ +public interface ProjectConstant { + + /** + * 排序类型(创建时间:create 更新时间:update 涉及部门最多:department 耗时最长:date 处理次数最多:count) + */ + String CREATE_TIME = "create"; + String UPDATE_TIME = "update"; + String REFER_DEPT = "department"; + String ELAPSED_TIME = "date"; + String DISPOSE_COUNT = "count"; + + /** + * 项目状态(处理中:pending 已结案:closed) + */ + String PROJECT_STATUS_PENDING = "pending"; + String PROJECT_STATUS_CLOSED = "closed"; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/UserConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/UserConstant.java new file mode 100644 index 0000000000..337f084031 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/UserConstant.java @@ -0,0 +1,8 @@ +package com.epmet.dataaggre.constant; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午10:54 + */ +public interface UserConstant { +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/BadgeCertificationConfigDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/BadgeCertificationConfigDTO.java new file mode 100644 index 0000000000..30179678c3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/BadgeCertificationConfigDTO.java @@ -0,0 +1,87 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.epmetuser; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 徽章认证配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class BadgeCertificationConfigDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户Id 默认配置id:default + */ + private String customerId; + + /** + * 徽章ID + */ + private String badgeId; + + /** + * 认证信息类型 手机号:mobile;全名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark + */ + private String certificationType; + + /** + * 删除标识 1删除;0未删除 + */ + 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/BadgeCertificationConfigFieldDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/BadgeCertificationConfigFieldDTO.java new file mode 100644 index 0000000000..7252e445b0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/BadgeCertificationConfigFieldDTO.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 徽章认证配置字段表 + + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class BadgeCertificationConfigFieldDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 中文名 + */ + private String cnName; + + /** + * 英文名(字段名) + */ + private String enName; + + /** + * 字段类型 img:图片,text:文本 + */ + private String fieldType; + + /** + * 是否必填 + */ + private Integer isRequired; + + /** + * 认证信息类型 手机号:mobile;全名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark + */ + private String certificationType; + + /** + * 字段排序 + */ + private Integer sort; + + /** + * 删除标识 1删除0未删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/BadgeDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/BadgeDTO.java new file mode 100644 index 0000000000..d1fc1d1a43 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/BadgeDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 徽章 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class BadgeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户Id 默认配置id:default + */ + private String customerId; + + /** + * 徽章名称 + */ + private String badgeName; + + /** + * 徽章图标url + */ + private String badgeIcon; + + /** + * 固有徽章类型 前端页面跳转标识,党员徽章:party;无:none + */ + private String fixationBadgeType; + + /** + * 徽章排序 + */ + private Integer sort; + + /** + * 状态 上线:online;下线:offline; + */ + private String badgeStatus; + + /** + * 删除标识 1删除;0未删除 + */ + 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/CustomerStaffDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/CustomerStaffDTO.java new file mode 100644 index 0000000000..c4b24217e3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/CustomerStaffDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 政府工作人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class CustomerStaffDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户Id CUSTOMER.id + */ + private String customerId; + + /** + * 关联User表的主键Id + */ + private String userId; + + /** + * 真实姓名 + */ + private String realName; + + /** + * 性别0.未知,1男,2.女 + */ + private Integer gender; + + /** + * 邮箱 + */ + private String email; + + /** + * 手机号-唯一键 + */ + private String mobile; + + /** + * 地址 + */ + private String address; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * fulltime专职parttime兼职 + */ + private String workType; + + /** + * 头像 + */ + private String headPhoto; + + /** + * inactive未激活,active已激活 + */ + private String activeFlag; + + /** + * 激活时间 + */ + private Date activeTime; + + /** + * 未禁用enable,已禁用disabled + */ + private String enableFlag; + + /** + * 登录密码 + */ + private String password; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/CustomerUserDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/CustomerUserDTO.java new file mode 100644 index 0000000000..66f1c257b3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/CustomerUserDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 居民用户信息,此表已作废 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class CustomerUserDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id CUSTOMER.id + */ + private String customerId; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 微信unionId + */ + private String wxUnionId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 昵称 + */ + private String nickname; + + /** + * 性别:0.未知 1.男性2女性 + */ + private Integer sex; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 国家 + */ + private String country; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 语言 + */ + private String language; + + /** + * 删除标识: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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/GovStaffRoleDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/GovStaffRoleDTO.java new file mode 100644 index 0000000000..9e569488d2 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/GovStaffRoleDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 政府端角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class GovStaffRoleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID。如果该角色由客户定制,其下的机关和部门都不再各自定制自己的角色,这个字段会比较有用。包括通用角色以及客户定制角色。 + */ + private String customerId; + + /** + * 角色key + */ + private String roleKey; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 角色所属体系类型:agency,department,grid + */ + private String orgType; + + /** + * + */ + private Integer delFlag; + + /** + * + */ + private Integer revision; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String updatedBy; + + /** + * + */ + private Date updatedTime; + + /** + * 是否只有全职 1对应true 0对应false + */ + private Integer fullTimeOnly; + + /** + * 排序 + */ + private Integer sort; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/GovStaffRoleTemplateDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/GovStaffRoleTemplateDTO.java new file mode 100644 index 0000000000..5c38ca8a2c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/GovStaffRoleTemplateDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 政府端角色模板表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class GovStaffRoleTemplateDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 角色key + */ + private String roleKey; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 角色所属体系类型:org,dept,grid + */ + private String orgType; + + /** + * 是否只有全职 1对应true 0对应false + */ + private Integer fullTimeOnly; + + /** + * + */ + private Integer delFlag; + + /** + * + */ + private Integer revision; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String updatedBy; + + /** + * + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/GridLatestDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/GridLatestDTO.java new file mode 100644 index 0000000000..c0ddfade87 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/GridLatestDTO.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 最近访问网格表 +记录用户访问网格的最近一次记录,对同一网格只记录一条记录,同一网格每次只更新最近一次访问的时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class GridLatestDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id CUSTOMER.id + */ + private String customerId; + + /** + * 网格表Id(CUSTOMER_GRID.id) + */ + private String gridId; + + /** + * 用户Id(CUSTOMER_USER.id) + */ + private String customerUserId; + + /** + * 所属地区码 (数据统计字段) + */ + private String areaCode; + + /** + * 上级组织ID (数据统计字段) + */ + private String pid; + + /** + * 最近访问时间 + */ + private Date latestTime; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/GridVisitedDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/GridVisitedDTO.java new file mode 100644 index 0000000000..c7fa297cd9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/GridVisitedDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 网格访问记录表 用户对网格访问的一个记录,只有在访问网格首页时才存储数据,一个用户一天对一个网格的访问只有一条记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class GridVisitedDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 是否注册(0:否 1:是) + */ + private Integer isRegister; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格表Id (CUSTOMER_GRID.id) + */ + private String gridId; + + /** + * 用户Id + */ + private String customerUserId; + + /** + * 访问时间 一个用户一天访问一个网格只有一条记录 + */ + private Date visitTime; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/OperUserDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/OperUserDTO.java new file mode 100644 index 0000000000..f3eb7ebc02 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/OperUserDTO.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 运营人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class OperUserDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 关联User表主键 + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 密码 + */ + private String password; + + /** + * 头像 + */ + private String headUrl; + + /** + * 性别 0:男 1:女 2:保密 + */ + private Integer gender; + + /** + * 邮箱 + */ + private String email; + + /** + * 手机号-唯一键 + */ + private String phone; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 超级管理员 0:否 1:是 + */ + private Integer superAdmin; + + /** + * 状态 0:停用 1:正常 + */ + private Integer status; + + /** + * 备注 + */ + private String remark; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/RegisterRelationDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/RegisterRelationDTO.java new file mode 100644 index 0000000000..245636ced7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/RegisterRelationDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 注册关系表 用于统计客户网格的注册居民数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class RegisterRelationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + /** + * 网格Id (customer_grid.id) + */ + private String gridId; + + /** + * 用户Id (user.id) + */ + private String userId; + + /** + * 首次注册用户 0表示不参与计数 1表示参与计数 + */ + private String firstRegister; + + /** + * 注册用户 0表示不参与计数 1表示参与计数 + */ + private String register; + + /** + * 参与用户 0表示不参与计数 1表示参与计数 + */ + private String participation; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/ResiUserBadgeDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/ResiUserBadgeDTO.java new file mode 100644 index 0000000000..e6290b9637 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/ResiUserBadgeDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户徽章关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ResiUserBadgeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户Id 默认配置id:default + */ + private String customerId; + + /** + * 用户注册网格ID + */ + private String gridId; + + /** + * 用户ID + */ + private String userId; + + /** + * 徽章ID + */ + private String badgeId; + + /** + * 是否开启(点亮) 1:点亮;0:未点亮 + */ + private Integer isOpened; + + /** + * 认证(审核)状态 待审核:auditing;审核通过: approved;驳回:rejected; + */ + private String certificationAutidStatus; + + /** + * 删除标识 1删除;0未删除 + */ + 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/RoleDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/RoleDTO.java new file mode 100644 index 0000000000..03ca62bcad --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/RoleDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class RoleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 所属APP + */ + private String app; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 角色Key值 + */ + private String roleKey; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffAgencyVisitedDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffAgencyVisitedDTO.java new file mode 100644 index 0000000000..e0dd85fb43 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffAgencyVisitedDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 工作人员进入组织日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class StaffAgencyVisitedDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * customer_staff.userId + */ + private String staffId; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 机关单位id来源于customer_agency.id + */ + private String agencyId; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间,登录时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffGridVisitedDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffGridVisitedDTO.java new file mode 100644 index 0000000000..e8f6761945 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffGridVisitedDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 工作人员进入网格日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class StaffGridVisitedDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * customer_staff.userId + */ + private String staffId; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间,登录时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffRoleDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffRoleDTO.java new file mode 100644 index 0000000000..472615f6b1 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffRoleDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 工作人员-角色关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class StaffRoleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 用户ID + */ + private String staffId; + + /** + * 角色ID + */ + private String roleId; + + /** + * 角色所属类型的ID。例如,机关的角色,那该字段就是所属机关的ID;部门的角色,该字段就是所属部门的ID;网格的角色,该字段就是所属网格ID + */ + private String orgId; + + /** + * + */ + private Integer delFlag; + + /** + * + */ + private Integer revision; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String updatedBy; + + /** + * + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffWechatDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffWechatDTO.java new file mode 100644 index 0000000000..b129857f74 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/StaffWechatDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 工作人员微信关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class StaffWechatDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 用户Id user.id + */ + private String userId; + + /** + * openId + */ + private String wxOpenId; + + /** + * 微信unionId + */ + private String wxUnionId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 昵称 + */ + private String nickname; + + /** + * 性别 + */ + private Integer sex; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 国家 + */ + private String country; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 语言 + */ + private String language; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserAdviceDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserAdviceDTO.java new file mode 100644 index 0000000000..a1f9449b90 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserAdviceDTO.java @@ -0,0 +1,171 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * user_advice + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class UserAdviceDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户名 + */ + private String customerName; + + /** + * 组织ID + */ + private String agencyId; + + /** + * + */ + private String agencyPids; + + /** + * + */ + private String agencyAllParentName; + + /** + * 组织名 + */ + private String agencyName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名 + */ + private String gridName; + + /** + * userid + */ + private String userId; + + /** + * 用户姓名 + */ + private String userName; + + /** + * 用户注册手机号 + */ + private String regPhone; + + /** + * 1 + */ + private String adviceContent; + + /** + * 填写手机号 + */ + private String phone; + + /** + * 建议时间 + */ + private Date adviceTime; + + /** + * 问题分类(gov政府software软件,逗号分隔) + */ + private String adviceType; + + /** + * 回复内容 + */ + private String replyContent; + + /** + * 回复人id + */ + private String replyUserId; + + /** + * 回复人姓名 + */ + private String replyUserName; + + /** + * 回复时间 + */ + private Date replyTime; + + /** + * 建议回复内容 + */ + private String govContent; + + /** + * 删除标志 + */ + 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserAdviceImgDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserAdviceImgDTO.java new file mode 100644 index 0000000000..029dbac2ee --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserAdviceImgDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户建议图片 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class UserAdviceImgDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 建议id + */ + private String adviceId; + + /** + * 图片类型,resi是用户上传的建议图片,oper是运营上传的代替政府回复的存证 + */ + private String type; + + /** + * 图片url + */ + private String imgUrl; + + /** + * 删除标志 + */ + 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserBadgeCertificateRecordDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserBadgeCertificateRecordDTO.java new file mode 100644 index 0000000000..5969d6d34b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserBadgeCertificateRecordDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户认证徽章记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class UserBadgeCertificateRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 用户注册网格ID + */ + private String gridId; + + /** + * 用户ID + */ + private String userId; + + /** + * 徽章ID + */ + private String badgeId; + + /** + * 姓 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 网格内去重 + */ + private String idNum; + + /** + * 认证证件图片 + */ + private String certificationImg; + + /** + * 认证说明(备注) + */ + private String remaek; + + /** + * 审核状态 approved:审核通过,rejected:审核驳回;auditing:审核中 + */ + private String auditStatus; + + /** + * 审核意见 + */ + private String auditRemark; + + /** + * 审核人 审核人Id + */ + private String staffId; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 是否是最新纪录:yes:最新纪录,no:非最新纪录 + */ + private String isLast; + + /** + * 删除标识 1删除;0未删除 + */ + 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserBaseInfoDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserBaseInfoDTO.java new file mode 100644 index 0000000000..d610234056 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserBaseInfoDTO.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class UserBaseInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户id + */ + private String userId; + + /** + * 手机号(注册手机号) + */ + private String mobile; + + /** + * 姓氏 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 姓+名 + */ + private String realName; + + /** + * 身份证号 + */ + private String idNum; + + /** + * 性别(1男2女0未知) + */ + private String gender; + + /** + * 街道 + */ + private String street; + + /** + * 小区名称 + */ + private String district; + + /** + * 楼栋单元 + */ + private String buildingAddress; + + /** + * 昵称(目前来源于微信昵称,后续系统可支持用户有昵称) + */ + private String nickname; + + /** + * 头像(目前来源于微信,后续系统顾客支持上传头像) + */ + private String headImgUrl; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserCustomerDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserCustomerDTO.java new file mode 100644 index 0000000000..9922266f3a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserCustomerDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户客户关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class UserCustomerDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 用户Id user.id + */ + private String userId; + + /** + * 是否注册 1注册; 0未注册 + */ + private String isRegister; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserDTO.java new file mode 100644 index 0000000000..6d79de576b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class UserDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 来源app(政府端:gov、居民端:resi、运营端:oper) + */ + private String fromApp; + + /** + * 来源client(PC端:web、微信小程序:wxmp) + */ + private String fromClient; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserInvitationDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserInvitationDTO.java new file mode 100644 index 0000000000..5a048747b7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserInvitationDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 人员邀请关系表 记录user之间的邀请关系 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class UserInvitationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + /** + * 网格Id (customer_grid.id) + */ + private String gridId; + + /** + * 邀请人Id + */ + private String inviterUserId; + + /** + * 被邀请人Id + */ + private String inviteeUserId; + + /** + * 邀请场景 (value:feature+action) + */ + private String inviteSource; + + /** + * 邀请记录Id + */ + private String inviteSourceId; + + /** + * 邀请时间 + */ + private Date invitationTime; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserResiInfoDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserResiInfoDTO.java new file mode 100644 index 0000000000..48474f547f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserResiInfoDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户居民端注册信息表 用户在居民端完善的个人信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class UserResiInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 用户Id(主键) user.id + */ + private String userId; + + /** + * 手机号(注册手机号) + */ + private String regMobile; + + /** + * 姓氏 + */ + private String surname; + + /** + * 名称 + */ + private String name; + + /** + * 街道 + */ + private String street; + + /** + * 小区名称 + */ + private String district; + + /** + * 楼栋单元 + */ + private String buildingAddress; + + /** + * 居民注册行为记录表Id resi_visit.id + */ + private String resiVisitId; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserResiRegisterVisitDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserResiRegisterVisitDTO.java new file mode 100644 index 0000000000..43e72c1ada --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserResiRegisterVisitDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户居民端注册访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class UserResiRegisterVisitDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + /** + * 用户Id (user.id) + */ + private String userId; + + /** + * 网格Id (customer_grid.id) + */ + private String gridId; + + /** + * 访问来源 【指的是用户点的那个功能进入到的注册页面,就是一个功能模块的Id(value:feature+action)】 + */ + private String visitFrom; + + /** + * 最后一次操作行为 key:operate_visit value:(initialize:初始化 sms_Code:获取验证码 success:提交成功 faild:提交失败) + */ + private String lastOperateVisit; + + /** + * 访问时间 + */ + private Date visitTime; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserRoleDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserRoleDTO.java new file mode 100644 index 0000000000..3e369e1099 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserRoleDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户角色关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class UserRoleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 网格表Id(CUSTOMER_GRID.id)【居民党员角色值为all,热心居民角色对应的网格Id】 + */ + private String gridId; + + /** + * 用户Id user.id + */ + private String userId; + + /** + * 角色Id 【角色表Id】 + */ + private String roleId; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserWechatDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserWechatDTO.java new file mode 100644 index 0000000000..6ddad76885 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/UserWechatDTO.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.dataaggre.dto.epmetuser; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户微信端关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class UserWechatDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 用户Id user.id + */ + private String userId; + + /** + * openId + */ + private String wxOpenId; + + /** + * 微信unionId + */ + private String wxUnionId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 昵称 + */ + private String nickname; + + /** + * 性别 + */ + private Integer sex; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 国家 + */ + private String country; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 语言 + */ + private String language; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/EvaluateInfoDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/EvaluateInfoDTO.java new file mode 100644 index 0000000000..4933a0a00c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/EvaluateInfoDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dataaggre.dto.govissue; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * 评价信息 + */ +@Data +public class EvaluateInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 评价内容 + */ + private String evaluateContent; + + /** + * 满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + private String satisfaction; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueApplicationDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueApplicationDTO.java new file mode 100644 index 0000000000..4565baf59c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueApplicationDTO.java @@ -0,0 +1,133 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.govissue; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 话题转议题申请表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-17 + */ +@Data +public class IssueApplicationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 议题名称 + */ + private String issueTitle; + + /** + * 建议 + */ + private String suggestion; + + /** + * 审核状态:under_auditing:待审核;approved:通过;rejected:驳回;自动通过:auto_passed + */ + private String applyStatus; + + /** + * 话题id + */ + private String topicId; + + /** + * 小组id + */ + private String groupId; + + /** + * 网格ID 居民端议题对应一个网格Id + */ + private String gridId; + + /** + * 审核通过后对应的 议题id + */ + private String issueId; + + /** + * 审核通过时填写的理由 + */ + private String passedReason; + + /** + * 审批通过时工作人员id,自动通过此列不存储 + */ + private String approveStaffId; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + //拓展属性 + /** + * 申请id + */ + private String issueApplicationId; + + /** + * 对应issue_application.UPDATED_TIME 对应的秒级时间戳 + */ + private Long latestTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueApplicationHistoryDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueApplicationHistoryDTO.java new file mode 100644 index 0000000000..65376d7dd9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueApplicationHistoryDTO.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.dataaggre.dto.govissue; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 话题转议题审核历史表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-17 + */ +@Data +public class IssueApplicationHistoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题转议题申请表 issue_application.id + */ + private String issueApplicationId; + + /** + * under_auditing:待审核; + * approved:审核通过; + * rejected:驳回; + * auto_passed:自动通过 + */ + private String actionType; + + /** + * 审核时的说明 + */ + private String reason; + + /** + * 工作端人员姓名 + */ + private String staffName; + + /** + * 删除标识:0 未删除 1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 提交人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 修改人ID + */ + private String updatedBy; + + /** + * 修改时间 + */ + private Date updatedTime; + + //扩展属性 + /** + * =id + */ + private String historyId; + + /** + * createdTime 对应时间戳 + */ + private Long operateTime; +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueCustomerParameterDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueCustomerParameterDTO.java new file mode 100644 index 0000000000..c1290190eb --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueCustomerParameterDTO.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.dataaggre.dto.govissue; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 议题客户参数定制表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-12 + */ +@Data +public class IssueCustomerParameterDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 参数键 eg:voting_time_limit + */ + private String parameterKey; + + /** + * 参数名 eg:表决期限 + */ + private String parameterName; + + /** + * 参数值 eg:10(天) + */ + private String parameterValue; + + /** + * 参数说明 eg:这个客户下所有的网格议题表决期限都是10天 + */ + private String description; + + /** + * 删除标志 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueDTO.java new file mode 100644 index 0000000000..b3b36dba2d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueDTO.java @@ -0,0 +1,163 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.govissue; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 议题详情表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-12 + */ +@Data +public class IssueDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 议题ID + */ + private String id; + + /** + * 议题状态 表决中:voting 已转项目:shift_project 已关闭:closed + */ + private String issueStatus; + + /** + * 来源类型 eg:resi_topic + */ + private String sourceType; + + /** + * 来源ID eg:2223232(当SOURCE_TYPE为"resi_topic"时,这里指话题的ID) + */ + private String sourceId; + + /** + * 关闭理由 【未关闭时可以为空】关闭议题时必填的理由,转项目后而且已经结案,这个字段不回写 + */ + private String closeReason; + + /** + * 解决类型 【未关闭时可以为空】已解决resolved、未解决unresolved,对应在关闭议题时所选的checkbox,转项目后而且已经结案,这个字段不回写 + */ + private String resolveType; + + /** + * 议题名称 最多20字 + */ + private String issueTitle; + + /** + * 建议 最多1000字 + */ + private String suggestion; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID 居民端议题对应一个网格Id + */ + private String gridId; + + /** + * 所属机关 【数据权限-非必填】11:22:33(agencyId)数据权限控制 + */ + private String orgIdPath; + + /** + * 组织ID 【数据权限-非必填】agencyId + */ + private String orgId; + + /** + * 表决截止日期 + */ + private Date votingDeadline; + + /** + * 表决发起日期(转议题日期) + */ + private Date decidedTime; + + /** + * 转项目日期 (服务间调用日期一致性) + */ + private Date shiftedTime; + + /** + * 关闭日期 + */ + private Date closedTime; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 转项目日期 (服务间调用日期一致性) 戳 + */ + private Long shiftedTimeStamp; + + /** + * 关闭日期 戳 + */ + private Long closedTimeStamp; + + /** + * 议题转项目后-对应的项目id + */ + private String projectId; + + private String issueId; +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProcessDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProcessDTO.java new file mode 100644 index 0000000000..268b2b673c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProcessDTO.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.govissue; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 议题进展记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-12 + */ +@Data +public class IssueProcessDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 议题ID + */ + private String issueId; + + /** + * 操作状态 - 表决中:voting 已转项目:shift_project 已关闭:closed + */ + private String issueStatus; + + /** + * 组织类型 操作人所属机构类型(机构:agency | 部门:dept | 网格:grid)操作人可能来源于居民端和政府段,但是只有在“转议题”的时候才是居民端拥有组长权限的人操作,所以当这条记录是转议题时,该记录为grid,ORD_ID相应的也为GRID_ID + */ + private String orgType; + + /** + * 组织ID 操作人所属机构ID(对应的有网格ID、部门ID、机构ID) + */ + private String orgId; + + /** + * 操作说明 (节点的说明文案,包含三个节点的文案说明【转议题】、【已关闭】、【转项目】) + */ + private String operationExplain; + + /** + * 组织名称 + * */ + private String orgName; + + /** + * 删除标识 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProjectRelationDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProjectRelationDTO.java new file mode 100644 index 0000000000..3e3d53ee6e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueProjectRelationDTO.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.dataaggre.dto.govissue; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 议题项目关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-12 + */ +@Data +public class IssueProjectRelationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID 主键ID + */ + private String id; + + /** + * 议题ID 议题ID + */ + private String issueId; + + /** + * 项目ID 项目ID + */ + private String projectId; + + /** + * 删除标识 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueSatisfactionDetailDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueSatisfactionDetailDTO.java new file mode 100644 index 0000000000..626afb8f37 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueSatisfactionDetailDTO.java @@ -0,0 +1,87 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.govissue; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 议题满意度调查记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-12 + */ +@Data +public class IssueSatisfactionDetailDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 议题ID + */ + private String issueId; + + /** + * 评论 - 最多300字 + */ + private String comment; + + /** + * 满意度 满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + private String satisfaction; + + /** + * 删除标识 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueSatisfactionStatisticalDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueSatisfactionStatisticalDTO.java new file mode 100644 index 0000000000..f80a037561 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueSatisfactionStatisticalDTO.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.govissue; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 议题满意度调查统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-12 + */ +@Data +public class IssueSatisfactionStatisticalDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 议题ID + */ + private String issueId; + + /** + * 一般满意数 + */ + private Integer goodCount; + + /** + * 非常满意数 + */ + private Integer perfectCount; + + /** + * 不满意数 + */ + private Integer badCount; + + /** + * 删除标识 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueSuggestionDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueSuggestionDTO.java new file mode 100644 index 0000000000..5f3dd43f10 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueSuggestionDTO.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.dataaggre.dto.govissue; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 居民端用户对议题建议或意见表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-18 + */ +@Data +public class IssueSuggestionDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 议题id + */ + private String issueId; + + /** + * 议题所属网格id + */ + private String gridId; + + /** + * 对议题的想法 + */ + private String suggestion; + + /** + * 1公开; 0匿名 + */ + private Integer publicFlag; + + /** + * 删除标识:0 未删除 1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 提建议的人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 修改人ID + */ + private String updatedBy; + + /** + * 修改时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueVoteDetailDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueVoteDetailDTO.java new file mode 100644 index 0000000000..47e582c324 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueVoteDetailDTO.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.dataaggre.dto.govissue; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 议题表决记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-12 + */ +@Data +public class IssueVoteDetailDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 议题ID + */ + private String issueId; + + /** + * 态度 - opposition(反对)support(赞成) + */ + private String attitude; + + /** + * 删除标识 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueVoteStatisticalDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueVoteStatisticalDTO.java new file mode 100644 index 0000000000..fdf0e660f3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueVoteStatisticalDTO.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.govissue; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 议题表决统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-12 + */ +@Data +public class IssueVoteStatisticalDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 议题ID + */ + private String issueId; + + /** + * 支持数 + */ + private Integer supportCount; + + /** + * 反对数 + */ + private Integer oppositionCount; + + /** + * 应表决数 + */ + private Integer votableCount; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueVoteStatisticalDailyDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueVoteStatisticalDailyDTO.java new file mode 100644 index 0000000000..0575ed5585 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/IssueVoteStatisticalDailyDTO.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.dataaggre.dto.govissue; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 议题表决按天统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-12 + */ +@Data +public class IssueVoteStatisticalDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 议题ID + */ + private String issueId; + + /** + * 统计日期 yyyy-MM-dd + */ + private Date statisticalDate; + + /** + * 到该日的总赞成数 + */ + private Integer supportCount; + + /** + * 到该日的总反对数 + */ + private Integer oppositionCount; + + /** + * 到该日的总票数 + */ + private Integer totalCount; + + /** + * 该日增量 + */ + private Integer todayIncrement; + + /** + * 该日赞成增量 + */ + private Integer supportIncrement; + + /** + * 该日反对增量 + */ + private Integer oppositionIncrement; + + /** + * 到该日的应表决数 + */ + private Integer votableCount; + + /** + * 删除标识 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/PolyLineDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/PolyLineDTO.java new file mode 100644 index 0000000000..00c03bdd2f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/PolyLineDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dataaggre.dto.govissue; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * 投票折线数据 + * @CreateTime 2020/5/11 9:36 + */ +@Data +public class PolyLineDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 投票日期 + */ + private Long voteDate; + + /** + * 当日赞成票数量 + */ + private Integer supportIncrement; + + /** + * 当日反对票数量 + */ + private Integer oppositionIncrement; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/TopicInfoDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/TopicInfoDTO.java new file mode 100644 index 0000000000..6cd9256c17 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/TopicInfoDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dataaggre.dto.govissue; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * 话题详情(议题详情中的) + * @CreateTime 2020/5/11 9:36 + */ +@Data +public class TopicInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 话题id + */ + private String topicId; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 图片列表 + */ + private List topicImgs; + + /** + * 话题发表人(山东路168-尹女士) + */ + private String publishedUser; + + /** + * 话题发表时间 (时间戳 毫秒级) + */ + private Long publishedTime; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/form/AllIssueFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/form/AllIssueFormDTO.java new file mode 100644 index 0000000000..73822375f0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/form/AllIssueFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dataaggre.dto.govissue.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/12/25 下午1:26 + */ +@Data +public class AllIssueFormDTO implements Serializable { + + private static final long serialVersionUID = -7857792672812118217L; + + public interface AllIssueForm{} + + @NotNull(message = "页码不能为空",groups = {AllIssueForm.class}) + private Integer pageNo; + + @NotNull(message = "每页数量不能为空",groups = {AllIssueForm.class}) + private Integer pageSize; + + @NotNull(message = "议题类型不能为空",groups = {AllIssueForm.class}) + private String issueType; + + /** + * 网格Id集合 + */ + private List gridIdList; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/form/ClosedIssueListFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/form/ClosedIssueListFormDTO.java new file mode 100644 index 0000000000..2fe2404bd9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/form/ClosedIssueListFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.govissue.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 议题-已关闭列表-接口入参 + * @Auth sun + */ +@Data +public class ClosedIssueListFormDTO implements Serializable { + private static final long serialVersionUID = -436147374473316845L; + /** + * 机关组织Id + * */ + @NotBlank(message = "组织Id不能为空", groups = {ClosedIssueListFormDTO.ClosedForm.class}) + private String agencyId; + /** + * 页码 + * */ + @Min(1) + private Integer pageNo; + /** + * 每页多少条 + * */ + private Integer pageSize = 20; + /** + * 组织下网格Id集合 + * */ + private List gridIdList; + + public interface ClosedForm{} +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/form/ShiftProjectIssueListFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/form/ShiftProjectIssueListFormDTO.java new file mode 100644 index 0000000000..34f3d13326 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/form/ShiftProjectIssueListFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.govissue.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 议题-已转项目列表-接口入参 + * @Auth sun + */ +@Data +public class ShiftProjectIssueListFormDTO implements Serializable { + private static final long serialVersionUID = -436147374473316845L; + /** + * 机关组织Id + * */ + @NotBlank(message = "组织Id不能为空", groups = {ShiftProjectIssueListFormDTO.ShiftForm.class}) + private String agencyId; + /** + * 页码 + * */ + @Min(1) + private Integer pageNo; + /** + * 每页多少条 + * */ + private Integer pageSize = 20; + + public interface ShiftForm{} +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/form/VotingIssueListFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/form/VotingIssueListFormDTO.java new file mode 100644 index 0000000000..9b5a1ad4d8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/form/VotingIssueListFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.govissue.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 议题-表决中列表-接口入参 + * @Auth sun + */ +@Data +public class VotingIssueListFormDTO implements Serializable { + private static final long serialVersionUID = -436147374473316845L; + /** + * 机关组织Id + * */ + @NotBlank(message = "组织Id不能为空", groups = {VotingIssueListFormDTO.VotingForm.class}) + private String agencyId; + /** + * 页码 + * */ + @Min(1) + private Integer pageNo; + /** + * 每页多少条 + * */ + private Integer pageSize = 20; + /** + * 组织下网格Id集合 + * */ + private List gridIdList; + + public interface VotingForm{} +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/AllIssueResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/AllIssueResultDTO.java new file mode 100644 index 0000000000..ec9e6a2526 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/AllIssueResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dataaggre.dto.govissue.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/12/25 下午1:32 + */ +@Data +public class AllIssueResultDTO implements Serializable { + + private static final long serialVersionUID = -2729009012650779109L; + + /** + * 议题总数 + */ + private Integer total; + + /** + * 议题列表 + */ + private List issueList; + + public AllIssueResultDTO() { + this.total = 0; + this.issueList = new ArrayList<>(); + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/ClosedIssueListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/ClosedIssueListResultDTO.java new file mode 100644 index 0000000000..cad51d4517 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/ClosedIssueListResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dataaggre.dto.govissue.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 议题-已关闭列表-接口返参 + * @Auth sun + */ +@Data +public class ClosedIssueListResultDTO implements Serializable { + + private static final long serialVersionUID = 3809252070982486401L; + + /** + * 网格Id(方便查操作权限) + * */ + @JsonIgnore + private String gridId; + /** + * 议题id + * */ + private String issueId; + /** + * 议题标题 + * */ + private String issueTitle; + /** + * 所属网格(网格所属组织名称-网格名称) + * */ + private String belongsGridName; + /** + * 关闭说明(关闭时的答复) + * */ + private String closeReason; + /** + * 议题关闭时间 时间戳 + * */ + private Long closedTime; + /** + * 实际总表决数 + * */ + private Integer count; +} 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/govissue/result/IssueListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/IssueListResultDTO.java new file mode 100644 index 0000000000..f1561c2a1b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/IssueListResultDTO.java @@ -0,0 +1,133 @@ +package com.epmet.dataaggre.dto.govissue.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/12/25 下午1:34 + */ +@Data +public class IssueListResultDTO implements Serializable { + + private static final long serialVersionUID = -2926735144624342550L; + + /** + * 议题ID + */ + private String issueId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 议题标题 + */ + private String issueTitle; + + /** + * 所属网格(网格所属组织名称-网格名称) + */ + private String belongsGridName; + + /** + * 议题建议 + */ + private String suggestion; + + /** + * 网格ID + */ + private String gridId; + + /** + * 议题创建时间 + */ + private Long createTime; + + /** + * 议题关闭说明(关闭时的答复) + */ + private String issueCloseReason; + + /** + * 议题关闭时间 + */ + private Long issueClosedTime; + + /** + * 议题状态 + */ + private String status; + + /** + * 结案说明 + */ + private String closedReason; + + /** + * 驳回理由 + */ + private String rejectedReason; + + /** + * 驳回时间 + */ + private Long rejectedTime; + + /** + * 话题ID + */ + private String topicId; + + /** + * 审核中的创建时间 + */ + private Long auditingTime; + + /** + * 转项目时间 + */ + private Long shiftProjectTime; + + /** + * 当前处理部门 + */ + private List currentDepartment; + + private String issueApplicationId; + + @JsonIgnore + private Long operationTime; + + @JsonIgnore + private String applyStatus; + + public IssueListResultDTO() { + this.issueId = ""; + this.issueTitle = ""; + this.belongsGridName = ""; + this.suggestion = ""; + this.gridId = ""; + this.createTime = 0L; + this.issueCloseReason = ""; + this.issueClosedTime = 0L; + this.status = ""; + this.closedReason = ""; + this.rejectedReason = ""; + this.rejectedTime = 0L; + this.topicId = ""; + this.auditingTime = 0L; + this.shiftProjectTime = 0L; + this.currentDepartment = new ArrayList<>(); + this.projectId = ""; + this.issueClosedTime = 0L; + this.issueApplicationId = ""; + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/IssueShiftProjectResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/IssueShiftProjectResultDTO.java new file mode 100644 index 0000000000..559b26a328 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/IssueShiftProjectResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dataaggre.dto.govissue.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 议题-已转项目列表-接口返参 + * @Auth sun + */ +@Data +public class IssueShiftProjectResultDTO implements Serializable { + private static final long serialVersionUID = -7134055957167447949L; + + /** + * 议题Id + * */ + private String issueId; + /** + * 议题标题 + * */ + private String issueTitle; + /** + * 实际总表决数 + * */ + private Integer count; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/ShiftProjectIssueListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/ShiftProjectIssueListResultDTO.java new file mode 100644 index 0000000000..4c55d2e9bf --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/ShiftProjectIssueListResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dataaggre.dto.govissue.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 议题-已转项目列表-接口入参 + * @Auth sun + */ +@Data +public class ShiftProjectIssueListResultDTO implements Serializable { + private static final long serialVersionUID = -8616067919204282328L; + /** + * 议题Id + */ + private String issueId; + /** + * 议题标题 + */ + private String issueTitle; + /** + * 当前处理部门 + */ + private List departmentNameList; + /** + * 转成项目时间 + */ + private Long shiftedTime; + /** + * 项目状态 + */ + private String status; + /** + * 结案说明 + */ + private String closedReason; + /** + * 实际总表决数 + */ + private Integer count; + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/VotingIssueListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/VotingIssueListResultDTO.java new file mode 100644 index 0000000000..e514dc21c8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govissue/result/VotingIssueListResultDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dataaggre.dto.govissue.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 议题-表决中列表-接口返参 + * @Auth sun + */ +@Data +public class VotingIssueListResultDTO implements Serializable { + private static final long serialVersionUID = -7134055957167447949L; + + /** + * 网格Id(方便查操作权限) + * */ + private String gridId; + /** + * 议题Id + * */ + private String issueId; + /** + * 议题标题 + * */ + private String issueTitle; + /** + * 所属网格(网格所属组织名称-网格名称) + * */ + private String belongsGridName; + /** + * 议题建议 + * */ + private String suggestion; + /** + * 议题创建时间 + * */ + private Long createTime; + /** + * 实际总表决数 + * */ + private Integer count; + +} 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 new file mode 100644 index 0000000000..4b98fb899f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerAgencyDTO.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.dataaggre.dto.govorg; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 机关单位信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +public class CustomerAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 所有上级名称,以-连接 + */ + private String allParentName; + + /** + * 组织名称 + */ + private String organizationName; + + /** + * 机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) + */ + private String level; + + /** + * 地区编码 + */ + private String areaCode; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 总人数 + */ + private Integer totalUser; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 区县 + */ + 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/govorg/CustomerDepartmentDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerDepartmentDTO.java new file mode 100644 index 0000000000..ca02fda8bf --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerDepartmentDTO.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.dataaggre.dto.govorg; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 客户部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +public class CustomerDepartmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 所属组织机构ID(customer_organization.id)AGENCY_ID + */ + private String agencyId; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门职责 + */ + private String departmentDuty; + + /** + * 总人数 + */ + private Integer totalUser; + + /** + * 删除标识: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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.java new file mode 100644 index 0000000000..10620c89d2 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerGridDTO.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.dataaggre.dto.govorg; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 客户网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +public class CustomerGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 所属地区码(所属组织地区码) + */ + private String areaCode; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 管辖区域 + */ + private String manageDistrict; + + /** + * 当前网格总人数 + */ + private Integer totalUser; + + /** + * 所属组织机构ID(customer_organization.id) + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; + + /** + * 所属组织机构名 + */ + private String agencyName; + + /** + * 所有上级组织名 + */ + private String allParentName; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerIdDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerIdDTO.java new file mode 100644 index 0000000000..5d0eaf4f42 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerIdDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dataaggre.dto.govorg; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 根据userId查询customerId 的DTO + * @Auther zxc + * @Create 2020-04-24 15:57 + */ +@Data +public class CustomerIdDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * userId 用户id + */ + private String userId; + + /** + * customerId 客户id + */ + private String customerId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerPartyBranchDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerPartyBranchDTO.java new file mode 100644 index 0000000000..328d06074f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerPartyBranchDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.govorg; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 党支部信息 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class CustomerPartyBranchDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 支部名称 + */ + private String partyBranchName; + + /** + * 概要 + */ + private String profile; + + /** + * 党支部所属网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 党员总数 + */ + private Integer totalPartyMember; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属机关id + */ + private String agencyId; + + /** + * 网格所属机关名字 + */ + private String agencyName; +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerStaffAgencyDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerStaffAgencyDTO.java new file mode 100644 index 0000000000..b161af7cb4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerStaffAgencyDTO.java @@ -0,0 +1,87 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.govorg; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 人员-机关单位关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +public class CustomerStaffAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户ID + */ + private String userId; + + /** + * 组织机构ID customer_agency.id + */ + private String agencyId; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerStaffDepartmentDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerStaffDepartmentDTO.java new file mode 100644 index 0000000000..08bab4309f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerStaffDepartmentDTO.java @@ -0,0 +1,87 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.govorg; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 部门人员关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +public class CustomerStaffDepartmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户ID + */ + private String userId; + + /** + * 部门ID customer_department.id + */ + private String departmentId; + + /** + * 删除标识 + */ + 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerStaffGridDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerStaffGridDTO.java new file mode 100644 index 0000000000..61fabd36c0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/CustomerStaffGridDTO.java @@ -0,0 +1,87 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.govorg; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 网格人员关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +public class CustomerStaffGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 用户id, user.id + */ + private String userId; + + /** + * 网格ID customer_grid.id + */ + private String gridId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 删除标识 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/GridStaffCountDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/GridStaffCountDTO.java new file mode 100644 index 0000000000..82f42cae99 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/GridStaffCountDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dataaggre.dto.govorg; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-24 9:13 + */ +@Data +public class GridStaffCountDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格下未被禁用的工作人员数量 + */ + private Integer enableCount; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/OrgTreeNode.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/OrgTreeNode.java new file mode 100644 index 0000000000..0612a7eaf9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/OrgTreeNode.java @@ -0,0 +1,13 @@ +package com.epmet.dataaggre.dto.govorg; + +import lombok.Data; + +import java.util.List; + +@Data +public class OrgTreeNode { + private String orgId; + private String orgName; + private String orgType; + private List subOrgs; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/StaffGridListDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/StaffGridListDTO.java new file mode 100644 index 0000000000..9d5f3b263d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/StaffGridListDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dataaggre.dto.govorg; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-23 10:38 + */ +@Data +public class StaffGridListDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 用户id + */ + private String staffId; + + /** + * 用户姓名 + */ + private String staffName; + + /** + * 用户头像 + */ + private String staffHeadPhoto; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 性别 + */ + private String gender; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/StaffTransferRecordDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/StaffTransferRecordDTO.java new file mode 100644 index 0000000000..2c8b88cea4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/StaffTransferRecordDTO.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.govorg; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 工作人员调动记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Data +public class StaffTransferRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 调动人员Id(操作人) + */ + private String operateStaffId; + + /** + * 被调动人员Id + */ + private String operatedStaffId; + + /** + * 调动前组织Id + */ + private String oldAgencyId; + + /** + * 调动后组织Id + */ + private String agencyId; + + /** + * 备注说明 + */ + private String remarks; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/UserIdAndPidDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/UserIdAndPidDTO.java new file mode 100644 index 0000000000..0fc0abf32c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/UserIdAndPidDTO.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.dataaggre.dto.govorg; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 网格人员关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +public class UserIdAndPidDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 用户id, user.id + */ + private String userId; + + /** + * pid 所属机关id + */ + private String pid; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/UserIdDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/UserIdDTO.java new file mode 100644 index 0000000000..bb9a694d53 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/UserIdDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dataaggre.dto.govorg; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther zxc + * @Create 2020-04-24 9:06 + */ +@Data +public class UserIdDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * userId + */ + private String userId; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/.gitkeep b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/.gitkeep similarity index 100% rename from epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/.gitkeep rename to epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/.gitkeep diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/AgencyGridListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/AgencyGridListResultDTO.java new file mode 100644 index 0000000000..11511bedf4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/AgencyGridListResultDTO.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.dataaggre.dto.govorg.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 组织、网格树结构 + * + * @author sun + */ +@Data +public class AgencyGridListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 树结构对象 + */ + private AgencyGridResultDTO agencyGridList; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/AgencyGridResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/AgencyGridResultDTO.java new file mode 100644 index 0000000000..8066a7cc16 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/AgencyGridResultDTO.java @@ -0,0 +1,60 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.govorg.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + + +/** + * 获取工作人员所属组织及下级组织和网格树结构-接口返参 + * + * @author sun + */ +@Data +public class AgencyGridResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + private String agencyId = ""; + /** + * 机关组织名称 + */ + private String agencyName = ""; + /** + * 当前机关的下属网格列表 + */ + private List gridList = new ArrayList<>(); + /** + * 当前组织的所有下级组织信息(递归) + */ + private List subAgencyGridList = new ArrayList<>(); + /** + * 所有上级组织机构ID(以英文:隔开) + */ + @JsonIgnore + private String pids = ""; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridInfoResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridInfoResultDTO.java new file mode 100644 index 0000000000..45618fbff5 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridInfoResultDTO.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.dataaggre.dto.govorg.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 获取工作人员所属组织及下级组织和网格树结构-接口返参 + * + * @author sun + */ +@Data +public class GridInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + private String gridId = ""; + private String gridName = ""; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridsInfoListResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridsInfoListResultDTO.java new file mode 100644 index 0000000000..f25721539f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/GridsInfoListResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dataaggre.dto.govorg.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Auther sun + * 获取用户访问过的所有网格列表-接口返参 + */ +@Data +public class GridsInfoListResultDTO implements Serializable { + + private static final long serialVersionUID = -1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/CustomerProjectParameterDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/CustomerProjectParameterDTO.java new file mode 100644 index 0000000000..f9ef23d1d8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/CustomerProjectParameterDTO.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.dataaggre.dto.govproject; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 项目客户参数订制表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class CustomerProjectParameterDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 参数KEY值 + */ + private String parameterKey; + + /** + * 参数名称 + */ + private String parameterName; + + /** + * 参数VALUE值 + */ + private String parameterValue; + + /** + * 说明 + */ + private String description; + + /** + * 删除标识: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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectCategoryDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectCategoryDTO.java new file mode 100644 index 0000000000..cbda7d52f6 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectCategoryDTO.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.govproject; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ProjectCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 来源网格id + */ + private String gridId; + + /** + * 项目id + */ + private String projectId; + + /** + * 分类id + */ + private String categoryId; + + /** + * 分类对应的所有上级,英文逗号隔开 + */ + private String categoryPids; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectDTO.java new file mode 100644 index 0000000000..c73cc7ecd3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectDTO.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.dataaggre.dto.govproject; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Data +public class ProjectDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 来源:议题issue + */ + private String origin; + + /** + * 来源ID + */ + private String originId; + + /** + * 项目标题 + */ + private String title; + + /** + * 状态:待处理 pending,结案closed + */ + private String status; + + /** + * 结案说明 + */ + private String publicReply; + + /** + * 结案状态:已解决 resolved,未解决 unresolved + */ + private String closedStatus; + + /** + * 所属机关 11:22:33(本机关以及上级所有机关ID) + */ + private String orgIdPath; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 当前处理部门名称列表 + */ + private List currentDepartmentNameList; +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectOrgRelationDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectOrgRelationDTO.java new file mode 100644 index 0000000000..917aee0760 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectOrgRelationDTO.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.dataaggre.dto.govproject; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 项目机关历时关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ProjectOrgRelationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 关联PROJECT_STAFF,由此ID可以关联出PROJECT_ID、CUSTOMER_ID、PROCESS_ID + */ + private String projectStaffId; + + /** + * 流转到的日期 同CREATED_TIME + */ + private Date informedDate; + + /** + * 流转走或结案的日期 + */ + private Date handledDate; + + /** + * 节点耗时,从流转到自己到流转走共耗时,单位:分钟,如果项目还没有结案且该项目在这个组织下一直滞留,这一项为空 +8*60的倍数 + */ + private Integer totalPeriod; + + /** + * 第一次响应时间 + */ + private Date firstDealtDate; + + /** + * 首次响应时长,单位:分钟 +8*60的倍数 + */ + private Integer firstReplyPeriod; + + /** + * 来源动作,return(回退)、transfer(流转)、closed(结案)、response(响应)、created(立项时第一个流转到的) + */ + private String sourceOperation; + + /** + * 处理动作,return(回退)、transfer(流转)、closed(结案)、response(响应) + */ + private String operation; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date updatedTime; + + /** + * + */ + private String updatedBy; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessAttachmentDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessAttachmentDTO.java new file mode 100644 index 0000000000..5e8a24fec4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessAttachmentDTO.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.dataaggre.dto.govproject; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目节点附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ProjectProcessAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户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 Integer isRelease; + + /** + * 附件审核状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) +现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 附件审核结果描述 + */ + private String reason; + + /** + * 删除标识: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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessDTO.java new file mode 100644 index 0000000000..8d566b72ef --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessDTO.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.dataaggre.dto.govproject; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 项目处理进展表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ProjectProcessDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 处理部门 + */ + private String departmentName; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 所属机关(11:22:33) + */ + private String orgIdPath; + + /** + * 负负责人ID + */ + private String staffId; + + /** + * 处理:结案close,退回return,部门流转transfer,创建项目created + */ + private String operation; + + /** + * 处理进展名称 + */ + private String operationName; + + /** + * 公开答复 + */ + private String publicReply; + + /** + * 内部备注 + */ + private String internalRemark; + + /** + * 结束时间 + */ + private Date endTime; + + /** + * 耗费天数 + */ + private String costWorkdays; + + /** + * 删除标识: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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessScanTaskDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessScanTaskDTO.java new file mode 100644 index 0000000000..4200614e72 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectProcessScanTaskDTO.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.govproject; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目节点附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ProjectProcessScanTaskDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 项目进展表(project_process)ID + */ + private String processId; + + /** + * 项目附件表主键,对应dataId + */ + private String projectProcessAttachmentId; + + /** + * 阿里云审核任务Id + */ + private String taskId; + + /** + * 审核状态【auditing: 审核中; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规;】 + */ + private String status; + + /** + * 附件类型(视频 - video、 语音 - voice 文件 - doc) + */ + private String attachmentType; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectRelatedPersonnelDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectRelatedPersonnelDTO.java new file mode 100644 index 0000000000..87ed6f6173 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectRelatedPersonnelDTO.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.dataaggre.dto.govproject; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目相关人员表(存放话题人、议题人数据) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ProjectRelatedPersonnelDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 唯一标识 + */ + private String id; + + /** + * 项目ID + */ + private String projectId; + + /** + * 所属端 居民端用户resi、政府端工作人员gov、运营端工作人员oper + */ + private String app; + + /** + * 网格ID app=resi时,此列为gridId,其他情况暂定 * + */ + private String gridId; + + /** + * 来源类型(话题:topic 议题:issue) + */ + private String sourceType; + + /** + * 来源Id(话题或议题Id) + */ + private String sourceId; + + /** + * 用户ID + */ + private String userId; + + /** + * 删除标识 + */ + 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectSatisfactionDetailDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectSatisfactionDetailDTO.java new file mode 100644 index 0000000000..96498ad3ca --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectSatisfactionDetailDTO.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.dataaggre.dto.govproject; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目满意度调查记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ProjectSatisfactionDetailDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 项目ID + */ + private String projectId; + + /** + * 评论 - 最多300字 + */ + private String comment; + + /** + * 满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + private String satisfaction; + + /** + * 删除标识 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectSatisfactionStatisticsDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectSatisfactionStatisticsDTO.java new file mode 100644 index 0000000000..4498a44038 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectSatisfactionStatisticsDTO.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.dataaggre.dto.govproject; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目满意度调查统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ProjectSatisfactionStatisticsDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 项目ID + */ + private String projectId; + + /** + * 一般满意数 + */ + private Integer goodCount; + + /** + * 非常满意数 + */ + private Integer perfectCount; + + /** + * 不满意数 + */ + private Integer badCount; + + /** + * 删除标识 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectStaffDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectStaffDTO.java new file mode 100644 index 0000000000..1140b0bbb6 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectStaffDTO.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.govproject; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目人员关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ProjectStaffDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 项目ID + */ + private String projectId; + + /** + * 处理进展ID + */ + private String processId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String orgId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 所属机关(11:22:33) + */ + private String orgIdPath; + + /** + * 人员ID + */ + private String staffId; + + /** + * 处理部门 + */ + private String departmentName; + + /** + * 是否处理:未处理unhandled,已处理handle + */ + private String isHandle; + + /** + * 删除标识: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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectTagsDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectTagsDTO.java new file mode 100644 index 0000000000..60f01c7299 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/ProjectTagsDTO.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.dataaggre.dto.govproject; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ProjectTagsDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + + /** + * 删除标识 0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/AllProjectFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/AllProjectFormDTO.java new file mode 100644 index 0000000000..7ddd901d11 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/form/AllProjectFormDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dataaggre.dto.govproject.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/12/25 14:46 + */ +@NoArgsConstructor +@Data +public class AllProjectFormDTO implements Serializable { + + private static final long serialVersionUID = -8515172319313536407L; + /** + * 排序方式 + */ + private String sortType; + /** + * 项目状态(处理中:pending 已结案:closed) + */ + private String projectStatus; + /** + * 排序方式 + */ + private Integer pageNo = 1; + /** + * 排序方式 + */ + private Integer pageSize = 20; + /** + * 网格ID集合 + */ + private List gridIdList; + + private String agencyId; +} 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/AllProjectResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/AllProjectResultDTO.java new file mode 100644 index 0000000000..3df14e2e75 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/AllProjectResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dataaggre.dto.govproject.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/12/25 15:38 + */ +@Data +public class AllProjectResultDTO implements Serializable { + private static final long serialVersionUID = 6188316867855643263L; + private Integer projectCount; + private List projectList; +} 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/govproject/result/ProjectInfoDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectInfoDTO.java new file mode 100644 index 0000000000..e38cbf7bb4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ProjectInfoDTO.java @@ -0,0 +1,66 @@ +package com.epmet.dataaggre.dto.govproject.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/12/25 15:03 + */ +@NoArgsConstructor +@Data +public class ProjectInfoDTO implements Serializable { + + private static final long serialVersionUID = 3217246702883400582L; + /** + * 项目ID + */ + private String projectId; + /** + * 项目标题 + */ + private String projectTitle; + /** + * 项目创建时间 + */ + private Long projectTime; + /** + * 结案说明 + */ + private String publicReply; + /** + * 项目状态 + */ + private String projectStatus; + /** + * 项目更新时间 + */ + private Long updateTime; + /** + * 涉及部门数 + */ + private Integer departmentCount; + /** + * 消耗时长 + */ + private Integer timeSpent; + /** + * 处理次数 + */ + private Integer processCount; + /** + * 当前处理部门 + */ + private List currentDisposeDept; + + @JsonIgnore + private Date startTime; + @JsonIgnore + private Date endTime; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ShiftProjectResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ShiftProjectResultDTO.java new file mode 100644 index 0000000000..01fe2533d2 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govproject/result/ShiftProjectResultDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dataaggre.dto.govproject.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/5/14 13:45 + */ +@Data +public class ShiftProjectResultDTO implements Serializable { + + private static final long serialVersionUID = 4807330131467747264L; + /** + * 唯一标识 + */ + private String id; + + /** + * 来源ID + */ + private String originId; + + /** + * 项目标题 + */ + private String title; + + /** + * 状态:待处理 pending,结案closed + */ + private String status; + + /** + * 结案说明 + */ + private String publicReply; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 当前处理部门 + */ + private List departmentNameList; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/EnterGroupSwitchDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/EnterGroupSwitchDTO.java new file mode 100644 index 0000000000..3cd065cf39 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/EnterGroupSwitchDTO.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.resigroup; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class EnterGroupSwitchDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 小组所属网格id + */ + private String gridId; + + /** + * 小组id + */ + private String groupId; + + /** + * open开启; close关闭 + */ + private String auditSwitch; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人(customer_user.id) + */ + private String createdBy; + + /** + * 创建时间(邀请时间) + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/GroupEditSubmitRecordDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/GroupEditSubmitRecordDTO.java new file mode 100644 index 0000000000..977d02f9c4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/GroupEditSubmitRecordDTO.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 组编辑提交记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class GroupEditSubmitRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 小组ID + */ + private String groupId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 头像 + */ + private String groupHeadPhoto; + + /** + * 小组名称 + */ + private String groupName; + + /** + * 小组介绍 + */ + private String groupIntroduction; + + /** + * 审核状态。under_auditting:审核中,approved:通过,rejected:驳回 + */ + private String auditStatus; + + /** + * 审核人ID + */ + private String staffId; + + /** + * 回复 + */ + private String remark; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 提交人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 修改人ID + */ + private String updatedBy; + + /** + * 修改时间 + */ + private Date updatedTime; + + /** + * 已读read 未读unread + */ + private String readFlag; + + /** + * 审核人员查看待审核列表时的文案,如:党员李华申请变更小组【原小组名】,请审核。 + */ + private String messageText; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/GroupInvitationDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/GroupInvitationDTO.java new file mode 100644 index 0000000000..23ba23aeb8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/GroupInvitationDTO.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.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 群邀请记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class GroupInvitationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键(可能跟epmet-user的personnel_invite的[邀请Id]关联) + */ + private String id; + + /** + * 邀请人id(customer_user.id) + */ + private String inviterUserId; + + /** + * 邀请人所属客户id + */ + private String inviterCustomerId; + + /** + * 邀请网格id + */ + private String inviterGridId; + + /** + * 邀请小组id(resi_group.id) + */ + private String resiGroupId; + + /** + * 邀请链接:invited;扫码:scancode + */ + private String invitationType; + + /** + * 邀请内容 + */ + private String inviterContent; + + /** + * 邀请码有效截止时间(暂定XX天) + */ + private Date validEndTime; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人(customer_user.id) + */ + private String createdBy; + + /** + * 创建时间(邀请时间) + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/GroupMemeberOperationDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/GroupMemeberOperationDTO.java new file mode 100644 index 0000000000..c9c2ed3f88 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/GroupMemeberOperationDTO.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.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 组成员出入群记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class GroupMemeberOperationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户id来源于customer_user.id + */ + private String customerUserId; + + /** + * 群组表主键RESI_GROUP.ID + */ + private String groupId; + + /** + * 状态: +审核中 - under_auditting、 +审核通过 - approved、 +入群被拒 - rejected 、 +已禁言 - silent、 +取消禁言-cancel_silent resi_group_member中status置为approved +被移出群 - removed 修改resi_group_member表del_flag=1 +Ps: 1) 入群被拒绝之后,如果再申请是插入一条新的审核中的数据 + 2)组长看到的待审核列表,同一个人一开始被拒绝,后来再次申请,列表是显示2条 + */ + private String operateStatus; + + /** + * 入群方式:(受邀请入群 - invited;主动加入 - join;created创建群自动进入;scancode扫码入群;话题分享链接 - topic_share_link;议题分享链接 - issue_share_link) + */ + private String enterGroupType; + + /** + * 邀请连接id对应GROUP_INVITATION.id + */ + private String groupInvitationId; + + /** + * 入群理由、拒绝理由 + */ + private String operateDes; + + /** + * 操作人id + */ + private String operateUserId; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人(操作人id) + */ + private String createdBy; + + /** + * 创建时间(操作时间) + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/InvitationAccessRecordDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/InvitationAccessRecordDTO.java new file mode 100644 index 0000000000..fcada6acf6 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/InvitationAccessRecordDTO.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.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 邀请链接访问表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class InvitationAccessRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 邀请链接主键group_invitation.id + */ + private String invitationId; + + /** + * 用户idcustomer_user.id + */ + private String customerUserId; + + /** + * 状态:(已浏览 - viewed 、 同意加入小组 - tried 、 成功入群 - success) + */ + private String state; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人(用户id来源于customer_user.id) + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupCodeDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupCodeDTO.java new file mode 100644 index 0000000000..acc74838e7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupCodeDTO.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.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 小组二维码 小组唯一二维码,海报码和小组码是同一个二维码,长期有效的 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ResiGroupCodeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组Id + */ + private String groupId; + + /** + * 邀请id + */ + private String invitationId; + + /** + * 微信二维码使用类型 邀请:invite + */ + private String type; + + /** + * 二维码路径 + */ + private String url; + + /** + * 删除标志 + */ + 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupDTO.java new file mode 100644 index 0000000000..43e46572bb --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupDTO.java @@ -0,0 +1,112 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 群组信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ResiGroupDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 群头像(htt://地址) + */ + private String groupHeadPhoto; + + /** + * 小组名称 + */ + private String groupName; + + /** + * 群介绍 + */ + private String groupIntroduction; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 状态:(审核通过 - approved 、 审核中 - under_auditting、 审核未通过 - rejected 、 已屏蔽 - hidden、 已关闭 - closed) +Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审核未通过” + */ + private String state; + + /** + * 最新话题时间 + */ + private Date latestTopicPublishDate; + + /** + * 进组审核open开启;close关闭 + */ + private String auditSwitch; + + /** + * 删除标记 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupMemberDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupMemberDTO.java new file mode 100644 index 0000000000..126b85c8e8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupMemberDTO.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.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 群组成员关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ResiGroupMemberDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 用户id,来源于customer_user.id + */ + private String customerUserId; + + /** + * 小组id: 来源于resi_group表id + */ + private String resiGroupId; + + /** + * member成员,leader群主 + */ + private String groupLeaderFlag; + + /** + * 入群方式:(受邀请入群 - invited 、 主动加入 - join、created创建群自动进入、扫码入群-scancode) + */ + private String enterGroupType; + + /** + * 邀请连接id对应GROUP_INVITATION.id + */ + private String groupInvitationId; + + /** + * 状态:( 审核通过 - approved、 已禁言 - silent、被移出群 - removed) + */ + private String status; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人(用户id,来源于customer_user.id) + */ + private String createdBy; + + /** + * 创建时间(入群时间) + */ + private Date createdTime; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 更新人 + */ + private String updatedBy; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupOperationDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupOperationDTO.java new file mode 100644 index 0000000000..f9db3273e3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupOperationDTO.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.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 群组操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ResiGroupOperationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 小组id: 来源于resi_group表id + */ + private String resiGroupId; + + /** + * 状态:审核通过 - approved 、 审核中 - under_auditting、 审核未通过 - rejected 、 已屏蔽 - hidden、取消屏蔽 - hidden_cancelled、 (组的状态变为审核通过approved)、 已关闭 - closed + */ + private String state; + + /** + * 审核未通过理由 ,屏蔽理由,关闭原因 + */ + private String operateReason; + + /** + * 操作人id + */ + private String operateUserId; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人(操作人id) + */ + private String createdBy; + + /** + * 创建时间(操作时间) + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 审核人员已读未读标识(未读:unread 界面显示红点; 已读:read 不显示红点) + */ + private String readFlag; + + /** + * 消息通知内容 + */ + private String messageText; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupStatisticalDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupStatisticalDTO.java new file mode 100644 index 0000000000..357df74487 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiGroupStatisticalDTO.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.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 群组统计信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ResiGroupStatisticalDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 小组id: 来源于resi_group表id + */ + private String resiGroupId; + + /** + * 成员总数 + */ + private Integer totalMembers; + + /** + * 话题总数 + */ + private Integer totalTopics; + + /** + * 已转议题总数 + */ + private Integer totalIssues; + + /** + * 党员总数 + */ + private Integer totalPartyMembers; + + /** + * 热心居民总数 + */ + private Integer totalEarnestMemebers; + + /** + * 普通居民总数=群人数 + */ + private Integer totalNormalMemebers; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人(用户id,来源于customer_user.id) + */ + private String createdBy; + + /** + * 创建时间(入群时间) + */ + private Date createdTime; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 更新人 + */ + private String updatedBy; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiTopicAttachmentDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiTopicAttachmentDTO.java new file mode 100644 index 0000000000..58a0c9046b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiTopicAttachmentDTO.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.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ResiTopicAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 话题Id,关联resi_topic的id + */ + private String topicId; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + 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; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiTopicCommentDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiTopicCommentDTO.java new file mode 100644 index 0000000000..b84e9d8f10 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiTopicCommentDTO.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.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ResiTopicCommentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * + */ + private String commentContent; + + /** + * 话题Id,来自resi_topic + */ + private String topicId; + + /** + * 评论状态 + */ + private String status; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人,评论人Id,来自user + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..19c44136fb --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiTopicDTO.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.dataaggre.dto.resigroup; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 话题信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ResiTopicDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 小组Id,关联resi_group的ID + */ + private String groupId; + + /** + * + */ + private String topicContent; + + /** + * 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + */ + private String status; + + /** + * 关闭状态:已解决 resolved,未解决 unresolved + */ + private String closedStatus; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String area; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String dimension; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人,发布人Id来源于user + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 是否转为议题,0:false,1:true + */ + private Integer shiftIssue; + + /** + * 议题ID,可为空 + */ + private String issueId; + + /** + * 话题所属网格id + */ + private String gridId; +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiTopicOperationDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiTopicOperationDTO.java new file mode 100644 index 0000000000..74d8b5bd66 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ResiTopicOperationDTO.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.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ResiTopicOperationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 话题Id,关联resi_topic的ID + */ + private String topicId; + + /** + * 操作类型(发布 - discussing 、 屏蔽 - hidden、 取消屏蔽 - hidden_cancelled、 关闭话题 - closed) + */ + private String operationType; + + /** + * 屏蔽理由 + */ + private String operationReason; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人ID,关联user的ID + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicDraftAttachmentDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicDraftAttachmentDTO.java new file mode 100644 index 0000000000..519c1e5d13 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicDraftAttachmentDTO.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.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题草稿附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class TopicDraftAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 附件id + */ + private String id; + + /** + * 话题草稿id + */ + private String topicDraftId; + + /** + * 客户id + */ + private String customerId; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址url + */ + private String attachmentUrl; + + /** + * 排序字段(按附件类型分组排序) + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) +现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 失败原因 + */ + private String reason; + + /** + * 语音或视频时长,毫秒 + */ + private Integer duration; + + /** + * 删除标记 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicDraftDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicDraftDTO.java new file mode 100644 index 0000000000..d46e78aa2a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicDraftDTO.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.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class TopicDraftDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 话题草稿id + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组Id + */ + private String groupId; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 话题草稿状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) + */ + private String draftStatus; + + /** + * 草稿审核理由 + */ + private String draftReason; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String area; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String dimension; + + /** + * 发布成功后的话题id + */ + private String topicId; + + /** + * 创建者是否可见(0是 1否) + */ + private String isSee; + + /** + * 删除标记 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-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicDraftOperationDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicDraftOperationDTO.java new file mode 100644 index 0000000000..f0c554266f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicDraftOperationDTO.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.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题草稿操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class TopicDraftOperationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 话题草稿操作日志id + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 话题草稿id + */ + private String topicDraftId; + + /** + * 操作类型:submit:提交发布; +auto_passed: 自动审核-通过; +review:自动审核-结果不确定,需要人工审核; +block: 自动审核-结果违规; +rejected:人工审核驳回; +approved:人工审核通过 + */ + private String operateType; + + /** + * 操作时的备注,比如驳回理由 + */ + private String remark; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 操作人,API审核结果,存储为SCAN_USER或者APP_USER + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicDraftScanTaskDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicDraftScanTaskDTO.java new file mode 100644 index 0000000000..e6b90cb92a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicDraftScanTaskDTO.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题附件检测任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class TopicDraftScanTaskDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 话题草稿Id + */ + private String topicDraftId; + + /** + * 话题草稿附件表Id,对应dataId + */ + private String topicDraftAttachmentId; + + /** + * 阿里云审核任务Id + */ + private String taskId; + + /** + * 审核状态【auditing: 审核中; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规;】 + */ + private String status; + + /** + * 附件类型(视频 - video、 语音 - voice) + */ + private String attachmentType; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 操作人,API审核结果,存储为SCAN_USER或者APP_USER + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicShareLinkRecordDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicShareLinkRecordDTO.java new file mode 100644 index 0000000000..5d7cfb7116 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicShareLinkRecordDTO.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.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题分享链接表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class TopicShareLinkRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 邀请ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题所属网格ID + */ + private String gridId; + + /** + * 小组ID + */ + private String groupId; + + /** + * 话题ID + */ + private String topicId; + + /** + * 分享人ID(当前登录用户) + */ + private String shareUserId; + + /** + * 邀请内容 + */ + private String inviteContent; + + /** + * 删除状态 0:正常,1:删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicShareLinkVisitRecordDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicShareLinkVisitRecordDTO.java new file mode 100644 index 0000000000..c3674608ae --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/TopicShareLinkVisitRecordDTO.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.dataaggre.dto.resigroup; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题分享链接访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class TopicShareLinkVisitRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 分享人【邀请人】ID + */ + private String shareUserId; + + /** + * 被邀请人ID + */ + private String inviteeUserId; + + /** + * 话题分享链接表id + */ + private String shareLinkRecId; + + /** + * 是否邀请注册:0:是,1:不是; +默认为1,完成注册后,回填此字段 + */ + private Integer isInviteRegister; + + /** + * 删除状态,0:正常,1:删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/Dockerfile b/epmet-module/data-aggregator/data-aggregator-server/Dockerfile new file mode 100644 index 0000000000..57bc7e63b0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./data-aggregator.jar + +EXPOSE 8114 + +ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-dev.yml b/epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-dev.yml new file mode 100644 index 0000000000..e26e72451c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-dev.yml @@ -0,0 +1,18 @@ +version: "3.7" +services: + data-aggregator-server: + container_name: data-aggregator-server-dev + image: 192.168.1.130:10080/epmet-cloud-dev/data-aggregator-server:version_placeholder + ports: + - "8114:8114" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./data-aggregator.jar" + restart: "unless-stopped" + deploy: + resources: + limits: + cpus: '0.1' + memory: 300M \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-prod.yml b/epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-prod.yml new file mode 100644 index 0000000000..2906b958ce --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-prod.yml @@ -0,0 +1,18 @@ +version: "3.7" +services: + data-aggregator-server: + container_name: data-aggregator-server-prod + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-aggregator-server:0.3.1 + ports: + - "8114:8114" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/prod:/logs" + environment: + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./data-aggregator.jar" + restart: "unless-stopped" + deploy: + resources: + limits: + cpus: '0.1' + memory: 600M diff --git a/epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-test.yml b/epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..e066047e36 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/deploy/docker-compose-test.yml @@ -0,0 +1,18 @@ +version: "3.7" +services: + data-aggregator-server: + container_name: data-aggregator-server-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-aggregator-server:version_placeholder + ports: + - "8114:8114" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/test:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./data-aggregator.jar" + restart: "unless-stopped" + deploy: + resources: + limits: + cpus: '0.1' + memory: 300M \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/pom.xml b/epmet-module/data-aggregator/data-aggregator-server/pom.xml new file mode 100644 index 0000000000..c1e47d3b7e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -0,0 +1,371 @@ + + + + data-aggregator + com.epmet + 2.0.0 + + 4.0.0 + + data-aggregator-server + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + com.epmet + epmet-commons-mybatis + 2.0.0 + + + com.epmet + data-aggregator-client + 2.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + de.codecentric + spring-boot-admin-starter-client + ${spring.boot.admin.version} + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + + com.epmet + epmet-commons-dynamic-datasource + 2.0.0 + + + com.epmet + common-service-client + 2.0.0 + compile + + + com.epmet + gov-project-client + 2.0.0 + compile + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + + + + + + dev + + 8114 + dev + + + + + + epmet_gov_org_user + EpmEt-db-UsEr + + + + + + epmet_gov_issue_user + EpmEt-db-UsEr + + + + + + epmet_gov_project_user + EpmEt-db-UsEr + + + + + + epmet_resi_group_user + EpmEt-db-UsEr + + + + + + epmet_user_user + EpmEt-db-UsEr + + + 0 + 192.168.1.130 + 6379 + 123456 + + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + local + + true + + + 8114 + local + + + + + + epmet_gov_org_user + EpmEt-db-UsEr + + + + + + epmet_gov_issue_user + EpmEt-db-UsEr + + + + + + epmet_gov_project_user + EpmEt-db-UsEr + + + + + + epmet_resi_group_user + EpmEt-db-UsEr + + + + + + epmet_user_user + EpmEt-db-UsEr + + + 0 + 192.168.1.130 + 6379 + 123456 + + + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + + false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + test + + + 8114 + test + + + + + + epmet + elink@833066 + + + + + + epmet + elink@833066 + + + + + + epmet + elink@833066 + + + + + + epmet + elink@833066 + + + + + + epmet + elink@833066 + + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + + true + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + prod + + + 8114 + prod + + + + + + epmet_gov_org_user + EpmEt-db-UsEr + + + + + + epmet_gov_issue_user + EpmEt-db-UsEr + + + + + + epmet_gov_project_user + EpmEt-db-UsEr + + + + + + epmet_resi_group_user + EpmEt-db-UsEr + + + + + + epmet_user_user + EpmEt-db-UsEr + + + 0 + r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com + 6379 + EpmEtclOUdrEdIs!Q2w + + + true + 192.168.11.180:8848 + bd205d23-e696-47be-b995-916313f86e99 + + + false + + + + true + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/DataAggregatorApplication.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/DataAggregatorApplication.java new file mode 100644 index 0000000000..791cf0b415 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/DataAggregatorApplication.java @@ -0,0 +1,16 @@ +package com.epmet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; + +@SpringBootApplication(scanBasePackages = {"com.epmet"}, exclude = {DataSourceAutoConfiguration.class}) +@EnableDiscoveryClient +@EnableFeignClients +public class DataAggregatorApplication { + public static void main(String[] args) { + SpringApplication.run(DataAggregatorApplication.class, args); + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/aspect/RequestLogAspect.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..34cf9f3d69 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.dataaggre.aspect; + +import com.epmet.commons.tools.aspect.BaseRequestLogAspect; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 + */ +@Aspect +@Component +@Order(0) +public class RequestLogAspect extends BaseRequestLogAspect { + + @Override + @Around(value = "execution(* com.epmet.dataaggre.controller.*Controller.*(..)) ") + public Object proceed(ProceedingJoinPoint point) throws Throwable { + return super.proceed(point, getRequest()); + } + + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + return sra.getRequest(); + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/config/ModuleConfigImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..3805467ca5 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/config/ModuleConfigImpl.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.dataaggre.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "data-aggregator"; + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DemoController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DemoController.java new file mode 100644 index 0000000000..b3300e3fb4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DemoController.java @@ -0,0 +1,23 @@ +package com.epmet.dataaggre.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dataaggre.service.DemoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("demo") +public class DemoController { + + @Autowired + private DemoService demoService; + + @GetMapping("doIt") + public Result doIt() { + demoService.doIt(); + return new Result(); + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java new file mode 100644 index 0000000000..583b66f4f1 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java @@ -0,0 +1,13 @@ +package com.epmet.dataaggre.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午9:45 + */ +@RestController +@RequestMapping("epmetuser") +public class EpmetUserController { +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovIssueController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovIssueController.java new file mode 100644 index 0000000000..a3a6545861 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovIssueController.java @@ -0,0 +1,84 @@ +package com.epmet.dataaggre.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.enums.RequirePermissionEnum; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +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.service.govissue.GovIssueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午9:45 + */ +@RestController +@RequestMapping("issue") +public class GovIssueController { + + @Autowired + private GovIssueService govIssueService; + + /** + * @Description 按组织查询所有议题 + * @Param formDTO + * @Param tokenDto + * @author zxc + * @date 2020/12/25 下午2:37 + */ + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_HOT_ISSUE_ALL) + @PostMapping("allissuelist") + public Result allIssueList(@RequestBody AllIssueFormDTO formDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, AllIssueFormDTO.AllIssueForm.class); + return new Result().ok(govIssueService.allIssueList(formDTO,tokenDto)); + } + + /** + * @param formDTO + * @Description 居民热议-表决中列表 + * @author sun + **/ + @PostMapping(value = "votingissuelist") + public Result> votingIssueList(@RequestBody VotingIssueListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, VotingIssueListFormDTO.VotingForm.class); + return new Result>().ok(govIssueService.votingIssueList(formDTO)); + } + + /** + * @param fromDTO + * @Description 居民热议-已转项目列表 + * @author sun + **/ + @PostMapping("shiftprojectissuelist") + public Result> shiftProjectIssueList(@RequestBody ShiftProjectIssueListFormDTO fromDTO) { + ValidatorUtils.validateEntity(fromDTO, VotingIssueListFormDTO.VotingForm.class); + return new Result>().ok(govIssueService.shiftProjectIssueList(fromDTO)); + } + + /** + * @param fromDTO + * @Description 居民热议-已关闭列表 + * @author sun + **/ + @PostMapping(value = "closedissuelist") + public Result> closedIssueList(@RequestBody ClosedIssueListFormDTO fromDTO){ + ValidatorUtils.validateEntity(fromDTO, ClosedIssueListFormDTO.ClosedForm.class); + return new Result>().ok(govIssueService.closedIssueList(fromDTO)); + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java new file mode 100644 index 0000000000..aebb23a8b5 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dataaggre.dto.govorg.result.AgencyGridListResultDTO; +import com.epmet.dataaggre.service.govorg.GovOrgService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午9:45 + */ +@RestController +@RequestMapping("org") +public class GovOrgController { + + @Autowired + private GovOrgService govOrgService; + + + /** + * @param tokenDTO + * @Author sun + * @Description 组织、网格树结构 + **/ + @PostMapping("agencygridlist") + public Result agencyGridList(@LoginUser TokenDto tokenDTO) { + AgencyGridListResultDTO agencyGridList = new AgencyGridListResultDTO(); + agencyGridList.setAgencyGridList(govOrgService.agencyGridList(tokenDTO.getUserId())); + return new Result().ok(agencyGridList); + } + +} 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 new file mode 100644 index 0000000000..18aa5a924c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovProjectController.java @@ -0,0 +1,59 @@ +package com.epmet.dataaggre.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.enums.RequirePermissionEnum; +import com.epmet.commons.tools.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.*; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午9:45 + */ +@RestController +@RequestMapping("project") +public class GovProjectController { + + @Autowired + private GovProjectService govProjectService; + + /** + * 全部项目 + * @author zhaoqifeng + * @date 2020/12/25 16:00 + * @param tokenDto token + * @param formDTO 入参 + * @return com.epmet.commons.tools.utils.Result> + */ + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_ALL) + @PostMapping("allprojectlist") + public Result allProjectList(@LoginUser TokenDto tokenDto, @RequestBody AllProjectFormDTO formDTO) { + 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/controller/ResiGroupController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/ResiGroupController.java new file mode 100644 index 0000000000..984db9af9f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/ResiGroupController.java @@ -0,0 +1,13 @@ +package com.epmet.dataaggre.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午9:45 + */ +@RestController +@RequestMapping("resigroup") +public class ResiGroupController { +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/BadgeCertificationConfigDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/BadgeCertificationConfigDao.java new file mode 100644 index 0000000000..1d5de47a1b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/BadgeCertificationConfigDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.BadgeCertificationConfigEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 徽章认证配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface BadgeCertificationConfigDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/BadgeCertificationConfigFieldDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/BadgeCertificationConfigFieldDao.java new file mode 100644 index 0000000000..890671f0cc --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/BadgeCertificationConfigFieldDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.BadgeCertificationConfigFieldEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 徽章认证配置字段表 + + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface BadgeCertificationConfigFieldDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/BadgeDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/BadgeDao.java new file mode 100644 index 0000000000..babfb9f9a8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/BadgeDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.BadgeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 徽章 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface BadgeDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java new file mode 100644 index 0000000000..9d3004c815 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 政府工作人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface CustomerStaffDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerUserDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerUserDao.java new file mode 100644 index 0000000000..efd5cde8c0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerUserDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.CustomerUserEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 居民用户信息,此表已作废 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface CustomerUserDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/GovStaffRoleDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/GovStaffRoleDao.java new file mode 100644 index 0000000000..5cdb42779f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/GovStaffRoleDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.GovStaffRoleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 政府端角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface GovStaffRoleDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/GovStaffRoleTemplateDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/GovStaffRoleTemplateDao.java new file mode 100644 index 0000000000..24440b43fa --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/GovStaffRoleTemplateDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.GovStaffRoleTemplateEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 政府端角色模板表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface GovStaffRoleTemplateDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/GridLatestDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/GridLatestDao.java new file mode 100644 index 0000000000..e9d28e949a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/GridLatestDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.GridLatestEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 最近访问网格表 +记录用户访问网格的最近一次记录,对同一网格只记录一条记录,同一网格每次只更新最近一次访问的时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface GridLatestDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/GridVisitedDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/GridVisitedDao.java new file mode 100644 index 0000000000..3f7c34ddda --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/GridVisitedDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.GridVisitedEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格访问记录表 用户对网格访问的一个记录,只有在访问网格首页时才存储数据,一个用户一天对一个网格的访问只有一条记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface GridVisitedDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/OperUserDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/OperUserDao.java new file mode 100644 index 0000000000..96c7f5e6f3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/OperUserDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.OperUserEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 运营人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface OperUserDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/RegisterRelationDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/RegisterRelationDao.java new file mode 100644 index 0000000000..ced9de54cd --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/RegisterRelationDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.RegisterRelationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 注册关系表 用于统计客户网格的注册居民数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface RegisterRelationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/ResiUserBadgeDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/ResiUserBadgeDao.java new file mode 100644 index 0000000000..7d8765b542 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/ResiUserBadgeDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户徽章关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ResiUserBadgeDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/RoleDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/RoleDao.java new file mode 100644 index 0000000000..ab5751a501 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/RoleDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.RoleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface RoleDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffAgencyVisitedDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffAgencyVisitedDao.java new file mode 100644 index 0000000000..ea59c1046f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffAgencyVisitedDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.StaffAgencyVisitedEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员进入组织日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface StaffAgencyVisitedDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffGridVisitedDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffGridVisitedDao.java new file mode 100644 index 0000000000..b10622f6a7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffGridVisitedDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.StaffGridVisitedEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员进入网格日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface StaffGridVisitedDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffRoleDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffRoleDao.java new file mode 100644 index 0000000000..02ace6bc28 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffRoleDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.StaffRoleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员-角色关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface StaffRoleDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffWechatDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffWechatDao.java new file mode 100644 index 0000000000..6862779142 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffWechatDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.StaffWechatEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员微信关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface StaffWechatDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserAdviceDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserAdviceDao.java new file mode 100644 index 0000000000..a24895160b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserAdviceDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.UserAdviceEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * user_advice + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface UserAdviceDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserAdviceImgDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserAdviceImgDao.java new file mode 100644 index 0000000000..0346a96301 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserAdviceImgDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.UserAdviceImgEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户建议图片 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface UserAdviceImgDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBadgeCertificateRecordDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBadgeCertificateRecordDao.java new file mode 100644 index 0000000000..1477837f71 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBadgeCertificateRecordDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.UserBadgeCertificateRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户认证徽章记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface UserBadgeCertificateRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.java new file mode 100644 index 0000000000..f7ced8b6f0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserBaseInfoDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.UserBaseInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface UserBaseInfoDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserCustomerDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserCustomerDao.java new file mode 100644 index 0000000000..35d96dba1c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserCustomerDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.UserCustomerEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户客户关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface UserCustomerDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserDao.java new file mode 100644 index 0000000000..8982519ccc --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.UserEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface UserDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserInvitationDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserInvitationDao.java new file mode 100644 index 0000000000..a20c106db5 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserInvitationDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.UserInvitationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 人员邀请关系表 记录user之间的邀请关系 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface UserInvitationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserResiInfoDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserResiInfoDao.java new file mode 100644 index 0000000000..9134ce63f9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserResiInfoDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.UserResiInfoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户居民端注册信息表 用户在居民端完善的个人信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface UserResiInfoDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserResiRegisterVisitDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserResiRegisterVisitDao.java new file mode 100644 index 0000000000..011871b5cd --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserResiRegisterVisitDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.UserResiRegisterVisitEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户居民端注册访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface UserResiRegisterVisitDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserRoleDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserRoleDao.java new file mode 100644 index 0000000000..9247a898f3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserRoleDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.UserRoleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户角色关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface UserRoleDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserWechatDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserWechatDao.java new file mode 100644 index 0000000000..ac7e440193 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/UserWechatDao.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.dataaggre.dao.epmetuser; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.epmetuser.UserWechatEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户微信端关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface UserWechatDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueApplicationDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueApplicationDao.java new file mode 100644 index 0000000000..8cda8f76cf --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueApplicationDao.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.dataaggre.dao.govissue; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.govissue.result.IssueListResultDTO; +import com.epmet.dataaggre.entity.govissue.IssueApplicationEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 话题转议题申请表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-17 + */ +@Mapper +public interface IssueApplicationDao extends BaseDao { + + /** + * @Description 查询被拒绝的议题 + * @Param gridIds + * @author zxc + * @date 2020/12/25 下午2:40 + */ + List issueStatusRejected(@Param("gridIds") List gridIds); + + /** + * @Description 查询被拒绝的议题 + * @Param gridIds + * @author zxc + * @date 2020/12/25 下午2:40 + */ + List issueStatusAuditing(@Param("gridIds") List gridIds); + + Integer selectApplicationCount(@Param("gridIds") List gridIds,@Param("status")String status); + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueApplicationHistoryDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueApplicationHistoryDao.java new file mode 100644 index 0000000000..fab70d4286 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueApplicationHistoryDao.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.dataaggre.dao.govissue; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govissue.IssueApplicationHistoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题转议题审核历史表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-17 + */ +@Mapper +public interface IssueApplicationHistoryDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueCustomerParameterDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueCustomerParameterDao.java new file mode 100644 index 0000000000..fd2e407cda --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueCustomerParameterDao.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.dataaggre.dao.govissue; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govissue.IssueCustomerParameterEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 议题客户参数定制表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Mapper +public interface IssueCustomerParameterDao extends BaseDao { + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..1e85e06366 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueDao.java @@ -0,0 +1,77 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dao.govissue; + +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.*; +import com.epmet.dataaggre.entity.govissue.IssueEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 议题详情 关联话题,转议题时间必须要和话题转议题时间一致、关闭时间必须要和操作记录表的关闭记录时间一致、转项目时间必须要和项目记录生成时间一致,注意服务间调用的时间一致性。每个议题最后总会被关闭。 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Mapper +public interface IssueDao extends BaseDao { + + /** + * @Description 查询议题【表决中、已关闭】 + * @Param gridIds + * @author zxc + * @date 2020/12/25 下午2:19 + */ + List issueStatusClosedOrVoting(@Param("gridIds") List gridIds, @Param("issueStatus")String issueStatus); + + /** + * @Description 查询已转项目议题 + * @Param gridIds + * @author zxc + * @date 2020/12/25 下午5:27 + */ + List issueStatusShiftProject(@Param("gridIds") List gridIds); + + /** + * @Description 查询网格列表下表决中的议题列表 + * @author sun + **/ + List selectVotingList(VotingIssueListFormDTO formDTO); + + /** + * @Description 根据组织ID查询议题Id集合 + * @author sun + **/ + List selectIssueListByGridIds(ShiftProjectIssueListFormDTO fromDTO); + + /** + * @Description 查询组织下议题转项目切项目已关闭列表数据 + * @author sun + **/ + 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/govissue/IssueProcessDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueProcessDao.java new file mode 100644 index 0000000000..1569406be3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueProcessDao.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.dataaggre.dao.govissue; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govissue.IssueProcessEntity; +import org.apache.ibatis.annotations.Mapper; + + +/** + * 议题进展记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Mapper +public interface IssueProcessDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueProjectRelationDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueProjectRelationDao.java new file mode 100644 index 0000000000..97d3a25866 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueProjectRelationDao.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.dataaggre.dao.govissue; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govissue.IssueProjectRelationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 议题项目关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Mapper +public interface IssueProjectRelationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueSatisfactionDetailDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueSatisfactionDetailDao.java new file mode 100644 index 0000000000..d819c9f6c0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueSatisfactionDetailDao.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.dataaggre.dao.govissue; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govissue.IssueSatisfactionDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 议题满意度调查记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Mapper +public interface IssueSatisfactionDetailDao extends BaseDao { +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueSatisfactionStatisticalDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueSatisfactionStatisticalDao.java new file mode 100644 index 0000000000..27ab4ddabd --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueSatisfactionStatisticalDao.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.dataaggre.dao.govissue; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govissue.IssueSatisfactionStatisticalEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 议题满意度调查统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Mapper +public interface IssueSatisfactionStatisticalDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueSuggestionDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueSuggestionDao.java new file mode 100644 index 0000000000..dce95ef706 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueSuggestionDao.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.dataaggre.dao.govissue; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govissue.IssueSuggestionEntity; +import org.apache.ibatis.annotations.Mapper; + + +/** + * 居民端用户对议题建议或意见表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-18 + */ +@Mapper +public interface IssueSuggestionDao extends BaseDao { +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueVoteDetailDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueVoteDetailDao.java new file mode 100644 index 0000000000..9e244a0ee8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueVoteDetailDao.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.dataaggre.dao.govissue; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govissue.IssueVoteDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 议题表决记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Mapper +public interface IssueVoteDetailDao extends BaseDao { +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueVoteStatisticalDailyDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueVoteStatisticalDailyDao.java new file mode 100644 index 0000000000..88914bedd7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueVoteStatisticalDailyDao.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.dataaggre.dao.govissue; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govissue.IssueVoteStatisticalDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 议题表决按天统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Mapper +public interface IssueVoteStatisticalDailyDao extends BaseDao { +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueVoteStatisticalDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueVoteStatisticalDao.java new file mode 100644 index 0000000000..aeb097b416 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govissue/IssueVoteStatisticalDao.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.dataaggre.dao.govissue; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govissue.IssueVoteStatisticalEntity; +import org.apache.ibatis.annotations.Mapper; + + +/** + * 议题表决统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Mapper +public interface IssueVoteStatisticalDao extends BaseDao { +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java new file mode 100644 index 0000000000..445baf2477 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.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.dataaggre.dao.govorg; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO; +import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 机关单位信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Mapper +public interface CustomerAgencyDao extends BaseDao { + + /** + * @Author sun + * @Description 递归查询当前机关的下一级机关列表 + **/ + List selectAllSubAgency(@Param("subPids") String subPids); + + /** + * @Description 根据userId查询组织ID + * @Param userId + * @author zxc + * @date 2020/12/25 下午4:55 + */ + String getAgencyIdByUserId(@Param("userId") String userId); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerDepartmentDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerDepartmentDao.java new file mode 100644 index 0000000000..e640c21b32 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerDepartmentDao.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.dataaggre.dao.govorg; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govorg.CustomerDepartmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Mapper +public interface CustomerDepartmentDao extends BaseDao { +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.java new file mode 100644 index 0000000000..1da9910104 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerGridDao.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.dataaggre.dao.govorg; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO; +import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; +import com.epmet.dataaggre.entity.govorg.CustomerGridEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 客户网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface CustomerGridDao extends BaseDao { + + /** + * @Author sun + * @Description 根据组织Id查询当前组织及下级所有网格列表 + **/ + List selectAgencyGridList(@Param("agencyId") String agencyId); + + /** + * @param gridIdList + * @return + * @Description 根据网格Id集合获取网格列表信息 + * @Author sun + */ + List selectGridByIds(@Param("gridIdList") List gridIdList); + + /** + * @Author sun + * @Description 根据组织Id查询当前组织下所有网格列表 + **/ + List selectGridListByAgencyId(@Param("agencyId") String agencyId); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerPartyBranchDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerPartyBranchDao.java new file mode 100644 index 0000000000..52551a6d52 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerPartyBranchDao.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.dataaggre.dao.govorg; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govorg.CustomerPartyBranchEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 党支部信息 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface CustomerPartyBranchDao extends BaseDao { +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java new file mode 100644 index 0000000000..f8b58c698b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.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.dataaggre.dao.govorg; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO; +import com.epmet.dataaggre.entity.govorg.CustomerStaffAgencyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 人员-机关单位关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Mapper +public interface CustomerStaffAgencyDao extends BaseDao { + + /** + * @Author sun + * @Description 根据staffId查询客户、组织信息 + **/ + CustomerStaffAgencyDTO selectByStaffId(@Param("userId") String userId); + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java new file mode 100644 index 0000000000..bde0fbaf92 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.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.dataaggre.dao.govorg; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govorg.CustomerStaffDepartmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 部门人员关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Mapper +public interface CustomerStaffDepartmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java new file mode 100644 index 0000000000..b05163ddd5 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.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.dataaggre.dao.govorg; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govorg.CustomerStaffGridEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格人员关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Mapper +public interface CustomerStaffGridDao extends BaseDao { +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/StaffTransferRecordDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/StaffTransferRecordDao.java new file mode 100644 index 0000000000..a155b73d8f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/StaffTransferRecordDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dao.govorg; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govorg.StaffTransferRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 工作人员调动记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Mapper +public interface StaffTransferRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/CustomerProjectParameterDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/CustomerProjectParameterDao.java new file mode 100644 index 0000000000..cfdd531e6d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/CustomerProjectParameterDao.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.dataaggre.dao.govproject; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govproject.CustomerProjectParameterEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目客户参数订制表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface CustomerProjectParameterDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectCategoryDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectCategoryDao.java new file mode 100644 index 0000000000..998b6b4b03 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectCategoryDao.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.dataaggre.dao.govproject; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govproject.ProjectCategoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ProjectCategoryDao extends BaseDao { + +} \ 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 new file mode 100644 index 0000000000..cc3f3d9e7e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectDao.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dao.govproject; + +import com.epmet.commons.mybatis.dao.BaseDao; +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; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ProjectDao extends BaseDao { + List getAllProject(AllProjectFormDTO formDTO); + + /** + * @Description 查询项目信息【已关闭】 + * @Param issueIds + * @author zxc + * @date 2020/12/25 下午5:47 + */ + List selectProjectInfoClosed(@Param("issueIds") List issueIds); + + /** + * @Description 查询项目信息【处理中】 + * @Param issueIds + * @author zxc + * @date 2020/12/28 上午9:26 + */ + List selectProjectInfoPending(@Param("issueIds") List issueIds); + + /** + * @Description 根据议题Id集合查询项目数据 + * @author sun + **/ + List selectShiftProjectList(@Param("issueIdList") List issueIdList); + + /** + * @Description 查询项目当前处理部门 + * @author sun + **/ + 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/govproject/ProjectOrgRelationDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectOrgRelationDao.java new file mode 100644 index 0000000000..66edef9272 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectOrgRelationDao.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.dataaggre.dao.govproject; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govproject.ProjectOrgRelationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目机关历时关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ProjectOrgRelationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectProcessAttachmentDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectProcessAttachmentDao.java new file mode 100644 index 0000000000..92d1287477 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectProcessAttachmentDao.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.dataaggre.dao.govproject; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govproject.ProjectProcessAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目节点附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ProjectProcessAttachmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectProcessDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectProcessDao.java new file mode 100644 index 0000000000..a00c7c361f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectProcessDao.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.dataaggre.dao.govproject; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govproject.ProjectProcessEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目处理进展表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ProjectProcessDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectProcessScanTaskDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectProcessScanTaskDao.java new file mode 100644 index 0000000000..49d39765dd --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectProcessScanTaskDao.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.dataaggre.dao.govproject; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govproject.ProjectProcessScanTaskEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目节点附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ProjectProcessScanTaskDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectRelatedPersonnelDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectRelatedPersonnelDao.java new file mode 100644 index 0000000000..62aaa8de59 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectRelatedPersonnelDao.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.dataaggre.dao.govproject; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govproject.ProjectRelatedPersonnelEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目相关人员表(存放话题人、议题人数据) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ProjectRelatedPersonnelDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectSatisfactionDetailDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectSatisfactionDetailDao.java new file mode 100644 index 0000000000..ad2de40cb9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectSatisfactionDetailDao.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.dataaggre.dao.govproject; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govproject.ProjectSatisfactionDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目满意度调查记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ProjectSatisfactionDetailDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectSatisfactionStatisticsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectSatisfactionStatisticsDao.java new file mode 100644 index 0000000000..ffaf905e57 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectSatisfactionStatisticsDao.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.dataaggre.dao.govproject; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govproject.ProjectSatisfactionStatisticsEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目满意度调查统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ProjectSatisfactionStatisticsDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectStaffDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectStaffDao.java new file mode 100644 index 0000000000..948d53096f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectStaffDao.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.dataaggre.dao.govproject; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govproject.ProjectStaffEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目人员关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ProjectStaffDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectTagsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectTagsDao.java new file mode 100644 index 0000000000..ffb9650dd7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govproject/ProjectTagsDao.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.dataaggre.dao.govproject; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.govproject.ProjectTagsEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ProjectTagsDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/EnterGroupSwitchDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/EnterGroupSwitchDao.java new file mode 100644 index 0000000000..fa28a17e4a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/EnterGroupSwitchDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.EnterGroupSwitchEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface EnterGroupSwitchDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/GroupEditSubmitRecordDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/GroupEditSubmitRecordDao.java new file mode 100644 index 0000000000..0e22a7e352 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/GroupEditSubmitRecordDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.GroupEditSubmitRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 组编辑提交记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface GroupEditSubmitRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/GroupInvitationDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/GroupInvitationDao.java new file mode 100644 index 0000000000..82d1a2c35a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/GroupInvitationDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.GroupInvitationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 群邀请记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface GroupInvitationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/GroupMemeberOperationDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/GroupMemeberOperationDao.java new file mode 100644 index 0000000000..48c8669cde --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/GroupMemeberOperationDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.GroupMemeberOperationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 组成员出入群记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface GroupMemeberOperationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/InvitationAccessRecordDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/InvitationAccessRecordDao.java new file mode 100644 index 0000000000..13dc920964 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/InvitationAccessRecordDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.InvitationAccessRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 邀请链接访问表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface InvitationAccessRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupCodeDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupCodeDao.java new file mode 100644 index 0000000000..0f8ed1d812 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupCodeDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.ResiGroupCodeEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 小组二维码 小组唯一二维码,海报码和小组码是同一个二维码,长期有效的 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ResiGroupCodeDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupDao.java new file mode 100644 index 0000000000..1658a05ad9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.ResiGroupEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 群组信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ResiGroupDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupMemberDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupMemberDao.java new file mode 100644 index 0000000000..f2e3de739b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupMemberDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.ResiGroupMemberEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 群组成员关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ResiGroupMemberDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupOperationDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupOperationDao.java new file mode 100644 index 0000000000..64c780a6c7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupOperationDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.ResiGroupOperationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 群组操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ResiGroupOperationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupStatisticalDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupStatisticalDao.java new file mode 100644 index 0000000000..0665a7e3c6 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupStatisticalDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.ResiGroupStatisticalEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 群组统计信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ResiGroupStatisticalDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicAttachmentDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicAttachmentDao.java new file mode 100644 index 0000000000..4b3bbf55c3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicAttachmentDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.ResiTopicAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ResiTopicAttachmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicCommentDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicCommentDao.java new file mode 100644 index 0000000000..765569b2eb --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicCommentDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.ResiTopicCommentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ResiTopicCommentDao extends BaseDao { + +} \ 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 new file mode 100644 index 0000000000..cd57936e2f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicDao.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.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; + +/** + * 话题信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@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/dao/resigroup/ResiTopicOperationDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicOperationDao.java new file mode 100644 index 0000000000..894ff87aec --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiTopicOperationDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.ResiTopicOperationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface ResiTopicOperationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicDraftAttachmentDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicDraftAttachmentDao.java new file mode 100644 index 0000000000..dadc473d60 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicDraftAttachmentDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.TopicDraftAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题草稿附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface TopicDraftAttachmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicDraftDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicDraftDao.java new file mode 100644 index 0000000000..57f09caf68 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicDraftDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.TopicDraftEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface TopicDraftDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicDraftOperationDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicDraftOperationDao.java new file mode 100644 index 0000000000..1e3cef5e95 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicDraftOperationDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.TopicDraftOperationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题草稿操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface TopicDraftOperationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicDraftScanTaskDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicDraftScanTaskDao.java new file mode 100644 index 0000000000..94b005c533 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicDraftScanTaskDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.TopicDraftScanTaskEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题附件检测任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface TopicDraftScanTaskDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicShareLinkRecordDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicShareLinkRecordDao.java new file mode 100644 index 0000000000..67fa977a11 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicShareLinkRecordDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.TopicShareLinkRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题分享链接表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface TopicShareLinkRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicShareLinkVisitRecordDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicShareLinkVisitRecordDao.java new file mode 100644 index 0000000000..75c1b8b88a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/TopicShareLinkVisitRecordDao.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.dataaggre.dao.resigroup; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.resigroup.TopicShareLinkVisitRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题分享链接访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Mapper +public interface TopicShareLinkVisitRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/BadgeCertificationConfigEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/BadgeCertificationConfigEntity.java new file mode 100644 index 0000000000..67efd3a8ed --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/BadgeCertificationConfigEntity.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.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 徽章认证配置 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("badge_certification_config") +public class BadgeCertificationConfigEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 默认配置id:default + */ + private String customerId; + + /** + * 徽章ID + */ + private String badgeId; + + /** + * 认证信息类型 手机号:mobile;全名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark + */ + private String certificationType; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/BadgeCertificationConfigFieldEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/BadgeCertificationConfigFieldEntity.java new file mode 100644 index 0000000000..81b970e677 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/BadgeCertificationConfigFieldEntity.java @@ -0,0 +1,72 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 徽章认证配置字段表 + + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("badge_certification_config_field") +public class BadgeCertificationConfigFieldEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 中文名 + */ + private String cnName; + + /** + * 英文名(字段名) + */ + private String enName; + + /** + * 字段类型 img:图片,text:文本 + */ + private String fieldType; + + /** + * 是否必填 + */ + private Integer isRequired; + + /** + * 认证信息类型 手机号:mobile;全名:fullname;身份证:idcard;认证证件: certificate;认证说明(备注):remark + */ + private String certificationType; + + /** + * 字段排序 + */ + private Integer sort; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/BadgeEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/BadgeEntity.java new file mode 100644 index 0000000000..a70ecfb4f9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/BadgeEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 徽章 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("badge") +public class BadgeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 默认配置id:default + */ + private String customerId; + + /** + * 徽章名称 + */ + private String badgeName; + + /** + * 徽章图标url + */ + private String badgeIcon; + + /** + * 固有徽章类型 前端页面跳转标识,党员徽章:party;无:none + */ + private String fixationBadgeType; + + /** + * 徽章排序 + */ + private Integer sort; + + /** + * 状态 上线:online;下线:offline; + */ + private String badgeStatus; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/CustomerStaffEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/CustomerStaffEntity.java new file mode 100644 index 0000000000..479c5f7c0f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/CustomerStaffEntity.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.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 政府工作人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_staff") +public class CustomerStaffEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id CUSTOMER.id + */ + private String customerId; + + /** + * 关联User表的主键Id + */ + private String userId; + + /** + * 真实姓名 + */ + private String realName; + + /** + * 性别0.未知,1男,2.女 + */ + private Integer gender; + + /** + * 邮箱 + */ + private String email; + + /** + * 手机号-唯一键 + */ + private String mobile; + + /** + * 地址 + */ + private String address; + + /** + * fulltime专职parttime兼职 + */ + private String workType; + + /** + * 头像 + */ + private String headPhoto; + + /** + * inactive未激活,active已激活 + */ + private String activeFlag; + + /** + * 激活时间 + */ + private Date activeTime; + + /** + * 未禁用enable,已禁用disabled + */ + private String enableFlag; + + /** + * 登录密码 + */ + private String password; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/CustomerUserEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/CustomerUserEntity.java new file mode 100644 index 0000000000..bad1b5b830 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/CustomerUserEntity.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.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 居民用户信息,此表已作废 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_user") +public class CustomerUserEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id CUSTOMER.id + */ + private String customerId; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 微信unionId + */ + private String wxUnionId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 昵称 + */ + private String nickname; + + /** + * 性别:0.未知 1.男性2女性 + */ + private Integer sex; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 国家 + */ + private String country; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 语言 + */ + private String language; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/GovStaffRoleEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/GovStaffRoleEntity.java new file mode 100644 index 0000000000..d10c281e10 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/GovStaffRoleEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 政府端角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_staff_role") +public class GovStaffRoleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID。如果该角色由客户定制,其下的机关和部门都不再各自定制自己的角色,这个字段会比较有用。包括通用角色以及客户定制角色。 + */ + private String customerId; + + /** + * 角色key + */ + private String roleKey; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 角色所属体系类型:agency,department,grid + */ + private String orgType; + + /** + * 是否只有全职 1对应true 0对应false + */ + private Integer fullTimeOnly; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/GovStaffRoleTemplateEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/GovStaffRoleTemplateEntity.java new file mode 100644 index 0000000000..24e77d5ef3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/GovStaffRoleTemplateEntity.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.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 政府端角色模板表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_staff_role_template") +public class GovStaffRoleTemplateEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 角色key + */ + private String roleKey; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 角色所属体系类型:org,dept,grid + */ + private String orgType; + + /** + * 是否只有全职 1对应true 0对应false + */ + private Integer fullTimeOnly; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/GridLatestEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/GridLatestEntity.java new file mode 100644 index 0000000000..a04455241d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/GridLatestEntity.java @@ -0,0 +1,72 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 最近访问网格表 +记录用户访问网格的最近一次记录,对同一网格只记录一条记录,同一网格每次只更新最近一次访问的时间 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("grid_latest") +public class GridLatestEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id CUSTOMER.id + */ + private String customerId; + + /** + * 网格表Id(CUSTOMER_GRID.id) + */ + private String gridId; + + /** + * 用户Id(CUSTOMER_USER.id) + */ + private String customerUserId; + + /** + * 所属地区码 (数据统计字段) + */ + private String areaCode; + + /** + * 上级组织ID (数据统计字段) + */ + private String pid; + + /** + * 最近访问时间 + */ + private Date latestTime; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/GridVisitedEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/GridVisitedEntity.java new file mode 100644 index 0000000000..07141923e3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/GridVisitedEntity.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.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 网格访问记录表 用户对网格访问的一个记录,只有在访问网格首页时才存储数据,一个用户一天对一个网格的访问只有一条记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("grid_visited") +public class GridVisitedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 是否注册(0:否 1:是) + */ + private Integer isRegister; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格表Id (CUSTOMER_GRID.id) + */ + private String gridId; + + /** + * 用户Id + */ + private String customerUserId; + + /** + * 访问时间 一个用户一天访问一个网格只有一条记录 + */ + private Date visitTime; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/OperUserEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/OperUserEntity.java new file mode 100644 index 0000000000..95f1ca70c9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/OperUserEntity.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.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 运营人员表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("oper_user") +public class OperUserEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 关联User表主键 + */ + private String userId; + + /** + * 姓名 + */ + private String realName; + + /** + * 密码 + */ + private String password; + + /** + * 头像 + */ + private String headUrl; + + /** + * 性别 0:男 1:女 2:保密 + */ + private Integer gender; + + /** + * 邮箱 + */ + private String email; + + /** + * 手机号-唯一键 + */ + private String phone; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 超级管理员 0:否 1:是 + */ + private Integer superAdmin; + + /** + * 状态 0:停用 1:正常 + */ + private Integer status; + + /** + * 备注 + */ + private String remark; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/RegisterRelationEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/RegisterRelationEntity.java new file mode 100644 index 0000000000..056d0b8fd8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/RegisterRelationEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 注册关系表 用于统计客户网格的注册居民数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("register_relation") +public class RegisterRelationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + /** + * 网格Id (customer_grid.id) + */ + private String gridId; + + /** + * 用户Id (user.id) + */ + private String userId; + + /** + * 首次注册用户 0表示不参与计数 1表示参与计数 + */ + private String firstRegister; + + /** + * 注册用户 0表示不参与计数 1表示参与计数 + */ + private String register; + + /** + * 参与用户 0表示不参与计数 1表示参与计数 + */ + private String participation; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/ResiUserBadgeEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/ResiUserBadgeEntity.java new file mode 100644 index 0000000000..497bccd06c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/ResiUserBadgeEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户徽章关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_user_badge") +public class ResiUserBadgeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 默认配置id:default + */ + private String customerId; + + /** + * 用户注册网格ID + */ + private String gridId; + + /** + * 用户ID + */ + private String userId; + + /** + * 徽章ID + */ + private String badgeId; + + /** + * 是否开启(点亮) 1:点亮;0:未点亮 + */ + private Integer isOpened; + + /** + * 认证(审核)状态 待审核:auditing;审核通过: approved;驳回:rejected; + */ + private String certificationAutidStatus; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/RoleEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/RoleEntity.java new file mode 100644 index 0000000000..fe0dc92157 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/RoleEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 角色表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("epmet_role") +public class RoleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 所属APP + */ + private String app; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 角色Key值 + */ + private String roleKey; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffAgencyVisitedEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffAgencyVisitedEntity.java new file mode 100644 index 0000000000..d12bb12dd7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffAgencyVisitedEntity.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.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作人员进入组织日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_agency_visited") +public class StaffAgencyVisitedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * customer_staff.userId + */ + private String staffId; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 机关单位id来源于customer_agency.id + */ + private String agencyId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffGridVisitedEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffGridVisitedEntity.java new file mode 100644 index 0000000000..a955852f0e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffGridVisitedEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作人员进入网格日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_grid_visited") +public class StaffGridVisitedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * customer_staff.userId + */ + private String staffId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffRoleEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffRoleEntity.java new file mode 100644 index 0000000000..c8a27e515f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffRoleEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作人员-角色关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_role") +public class StaffRoleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户ID + */ + private String staffId; + + /** + * 角色ID + */ + private String roleId; + + /** + * 角色所属类型的ID。例如,机关的角色,那该字段就是所属机关的ID;部门的角色,该字段就是所属部门的ID;网格的角色,该字段就是所属网格ID + */ + private String orgId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffWechatEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffWechatEntity.java new file mode 100644 index 0000000000..33771a607f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StaffWechatEntity.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.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 工作人员微信关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_wechat") +public class StaffWechatEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户Id user.id + */ + private String userId; + + /** + * openId + */ + private String wxOpenId; + + /** + * 微信unionId + */ + private String wxUnionId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 昵称 + */ + private String nickname; + + /** + * 性别 + */ + private Integer sex; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 国家 + */ + private String country; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 语言 + */ + private String language; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserAdviceEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserAdviceEntity.java new file mode 100644 index 0000000000..e790bbba8f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserAdviceEntity.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.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * user_advice + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_advice") +public class UserAdviceEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户名 + */ + private String customerName; + + /** + * 组织ID + */ + private String agencyId; + + /** + * + */ + private String agencyPids; + + /** + * + */ + private String agencyAllParentName; + + /** + * 组织名 + */ + private String agencyName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名 + */ + private String gridName; + + /** + * userid + */ + private String userId; + + /** + * 用户姓名 + */ + private String userName; + + /** + * 用户注册手机号 + */ + private String regPhone; + + /** + * 1 + */ + private String adviceContent; + + /** + * 填写手机号 + */ + private String phone; + + /** + * 建议时间 + */ + private Date adviceTime; + + /** + * 问题分类(gov政府software软件,逗号分隔) + */ + private String adviceType; + + /** + * 回复内容 + */ + private String replyContent; + + /** + * 回复人id + */ + private String replyUserId; + + /** + * 回复人姓名 + */ + private String replyUserName; + + /** + * 回复时间 + */ + private Date replyTime; + + /** + * 建议回复内容 + */ + private String govContent; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserAdviceImgEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserAdviceImgEntity.java new file mode 100644 index 0000000000..d157d519c5 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserAdviceImgEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户建议图片 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_advice_img") +public class UserAdviceImgEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 建议id + */ + private String adviceId; + + /** + * 图片类型,resi是用户上传的建议图片,oper是运营上传的代替政府回复的存证 + */ + private String type; + + /** + * 图片url + */ + private String imgUrl; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserBadgeCertificateRecordEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserBadgeCertificateRecordEntity.java new file mode 100644 index 0000000000..b00adb94f2 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserBadgeCertificateRecordEntity.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.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户认证徽章记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_badge_certificate_record") +public class UserBadgeCertificateRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 用户注册网格ID + */ + private String gridId; + + /** + * 用户ID + */ + private String userId; + + /** + * 徽章ID + */ + private String badgeId; + + /** + * 姓 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 手机号 + */ + private String mobile; + + /** + * 身份证号 网格内去重 + */ + private String idNum; + + /** + * 认证证件图片 + */ + private String certificationImg; + + /** + * 认证说明(备注) + */ + private String remaek; + + /** + * 审核状态 approved:审核通过,rejected:审核驳回;auditing:审核中 + */ + private String auditStatus; + + /** + * 审核意见 + */ + private String auditRemark; + + /** + * 审核人 审核人Id + */ + private String staffId; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 是否是最新纪录:yes:最新纪录,no:非最新纪录 + */ + private String isLast; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserBaseInfoEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserBaseInfoEntity.java new file mode 100644 index 0000000000..52c1961193 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserBaseInfoEntity.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.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户基础信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_base_info") +public class UserBaseInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户id + */ + private String userId; + + /** + * 手机号(注册手机号) + */ + private String mobile; + + /** + * 姓氏 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 姓+名 + */ + private String realName; + + /** + * 身份证号 + */ + private String idNum; + + /** + * 性别(1男2女0未知) + */ + private String gender; + + /** + * 街道 + */ + private String street; + + /** + * 小区名称 + */ + private String district; + + /** + * 楼栋单元 + */ + private String buildingAddress; + + /** + * 昵称(目前来源于微信昵称,后续系统可支持用户有昵称) + */ + private String nickname; + + /** + * 头像(目前来源于微信,后续系统顾客支持上传头像) + */ + private String headImgUrl; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserCustomerEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserCustomerEntity.java new file mode 100644 index 0000000000..6909b3dad8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserCustomerEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户客户关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_customer") +public class UserCustomerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 用户Id user.id + */ + private String userId; + + /** + * 是否注册 1注册; 0未注册 + */ + private String isRegister; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserEntity.java new file mode 100644 index 0000000000..fbec7cb293 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserEntity.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.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user") +public class UserEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 来源app(政府端:gov、居民端:resi、运营端:oper) + */ + private String fromApp; + + /** + * 来源client(PC端:web、微信小程序:wxmp) + */ + private String fromClient; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserInvitationEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserInvitationEntity.java new file mode 100644 index 0000000000..7f5d8c8cbe --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserInvitationEntity.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.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 人员邀请关系表 记录user之间的邀请关系 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_invitation") +public class UserInvitationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + /** + * 网格Id (customer_grid.id) + */ + private String gridId; + + /** + * 邀请人Id + */ + private String inviterUserId; + + /** + * 被邀请人Id + */ + private String inviteeUserId; + + /** + * 邀请场景 (value:feature+action) + */ + private String inviteSource; + + /** + * 邀请记录Id + */ + private String inviteSourceId; + + /** + * 邀请时间 + */ + private Date invitationTime; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserResiInfoEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserResiInfoEntity.java new file mode 100644 index 0000000000..11f98da9e0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserResiInfoEntity.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.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户居民端注册信息表 用户在居民端完善的个人信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_resi_info") +public class UserResiInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户Id(主键) user.id + */ + private String userId; + + /** + * 手机号(注册手机号) + */ + private String regMobile; + + /** + * 姓氏 + */ + private String surname; + + /** + * 名称 + */ + private String name; + + /** + * 街道 + */ + private String street; + + /** + * 小区名称 + */ + private String district; + + /** + * 楼栋单元 + */ + private String buildingAddress; + + /** + * 居民注册行为记录表Id resi_visit.id + */ + private String resiVisitId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserResiRegisterVisitEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserResiRegisterVisitEntity.java new file mode 100644 index 0000000000..e49ea4164c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserResiRegisterVisitEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户居民端注册访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_resi_register_visit") +public class UserResiRegisterVisitEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id (customer.id) + */ + private String customerId; + + /** + * 用户Id (user.id) + */ + private String userId; + + /** + * 网格Id (customer_grid.id) + */ + private String gridId; + + /** + * 访问来源 【指的是用户点的那个功能进入到的注册页面,就是一个功能模块的Id(value:feature+action)】 + */ + private String visitFrom; + + /** + * 最后一次操作行为 key:operate_visit value:(initialize:初始化 sms_Code:获取验证码 success:提交成功 faild:提交失败) + */ + private String lastOperateVisit; + + /** + * 访问时间 + */ + private Date visitTime; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserRoleEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserRoleEntity.java new file mode 100644 index 0000000000..78cbcc96fc --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserRoleEntity.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.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户角色关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_role") +public class UserRoleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 网格表Id(CUSTOMER_GRID.id)【居民党员角色值为all,热心居民角色对应的网格Id】 + */ + private String gridId; + + /** + * 用户Id user.id + */ + private String userId; + + /** + * 角色Id 【角色表Id】 + */ + private String roleId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserWechatEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserWechatEntity.java new file mode 100644 index 0000000000..b319057238 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/UserWechatEntity.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.dataaggre.entity.epmetuser; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 用户微信端关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("user_wechat") +public class UserWechatEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户Id user.id + */ + private String userId; + + /** + * openId + */ + private String wxOpenId; + + /** + * 微信unionId + */ + private String wxUnionId; + + /** + * 手机号 + */ + private String mobile; + + /** + * 昵称 + */ + private String nickname; + + /** + * 性别 + */ + private Integer sex; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 国家 + */ + private String country; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 语言 + */ + private String language; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueApplicationEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueApplicationEntity.java new file mode 100644 index 0000000000..1e6671bfa7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueApplicationEntity.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.dataaggre.entity.govissue; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 话题转议题申请表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_application") +public class IssueApplicationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 议题名称 + */ + private String issueTitle; + + /** + * 建议 + */ + private String suggestion; + + /** + * 审核状态:under_auditing:待审核;approved:通过;rejected:驳回;自动通过:auto_passed + */ + private String applyStatus; + + /** + * 话题id + */ + private String topicId; + + /** + * 小组id + */ + private String groupId; + + /** + * 网格ID 居民端议题对应一个网格Id + */ + private String gridId; + + /** + * 审核通过后对应的 议题id + */ + private String issueId; + + /** + * 审核通过时填写的理由 + */ + private String passedReason; + + /** + * 审批通过时工作人员id,自动通过此列不存储 + */ + private String approveStaffId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueApplicationHistoryEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueApplicationHistoryEntity.java new file mode 100644 index 0000000000..43b7ad28f7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueApplicationHistoryEntity.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.dataaggre.entity.govissue; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 话题转议题审核历史表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_application_history") +public class IssueApplicationHistoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题转议题申请表 issue_application.id + */ + private String issueApplicationId; + + /** + * under_auditing:待审核; + * approved:审核通过; + * rejected:驳回; + * auto_passed:自动通过 + */ + private String actionType; + + /** + * 审核时的说明 + */ + private String reason; + + /** + * 工作端人员姓名 + */ + private String staffName; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueCustomerParameterEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueCustomerParameterEntity.java new file mode 100644 index 0000000000..d86bd5fde6 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueCustomerParameterEntity.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.dataaggre.entity.govissue; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 议题客户参数定制表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_customer_parameter") +public class IssueCustomerParameterEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 参数键 eg:voting_time_limit + */ + private String parameterKey; + + /** + * 参数名 eg:表决期限 + */ + private String parameterName; + + /** + * 参数值 eg:10(天) + */ + private String parameterValue; + + /** + * 参数说明 eg:这个客户下所有的网格议题表决期限都是10天 + */ + private String description; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueEntity.java new file mode 100644 index 0000000000..549beaff2d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueEntity.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.dataaggre.entity.govissue; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 议题详情 关联话题,转议题时间必须要和话题转议题时间一致、关闭时间必须要和操作记录表的关闭记录时间一致、转项目时间必须要和项目记录生成时间一致,注意服务间调用的时间一致性。每个议题最后总会被关闭。 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue") +public class IssueEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 议题状态 表决中:voting 已转项目:shift_project 已关闭:closed + */ + private String issueStatus; + + /** + * 来源类型 eg:resi_topic + */ + private String sourceType; + + /** + * 来源ID eg:2223232(当SOURCE_TYPE为"resi_topic"时,这里指话题的ID) + */ + private String sourceId; + + /** + * 关闭理由 【未关闭时可以为空】关闭话题时必填的理由,转项目后而且已经结案,这个字段不回写 + */ + private String closeReason; + + /** + * 解决类型 【未关闭时可以为空】已解决resolved、未解决unresolved,对应在关闭议题时所选的checkbox,转项目后而且已经结案,这个字段不回写 + */ + private String resolveType; + + /** + * 议题名称 最多20字 + */ + private String issueTitle; + + /** + * 建议 建议 + */ + private String suggestion; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 网格ID 居民端议题对应一个网格iId + */ + private String gridId; + + /** + * 所属机关 【数据权限-非必填】11:22:33(agencyId)数据权限控制 + */ + private String orgIdPath; + + /** + * 组织ID 【数据权限-非必填】agencyId + */ + private String orgId; + + /** + * 表决截止日期 表决截止日期 + */ + private Date votingDeadline; + + /** + * 表决发起日期(转议题日期) 表决发起日期(转议题日期) + */ + private Date decidedTime; + + /** + * 转项目日期 转项目日期(服务间调用日期一致性) + */ + private Date shiftedTime; + + /** + * 关闭日期 关闭日期 + */ + private Date closedTime; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueProcessEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueProcessEntity.java new file mode 100644 index 0000000000..ccb48cb036 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueProcessEntity.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.dataaggre.entity.govissue; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 议题进展记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_process") +public class IssueProcessEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 议题ID + */ + private String issueId; + + /** + * 操作状态 - 表决中:voting 已转项目:shift_project 已关闭:closed + */ + private String issueStatus; + + /** + * 组织类型 操作人所属机构类型(机构:agency | 部门:dept | 网格:grid)操作人可能来源于居民端和政府段,但是只有在“转议题”的时候才是居民端拥有组长权限的人操作,所以当这条记录是转议题时,该记录为grid,ORD_ID相应的也为GRID_ID + */ + private String orgType; + + /** + * 组织ID 操作人所属机构ID(对应的有网格ID、部门ID、机构ID) + */ + private String orgId; + + /** + * 操作说明 (节点的说明文案,包含三个节点的文案说明【转议题】、【已关闭】、【转项目】) + */ + private String operationExplain; + + /** + * 组织名称 + * */ + private String orgName; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueProjectRelationEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueProjectRelationEntity.java new file mode 100644 index 0000000000..71152d440e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueProjectRelationEntity.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.dataaggre.entity.govissue; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 议题项目关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_project_relation") +public class IssueProjectRelationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 议题ID 议题ID + */ + private String issueId; + + /** + * 项目ID 项目ID + */ + private String projectId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueSatisfactionDetailEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueSatisfactionDetailEntity.java new file mode 100644 index 0000000000..478dd4b6be --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueSatisfactionDetailEntity.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.dataaggre.entity.govissue; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 议题满意度调查记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_satisfaction_detail") +public class IssueSatisfactionDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 议题ID + */ + private String issueId; + + /** + * 评论 - 最多300字 + */ + private String comment; + + /** + * 满意度 满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + private String satisfaction; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueSatisfactionStatisticalEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueSatisfactionStatisticalEntity.java new file mode 100644 index 0000000000..f97a43be33 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueSatisfactionStatisticalEntity.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.govissue; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 议题满意度调查统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_satisfaction_statistical") +public class IssueSatisfactionStatisticalEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 议题ID + */ + private String issueId; + + /** + * 一般满意数 + */ + private Integer goodCount; + + /** + * 非常满意数 + */ + private Integer perfectCount; + + /** + * 不满意数 + */ + private Integer badCount; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueSuggestionEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueSuggestionEntity.java new file mode 100644 index 0000000000..5573308f72 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueSuggestionEntity.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.dataaggre.entity.govissue; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 居民端用户对议题建议或意见表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-11-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_suggestion") +public class IssueSuggestionEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id customer.id + */ + private String customerId; + + /** + * 议题id + */ + private String issueId; + + /** + * 议题所属网格id + */ + private String gridId; + + /** + * 对议题的想法 + */ + private String suggestion; + + /** + * 1公开; 0匿名 + */ + private Integer publicFlag; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueVoteDetailEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueVoteDetailEntity.java new file mode 100644 index 0000000000..bb5f005d19 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueVoteDetailEntity.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.dataaggre.entity.govissue; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 议题表决记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_vote_detail") +public class IssueVoteDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 议题ID + */ + private String issueId; + + /** + * 态度 - opposition(反对)support(赞成) + */ + private String attitude; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueVoteStatisticalDailyEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueVoteStatisticalDailyEntity.java new file mode 100644 index 0000000000..6bdcb15195 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueVoteStatisticalDailyEntity.java @@ -0,0 +1,85 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.govissue; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 议题表决按天统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_vote_statistical_daily") +public class IssueVoteStatisticalDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 议题ID + */ + private String issueId; + + /** + * 统计日期 yyyy-MM-dd + */ + private Date statisticalDate; + + /** + * 到该日的总赞成数 + */ + private Integer supportCount; + + /** + * 到该日的总反对数 + */ + private Integer oppositionCount; + + /** + * 到该日的总票数 + */ + private Integer totalCount; + + /** + * 该日增量 + */ + private Integer todayIncrement; + + /** + * 该日赞成增量 + */ + private Integer supportIncrement; + + /** + * 该日反对增量 + */ + private Integer oppositionIncrement; + + /** + * 到该日的应表决数 + */ + private Integer votableCount; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueVoteStatisticalEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueVoteStatisticalEntity.java new file mode 100644 index 0000000000..3cbbfd50d2 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govissue/IssueVoteStatisticalEntity.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.govissue; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 议题表决统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_vote_statistical") +public class IssueVoteStatisticalEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 议题ID + */ + private String issueId; + + /** + * 支持数 + */ + private Integer supportCount; + + /** + * 反对数 + */ + private Integer oppositionCount; + + /** + * 应表决数 + */ + private Integer votableCount; + +} 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 new file mode 100644 index 0000000000..79f226ca2f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerAgencyEntity.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.dataaggre.entity.govorg; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 机关单位信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_agency") +public class CustomerAgencyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 所有上级名称,以-连接 + */ + private String allParentName; + + /** + * 组织名称 + */ + private String organizationName; + + /** + * 机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) + */ + private String level; + + /** + * 地区编码 + */ + private String areaCode; + + /** + * 总人数 + */ + private Integer totalUser; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 区县 + */ + private String district; + + /** + * 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 + */ + private String parentAreaCode; +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerDepartmentEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerDepartmentEntity.java new file mode 100644 index 0000000000..c0d80a3d9f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerDepartmentEntity.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.dataaggre.entity.govorg; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 客户部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_department") +public class CustomerDepartmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String agencyId; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门职责 + */ + private String departmentDuty; + + /** + * 总人数 + */ + private Integer totalUser; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerGridEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerGridEntity.java new file mode 100644 index 0000000000..60e35afefa --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerGridEntity.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.dataaggre.entity.govorg; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 客户网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_grid") +public class CustomerGridEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 所属地区码(所属组织地区码) + */ + private String areaCode; + + /** + * 管辖区域 + */ + private String manageDistrict; + + /** + * 当前网格总人数 + */ + private Integer totalUser; + + /** + * 所属组织机构ID(customer_organization.id) + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerPartyBranchEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerPartyBranchEntity.java new file mode 100644 index 0000000000..6113dbe16c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerPartyBranchEntity.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.dataaggre.entity.govorg; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 党支部信息 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_party_branch") +public class CustomerPartyBranchEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 支部名称 + */ + private String partyBranchName; + + /** + * 概要 + */ + private String profile; + + /** + * 党支部所属网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 党员总数 + */ + private Integer totalPartyMember; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerStaffAgencyEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerStaffAgencyEntity.java new file mode 100644 index 0000000000..b63f797cf7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerStaffAgencyEntity.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.dataaggre.entity.govorg; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 人员-机关单位关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_staff_agency") +public class CustomerStaffAgencyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户ID + */ + private String userId; + + /** + * 组织机构ID customer_agency.id + */ + private String agencyId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerStaffDepartmentEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerStaffDepartmentEntity.java new file mode 100644 index 0000000000..cd3febb9b6 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerStaffDepartmentEntity.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.dataaggre.entity.govorg; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 部门人员关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_staff_department") +public class CustomerStaffDepartmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户ID + */ + private String userId; + + /** + * 部门ID customer_department.id + */ + private String departmentId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerStaffGridEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerStaffGridEntity.java new file mode 100644 index 0000000000..ef0f476417 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/CustomerStaffGridEntity.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.dataaggre.entity.govorg; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 网格人员关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_staff_grid") +public class CustomerStaffGridEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户id, user.id + */ + private String userId; + + /** + * 网格ID customer_grid.id + */ + private String gridId; + + /** + * 客户ID + */ + private String customerId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/StaffTransferRecordEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/StaffTransferRecordEntity.java new file mode 100644 index 0000000000..3f4d731942 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govorg/StaffTransferRecordEntity.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.dataaggre.entity.govorg; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 工作人员调动记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("staff_transfer_record") +public class StaffTransferRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 调动人员Id(操作人) + */ + private String operateStaffId; + + /** + * 被调动人员Id + */ + private String operatedStaffId; + + /** + * 调动前组织Id + */ + private String oldAgencyId; + + /** + * 调动后组织Id + */ + private String agencyId; + + /** + * 备注说明 + */ + private String remarks; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/CustomerProjectParameterEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/CustomerProjectParameterEntity.java new file mode 100644 index 0000000000..929a44b6a2 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/CustomerProjectParameterEntity.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.dataaggre.entity.govproject; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 项目客户参数订制表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_project_parameter") +public class CustomerProjectParameterEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 参数KEY值 + */ + private String parameterKey; + + /** + * 参数名称 + */ + private String parameterName; + + /** + * 参数VALUE值 + */ + private String parameterValue; + + /** + * 说明 + */ + private String description; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectCategoryEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectCategoryEntity.java new file mode 100644 index 0000000000..75716092e7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectCategoryEntity.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.dataaggre.entity.govproject; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project_category") +public class ProjectCategoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 来源网格id + */ + private String gridId; + + /** + * 项目id + */ + private String projectId; + + /** + * 分类id + */ + private String categoryId; + + /** + * 分类对应的所有上级,英文逗号隔开 + */ + private String categoryPids; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectEntity.java new file mode 100644 index 0000000000..1a4c9ea1e1 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectEntity.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.dataaggre.entity.govproject; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project") +public class ProjectEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 来源:议题issue + */ + private String origin; + + /** + * 来源ID + */ + private String originId; + + /** + * 项目标题 + */ + private String title; + + /** + * 状态:待处理 pending,结案closed + */ + private String status; + + /** + * 结案状态:已解决 resolved,未解决 unresolved + */ + private String closedStatus; + + /** + * 所属机关 11:22:33(本机关以及上级所有机关ID) + */ + private String orgIdPath; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectOrgRelationEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectOrgRelationEntity.java new file mode 100644 index 0000000000..975d2282a0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectOrgRelationEntity.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.dataaggre.entity.govproject; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目机关历时关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project_org_relation") +public class ProjectOrgRelationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 关联PROJECT_STAFF,由此ID可以关联出PROJECT_ID、CUSTOMER_ID、PROCESS_ID + */ + private String projectStaffId; + + /** + * 流转到的日期 同CREATED_TIME + */ + private Date informedDate; + + /** + * 流转走或结案的日期 + */ + private Date handledDate; + + /** + * 节点耗时,从流转到自己到流转走共耗时,单位:分钟,如果项目还没有结案且该项目在这个组织下一直滞留,这一项为空 +8*60的倍数 + */ + private Integer totalPeriod; + + /** + * 第一次响应时间 + */ + private Date firstDealtDate; + + /** + * 首次响应时长,单位:分钟 +8*60的倍数 + */ + private Integer firstReplyPeriod; + + /** + * 来源动作,return(回退)、transfer(流转)、closed(结案)、response(响应)、created(立项时第一个流转到的) + */ + private String sourceOperation; + + /** + * 处理动作,return(回退)、transfer(流转)、closed(结案)、response(响应) + */ + private String operation; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectProcessAttachmentEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectProcessAttachmentEntity.java new file mode 100644 index 0000000000..62b9ca896a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectProcessAttachmentEntity.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.dataaggre.entity.govproject; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目节点附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project_process_attachment") +public class ProjectProcessAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户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 Integer isRelease; + + /** + * 附件审核状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) +现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 附件审核结果描述 + */ + private String reason; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectProcessEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectProcessEntity.java new file mode 100644 index 0000000000..661dc19df3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectProcessEntity.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.govproject; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目处理进展表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project_process") +public class ProjectProcessEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 处理部门 + */ + private String departmentName; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 所属机关(11:22:33) + */ + private String orgIdPath; + + /** + * 负负责人ID + */ + private String staffId; + + /** + * 处理:结案close,退回return,部门流转transfer,创建项目created + */ + private String operation; + + /** + * 处理进展名称 + */ + private String operationName; + + /** + * 公开答复 + */ + private String publicReply; + + /** + * 内部备注 + */ + private String internalRemark; + + /** + * 结束时间 + */ + private Date endTime; + + /** + * 耗费天数 + */ + private String costWorkdays; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectProcessScanTaskEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectProcessScanTaskEntity.java new file mode 100644 index 0000000000..3a14d8cb52 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectProcessScanTaskEntity.java @@ -0,0 +1,79 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.govproject; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目节点附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project_process_scan_task") +public class ProjectProcessScanTaskEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 项目进展表(project_process)ID + */ + private String processId; + + /** + * 项目附件表主键,对应dataId + */ + private String projectProcessAttachmentId; + + /** + * 阿里云审核任务Id + */ + private String taskId; + + /** + * 审核状态【auditing: 审核中; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规;】 + */ + private String status; + + /** + * 附件类型(视频 - video、 语音 - voice 文件 - doc) + */ + private String attachmentType; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectRelatedPersonnelEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectRelatedPersonnelEntity.java new file mode 100644 index 0000000000..95259997cf --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectRelatedPersonnelEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.govproject; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目相关人员表(存放话题人、议题人数据) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project_related_personnel") +public class ProjectRelatedPersonnelEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 项目ID + */ + private String projectId; + + /** + * 所属端 居民端用户resi、政府端工作人员gov、运营端工作人员oper + */ + private String app; + + /** + * 网格ID app=resi时,此列为gridId,其他情况暂定 * + */ + private String gridId; + + /** + * 来源类型(话题:topic 议题:issue) + */ + private String sourceType; + + /** + * 来源Id(话题或议题Id) + */ + private String sourceId; + + /** + * 用户ID + */ + private String userId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectSatisfactionDetailEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectSatisfactionDetailEntity.java new file mode 100644 index 0000000000..8017977d0a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectSatisfactionDetailEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.govproject; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目满意度调查记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project_satisfaction_detail") +public class ProjectSatisfactionDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 项目ID + */ + private String projectId; + + /** + * 评论 - 最多300字 + */ + private String comment; + + /** + * 满意度 - 不满意:bad、基本满意:good、非常满意:perfect + */ + private String satisfaction; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectSatisfactionStatisticsEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectSatisfactionStatisticsEntity.java new file mode 100644 index 0000000000..2c0cd8dd2b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectSatisfactionStatisticsEntity.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.dataaggre.entity.govproject; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目满意度调查统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project_satisfaction_statistics") +public class ProjectSatisfactionStatisticsEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 项目ID + */ + private String projectId; + + /** + * 一般满意数 + */ + private Integer goodCount; + + /** + * 非常满意数 + */ + private Integer perfectCount; + + /** + * 不满意数 + */ + private Integer badCount; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectStaffEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectStaffEntity.java new file mode 100644 index 0000000000..02b37cafc6 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectStaffEntity.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.dataaggre.entity.govproject; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目人员关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project_staff") +public class ProjectStaffEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 项目ID + */ + private String projectId; + + /** + * 处理进展ID + */ + private String processId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String orgId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 所属机关(11:22:33) + */ + private String orgIdPath; + + /** + * 人员ID + */ + private String staffId; + + /** + * 处理部门 + */ + private String departmentName; + + /** + * 是否处理:未处理unhandled,已处理handle + */ + private String isHandle; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectTagsEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectTagsEntity.java new file mode 100644 index 0000000000..b8cb424054 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/govproject/ProjectTagsEntity.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.dataaggre.entity.govproject; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目关联标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project_tags") +public class ProjectTagsEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/EnterGroupSwitchEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/EnterGroupSwitchEntity.java new file mode 100644 index 0000000000..998b777710 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/EnterGroupSwitchEntity.java @@ -0,0 +1,58 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("enter_group_switch") +public class EnterGroupSwitchEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 小组所属网格id + */ + private String gridId; + + /** + * 小组id + */ + private String groupId; + + /** + * open开启; close关闭 + */ + private String auditSwitch; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/GroupEditSubmitRecordEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/GroupEditSubmitRecordEntity.java new file mode 100644 index 0000000000..e3d3e1a215 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/GroupEditSubmitRecordEntity.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.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 组编辑提交记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("group_edit_submit_record") +public class GroupEditSubmitRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 小组ID + */ + private String groupId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 头像 + */ + private String groupHeadPhoto; + + /** + * 小组名称 + */ + private String groupName; + + /** + * 小组介绍 + */ + private String groupIntroduction; + + /** + * 审核状态。under_auditting:审核中,approved:通过,rejected:驳回 + */ + private String auditStatus; + + /** + * 审核人ID + */ + private String staffId; + + /** + * 回复 + */ + private String remark; + + /** + * 审核时间 + */ + private Date auditTime; + + /** + * 已读read 未读unread + */ + private String readFlag; + + /** + * 审核人员查看待审核列表时的文案,如:党员李华申请变更小组【原小组名】,请审核。 + */ + private String messageText; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/GroupInvitationEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/GroupInvitationEntity.java new file mode 100644 index 0000000000..1edd70783f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/GroupInvitationEntity.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.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 群邀请记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("group_invitation") +public class GroupInvitationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 邀请人id(customer_user.id) + */ + private String inviterUserId; + + /** + * 邀请人所属客户id + */ + private String inviterCustomerId; + + /** + * 邀请网格id + */ + private String inviterGridId; + + /** + * 邀请小组id(resi_group.id) + */ + private String resiGroupId; + + /** + * 邀请链接:invited;扫码:scancode + */ + private String invitationType; + + /** + * 邀请内容 + */ + private String inviterContent; + + /** + * 邀请码有效截止时间(暂定XX天) + */ + private Date validEndTime; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/GroupMemeberOperationEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/GroupMemeberOperationEntity.java new file mode 100644 index 0000000000..b947e1bdb4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/GroupMemeberOperationEntity.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 组成员出入群记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("group_memeber_operation") +public class GroupMemeberOperationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户id来源于customer_user.id + */ + private String customerUserId; + + /** + * 群组表主键RESI_GROUP.ID + */ + private String groupId; + + /** + * 状态: +审核中 - under_auditting、 +审核通过 - approved、 +入群被拒 - rejected 、 +已禁言 - silent、 +取消禁言-cancel_silent resi_group_member中status置为approved +被移出群 - removed 修改resi_group_member表del_flag=1 +Ps: 1) 入群被拒绝之后,如果再申请是插入一条新的审核中的数据 + 2)组长看到的待审核列表,同一个人一开始被拒绝,后来再次申请,列表是显示2条 + */ + private String operateStatus; + + /** + * 入群方式:(受邀请入群 - invited;主动加入 - join;created创建群自动进入;scancode扫码入群;话题分享链接 - topic_share_link;议题分享链接 - issue_share_link) + */ + private String enterGroupType; + + /** + * 邀请连接id对应GROUP_INVITATION.id + */ + private String groupInvitationId; + + /** + * 入群理由、拒绝理由 + */ + private String operateDes; + + /** + * 操作人id + */ + private String operateUserId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/InvitationAccessRecordEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/InvitationAccessRecordEntity.java new file mode 100644 index 0000000000..9db8112806 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/InvitationAccessRecordEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 邀请链接访问表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("invitation_access_record") +public class InvitationAccessRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 邀请链接主键group_invitation.id + */ + private String invitationId; + + /** + * 用户idcustomer_user.id + */ + private String customerUserId; + + /** + * 状态:(已浏览 - viewed 、 同意加入小组 - tried 、 成功入群 - success) + */ + private String state; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupCodeEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupCodeEntity.java new file mode 100644 index 0000000000..a9a2fb7dc3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupCodeEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 小组二维码 小组唯一二维码,海报码和小组码是同一个二维码,长期有效的 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_group_code") +public class ResiGroupCodeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组Id + */ + private String groupId; + + /** + * 邀请id + */ + private String invitationId; + + /** + * 微信二维码使用类型 邀请:invite + */ + private String type; + + /** + * 二维码路径 + */ + private String url; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupEntity.java new file mode 100644 index 0000000000..a49d9506d7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupEntity.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.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 群组信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_group") +public class ResiGroupEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 群头像(htt://地址) + */ + private String groupHeadPhoto; + + /** + * 小组名称 + */ + private String groupName; + + /** + * 群介绍 + */ + private String groupIntroduction; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 状态:(审核通过 - approved 、 审核中 - under_auditting、 审核未通过 - rejected 、 已屏蔽 - hidden、 已关闭 - closed) +Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审核未通过” + */ + private String state; + + /** + * 最新话题时间 + */ + private Date latestTopicPublishDate; + + /** + * 进组审核open开启;close关闭 + */ + private String auditSwitch; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupMemberEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupMemberEntity.java new file mode 100644 index 0000000000..101f61bf37 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupMemberEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 群组成员关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_group_member") +public class ResiGroupMemberEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户id,来源于customer_user.id + */ + private String customerUserId; + + /** + * 小组id: 来源于resi_group表id + */ + private String resiGroupId; + + /** + * member成员,leader群主 + */ + private String groupLeaderFlag; + + /** + * 入群方式:(受邀请入群 - invited 、 主动加入 - join、created创建群自动进入、扫码入群-scancode) + */ + private String enterGroupType; + + /** + * 邀请连接id对应GROUP_INVITATION.id + */ + private String groupInvitationId; + + /** + * 状态:( 审核通过 - approved、 已禁言 - silent、被移出群 - removed) + */ + private String status; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupOperationEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupOperationEntity.java new file mode 100644 index 0000000000..941d59bb88 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupOperationEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 群组操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_group_operation") +public class ResiGroupOperationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 小组id: 来源于resi_group表id + */ + private String resiGroupId; + + /** + * 状态:审核通过 - approved 、 审核中 - under_auditting、 审核未通过 - rejected 、 已屏蔽 - hidden、取消屏蔽 - hidden_cancelled、 (组的状态变为审核通过approved)、 已关闭 - closed + */ + private String state; + + /** + * 审核未通过理由 ,屏蔽理由,关闭原因 + */ + private String operateReason; + + /** + * 操作人id + */ + private String operateUserId; + + /** + * 审核人员已读未读标识(未读:unread 界面显示红点; 已读:read 不显示红点) + */ + private String readFlag; + + /** + * 消息通知内容 + */ + private String messageText; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupStatisticalEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupStatisticalEntity.java new file mode 100644 index 0000000000..ff0d8e57d5 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiGroupStatisticalEntity.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.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 群组统计信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_group_statistical") +public class ResiGroupStatisticalEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 小组id: 来源于resi_group表id + */ + private String resiGroupId; + + /** + * 成员总数 + */ + private Integer totalMembers; + + /** + * 话题总数 + */ + private Integer totalTopics; + + /** + * 已转议题总数 + */ + private Integer totalIssues; + + /** + * 党员总数 + */ + private Integer totalPartyMembers; + + /** + * 热心居民总数 + */ + private Integer totalEarnestMemebers; + + /** + * 普通居民总数=群人数 + */ + private Integer totalNormalMemebers; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiTopicAttachmentEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiTopicAttachmentEntity.java new file mode 100644 index 0000000000..3f0b97e1d1 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiTopicAttachmentEntity.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.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_topic_attachment") +public class ResiTopicAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 话题Id,关联resi_topic的id + */ + private String topicId; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址 + */ + private String attachmentUrl; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiTopicCommentEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiTopicCommentEntity.java new file mode 100644 index 0000000000..ff12b3fb1a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiTopicCommentEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题评论表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_topic_comment") +public class ResiTopicCommentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String commentContent; + + /** + * 话题Id,来自resi_topic + */ + private String topicId; + + /** + * 评论状态 + */ + private String status; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiTopicEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiTopicEntity.java new file mode 100644 index 0000000000..1056f72771 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiTopicEntity.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.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_topic") +public class ResiTopicEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 小组Id,关联resi_group的ID + */ + private String groupId; + + /** + * + */ + private String topicContent; + + /** + * 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + */ + private String status; + + /** + * 关闭状态:已解决 resolved,未解决 unresolved + */ + private String closedStatus; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String area; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String dimension; + + /** + * 是否转为议题,0:false,1:true + */ + private Integer shiftIssue; + + /** + * 议题ID,可为空 + */ + private String issueId; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiTopicOperationEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiTopicOperationEntity.java new file mode 100644 index 0000000000..261ebd0b39 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/ResiTopicOperationEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_topic_operation") +public class ResiTopicOperationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 话题Id,关联resi_topic的ID + */ + private String topicId; + + /** + * 操作类型(发布 - discussing 、 屏蔽 - hidden、 取消屏蔽 - hidden_cancelled、 关闭话题 - closed) + */ + private String operationType; + + /** + * 屏蔽理由 + */ + private String operationReason; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicDraftAttachmentEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicDraftAttachmentEntity.java new file mode 100644 index 0000000000..3881f99f81 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicDraftAttachmentEntity.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.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题草稿附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("topic_draft_attachment") +public class TopicDraftAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 话题草稿id + */ + private String topicDraftId; + + /** + * 客户id + */ + private String customerId; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址url + */ + private String attachmentUrl; + + /** + * 排序字段(按附件类型分组排序) + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) +现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 失败原因 + */ + private String reason; + + /** + * 语音或视频时长,毫秒 + */ + private Integer duration; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicDraftEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicDraftEntity.java new file mode 100644 index 0000000000..c3fd045e30 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicDraftEntity.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.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("topic_draft") +public class TopicDraftEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组Id + */ + private String groupId; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 话题草稿状态(审核中:auditing; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规; +rejected:人工审核驳回; +approved:人工审核通过) + */ + private String draftStatus; + + /** + * 草稿审核理由 + */ + private String draftReason; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String area; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String dimension; + + /** + * 发布成功后的话题id + */ + private String topicId; + + /** + * 创建者是否可见(0是 1否) + */ + private String isSee; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicDraftOperationEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicDraftOperationEntity.java new file mode 100644 index 0000000000..7cb5c3260b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicDraftOperationEntity.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.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题草稿操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("topic_draft_operation") +public class TopicDraftOperationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 话题草稿id + */ + private String topicDraftId; + + /** + * 操作类型:submit:提交发布; +auto_passed: 自动审核-通过; +review:自动审核-结果不确定,需要人工审核; +block: 自动审核-结果违规; +rejected:人工审核驳回; +approved:人工审核通过 + */ + private String operateType; + + /** + * 操作时的备注,比如驳回理由 + */ + private String remark; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicDraftScanTaskEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicDraftScanTaskEntity.java new file mode 100644 index 0000000000..72b2f3c3c2 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicDraftScanTaskEntity.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题附件检测任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("topic_draft_scan_task") +public class TopicDraftScanTaskEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 话题草稿Id + */ + private String topicDraftId; + + /** + * 话题草稿附件表Id,对应dataId + */ + private String topicDraftAttachmentId; + + /** + * 阿里云审核任务Id + */ + private String taskId; + + /** + * 审核状态【auditing: 审核中; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规;】 + */ + private String status; + + /** + * 附件类型(视频 - video、 语音 - voice) + */ + private String attachmentType; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicShareLinkRecordEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicShareLinkRecordEntity.java new file mode 100644 index 0000000000..f1145c4a43 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicShareLinkRecordEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题分享链接表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("topic_share_link_record") +public class TopicShareLinkRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题所属网格ID + */ + private String gridId; + + /** + * 小组ID + */ + private String groupId; + + /** + * 话题ID + */ + private String topicId; + + /** + * 分享人ID(当前登录用户) + */ + private String shareUserId; + + /** + * 邀请内容 + */ + private String inviteContent; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicShareLinkVisitRecordEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicShareLinkVisitRecordEntity.java new file mode 100644 index 0000000000..7a3bb3e514 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/resigroup/TopicShareLinkVisitRecordEntity.java @@ -0,0 +1,67 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.entity.resigroup; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题分享链接访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("topic_share_link_visit_record") +public class TopicShareLinkVisitRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 分享人【邀请人】ID + */ + private String shareUserId; + + /** + * 被邀请人ID + */ + private String inviteeUserId; + + /** + * 话题分享链接表id + */ + private String shareLinkRecId; + + /** + * 是否邀请注册:0:是,1:不是; +默认为1,完成注册后,回填此字段 + */ + private Integer isInviteRegister; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/DemoService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/DemoService.java new file mode 100644 index 0000000000..e77497bdcc --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/DemoService.java @@ -0,0 +1,7 @@ +package com.epmet.dataaggre.service; + +public interface DemoService { + + void doIt(); + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java new file mode 100644 index 0000000000..fc3acacff7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java @@ -0,0 +1,8 @@ +package com.epmet.dataaggre.service.epmetuser; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午9:20 + */ +public interface EpmetUserService { +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java new file mode 100644 index 0000000000..a992809a17 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java @@ -0,0 +1,17 @@ +package com.epmet.dataaggre.service.epmetuser.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.service.epmetuser.EpmetUserService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午9:21 + */ +@Service +@DataSource(DataSourceConstant.EPMET_USER) +@Slf4j +public class EpmetUserServiceImpl implements EpmetUserService { +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueDemoService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueDemoService.java new file mode 100644 index 0000000000..178ea0ce18 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueDemoService.java @@ -0,0 +1,9 @@ +package com.epmet.dataaggre.service.govissue; + +import com.epmet.dataaggre.entity.govissue.IssueEntity; + +public interface GovIssueDemoService { + + IssueEntity doIt(); + +} 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 new file mode 100644 index 0000000000..b3a96f917c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/GovIssueService.java @@ -0,0 +1,48 @@ +package com.epmet.dataaggre.service.govissue; + +import com.epmet.commons.tools.security.dto.TokenDto; +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.*; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午9:16 + */ +public interface GovIssueService { + + /** + * @Description 按组织查询所有议题 + * @Param formDTO + * @Param tokenDto + * @author zxc + * @date 2020/12/25 下午2:37 + */ + AllIssueResultDTO allIssueList(AllIssueFormDTO formDTO,TokenDto tokenDto); + + /** + * @Description 居民热议-表决中列表 + * @author sun + **/ + List votingIssueList(VotingIssueListFormDTO formDTO); + + /** + * @param fromDTO + * @Description 居民热议-已转项目列表 + * @author sun + **/ + List shiftProjectIssueList(ShiftProjectIssueListFormDTO fromDTO); + + /** + * @param fromDTO + * @Description 居民热议-已关闭列表 + * @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/GovIssueDemoServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueDemoServiceImpl.java new file mode 100644 index 0000000000..8666ed002c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueDemoServiceImpl.java @@ -0,0 +1,22 @@ +package com.epmet.dataaggre.service.govissue.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.govissue.IssueDao; +import com.epmet.dataaggre.entity.govissue.IssueEntity; +import com.epmet.dataaggre.service.govissue.GovIssueDemoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +@DataSource(DataSourceConstant.GOV_ISSUE) +public class GovIssueDemoServiceImpl implements GovIssueDemoService { + + @Autowired + private IssueDao issueDao; + + @Override + public IssueEntity doIt() { + return issueDao.selectById("01ff7c7027af11eb8dcfc03fd56f7847"); + } +} 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 new file mode 100644 index 0000000000..e379b75a38 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govissue/impl/GovIssueServiceImpl.java @@ -0,0 +1,321 @@ +package com.epmet.dataaggre.service.govissue.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.security.dto.TokenDto; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.constant.IssueConstant; +import com.epmet.dataaggre.dao.govissue.IssueApplicationDao; +import com.epmet.dataaggre.dao.govissue.IssueDao; +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.*; +import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO; +import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; +import com.epmet.dataaggre.dto.govproject.result.ShiftProjectResultDTO; +import com.epmet.dataaggre.service.govissue.GovIssueService; +import com.epmet.dataaggre.service.govorg.GovOrgService; +import com.epmet.dataaggre.service.govproject.GovProjectService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午9:16 + */ +@Service +@DataSource(DataSourceConstant.GOV_ISSUE) +@Slf4j +public class GovIssueServiceImpl implements GovIssueService { + + @Autowired + private IssueDao issueDao; + @Autowired + private IssueApplicationDao issueApplicationDao; + @Autowired + private GovOrgService govOrgService; + @Autowired + private GovProjectService govProjectService; + + /** + * @Description 按组织查询所有议题 + * @Param formDTO + * @Param tokenDto + * @author zxc + * @date 2020/12/25 下午2:37 + */ + @Override + public AllIssueResultDTO allIssueList(AllIssueFormDTO formDTO, TokenDto tokenDto) { + if (CollectionUtils.isEmpty(formDTO.getGridIdList())){ + String agencyId = govOrgService.getAgencyIdByUserId(tokenDto.getUserId()); + if (StringUtils.isBlank(agencyId)){ + throw new RenException(IssueConstant.GET_AGENCY_FAILURE); + } + List gridList = govOrgService.gridList(agencyId); + if (CollectionUtils.isEmpty(gridList)){ + throw new RenException(IssueConstant.GET_GRID_LIST_FAILURE); + } + formDTO.setGridIdList(gridList.stream().map(m -> m.getGridId()).collect(Collectors.toList())); + } + // xx街道-xx网格 + List gridsInfoList = govOrgService.gridListByIds(formDTO.getGridIdList()); + AllIssueResultDTO result = new AllIssueResultDTO(); + switch (formDTO.getIssueType()){ + // 待审核议题 + case IssueConstant.ISSUE_STATUS_AUDITING: + List resultAuditing = issueStatusAuditing(formDTO); + result.setIssueList(resultAuditing); + Integer auditingCount = issueApplicationDao.selectApplicationCount(formDTO.getGridIdList(), IssueConstant.ISSUE_STATUS_UNDER_AUDITING); + result.setTotal(auditingCount); + break; + // 被拒绝的议题 + case IssueConstant.ISSUE_STATUS_REJECTED: + List resultRejected = issueStatusRejected(formDTO); + result.setIssueList(resultRejected); + Integer rejectedCount = issueApplicationDao.selectApplicationCount(formDTO.getGridIdList(), formDTO.getIssueType()); + result.setTotal(rejectedCount); + break; + // 已转项目的议题 + case IssueConstant.ISSUE_STATUS_SHIFT_PROJECT: + List resultShiftProject = issueStatusShiftProject(formDTO); + result.setIssueList(resultShiftProject); + Integer issueCount = issueDao.selectIssueCount(formDTO.getGridIdList(),formDTO.getIssueType()); + result.setTotal(issueCount); + break; + // 已关闭、表决中的议题 + default: + List resultClosedOrVoting = issueStatusClosedOrVoting(formDTO); + result.setIssueList(resultClosedOrVoting); + Integer closeOrVotingCount = issueDao.selectIssueCount(formDTO.getGridIdList(),formDTO.getIssueType()); + result.setTotal(closeOrVotingCount); + } + if (!CollectionUtils.isEmpty(gridsInfoList)){ + // 给所属网格 赋值 + result.getIssueList().forEach(issue -> gridsInfoList.stream().filter(g -> issue.getGridId().equals(g.getGridId())).forEach(g -> issue.setBelongsGridName(g.getGridName()))); + } + return result; + } + + /** + * @Description 已关闭、表决中的议题走此方法 + * @Param formDTO + * @author zxc + * @date 2020/12/25 下午2:30 + */ + public List issueStatusClosedOrVoting(AllIssueFormDTO formDTO){ + // 当议题类型为空时 + if (StringUtils.isBlank(formDTO.getIssueType())){ + throw new RenException(IssueConstant.NOT_EXISTS_ISSUE_TYPE); + } + // 网格ID为空时 + if (CollectionUtils.isEmpty(formDTO.getGridIdList())){ + return new ArrayList<>(); + } + // 分页查询关闭/表决中的议题 + PageInfo result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> issueDao.issueStatusClosedOrVoting(formDTO.getGridIdList(), formDTO.getIssueType())); + List list = result.getList(); + List resultList = new ArrayList<>(); + // 根据议题类型,分开排序 + if (formDTO.getIssueType().equals(IssueConstant.ISSUE_STATUS_CLOSED)){ + // 议题关闭时间排序 + resultList = list.stream().sorted(Comparator.comparing(IssueListResultDTO::getIssueClosedTime).reversed()).collect(Collectors.toList()); + }else { + // 议题创建时间 + resultList = list.stream().sorted(Comparator.comparing(IssueListResultDTO::getCreateTime).reversed()).collect(Collectors.toList()); + } + return resultList; + } + + /** + * @Description 被拒绝的议题走此方法 + * @Param formDTO + * @author zxc + * @date 2020/12/25 下午2:34 + */ + public List issueStatusRejected(AllIssueFormDTO formDTO){ + if (CollectionUtils.isEmpty(formDTO.getGridIdList())){ + return new ArrayList<>(); + } + PageInfo result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> issueApplicationDao.issueStatusRejected(formDTO.getGridIdList())); + List list = result.getList(); + if (CollectionUtils.isEmpty(list)){ + return new ArrayList<>(); + } + List resultDTOs = new ArrayList<>(); + // 按照话题ID分组 + Map> groupByTopic = list.stream().collect(Collectors.groupingBy(IssueListResultDTO::getTopicId)); + groupByTopic.forEach((topicId,l) -> { + // 取每个话题时间最近的一条记录 + IssueListResultDTO issueListResultDTO = l.stream().max(Comparator.comparing(IssueListResultDTO::getRejectedTime)).get(); + resultDTOs.add(issueListResultDTO); + }); + List collect = resultDTOs.stream().sorted(Comparator.comparing(IssueListResultDTO::getRejectedTime).reversed()).collect(Collectors.toList()); + return collect; + } + + /** + * @Description 审核中的议题走此方法 + * @Param formDTO + * @author zxc + * @date 2020/12/25 下午4:34 + */ + public List issueStatusAuditing(AllIssueFormDTO formDTO){ + if (CollectionUtils.isEmpty(formDTO.getGridIdList())){ + return new ArrayList<>(); + } + PageInfo result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> issueApplicationDao.issueStatusAuditing(formDTO.getGridIdList())); + return result.getList().stream().sorted(Comparator.comparing(IssueListResultDTO::getAuditingTime).reversed()).collect(Collectors.toList()); + } + + /** + * @Description 议题状态为转项目时走此方法 + * @Param formDTO + * @author zxc + * @date 2020/12/28 上午9:13 + */ + public List issueStatusShiftProject(AllIssueFormDTO formDTO){ + if (CollectionUtils.isEmpty(formDTO.getGridIdList())){ + return new ArrayList<>(); + } + // 查询已转项目的议题 + PageInfo result = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> issueDao.issueStatusShiftProject(formDTO.getGridIdList())); + List list = result.getList(); + if (CollectionUtils.isEmpty(list)){ + return new ArrayList<>(); + } + List issueIds = list.stream().map(m -> m.getIssueId()).collect(Collectors.toList()); + // 根据issueIds去查询项目信息 + List resultDTOS = govProjectService.selectProjectInfo(issueIds); + if (CollectionUtils.isEmpty(resultDTOS)){ + throw new RenException(IssueConstant.NOT_EXISTS_PROJECT_INFO); + } + list.forEach(l -> { + resultDTOS.forEach(r -> { + if (l.getIssueId().equals(r.getIssueId())){ + l.setClosedReason(r.getClosedReason()); + l.setStatus(r.getStatus()); + l.setCurrentDepartment(r.getCurrentDepartment()); + } + }); + }); + // 根据转项目时间排序 + List collect = list.stream().sorted(Comparator.comparing(IssueListResultDTO::getShiftProjectTime).reversed()).collect(Collectors.toList()); + return collect; + } + + /** + * @Description 居民热议-表决中列表 + * @author sun + **/ + @Override + public List votingIssueList(VotingIssueListFormDTO formDTO) { + List resultList = new ArrayList<>(); + int num = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(num); + //1.查询组织下网格列表 + List gridList = govOrgService.gridList(formDTO.getAgencyId()); + List gridIdList = gridList.stream().map(GridInfoResultDTO::getGridId).collect(Collectors.toList()); + if (gridIdList.size() < NumConstant.ONE) { + return resultList; + } + formDTO.setGridIdList(gridIdList); + + //2.查询网格列表下表决中的议题列表 + resultList = issueDao.selectVotingList(formDTO); + if (null == resultList || resultList.size() < NumConstant.ONE) { + return new ArrayList<>(); + } + + //3.根据网格Id查询"组织-网格"名称 + List gridInfoList = govOrgService.gridListByIds(gridIdList); + + //4.封装数据并返回 + HashMap gridIdAndNames = new HashMap<>(); + gridInfoList.stream().forEach(g -> gridIdAndNames.put(g.getGridId(), g.getGridName())); + resultList.stream().forEach(pt -> pt.setBelongsGridName(gridIdAndNames.get(pt.getGridId()))); + + return resultList; + } + + /** + * @param fromDTO + * @Description 居民热议-已转项目列表 + * @author sun + **/ + @Override + public List shiftProjectIssueList(ShiftProjectIssueListFormDTO fromDTO) { + List resultList = new ArrayList<>(); + int pageIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize(); + fromDTO.setPageNo(pageIndex); + //1.查询组织及下级已转项目议题列表数据 + List issueList = issueDao.selectIssueListByGridIds(fromDTO); + if (null == issueList || issueList.size() < NumConstant.ONE) { + return resultList; + } + + //2.查询议题对应项目数据 + List issueIds = issueList.stream().map(IssueShiftProjectResultDTO::getIssueId).collect(Collectors.toList()); + List projectList = govProjectService.getProjectByIssue(issueIds); + + //3.遍历封装数据并返回 + resultList = issueList.stream().flatMap(issue -> projectList.stream().filter(p -> issue.getIssueId().equals(p.getOriginId())).map(project -> { + ShiftProjectIssueListResultDTO shiftProject = new ShiftProjectIssueListResultDTO(); + shiftProject.setIssueId(issue.getIssueId()); + shiftProject.setIssueTitle(issue.getIssueTitle()); + shiftProject.setCount(issue.getCount()); + shiftProject.setDepartmentNameList(project.getDepartmentNameList()); + shiftProject.setClosedReason(project.getPublicReply()); + shiftProject.setShiftedTime(project.getCreatedTime().getTime() / NumConstant.ONE_THOUSAND); + shiftProject.setStatus(project.getStatus()); + return shiftProject; + })).collect(Collectors.toList()); + return resultList; + } + + /** + * @param fromDTO + * @Description 居民热议-已关闭列表 + * @author sun + **/ + @Override + public List closedIssueList(ClosedIssueListFormDTO fromDTO) { + List resultList = new ArrayList<>(); + //分页参数 + int pageIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize(); + fromDTO.setPageNo(pageIndex); + + //1.查询组织及下级议题已关闭列表数据 + resultList = issueDao.selectClosedListGov(fromDTO); + if(null == resultList || resultList.size()(); + } + + //2.根据网格Id查询"组织-网格"名称 + List gridIdList = resultList.stream().map(ClosedIssueListResultDTO::getGridId).collect(Collectors.toList()); + List gridInfoList = govOrgService.gridListByIds(gridIdList); + + //3.封装数据并返回 + HashMap gridIdAndNames = new HashMap<>(); + gridInfoList.stream().forEach(g -> gridIdAndNames.put(g.getGridId(), g.getGridName())); + resultList.stream().forEach(pt -> pt.setBelongsGridName(gridIdAndNames.get(pt.getGridId()))); + + 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/govorg/GovOrgDemoService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgDemoService.java new file mode 100644 index 0000000000..2891de430f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgDemoService.java @@ -0,0 +1,9 @@ +package com.epmet.dataaggre.service.govorg; + +import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; + +public interface GovOrgDemoService { + + CustomerAgencyEntity doIt(); + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java new file mode 100644 index 0000000000..c0b7fff4bd --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -0,0 +1,45 @@ +package com.epmet.dataaggre.service.govorg; + +import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO; +import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO; +import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午9:15 + */ +public interface GovOrgService { + + /** + * @param staffId + * @Author sun + * @Description 组织、网格树结构 + **/ + AgencyGridResultDTO agencyGridList(String staffId); + + /** + * @param agencyId + * @Author sun + * @Description 根据组织Id查询当前组织及下级所有网格列表 + **/ + List gridList(String agencyId); + + /** + * @param gridIdList + * @return + * @Description 根据网格Id集合获取网格列表信息 + * @Author sun + */ + List gridListByIds(List gridIdList); + + /** + * @Description 根据userId查询组织ID + * @Param userId + * @author zxc + * @date 2020/12/25 下午4:53 + */ + String getAgencyIdByUserId(String userId); + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgDemoServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgDemoServiceImpl.java new file mode 100644 index 0000000000..1bba954d93 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgDemoServiceImpl.java @@ -0,0 +1,23 @@ +package com.epmet.dataaggre.service.govorg.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.govorg.CustomerAgencyDao; +import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; +import com.epmet.dataaggre.service.govorg.GovOrgDemoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +@Service +@DataSource(DataSourceConstant.GOV_ORG) +public class GovOrgDemoServiceImpl implements GovOrgDemoService { + + @Autowired + private CustomerAgencyDao customerAgencyDao; + + @Override + public CustomerAgencyEntity doIt() { + return customerAgencyDao.selectById("00b41781da588d173af874ac9f33386e"); + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java new file mode 100644 index 0000000000..7b3314f5dc --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -0,0 +1,124 @@ +package com.epmet.dataaggre.service.govorg.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.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.govorg.CustomerAgencyDao; +import com.epmet.dataaggre.dao.govorg.CustomerGridDao; +import com.epmet.dataaggre.dao.govorg.CustomerStaffAgencyDao; +import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO; +import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO; +import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO; +import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; +import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; +import com.epmet.dataaggre.service.govorg.GovOrgService; +import lombok.extern.slf4j.Slf4j; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/12/25 上午9:15 + */ +@Service +@DataSource(DataSourceConstant.GOV_ORG) +@Slf4j +public class GovOrgServiceImpl implements GovOrgService { + private static final Logger logger = LoggerFactory.getLogger(GovOrgServiceImpl.class); + + @Autowired + private CustomerAgencyDao customerAgencyDao; + @Autowired + private CustomerStaffAgencyDao customerStaffAgencyDao; + @Autowired + private CustomerGridDao customerGridDao; + + + /** + * @param staffId + * @Author sun + * @Description 组织、网格树结构 + **/ + @Override + public AgencyGridResultDTO agencyGridList(String staffId) { + AgencyGridResultDTO returnDTO = new AgencyGridResultDTO(); + + //1:根据staffId查询该工作人员对应的机关Id、客户Id + CustomerStaffAgencyDTO staffAgencyDTO = customerStaffAgencyDao.selectByStaffId(staffId); + if (null == staffAgencyDTO || null == staffAgencyDTO.getId()) { + throw new RenException(String.format("获取工作人员组织信息失败,staffId->%s", staffId)); + } + + //2:查询当前组织机关信息 + CustomerAgencyEntity agencyEntity = customerAgencyDao.selectById(staffAgencyDTO.getAgencyId()); + returnDTO.setAgencyId(agencyEntity.getId()); + returnDTO.setAgencyName(agencyEntity.getOrganizationName()); + + //3:查询当前机关下的网格列表 + List gridList = customerGridDao.selectGridListByAgencyId(agencyEntity.getId()); + returnDTO.setGridList(gridList); + + //4:递归查询当前组织的下级组织以及每个下级组织对应的网格列表 + //根组织pids为空 + List subAgencyGridList = getGridList(("".equals(agencyEntity.getPids()) ? "" : agencyEntity.getPids() + ":") + agencyEntity.getId()); + returnDTO.setSubAgencyGridList(subAgencyGridList); + + return returnDTO; + } + + /** + * @Author sun + * @Description 递归查询当前机关的下一级机关列表 + **/ + private List getGridList(String subPids) { + List subAgencyList = customerAgencyDao.selectAllSubAgency(subPids); + if (subAgencyList.size() > NumConstant.ZERO) { + for (AgencyGridResultDTO sub : subAgencyList) { + List gridList = customerGridDao.selectGridListByAgencyId(sub.getAgencyId()); + sub.setGridList(gridList); + List subAgency = getGridList(sub.getPids() + ":" + sub.getAgencyId()); + sub.setSubAgencyGridList(subAgency); + } + } + return subAgencyList; + } + + /** + * @param agencyId + * @Author sun + * @Description 根据组织Id查询当前组织及下级所有网格列表 + **/ + @Override + public List gridList(String agencyId) { + return customerGridDao.selectAgencyGridList(agencyId); + } + + /** + * @param gridIdList + * @return + * @Description 根据网格Id集合获取网格列表信息 + * @Author sun + */ + @Override + public List gridListByIds(List gridIdList) { + return customerGridDao.selectGridByIds(gridIdList); + } + + /** + * @Description 根据userId查询组织ID + * @Param userId + * @author zxc + * @date 2020/12/25 下午4:53 + */ + @Override + public String getAgencyIdByUserId(String userId) { + return customerAgencyDao.getAgencyIdByUserId(userId); + } + + +} 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 new file mode 100644 index 0000000000..38192cd035 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/GovProjectService.java @@ -0,0 +1,44 @@ +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 com.epmet.dataaggre.dto.govproject.result.ProjectDistributionResultDTO; +import com.epmet.dataaggre.dto.govproject.result.ShiftProjectResultDTO; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/12/24 下午5:50 + */ +public interface GovProjectService { + /** + * 全部项目 + * @author zhaoqifeng + * @date 2020/12/25 15:59 + * @param tokenDto token + * @param formDTO 入参 + * @return java.util.List + */ + AllProjectResultDTO allProjectList(TokenDto tokenDto, AllProjectFormDTO formDTO); + + /** + * @Description 查询项目信息 + * @Param issueIds + * @author zxc + * @date 2020/12/25 下午5:46 + */ + List selectProjectInfo(List issueIds); + + /** + * @Description 根据议题Id集合查询项目数据 + * @author sun + **/ + 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 new file mode 100644 index 0000000000..cc664bf225 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java @@ -0,0 +1,236 @@ +package com.epmet.dataaggre.service.govproject.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.security.dto.TokenDto; +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.govproject.ProjectDao; +import com.epmet.dataaggre.dto.govissue.result.IssueInfoDTO; +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.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; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @DateTime 2020/12/24 下午5:50 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.GOV_PROJECT) +public class GovProjectServiceImpl implements GovProjectService { + + @Autowired + private ProjectDao projectDao; + @Autowired + private GovOrgService govOrgService; + @Autowired + private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; + @Autowired + private GovIssueService govIssueService; + @Autowired + private ResiGroupService resiGroupService; + + /** + * @Description 查询项目信息 + * @Param issueIds + * @author zxc + * @date 2020/12/25 下午5:47 + */ + @Override + public List selectProjectInfo(List issueIds) { + if (CollectionUtils.isEmpty(issueIds)){ + return new ArrayList<>(); + } + // 已关闭项目 + List closedResult = projectDao.selectProjectInfoClosed(issueIds); + // 为关闭项目 + List pendingResult = projectDao.selectProjectInfoPending(issueIds); + if (CollectionUtils.isEmpty(closedResult)){ + if (CollectionUtils.isEmpty(pendingResult)) { + return new ArrayList<>(); + } + return pendingResult; + } + if (CollectionUtils.isEmpty(pendingResult)){ + if (CollectionUtils.isEmpty(closedResult)) { + return new ArrayList<>(); + } + return closedResult; + } + closedResult.addAll(pendingResult); + List result = new ArrayList<>(); + // 根据议题分组 + Map> groupByIssue = closedResult.stream().collect(Collectors.groupingBy(IssueListResultDTO::getIssueId)); + groupByIssue.forEach((k,v) ->{ + // 取每个项目时间最近一条记录 + List sortByTime = v.stream().sorted(Comparator.comparing(IssueListResultDTO::getOperationTime).reversed()).collect(Collectors.toList()); + result.add(sortByTime.get(NumConstant.ZERO)); + }); + return closedResult; + } + + /** + * @Description 根据议题Id集合查询项目数据 + * @author sun + **/ + @Override + public List getProjectByIssue(List issueIdList) { + List resultList = new ArrayList<>(); + List projectList = projectDao.selectShiftProjectList(issueIdList); + projectList.forEach(project -> { + ShiftProjectResultDTO shiftProject = ConvertUtils.sourceToTarget(project, ShiftProjectResultDTO.class); + List departmentNameList = projectDao.selectDepartmentNameList(project); + shiftProject.setDepartmentNameList(departmentNameList); + resultList.add(shiftProject); + }); + 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; + } + + + /** + * 全部项目 + * + * @param tokenDto token + * @param formDTO 入参 + * @return java.util.List + * @author zhaoqifeng + * @date 2020/12/25 15:59 + */ + @Override + public AllProjectResultDTO allProjectList(TokenDto tokenDto, AllProjectFormDTO formDTO) { + AllProjectResultDTO resultDTO = new AllProjectResultDTO(); + String agencyId = govOrgService.getAgencyIdByUserId(tokenDto.getUserId()); + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + + if (StringUtils.isEmpty(agencyId)) { + throw new RenException(String.format("获取工作人员组织信息失败,staffId->%s", tokenDto.getUserId())); + } + formDTO.setAgencyId(agencyId); + List projectList = projectDao.getAllProject(formDTO); + if (CollectionUtils.isNotEmpty(projectList)) { + resultDTO.setProjectCount(projectList.size()); + projectList.forEach(project -> { + //计算项目耗时 + Integer timeSpent; + if (ProjectConstant.PROJECT_STATUS_CLOSED.equals(project.getProjectStatus())) { + timeSpent = getTimeSpent(project.getProjectId(), project.getStartTime(), project.getEndTime()); + } else { + timeSpent = getTimeSpent(project.getProjectId(), project.getStartTime(), new Date()); + } + project.setTimeSpent(timeSpent); + //获取当前处理部门 + ProjectDTO projectDTO = new ProjectDTO(); + projectDTO.setId(project.getProjectId()); + List departmentList = projectDao.selectDepartmentNameList(projectDTO); + project.setCurrentDisposeDept(departmentList); + + }); + int pageSize = pageIndex + formDTO.getPageSize(); + if (pageSize > projectList.size()) { + pageSize = projectList.size(); + } + //排序(创建:create 更新:update 部门:department 耗时:date 次数:count) + switch (formDTO.getSortType()) { + case "create": + projectList = projectList.stream().sorted(Comparator.comparing(ProjectInfoDTO::getProjectTime).reversed()) + .collect(Collectors.toList()).subList(pageIndex, pageSize); + break; + case "update": + projectList = projectList.stream().sorted(Comparator.comparing(ProjectInfoDTO::getUpdateTime).reversed()) + .collect(Collectors.toList()).subList(pageIndex, pageSize); + break; + case "department": + projectList = projectList.stream().sorted(Comparator.comparing(ProjectInfoDTO::getDepartmentCount).reversed()) + .collect(Collectors.toList()).subList(pageIndex, pageSize); + break; + case "date": + projectList = projectList.stream().sorted(Comparator.comparing(ProjectInfoDTO::getTimeSpent).reversed()) + .collect(Collectors.toList()).subList(pageIndex, pageSize); + break; + case "count": + projectList = projectList.stream().sorted(Comparator.comparing(ProjectInfoDTO::getProcessCount).reversed()) + .collect(Collectors.toList()).subList(pageIndex, pageSize); + break; + default: + break; + } + resultDTO.setProjectList(projectList); + } else { + resultDTO.setProjectCount(NumConstant.ZERO); + resultDTO.setProjectList(Collections.emptyList()); + } + + return resultDTO; + } + + + private Integer getTimeSpent(String id, Date startTime, Date endTime) { + WorkMinuteFormDTO timeParam = new WorkMinuteFormDTO(); + timeParam.setIfPrecise("imprecise"); + timeParam.setIfCustom("default"); + TimestampIntervalFormDTO interval = new TimestampIntervalFormDTO(id, startTime, endTime); + List intervalList = new LinkedList<>(); + intervalList.add(interval); + timeParam.setTimeList(intervalList); + Result> timeResult = epmetCommonServiceOpenFeignClient.workMinutes(timeParam); + + if (timeResult.success() && !org.springframework.util.CollectionUtils.isEmpty(timeResult.getData()) && null != timeResult.getData().get(id)) { + return timeResult.getData().get(id) / 60; + } else { + log.error("计算首次响应时间失败"); + throw new RenException("计算首次响应时间失败"); + } + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/DemoServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/DemoServiceImpl.java new file mode 100644 index 0000000000..de3e62a4a0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/impl/DemoServiceImpl.java @@ -0,0 +1,26 @@ +package com.epmet.dataaggre.service.impl; + +import com.epmet.dataaggre.entity.govissue.IssueEntity; +import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; +import com.epmet.dataaggre.service.DemoService; +import com.epmet.dataaggre.service.govissue.GovIssueDemoService; +import com.epmet.dataaggre.service.govorg.GovOrgDemoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class DemoServiceImpl implements DemoService { + + @Autowired + private GovOrgDemoService govOrgDemoService; + + @Autowired + private GovIssueDemoService govIssueDemoService; + + @Override + public void doIt() { + CustomerAgencyEntity customerAgencyEntity = govOrgDemoService.doIt(); + IssueEntity issueEntity = govIssueDemoService.doIt(); + System.out.println(6); + } +} 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 new file mode 100644 index 0000000000..1e15dce4fa --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java @@ -0,0 +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 new file mode 100644 index 0000000000..931c13ffbb --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java @@ -0,0 +1,29 @@ +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 + */ +@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/bootstrap.yml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..55e3265590 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml @@ -0,0 +1,157 @@ +server: + port: @server.port@ + version: @version@ + servlet: + context-path: /data/aggregator + +spring: + main: + allow-bean-definition-overriding: true + application: + name: data-aggregator-server + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + port: @spring.redis.port@ + password: @spring.redis.password@ + timeout: 30s + datasource: + #MySQL + druid: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.govissue.url@ + username: @datasource.druid.govissue.username@ + password: @datasource.druid.govissue.password@ + #环境 dev|test|prod + profiles: + active: @spring.profiles.active@ + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + #nacos的命名空间ID,默认是public + namespace: @nacos.discovery.namespace@ + #不把自己注册到注册中心的地址 + register-enabled: @nacos.register-enabled@ + ip: @nacos.ip@ + config: + enabled: @nacos.config-enabled@ + server-addr: @nacos.server-addr@ + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + file-extension: yaml + #指定共享配置,且支持动态刷新 + # ext-config: + # - data-id: datasource.yaml + # group: ${spring.cloud.nacos.config.group} + # refresh: true + # - data-id: common.yaml + # group: ${spring.cloud.nacos.config.group} + # refresh: true + + # 数据迁移工具flyway + flyway: + enabled: false +# locations: classpath:db/migration +# url: @datasource.druid.stats.url@ +# user: @datasource.druid.stats.username@ +# password: @datasource.druid.stats.password@ +# baseline-on-migrate: true +# baseline-version: 0 +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.epmet.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: INPUT + #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" + field-strategy: NOT_NULL + #驼峰下划线转换 + column-underline: true + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +#动态数据源 +dynamic: + datasource: + govorg: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.govorg.url@ + username: @datasource.druid.govorg.username@ + password: @datasource.druid.govorg.password@ + govissue: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.govissue.url@ + username: @datasource.druid.govissue.username@ + password: @datasource.druid.govissue.password@ + govproject: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.govproject.url@ + username: @datasource.druid.govproject.username@ + password: @datasource.druid.govproject.password@ + resigroup: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.resigroup.url@ + username: @datasource.druid.resigroup.username@ + password: @datasource.druid.resigroup.password@ + epmetuser: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.epmetuser.url@ + username: @datasource.druid.epmetuser.username@ + password: @datasource.druid.epmetuser.password@ + +feign: + hystrix: + enabled: true + client: + config: + default: + loggerLevel: BASIC + httpclient: + enabled: true + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ + +logging: + level: + com.epmet.dataaggre: debug diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/logback-spring.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..04411568ff --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/logback-spring.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + ${appname} + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + ${webHook} + ${secret} + ${appname} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/BadgeCertificationConfigDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/BadgeCertificationConfigDao.xml new file mode 100644 index 0000000000..f6e9b8cb2f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/BadgeCertificationConfigDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/BadgeCertificationConfigFieldDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/BadgeCertificationConfigFieldDao.xml new file mode 100644 index 0000000000..acccc5f12f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/BadgeCertificationConfigFieldDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/BadgeDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/BadgeDao.xml new file mode 100644 index 0000000000..d9be349b8f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/BadgeDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml new file mode 100644 index 0000000000..43e15095e4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerUserDao.xml new file mode 100644 index 0000000000..9676ace2cc --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerUserDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/GovStaffRoleDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/GovStaffRoleDao.xml new file mode 100644 index 0000000000..70497272c6 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/GovStaffRoleDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/GovStaffRoleTemplateDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/GovStaffRoleTemplateDao.xml new file mode 100644 index 0000000000..f3ad859fdc --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/GovStaffRoleTemplateDao.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/GridLatestDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/GridLatestDao.xml new file mode 100644 index 0000000000..3b7224f243 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/GridLatestDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/GridVisitedDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/GridVisitedDao.xml new file mode 100644 index 0000000000..7a2853c62a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/GridVisitedDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/OperUserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/OperUserDao.xml new file mode 100644 index 0000000000..088c4d652b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/OperUserDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/RegisterRelationDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/RegisterRelationDao.xml new file mode 100644 index 0000000000..21a959c15e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/RegisterRelationDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/ResiUserBadgeDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/ResiUserBadgeDao.xml new file mode 100644 index 0000000000..ba7b99c850 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/ResiUserBadgeDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/RoleDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/RoleDao.xml new file mode 100644 index 0000000000..1396add663 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/RoleDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffAgencyVisitedDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffAgencyVisitedDao.xml new file mode 100644 index 0000000000..f1411c383e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffAgencyVisitedDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffGridVisitedDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffGridVisitedDao.xml new file mode 100644 index 0000000000..0e70d9d116 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffGridVisitedDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffRoleDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffRoleDao.xml new file mode 100644 index 0000000000..03bf90a6e1 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffRoleDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffWechatDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffWechatDao.xml new file mode 100644 index 0000000000..0eb8bfca92 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffWechatDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserAdviceDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserAdviceDao.xml new file mode 100644 index 0000000000..851a6804a0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserAdviceDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserAdviceImgDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserAdviceImgDao.xml new file mode 100644 index 0000000000..0395ddbbb9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserAdviceImgDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBadgeCertificateRecordDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBadgeCertificateRecordDao.xml new file mode 100644 index 0000000000..2b303cc7a1 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBadgeCertificateRecordDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml new file mode 100644 index 0000000000..72039e24cd --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserBaseInfoDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserCustomerDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserCustomerDao.xml new file mode 100644 index 0000000000..3655902b70 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserCustomerDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserDao.xml new file mode 100644 index 0000000000..ac93fccb93 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserInvitationDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserInvitationDao.xml new file mode 100644 index 0000000000..083251729d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserInvitationDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserResiInfoDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserResiInfoDao.xml new file mode 100644 index 0000000000..e41c00500b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserResiInfoDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserResiRegisterVisitDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserResiRegisterVisitDao.xml new file mode 100644 index 0000000000..c65c82fd73 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserResiRegisterVisitDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserRoleDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserRoleDao.xml new file mode 100644 index 0000000000..13e540d055 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserRoleDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserWechatDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserWechatDao.xml new file mode 100644 index 0000000000..5fb8557e79 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/UserWechatDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueApplicationDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueApplicationDao.xml new file mode 100644 index 0000000000..08db0e9088 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueApplicationDao.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueApplicationHistoryDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueApplicationHistoryDao.xml new file mode 100644 index 0000000000..1542724d73 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueApplicationHistoryDao.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueCustomerParameterDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueCustomerParameterDao.xml new file mode 100644 index 0000000000..bf635295cd --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueCustomerParameterDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file 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 new file mode 100644 index 0000000000..44c2924ba8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueDao.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueProcessDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueProcessDao.xml new file mode 100644 index 0000000000..4e4eaf9e18 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueProcessDao.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueProjectRelationDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueProjectRelationDao.xml new file mode 100644 index 0000000000..743605ece8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueProjectRelationDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueSatisfactionDetailDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueSatisfactionDetailDao.xml new file mode 100644 index 0000000000..5afdb23f12 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueSatisfactionDetailDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueSatisfactionStatisticalDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueSatisfactionStatisticalDao.xml new file mode 100644 index 0000000000..3d7544c09d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueSatisfactionStatisticalDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueSuggestionDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueSuggestionDao.xml new file mode 100644 index 0000000000..20f52ffe4f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueSuggestionDao.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueVoteDetailDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueVoteDetailDao.xml new file mode 100644 index 0000000000..63821b8286 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueVoteDetailDao.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueVoteStatisticalDailyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueVoteStatisticalDailyDao.xml new file mode 100644 index 0000000000..f81c4aa9cf --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueVoteStatisticalDailyDao.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueVoteStatisticalDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueVoteStatisticalDao.xml new file mode 100644 index 0000000000..5116816b06 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govissue/IssueVoteStatisticalDao.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml new file mode 100644 index 0000000000..aece51edb3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerDepartmentDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerDepartmentDao.xml new file mode 100644 index 0000000000..d492f651e5 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerDepartmentDao.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml new file mode 100644 index 0000000000..331246a2f5 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerGridDao.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerPartyBranchDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerPartyBranchDao.xml new file mode 100644 index 0000000000..2bf31f64d9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerPartyBranchDao.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml new file mode 100644 index 0000000000..50269ca116 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml new file mode 100644 index 0000000000..b7ae78179e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml new file mode 100644 index 0000000000..384a28b8e9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/StaffTransferRecordDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/StaffTransferRecordDao.xml new file mode 100644 index 0000000000..b1c3d22ccd --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/StaffTransferRecordDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/CustomerProjectParameterDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/CustomerProjectParameterDao.xml new file mode 100644 index 0000000000..6bb3e0d8e8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/CustomerProjectParameterDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectCategoryDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectCategoryDao.xml new file mode 100644 index 0000000000..1021dc0b84 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectCategoryDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ 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 new file mode 100644 index 0000000000..f171a790e3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectDao.xml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectOrgRelationDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectOrgRelationDao.xml new file mode 100644 index 0000000000..e208dd33be --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectOrgRelationDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectProcessAttachmentDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectProcessAttachmentDao.xml new file mode 100644 index 0000000000..9d7d8ed6d5 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectProcessAttachmentDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectProcessDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectProcessDao.xml new file mode 100644 index 0000000000..f2e4583aea --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectProcessDao.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectProcessScanTaskDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectProcessScanTaskDao.xml new file mode 100644 index 0000000000..857b4aabad --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectProcessScanTaskDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectRelatedPersonnelDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectRelatedPersonnelDao.xml new file mode 100644 index 0000000000..4d2fee3b4c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectRelatedPersonnelDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectSatisfactionDetailDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectSatisfactionDetailDao.xml new file mode 100644 index 0000000000..b5688dbc45 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectSatisfactionDetailDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectSatisfactionStatisticsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectSatisfactionStatisticsDao.xml new file mode 100644 index 0000000000..ec260b465b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectSatisfactionStatisticsDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectStaffDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectStaffDao.xml new file mode 100644 index 0000000000..dedb9b1d3e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectStaffDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectTagsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectTagsDao.xml new file mode 100644 index 0000000000..fe03f5fc2e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govproject/ProjectTagsDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/EnterGroupSwitchDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/EnterGroupSwitchDao.xml new file mode 100644 index 0000000000..cdb6940650 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/EnterGroupSwitchDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/GroupEditSubmitRecordDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/GroupEditSubmitRecordDao.xml new file mode 100644 index 0000000000..b69a84b6a1 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/GroupEditSubmitRecordDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/GroupInvitationDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/GroupInvitationDao.xml new file mode 100644 index 0000000000..2d59e9e4d4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/GroupInvitationDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/GroupMemeberOperationDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/GroupMemeberOperationDao.xml new file mode 100644 index 0000000000..7f431ede4b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/GroupMemeberOperationDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/InvitationAccessRecordDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/InvitationAccessRecordDao.xml new file mode 100644 index 0000000000..c17cdfca9d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/InvitationAccessRecordDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupCodeDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupCodeDao.xml new file mode 100644 index 0000000000..693cf59838 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupCodeDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupDao.xml new file mode 100644 index 0000000000..d2c9e20e2d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupMemberDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupMemberDao.xml new file mode 100644 index 0000000000..c02549116c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupMemberDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupOperationDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupOperationDao.xml new file mode 100644 index 0000000000..8467a00213 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupOperationDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupStatisticalDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupStatisticalDao.xml new file mode 100644 index 0000000000..506e0395bf --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupStatisticalDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicAttachmentDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicAttachmentDao.xml new file mode 100644 index 0000000000..134b0798ef --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicAttachmentDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicCommentDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicCommentDao.xml new file mode 100644 index 0000000000..90545b6097 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicCommentDao.xml @@ -0,0 +1,6 @@ + + + + + + \ 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 new file mode 100644 index 0000000000..bd46639c94 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicDao.xml @@ -0,0 +1,25 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicOperationDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicOperationDao.xml new file mode 100644 index 0000000000..f9a44b7bd0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiTopicOperationDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicDraftAttachmentDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicDraftAttachmentDao.xml new file mode 100644 index 0000000000..8b998257bb --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicDraftAttachmentDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicDraftDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicDraftDao.xml new file mode 100644 index 0000000000..f71ead059d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicDraftDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicDraftOperationDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicDraftOperationDao.xml new file mode 100644 index 0000000000..0cb9c667fb --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicDraftOperationDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicDraftScanTaskDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicDraftScanTaskDao.xml new file mode 100644 index 0000000000..4467f57212 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicDraftScanTaskDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicShareLinkRecordDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicShareLinkRecordDao.xml new file mode 100644 index 0000000000..38d05993be --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicShareLinkRecordDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicShareLinkVisitRecordDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicShareLinkVisitRecordDao.xml new file mode 100644 index 0000000000..0999ed8834 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/TopicShareLinkVisitRecordDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/pom.xml b/epmet-module/data-aggregator/pom.xml new file mode 100644 index 0000000000..a958348839 --- /dev/null +++ b/epmet-module/data-aggregator/pom.xml @@ -0,0 +1,20 @@ + + + + epmet-module + com.epmet + 2.0.0 + + 4.0.0 + + data-aggregator + pom + + data-aggregator-client + data-aggregator-server + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/AgencyInfoDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/AgencyInfoDTO.java new file mode 100644 index 0000000000..04d4896995 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/AgencyInfoDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/27 17:52 + */ +@Data +public class AgencyInfoDTO implements Serializable { + private String agencyId; + private String areaCode; + private List subAgencyIds; + private List subGridIds; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java new file mode 100644 index 0000000000..b9cd6657b6 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java @@ -0,0 +1,142 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 项目(事件)分类按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +public class ScreenProjectCategoryGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * e世通中的项目类别编码 + */ + private String epmetCategoryCode; + + /** + * 该分类下所有项目总数 + */ + private Integer projectTotal; + + /** + * 该分类下,正在处理中的项目总数 + */ + private Integer pendingTotal; + + /** + * 该分类下已结案的项目总数 + */ + private Integer closedTotal; + + /** + * 该分类下已结案无需解决的项目总数 + */ + private Integer unResolvedTotal; + + /** + * 该分类下已结案已解决的项目总数 + */ + private Integer resolvedTotal; + + /** + * 该分类下项目结案率 + */ + private BigDecimal closedRatio; + + /** + * 该分类下已结案项目解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 该分类下已结案项目未解决率 + */ + private BigDecimal unResolvedRatio; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java new file mode 100644 index 0000000000..1507a1f88a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java @@ -0,0 +1,147 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 项目(事件)分类按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +public class ScreenProjectCategoryOrgDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String dateId; + + /** + * 组织id + */ + private String orgId; + + /** + * 社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province + */ + private String orgType; + + /** + * 当前orgId所属的上级id + */ + private String pid; + + /** + * orgId所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * e世通中的项目类别编码 + */ + private String epmetCategoryCode; + + /** + * 该分类下所有项目总数 + */ + private Integer projectTotal; + + /** + * 该分类下,正在处理中的项目总数 + */ + private Integer pendingTotal; + + /** + * 该分类下已结案的项目总数 + */ + private Integer closedTotal; + + /** + * 该分类下已结案无需解决的项目总数 + */ + private Integer unResolvedTotal; + + /** + * 该分类下已结案已解决的项目总数 + */ + private Integer resolvedTotal; + + /** + * 该分类下项目结案率 + */ + private BigDecimal closedRatio; + + /** + * 该分类下已结案项目解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 该分类下已结案项目未解决率 + */ + private BigDecimal unResolvedRatio; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/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 5ea0aa7cbf..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 @@ -21,4 +21,24 @@ public interface ScreenConstant { String MONTH_ID = "month"; String YEAR_ID = "year"; + + 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/AgencyAndNumFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyAndNumFormDTO.java index cd31c9688b..9410dda13a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyAndNumFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyAndNumFormDTO.java @@ -25,4 +25,9 @@ public class AgencyAndNumFormDTO implements Serializable { * */ @NotBlank(message = "机关Id不能为空" , groups = AgencyFormDTO.CommonAgencyIdGroup.class) private String agencyId; + + /** + * 目前只有平阴在传,默认赋值:370124 + */ + private String areaCode; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyNumTypeParamFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyNumTypeParamFormDTO.java index 9e2e3c74a9..6dc17c3e48 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyNumTypeParamFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyNumTypeParamFormDTO.java @@ -32,4 +32,9 @@ public class AgencyNumTypeParamFormDTO implements Serializable { @NotBlank(message = "类型不能为空", groups = AgencyNumTypeParamGroup.class) private String type; + /** + * 地区编码 + */ + private String areaCode; + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenTrendFormDTO.java index 88d0215be4..a0b26909b7 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenTrendFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnScreenTrendFormDTO.java @@ -22,4 +22,9 @@ public class AnScreenTrendFormDTO implements Serializable { */ @NotBlank(message = "机关Id不能为空", groups = AnScreenTrendFormDTO.AnScreenTrendGroup.class) private String agencyId; + + /** + * 月份ID + */ + private String monthId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java index c2deeac60b..b696426a2e 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java @@ -21,4 +21,9 @@ public class ContactMassLineChartFormDTO implements Serializable { */ @NotBlank(message = "机关ID不能为空",groups = {ContactMassLineChart.class}) private String agencyId; + + /** + * 目前只有平阴在传,默认赋值:370124 + */ + private String areaCode; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java index 5ed5b9fc1a..542c2e5b48 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.evaluationindex.screen.dto.form; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthBarchartFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/MonthBarchartFormDTO.java index b6e0141d6a..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 @@ -21,4 +21,14 @@ public class MonthBarchartFormDTO implements Serializable { */ @NotBlank(message = "机关ID不能为空",groups = {MonthBarchart.class}) private String agencyId; + + /** + * 月份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/ParymemberFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ParymemberFormDTO.java index fdf525f37b..15b3e36477 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ParymemberFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ParymemberFormDTO.java @@ -21,4 +21,9 @@ public class ParymemberFormDTO implements Serializable { */ @NotBlank(message = "机关ID不能为空",groups = {Parymember.class}) private String agencyId; + + /** + * 目前只有平阴在传,默认赋值:370124 + */ + private String areaCode; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java new file mode 100644 index 0000000000..be3585067d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/24 16:12 + */ +@Data +public class ScreenProjectDetailFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @NotBlank(message = "projectId不能为空") + private String projectId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java new file mode 100644 index 0000000000..aa4a89183e --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java @@ -0,0 +1,39 @@ +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 15:22 + */ +@Data +public class ScreenProjectDistributionFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 目前只有平阴在传,默认赋值:370124 + */ + private String areaCode; + + /** + * 如果为空返回全部;可选值:1:红色事件;2:黄色事件;3:绿色事件 + */ + private String level; + + /** + * 当前组织id + */ + @NotBlank(message = "agencyId不能为空") + private String agencyId; + + + /** + * 不必填;默认查询的是处理中;可选值:all: 全部,pending:处理中 已结案:closed_case ;已关闭:closed + * 默认查询pending + */ + private String status; +} 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..18fdae844f 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java @@ -30,4 +30,14 @@ public class SubAgencyIndexRankFormDTO implements Serializable { private Integer topNum; private String yearId; + + /** + * area_code升级,新增此参数,来源于当前token + */ + private String customerId; + + /** + * 行政区域编码 + */ + private String areaCode; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankPyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankPyFormDTO.java new file mode 100644 index 0000000000..f437e1a5b4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankPyFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/28 14:29 + */ +@Data +public class SubAgencyIndexRankPyFormDTO implements Serializable { + private static final long serialVersionUID = 8930332375421099186L; + /** + * 当前组织,平阴大屏,默认传跟组织 + * */ + @NotBlank(message = "agencyId不能为空") + private String agencyId; + + /** + * 目前只有平阴在传,默认赋值:370124 + * */ + @NotBlank(message = "areaCode不能为空;平阴默认传:370124") + private String areaCode; + + /** + * 默认查询前10条 + * */ + @NotNull(message = "topNum不能为空") + private Integer topNum; + + @NotBlank(message = "type不能为空,街道:street;网格:grid") + private String type; + + @NotBlank(message = "customerId不能为空") + private String customerId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/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/AdvanceBranchRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AdvanceBranchRankResultDTO.java index 60545c7fc4..216214d05c 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AdvanceBranchRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AdvanceBranchRankResultDTO.java @@ -50,4 +50,9 @@ public class AdvanceBranchRankResultDTO implements Serializable { * */ private Integer projectNum; + /** + * 当前name的上级组织名称 2021-01-11新增 + */ + private String parentAgencyName; + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java index 3a91fdfbf7..e8822ea470 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AgencyDistributionResultDTO.java @@ -38,6 +38,17 @@ public class AgencyDistributionResultDTO implements Serializable { */ private String type; + /** + * 若果是组织,对应返回screen_customer_agency的 level + * 机关级别 + * 社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province + */ + private String agencyLevel; + public AgencyDistributionResultDTO() { this.subAreaMarks = ""; this.subCenterMark = ""; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java index b959cf8ea7..9e941152e4 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/CompartmentResultDTO.java @@ -31,7 +31,10 @@ public class CompartmentResultDTO implements Serializable { */ private String areaMarks = ""; + @JsonIgnore + private String level; /** + * 当前组织的级别 * 机关级别 * 社区级:community, * 乡(镇、街道)级:street, @@ -39,8 +42,7 @@ public class CompartmentResultDTO implements Serializable { * 市级: city * 省级:province */ - @JsonIgnore - private String level; + private String agencyLevel; /** * 子级用户分布 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/FineExampleResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/FineExampleResultDTO.java index b522e3166c..d8b33c9d12 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/FineExampleResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/FineExampleResultDTO.java @@ -78,4 +78,13 @@ public class FineExampleResultDTO implements Serializable { * 党员发布议题数占比 */ private String publishIssueRatio = "0.00%"; + + /** + * 01.12新增:PLAT_ISSUE_TOTAL 平台参与议事总数 + */ + private Integer platIssueTotal; + /** + * PLAT_JOIN PARTY_RATIO 平台参与议事的党员占比 + */ + private String platJoinPartyRatio = "0.00%"; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityRankResultDTO.java index 0f6b481e1c..bf6ae28829 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityRankResultDTO.java @@ -39,4 +39,9 @@ public class GovernCapacityRankResultDTO implements Serializable { * 满意率 * */ private String satisfactionRatio; + + /** + * 当前agencyName的上一级组织名称 + */ + private String parentAgencyName; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java index f51fe26255..e749c0e218 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java @@ -39,4 +39,11 @@ public class GovernCapacityResultDTO implements Serializable { * 满意率 * */ private BigDecimal satisfactionRatio; + + /** + * 当前agencyName的上一级组织名称 + */ + private String parentAgencyName; + + private String orgId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java index 9aff92593f..a52b035475 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/OrgRankDataResultDTO.java @@ -51,4 +51,9 @@ public class OrgRankDataResultDTO implements Serializable { * */ private Integer projectNum; + /** + * 当前name的上级组织名称 2021-01-11新增 + */ + private String parentAgencyName; + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiRankResultDTO.java index 6d4eba5f4b..53209c640a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PublicPartiRankResultDTO.java @@ -25,4 +25,6 @@ public class PublicPartiRankResultDTO implements Serializable { private Integer issueNum; private Integer projectNum; + + private String parentAgencyName; } 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/evaluationindex/screen/dto/result/YearAverageIndexResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/YearAverageIndexResultDTO.java index 21c82e2e66..5047d2d7fd 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/YearAverageIndexResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/YearAverageIndexResultDTO.java @@ -32,4 +32,6 @@ public class YearAverageIndexResultDTO implements Serializable { * 治理能力 */ private Double governAbility = 0.0; + + private String yearId; } 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/VoluntaryServiceTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/VoluntaryServiceTrendFormDTO.java new file mode 100644 index 0000000000..63fdbc4571 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/VoluntaryServiceTrendFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.plugins.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 7、【工作日志】党员志愿者服务近12月趋势图 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/27 19:53 + */ +@Data +public class VoluntaryServiceTrendFormDTO { + /** + * 当前组织id + */ + @NotBlank(message = "agencyId不能为空") + private String agencyId; + + @NotBlank(message = "目前只有平阴在传,默认赋值:370124") + private String areaCode; + + @NotBlank(message = "customerId不能为空") + private String customerId; + + /** + * 截止到某月格式:yyyyMM;目前没有让大屏前端赋值,代码默认为为上个月 + */ + private String endMonthId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordRankFormDTO.java new file mode 100644 index 0000000000..a4e5e0b9f4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordRankFormDTO.java @@ -0,0 +1,41 @@ +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; + + @NotBlank(message = "areaCode不能为空,目前只有平阴在传,默认赋值:370124") + private String areaCode; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordTrendFormDTO.java new file mode 100644 index 0000000000..db2184bdc1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordTrendFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.plugins.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 6、【工作日志】近12月趋势图 + * + * @author sun + */ +@Data +public class WorkRecordTrendFormDTO implements Serializable { + private static final long serialVersionUID = -2934835714413031036L; + /** + * party:支部建设; union:联建共建;党员志愿服务:voluntaryservice + */ + @NotBlank(message = "dataType不能为空;可选值:party:支部建设; union:联建共建") + private String dataType; + + /** + * 当前组织id + */ + @NotBlank(message = "agencyId不能为空") + private String agencyId; + + /** + * 组织次数:organize;参与人数:joinuser;平均参与人数:avguser + */ + @NotBlank(message = "type不能为空") + private String type; + + @NotBlank(message = "customerId不能为空") + private String customerId; + + /** + * 查询数据起始月份Id + */ + private String startMonth; + + /** + * 查询数据结束月份Id + */ + private String endMonth; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendDTO.java new file mode 100644 index 0000000000..49e79a19de --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendDTO.java @@ -0,0 +1,30 @@ +package com.epmet.plugins.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 7、【工作日志】党员志愿者服务近12月趋势图 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/28 13:41 + */ +@Data +public class VoluntaryServiceTrendDTO implements Serializable { + private String monthId; + /** + * 组织次数 + */ + private Integer organizeTotal; + + /** + * 参与人数 + */ + private Integer participateUserTotal; + + /** + * 平均参与人数 + */ + private Integer avgParticipateUserTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendResultDTO.java new file mode 100644 index 0000000000..ad5a204aef --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.plugins.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 7、【工作日志】党员志愿者服务近12月趋势图 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/27 19:55 + */ +@Data +public class VoluntaryServiceTrendResultDTO implements Serializable { + private static final long serialVersionUID = -560895826884970305L; + private List xAxis=new ArrayList<>(); + //组织次数:organize;参与人数:joinuser;平均参与人数:avguser + private List organizeList=new ArrayList<>(); + private List joinUserList=new ArrayList<>(); + private List avgUserList=new ArrayList<>(); +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordRankResultDTO.java new file mode 100644 index 0000000000..4ca6521cce --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordRankResultDTO.java @@ -0,0 +1,39 @@ +package com.epmet.plugins.result; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +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; + + public WorkRecordRankResultDTO() { + this.participateTotal=0; + this.participateUserTotal=0; + this.subRankList=new ArrayList<>(); + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/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..6c0aec4959 --- /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 = 0; + } + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java index df2f60b2f2..f00079315d 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDetailResultDTO.java @@ -2,7 +2,6 @@ package com.epmet.project.dto.result; import com.epmet.evaluationindex.screen.dto.result.DepartmentNameListResultDTO; import lombok.Data; -import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.ArrayList; @@ -51,11 +50,17 @@ public class ProjectDetailResultDTO implements Serializable { */ private List departmentList; + /** + * 话题内容add at 21.03.01 + */ + private String topicContent; + public ProjectDetailResultDTO() { this.eventTitle = ""; this.eventContent = ""; this.eventSource = ""; this.imgUrlList = new ArrayList<>(); this.processList = new ArrayList<>(); + this.topicContent=""; } } diff --git a/epmet-module/data-report/data-report-server/Dockerfile b/epmet-module/data-report/data-report-server/Dockerfile index abb03ca056..98c31d5ed3 100644 --- a/epmet-module/data-report/data-report-server/Dockerfile +++ b/epmet-module/data-report/data-report-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./data-report.jar EXPOSE 8109 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml index 276d37e95b..fa6f9d7f73 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-report-server:0.3.45 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-report-server:0.3.59 ports: - "8108:8108" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 5ce4fb7db8..8cb39e2c6b 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - 0.3.45 + 0.3.59 data-report-server @@ -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 @@ -83,6 +88,12 @@ epmet-commons-dynamic-datasource 2.0.0 + + com.epmet + resi-group-client + 2.0.0 + compile + @@ -316,4 +327,4 @@ - \ No newline at end of file + 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..4e409e6316 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/WorkRecordController.java @@ -0,0 +1,79 @@ +package com.epmet.datareport.controller.plugins; + +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgDailyService; +import com.epmet.plugins.form.VoluntaryServiceTrendFormDTO; +import com.epmet.plugins.form.WorkRecordRankFormDTO; +import com.epmet.plugins.form.WorkRecordTrendFormDTO; +import com.epmet.plugins.result.VoluntaryServiceTrendResultDTO; +import com.epmet.plugins.result.WorkRecordRankResultDTO; +import com.epmet.plugins.result.WorkRecordTrendResultDTO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * 大屏工作日志相关输出接口 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/21 19:51 + */ +@Slf4j +@RestController +@RequestMapping("screen/plugins/workrecord") +public class WorkRecordController { + @Autowired + private ScreenWorkRecordOrgDailyService screenWorkRecordOrgDailyService; + //5、【工作日志】本机及下级排名 + //NEI接口地址:https://nei.netease.com/interface/detail/?pid=57068&id=348966 + //返参中的当前组织的参与人数、组织次数 直接sum所有下级的值; + //下级根据当前组织的areaCode查询下级列表,再去查询screen_work_record_org_daily + + @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); + if(!"party".equals(formDTO.getDataType())&&!"union".equals(formDTO.getDataType())){ + throw new RenException("入参dataType值错误,可选值:party--支部建设; union--联建共建"); + } + if(!"organize".equals(formDTO.getType())&&!"joinuser".equals(formDTO.getType())&&!"avguser".equals(formDTO.getType())){ + throw new RenException("入参type值错误,可选值:组织次数--organize;参与人数--joinuser;平均参与人数--avguser"); + } + return new Result().ok(screenWorkRecordOrgDailyService.trend(formDTO)); + } + + /** + * @param customerId + * @param formDTO + * @author yinzuomei + * @description 7、【工作日志】党员志愿者服务近12月趋势图 + * @Date 2021/2/27 19:56 + **/ + @PostMapping("voluntaryservicetrend") + public Result voluntaryServiceTrend(@RequestHeader("CustomerId")String customerId, @RequestBody VoluntaryServiceTrendFormDTO formDTO){ + formDTO.setCustomerId(customerId); + if (StringUtils.isBlank(formDTO.getEndMonthId())) { + formDTO.setEndMonthId(com.epmet.commons.tools.utils.DateUtils.getCurrentTimeBeforeMonthId()); + } + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(screenWorkRecordOrgDailyService.voluntaryServiceTrend(formDTO)); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java index 94186e7336..ed31aef27a 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,6 +5,10 @@ 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.ScreenProjectGridDailyService; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectOrgDailyService; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantityGridMonthlyService; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService; import com.epmet.datareport.service.project.ProjectService; import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.project.constant.ProjectConstant; @@ -29,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 @@ -118,7 +129,4 @@ public class ProjectController { public Result> myNextAgency(@LoginUser TokenDto tokenDto){ return new Result>().ok(projectService.getMyNextAgency(tokenDto)); } - - - } 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 86a6f3213e..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,14 +3,22 @@ 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.*; +import java.util.List; + /** * 组织相关api * @@ -23,7 +31,6 @@ public class AgencyController { @Autowired private AgencyService agencyService; - /** * @param * @Description 1、组织机构树 只返回 is_display = '1'的 @@ -66,4 +73,41 @@ public class AgencyController { return new Result().ok(agencyService.compartmentByBizType(compartmentFormDTO)); } + /** + * @Description 行政地区编码查询 + * @Param formDTO + * @author zxc + * @date 2021/1/7 下午1:41 + */ + @PostMapping("areacodedict") + public Result> areaCodeDictTree(@RequestBody AreaCodeDictFormDTO formDTO){ + 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/GrassRootsGovernController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java index 4cec62dc66..f3c2a545c5 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java @@ -8,10 +8,7 @@ import com.epmet.evaluationindex.screen.dto.form.AgencyFormDTO; import com.epmet.evaluationindex.screen.dto.form.AgencyNumTypeParamFormDTO; import com.epmet.evaluationindex.screen.dto.result.*; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java index f7273b3da8..6d2a49cbe7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java @@ -10,11 +10,9 @@ import com.epmet.evaluationindex.screen.dto.result.BranchBuildRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.BranchBuildTrendResultDTO; import com.epmet.evaluationindex.screen.dto.result.PartymemberAgeDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.PartymemberPercentResultDTO; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * 基层党建相关各指标查询 @@ -22,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:11 */ +@Slf4j @RestController @RequestMapping("/screen/grassrootspartydev") public class GrassrootsPartyDevController { @@ -52,9 +51,10 @@ public class GrassrootsPartyDevController { * @date 2020.08.18 17:54 **/ @PostMapping("ageinfo") - public Result ageInfo(@RequestBody ParymemberFormDTO param){ + public Result ageInfo(@RequestBody ParymemberFormDTO param,@RequestHeader("CustomerId") String customerId){ + log.info("CustomerId"+customerId); ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class); - return new Result().ok(grassrootsPartyDevService.partymemberAgeDistribution(param)); + return new Result().ok(grassrootsPartyDevService.partymemberAgeDistribution(param,customerId)); } /** diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java index 00fc8046a5..cb851647af 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -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") @@ -138,5 +150,16 @@ public class IndexController { return new Result>().ok(indexService.advancedBranchRank(formDTO)); } - + /** + * @param formDTO + * @author yinzuomei + * @description 8、平阴大屏-下级街道or网格指数排行 + * @Date 2021/2/28 14:33 + **/ + @PostMapping("subagencyindexrank-py") + Result> subAgencyIndexRankPy(@RequestHeader("CustomerId") String customerId,@RequestBody SubAgencyIndexRankPyFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(indexService.subAgencyIndexRankPy(formDTO)); + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java index ca1104f534..bbd0039e71 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java @@ -6,10 +6,7 @@ import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadServic import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java index 483e3edcc1..84e109d3fc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java @@ -2,14 +2,26 @@ package com.epmet.datareport.controller.screen; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectOrgDailyService; +import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; +import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; +import com.epmet.dto.form.screen.EfficiencyAnalysisFormDTO; +import com.epmet.dto.form.screen.QueryQuantityMonthlyFormDTO; +import com.epmet.dto.form.screen.ScreenCommonFormDTO; +import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; +import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO; +import com.epmet.dto.result.screen.ProjectQuantityResultDTO; +import com.epmet.dto.result.screen.QueryQuantityMonthlyResultDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.List; /** * 项目 @@ -17,13 +29,17 @@ import org.springframework.web.bind.annotation.RestController; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:16 */ +@Slf4j @RestController @RequestMapping("/screen/project") public class ScreenProjectController { @Autowired private ScreenProjectService screenProjectService; - + @Autowired + private ScreenProjectOrgDailyService projectOrgDailyService; + @Autowired + private ScreenProjectQuantityOrgMonthlyService projectQuantityOrgMonthlyService; /** * @Description 3、项目详情 * @param projectDetailFormDTO @@ -36,4 +52,81 @@ 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){ + ValidatorUtils.validateEntity(formDTO); + return screenProjectService.projectDistribution(formDTO); + } + + /** + * @Description 中央区事件分析-项目详情接口 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2021/2/24 16:10 + */ + @PostMapping("projectdetailv2") + public Result projectDetail(@RequestBody ScreenProjectDetailFormDTO formDTO){ + return screenProjectService.projectDistributionDetail(formDTO); + } + + /** + * @param customerId + * @param formDTO + * @description 1、【事件分析】数量统计查询 平阴大屏 + **/ + @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 2、近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 3、【事件分析】效率分析 平阴大屏 + **/ + @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)); + } + + /** + * 【事件分析】类型分析 + * @author zhaoqifeng + * @date 2021/2/23 15:37 + * @param customerId + * @param formDTO 【事件类型分析】NEI接口地址: https://nei.netease.com/interface/detail/?pid=57068&id=346721 + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("category-analysis") + public Result> categoryAnalysis(@RequestHeader("CustomerId") String customerId, + @RequestBody CategoryAnalysisFormDTO formDTO) { + log.info("===================customerId"+customerId); + ValidatorUtils.validateEntity(formDTO, CategoryAnalysisFormDTO.CategoryAnalysis.class); + return new Result>().ok(screenProjectService.categoryAnalysis(customerId, formDTO)); + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/UserAnalysisController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/UserAnalysisController.java index dda6b177cf..a78d744487 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/UserAnalysisController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/UserAnalysisController.java @@ -1,5 +1,7 @@ package com.epmet.datareport.controller.user; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.user.UserIncrTrendFormDTO; @@ -50,9 +52,9 @@ public class UserAnalysisController { * @Date 2020/6/22 13:30 **/ @PostMapping("subagency") - public Result> subAgency(@RequestBody UserSubAgencyFormDTO formDTO) { + public Result> subAgency(@LoginUser TokenDto tokenDto, @RequestBody UserSubAgencyFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO,UserSubAgencyFormDTO.AddUserInternalGroup.class); - List userSubAgencyResultDTO = userService.subAgency(formDTO); + List userSubAgencyResultDTO = userService.subAgency(tokenDto, formDTO); return new Result>().ok(userSubAgencyResultDTO); } @@ -64,9 +66,9 @@ public class UserAnalysisController { * @Date 2020/6/22 13:33 **/ @PostMapping("subgrid") - public Result> subGrid(@RequestBody UserSubGridFormDTO formDTO) { + public Result> subGrid(@LoginUser TokenDto tokenDto, @RequestBody UserSubGridFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, UserSubGridFormDTO.AddUserInternalGroup.class); - List userSubGridResultDTO = userService.subGrid(formDTO); + List userSubGridResultDTO = userService.subGrid(tokenDto, formDTO); return new Result>().ok(userSubGridResultDTO); } @@ -78,9 +80,9 @@ public class UserAnalysisController { * @Date 2020/6/22 13:36 **/ @PostMapping("incrtrend") - public Result> incrTrend(@RequestBody UserIncrTrendFormDTO formDTO) { + public Result> incrTrend(@LoginUser TokenDto tokenDto, @RequestBody UserIncrTrendFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, UserIncrTrendFormDTO.AddUserInternalGroup.class); - List userIncrTrendResultDTO = userService.incrTrendV2(formDTO); + List userIncrTrendResultDTO = userService.incrTrendV2(tokenDto, formDTO); return new Result>().ok(userIncrTrendResultDTO); } 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..498f57309c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -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,41 @@ 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); + + List getNextAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId); + + List selectSubAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java index a024d60791..e0484794e6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java @@ -80,5 +80,6 @@ public interface ScreenCustomerGridDao { * @date 2020/8/26 5:29 下午 */ List selectGridInfo(@Param("agencyId")String agencyId); - + + List selectSubGridIds(@Param("areaCode")String areaCode, @Param("agencyId")String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java index 5a0a566342..801f8d5026 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java @@ -42,6 +42,14 @@ public interface ScreenDifficultyDataDao { **/ List selectDifficulty(@Param("agencyId")String agencyId,@Param("type")String type); + /** + * @Description 查询难点赌点-耗时最长|涉及部门最多|处理次数【new】 + * @Param type + * @author zxc + * @date 2021/2/25 下午6:41 + */ + List selectDifficultyByAreaCode(@Param("areaCode")String areaCode,@Param("type")String type); + ProjectDetailResultDTO projectDetail(@Param("eventId")String projectId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java index e973aa85f3..405144008a 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java @@ -41,4 +41,13 @@ public interface ScreenGovernRankDataDao{ * @date 2020.08.20 17:34 **/ List selectGovernCapacityRatio(@Param("monthId") String monthId,@Param("agencyId") String agencyId); + + /** + * @Description 查询政府治理能力各项指标【new】 + * @Param monthId + * @Param orgIds + * @author zxc + * @date 2021/2/26 上午9:22 + */ + List selectGovernCapacityRatioNew(@Param("monthId") String monthId,@Param("orgIds") List orgIds); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index 93221bd6f0..f502b0f471 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -47,7 +47,7 @@ public interface ScreenIndexDataMonthlyDao{ * @author zxc * @date 2020/8/20 9:02 上午 */ - List selectMonthBarchart(@Param("agencyId")String agencyId); + List selectMonthBarchart(@Param("agencyId")String agencyId,@Param("monthId") String monthId); /** * @param subAgencyIndexRankFormDTO @@ -56,6 +56,7 @@ public interface ScreenIndexDataMonthlyDao{ * @date 2020/8/20 10:04 上午 */ List selectSubAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO); + List selectSubAgencyIndexRankNew(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO); /** * 5、下级部门指数排行(安宁数据段用) - 月(上一个月) @@ -102,4 +103,26 @@ public interface ScreenIndexDataMonthlyDao{ * @author sun */ List getSingleIndexRank(SubSingleIndexRankFormDTO formDTO); + + /** + * @param yearId + * @param areaCode + * @Description 根据areaCode查询下级指数 + * @author yinzuomei + */ + List selectSubStreetByAreaCode(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("areaCode") String areaCode, + @Param("topNum") int topNum); + + /** + * @param yearId + * @param areaCode + * @Description 根据areaCode查询网格指数 + * @author yinzuomei + */ + List selectSubGridByAreaCode(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("areaCode") String areaCode, + @Param("topNum") int topNum); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataDao.java index 2b9bdba497..1e9a5efe09 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataDao.java @@ -42,4 +42,6 @@ public interface ScreenOrgRankDataDao{ **/ List selectGridDataMonthly(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + List selectGridDataMonthlyAreaCode(@Param("monthId") String monthId, + @Param("areaCode")String areaCode); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java index 1ca974982f..30094b7225 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java @@ -39,5 +39,6 @@ public interface ScreenPartyLinkMassesDataDao { * @date 2020/8/20 2:48 下午 */ List selectContactMassLineChart(@Param("agencyId")String agencyId); - + + List selectContactMassLineChartByAgencyIds(@Param("agencyIdList")List agencyIdList); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java index 0f442931b5..fe5adc1a77 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java @@ -71,4 +71,8 @@ public interface ScreenPartyUserRankDataDao{ * @author sun */ List selectPartymemberPointList(PartIndexScroeRankFormDTO formDTO); + + List selectPartymemberPointOrderByAreaCode(@Param("areaCode") String areaCode); + + List selectUserPointOrderByAreaCode(@Param("areaCode") String areaCode); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java index 92177ec52c..5bc3077e85 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java @@ -21,6 +21,8 @@ import com.epmet.evaluationindex.screen.dto.result.FineExampleResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 党建引领-先锋模范数据 * @@ -37,5 +39,16 @@ public interface ScreenPioneerDataDao{ * @date 2020/8/20 5:22 下午 */ FineExampleResultDTO selectFineExample(@Param("agencyId")String agencyId); + + /** + * @Description 根据地区码查询先锋模范 + * @param areaCode + * @param customerId + * @param customerIds - 子级客户列表 + * @return com.epmet.evaluationindex.screen.dto.result.FineExampleResultDTO + * @author wangc + * @date 2021.02.24 15:39 + */ + FineExampleResultDTO selectFineExampleByAreaCode(@Param("areaCode")String areaCode,@Param("customerId")String customerId,@Param("list") List customerIds); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java new file mode 100644 index 0000000000..c3b90ff1c7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.screen; + +import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 项目(事件)分类按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Mapper +public interface ScreenProjectCategoryOrgDailyDao { + /** + * 类型分析 + * @author zhaoqifeng + * @date 2021/2/23 16:47 + * @param agencyId + * @return java.util.List + */ + List selectCategoryAnalysis(@Param("agencyId") String agencyId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java new file mode 100644 index 0000000000..eeb9831e21 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java @@ -0,0 +1,27 @@ +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, + @Param("status")String status); + + 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..33512f7557 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectGridDailyDao.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.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, + @Param("dateId")String dateId); + + String selectLastDateId(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/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/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java index 88c2aa0e77..6feb784626 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java @@ -39,4 +39,14 @@ public interface ScreenPublicPartiTotalDataDao{ * @date 2020.08.20 16:00 **/ List selectPublicPartiTotal(@Param("agencyId") String agencyId); + + + /** + * @Description 根据areaCode查询公众参与各类总数 + * @param areaCode + * @return + * @author wangc + * @date 2020.08.20 16:00 + **/ + List selectPublicPartiTotalByAreaCode(@Param("areaCode") String areaCode); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserJoinDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserJoinDao.java index 962691f625..39a16db7bf 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserJoinDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserJoinDao.java @@ -42,6 +42,16 @@ public interface ScreenUserJoinDao { **/ UserJoinIndicatorGrowthRateResultDTO selectUserJoinData(@Param("agencyId") String agencyId, @Param("monthId")String monthId); + /** + * @Description 根据地区码查询用户参与数据 + * @param areaCode + * @return + * @author wangc + * @date 2020.08.20 15:07 + **/ + UserJoinIndicatorGrowthRateResultDTO selectUserJoinDataByAreaCode(@Param("areaCode") String areaCode, @Param("monthId")String monthId); + + /** * @Description 查询月度用户参与数据 * @param agencyId diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java index 653cf3f606..8de5eaadfc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java @@ -22,6 +22,8 @@ import com.epmet.evaluationindex.screen.dto.result.TopProfileResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 中央区-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 * @@ -56,5 +58,6 @@ public interface ScreenUserTotalDataDao { * @date 2020.08.20 14:54 **/ int selectAvgIssue(@Param("agencyId")String agencyId); - + + PartymemberPercentResultDTO selectAgencyPartymemberPercentByIds(@Param("orgIds") List orgIds); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java index 40609442aa..7b03527fcd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsGovernMonthlyDao.java @@ -48,12 +48,12 @@ public interface ScreenAnGrassRootsGovernMonthlyDao { * 基层治理-指标月度趋势 * * @param agencyId - * @param yearId + * @param curDate * @return java.util.List * @author zhaoqifeng * @date 2020/10/9 16:49 */ - List selectGrassRootsGovernTrend(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + List selectGrassRootsGovernTrend(@Param("agencyId") String agencyId, @Param("curDate") String curDate); /** * 基层治理-治理排行 @@ -66,4 +66,4 @@ public interface ScreenAnGrassRootsGovernMonthlyDao { */ List selectGrassRootsGovernRank(@Param("agencyId") String agencyId, @Param("monthId") String monthId); -} \ No newline at end of file +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java index 9fb38ae91e..c962c58c9e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsOrgMonthlyDao.java @@ -49,12 +49,12 @@ public interface ScreenAnGrassRootsOrgMonthlyDao { * 基层组织-指标月度趋势 * * @param agencyId - * @param yearId + * @param curDate * @return java.util.List * @author zhaoqifeng * @date 2020/10/9 16:32 */ - List selectGrassRootsOrgTrend(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + List selectGrassRootsOrgTrend(@Param("agencyId") String agencyId, @Param("curDate") String curDate); /** * 基层组织-组织排行榜单 @@ -67,4 +67,4 @@ public interface ScreenAnGrassRootsOrgMonthlyDao { */ List selectGrassRootsOrgRank(@Param("agencyId") String agencyId, @Param("monthId") String monthId); -} \ No newline at end of file +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.java index 3e0c05e93f..6ad769f2a9 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.java @@ -17,7 +17,6 @@ package com.epmet.datareport.dao.evaluationindex.screenan; -import com.epmet.evaluationindex.screen.dto.form.AnScreenFormDTO; import com.epmet.evaluationindex.screen.dto.result.PmTotalResultDTO; import com.epmet.evaluationindex.screen.dto.result.PmTotalTrendDTO; import org.apache.ibatis.annotations.Mapper; @@ -48,12 +47,12 @@ public interface ScreenAnGrassRootsPmTotalMonthlyDao { * 基层党员-指标月度趋势 * * @param agencyId - * @param yearId + * @param curDate * @return java.util.List * @author zhaoqifeng * @date 2020/10/9 15:12 */ - List selectPmTotalTrend(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + List selectPmTotalTrend(@Param("agencyId") String agencyId, @Param("curDate") String curDate); -} \ 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..d27a4eee75 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java @@ -0,0 +1,70 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.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 { + /** + * @return com.epmet.plugins.result.WorkRecordRankResultDTO + * @author yinzuomei + * @description 5、【工作日志】本机及下级排名- 下级组织 + * @Date 2021/2/23 23:37 + **/ + List selectSubList(@Param("subAgencyIds") List subAgencyIds, + @Param("dataType")String dataType, + @Param("customerId")String customerId, + @Param("dateId")String dateId); + + /** + * @param subGridIds 当前组织的指数网格ids + * @author yinzuomei + * @description + * @Date 2021/2/27 19:31 + **/ + List selectSubGridList(@Param("subGridIds")List subGridIds, + @Param("dataType")String dataType, + @Param("customerId")String customerId, + @Param("dateId")String dateId); + + /** + * @param customerIds 当前客户+所有子客户 列表 + * @author yinzuomei + * @description 查询最近一次上传的日期 + * @Date 2021/2/27 19:31 + **/ + String selectLatestDateId(@Param("customerIds")List customerIds); + + List selectCurrentAgency(@Param("agencyId") String agencyId, + @Param("dataType")String dataType, + @Param("customerId")String customerId, + @Param("dateId")String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java new file mode 100644 index 0000000000..10e5fd88c3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgMonthlyDao.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.datareport.dao.plugins; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgMonthlyEntity; +import com.epmet.plugins.form.WorkRecordTrendFormDTO; +import com.epmet.plugins.result.VoluntaryServiceTrendDTO; +import com.epmet.plugins.result.WorkRecordTrendResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 工作日志-组织按月统计(增量) + * + * @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); + + List selectVoluntaryServiceTrendDTO(@Param("customerId")String customerId, + @Param("orgIds") List orgIds, + @Param("startMonth")String startMonth, + @Param("endMonth")String endMonth); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/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 046eaccbef..4f11f160ab 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java @@ -1,11 +1,20 @@ package com.epmet.datareport.service.evaluationindex.screen; +import com.epmet.dto.AgencyInfoDTO; +import com.epmet.dto.form.AddAreaCodeDictFormDTO; +import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.result.AreaCodeDictResultDTO; +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; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; +import java.util.List; + /** * 组织相关api * @@ -35,4 +44,33 @@ public interface AgencyService { CompartmentResultDTO compartmentByBizType(CompartmentByBizTypeFormDTO compartmentFormDTO); + /** + * @Description 行政地区编码查询 + * @Param formDTO + * @author zxc + * @date 2021/1/7 下午1:41 + */ + 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); + + /** + * @return java.util.List + * @param agencyId + * @author yinzuomei + * @description 获取当前组织的下级组织集合 + * @Date 2021/2/25 16:52 + **/ + List getNextAgencyIds(String areaCode,String agencyId); + + AgencyInfoDTO getAgencyInfoDTO(String areaCode, String agencyId); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java index 41c8fafc28..09e94717b6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java @@ -34,7 +34,7 @@ public interface GrassrootsPartyDevService { * @author wangc * @date 2020.08.18 17:54 **/ - PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param); + PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param,String customerId); /** * @Description 3、支部建设情况|联建共建情况-折线图 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java index 0dc99d37bc..bfbf7a9d41 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java @@ -86,4 +86,12 @@ public interface IndexService { * @date 2020/10/22 10:58 上午 */ List getSubSingleIndexRank(SubSingleIndexRankFormDTO formDTO); + + /** + * @param formDTO + * @author yinzuomei + * @description 8、平阴大屏-下级街道or网格指数排行 + * @Date 2021/2/28 14:33 + **/ + List subAgencyIndexRankPy(SubAgencyIndexRankPyFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/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 3232cf7793..bf3f8dbdcc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -1,12 +1,22 @@ 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.AgencyInfoDTO; +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; @@ -14,9 +24,13 @@ import com.epmet.evaluationindex.screen.dto.form.TreeByTypeFormDTO; 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; +import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.List; @@ -27,6 +41,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 { @@ -35,6 +50,8 @@ public class AgencyServiceImpl implements AgencyService { private ScreenCustomerAgencyDao screenCustomerAgencyDao; @Autowired private ScreenCustomerGridDao screenCustomerGridDao; + @Autowired + private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; /** * @Description 1、组织机构树 @@ -195,7 +212,7 @@ public class AgencyServiceImpl implements AgencyService { if (null == agencyAreaInfo){ return new CompartmentResultDTO(); } - if (agencyAreaInfo.getLevel().equals(ScreenConstant.COMMUNITY)){ + if (agencyAreaInfo.getAgencyLevel().equals(ScreenConstant.COMMUNITY)){ // 当level为"community"时,查询screen_customer_grid表 List agencyDistributionResultDTOS = screenCustomerGridDao.selectSubDistribution(compartmentFormDTO.getAgencyId()); agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS); @@ -213,7 +230,7 @@ public class AgencyServiceImpl implements AgencyService { if (null == agencyAreaInfo){ return new CompartmentResultDTO(); } - if (agencyAreaInfo.getLevel().equals(ScreenConstant.COMMUNITY)){ + if (agencyAreaInfo.getAgencyLevel().equals(ScreenConstant.COMMUNITY)){ // 当level为"community"时,查询screen_customer_grid表 List agencyDistributionResultDTOS = screenCustomerGridDao.selectSubDistribution(compartmentFormDTO.getAgencyId()); agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS); @@ -223,4 +240,86 @@ public class AgencyServiceImpl implements AgencyService { } return agencyAreaInfo; } + + /** + * @Description 行政地区编码查询 + * @Param formDTO + * @author zxc + * @date 2021/1/7 下午1:41 + */ + @Override + public List areaCodeDictTree(AreaCodeDictFormDTO formDTO) { + Result> listResult = commonServiceOpenFeignClient.areaCodeDictTree(formDTO); + if (!listResult.success()){ + 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); + } + + /** + * @param agencyId + * @return java.util.List + * @author yinzuomei + * @description 获取当前组织的下级组织集合 + * @Date 2021/2/25 16:52 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public List getNextAgencyIds(String areaCode,String agencyId) { + return screenCustomerAgencyDao.getNextAgencyIds(areaCode,agencyId); + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public AgencyInfoDTO getAgencyInfoDTO(String areaCode, String agencyId) { + AgencyInfoDTO agencyInfoDTO=new AgencyInfoDTO(); + agencyInfoDTO.setAgencyId(agencyId); + agencyInfoDTO.setAreaCode(areaCode); + agencyInfoDTO.setSubAgencyIds(screenCustomerAgencyDao.selectSubAgencyIds(areaCode,agencyId)); + agencyInfoDTO.setSubGridIds(screenCustomerGridDao.selectSubGridIds(areaCode,agencyId)); + return agencyInfoDTO; + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java index 158ca87d8e..a13fe2fe34 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AnScreenServiceImpl.java @@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.stream.Collectors; @@ -38,6 +39,8 @@ public class AnScreenServiceImpl implements AnScreenService { private ScreenAnGrassRootsGovernMonthlyDao screenAnGrassRootsGovernMonthlyDao; @Autowired private ScreenAnCommunityProjectProfileDao screenAnCommunityProjectProfileDao; + @Autowired + private PartyMemberLeadServiceImpl partyMemberLeadServiceImpl; /** * 基层党员-各类总数 @@ -65,8 +68,10 @@ public class AnScreenServiceImpl implements AnScreenService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) public PmTotalTrendResultDTO pmTotalTrend(AnScreenTrendFormDTO formDTO) { PmTotalTrendResultDTO resultDTO = new PmTotalTrendResultDTO(); - String yearId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY); - List list = screenAnGrassRootsPmTotalMonthlyDao.selectPmTotalTrend(formDTO.getAgencyId(), yearId); + String monthId = StringUtils.isNotBlank(formDTO.getMonthId()) ? formDTO.getMonthId() : DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMM); + String curDate = monthId.substring(0, 4) + "-" + monthId.substring(4, 6) + "-" + "01"; + // 查询近一年的指数值【包括本月】 + List list = screenAnGrassRootsPmTotalMonthlyDao.selectPmTotalTrend(formDTO.getAgencyId(), curDate); List xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList()); List groupMemberTotalList = list.stream().map(PmTotalTrendDTO::getGroupMemberTotal).collect(Collectors.toList()); List topicTotalList = list.stream().map(PmTotalTrendDTO::getTopicTotal).collect(Collectors.toList()); @@ -124,9 +129,12 @@ public class AnScreenServiceImpl implements AnScreenService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) public GrassRootsOrgTrendResultDTO grassRootsOrgTrend(AnScreenTrendFormDTO formDTO) { GrassRootsOrgTrendResultDTO resultDTO = new GrassRootsOrgTrendResultDTO(); - String yearId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY); - List list = screenAnGrassRootsOrgMonthlyDao.selectGrassRootsOrgTrend(formDTO.getAgencyId(), yearId); - List xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList()); + + String monthId = StringUtils.isNotBlank(formDTO.getMonthId()) ? formDTO.getMonthId() : DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMM); + String curDate = monthId.substring(0, 4) + "-" + monthId.substring(4, 6) + "-" + "01"; + // 查询近一年的指数值【包括本月】 + List list = screenAnGrassRootsOrgMonthlyDao.selectGrassRootsOrgTrend(formDTO.getAgencyId(), curDate); + List xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList()); List groupTotalList = list.stream().map(GrassRootsOrgTrendDTO::getGroupTotal).collect(Collectors.toList()); List issueTotalList = list.stream().map(GrassRootsOrgTrendDTO::getIssueTotal).collect(Collectors.toList()); List projectTotal = list.stream().map(GrassRootsOrgTrendDTO::getProjectTotal).collect(Collectors.toList()); @@ -177,8 +185,11 @@ public class AnScreenServiceImpl implements AnScreenService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) public GrassRootsGovernTrendResultDTO grassRootsGovernTrend(AnScreenTrendFormDTO formDTO) { GrassRootsGovernTrendResultDTO resultDTO = new GrassRootsGovernTrendResultDTO(); - String yearId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYY); - List list = screenAnGrassRootsGovernMonthlyDao.selectGrassRootsGovernTrend(formDTO.getAgencyId(), yearId); + + String monthId = StringUtils.isNotBlank(formDTO.getMonthId()) ? formDTO.getMonthId() : DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMM); + String curDate = monthId.substring(0, 4) + "-" + monthId.substring(4, 6) + "-" + "01"; + // 查询近一年的指数值【包括本月】 + List list = screenAnGrassRootsGovernMonthlyDao.selectGrassRootsGovernTrend(formDTO.getAgencyId(), curDate); List xAxis = list.stream().map(item -> getMonth(item.getMonthId())).collect(Collectors.toList()); List partiProjectTotalList = list.stream().map(GrassRootsGovernTrendDTO::getPartiProjectTotal).collect(Collectors.toList()); List closedProjectTotalList = list.stream().map(GrassRootsGovernTrendDTO::getClosedProjectTotal).collect(Collectors.toList()); 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 7afd0f4362..e427ad9e3b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java @@ -2,17 +2,25 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.*; +import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.datareport.service.evaluationindex.screen.GrassRootsGovernService; import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.ModuleConstant; +import com.epmet.dto.result.ScreenCustomerAgencyDTO; import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; import com.epmet.evaluationindex.screen.dto.form.AgencyFormDTO; import com.epmet.evaluationindex.screen.dto.form.AgencyNumTypeParamFormDTO; import com.epmet.evaluationindex.screen.dto.result.*; +import com.epmet.feign.OperCrmOpenFeignClient; import com.github.pagehelper.PageHelper; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -30,6 +38,7 @@ import java.util.stream.Collectors; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:20 */ +@Slf4j @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @@ -46,6 +55,13 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { private ScreenGovernRankDataDao screenGovernRankDataDao; @Autowired private ScreenPublicPartiTotalDataDao screenPublicPartiTotalDataDao; + @Autowired + private OperCrmOpenFeignClient crmClient; + @Autowired + private ScreenCustomerAgencyDao agencyDao; + @Autowired + private AgencyService screenCustomerAgencyService; + /** * @Description 1、热心市民积分排行 @@ -63,7 +79,13 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { param.setTopNum(NumConstant.FIVE); } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - List userPointList = screenPartyUserRankDataDao.selectUserPointOrder(param.getAgencyId()); + List userPointList = new ArrayList<>(); + if(StringUtils.isNotBlank(param.getAreaCode())){ + log.info("热心市民积分排行按照areaCode查询"+param.getAreaCode()); + userPointList=screenPartyUserRankDataDao.selectUserPointOrderByAreaCode(param.getAreaCode()); + }else{ + userPointList=screenPartyUserRankDataDao.selectUserPointOrder(param.getAgencyId()); + } UserPointRankResultDTO result = new UserPointRankResultDTO(); result.setNameData(userPointList.stream().map(UserPointResultDTO::getName).collect(Collectors.toList())); result.setPointsData(userPointList.stream().map(UserPointResultDTO::getPoint).collect(Collectors.toList())); @@ -82,11 +104,21 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List difficultProject(AgencyNumTypeParamFormDTO param) { + List result = new ArrayList<>(); if(null == param.getTopNum()){ param.setTopNum(NumConstant.TWO); } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - List result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType()); + if (StringUtils.isNotEmpty(param.getAreaCode())){ + result = screenDifficultyDataDao.selectDifficultyByAreaCode(param.getAreaCode(),param.getType()); + }else { + result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType()); + } + for(DifficultProjectResultDTO resultDTO:result){ + if (StringUtils.isNotBlank(resultDTO.getImgUrl()) && !resultDTO.getImgUrl().contains("http")) { + resultDTO.setImgUrl(StrConstant.EPMETY_STR); + } + } if(null == result) return new ArrayList<>(); return result; } @@ -103,15 +135,24 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public PublicPartiProfileResultDTO publicPartiProfile(AgencyFormDTO param) { + ScreenCustomerAgencyDTO agencyInfo = agencyInfo(param.getAgencyId()); + Result> crmResp = crmClient.getAllSubCustomerIds(agencyInfo.getCustomerId()); + List subCustomers; + if(null == crmResp || !crmResp.success()|| org.apache.commons.collections4.CollectionUtils.isEmpty(crmResp.getData())) {subCustomers = null ;} + else {subCustomers = crmResp.getData();} String monthId = dateUtils.getCurrentMonthId(); - UserJoinIndicatorGrowthRateResultDTO latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); + UserJoinIndicatorGrowthRateResultDTO latest = CollectionUtils.isEmpty(subCustomers) ||StringUtils.isBlank(agencyInfo.getAreaCode())? + screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId) : + screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId); //保证获取公众参与概率数据的最大可能性 int time = NumConstant.TWELVE; while (null == latest && time > NumConstant.ONE) { time--; monthId = dateUtils.getPreviousMonthIdByDest(null, monthId); - latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); + latest = CollectionUtils.isEmpty(subCustomers)||StringUtils.isBlank(agencyInfo.getAreaCode()) ? + screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId) : + screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId); } if (null == latest) return new PublicPartiProfileResultDTO(); @@ -130,18 +171,30 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { * @author wangc * @date 2020.08.20 15:32 **/ - @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override public List publicPartiRank(AgencyAndNumFormDTO param) { - if(null == param.getTopNum()){ + if (null == param.getTopNum()) { param.setTopNum(NumConstant.TWO); } - if(NumConstant.ZERO == param.getTopNum()){ + if (NumConstant.ZERO == param.getTopNum()) { param.setTopNum(NumConstant.MAX); } - PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - List result = screenPublicPartiTotalDataDao.selectPublicPartiTotal(param.getAgencyId()); - if(null == result) { + + ScreenCustomerAgencyDTO agencyInfo = agencyInfo(param.getAgencyId()); + List subCustomers; + Result> crmResp = crmClient.getAllSubCustomerIds(agencyInfo.getCustomerId()); + if (null == crmResp || !crmResp.success() || CollectionUtils.isEmpty(crmResp.getData())) { + subCustomers = null; + } else { + subCustomers = crmResp.getData(); + } + PageHelper.startPage(NumConstant.ONE, param.getTopNum()); + List result = + CollectionUtils.isEmpty(subCustomers) || StringUtils.isBlank(agencyInfo.getAreaCode()) ? + screenPublicPartiTotalDataDao.selectPublicPartiTotal(param.getAgencyId()) + : screenPublicPartiTotalDataDao.selectPublicPartiTotalByAreaCode(agencyInfo.getAreaCode()); + if (null == result) { return new ArrayList<>(); } return result; @@ -158,19 +211,33 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List governCapacityRank(AgencyAndNumFormDTO param) { + List orderList = new ArrayList<>(); if(null == param.getTopNum()) param.setTopNum(NumConstant.FIVE); if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX); PageHelper.startPage(NumConstant.ONE,param.getTopNum()); String monthId = dateUtils.getCurrentMonthId(); - List orderList = - screenGovernRankDataDao.selectGovernCapacityRatio(monthId,param.getAgencyId()); - int time = NumConstant.TWELVE; - while(CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE){ - time--; - monthId = dateUtils.getPreviousMonthIdByDest(null ,monthId); - PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - orderList = - screenGovernRankDataDao.selectGovernCapacityRatio(monthId,param.getAgencyId()); + if (StringUtils.isNotEmpty(param.getAreaCode())){ + List nextAgencyIds = screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(), param.getAgencyId()); + if (CollectionUtils.isEmpty(nextAgencyIds)){ + return new ArrayList<>(); + } + orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(monthId,nextAgencyIds); + int time = NumConstant.TWELVE; + while(CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE){ + time--; + monthId = dateUtils.getPreviousMonthIdByDest(null ,monthId); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(monthId,nextAgencyIds); + } + }else { + orderList = screenGovernRankDataDao.selectGovernCapacityRatio(monthId, param.getAgencyId()); + int time = NumConstant.TWELVE; + while (CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE) { + time--; + monthId = dateUtils.getPreviousMonthIdByDest(null, monthId); + PageHelper.startPage(NumConstant.ONE, param.getTopNum()); + orderList = screenGovernRankDataDao.selectGovernCapacityRatio(monthId, param.getAgencyId()); + } } if(null == orderList || orderList.isEmpty()) return new ArrayList<>(); List result = new LinkedList<>(); @@ -181,6 +248,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { rank.setResolvedRatio(convertPercentStr(o.getResolvedRatio(),NumConstant.ONE)); rank.setResponseRatio(convertPercentStr(o.getResponseRatio(),NumConstant.ONE)); rank.setSatisfactionRatio(convertPercentStr(o.getSatisfactionRatio(),NumConstant.ONE)); + rank.setParentAgencyName(o.getParentAgencyName()); result.add(rank); }); return result; @@ -199,7 +267,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { Map Xaxis = dateUtils.getXpro(); List monthlyData = screenUserJoinDao.selectUserJoinDataMonthly(param.getAgencyId(),Xaxis.keySet().iterator().next()); PublicPartiChartResultDTO result = new PublicPartiChartResultDTO(); - result.setXAxis(Xaxis.values().stream().collect(Collectors.toList())); + result.setXAxis(new ArrayList<>(Xaxis.values())); List defaultData = new LinkedList<>(); for(int i = NumConstant.ZERO ; i < NumConstant.TWELVE ; i++){ defaultData.add(NumConstant.ZERO); @@ -214,17 +282,17 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { result.setJoinUserNumList(new ArrayList<>()); result.setAverageJoinNumList(new ArrayList<>()); Map> dataMap = monthlyData.stream().collect(Collectors.groupingBy(UserJoinMonthlyResultDTO :: getMonthId)); - Xaxis.keySet().stream().forEach(monthId -> { + Xaxis.keySet().forEach(monthId -> { List data = dataMap.get(monthId); - if(null == data || data.isEmpty()){ + if (null == data || data.isEmpty()) { result.getOrganizeNumList().add(NumConstant.ZERO); result.getJoinUserNumList().add(NumConstant.ZERO); result.getAverageJoinNumList().add(NumConstant.ZERO); - }else{ + } else { Integer o = NumConstant.ZERO; Integer j = NumConstant.ZERO; Integer a = NumConstant.ZERO; - for(UserJoinMonthlyResultDTO unit : data){ + for (UserJoinMonthlyResultDTO unit : data) { o = null == unit.getOrganizeNum() ? NumConstant.ZERO : o + unit.getOrganizeNum(); j = null == unit.getJoinUserNum() ? NumConstant.ZERO : o + unit.getJoinUserNum(); a = null == unit.getAverageJoinNum() ? NumConstant.ZERO : o + unit.getAverageJoinNum(); @@ -246,6 +314,18 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { return percentStr.concat(ModuleConstant.SYMBOL_PERCENT); } + /** + * @Description 通过agencyId获取机关信息 + * @param agencyId + * @return java.lang.String + * @author wangc + * @date 2021.02.25 13:46 + */ + private ScreenCustomerAgencyDTO agencyInfo(String agencyId){ + ScreenCustomerAgencyDTO agencyInfo = agencyDao.selectByAgencyId(agencyId); + if(null == agencyInfo) throw new RenException("获取Agency信息失败"); + return agencyInfo; + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java index 73ebfc5c14..333c129f87 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -2,17 +2,22 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCpcBaseDataDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyBranchDataDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenUserTotalDataDao; +import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.datareport.service.evaluationindex.screen.GrassrootsPartyDevService; import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.ModuleConstant; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; import com.epmet.evaluationindex.screen.dto.form.BranchBuildRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.BranchBuildTrendFormDTO; import com.epmet.evaluationindex.screen.dto.form.ParymemberFormDTO; import com.epmet.evaluationindex.screen.dto.result.*; +import com.epmet.feign.OperCrmOpenFeignClient; import com.github.pagehelper.PageHelper; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -45,7 +50,10 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService private ScreenPartyBranchDataDao screenPartyBranchDataDao; @Autowired private DateUtils dateUtils; - + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; + @Autowired + private AgencyService screenCustomerAgencyService; /** * @Description 1、党员基本情况-饼状图概况 * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321324 @@ -57,10 +65,29 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public PartymemberPercentResultDTO partymemberBaseInfo(ParymemberFormDTO param) { - + if(StringUtils.isNotBlank(param.getAreaCode())){ + logger.info(String.format("党员基本情况-饼状图概况按照areaCode查询:%s",param.getAreaCode())); + List ids=screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(),param.getAgencyId()); + if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(ids)){ + PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercentByIds(ids); + if(null == result){ + logger.warn("selectAgencyPartymemberPercentByIds is null"); + result = new PartymemberPercentResultDTO(); + result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); + return result; + } + if(null == result.getPlatFormTotal() || NumConstant.ZERO == result.getPlatFormTotal()){ + result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); + }else{ + result.setPercentInPlatForm(getRatio(result.getPartyMemberTotal(),result.getPlatFormTotal())); + } + return result; + } + logger.warn("当前组织没有下级getNextAgencyIds is empty"); + return new PartymemberPercentResultDTO(); + } PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercent(param.getAgencyId()); if(null == result){ - result = new PartymemberPercentResultDTO(); logger.warn("com.epmet.datareport.service.screen.impl.GrassrootsPartyDevServiceImpl.partymemberBaseInfo:未查询出指定agencyId下的党员基础信息数据,agencyId :: {}",param.getAgencyId()); result = new PartymemberPercentResultDTO(); result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); @@ -70,11 +97,21 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService if(null == result.getPlatFormTotal() || NumConstant.ZERO == result.getPlatFormTotal()){ result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); }else{ - result.setPercentInPlatForm(convertPercentStr(new BigDecimal((result.getPartyMemberTotal().doubleValue()/result.getPlatFormTotal().doubleValue())))); + result.setPercentInPlatForm(getRatio(result.getPartyMemberTotal(),result.getPlatFormTotal())); } return result; } + public String getRatio(Integer partyMemberTotal, Integer platFormTotal){ + if (null == partyMemberTotal || null == platFormTotal || partyMemberTotal == NumConstant.ZERO || platFormTotal == NumConstant.ZERO){ + return "0.00%"; + } + BigDecimal aDecimal = new BigDecimal(partyMemberTotal); + BigDecimal bDecimal = new BigDecimal(platFormTotal); + BigDecimal result = aDecimal.divide(bDecimal, NumConstant.FOUR, BigDecimal.ROUND_HALF_UP); + return result.multiply(NumConstant.ONE_HUNDRED_DECIMAL).setScale(NumConstant.TWO,BigDecimal.ROUND_HALF_UP).toPlainString().concat(ScreenConstant.RATIO); + } + /** * @Description 2、党员基本情况-年龄分布 * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321980 @@ -85,8 +122,17 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService **/ @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override - public PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param) { - PartymemberAgeDistributionResultDTO ageInfo = screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId()); + public PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param,String customerId) { + Result> result = operCrmOpenFeignClient.getAllSubCustomerIds(customerId); + if (!result.success()){ + throw new RenException("select subCustomerIds failure"); + } + PartymemberAgeDistributionResultDTO ageInfo = new PartymemberAgeDistributionResultDTO(); + if (!CollectionUtils.isEmpty(result.getData())) { + ageInfo = screenCpcBaseDataDao.selectPartymemberAgeDistributionNew(param.getAgencyId()); + }else { + ageInfo = screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId()); + } if(null == ageInfo){ ageInfo = new PartymemberAgeDistributionResultDTO(); } @@ -231,7 +277,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService private String convertPercentStr(BigDecimal percent){ - if(null == percent || BigDecimal.ZERO == percent) return "0.00%"; + if (null == percent || BigDecimal.ZERO.equals(percent)) return "0.00%"; String percentStr = percent.setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); return percentStr.concat(ModuleConstant.SYMBOL_PERCENT); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 30afda20ef..831aa3ae36 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.enums.CommonOperateTypeEnum; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; @@ -112,9 +113,13 @@ public class IndexServiceImpl implements IndexService { List partyDevWeightData = new ArrayList<>(); List governAblityWeightData = new ArrayList<>(); // 1. x轴 - result.setXAxis(partyMemberLeadServiceImpl.getXPro()); + if(StringUtils.isNotBlank(monthBarchartFormDTO.getMonthId())){ + result.setXAxis(partyMemberLeadServiceImpl.getXproEndMonth(monthBarchartFormDTO.getMonthId())); + }else{ + result.setXAxis(partyMemberLeadServiceImpl.getXPro()); + } // 2. 查询近一年的指数值【包括本月】 - List monthBarchartResults = screenIndexDataMonthlyDao.selectMonthBarchart(monthBarchartFormDTO.getAgencyId()); + List monthBarchartResults = screenIndexDataMonthlyDao.selectMonthBarchart(monthBarchartFormDTO.getAgencyId(),monthBarchartFormDTO.getMonthId()); if (monthBarchartResults.size() == NumConstant.ZERO){ for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) { serviceAbilityData.add(NumConstant.ZERO_DOT_ZERO); @@ -149,7 +154,12 @@ public class IndexServiceImpl implements IndexService { }); List collect = monthBarchartResults.stream().sorted(Comparator.comparing(MonthBarchartResult::getMonthId)).collect(Collectors.toList()); //升序 当前月份在队尾 - List _ymList = dateUtils.getXpro().keySet().stream().collect(Collectors.toList()); + List _ymList = new ArrayList<>(); + if(StringUtils.isNotBlank(monthBarchartFormDTO.getMonthId())){ + _ymList=dateUtils.getXproEndMonth(monthBarchartFormDTO.getMonthId()).keySet().stream().collect(Collectors.toList()); + }else{ + _ymList=dateUtils.getXpro().keySet().stream().collect(Collectors.toList()); + } //针对集合collect的游标 int cursor = NumConstant.ZERO; //针对X轴,数据集合不全则进行数据填充 @@ -221,7 +231,12 @@ public class IndexServiceImpl implements IndexService { LocalDate now = LocalDate.now().minusMonths(NumConstant.ONE); int yearId = now.getYear(); subAgencyIndexRankFormDTO.setYearId(String.valueOf(yearId)); - List subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyIndexRank(subAgencyIndexRankFormDTO); + List subAgencyIndexRankResultDTOS = new ArrayList<>(); + if (StringUtils.isNotEmpty(subAgencyIndexRankFormDTO.getAreaCode())){ + subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyIndexRankNew(subAgencyIndexRankFormDTO); + }else { + subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyIndexRank(subAgencyIndexRankFormDTO); + } if (CollectionUtils.isEmpty(subAgencyIndexRankResultDTOS)){ return new ArrayList<>(); } @@ -371,4 +386,40 @@ public class IndexServiceImpl implements IndexService { return list; } + /** + * @param formDTO + * @author yinzuomei + * @description 8、平阴大屏-下级街道or网格指数排行 + * @Date 2021/2/28 14:33 + **/ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public List subAgencyIndexRankPy(SubAgencyIndexRankPyFormDTO formDTO) { + if (!"street".equals(formDTO.getType()) && !"grid".equals(formDTO.getType())) { + throw new RenException("type传参错误,街道:street;网格:grid"); + } + LocalDate now = LocalDate.now().minusMonths(NumConstant.ONE); + String yearId = String.valueOf(now.getYear()); + if("street".equals(formDTO.getType())){ + List streetList = screenIndexDataMonthlyDao.selectSubStreetByAreaCode(formDTO.getCustomerId(),yearId,formDTO.getAreaCode(),formDTO.getTopNum()); + // 小数四舍五入 + streetList.forEach(indexRank -> { + indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility())); + indexRank.setGovernAbility(getRound(indexRank.getGovernAbility())); + indexRank.setServiceAbility(getRound(indexRank.getServiceAbility())); + indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility())); + }); + return streetList; + } + List gridList = screenIndexDataMonthlyDao.selectSubGridByAreaCode(formDTO.getCustomerId(),yearId,formDTO.getAreaCode(),formDTO.getTopNum()); + // 小数四舍五入 + gridList.forEach(indexRank -> { + indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility())); + indexRank.setGovernAbility(getRound(indexRank.getGovernAbility())); + indexRank.setServiceAbility(getRound(indexRank.getServiceAbility())); + indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility())); + }); + return gridList; + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java index 203b5cb456..fce388ec23 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java @@ -1,20 +1,27 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.*; +import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService; import com.epmet.datareport.utils.DateUtils; import com.epmet.datareport.utils.ModuleConstant; +import com.epmet.dto.result.ScreenCustomerAgencyDTO; import com.epmet.evaluationindex.screen.constant.ScreenConstant; import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO; import com.epmet.evaluationindex.screen.dto.form.ContactMassLineChartFormDTO; import com.epmet.evaluationindex.screen.dto.form.FineExampleFormDTO; import com.epmet.evaluationindex.screen.dto.form.VolunteerServiceFormDTO; import com.epmet.evaluationindex.screen.dto.result.*; +import com.epmet.feign.OperCrmOpenFeignClient; import com.github.pagehelper.PageHelper; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -30,6 +37,7 @@ import java.util.*; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:22 */ +@Slf4j @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { @@ -46,6 +54,12 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { private DateUtils dateUtils; @Autowired private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + @Autowired + private ScreenCustomerAgencyDao customerAgencyDao; + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; + @Autowired + private AgencyService screenCustomerAgencyService; /** * @Description 1、先锋模范 @@ -56,16 +70,33 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public FineExampleResultDTO fineExample(FineExampleFormDTO fineExampleFormDTO) { - FineExampleResultDTO fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId()); - if (null == fineExampleResultDTO){ - return new FineExampleResultDTO(); - } - fineExampleResultDTO.setIssueRatio(this.getRatio(fineExampleResultDTO.getIssueRatioA())); - fineExampleResultDTO.setPublishIssueRatio(this.getRatio(fineExampleResultDTO.getPublishIssueRatioA())); - fineExampleResultDTO.setResolvedProjectRatio(this.getRatio(fineExampleResultDTO.getResolvedProjectRatioA())); - fineExampleResultDTO.setTopicRatio(this.getRatio(fineExampleResultDTO.getTopicRatioA())); - fineExampleResultDTO.setShiftProjectRatio(this.getRatio(fineExampleResultDTO.getShiftProjectRatioA())); - return fineExampleResultDTO; + ScreenCustomerAgencyDTO agencyInfo = customerAgencyDao.selectByAgencyId(fineExampleFormDTO.getAgencyId()); + if(null == agencyInfo) throw new RenException("未找到对应的机关"); + String customerId = agencyInfo.getCustomerId(); + String areaCode = agencyInfo.getAreaCode(); + + Result> crmResponse = operCrmOpenFeignClient.getAllSubCustomerIds(customerId); + List subCustomers; + if(null == crmResponse || !crmResponse.success()) + {subCustomers = null;} + else + {subCustomers = crmResponse.getData();} + FineExampleResultDTO fineExampleResultDTO; + if(CollectionUtils.isEmpty(subCustomers)) + fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId()); + else + fineExampleResultDTO = screenPioneerDataDao.selectFineExampleByAreaCode(areaCode,customerId,subCustomers); + + if (null == fineExampleResultDTO) { + return new FineExampleResultDTO(); + } + fineExampleResultDTO.setIssueRatio(this.getRatio(fineExampleResultDTO.getIssueRatioA())); + fineExampleResultDTO.setPublishIssueRatio(this.getRatio(fineExampleResultDTO.getPublishIssueRatioA())); + fineExampleResultDTO.setResolvedProjectRatio(this.getRatio(fineExampleResultDTO.getResolvedProjectRatioA())); + fineExampleResultDTO.setTopicRatio(this.getRatio(fineExampleResultDTO.getTopicRatioA())); + fineExampleResultDTO.setShiftProjectRatio(this.getRatio(fineExampleResultDTO.getShiftProjectRatioA())); + fineExampleResultDTO.setPlatJoinPartyRatio(this.getRatio(Double.valueOf(fineExampleResultDTO.getPlatJoinPartyRatio()))); + return fineExampleResultDTO; } /** @@ -88,8 +119,14 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public ContactMassLineChartResultDTO contactMassLineChart(ContactMassLineChartFormDTO contactMassLineChartFormDTO) { + + List subAgencyIdorGridIdList=screenCustomerAgencyService.getNextAgencyIds(contactMassLineChartFormDTO.getAreaCode(),contactMassLineChartFormDTO.getAgencyId()); + log.info("当前组织的下级id:"+JSON.toJSONString(subAgencyIdorGridIdList)); + ContactMassLineChartResultDTO result = new ContactMassLineChartResultDTO(); - List contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChart(contactMassLineChartFormDTO.getAgencyId()); + // List contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChart(contactMassLineChartFormDTO.getAgencyId()); + //多客户版修改如下: + List contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChartByAgencyIds(subAgencyIdorGridIdList); if (contactMassLineChartResults.size() == NumConstant.ZERO){ result.setXAxis(new ArrayList<>()); result.setGroupMemberData(new ArrayList<>()); @@ -194,6 +231,18 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { return xAxis; } + public List getXproEndMonth(String monthId) { + List xAxis = new ArrayList<>(); + for (int i = NumConstant.ELEVEN; 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); + xAxis.add(month.substring(4, 6).concat(ScreenConstant.MONTH)); + } + return xAxis; + } /** * @Description 4、先进排行榜单-先进支部排行 @@ -206,6 +255,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List advancedBranchRank(AgencyAndNumFormDTO param) { + List result = new LinkedList<>(); if(null == param.getTopNum()){ param.setTopNum(NumConstant.FIVE); }else if(NumConstant.ZERO == param.getTopNum()){ @@ -213,24 +263,43 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { } PageHelper.startPage(NumConstant.ONE,param.getTopNum()); String monthId = dateUtils.getCurrentMonthId(); - List gridData = - screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId); - int time = NumConstant.TWELVE; - while(CollectionUtils.isEmpty(gridData) && time > NumConstant.ONE){ - time--; - monthId = dateUtils.getPreviousMonthIdByDest(null,monthId); - PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - gridData = screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId); + if(StringUtils.isNotBlank(param.getAreaCode())){ + log.info("先进排行榜单-先进支部排行入参"+JSON.toJSONString(param)); + //areaCode不为空,按照areaCode查询 + List gridData = + screenOrgRankDataDao.selectGridDataMonthlyAreaCode(monthId,param.getAreaCode()); + int time = NumConstant.TWELVE; + while(CollectionUtils.isEmpty(gridData) && time > NumConstant.ONE){ + time--; + monthId = dateUtils.getPreviousMonthIdByDest(null,monthId); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + gridData = screenOrgRankDataDao.selectGridDataMonthlyAreaCode(monthId,param.getAreaCode()); + } + if(null == gridData || gridData.isEmpty()) return result; + gridData.forEach( data -> { + AdvanceBranchRankResultDTO o = ConvertUtils.sourceToTarget(data,AdvanceBranchRankResultDTO.class); + o.setClosedProjectRatio(convertPercentStr(data.getClosedProjectRatio())); + o.setSatisfactionRatio(convertPercentStr(data.getSatisfactionRatio())); + result.add(o); + }); + }else{ + List gridData = + screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId); + int time = NumConstant.TWELVE; + while(CollectionUtils.isEmpty(gridData) && time > NumConstant.ONE){ + time--; + monthId = dateUtils.getPreviousMonthIdByDest(null,monthId); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + gridData = screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId); + } + if(null == gridData || gridData.isEmpty()) return result; + gridData.forEach( data -> { + AdvanceBranchRankResultDTO o = ConvertUtils.sourceToTarget(data,AdvanceBranchRankResultDTO.class); + o.setClosedProjectRatio(convertPercentStr(data.getClosedProjectRatio())); + o.setSatisfactionRatio(convertPercentStr(data.getSatisfactionRatio())); + result.add(o); + }); } - List result = new LinkedList<>(); - if(null == gridData || gridData.isEmpty()) return result; - gridData.forEach( data -> { - AdvanceBranchRankResultDTO o = ConvertUtils.sourceToTarget(data,AdvanceBranchRankResultDTO.class); - o.setClosedProjectRatio(convertPercentStr(data.getClosedProjectRatio())); - o.setSatisfactionRatio(convertPercentStr(data.getSatisfactionRatio())); - result.add(o); - }); - return result; } @@ -247,14 +316,20 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { public List advancedPartymemberRank(AgencyAndNumFormDTO param) { if(null == param.getTopNum()) param.setTopNum(NumConstant.TEN); PageHelper.startPage(NumConstant.ONE,param.getTopNum()); - List result = screenPartyUserRankDataDao.selectPartymemberPointOrder(param.getAgencyId()); + List result=new ArrayList<>(); + if(StringUtils.isNotBlank(param.getAreaCode())){ + log.info("先进排行榜单-先进党员排行按照areaCode查询入参:"+param.getAreaCode()); + result=screenPartyUserRankDataDao.selectPartymemberPointOrderByAreaCode(param.getAreaCode()); + }else{ + result=screenPartyUserRankDataDao.selectPartymemberPointOrder(param.getAgencyId()); + } if(null == result) return new ArrayList<>(); return result; } private String convertPercentStr(BigDecimal percent){ - if(null == percent || BigDecimal.ZERO == percent) return "0.0%"; + if (null == percent || BigDecimal.ZERO.equals(percent)) return "0.0%"; String percentStr = percent.setScale(NumConstant.ONE, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); return percentStr.concat(ModuleConstant.SYMBOL_PERCENT); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/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..ca9130b5c4 --- /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,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.evaluationindex.screen.impl; + +import com.alibaba.druid.util.StringUtils; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +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) { + //先查询最后一次统计的dateId + String dateId=screenProjectGridDailyDao.selectLastDateId(customerId); + if(StringUtils.isEmpty(dateId)){ + //如果为空,默认查询前一天 + dateId= DateUtils.getBeforeNDay(NumConstant.ONE); + } + return screenProjectGridDailyDao.queryGridEfficiencyAnalysis(customerId,areaCode,dateId); + } +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/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..1ef82de513 --- /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(String.format("【事件分析】数量统计查询 结果为空,customerId:%s,agencyId:%s",formDTO.getCustomerId(),formDTO.getAgencyId())); + 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..72cc5f40cc --- /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,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.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.*; +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)); + List blank = dtoMap.keySet().stream().filter(query -> !monthIdList.contains(query)).collect(Collectors.toList()); + if(!CollectionUtils.isEmpty(blank)){ + for(int i = NumConstant.ZERO; i < blank.size(); i++){dtoMap.put(blank.get(i),null);} + } + }else{ + for(int i = NumConstant.ZERO; i < monthIdList.size(); i++){dtoMap.put(monthIdList.get(i),null);} + } + for (String monthId : monthIdList) { + //202101=>01月 + xAxis.add(monthId.substring(NumConstant.FOUR, NumConstant.SIX).concat(ScreenConstant.MONTH)); + if (!CollectionUtils.isEmpty(dtoList)) { + ScreenProjectQuantityOrgMonthlyDTO en = dtoMap.get(monthId); + if ("incr".equals(formDTO.getType())) { + yAxis.add( null == en ? NumConstant.ZERO : en.getProjectIncr()); + } else if ("sum".equals(formDTO.getType())) { + yAxis.add( null == en ? NumConstant.ZERO : en.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..97dafab068 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java @@ -1,12 +1,22 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; +import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; +import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -26,6 +36,11 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { private ScreenEventDataDao screenEventDataDao; @Autowired private ScreenEventImgDataDao screenEventImgDataDao; + @Autowired + private ScreenProjectDataDao screenProjectDataDao; + + @Autowired + private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao; /** * @Description 3、项目详情 @@ -44,4 +59,59 @@ 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) { + if(StringUtils.isBlank(formDTO.getStatus())){ + formDTO.setStatus("pending"); + } + List areaIds = null; + if (StringUtils.isNotBlank(formDTO.getAreaCode())){ + areaIds = screenProjectDataDao.selectIdsByAreaCode(formDTO.getAreaCode()); + } + List resultDTOS = screenProjectDataDao.projectDistribution(formDTO.getAgencyId(),areaIds,formDTO.getLevel(),formDTO.getStatus()); + return new Result().ok(resultDTOS); + } + + @Override + public Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO) { + List resultDTOS = screenProjectDataDao.projectDistributionDetail(formDTO.getProjectId()); + resultDTOS.forEach(item -> { + //项目图片 + List imgList = screenProjectDataDao.selectProjectImgs(formDTO.getProjectId()); + item.setImgList(imgList); + //项目处理流程 + List processDTOS = screenProjectDataDao.selectProjectProcess(formDTO.getProjectId()); + //流程附件 + processDTOS.forEach(processDTO -> { + List attachmentDTOS = screenProjectDataDao.selectProjectProcessAttachments(processDTO.getProcessId()); + processDTO.setAttachments(attachmentDTOS); + }); + item.setProcessList(processDTOS); + }); + return new Result().ok(resultDTOS); + } + + /** + * 【事件分析】类型分析 + * + * @param customerId + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2021/2/23 15:37 + */ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + public List categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO) { + return screenProjectCategoryOrgDailyDao.selectCategoryAnalysis(formDTO.getAgencyId()); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java index 01e0a69ac6..596b1e9dd6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.datareport.service.fact.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; @@ -12,6 +13,7 @@ import com.epmet.datareport.dao.fact.*; import com.epmet.datareport.service.fact.FactIndexService; 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.stereotype.Service; @@ -29,6 +31,7 @@ import java.util.regex.Pattern; * * @author sun */ +@Slf4j @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class FactIndexServiceImpl implements FactIndexService { @@ -77,12 +80,12 @@ public class FactIndexServiceImpl implements FactIndexService { } //4.根据组织级别判断查询哪类数据表 //区县级、乡镇街道级 - if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + if ("district".equals(agency.getAgencyLevel()) || "street".equals(agency.getAgencyLevel())) { //4-1.查询过去12个月党建能力、治理能力、服务能力每月总分数据 list = factIndexAgencyScoreDao.selectAgencyAblityWeightScoreIndex(formDTO); //社区级 - } else if ("community".equals(agency.getLevel())) { + } else if ("community".equals(agency.getAgencyLevel())) { //4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 list = factIndexCommunityScoreDao.selectCommunityAblityWeightScore(formDTO); } else { @@ -179,11 +182,11 @@ public class FactIndexServiceImpl implements FactIndexService { } //3.根据组织级别判断查询哪类数据表 //区县级、乡镇街道级 - if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + if ("district".equals(agency.getAgencyLevel()) || "street".equals(agency.getAgencyLevel())) { //3-1.查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 resultList = factIndexAgencyScoreDao.selectAgencyWeightScoreList(formDTO); //社区级 - } else if ("community".equals(agency.getLevel())) { + } else if ("community".equals(agency.getAgencyLevel())) { //3-1.查询当前组织某一月份党建能力、治理能力、服务能力对应的总分、本级分、下级分 resultList = factIndexCommunityScoreDao.selectCommunityWeightScoreList(formDTO); } else { @@ -221,22 +224,25 @@ public class FactIndexServiceImpl implements FactIndexService { if (FactConstant.AGENCY.equals(formDTO.getOrgType())) { //3.根据组织Id查询组织信息 CompartmentResultDTO agency = screenCustomerAgencyDao.getAgencyInfoByAegncyId(formDTO.getOrgId()); + log.debug("monthScoreList search agency result:{}", JSON.toJSONString(agency)); if (null == agency) { - //throw new RenException(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); + log.warn(String.format("根据组织Id未查询到组织信息,组织Id:%s", formDTO.getOrgId())); return resultList; } //4.根据组织级别判断查询哪类数据表 //区县级、乡镇街道级 - if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + if ("district".equals(agency.getAgencyLevel()) || "street".equals(agency.getAgencyLevel())) { //4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 list = factIndexAgencyScoreDao.selectAgencyMonthWeightScoreList(formDTO); - + log.debug("monthScoreList search selectAgencyMonthWeightScoreList result:{}", JSON.toJSONString(list)); //社区级 - } else if ("community".equals(agency.getLevel())) { + } else if ("community".equals(agency.getAgencyLevel())) { //4-1.查询过去12个月党建能力、治理能力、服务能力每月总分、本级得分、下级得分数据 list = factIndexCommunityScoreDao.selectCommunityMonthWeightScoreList(formDTO); + log.debug("monthScoreList search selectCommunityMonthWeightScoreList result:{}", JSON.toJSONString(list)); } else { - //throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + log.warn(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); + log.debug("monthScoreList search othoer result:{}", JSON.toJSONString(list)); return resultList; } //网格层级数据 @@ -246,7 +252,7 @@ public class FactIndexServiceImpl implements FactIndexService { } else { throw new RenException(String.format("能力指数查询,orgType类型错误,组织Id:%s,类型Type:%s", formDTO.getOrgId(), formDTO.getOrgType())); } - + log.debug("monthScoreList search result:{}", JSON.toJSONString(list)); //5.封装数据并返回 for (MonthScoreListResultDTO.ScoreListResultDTO l : list) { if (FactConstant.DJNL.equals(l.getIndexCode())) { @@ -275,7 +281,7 @@ public class FactIndexServiceImpl implements FactIndexService { if (null != fwList) { resultList.add(fw); } - + log.debug("monthScoreList search return result:{}", JSON.toJSONString(resultList)); return resultList; } @@ -298,8 +304,8 @@ public class FactIndexServiceImpl implements FactIndexService { } //3.根据组织级别拼接查询条件,判断查询不同数据表 //区县级、乡镇街道级 - if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { - if ("district".equals(agency.getLevel())) { + if ("district".equals(agency.getAgencyLevel()) || "street".equals(agency.getAgencyLevel())) { + if ("district".equals(agency.getAgencyLevel())) { formDTO.setAllParentIndexCode(FactConstant.QUAN_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); } else { formDTO.setAllParentIndexCode(FactConstant.JIE_DAO_XIANG_GUAN + ":" + formDTO.getIndexCode()); @@ -307,7 +313,7 @@ public class FactIndexServiceImpl implements FactIndexService { resultList = factIndexAgencySubScoreDao.selectAblityList(formDTO); //社区级 - } else if ("community".equals(agency.getLevel())) { + } else if ("community".equals(agency.getAgencyLevel())) { formDTO.setAllParentIndexCode(FactConstant.SHE_QU_XIANG_GUAN + ":" + formDTO.getIndexCode()); resultList = factIndexCommunitySubScoreDao.selectCommunityAblityList(formDTO); } else { @@ -366,10 +372,10 @@ public class FactIndexServiceImpl implements FactIndexService { } //4.根据组织级别拼接查询条件,判断查询不同数据表 //区县级、乡镇街道级 - if ("district".equals(agency.getLevel()) || "street".equals(agency.getLevel())) { + if ("district".equals(agency.getAgencyLevel()) || "street".equals(agency.getAgencyLevel())) { resultList = factIndexAgencySubScoreDao.selectMonthAblityList(formDTO); //社区级 - } else if ("community".equals(agency.getLevel())) { + } else if ("community".equals(agency.getAgencyLevel())) { resultList = factIndexCommunitySubScoreDao.selectCommunityMonthAblityList(formDTO); } else { //throw new RenException(String.format("根据组织Id查询到的组织级别信息错误,组织Id:%s", formDTO.getOrgId())); 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..0991305f4f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java @@ -0,0 +1,118 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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.VoluntaryServiceTrendFormDTO; +import com.epmet.plugins.form.WorkRecordRankFormDTO; +import com.epmet.plugins.form.WorkRecordTrendFormDTO; +import com.epmet.plugins.result.VoluntaryServiceTrendResultDTO; +import com.epmet.plugins.result.WorkRecordRankResultDTO; +import com.epmet.plugins.result.WorkRecordTrendResultDTO; + +import java.util.List; +import java.util.Map; + +/** + * 工作日志-组织按日统计(累计值) + * + * @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); + + /** + * @return com.epmet.plugins.result.VoluntaryServiceTrendResultDTO + * @param formDTO + * @author yinzuomei + * @description 7、【工作日志】党员志愿者服务近12月趋势图 + * @Date 2021/2/27 19:56 + **/ + VoluntaryServiceTrendResultDTO voluntaryServiceTrend(VoluntaryServiceTrendFormDTO 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..fbe09c540f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/OfsServiceImpl.java @@ -0,0 +1,60 @@ +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 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @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..39380cd9d4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.plugins.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.plugins.ScreenCustomerWorkRecordDictDao; +import com.epmet.datareport.entity.plugins.ScreenCustomerWorkRecordDictEntity; +import com.epmet.datareport.service.plugins.ScreenCustomerWorkRecordDictService; +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 +@DataSource(DataSourceConstant.EVALUATION_INDEX) +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..d55fbf927a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java @@ -0,0 +1,310 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.plugins.ScreenCustomerWorkRecordDictDao; +import com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgDailyDao; +import com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgMonthlyDao; +import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgDailyEntity; +import com.epmet.datareport.service.evaluationindex.screen.AgencyService; +import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgDailyService; +import com.epmet.datareport.utils.DateUtils; +import com.epmet.dto.AgencyInfoDTO; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import com.epmet.feign.OperCrmOpenFeignClient; +import com.epmet.plugins.ScreenWorkRecordOrgDailyDTO; +import com.epmet.plugins.form.VoluntaryServiceTrendFormDTO; +import com.epmet.plugins.form.WorkRecordRankFormDTO; +import com.epmet.plugins.form.WorkRecordTrendFormDTO; +import com.epmet.plugins.result.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 工作日志-组织按日统计(累计值) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl implements ScreenWorkRecordOrgDailyService { + @Autowired + private AgencyService agencyService; + @Autowired + private DateUtils dateUtils; + @Autowired + private ScreenCustomerWorkRecordDictDao screenCustomerWorkRecordDictDao; + @Autowired + private ScreenWorkRecordOrgMonthlyDao screenWorkRecordOrgMonthlyDao; + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + 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)); + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + public WorkRecordRankResultDTO rankList(WorkRecordRankFormDTO formDTO) { + List customerIds=new ArrayList<>(); + Result> result=operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId()); + // log.info("根据customerId查询其所有下级子客户id result: "+JSON.toJSONString(result)); + if (result.success() && CollectionUtils.isNotEmpty(result.getData())) { + customerIds.addAll(result.getData()); + } + customerIds.add(formDTO.getCustomerId()); + String dateId= baseDao.selectLatestDateId(customerIds); + if(StringUtils.isBlank(dateId)){ + dateId= com.epmet.commons.tools.utils.DateUtils.getBeforeNDay(NumConstant.ONE); + log.warn("dateId 赋值为"+dateId+" ; selectLatestDateId dateId is null customerIds" + JSON.toJSONString(customerIds)); + } + WorkRecordRankResultDTO returnDto = new WorkRecordRankResultDTO(); + AgencyInfoDTO agencyInfoDTO = agencyService.getAgencyInfoDTO(formDTO.getAreaCode(), formDTO.getAgencyId()); + // log.info("agencyInfoDTO: "+JSON.toJSONString(agencyInfoDTO)); + //当前组织的自身的数据 + List currentAgency = baseDao.selectCurrentAgency(formDTO.getAgencyId(), + formDTO.getDataType(), + formDTO.getCustomerId(), + dateId); + //下级所有组织 + List subAgencyRankList = CollectionUtils.isNotEmpty(agencyInfoDTO.getSubAgencyIds()) ? baseDao.selectSubList( + agencyInfoDTO.getSubAgencyIds(), + formDTO.getDataType(), + formDTO.getCustomerId(), + dateId) : new ArrayList<>(); + //直属网格 + List subGridList = CollectionUtils.isNotEmpty(agencyInfoDTO.getSubGridIds()) ? baseDao.selectSubGridList( + agencyInfoDTO.getSubGridIds(), + formDTO.getDataType(), + formDTO.getCustomerId(), + dateId) : new ArrayList<>(); + + returnDto.getSubRankList().addAll(subAgencyRankList); + returnDto.getSubRankList().addAll(subGridList); + // log.info("returnDto.getSubRankList()="+returnDto.getSubRankList()); + int participateUserTotal = 0; + int participateTotal = 0; + for (WorkRecordSubRank subAgency : returnDto.getSubRankList()) { + participateUserTotal += subAgency.getParticipateUserTotal(); + participateTotal += subAgency.getParticipateTotal(); + } + if (CollectionUtils.isNotEmpty(currentAgency)) { + for (WorkRecordSubRank m : currentAgency) { + participateUserTotal += m.getParticipateUserTotal(); + participateTotal += m.getParticipateTotal(); + } + } + returnDto.setParticipateTotal(participateTotal); + returnDto.setParticipateUserTotal(participateUserTotal); + returnDto.setSubRankList(CollectionUtils.isNotEmpty(returnDto.getSubRankList()) && returnDto.getSubRankList().size() >= formDTO.getTopRow() ? + returnDto.getSubRankList().subList(NumConstant.ZERO, formDTO.getTopRow()) : returnDto.getSubRankList()); + return returnDto; + } + + /** + * @Description 6、【工作日志】近12月趋势图 + * 查询当前组织及所有下级某项数据(组织次数、参与人数、平均参与人数)的某个资源(支部建设、联建共建、党员志愿服务)对应的每个类型的指标过去12个月的汇总数据,某个月份没数据的补0 + * @author sun + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + public WorkRecordTrendResultDTO trend(WorkRecordTrendFormDTO formDTO) { + WorkRecordTrendResultDTO resultDTO = new WorkRecordTrendResultDTO(); + + //1.根据资源编码查询资源名称集合,按sort升序 + List legendList = screenCustomerWorkRecordDictDao.selectListByDataType(formDTO.getCustomerId(), formDTO.getDataType()); + resultDTO.setLegend(legendList); + if (null == legendList || legendList.size() < NumConstant.ONE) { + return resultDTO; + } + + //2.查询当前月过去12个月份 + Map map = dateUtils.getXpro(); + resultDTO.setXAxis(map.values().stream().collect(Collectors.toList())); + List monthIdList = map.keySet().stream().collect(Collectors.toList()); + + //3-1.查询当前组织及所有下级过去12个月份某项数据所有资源的统计数据 + DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyyMM"); + LocalDate today = LocalDate.now(); + formDTO.setStartMonth(today.minusMonths(NumConstant.THIRTEEN).format(fmt)); + formDTO.setEndMonth(today.minusMonths(NumConstant.ONE).format(fmt)); + List list = screenWorkRecordOrgMonthlyDao.selectMonthList(formDTO); + + //3-2.遍历封装数据并返回 + LinkedList seriesList = new LinkedList<>(); + //按资源类型封装每一个资源类型对应的过去12个月的汇总数据,某个月份没有数据的补0 + legendList.forEach(le -> { + WorkRecordTrendResultDTO.SeriesResultDTO dto = new WorkRecordTrendResultDTO.SeriesResultDTO(); + dto.setName(le); + LinkedList dataList = new LinkedList<>(); + monthIdList.forEach(m->{ + AtomicInteger num = new AtomicInteger(0); + list.forEach(l -> { + if (m.equals(l.getMonthId())&&le.equals(l.getName())) { + //dataList.add(l.getValue()); + num.set(l.getValue()); + } + }); + dataList.add(num.get()); + }); + dto.setData(dataList); + seriesList.add(dto); + }); + + resultDTO.setSeries(seriesList); + return resultDTO; + } + + /** + * @param formDTO + * @return com.epmet.plugins.result.VoluntaryServiceTrendResultDTO + * @author yinzuomei + * @description 7、【工作日志】党员志愿者服务近12月趋势图 + * @Date 2021/2/27 19:56 + **/ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + public VoluntaryServiceTrendResultDTO voluntaryServiceTrend(VoluntaryServiceTrendFormDTO formDTO) { + VoluntaryServiceTrendResultDTO resultDTO = new VoluntaryServiceTrendResultDTO(); + //近12个月的monthId集合,["202002","202003","202004","202005","202006","202007","202008","202009","202010","202011","202012","202101"] + List monthIdList = com.epmet.commons.tools.utils.DateUtils.getMonthIdList(formDTO.getEndMonthId(), NumConstant.ELEVEN); + // log.info(JSON.toJSONString(monthIdList)); + + AgencyInfoDTO agencyInfoDTO = agencyService.getAgencyInfoDTO(formDTO.getAreaCode(), formDTO.getAgencyId()); + List orgIds = new ArrayList<>(); + orgIds.addAll(agencyInfoDTO.getSubAgencyIds()); + orgIds.add(agencyInfoDTO.getAgencyId()); + orgIds.addAll(agencyInfoDTO.getSubGridIds()); + List list = screenWorkRecordOrgMonthlyDao.selectVoluntaryServiceTrendDTO(formDTO.getCustomerId(), + orgIds, + monthIdList.get(NumConstant.ZERO), + monthIdList.get(NumConstant.ELEVEN)); + Map dtoMap = new HashMap<>(); + if (!org.springframework.util.CollectionUtils.isEmpty(list)) { + dtoMap = list.stream().collect(Collectors.toMap(VoluntaryServiceTrendDTO::getMonthId, Function.identity(), (key1, key2) -> key2)); + } + + //要返回的横坐标:["02月","03月","04月","05月","06月","07月","08月","09月","10月","11月","12月","01月"] + List xAxis = new ArrayList<>(); + List organizeList = new ArrayList<>(); + List joinUserList = new ArrayList<>(); + List avgUserList = new ArrayList<>(); + + for (String monthId : monthIdList) { + xAxis.add(monthId.substring(NumConstant.FOUR, NumConstant.SIX).concat(ScreenConstant.MONTH)); + if (null != dtoMap.get(monthId) && null != dtoMap.get(monthId).getOrganizeTotal()) { + organizeList.add(dtoMap.get(monthId).getOrganizeTotal()); + } else { + organizeList.add(NumConstant.ZERO); + } + if (null != dtoMap.get(monthId) && null != dtoMap.get(monthId).getParticipateUserTotal()) { + joinUserList.add(dtoMap.get(monthId).getParticipateUserTotal()); + } else { + joinUserList.add(NumConstant.ZERO); + } + if (null != dtoMap.get(monthId) && null != dtoMap.get(monthId).getAvgParticipateUserTotal()) { + avgUserList.add(dtoMap.get(monthId).getAvgParticipateUserTotal()); + } else { + avgUserList.add(NumConstant.ZERO); + } + } + resultDTO.setXAxis(xAxis); + resultDTO.setOrganizeList(organizeList); + resultDTO.setJoinUserList(joinUserList); + resultDTO.setAvgUserList(avgUserList); + return resultDTO; + } + + public static void main(String[] args) { + LocalDate today = LocalDate.now(); + DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyyMM"); + System.out.println(today.minusMonths(NumConstant.THIRTEEN).format(fmt)); + System.out.println(today.minusMonths(NumConstant.ONE).format(fmt)); + } +} \ 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..533bf00c18 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.service.plugins.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgMonthlyDao; +import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgMonthlyEntity; +import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgMonthlyService; +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 +@DataSource(DataSourceConstant.EVALUATION_INDEX) +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 9c2336d992..f095fb0666 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.datareport.service.project.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; @@ -26,7 +27,11 @@ import com.epmet.project.dto.form.DifficultyRankFormDTO; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; import com.epmet.project.dto.result.ProjectDetailResultDTO; import com.epmet.project.dto.result.*; +import com.epmet.resi.group.dto.topic.ResiTopicDTO; +import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.github.pagehelper.PageHelper; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -42,6 +47,7 @@ import java.util.List; * @Author sun * @Description 数据-项目 **/ +@Slf4j @Service public class ProjectServiceImpl implements ProjectService { @@ -56,7 +62,8 @@ public class ProjectServiceImpl implements ProjectService { @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; - + @Autowired + private ResiGroupOpenFeignClient resiGroupOpenFeignClient; /** * @Author sun * @Description 数据-项目-获取汇总数据 @@ -197,10 +204,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(); + Result result=govProjectOpenFeignClient.queryProjectInfoByProjectId(processListFormDTO.getProjectId()); + if(!result.success()||null==result.getData()){ + log.warn(String.format("项目信息查询失败(该接口目前只支持e事通内的客户),projectId:%s", processListFormDTO.getProjectId())); + return projectDetailResultDTO; } + ProjectInfoDTO projectInfoDTO=result.getData(); + projectDetailResultDTO.setImgUrlList(projectInfoDTO.getImgUrlList()); + projectDetailResultDTO.setEventSource(projectInfoDTO.getGridName()); + projectDetailResultDTO.setEventTitle(projectInfoDTO.getEventTitle()); + projectDetailResultDTO.setEventContent(projectInfoDTO.getEventContent()); Result processList = govProjectOpenFeignClient.getProcessList(processListFormDTO); if (!processList.success()) { throw new RenException(ProjectConstant.PROCESS_FAILURE); @@ -211,6 +229,14 @@ public class ProjectServiceImpl implements ProjectService { List departmentNameListResultDTOS = ConvertUtils.sourceToTarget(data.getDepartmentList(), DepartmentNameListResultDTO.class); projectDetailResultDTO.setDepartmentList(departmentNameListResultDTOS); projectDetailResultDTO.setDepartmentNameList(data.getDepartmentNameList()); + //返回话题内容 + if(result.success()&&null!=result.getData()){ + Result topicResult = resiGroupOpenFeignClient.queryTopicInfoByIssueId(result.getData().getIssueId()); + log.info(String.format("根据issueId:%s查询话题详情返参:%s", result.getData().getIssueId(), JSON.toJSONString(topicResult))); + if (topicResult.success() && null != topicResult.getData() && StringUtils.isNotBlank(topicResult.getData().getTopicContent())) { + projectDetailResultDTO.setTopicContent(topicResult.getData().getTopicContent()); + } + } return projectDetailResultDTO; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/UserAnalysisService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/UserAnalysisService.java index 47c304f1b2..e7e31c78a1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/UserAnalysisService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/UserAnalysisService.java @@ -1,6 +1,7 @@ package com.epmet.datareport.service.user; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dto.form.user.UserIncrTrendFormDTO; import com.epmet.dto.form.user.UserSubAgencyFormDTO; import com.epmet.dto.form.user.UserSubGridFormDTO; @@ -32,7 +33,7 @@ public interface UserAnalysisService { * @description 直属机关柱状图查询 * @Date 2020/6/22 13:42 **/ - List subAgency(UserSubAgencyFormDTO formDTO); + List subAgency(TokenDto tokenDto, UserSubAgencyFormDTO formDTO); /** * @param formDTO @@ -41,7 +42,7 @@ public interface UserAnalysisService { * @description 直属网格柱状图查询 * @Date 2020/6/22 13:42 **/ - List subGrid(UserSubGridFormDTO formDTO); + List subGrid(TokenDto tokenDto, UserSubGridFormDTO formDTO); /** * @param formDTO @@ -60,7 +61,7 @@ public interface UserAnalysisService { * @description 按日、按月查询注册用户数(参与用户数)增量折线图 * @Date 2020/6/22 13:42 **/ - List incrTrendV2(UserIncrTrendFormDTO formDTO); + List incrTrendV2(TokenDto tokenDto, UserIncrTrendFormDTO formDTO); /** * @return com.epmet.dto.result.user.UserAgencyInfoResultDTO diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java index 88e39067b4..c4bf48603a 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java @@ -2,7 +2,9 @@ package com.epmet.datareport.service.user.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.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; @@ -74,6 +76,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { logger.info(String.format("用户%s的所属机关id为%s",loginUserDetailsFormDTO.getUserId(),result.getData().getAgencyId())); return result.getData().getAgencyId(); } + /** * @param formDTO * @return com.epmet.user.result.UserSummaryInfoResultDTO @@ -120,11 +123,11 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { * @Date 2020/6/22 13:42 **/ @Override - public List subAgency(UserSubAgencyFormDTO formDTO) { + public List subAgency(TokenDto tokenDto, UserSubAgencyFormDTO formDTO) { //获取用户所属机关id String myAgencyId = this.getMyAgency(); //初始化横坐标(用户所机关的下级机关列表) - List dimList = this.initUserSubAgencyResultDTO(myAgencyId); + List dimList = this.initUserSubAgencyResultDTO(tokenDto.getCustomerId(), myAgencyId); if(CollectionUtils.isEmpty(dimList)){ logger.info(String.format("当前机关(agencyId=%s)下没有下级机关",myAgencyId)); return new ArrayList<>(); @@ -199,7 +202,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { return dimList; } - private List initUserSubAgencyResultDTO(String myAgencyId) { + private List initUserSubAgencyResultDTO(String customerId, String myAgencyId) { List list=new ArrayList<>(); List dimAgencyDTOS=userAnalysisDao.selectSubAgencyList(myAgencyId); for(DimAgencyDTO agencyDTO:dimAgencyDTOS){ @@ -208,7 +211,11 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { resi.setAgencyId(agencyDTO.getId()); resi.setName(agencyDTO.getAgencyName()); resi.setValue(NumConstant.ZERO); - resi.setType(UserAnalysisConstant.REGISTERED_RESI); + if (StrConstant.SPECIAL_CUSTOMER.equals(customerId)) { + resi.setType("学员"); + } else { + resi.setType(UserAnalysisConstant.REGISTERED_RESI); + } resi.setTotal(NumConstant.ZERO); list.add(resi); //热心居民 @@ -216,7 +223,11 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { warm.setAgencyId(agencyDTO.getId()); warm.setName(agencyDTO.getAgencyName()); warm.setValue(NumConstant.ZERO); - warm.setType(UserAnalysisConstant.WARMHEARTED); + if (StrConstant.SPECIAL_CUSTOMER.equals(customerId)) { + warm.setType("组长"); + } else { + warm.setType(UserAnalysisConstant.WARMHEARTED); + } warm.setTotal(NumConstant.ZERO); list.add(warm); //党员 @@ -239,11 +250,11 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { * @Date 2020/6/22 13:42 **/ @Override - public List subGrid(UserSubGridFormDTO formDTO) { + public List subGrid(TokenDto tokenDto, UserSubGridFormDTO formDTO) { //获取用户所属机关id String myAgencyId = this.getMyAgency(); //初始化横坐标(用户所机关的直属网格) - List dimList = this.initUserSubGridResultDTO(myAgencyId); + List dimList = this.initUserSubGridResultDTO(tokenDto.getCustomerId(), myAgencyId); if(CollectionUtils.isEmpty(dimList)){ logger.info(String.format("当前机关(agencyId=%s)下没有网格",myAgencyId)); return new ArrayList<>(); @@ -315,7 +326,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { return dimList; } - private List initUserSubGridResultDTO(String myAgencyId) { + private List initUserSubGridResultDTO(String customerId, String myAgencyId) { List list=new ArrayList<>(); List gridList=userAnalysisDao.selectSubGridList(myAgencyId); for(DimGridDTO grid:gridList){ @@ -324,7 +335,11 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { resi.setGridId(grid.getId()); resi.setName(grid.getGridName()); resi.setValue(NumConstant.ZERO); - resi.setType(UserAnalysisConstant.REGISTERED_RESI); + if (StrConstant.SPECIAL_CUSTOMER.equals(customerId)) { + resi.setType("学员"); + } else { + resi.setType(UserAnalysisConstant.REGISTERED_RESI); + } resi.setTotal(NumConstant.ZERO); list.add(resi); //热心居民 @@ -332,7 +347,11 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { warm.setGridId(grid.getId()); warm.setName(grid.getGridName()); warm.setValue(NumConstant.ZERO); - warm.setType(UserAnalysisConstant.WARMHEARTED); + if (StrConstant.SPECIAL_CUSTOMER.equals(customerId)) { + warm.setType("组长"); + } else { + warm.setType(UserAnalysisConstant.WARMHEARTED); + } warm.setTotal(NumConstant.ZERO); list.add(warm); //党员 @@ -411,7 +430,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { } @Override - public List incrTrendV2(UserIncrTrendFormDTO formDTO) { + public List incrTrendV2(TokenDto tokenDto, UserIncrTrendFormDTO formDTO) { //获取用户所属机关id String myAgencyId = this.getMyAgency(); List resultList=new ArrayList<>(); @@ -443,14 +462,22 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { UserIncrTrendResultDTO reg=new UserIncrTrendResultDTO(); reg.setDateOrMonthId(userIncrTrendResDTO.getDateIdOrMonthId()); reg.setDate(date); - reg.setType(UserAnalysisConstant.REGISTERED_RESI); + if (StrConstant.SPECIAL_CUSTOMER.equals(tokenDto.getCustomerId())) { + reg.setType("学员"); + } else { + reg.setType(UserAnalysisConstant.REGISTERED_RESI); + } reg.setValue(userIncrTrendResDTO.getRegIncr()); resultList.add(reg); UserIncrTrendResultDTO warm=new UserIncrTrendResultDTO(); warm.setDateOrMonthId(userIncrTrendResDTO.getDateIdOrMonthId()); warm.setDate(date); - warm.setType(UserAnalysisConstant.WARMHEARTED); + if (StrConstant.SPECIAL_CUSTOMER.equals(tokenDto.getCustomerId())) { + warm.setType("组长"); + } else { + warm.setType(UserAnalysisConstant.WARMHEARTED); + } warm.setValue(userIncrTrendResDTO.getWarmIncr()); resultList.add(warm); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java index b2d99c00f1..62356ad9f5 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java @@ -75,6 +75,22 @@ public class DateUtils { return result; } + public Map getXproEndMonth(String monthId){ + Map xAxis = new HashMap<>(); + for(int i=NumConstant.ZERO;i <= NumConstant.ELEVEN; 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); + xAxis.put(month,month.substring(4,6).concat("月")); + } + Map result = Maps.newLinkedHashMap(); + xAxis.entrySet().stream().sorted(Map.Entry.comparingByKey()) + .forEachOrdered((e -> result.put(e.getKey(),e.getValue()))); + return result; + } + /** * @Description 得到上个月的monthId * @param diff --git a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml index 34d40361e4..4b220e0c72 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /data/report @@ -148,4 +149,10 @@ jwt: #秘钥 secret: 7016867071f0ebf1c46f123eaaf4b9d6[elink.epmet] #token有效时长,默认7天,单位秒 - expire: 604800 \ No newline at end of file + expire: 604800 + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml index 648ed8d9db..9cda990ac0 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml @@ -155,7 +155,7 @@ - + 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..4c68253adb --- /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..7da320609b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml @@ -0,0 +1,21 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml new file mode 100644 index 0000000000..3f43d05337 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + \ 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..9bbe13d732 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml @@ -0,0 +1,66 @@ + + + + + + + + + \ 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 573c7501fa..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 @@ -10,12 +10,28 @@ SUM( AGE_LEVEL_3 ) + SUM( AGE_LEVEL_4 ) AS between31And50Count, SUM( AGE_LEVEL_5 ) AS between51And60Count, SUM( AGE_LEVEL_6 ) AS above61Count, - SUM( PARTY_MEMBER_COUNT) AS partyTotal + SUM( PARTY_MEMBER_COUNT) AS partyMemberCount, + SUM( AGE_LEVEL_1 ) + SUM( AGE_LEVEL_2 )+SUM( AGE_LEVEL_3 ) + SUM( AGE_LEVEL_4 )+SUM( AGE_LEVEL_5 )+SUM( AGE_LEVEL_6 ) as partyTotal FROM screen_cpc_base_data WHERE 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 8dd92ec0d1..fba3b96602 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -44,7 +44,8 @@ agency_id AS agencyId, agency_name AS name, area_marks AS areaMarks, - level AS level + level as level, + level as agencyLevel FROM screen_customer_agency WHERE @@ -60,7 +61,8 @@ agency_name AS subName, area_marks AS subAreaMarks, center_mark AS subCenterMark, - 'agency' AS type + 'agency' AS type, + level as agencyLevel FROM screen_customer_agency WHERE @@ -73,7 +75,7 @@ - \ No newline at end of file + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index be82c07755..2d9f8e5deb 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -10,7 +10,8 @@ grid_name AS subName, area_marks AS subAreaMarks, center_mark AS subCenterMark, - 'grid' AS type + 'grid' AS type, + '' as agencyLevel FROM screen_customer_grid WHERE @@ -23,7 +24,7 @@ SELECT scg.grid_id AS gridId, scg.grid_name AS gridName, - scg.party_mark AS partyMark + IFNULL(scg.party_mark,'') AS partyMark FROM screen_customer_grid scg LEFT JOIN screen_customer_agency sca ON sca.AGENCY_ID = scg.PARENT_AGENCY_ID AND sca.IS_DISPLAY = 1 @@ -37,7 +38,7 @@ + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml index a342420f2d..7f30a13cac 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -12,7 +12,7 @@ ROUND(diff.EVENT_COST_TIME/60,0) AS totalHours, diff.EVENT_SOURCE AS gridName, diff.EVENT_IMG_URL AS imgUrl, - diff.EVENT_CATEGORY_NAME AS categoryName, + IFNULL(diff.EVENT_CATEGORY_NAME,'') AS categoryName, diff.EVENT_RE_ORG AS handleDepts, diff.EVENT_RE_ORG AS handleCount FROM @@ -52,4 +52,30 @@ AND dd.EVENT_ID = #{eventId} + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml index 7976de7ff1..5cd4094e36 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml @@ -6,19 +6,83 @@ + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 8011535fdb..ec417cbf50 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -42,6 +42,9 @@ WHERE del_flag = '0' AND org_id = #{agencyId} + + AND MONTH_ID <= #{monthId} + ORDER BY MONTH_ID DESC LIMIT 12 @@ -190,7 +193,11 @@ + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml index 5b445202d5..7cf197a054 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml @@ -8,13 +8,15 @@ SELECT service_ablity AS serviceAbility, party_dev_ablity AS partyDevAbility, - govern_ablity AS governAbility + govern_ablity AS governAbility, + year_id as yearId FROM screen_index_data_yearly WHERE del_flag = '0' AND org_id = #{agencyId} - AND year_id = DATE_FORMAT(NOW(),'%Y') + order by year_id desc + limit 1 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml index 310320029e..5d2be597be 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml @@ -6,29 +6,64 @@ + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml index 0ee2a6a315..a2d09bf0b3 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml @@ -32,6 +32,7 @@ AND ORG_ID = #{agencyId} AND TYPE = #{category} AND MONTH_ID = ]]> #{bottomMonthId} + AND MEET_CATEGORY_NAME IS NOT NULL ORDER BY MONTH_ID DESC , MEET_CATEGORY_NAME diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml index 7a59c7f16d..2a5f09786e 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml @@ -15,5 +15,45 @@ WHERE md.del_flag = '0' AND md.parent_id = #{agencyId} + + AND md.ORG_TYPE = + CASE WHEN sca.LEVEL = 'community' THEN 'grid' ELSE 'agency' END + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index ed4cf4c4d1..30fb7bd125 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -98,4 +98,37 @@ LIMIT #{topNum} + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml index 992c347f9b..6534512f8a 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml @@ -7,15 +7,17 @@ - \ No newline at end of file + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml new file mode 100644 index 0000000000..5816def044 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml @@ -0,0 +1,28 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml new file mode 100644 index 0000000000..08e88bbeae --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + 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..c674252a52 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectGridDailyDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectOrgDailyDao.xml new file mode 100644 index 0000000000..9ef167d327 --- /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-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml index 1a94210725..1f3e4623c0 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPublicPartiTotalDataDao.xml @@ -6,24 +6,62 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml index 42f6d5753c..88ea0c6d44 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml @@ -5,25 +5,59 @@ + + + + + - \ No newline at end of file + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml index 05c17e1378..9bf5d9a061 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsOrgMonthlyDao.xml @@ -14,14 +14,33 @@ AND MONTH_ID = #{monthId} - \ No newline at end of file + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml index 82456904ea..58b7001046 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screenan/ScreenAnGrassRootsPmTotalMonthlyDao.xml @@ -14,15 +14,38 @@ AND MONTH_ID = #{monthId} - \ 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..9e019b6d24 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 @@ -21,6 +23,7 @@ public class CalculateCommonFormDTO implements Serializable { /** * 月份id: yyyyMM */ + @NotBlank(message = "monthId不能为空", groups = { CancelCalculateGroup.class }) private String monthId; /** @@ -29,6 +32,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/IndexStatisticsFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/IndexStatisticsFormDTO.java new file mode 100644 index 0000000000..dd63b1fea7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/IndexStatisticsFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/3/3 下午4:32 + */ +@Data +public class IndexStatisticsFormDTO implements Serializable { + + private static final long serialVersionUID = 1127307237675056558L; + + private String customerId; + + private String monthId; + + private String startMonth; + + private String endMonth; +} diff --git a/epmet-module/data-statistical/data-statistical-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/indexcal/SubCommunityAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java index 06b06109f1..a2c167eaeb 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.indexcal; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; @@ -47,5 +48,10 @@ public class SubCommunityAvgResultDTO implements Serializable { /** * 分数 */ - private BigDecimal score; + private BigDecimal score = NumConstant.ZERO_DECIMAL; + + /** + * 赋值状态 + */ + private Boolean scoreStatus = false; } 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/issue/IssueProjectCategoryDictDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java new file mode 100644 index 0000000000..1955847edd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.issue; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 议题项目分类字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +public class IssueProjectCategoryDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id, 产品默认default + */ + private String customerId; + + /** + * 上级分类ID 顶级此列存储0 + */ + private String pid; + + /** + * 所有上级分类ID,用逗号分开 + */ + private String pids; + + /** + * 分类编码,分类编码+customer_id唯一 + */ + private String categoryCode; + + /** + * 分类名称 + */ + private String categoryName; + + /** + * 分类类别1,2,3,4.... + */ + private String categoryType; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-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/project/ProjectCategoryDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectCategoryDTO.java new file mode 100644 index 0000000000..3ca8dc43fc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectCategoryDTO.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ProjectCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 来源网格id + */ + private String gridId; + + /** + * 项目id + */ + private String projectId; + + /** + * 分类id + */ + private String categoryId; + + /** + * 分类对应的所有上级,英文逗号隔开 + */ + private String categoryPids; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectStaffDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectStaffDTO.java new file mode 100644 index 0000000000..6de5285b6b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectStaffDTO.java @@ -0,0 +1,122 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 项目人员关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Data +public class ProjectStaffDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 项目ID + */ + private String projectId; + + /** + * 项目处理进展ID + */ + private String processId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String orgId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 所属机关(11:22:33) + */ + private String orgIdPath; + + /** + * 人员ID + */ + private String staffId; + + /** + * 部门名 + */ + private String departmentName; + + /** + * 是否处理:未处理unhandled,已处理handle + */ + private String isHandle; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectExceedParamsResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectExceedParamsResultDTO.java new file mode 100644 index 0000000000..a8b2b0f0e5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectExceedParamsResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.project.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 客户项目超期相关参数 + * @ClassName ProjectExceedParamsResultDTO + * @Auth wangc + * @Date 2021-03-05 17:02 + */ +@Data +public class ProjectExceedParamsResultDTO implements Serializable { + private static final long serialVersionUID = 7621539816482416776L; + + private Integer defaultExceedLimit; + + private Integer defaultAbout2ExceedLimit; + + private Integer exceedLimit; + + private Integer about2ExceedLimit; +} 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..423a94ebce --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java @@ -0,0 +1,174 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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; + + private String topicId; + +} 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..42824beb62 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectImgDataDTO.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.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; + + private String topicId; + +} 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..e2479d607a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessDTO.java @@ -0,0 +1,150 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +import com.epmet.dto.project.ProjectStaffDTO; +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; + + private List points; + +} 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..16ab5fee7d 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java @@ -1,8 +1,12 @@ package com.epmet.dto.screencoll; import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.Valid; +import javax.validation.constraints.*; import java.io.Serializable; import java.util.List; @@ -14,21 +18,47 @@ import java.util.List; */ @Data public class ScreenCollFormDTO implements Serializable { - private static final long serialVersionUID = 4605543711669000348L; + + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface IsFirstShowGroup extends CustomerClientShowGroup { + } + + public interface DateIdShowGroup extends CustomerClientShowGroup { + } + + public interface MonthIdShowGroup extends CustomerClientShowGroup { + } + + public interface CustomerIdShowGroup extends CustomerClientShowGroup { + } + + public interface DataListShowGroup extends CustomerClientShowGroup { + + } + /** * 当为true时后台将先删除当前维度的数据,后新增 */ + @NotNull(message = "isFirst不能为空", groups = IsFirstShowGroup.class) private Boolean isFirst; /** * 日期Id, 数据更新至:yyyyMMdd */ + @NotBlank(message = "dateId不能为空;", groups = DateIdShowGroup.class) + @Length(min = 8, max = 8, message = "dateId不能为空,格式应为yyyyMMdd;", groups = {DateIdShowGroup.class}) private String dateId; /** * yyyyMM */ + @NotBlank(message = "monthId不能为空,格式yyyyMM;", groups = MonthIdShowGroup.class) + @Length(min = 6, max = 6, message = "monthId不能为空,格式应为yyyyMM;", groups = {MonthIdShowGroup.class}) private String monthId; /** @@ -39,10 +69,18 @@ public class ScreenCollFormDTO implements Serializable { /** * 数据集合 */ + @Valid + @NotEmpty(message = "dataList不能为空", groups = DataListShowGroup.class) private List dataList; @Override public String toString() { return JSON.toJSONString(this); } + + /** + * 当前客户id + */ + @NotBlank(message = "customerId不能为空;", groups = CustomerIdShowGroup.class) + private String customerId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java index d81ae5cf9e..0d52614cfd 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -14,23 +17,30 @@ import java.io.Serializable; public class AnCommunityProjectProfileFormDTO implements Serializable { private static final long serialVersionUID = 1466172677051250092L; + public interface DefaultShowGroup extends CustomerClientShowGroup { + } + /** * 数据更新至: yyyy|yyyyMM|yyyyMMdd,项目根据实际情况赋值 */ + @NotBlank(message = "dataEndTime不能为空;", groups = DefaultShowGroup.class) private String dataEndTime; /** * 社区id */ + @NotBlank(message = "orgId不能为空;", groups = DefaultShowGroup.class) private String orgId; /** * 项目数 */ + @NotNull(message = "projectTotal不能为空;", groups = DefaultShowGroup.class) private Integer projectTotal; /** * 等级 */ + @NotBlank(message = "level不能为空;", groups = DefaultShowGroup.class) private String level; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java index adcb9f63b2..ff3727625b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.math.BigDecimal; @@ -12,51 +15,63 @@ import java.math.BigDecimal; * @since v1.0.0 2020-10-09 */ @Data -public class AnGrassRootsGovernMonthlyFormDTO implements Serializable { +public class AnGrassRootsGovernMonthlyFormDTO implements Serializable { private static final long serialVersionUID = -6947401956711903753L; + public interface DefaultShowGroup extends CustomerClientShowGroup { + } + /** * 网格,街道或社区id */ + @NotBlank(message = "orgId不能为空;", groups = DefaultShowGroup.class) private String orgId; /** * 网格,街道名称或者社区名称 */ + @NotBlank(message = "orgName不能为空;", groups = DefaultShowGroup.class) private String orgName; /** * 网格:grid;组织:agency */ + @NotBlank(message = "orgType不能为空,网格:grid;组织:agency;", groups = DefaultShowGroup.class) private String orgType; /** * org_id的上一级id */ + @NotBlank(message = "pid不能为空;", groups = DefaultShowGroup.class) private String pid; /** * 参与项目数 */ + @NotNull(message = "partiProjectTotal不能为空;", groups = DefaultShowGroup.class) private Integer partiProjectTotal; /** * 办结项目数 */ + @NotNull(message = "closedProjectTotal不能为空;", groups = DefaultShowGroup.class) private Integer closedProjectTotal; /** * 项目响应度 存储的是%前面的数 */ + @NotNull(message = "projectResponseRatio不能为空;", groups = DefaultShowGroup.class) private BigDecimal projectResponseRatio; /** * 项目满意率,存储的是%前面的数 */ + @NotNull(message = "projectSatisRatio不能为空;", groups = DefaultShowGroup.class) private BigDecimal projectSatisRatio; /** * 办结率 for 社区 */ + @NotNull(message = "closedProjectRatio不能为空;", groups = DefaultShowGroup.class) private BigDecimal closedProjectRatio; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java index 70242f1ad3..5ca82e599e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -13,39 +16,49 @@ import java.io.Serializable; @Data public class AnGrassRootsOrgMonthlyFormDTO implements Serializable { private static final long serialVersionUID = -7389300512268641307L; + + public interface DefaultShowGroup extends CustomerClientShowGroup {} + /** * 网格id或者组织(街道或社区)id */ + @NotBlank(message = "orgId不能为空;", groups = DefaultShowGroup.class) private String orgId; /** * 组织名称OR网格名称 */ + @NotBlank(message = "orgName不能为空;", groups = DefaultShowGroup.class) private String orgName; /** * 网格:grid; 组织:agency */ + @NotBlank(message = "orgType不能为空;", groups = DefaultShowGroup.class) private String orgType; /** * org_id的上一级id */ + @NotBlank(message = "pid不能为空;", groups = DefaultShowGroup.class) private String pid; /** * 党群数 */ + @NotNull(message = "groupTotal不能为空;", groups = DefaultShowGroup.class) private Integer groupTotal; /** * 议题数 */ + @NotNull(message = "issueTotal不能为空;", groups = DefaultShowGroup.class) private Integer issueTotal; /** * 项目数 */ + @NotNull(message = "projectTotal不能为空;", groups = DefaultShowGroup.class) private Integer projectTotal; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java index b889e54661..c558760bf4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java @@ -1,7 +1,11 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -13,60 +17,73 @@ import java.io.Serializable; @Data public class AnGrassRootsPmRankFormDTO implements Serializable { private static final long serialVersionUID = 3642729389245262928L; + public interface DefaultShowGroup extends CustomerClientShowGroup {} /** - * 月份Id + * 月份Id */ + @NotBlank(message = "monthId不能为空;", groups = DefaultShowGroup.class) + @Length(min = 6, max = 6, message = "monthId不能为空,格式应为yyyyMM;", groups = {DefaultShowGroup.class}) private String monthId; /** * 用户id */ + @NotBlank(message = "userId不能为空;", groups = DefaultShowGroup.class) private String userId; /** * 姓名 */ + @NotBlank(message = "userName不能为空;", groups = DefaultShowGroup.class) private String userName; /** * 所属支部id */ + @NotBlank(message = "branchId不能为空;", groups = DefaultShowGroup.class) private String branchId; /** * 所属支部名称 */ + @NotBlank(message = "branchName不能为空;", groups = DefaultShowGroup.class) private String branchName; /** * 所属社区id */ + @NotBlank(message = "communityId不能为空;", groups = DefaultShowGroup.class) private String communityId; /** * 所属社区名称 */ + @NotBlank(message = "communityName不能为空;", groups = DefaultShowGroup.class) private String communityName; /** * 群成员数 */ + @NotNull(message = "groupMemberTotal不能为空;",groups =DefaultShowGroup.class ) private Integer groupMemberTotal; /** * 话题数 */ + @NotNull(message = "topicTotal不能为空;",groups =DefaultShowGroup.class ) private Integer topicTotal; /** * 参与人次 */ + @NotNull(message = "partiUserTotal不能为空;",groups =DefaultShowGroup.class ) private Integer partiUserTotal; /** * 议题数 */ + @NotNull(message = "issueTotal不能为空;",groups =DefaultShowGroup.class ) private Integer issueTotal; /** diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java index 4adb2ee168..1f1bcb4315 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -14,44 +17,54 @@ import java.io.Serializable; public class AnGrassRootsPmTotalMonthlyFormDTO implements Serializable { private static final long serialVersionUID = 8675347783888892404L; + public interface DefaultShowGroup extends CustomerClientShowGroup {} + /** * 网格id或者组织(街道或社区)id */ + @NotBlank(message = "orgId不能为空;", groups = DefaultShowGroup.class) private String orgId; /** * 组织名称OR网格名称 */ + @NotBlank(message = "orgName不能为空;", groups = DefaultShowGroup.class) private String orgName; /** * 网格:grid;组织:agency */ + @NotBlank(message = "orgType不能为空;", groups = DefaultShowGroup.class) private String orgType; /** * org_id的上一级id */ + @NotBlank(message = "pid不能为空;", groups = DefaultShowGroup.class) private String pid; /** * 群成员数 */ + @NotNull(message = "groupMemberTotal不能为空;", groups = DefaultShowGroup.class) private Integer groupMemberTotal; /** * 话题数 */ + @NotNull(message = "topicTotal不能为空;", groups = DefaultShowGroup.class) private Integer topicTotal; /** * 话题参与人次 */ + @NotNull(message = "topicPartiUserTotal不能为空;", groups = DefaultShowGroup.class) private Integer topicPartiUserTotal; /** * 议题数 */ + @NotNull(message = "issueTotal不能为空;", groups = DefaultShowGroup.class) private Integer issueTotal; } diff --git a/epmet-module/data-statistical/data-statistical-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..2ef49407e4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java @@ -60,7 +60,7 @@ public class CustomerAgencyFormDTO implements Serializable { private String level; /** - * 行政地区编码 + * 行政地区编码,孔村、榆山、锦水以及孔村要有值 */ private String areaCode; @@ -73,4 +73,10 @@ public class CustomerAgencyFormDTO implements Serializable { * 是否显示 */ private String isDisplay; + + /** + * v2升级:当前组织的上级行政地区编码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/Dockerfile b/epmet-module/data-statistical/data-statistical-server/Dockerfile index 55d058c4b8..e029544f66 100644 --- a/epmet-module/data-statistical/data-statistical-server/Dockerfile +++ b/epmet-module/data-statistical/data-statistical-server/Dockerfile @@ -8,5 +8,4 @@ COPY ./target/*.jar ./data-stats.jar EXPOSE 8108 -#ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] ENTRYPOINT ["sh","-c","exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml index 02c33e0f5a..670c9b1d5c 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.69 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/data-statistical-server:0.3.81 ports: - "8108:8108" network_mode: host # 使用现有网络 @@ -15,4 +15,4 @@ services: resources: limits: cpus: '0.1' - memory: 1100M \ No newline at end of file + memory: 1100M diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 4e899ed96e..5917c6bda9 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.69 + 0.3.81 data-statistical com.epmet diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java index 0766df597b..5b862b66ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java @@ -1,11 +1,10 @@ package com.epmet.controller; -import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.AnScreenCollService; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -23,79 +22,116 @@ public class AnScreenCollController { private AnScreenCollService screenCollService; /** - * @Description 安宁大屏数据采集 - 基层党员-各类总数 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329494 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 基层党员-各类总数 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329494 * @author wangc * @date 2020.10.09 17:20 */ @PostMapping("pmtotal") - public Result pmTotal(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); - screenCollService.pmTotal(formDTO,customerId); + public Result pmTotal(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.MonthIdShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnGrassRootsPmTotalMonthlyFormDTO.DefaultShowGroup.class); + }); + screenCollService.pmTotal(formDTO); return new Result(); } /** - * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329483 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 按月 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329483 * @author wangc * @date 2020.10.09 17:19 */ @PostMapping("pmrank") - public Result pmRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if (StringUtils.isBlank(formDTO.getMonthId())){ - throw new ValidateException("月份Id不能为空"); - } - screenCollService.pmRank(formDTO,customerId); + public Result pmRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.MonthIdShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnGrassRootsPmRankFormDTO.DefaultShowGroup.class); + }); + screenCollService.pmRank(formDTO); return new Result(); } /** - * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329498 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329498 * @author wangc * @date 2020.10.09 17:22 */ @PostMapping("grassrootsorg") - public Result grassrootsOrg(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); - screenCollService.grassrootsOrg(formDTO,customerId); + public Result grassrootsOrg(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.MonthIdShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnGrassRootsOrgMonthlyFormDTO.DefaultShowGroup.class); + }); + screenCollService.grassrootsOrg(formDTO); return new Result(); } /** - * @Description 安宁大屏数据采集 - 基层治理-各类数 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329499 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 基层治理-各类数 按月 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329499 * @author wangc * @date 2020.10.09 17:23 */ @PostMapping("grassrootsgovern") - public Result grassrootsGovern(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); - screenCollService.grassrootsGovern(formDTO,customerId); + public Result grassrootsGovern(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.MonthIdShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnGrassRootsGovernMonthlyFormDTO.DefaultShowGroup.class); + }); + screenCollService.grassrootsGovern(formDTO); return new Result(); } /** - * @Description 安宁大屏数据采集 - 中央区-项目概要 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329502 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 中央区-项目概要 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329502 * @author wangc * @date 2020.10.09 16:41 */ @PostMapping("projectfile") - public Result projectFile(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); - screenCollService.communityProjectProfile(formDTO,customerId); + public Result projectFile(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnCommunityProjectProfileFormDTO.DefaultShowGroup.class); + }); + screenCollService.communityProjectProfile(formDTO); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index a22a573819..4bb409b6eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -37,6 +37,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; @@ -47,7 +51,6 @@ import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; import java.time.LocalDateTime; import java.util.List; -import java.util.Map; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; @@ -177,8 +180,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(); } @@ -486,17 +489,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(){ @@ -664,12 +663,21 @@ public class DemoController { @Autowired private PublicPartiTotalDataExtractService publicPartiTotalDataExtractService; @PostMapping("insertScreenPioneerData") - public Result insertScreenPioneerData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId) { + public Result insertScreenPioneerData(@RequestParam("customerId") String customerId, @RequestParam("dateId") String dateId,@RequestParam("type") String type) { if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { - pioneerDataExtractService.extractGridPioneerData(customerId, dateId); - pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId); - pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId); - } else { + if ("grid".equals(type)) { + pioneerDataExtractService.extractGridPioneerData(customerId, dateId); + } else if ("community".equals(type)) { + pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId); + } else if ("exceptcommunity".equals(type)) { + pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId); + } else { + pioneerDataExtractService.extractGridPioneerData(customerId, dateId); + pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId); + pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId); + } + } + /*else { QueryWrapper customerEntityQueryWrapper = new QueryWrapper<>(); List customerEntityList = dimCustomerDao.selectList(customerEntityQueryWrapper); for (DimCustomerEntity customerEntity : customerEntityList) { @@ -677,8 +685,8 @@ public class DemoController { pioneerDataExtractService.extractCommunityPioneerData(customerEntity.getId(), "20200926"); pioneerDataExtractService.extractExceptCommunityPioneerData(customerEntity.getId(), "20200926"); } - } - return new Result(); + }*/ + return new Result().ok("调用成功"); } @PostMapping("extractPublicPartiTotalData") @@ -740,4 +748,84 @@ 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(); + } + + + @PostMapping("event-all-daily") + public Result eventAllDaily(@RequestParam("customerId") String customerId, + @RequestParam("dateId") String dateId) { + screenProjectGridDailyService.extractionProjectGridDaily(customerId, dateId); + screenProjectOrgDailyService.extractionProjectOrgDaily(customerId, dateId); + return new Result(); + } + + @PostMapping("event-all-monthly") + public Result eventAllMonthly(@RequestParam("customerId") String customerId, + @RequestParam("startMonthId") String startMonthId, + @RequestParam("endMonthId") String endMonthId) { + List monthIds = DateUtils.getMonthBetween(startMonthId,endMonthId); + for(String monthId:monthIds){ + screenProjectQuantityGridMonthlyService.extractionProjectGridMonthly(customerId, monthId); + screenProjectQuantityOrgMonthlyService.extractionProjectOrgMonthly(customerId, monthId); + } + return new Result(); + } + + /*@Autowired + private ScreenGrassrootsGovernDataAbsorptionService ndddYhjfService; + + @PostMapping("diff") + public Result diff(@RequestBody ScreenCentralZoneDataFormDTO param){ + ndddYhjfService.difficultyDataHub(param); + return new Result(); + }*/ + + @Autowired + private ScreenProjectSettleService screenProjectSettleService; + @PostMapping("project-test") + public Result project(@RequestBody ScreenCentralZoneDataFormDTO param){ + screenProjectSettleService.extractScreenData(param); + return new Result(); + } + public static void main(String[] args) { + List monthIds = DateUtils.getMonthBetween("202001","202012"); + for(String monthId:monthIds){ + System.out.println(monthId); + } + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java index 2abcd81edd..9542bdc580 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java @@ -1,5 +1,7 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.extract.form.ExtractOriginFormDTO; @@ -11,6 +13,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * 原始数据清洗 @@ -114,7 +118,15 @@ public class FactOriginExtractController { **/ @PostMapping("groupdatacleaning") public Result groupDataCleaning(@RequestBody ExtractOriginFormDTO param) { - groupExtractService.extractGroupData(param); + if(StringUtils.isNotBlank(param.getStartDate()) && StringUtils.isNotBlank(param.getEndDate())){ + List finalDaysBetween = DateUtils.getDaysBetween(param.getStartDate(), param.getEndDate()); + ExtractOriginFormDTO paramNew = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + paramNew.setDateId(dateDimId); + groupExtractService.extractGroupData(paramNew); + } + }else groupExtractService.extractGroupData(param); 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..9f2a4b06cd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -10,6 +10,8 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.constant.CalculateStatus; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.CustomerSubInfoDTO; +import com.epmet.dto.indexcal.IndexStatisticsFormDTO; import com.epmet.model.CalculateFlagModel; import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; @@ -84,6 +86,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); } }); @@ -102,6 +107,7 @@ public class IndexCalculateController { @PostMapping("all") public Result indexCalculate(@RequestHeader("CustomerId") String customerId, @RequestBody CalculateCommonFormDTO formDTO) { formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO); indexCalculate(formDTO); return new Result().ok(true); } @@ -141,7 +147,7 @@ public class IndexCalculateController { long start = System.currentTimeMillis(); Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); if (aBoolean) { - log.error("客户Id:{},全部指标计算完成,结果:{},总耗时:{}秒", formDTO.getCustomerId(), aBoolean, (System.currentTimeMillis() - start) / 1000); + log.error("客户Id:{},monthId:{},全部指标计算完成,结果:{},总耗时:{}秒", formDTO.getCustomerId(), formDTO.getMonthId(), aBoolean, (System.currentTimeMillis() - start) / 1000); } redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId())); @@ -197,7 +203,7 @@ public class IndexCalculateController { long start = System.currentTimeMillis(); try { Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); - HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + formDTO.getCustomerId() + ",calculateAll全部指标计算完成,是否成功:" + aBoolean + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒"); + HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + formDTO.getCustomerId() + ";monthId:" + formDTO.getMonthId() + ",calculateAll全部指标计算完成,是否成功:" + aBoolean + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒"); if (aBoolean) { return new Result().ok(true); } @@ -332,4 +338,29 @@ public class IndexCalculateController { factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); }*/ + + @PostMapping("indexstatistics") + public Result indexStatistics(@RequestBody IndexStatisticsFormDTO formDTO){ + indexCalculateService.indexStatistics(formDTO); + return new Result(); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description + * @Date 2021/3/4 18:52 + **/ + @PostMapping("toscreenindexdata") + public Result toScreenIndexData(CalculateCommonFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + indexCalculateService.toScreenIndexData(formDTO); + return new Result(); + } + + @PostMapping("getCustomerSubInfo") + public Result getCustomerSubInfo(@RequestParam("customerId") String customerId) { + return new Result().ok(indexCalculateService.getCustomerSubInfo(customerId)); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java index b64d7855a0..34269ee507 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java @@ -1,6 +1,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.KcScreenCollService; @@ -35,7 +36,9 @@ public class KcScreenCollController { @PostMapping("homepage/platformsummary") public Result platFormSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertPlatFormSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertPlatFormSummary(formDTO); return new Result(); } @@ -54,7 +57,9 @@ public class KcScreenCollController { @PostMapping("issue/summary") public Result issueSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertIssueSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertIssueSummary(formDTO); return new Result(); } @@ -73,7 +78,9 @@ public class KcScreenCollController { @PostMapping("issue/trend") public Result issueTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertIssueTrend(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertIssueTrend(formDTO); return new Result(); } @@ -92,7 +99,9 @@ public class KcScreenCollController { @PostMapping("user/summary") public Result userSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertUserSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertUserSummary(formDTO); return new Result(); } @@ -111,7 +120,9 @@ public class KcScreenCollController { @PostMapping("volunteer/heartrank") public Result volunteerHeartRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertVolunteerHeartRank(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertVolunteerHeartRank(formDTO); return new Result(); } @@ -130,7 +141,9 @@ public class KcScreenCollController { @PostMapping("user/userheartrank") public Result userHeartRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertUserHeartRank(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertUserHeartRank(formDTO); return new Result(); } @@ -149,7 +162,9 @@ public class KcScreenCollController { @PostMapping("act/summary") public Result actSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertActSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertActSummary(formDTO); return new Result(); } @@ -168,7 +183,9 @@ public class KcScreenCollController { @PostMapping("act/trend") public Result actTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertActTrend(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertActTrend(formDTO); return new Result(); } @@ -187,7 +204,9 @@ public class KcScreenCollController { @PostMapping("act/volunteersummary") public Result volunteerSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertVolunteerSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertVolunteerSummary(formDTO); return new Result(); } @@ -206,7 +225,9 @@ public class KcScreenCollController { @PostMapping("project/summary") public Result projectSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertProjectSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertProjectSummary(formDTO); return new Result(); } @@ -225,7 +246,9 @@ public class KcScreenCollController { @PostMapping("project/categorysummary") public Result categorySummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertCategorySummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertCategorySummary(formDTO); return new Result(); } @@ -244,7 +267,9 @@ public class KcScreenCollController { @PostMapping("project/satisanalysis") public Result projectSatisanalysis(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertProjectSatisanalysis(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertProjectSatisanalysis(formDTO); return new Result(); } @@ -263,7 +288,9 @@ public class KcScreenCollController { @PostMapping("news/summary") public Result newsSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertNewsSummary(formDTO); return new Result(); } @@ -282,7 +309,9 @@ public class KcScreenCollController { @PostMapping("news/trend") public Result newsTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsTrend(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertNewsTrend(formDTO); return new Result(); } @@ -301,7 +330,9 @@ public class KcScreenCollController { @PostMapping("news/hotrank") public Result newsHotRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsHotRank(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertNewsHotRank(formDTO); return new Result(); } @@ -320,7 +351,9 @@ public class KcScreenCollController { @PostMapping("news/categoryanalysis") public Result newsCategoryAnalysis(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsCategoryAnalysis(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertNewsCategoryAnalysis(formDTO); return new Result(); } @@ -339,7 +372,9 @@ public class KcScreenCollController { @PostMapping("group/summary") public Result groupSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertGroupSummary(formDTO); return new Result(); } @@ -358,7 +393,9 @@ public class KcScreenCollController { @PostMapping("group/detail") public Result groupDetail(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupDetail(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertGroupDetail(formDTO); return new Result(); } @@ -377,7 +414,9 @@ public class KcScreenCollController { @PostMapping("group/topictrend") public Result groupTopicTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupTopicTrend(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertGroupTopicTrend(formDTO); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java new file mode 100644 index 0000000000..0af70355e9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java @@ -0,0 +1,155 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.screen.*; +import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; +import com.epmet.dto.screen.form.ScreenProjectProcessFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.service.evaluationindex.screen.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +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) { + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectQuantityGridMonthlyService.collect(param); + return new Result(); + } + + /** + * @author wangc + * @description 【事件/项目分析】组织内月度数量统计 + **/ + @RequestMapping("quantity-org-monthly") + public Result quantityOrgMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectQuantityOrgMonthlyService.collect(param); + return new Result(); + } + + /** + * @author wangc + * @description 【事件/项目分析】网格内事件 + **/ + @RequestMapping("project-grid-daily") + public Result projectGridDaily(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectGridDailyService.collect(param); + return new Result(); + } + + /** + * @author wangc + * @description 【事件/项目分析】组织内事件 + **/ + @RequestMapping("project-org-daily") + public Result projectOrgDaily(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectOrgDailyService.collect(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) { + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectCategoryGridDailyService.collect(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) { + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectCategoryOrgDailyService.collect(param); + return new Result(); + } + //上述两个接口可以有采集接口方便灌假数。后面项目分类统计两个方案A:从项目信息中分析计算到大屏表; B:下面三个子客户(榆山街道、孔村街道、锦水街道)单独上报;子客户根据area_code计算 + + /** + * @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){ + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectDataService.collect(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){ + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectProcessService.collect(param); + return new Result(); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/OfsController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/OfsController.java new file mode 100644 index 0000000000..33e7c281aa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/OfsController.java @@ -0,0 +1,70 @@ +package com.epmet.controller.plugins; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.plugins.BidFormDTO; +import com.epmet.dto.plugins.ContractFormDTO; +import com.epmet.dto.plugins.OneListFormDTO; +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】一张清单 isFirst=true时,根据customerId先删除后增加 + * @Date 2021/1/22 10:19 + **/ + @PostMapping("onelist-daily") + public Result collOneList(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + ofsService.collOneList(formDTO); + return new Result(); + } + + /** + * @param customerId + * @param formDTO + * @author yinzuomei + * @description 【146】合同监管 isFirst=true时,根据customerId先删除后增加 + * @Date 2021/1/22 10:42 + **/ + @PostMapping("contract-daily") + public Result collContract(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + ofsService.collContract(formDTO); + return new Result(); + } + + /** + * @param customerId + * @param formDTO + * @author yinzuomei + * @description 【146】竞标管理 isFirst=true时,根据customerId先删除后增加 + * @Date 2021/1/22 10:53 + **/ + @PostMapping("bid-daily") + public Result collBid(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + ofsService.collBid(formDTO); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java new file mode 100644 index 0000000000..8bbce3e324 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java @@ -0,0 +1,81 @@ +package com.epmet.controller.plugins; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.plugins.ScreenCustomerWorkRecordDictDTO; +import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +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.springframework.beans.factory.annotation.Autowired; +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){ + data.setCustomerId(customerId); + ValidatorUtils.validateEntity(data, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + dictService.collect(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){ + data.setCustomerId(customerId); + ValidatorUtils.validateEntity(data, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + screenWorkRecordOrgMonthlyService.collect(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){ + data.setCustomerId(customerId); + ValidatorUtils.validateEntity(data, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + screenWorkRecordOrgDailyService.collectOrgDaily(data); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/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..fabee946e7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerRelationDao.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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; + +import java.util.List; + +/** + * 客户关系表(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); + + List selectListByPids(String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java index 12e6151f3f..911d8b7993 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java @@ -18,13 +18,11 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; -import com.epmet.dto.extract.result.OrgStatisticsResultDTO; -import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.PartyCreateGroupCountResultDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; @@ -164,12 +162,11 @@ public interface FactOriginGroupMainDailyDao extends BaseDao selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridIds") List gridIds); + List selectPartyCreateGroupInfo(@Param("customerId") String customerId, @Param("gridIds") List gridIds); /** * desc: 获取所有网格的组中成员人数 去重 @@ -202,4 +199,4 @@ public interface FactOriginGroupMainDailyDao extends BaseDao selectOrgGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level") String level); -} \ No newline at end of file +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java index 9dd9089d97..7154f5997e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java @@ -108,11 +108,26 @@ public interface FactOriginIssueLogDailyDao extends BaseDao * @author LiuJanJun * @date 2020/9/27 1:58 下午 */ List getVoteCount(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("groupField") String groupField); + + /** + * @param customerId + * @param gridId + * @param agencyPath + * @param isParty + * @return int + * @author yinzuomei + * @description 大屏:先锋模范:计算 平台参与议事总人数、平台参与议事党员数 + * @Date 2021/1/12 15:08 + **/ + int selectPlatJoinUserTotal(@Param("customerId") String customerId, + @Param("gridId") String gridId, + @Param("communityId") String communityId, + @Param("agencyPath") String agencyPath, + @Param("isParty") String isParty); } \ 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..086c2e4b61 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -23,6 +23,8 @@ 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.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; @@ -217,4 +219,74 @@ 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); + + /** + * @Description 初始化screen_project_data数据 + * 如果是dateId不为空,则查询前一天的数据 + * 否则全查(适用于首次初始化的场景) + * + * 这是只查询指定天新增的项目,对于需要更新状态的项目,对历史数据(流转中的项目)进行遍历查询 + * @param customerId + * @param dateId + * @return java.util.List + * @author wangc + * @date 2021.03.04 22:56 + */ + List initNewScreenProjectData(@Param("customerId")String customerId,@Param("dateId") String dateId,@Param("dataEndTime")String dataEndTime); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java index d107e0e2fe..5f3bf2ae42 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.form.CostDayFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -63,7 +64,7 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao list); + void deleteByProjectIds(@Param("list") List list,@Param("customerId") String customerId); /** * @Description 批量插入 @@ -83,4 +84,13 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao */ List selectDeptHandle(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @Description + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.05 15:12 + */ + List selectProjectNodeStartStopTime(@Param("list")List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java index 3046923a98..2593996a1b 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,17 @@ 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("monthId")String monthId, @Param("dataType")String dataType,@Param("customerId")String customerId); + List selectAgencyScoreInfoExistsSubSelf(@Param("areaCode") String areaCode, @Param("monthId")String monthId, @Param("dataType")String dataType,@Param("customerId")String customerId); + /** * @Description 区下级街道得分平均值 * @param customerId @@ -71,6 +82,18 @@ 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("areaCode")String areaCode); + List selectAgencyScoreAvgByOrgIds(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("orgIds")List orgIds); + /** * 根据入参查询 区/街道相关分数表 记录 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java index 95d0f60e84..104f53bb42 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")String customerId); + /** * 根据入参查询 查询社区相关信息 * @param customerId @@ -79,6 +88,17 @@ 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); + List selectSubCommAvgScoreExistSubNotSelf(@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..cc35dbb875 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptScoreDao.java @@ -68,6 +68,17 @@ 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); + List selectGovernDeptScoreAvgExistsSubNotSelf(@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..24f48eef4f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java @@ -67,6 +67,24 @@ 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); + List> selectCommunityGovernAbilityExistsSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode,@Param("level")String level); + /** + * @Description 孔村单独查询 + * @Param monthId + * @Param areaCode + * @author zxc + * @date 2021/3/11 下午5:21 + */ + List> selectCommunityGovernAbilityIsKongCun(@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..dd3774be45 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java @@ -78,6 +78,27 @@ 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> selectPublishArticleCountMapExistSubStreet(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + List> selectPublishArticleCountMapExistSubNotSelf(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + + /** + * @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); + List> selectPublishArticleCountMapbyAreaCodeNotSelf(@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..28917bf72b 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,17 @@ 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); + List> selectActivityCountMapIsKongCun(@Param("monthId")String monthId,@Param("areaCode")String areaCode); + List> selectActivityCountMapExistsSubNotSelf(@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/ScreenCpcBaseDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java index 716d9b2cfb..f33cd46393 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java @@ -69,12 +69,11 @@ public interface ScreenCpcBaseDataDao extends BaseDao { /** * @Description 删除旧的党员基本信息 * @param customerId - * @param dateId * @param orgIds * @author zxc * @date 2020/9/22 3:28 下午 */ - Integer deleteOldPartyBaseInfo(@Param("customerId") String customerId,@Param("dateId") String dateId,@Param("orgIds")List orgIds); + Integer deleteOldPartyBaseInfo(@Param("customerId") String customerId,@Param("orgIds")List orgIds); /** * @Description 查询党员信息【根据agencyId来查】 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..6aa48bf445 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 @@ -90,6 +95,8 @@ 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 +186,22 @@ 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); + + List selectAgencyByAreaCode(String areaCode); + + /** + * @Description 根据areaCode查询下级组织 + * @Param areaCode + * @author zxc + * @date 2021/3/9 上午9:41 + */ + List selectAgencyByParentAreaCode(@Param("areaCode") String areaCode); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/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..1cdb4a1e8d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.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.project.result.ProjectExceedParamsResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +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); + + int deleteByProjectTimeAndCustomerId(@Param("customerId") String customerId,@Param("dateId") String dateId); + + int checkIfExisted(@Param("customerId") String customerId); + + List selectPending(ScreenProjectDataDTO param); + + void insertBatch(@Param("list") List list); + + void updateBatch(@Param("list") List list,@Param("dateId") String dateId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/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..4904f32724 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.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.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.ScreenProjectImgDataDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 中央区-项目数据图片 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Mapper +public interface ScreenProjectImgDataDao extends BaseDao { + + void deleteByProjectIds(@Param("list") List list); + + void insertBatch(@Param("list") List list); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/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..4a84a02c90 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessAttachmentDao.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.ScreenProjectProcessAttachmentDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity; +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 ScreenProjectProcessAttachmentDao extends BaseDao { + + void deleteByProcessId(@Param("list") List list); + + void insertBatch(@Param("list")List list); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java new file mode 100644 index 0000000000..f9638e9c4f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.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.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.ScreenProjectProcessDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 中央区-项目数据项目处理进展表 + * + * @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); + + int deleteByProcessTimeAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + int countByCustomerId(@Param("customerId") String customerId); + + void insertBatch(@Param("list") List list); +} 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/issue/StatsIssueDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java index 190353059f..875efb82e1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java @@ -5,15 +5,13 @@ import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO; import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; -import com.epmet.dto.issue.IssueAgencyDTO; -import com.epmet.dto.issue.IssueDTO; -import com.epmet.dto.issue.IssueGridDTO; -import com.epmet.dto.issue.IssueProjectDTO; +import com.epmet.dto.issue.*; import com.epmet.entity.issue.IssueEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Set; @Mapper public interface StatsIssueDao extends BaseDao { @@ -181,4 +179,6 @@ public interface StatsIssueDao extends BaseDao { * @date 2020/9/27 1:22 下午 */ List selectIssueVoteStatis(@Param("customerId") String customerId, @Param("dateId") String dateId); + + List selectCategory(@Param("customerId") String customerId, @Param("ids") Set set); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java index eb02051e91..05a85d3d7c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java @@ -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,14 @@ 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); + + CustomerAgencyEntity getRootAgencyInfo(String customerId); } 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/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index 3d4526a0fe..9d64b829da 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -20,7 +20,10 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectCategoryDTO; import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -103,5 +106,31 @@ public interface ProjectDao extends BaseDao { */ String selectParameterValueByKey(@Param("customerId") String customerId); + /** + * @Description 查找客户项目超期参数 + * + * @param customerId + * @return java.util.List + * @author wangc + * @date 2021.03.05 17:52 + */ + List selectProjectExceedParams(@Param("customerId") String customerId); + /** + * @Description 批量查询项目信息 + * @param ids + * @return java.util.List + * @author wangc + * @date 2021.03.08 10:32 + */ + List batchSelectProjectInfo(@Param("ids")List ids); + + /** + * @Description 查询项目的分类信息 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 23:44 + */ + List selectProjectCategory(@Param("list")List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java index 37e130e678..f9647a4fe0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java @@ -18,12 +18,14 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ProjectProcessDTO; import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.ProcessInfoDTO; -import com.epmet.dto.project.ProjectOrgRelationDTO; import com.epmet.dto.project.result.ProjectLatestOperationResultDTO; import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.dto.screen.ScreenProjectProcessDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; import org.apache.ibatis.annotations.Mapper; @@ -153,4 +155,28 @@ public interface ProjectProcessDao extends BaseDao { * @date 2020.09.28 14:45 */ List selectLatestOperation(@Param("list") List list,@Param("customerId") String customerId); + + /** + * @Description 查找指定日期结案的项目 + * @param customerId + * @param dateId + * @return java.util.List + * @author wangc + * @date 2021.03.09 10:49 + */ + List selectClosedProjectOnAppointedDay(@Param("customerId") String customerId, @Param("dateId") String dateId); + + List selectClosedProjectByProjectIds(@Param("list")List list); + /** + * @Description 统计新增项目节点以及被流转到的指向部门 + * @param customerId + * @param dateId + * @param dataEndTime + * @return java.util.List + * @author wangc + * @date 2021.03.09 16:25 + */ + List selectProjectProcessAndDirection(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("dataEndTime")String dataEndTime ); + + List selectProcessAttachment(@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/topic/TopicDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java index 1d9a6125bc..16a76f30ee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java @@ -8,6 +8,8 @@ package com.epmet.dao.topic; */ import com.epmet.dto.group.result.TopicContentResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.dto.extract.result.TopicInfoResultDTO; @@ -117,4 +119,23 @@ public interface TopicDao { * @date 2020.09.28 16:28 */ List selectTopicContent(@Param("list") List list); + + /** + * @Description 根据话题Id查询大屏项目的相关信息 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:13 + */ + List selectScreenProjectData(@Param("list") List list); + + /** + * @Description 初始化指定项目的图片 + * @param customerId + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.09 14:19 + */ + List initNewScreenProjectImgData(@Param("customerId")String customerId,@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java index b9162c30a2..411452caeb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -2,6 +2,7 @@ package com.epmet.dao.user; import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.result.UserPartyResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -131,4 +132,14 @@ public interface UserDao { * @date 2020.09.25 13:54 **/ List selectRegisteredUserByCustomerId(@Param("customerId") String customerId); + + /** + * @Description 获取大屏项目相关信息 联系人 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:16 + */ + List selectScreenProjectData(@Param("list") List list); } + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/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..c063015f17 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyImgDataEntity.java @@ -1,10 +1,13 @@ 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; import lombok.Data; import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; /** @@ -17,6 +20,7 @@ import lombok.EqualsAndHashCode; @EqualsAndHashCode(callSuper=false) @TableName("screen_difficulty_img_data") @AllArgsConstructor +@NoArgsConstructor public class ScreenDifficultyImgDataEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; @@ -26,4 +30,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/ScreenPioneerDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java index c03d32f1df..2100e779bb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenPioneerDataEntity.java @@ -67,7 +67,12 @@ public class ScreenPioneerDataEntity extends BaseEpmetEntity { */ private Integer issueTotal; - /** + /** + * 01.12新增:PLAT_ISSUE_TOTAL 平台参与议事总数 + */ + private Integer platIssueTotal; + + /** * 党员参与议事占比 */ private BigDecimal issueRatio; @@ -77,6 +82,11 @@ public class ScreenPioneerDataEntity extends BaseEpmetEntity { */ private Integer topicTotal; + /** + * 01.12新增:PLAT_TOPIC_TOTAL 当前组织维度,话题总数,TOPIC_RATIO的分母 + */ + private Integer platTopicTotal; + /** * 党员发布话题占比 */ @@ -87,6 +97,11 @@ public class ScreenPioneerDataEntity extends BaseEpmetEntity { */ private Integer publishIssueTotal; + /** + * 01.12新增:PLAT_PUBLISH_ISSUE_TOTAL 当前组织维度,发布议题总数,PUBLISH_ISSUE_RATIO的分母,SHIFT_PROJECT_RATIO的分母 + */ + private Integer platPublishIssueTotal; + /** * 党员发布议题占比 */ @@ -107,6 +122,10 @@ public class ScreenPioneerDataEntity extends BaseEpmetEntity { */ private Integer resolvedProjectTotal; + /** + * 01.12新增:PLAT_CLOSED_PROJECT_TOTAL 当前组织维度,所有结案项目数,RESOLVED_PROJECT_RATIO的分母 + */ + private Integer platClosedProjectTotal; /** * 解决项目总数占比 */ @@ -124,4 +143,20 @@ public class ScreenPioneerDataEntity extends BaseEpmetEntity { private String pid; private String agencyPids; private String agencyPath; + + /** + * PLAT_JOIN_USER_TOTAL 平台参与议事总人数 + */ + private Integer platJoinUserTotal; + + /** + * PLAT_JOIN_PARTY_TOTAL 平台参与议事党员数 + */ + private Integer platJoinPartyTotal; + + /** + * PLAT_JOIN PARTY_RATIO 平台参与议事的党员占比 + */ + private BigDecimal platJoinPartyRatio; + } 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/Issue/IssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java index 239ad2d8b1..22201f81ab 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java @@ -11,6 +11,8 @@ import com.epmet.dto.issue.IssueProjectDTO; import com.epmet.entity.issue.IssueEntity; import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author zhaoqifeng @@ -172,4 +174,13 @@ public interface IssueService { * @date 2020/9/27 11:20 上午 */ List selectIssueVoteStatis(String customerId, String monthId); + + /** + * @Description 查找项目的分类名称 以-相连 + * @param param + * @return java.util.Map + * @author wangc + * @date 2021.03.09 00:23 + */ + Map getIntegratedProjectCategory(Map> param,String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java index e134358618..4ad4e58488 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java @@ -1,22 +1,24 @@ package com.epmet.service.Issue.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.issue.StatsIssueDao; import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO; import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; -import com.epmet.dto.issue.IssueAgencyDTO; -import com.epmet.dto.issue.IssueDTO; -import com.epmet.dto.issue.IssueGridDTO; -import com.epmet.dto.issue.IssueProjectDTO; +import com.epmet.dto.issue.*; import com.epmet.entity.issue.IssueEntity; import com.epmet.service.Issue.IssueService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author zhaoqifeng @@ -143,4 +145,19 @@ public class IssueServiceImpl implements IssueService { public List selectIssueVoteStatis(String customerId, String dateId) { return statsIssueDao.selectIssueVoteStatis(customerId, dateId); } + + @Override + public Map getIntegratedProjectCategory(Map> param,String customerId) { + Map map = new HashMap<>(); + param.forEach((projectId,categoryIds) -> { + List categories = statsIssueDao.selectCategory(customerId, categoryIds); + if(!CollectionUtils.isEmpty(categories)){ + StringBuilder str = new StringBuilder(); + categories.forEach(category -> {str.append(category.getCategoryName()).append("-");}); + map.put(projectId,str.substring(NumConstant.ZERO,str.length() - NumConstant.TWO)); + } + }); + + return map; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/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..f139c49bab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerRelationService.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.service.crm; + + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.indexcal.CustomerSubInfoDTO; +import com.epmet.entity.crm.CustomerRelationEntity; + +/** + * 客户关系表(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 customerId + * @author yinzuomei + * @description 查询每个客户的area_code、以及下一级客户列表 + * @Date 2021/1/14 16:22 + **/ + CustomerSubInfoDTO getCustomerSubInfo(String customerId); + + boolean haveSubCustomer(String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java new file mode 100644 index 0000000000..cab6ed0adc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerRelationServiceImpl.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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 lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 客户关系表(01.14 add) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-14 + */ +@Slf4j +@DataSource(DataSourceConstant.OPER_CRM) +@Service +public class CustomerRelationServiceImpl extends BaseServiceImpl implements CustomerRelationService { + + @Autowired + private DimCustomerService dimCustomerService; + /** + * @param customerId + * @return java.util.Map + * @author yinzuomei + * @description 查询每个客户的area_code、以及下一级客户列表 + * @Date 2021/1/14 16:22 + **/ + @Override + public CustomerSubInfoDTO getCustomerSubInfo(String customerId) { + CustomerSubInfoDTO customerSubInfoDTO = baseDao.selectCustomerSubInfo(customerId); + if (null != customerSubInfoDTO) { + DimCustomerDTO dimCustomerDTO = dimCustomerService.get(customerId); + customerSubInfoDTO.setCustomerName(dimCustomerDTO.getCustomerName()); + } + return customerSubInfoDTO; + } + + @Override + public boolean haveSubCustomer(String customerId) { + List list = baseDao.selectListByPids(customerId); + if (null == list || list.isEmpty()) { + return false; + } + return true; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java index c9a74e31b8..730acde2c8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java @@ -68,12 +68,11 @@ public interface FactOriginGroupMainDailyService extends BaseService selectPartyCreateGroupInfo(String customerId, String monthId, List gridIds); + List selectPartyCreateGroupInfo(String customerId, List gridIds); /** * desc: 获取客户下每个网格小组内的 去重人数 @@ -106,4 +105,4 @@ public interface FactOriginGroupMainDailyService extends BaseService */ List getOrgGroupCount(String customerId, String monthId, String level); -} \ 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/FactOriginIssueLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java index 591ff23f55..5bb46392f6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueLogDailyService.java @@ -65,4 +65,16 @@ public interface FactOriginIssueLogDailyService extends BaseService getVoteCount(String customerId, String monthId, String groupField); + + /** + * @return java.lang.Integer + * @param customerId + * @param gridId + * @param agencyPath + * @param isParty + * @author yinzuomei + * @description 计算 平台参与议事总人数、平台参与议事党员数 + * @Date 2021/1/12 15:02 + **/ + int calPlatJoinUserTotal(String customerId, String gridId, String communityId,String agencyPath, String isParty); } \ 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/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java index 2a3c3ab304..c337c085da 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; import com.epmet.dto.extract.result.*; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; import java.math.BigDecimal; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 8b7e1ae06c..ea44540cd9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -24,6 +24,8 @@ 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.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; @@ -263,4 +265,79 @@ 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); + + /** + * @Description 初始化screen_project_data数据 + * 如果是dateId不为空,则查询前一天的数据 + * 否则全查(适用于首次初始化的场景) + * + * 这是只查询指定天新增的项目,对于需要更新状态的项目,对历史数据(流转中的项目)进行遍历查询 + * @param customerId + * @param rows + * @param dateId + * @param exceedLimit 超期上线 + * @param about2exceedLimit 即将超期参数 + * @return java.util.List + * @author wangc + * @date 2021.03.04 22:56 + */ + List initNewScreenProjectData(String customerId,Integer rows ,String dateId,Integer exceedLimit,Integer about2exceedLimit); + + void computerIfExceed(List list,Integer exceedLimit,Integer about2exceedLimit); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java index ab3efce8b4..94fadea5fe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java @@ -21,8 +21,8 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; -import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; @@ -85,19 +85,21 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl originGroupData, List memberList,List missing) { - if (isFirst) { - //isFirst - baseDao.deleteBatchMemberByCustomerId(customerId,null,null); - } else { - if(StringUtils.isNotBlank(dateId)){ - baseDao.deleteBatchMemberByCustomerId(customerId,dateId,"date"); + if(!CollectionUtils.isEmpty(originGroupData)) { + if (isFirst) { + //isFirst + baseDao.deleteBatchMemberByCustomerId(customerId, null, null); + } else { + if (StringUtils.isNotBlank(dateId)) { + baseDao.deleteBatchMemberByCustomerId(customerId, dateId, "date"); + } } - } - //删除要插入的组主表数据 - baseDao.deleteBatchByGroupId(customerId,originGroupData.stream().map(FactOriginGroupMainDailyDTO :: getId).distinct().collect(Collectors.toList())); + //删除要插入的组主表数据 + baseDao.deleteBatchByGroupId(customerId, originGroupData.stream().map(FactOriginGroupMainDailyDTO::getId).distinct().collect(Collectors.toList())); - baseDao.insertBatchMain(originGroupData); - baseDao.insertBatchMembers(memberList); + baseDao.insertBatchMain(originGroupData); + baseDao.insertBatchMembers(memberList); + } if(!CollectionUtils.isEmpty(missing)){ baseDao.deleteBatchByGroupId(customerId,missing); baseDao.deleteMemberByGroupList(customerId,missing); @@ -106,16 +108,15 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl selectPartyCreateGroupInfo(String customerId, String monthId, List gridIds) { + public List selectPartyCreateGroupInfo(String customerId, List gridIds) { if (!CollectionUtils.isEmpty(gridIds)) { - return baseDao.selectPartyCreateGroupInfo(customerId, monthId, gridIds); + return baseDao.selectPartyCreateGroupInfo(customerId, gridIds); } return new ArrayList<>(); } @@ -135,4 +136,4 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl getVoteCount(String customerId, String monthId, String groupField) { return baseDao.getVoteCount(customerId, monthId, groupField); } + + /** + * @param customerId + * @param gridId + * @param agencyPath + * @param isParty + * @return java.lang.Integer + * @author yinzuomei + * @description 计算 平台参与议事总人数、平台参与议事党员数 + * @Date 2021/1/12 15:02 + **/ + @Override + public int calPlatJoinUserTotal(String customerId, String gridId,String communityId, String agencyPath, String isParty) { + return baseDao.selectPlatJoinUserTotal(customerId,gridId,communityId,agencyPath,isParty); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java index 7b3f127cd2..641b7efa03 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java @@ -30,6 +30,7 @@ import com.epmet.dao.evaluationindex.extract.FactOriginProjectLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; import com.epmet.dto.extract.result.*; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; import org.apache.commons.lang3.StringUtils; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index bdc82b519d..1a51ba5690 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -25,25 +25,32 @@ import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao; +import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.TransferRightRatioResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.pingyin.result.*; +import com.epmet.dto.result.CostDayResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * 项目主表_日统计 @@ -55,6 +62,10 @@ import java.util.Map; @DataSource(DataSourceConstant.STATS) public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl implements FactOriginProjectMainDailyService { + @Autowired + private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; + @Autowired + private FactOriginProjectOrgPeriodDailyDao periodDao; @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -259,4 +270,156 @@ 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<>(); + } + + /** + * @Description 初始化screen_project_data数据 + * 如果是dateId不为空,则查询前一天的数据 + * 否则全查(适用于首次初始化的场景) + * + * 这是只查询指定天新增的项目,对于需要更新状态的项目,对历史数据(流转中的项目)进行遍历查询 + * @param customerId + * @param rows + * @param dateId + * @param exceedLimit 超期上线 + * @param about2exceedLimit 即将超期参数 + * @return java.util.List + * @author wangc + * @date 2021.03.04 22:56 + */ + @Override + public List initNewScreenProjectData(String customerId,Integer rows , String dateId,Integer exceedLimit,Integer about2exceedLimit) { + boolean ifBeforeYesterday = true; + if(Integer.parseInt(DateUtils.getBeforeNDay(NumConstant.ONE)) > Integer.parseInt(dateId)){ + ifBeforeYesterday = false; + } + List projects = baseDao.initNewScreenProjectData(customerId, rows <= NumConstant.ZERO ? "" : dateId, dateId); + //如果不是昨天立项 + if(!CollectionUtils.isEmpty(projects) && !ifBeforeYesterday) + computerIfExceed(projects,exceedLimit,about2exceedLimit); + + return projects; + } + + @Override + public void computerIfExceed(List list,Integer exceedLimit,Integer about2exceedLimit){ + if(CollectionUtils.isEmpty(list)) return; + Result> costDays = epmetCommonServiceOpenFeignClient.costWorkDays(periodDao.selectProjectNodeStartStopTime(list.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList()))); + if(null != costDays && !CollectionUtils.isEmpty(costDays.getData())){ + //key : projectId + Map> projectPeriodMap + = costDays.getData().stream().collect(Collectors.groupingBy(CostDayResultDTO :: getId)); + list = list.stream().map(o -> { + List days = projectPeriodMap.get(o.getProjectId()); + if(!CollectionUtils.isEmpty(days)){ + Integer max = days.stream().max(Comparator.comparing(CostDayResultDTO::getDetentionDays)).get().getDetentionDays(); + //事件级别 红色1级:已超期;黄色2级:即将超期;绿色3级:未超期 + if(max > exceedLimit) + o.setProjectLevel(NumConstant.ONE); + else if(max >= about2exceedLimit) + o.setProjectLevel(NumConstant.TWO); + } + return o; + }).collect(Collectors.toList()); + } + } + + + } \ 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/GroupExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java index dedb5bc3a3..6f6451114d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.evaluationindex.extract.todata.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.utils.DateUtils; @@ -84,10 +85,10 @@ public class GroupExtractServiceImpl implements GroupExtractService { List originGroupData = groupDataService.extractGroupData( count <= NumConstant.ZERO, param.getCustomerId(), param.getDateId()); - + log.info("extractGroupData extractGroupData:result:{},param:{}", JSON.toJSONString(originGroupData), JSON.toJSONString(param)); List memberList = new LinkedList<>(); if (!CollectionUtils.isEmpty(originGroupData)) { - List gridList = dimGridService.getGridAttributes(param.getCustomerId(),originGroupData.stream().map(FactOriginGroupMainDailyDTO::getGridId).distinct().collect(Collectors.toList())); + List gridList = dimGridService.getGridAttributes(param.getCustomerId(),null); if (!CollectionUtils.isEmpty(gridList)) { Map gridMap = @@ -160,7 +161,7 @@ public class GroupExtractServiceImpl implements GroupExtractService { factOriginGroupMainDailyService.insertExtractedData( - count <= NumConstant.ZERO ? true : false, + count <= NumConstant.ZERO, param.getCustomerId(), param.getDateId(), originGroupData, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java index 20169ae538..b7b4532f4f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/IssueExtractServiceImpl.java @@ -22,6 +22,7 @@ import com.epmet.service.evaluationindex.extract.todata.IssueExtractService; import com.epmet.service.topic.TopicService; import com.epmet.service.user.UserService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -129,7 +130,11 @@ public class IssueExtractServiceImpl implements IssueExtractService { agencyInfoList.forEach(pid -> { if (r.getAgencyId().equals(pid.getAgencyId())){ r.setPid(pid.getPid()); - r.setPids(pid.getPids().concat(":").concat(r.getAgencyId())); + if (StringUtils.isNotBlank(pid.getPids())) { + r.setPids(pid.getPids().concat(":").concat(r.getAgencyId())); + } else { + r.setPids(r.getAgencyId()); + } } }); }); @@ -231,7 +236,11 @@ public class IssueExtractServiceImpl implements IssueExtractService { agencyInfoList.forEach(agency -> { if (r.getAgencyId().equals(agency.getAgencyId())){ r.setPid(agency.getPid()); - r.setPids(agency.getPids().concat(":").concat(r.getAgencyId())); + if(StringUtils.isNotBlank(agency.getPids())){ + r.setPids(agency.getPids().concat(":").concat(r.getAgencyId())); + }else{ + r.setPids(r.getAgencyId()); + } } }); }); 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 452edc9665..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 @@ -389,19 +389,14 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { /** * @param param * @return - * @Description 抽取项目节点历时逻辑 + * @Description 抽取项目节点历时逻辑 全量 * @author wangc * @date 2020.09.17 14:05 **/ @Override public void extractProjectPeriodData(ExtractOriginFormDTO param) { - int trace = factOriginProjectOrgPeriodDailyDao.selectIfExisted(param.getCustomerId()); - Boolean isFirst = trace <= NumConstant.ZERO; - if (StringUtils.isBlank(param.getDateId())) { - param.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE)); - } List extractData = - projectProcessService.getProjectPeriodDirectly(isFirst, param.getCustomerId(), param.getDateId()); + projectProcessService.getProjectPeriodDirectly(param.getCustomerId(), param.getDateId()); List formattingData = new LinkedList<>(); extractData.forEach(original -> { FactOriginProjectOrgPeriodDailyEntity dest @@ -444,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/ScreenProjectSettleService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenProjectSettleService.java new file mode 100644 index 0000000000..fe147887b0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenProjectSettleService.java @@ -0,0 +1,27 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; + +/** + * @Description + * 给【screen_project_data】 + * 【screen_project_process_attachment】 + * 【screen_project_img_data】 + * 【screen_project_process】这四个表定时整理数据 + * @author wangc + * @date 2021.03.04 13:38 +*/ + +public interface ScreenProjectSettleService { + + + /** + * @Description 抽取项目数据到screen_project_* + * @param param + * @return void + * @author wangc + * @date 2021.03.04 23:09 + */ + void extractScreenData(ScreenCentralZoneDataFormDTO param); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java index 90ccb5a0ed..a7435b914e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyBaseInfoServiceImpl.java @@ -129,7 +129,8 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { form.setAgeLevel4(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel4))); form.setAgeLevel5(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel5))); form.setAgeLevel6(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getAgeLevel6))); - form.setPartyMemberCount(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getPartyMemberCount))); +// form.setPartyMemberCount(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getPartyMemberCount))); + form.setPartyMemberCount(calPartyMemberCount(form)); form.setResiTotal(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getResiTotal))); form.setRegisterUserCount(party.stream().collect(Collectors.summingInt(PartyBaseInfoFormDTO::getRegisterUserCount))); result.add(form); @@ -175,6 +176,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY)); form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY)); form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true)); + form.setPartyMemberCount(calPartyMemberCount(form)); form.setCustomerId(customerId); form.setDataEndTime(dateId); form.setParentId(partyInfos.get(NumConstant.ZERO).getAgencyId()); @@ -183,7 +185,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { if (gridId.equals(user.getOrgId())){ form.setResiTotal(user.getResiTotal()); form.setRegisterUserCount(user.getRegisterUserCount()); - form.setPartyMemberCount(user.getPartyMemberCount()); +// form.setPartyMemberCount(user.getPartyMemberCount()); } }); } @@ -210,7 +212,8 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { form.setAgeLevel4(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel4))); form.setAgeLevel5(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel5))); form.setAgeLevel6(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getAgeLevel6))); - form.setPartyMemberCount(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getPartyMemberCount))); +// form.setPartyMemberCount(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getPartyMemberCount))); + form.setPartyMemberCount(calPartyMemberCount(form)); form.setResiTotal(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getResiTotal))); form.setRegisterUserCount(partyInfoList.stream().collect(Collectors.summingInt(PartyInfoResultDTO::getRegisterUserCount))); result.add(form); @@ -319,7 +322,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { } Integer delNum; do { - delNum = cpcBaseDataService.deleteOldPartyBaseInfo(customerId, dateId, orgIds); + delNum = cpcBaseDataService.deleteOldPartyBaseInfo(customerId, orgIds); }while (delNum > NumConstant.ZERO); List> partition = ListUtils.partition(finalResult, NumConstant.ONE_HUNDRED); partition.forEach(p -> { @@ -361,6 +364,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { form.setAgeLevel3(disposeAgeArea(partyInfos,NumConstant.THIRTY_ONE,NumConstant.FORTY)); form.setAgeLevel4(disposeAgeArea(partyInfos,NumConstant.FORTY_ONE,NumConstant.FIFTY)); form.setAgeLevel5(disposeAgeArea(partyInfos,NumConstant.FIFTY_ONE,NumConstant.SIXTY)); + form.setPartyMemberCount(calPartyMemberCount(form)); form.setAgeLevel6(disposeAge(partyInfos,NumConstant.SIXTY,true)); form.setCustomerId(customerId); form.setDataEndTime(dateId); @@ -370,7 +374,7 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { if (gridId.equals(user.getOrgId())){ form.setResiTotal(user.getResiTotal()); form.setRegisterUserCount(user.getRegisterUserCount()); - form.setPartyMemberCount(user.getPartyMemberCount()); +// form.setPartyMemberCount(user.getPartyMemberCount()); } }); } @@ -379,4 +383,9 @@ public class PartyBaseInfoServiceImpl implements PartyBaseInfoService { } return new GridPartyDTO(orgIds, result); } + + public Integer calPartyMemberCount(PartyBaseInfoFormDTO form){ + Integer result = form.getAgeLevel1() + form.getAgeLevel2() + form.getAgeLevel3() + form.getAgeLevel4() + form.getAgeLevel5() + form.getAgeLevel6(); + return result; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java index 74f7b84d27..2e31f8ae4a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PartyGuideServiceImpl.java @@ -1,11 +1,9 @@ package com.epmet.service.evaluationindex.extract.toscreen.impl; -import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.ScreenConstant; import com.epmet.dto.extract.form.ExtractScreenFormDTO; -import com.epmet.dto.extract.form.ScreenExtractFormDTO; import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.*; @@ -185,22 +183,22 @@ public class PartyGuideServiceImpl implements PartyGuideService { // 判断当前级别agency是否为空 if (!CollectionUtils.isEmpty(agencyIdList)){ // 获取agencyIds - List orgIds = agencyIdList.stream().map(m -> m.getAgencyId()).collect(Collectors.toList()); - if (isGrid == true){ + List orgIds = agencyIdList.stream().map(CustomerAgencyInfoResultDTO::getAgencyId).collect(Collectors.toList()); + if (isGrid) { agencyIdList.forEach(agency -> { // 计算社区级别的下级(实际就是网格) - GridPartyGuideDTO gridPartyGuideDTO = communityLevelSubGrid(customerId, monthId, agency); + GridPartyGuideDTO gridPartyGuideDTO = communityLevelSubGrid(customerId, agency); orgIds.addAll(gridPartyGuideDTO.getOrgIds()); result.addAll(gridPartyGuideDTO.getResult()); }); // 根据agencyId分组,计算各个社区的 Map> groupByAgency = result.stream().collect(Collectors.groupingBy(ScreenPartyLinkMassesDataFormDTO::getParentId)); - groupByAgency.forEach((agencyId,gridList) -> { + groupByAgency.forEach((agencyId, gridList) -> { ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO(); List orgNameAgencyList = agencyService.selectOrgNameAgency(orgIds); if (!CollectionUtils.isEmpty(orgNameAgencyList)){ orgNameAgencyList.forEach(name -> { - if (agencyId.equals(name.getAgencyId())){ + if (agencyId.equals(name.getAgencyId())) { form.setOrgName(name.getAgencyName()); form.setParentId(name.getParentId()); } @@ -210,8 +208,8 @@ public class PartyGuideServiceImpl implements PartyGuideService { form.setCustomerId(customerId); form.setDataEndTime(monthId); form.setOrgType(ScreenConstant.AGENCY); - form.setCreateGroupTotal(gridList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal))); - form.setGroupUserTotal(gridList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal))); + form.setCreateGroupTotal(gridList.stream().mapToInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal).sum()); + form.setGroupUserTotal(gridList.stream().mapToInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal).sum()); result.add(form); }); delAndInsertLink(result,customerId,monthId,orgIds); @@ -227,15 +225,15 @@ public class PartyGuideServiceImpl implements PartyGuideService { } }); // 不为空 存在直属网格 - if (!CollectionUtils.isEmpty(disGridIds)){ + if (!CollectionUtils.isEmpty(disGridIds)) { List gridResult = new ArrayList<>(); // 查询党员创建组,组内成员数 - List partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds); - List orgNameList = agencyService.selectOrgNameGrid(partyLinkMassesDataList.stream().map(m -> m.getOrgId()).collect(Collectors.toList())); - if (!CollectionUtils.isEmpty(partyLinkMassesDataList)){ + List partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, disGridIds); + List orgNameList = agencyService.selectOrgNameGrid(partyLinkMassesDataList.stream().map(ScreenPartyLinkMassesDataFormDTO::getOrgId).collect(Collectors.toList())); + if (!CollectionUtils.isEmpty(partyLinkMassesDataList)) { partyLinkMassesDataList.forEach(party -> { orgNameList.forEach(org -> { - if (party.getOrgId().equals(org.getGridId())){ + if (party.getOrgId().equals(org.getGridId())) { party.setOrgName(org.getGridName()); } }); @@ -246,10 +244,10 @@ public class PartyGuideServiceImpl implements PartyGuideService { delAndInsertLink(gridResult,customerId,monthId,disGridIds); } // 查询直属网格的信息 + 下级机关的信息 = agency的机关信息 - List screenPartyLinkMassesDataGrid = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, disGridIds); + List screenPartyLinkMassesDataGrid = groupMainService.selectPartyCreateGroupInfo(customerId, disGridIds); List screenPartyLinkMassesDataList = linkMassesDataService.selectPartyLinkMassesInfo(customerId, monthId, agencyId); screenPartyLinkMassesDataList.addAll(screenPartyLinkMassesDataGrid); - if (!CollectionUtils.isEmpty(screenPartyLinkMassesDataList)){ + if (!CollectionUtils.isEmpty(screenPartyLinkMassesDataList)) { ScreenPartyLinkMassesDataFormDTO form = new ScreenPartyLinkMassesDataFormDTO(); form.setOrgId(agencyId); form.setOrgType(ScreenConstant.AGENCY); @@ -257,8 +255,8 @@ public class PartyGuideServiceImpl implements PartyGuideService { form.setCustomerId(customerId); form.setDataEndTime(monthId); form.setParentId(screenPartyLinkMassesDataList.get(NumConstant.ZERO).getParentId()); - form.setGroupUserTotal(screenPartyLinkMassesDataList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal))); - form.setCreateGroupTotal(screenPartyLinkMassesDataList.stream().collect(Collectors.summingInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal))); + form.setGroupUserTotal(screenPartyLinkMassesDataList.stream().mapToInt(ScreenPartyLinkMassesDataFormDTO::getGroupUserTotal).sum()); + form.setCreateGroupTotal(screenPartyLinkMassesDataList.stream().mapToInt(ScreenPartyLinkMassesDataFormDTO::getCreateGroupTotal).sum()); result.add(form); } }); @@ -431,24 +429,23 @@ public class PartyGuideServiceImpl implements PartyGuideService { } /** - * @Description 社区级别的处理 + * @Description 社区级别的处理 * @Param customerId - * @Param monthId * @Param agency * @author zxc * @date 2020/9/25 10:06 上午 */ - public GridPartyGuideDTO communityLevelSubGrid(String customerId, String monthId, CustomerAgencyInfoResultDTO agency){ + public GridPartyGuideDTO communityLevelSubGrid(String customerId, CustomerAgencyInfoResultDTO agency) { String agencyId = agency.getAgencyId(); // 获取下级所有agencyId【根据agencyMap中的level判断下级orgId是否是gridId】(此处直接作为gridId) Map agencyMap = agencyService.selectAllSubAgencyId(agencyId, customerId); List gridIds = (List) agencyMap.get(agencyId); - List partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, monthId, gridIds); + List partyLinkMassesDataList = groupMainService.selectPartyCreateGroupInfo(customerId, gridIds); List orgIds = partyLinkMassesDataList.stream().map(m -> m.getOrgId()).collect(Collectors.toList()); List orgNameList = agencyService.selectOrgNameGrid(orgIds); partyLinkMassesDataList.forEach(party -> { orgNameList.forEach(orgName -> { - if (party.getOrgId().equals(orgName.getGridId())){ + if (party.getOrgId().equals(orgName.getGridId())) { party.setOrgName(orgName.getGridName()); } }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java index f41366eb13..3041ba742e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PioneerDataExtractServiceImpl.java @@ -66,56 +66,76 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService //何为参与: 议题的表决行为次数总计 //1、党员参与议事 entity.setIssueTotal(calPartyPartiIssueTotal(customerId,gridId,null,null,NumConstant.ONE_STR)); + log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员参与议事issueTotal="+entity.getIssueTotal()); + + //01.12新增:平台参与议事总数 + int issueTotal=calPartyPartiIssueTotal(customerId,gridId,null,null,null); + entity.setPlatIssueTotal(issueTotal); + log.info("extractGridPioneerData 当前网格id=" + gridId + ";参与议事总数issueTotal=" + issueTotal); + + //2、党员参与议事占比 if(entity.getIssueTotal()==0){ entity.setIssueRatio(BigDecimal.ZERO); }else{ - //2、党员参与议事占比 - int issueTotal=calPartyPartiIssueTotal(customerId,gridId,null,null,null); - BigDecimal issueRatio=new BigDecimal(entity.getIssueTotal()/issueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + BigDecimal issueRatio = new BigDecimal((double) entity.getIssueTotal() / issueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + log.info("extractGridPioneerData 当前网格id=" + gridId + ";issueRatio=" + issueRatio); entity.setIssueRatio(issueRatio.setScale(NumConstant.SIX,RoundingMode.HALF_UP)); } //3、党员发布话题: entity.setTopicTotal(getTopicTotal(customerId, gridId, null)); + log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员发布话题topicTotal"+entity.getTopicTotal()); + + //当前网格内所有话题总数 + int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId, null); + log.info("extractGridPioneerData 当前网格id=" + gridId + ";当前网格内所有话题总数gridTopicTotal="+gridTopicTotal); + //01.12新增:PLAT_TOPIC_TOTAL 当前组织维度,话题总数 + entity.setPlatTopicTotal(gridTopicTotal); + //4、党员发布话题占比: 网格内注册党员发布的话题总数占 网格内话题总数的 比率 if (entity.getTopicTotal() == NumConstant.ZERO) { entity.setTopicRatio(BigDecimal.ZERO); } else { - //当前网格内所有话题总数 - int gridTopicTotal = getGridOrCommunityTopicTotal(customerId, gridId, null); if(gridTopicTotal == NumConstant.ZERO){ entity.setTopicRatio(BigDecimal.ZERO); }else{ - BigDecimal topicRatio=new BigDecimal(entity.getTopicTotal() / gridTopicTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + BigDecimal topicRatio = new BigDecimal((double) entity.getTopicTotal() / gridTopicTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员发布话题占比topicRatio="+topicRatio); entity.setTopicRatio(topicRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } } //当前网格内所有议题总数 int gridIssueTotal = getGridOrCommunityIssueTotal(customerId, gridId, null); + log.info("extractGridPioneerData 当前网格id=" + gridId + ";当前网格内所有议题总数=" + gridIssueTotal); + //01.12新增:PLAT_PUBLISH_ISSUE_TOTAL 当前组织维度,发布议题总数 + entity.setPlatPublishIssueTotal(gridIssueTotal); + if (gridIssueTotal != NumConstant.ZERO) { //5、党员发布议题 entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, gridId, null)); + log.info("extractGridPioneerData 当前网格id=" + gridId + ";党员发布议题publishIssueTotal"+entity.getPublishIssueTotal()); //6、党员发布议题占比 : 占网格内所有议题的比率 if (entity.getPublishIssueTotal() == NumConstant.ZERO) { entity.setPublishIssueRatio(BigDecimal.ZERO); }else{ - BigDecimal publishIssueRatio=new BigDecimal(entity.getPublishIssueTotal() / gridIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + BigDecimal publishIssueRatio=new BigDecimal((double)entity.getPublishIssueTotal() / gridIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); entity.setPublishIssueRatio(publishIssueRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } //7、议题转项目数 entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, gridId, null)); + log.info("extractGridPioneerData 当前网格id=" + gridId +";议题转项目数shiftProjectTotal="+entity.getShiftProjectTotal()); //8、议题转项目占比 : 占网格内议题总数的比率 if(entity.getShiftProjectTotal() == NumConstant.ZERO){ entity.setShiftProjectRatio(BigDecimal.ZERO); }else{ - BigDecimal shiftProjectRatio=new BigDecimal(entity.getShiftProjectTotal() / gridIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + BigDecimal shiftProjectRatio = new BigDecimal((double) entity.getShiftProjectTotal() / gridIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); entity.setShiftProjectRatio(shiftProjectRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } }else{ -// log.info("当前网格内所有议题总数="+gridIssueTotal); + log.info("extractGridPioneerData 当前网格id="+gridId+";当前网格内所有议题总数 gridIssueTotal =0 "); entity.setPublishIssueTotal(NumConstant.ZERO); entity.setPublishIssueRatio(BigDecimal.ZERO); entity.setShiftProjectTotal(NumConstant.ZERO); @@ -125,18 +145,34 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService // 9、已解决项目 entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, gridId, null, DimObjectStatusConstant.RESOLVED)); + log.info("extractGridPioneerData 当前网格id="+gridId+";已解决项目resolvedProjectTotal="+entity.getResolvedProjectTotal()); + + int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, gridId, null, null); + log.info("extractGridPioneerData 当前网格id="+gridId+";总结项目closedProjectTotal="+closedProjectTotal); + // 01.12新增:PLAT_CLOSED_PROJECT_TOTAL 当前组织维度,所有结案项目数 + entity.setPlatClosedProjectTotal(closedProjectTotal); + + // 10、占总结项目 if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { entity.setResolvedProjectRatio(BigDecimal.ZERO); } else { - // 10、占总结项目 - int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, gridId, null, null); if(closedProjectTotal == NumConstant.ZERO){ entity.setResolvedProjectRatio(BigDecimal.ZERO); }else { - BigDecimal resolvedProjectRatio=new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + BigDecimal resolvedProjectRatio = new BigDecimal((double) entity.getResolvedProjectTotal() / closedProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); entity.setResolvedProjectRatio(resolvedProjectRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } } + //01.12: 新增指标:平台参与议事总人数、平台参与议事党员数、平台参与议事的党员占比 + entity.setPlatJoinUserTotal(factOriginIssueLogDailyService.calPlatJoinUserTotal(customerId, gridId, null, null,null)); + entity.setPlatJoinPartyTotal(factOriginIssueLogDailyService.calPlatJoinUserTotal(customerId, gridId, null, null,NumConstant.ONE_STR)); + if (entity.getPlatJoinPartyTotal() == NumConstant.ZERO) { + entity.setPlatJoinPartyRatio(BigDecimal.ZERO); + } else { + BigDecimal platJoinPartyRatio = new BigDecimal((double) entity.getPlatJoinPartyTotal() / entity.getPlatJoinUserTotal()).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + entity.setPlatJoinPartyRatio(platJoinPartyRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + }); screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.GRID, IndexCalConstant.DELETE_SIZE, gridList); } @@ -172,42 +208,60 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService String communityId = entity.getOrgId(); //1、党员参与议事 entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,communityId,null,NumConstant.ONE_STR)); + log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员参与议事issueTotal="+entity.getIssueTotal()); + + //01.12新增 + int issueTotal=calPartyPartiIssueTotal(customerId,null,communityId,null,null); + log.info("extractCommunityPioneerData 当前communityId="+communityId+";参与议事总数issueTotal="+issueTotal); + entity.setPlatIssueTotal(issueTotal); + if(entity.getIssueTotal()==0){ entity.setIssueRatio(BigDecimal.ZERO); }else{ //2、党员参与议事占比 - int issueTotal=calPartyPartiIssueTotal(customerId,null,communityId,null,null); - entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP)); + entity.setIssueRatio(new BigDecimal((double)entity.getIssueTotal()/issueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX,RoundingMode.HALF_UP)); } //3、党员发布话题: entity.setTopicTotal(getTopicTotal(customerId, null, communityId)); + log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员发布话题topicTotal="+entity.getTopicTotal()); + + //01.12新增 + //当前社区内所有话题总数 + int communityTopicTotal = getGridOrCommunityTopicTotal(customerId, null, communityId); + log.info("extractCommunityPioneerData 当前communityId="+communityId+";当前社区内所有话题总数communityTopicTotal="+communityTopicTotal); + entity.setPlatTopicTotal(communityTopicTotal); + //4、党员发布话题占比: 社区内注册党员发布的话题总数占 社区内话题总数的 比率 if (entity.getTopicTotal() == NumConstant.ZERO) { entity.setTopicRatio(BigDecimal.ZERO); } else { - //当前社区内所有话题总数 - int communityTopicTotal = getGridOrCommunityTopicTotal(customerId, null, communityId); - entity.setTopicRatio(communityTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / communityTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setTopicRatio(communityTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getTopicTotal() / communityTopicTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } + //01.12新增 //当前社区内所有议题总数 int communityIssueTotal = getGridOrCommunityIssueTotal(customerId, null, communityId); + log.info("extractCommunityPioneerData 当前communityId="+communityId+";当前社区内所有议题总数communityIssueTotal="+communityIssueTotal); + entity.setPlatPublishIssueTotal(communityIssueTotal); + if (communityIssueTotal != NumConstant.ZERO) { //5、党员发布议题 entity.setPublishIssueTotal(getParyPublishIssueTotal(customerId, null, communityId)); + log.info("extractCommunityPioneerData 当前communityId="+communityId+";党员发布议题publishIssueTotal="+entity.getPublishIssueTotal()); //6、党员发布议题占比 : 占社区内所有议题的比率 if (entity.getPublishIssueTotal() == NumConstant.ZERO) { entity.setPublishIssueRatio(BigDecimal.ZERO); } - entity.setPublishIssueRatio(communityIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setPublishIssueRatio(communityIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getPublishIssueTotal() / communityIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); //7、议题转项目数 entity.setShiftProjectTotal(getGridOrCommunityShiftProjectTotal(customerId, null, communityId)); + log.info("extractCommunityPioneerData 当前communityId="+communityId+";议题转项目数shiftProjectTotal="+entity.getShiftProjectTotal()); //8、议题转项目占比 : 占社区内议题总数的比率 - entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / communityIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getShiftProjectTotal() / communityIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); }else{ -// log.info("当前社区内所有议题总数="+communityIssueTotal); + log.info("extractCommunityPioneerData 当前communityId="+communityId+"communityIssueTotal =0"); entity.setPublishIssueTotal(NumConstant.ZERO); entity.setPublishIssueRatio(BigDecimal.ZERO); entity.setShiftProjectTotal(NumConstant.ZERO); @@ -217,12 +271,28 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService // 9、已解决项目 entity.setResolvedProjectTotal(getGridOrCommunityClosedProjectTotal(customerId, null, communityId, DimObjectStatusConstant.RESOLVED)); + log.info("extractCommunityPioneerData 当前communityId="+communityId+";已解决项目resolvedProjectTotal="+entity.getResolvedProjectTotal()); + + //01.12新增 + int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, null, communityId, null); + log.info("extractCommunityPioneerData 当前communityId="+communityId+";总结项目closedProjectTotal="+closedProjectTotal); + entity.setPlatClosedProjectTotal(closedProjectTotal); + if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { entity.setResolvedProjectRatio(BigDecimal.ZERO); } else { // 10、占总结项目 - int closedProjectTotal = getGridOrCommunityClosedProjectTotal(customerId, null, communityId, null); - entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getResolvedProjectTotal() / closedProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + + //01.12: 新增指标:平台参与议事总人数、平台参与议事党员数、平台参与议事的党员占比 + entity.setPlatJoinUserTotal(factOriginIssueLogDailyService.calPlatJoinUserTotal(customerId, null, communityId,null, null)); + entity.setPlatJoinPartyTotal(factOriginIssueLogDailyService.calPlatJoinUserTotal(customerId, null, communityId,null, NumConstant.ONE_STR)); + if (entity.getPlatJoinPartyTotal() == NumConstant.ZERO) { + entity.setPlatJoinPartyRatio(BigDecimal.ZERO); + } else { + BigDecimal platJoinPartyRatio = new BigDecimal((double) entity.getPlatJoinPartyTotal() / entity.getPlatJoinUserTotal()).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + entity.setPlatJoinPartyRatio(platJoinPartyRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } }); screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.AGENCY, IndexCalConstant.DELETE_SIZE, communityList); @@ -243,44 +313,63 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService } else { entity.setAgencyPath(entity.getAgencyPids().concat(StrConstant.COLON).concat(entity.getOrgId())); } + log.info("extractExceptCommunityPioneerData 当前orgId="+entity.getOrgId()+";agencyPath="+entity.getAgencyPath()); //1、党员参与议事 entity.setIssueTotal(calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),NumConstant.ONE_STR)); + log.info("extractExceptCommunityPioneerData 党员参与议事issueTotal="+entity.getIssueTotal()); + + //01.12新增 + int issueTotal=calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),null); + log.info("extractExceptCommunityPioneerData 平台参与议事issueTotal="+issueTotal); + entity.setPlatIssueTotal(issueTotal); + if(entity.getIssueTotal()==0){ entity.setIssueRatio(BigDecimal.ZERO); }else{ //2、党员参与议事占比 - int issueTotal=calPartyPartiIssueTotal(customerId,null,null,entity.getAgencyPath(),null); - entity.setIssueRatio(new BigDecimal(entity.getIssueTotal()/issueTotal).setScale(NumConstant.SIX,RoundingMode.HALF_UP)); + entity.setIssueRatio(new BigDecimal((double)entity.getIssueTotal()/issueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX,RoundingMode.HALF_UP)); } //3、党员发布话题: entity.setTopicTotal(getAgencyTopicTotal(customerId, entity.getAgencyPath(),NumConstant.ONE_STR)); + log.info("extractExceptCommunityPioneerData 党员发布话题topicTotal="+entity.getTopicTotal()); + + //01.12新增 + //当前组织内所有话题总数 + int agencyTopicTotal = getAgencyTopicTotal(customerId, entity.getAgencyPath(),null); + log.info("extractExceptCommunityPioneerData 当前组织内所有话题总数agencyTopicTotal="+agencyTopicTotal); + entity.setPlatTopicTotal(agencyTopicTotal); + //4、党员发布话题占比: 组织内注册党员发布的话题总数占 组织内话题总数的 比率 if (entity.getTopicTotal() == NumConstant.ZERO) { entity.setTopicRatio(BigDecimal.ZERO); } else { - //当前组织内所有话题总数 - int agencyTopicTotal = getAgencyTopicTotal(customerId, entity.getAgencyPath(),null); - entity.setTopicRatio(agencyTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getTopicTotal() / agencyTopicTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setTopicRatio(agencyTopicTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getTopicTotal() / agencyTopicTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } + //01.12新增 //当前组织内所有议题总数 int agencyIssueTotal = getAgencyIssueTotal(customerId, entity.getAgencyPath()); + log.info("extractExceptCommunityPioneerData 当前组织内所有议题总数agencyIssueTotal="+agencyIssueTotal); + entity.setPlatPublishIssueTotal(agencyIssueTotal); + if (agencyIssueTotal != NumConstant.ZERO) { //5、党员发布议题 entity.setPublishIssueTotal(getAgencyParyPublishIssueTotal(customerId, entity.getAgencyPath())); + log.info("extractExceptCommunityPioneerData 党员发布议题publishIssueTotal="+entity.getPublishIssueTotal()); //6、党员发布议题占比 : 占社区内所有议题的比率 if (entity.getPublishIssueTotal() == NumConstant.ZERO) { entity.setPublishIssueRatio(BigDecimal.ZERO); } - entity.setPublishIssueRatio(agencyIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getPublishIssueTotal() / agencyIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setPublishIssueRatio(agencyIssueTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getPublishIssueTotal() / agencyIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); //7、议题转项目数 entity.setShiftProjectTotal(getAgencyShiftProjectTotal(customerId, entity.getAgencyPath())); + log.info("extractExceptCommunityPioneerData 议题转项目数shiftProjectTotal="+entity.getShiftProjectTotal()); //8、议题转项目占比 : 占网格内议题总数的比率 - entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getShiftProjectTotal() / agencyIssueTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setShiftProjectRatio(entity.getShiftProjectTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getShiftProjectTotal() / agencyIssueTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); }else{ -// log.info("当前组织内所有议题总数="+agencyIssueTotal); + log.info("extractExceptCommunityPioneerData 当前组织内所有议题总数agencyIssueTotal=0"); entity.setPublishIssueTotal(NumConstant.ZERO); entity.setPublishIssueRatio(BigDecimal.ZERO); entity.setShiftProjectTotal(NumConstant.ZERO); @@ -290,13 +379,30 @@ public class PioneerDataExtractServiceImpl implements PioneerDataExtractService // 9、已解决项目 entity.setResolvedProjectTotal(getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), DimObjectStatusConstant.RESOLVED)); + log.info("extractExceptCommunityPioneerData 已解决项目resolvedProjectTotal="+entity.getResolvedProjectTotal()); + + //01.12新增 + int closedProjectTotal = getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), null); + log.info("extractExceptCommunityPioneerData 总结项目closedProjectTotal="+closedProjectTotal); + entity.setPlatClosedProjectTotal(closedProjectTotal); + if (entity.getResolvedProjectTotal() == NumConstant.ZERO) { entity.setResolvedProjectRatio(BigDecimal.ZERO); } else { // 10、占总结项目 - int closedProjectTotal = getAgencyClosedProjectTotal(customerId, entity.getAgencyPath(), null); - entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(entity.getResolvedProjectTotal() / closedProjectTotal).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setResolvedProjectRatio(closedProjectTotal == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal((double)entity.getResolvedProjectTotal() / closedProjectTotal).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.SIX, RoundingMode.HALF_UP)); } + + //01.12: 新增指标:平台参与议事总人数、平台参与议事党员数、平台参与议事的党员占比 + entity.setPlatJoinUserTotal(factOriginIssueLogDailyService.calPlatJoinUserTotal(customerId, null, null, entity.getAgencyPath(), null)); + entity.setPlatJoinPartyTotal(factOriginIssueLogDailyService.calPlatJoinUserTotal(customerId, null, null, entity.getAgencyPath(), NumConstant.ONE_STR)); + if (entity.getPlatJoinPartyTotal() == NumConstant.ZERO) { + entity.setPlatJoinPartyRatio(BigDecimal.ZERO); + } else { + BigDecimal platJoinPartyRatio = new BigDecimal((double) entity.getPlatJoinPartyTotal() / entity.getPlatJoinUserTotal()).multiply(new BigDecimal(NumConstant.ONE_HUNDRED)); + entity.setPlatJoinPartyRatio(platJoinPartyRatio.setScale(NumConstant.SIX, RoundingMode.HALF_UP)); + } + }); screenPioneerDataService.delAndSavePioneerData(customerId, OrgTypeConstant.AGENCY, IndexCalConstant.DELETE_SIZE, agencyList); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java index f26101c3dd..aa8c4728dc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java @@ -94,7 +94,7 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { private void extractGridUserJoin(ExtractScreenFormDTO formDTO) { List orgList = dimGridService.getGridListByCustomerId(formDTO.getCustomerId()); if (CollectionUtils.isEmpty(orgList)) { - log.warn("抽取【公众参与-人均议题】,获取组织数据失败"); + log.warn("抽取【公众参与-人均议题】,获取组织数据失败,customerId:{}", formDTO.getCustomerId()); return; } //构建组织数据 @@ -103,12 +103,12 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { //获取议题月份增量 List issueTotal = factIssueGridMonthlyService.getIssueIncCountAndTotalByMonthId(formDTO.getCustomerId(), formDTO.getMonthId()); if (CollectionUtils.isEmpty(issueTotal)) { - log.error("抽取【公众参与-人均议题】,获取议题增量为空"); + log.error("抽取【公众参与-人均议题】,获取议题增量为空,customerId:{}", formDTO.getCustomerId()); return; } List userCountList = factRegUserGridMonthlyService.selectGridUserCount(formDTO.getCustomerId(), formDTO.getMonthId()); if (CollectionUtils.isEmpty(userCountList)) { - log.error("抽取【公众参与-人均议题】,获取注册用户数为空"); + log.error("抽取【公众参与-人均议题】,获取注册用户数为空,customerId:{}", formDTO.getCustomerId()); return; } Map userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getOrgId, o -> o)); @@ -143,7 +143,7 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { //获取每个网格的应表决人数 List memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId(), ProjectConstant.AGENCY_ID); if (CollectionUtils.isEmpty(memberCountList)) { - log.warn("抽取【公众参与-人均议题】,获取应表决人数为空"); + log.warn("抽取【公众参与-人均议题】,获取应表决人数为空,customerId:{}", formDTO.getCustomerId()); return; } gridMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getOrgId, o -> o.getMemberCount())); @@ -184,7 +184,7 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { private void extractAgencyUserJoin(ExtractScreenFormDTO formDTO) { List orgList = dimAgencyService.getAgencyListByCustomerId(formDTO.getCustomerId()); if (CollectionUtils.isEmpty(orgList)) { - log.warn("抽取【公众参与-人均议题】,获取组织数据失败"); + log.warn("抽取【公众参与-人均议题】,获取组织数据失败,customerId:{}", formDTO.getCustomerId()); return; } //构建组织数据 @@ -193,66 +193,71 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { List issueTotal = factIssueAgencyMonthlyService.getIssueIncCountAndTotalByMonthId(formDTO.getCustomerId(), formDTO.getMonthId()); List userCountList = factRegUserAgencyMonthlyService.selectAgencyUserCount(formDTO.getCustomerId(), formDTO.getMonthId()); - if (CollectionUtils.isEmpty(issueTotal)) { - log.error("抽取【公众参与-人均议题】,获取注册用户数为空"); - return; - } Map userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getOrgId, o -> o)); Set agencyIdSet = new HashSet<>(); - issueTotal.forEach(issue -> { - String agencyId = issue.getAgencyId(); - agencyIdSet.add(agencyId); - ScreenUserJoinEntity entity = insertMap.get(agencyId); - entity.setJoinTotal(issue.getIssueIncr()); - GridUserCountResultDTO user = userCountMap.get(agencyId); - //百人人均议题:统计周期内总的议题数/(注册用户数/100) - if (!user.getRegTotal().equals(0)) { - BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getRegTotal()) - .divide(new BigDecimal(NumConstant.ONE_HUNDRED)), 4, BigDecimal.ROUND_HALF_UP); - entity.setAvgIssue(avgIssueCount); - } - }); - - List> partition = ListUtils.partition(new ArrayList<>(agencyIdSet), NumConstant.THIRTY); - partition.forEach(list -> { - //获取该月 表决的人数 - List voteCountList = factOriginIssueLogDailyService.getVoteCount(formDTO.getCustomerId(), formDTO.getMonthId(), ProjectConstant.AGENCY_ID); - Map orgMemberCount = new HashMap<>(); - if (!CollectionUtils.isEmpty(issueTotal)) { - //获取每个网格的应表决人数 - List memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId(), ProjectConstant.AGENCY_ID); - if (CollectionUtils.isEmpty(memberCountList)) { - log.warn("抽取【公众参与-人均议题】,获取应表决人数为空"); - return; + if (!CollectionUtils.isEmpty(issueTotal)) { + log.error("抽取【公众参与-人均议题】,获取注册用户数为空,customerId:{}", formDTO.getCustomerId()); + issueTotal.forEach(issue -> { + String agencyId = issue.getAgencyId(); + agencyIdSet.add(agencyId); + ScreenUserJoinEntity entity = insertMap.get(agencyId); + entity.setJoinTotal(issue.getIssueIncr()); + GridUserCountResultDTO user = userCountMap.get(agencyId); + //百人人均议题:统计周期内总的议题数/(注册用户数/100) + if (!user.getRegTotal().equals(0)) { + BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getRegTotal()) + .divide(new BigDecimal(NumConstant.ONE_HUNDRED)), 4, BigDecimal.ROUND_HALF_UP); + entity.setAvgIssue(avgIssueCount); + } + }); + List> partition = ListUtils.partition(new ArrayList<>(agencyIdSet), NumConstant.THIRTY); + partition.forEach(list -> { + //获取该月 表决的人数 + List voteCountList = factOriginIssueLogDailyService.getVoteCount(formDTO.getCustomerId(), formDTO.getMonthId(), ProjectConstant.AGENCY_ID); + Map orgMemberCount = new HashMap<>(); + if (!CollectionUtils.isEmpty(issueTotal)) { + //获取每个网格的应表决人数 + List memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId(), ProjectConstant.AGENCY_ID); + if (CollectionUtils.isEmpty(memberCountList)) { + log.warn("抽取【公众参与-人均议题】,获取应表决人数为空,customerId:{}", formDTO.getCustomerId()); + return; + } + orgMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getOrgId, o -> o.getMemberCount())); } - orgMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getOrgId, o -> o.getMemberCount())); - } - //百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数 + //百人平均参与度:每个议题的实际参与数/应参与数 的平均值:(每个议题的实际参与数/应参与数)的和)/被表决的议题数 - //遍历实际参与人数 - Map> voteMap = voteCountList.stream().collect(Collectors.groupingBy(IssueVoteUserCountResultDTO::getOrgId)); - for (Map.Entry> entry : voteMap.entrySet()) { - String orgId = entry.getKey(); - ScreenUserJoinEntity entity = insertMap.get(orgId); - List issueList = entry.getValue(); - BigDecimal bigDecimal = new BigDecimal(0); - BigDecimal votedByIssueCount = new BigDecimal(issueList.get(0).getIssueCount()); - for (IssueVoteUserCountResultDTO vote : issueList) { - Integer memberCount = orgMemberCount.get(orgId); - if (memberCount == null) { - memberCount = 0; + //遍历实际参与人数 + Map> voteMap = voteCountList.stream().collect(Collectors.groupingBy(IssueVoteUserCountResultDTO::getOrgId)); + for (Map.Entry> entry : voteMap.entrySet()) { + String orgId = entry.getKey(); + ScreenUserJoinEntity entity = insertMap.get(orgId); + List issueList = entry.getValue(); + BigDecimal bigDecimal = new BigDecimal(0); + BigDecimal votedByIssueCount = new BigDecimal(issueList.get(0).getIssueCount()); + for (IssueVoteUserCountResultDTO vote : issueList) { + Integer memberCount = orgMemberCount.get(orgId); + if (memberCount == null) { + //memberCount = 0; + continue; + } + + bigDecimal = bigDecimal.add(new BigDecimal(vote.getVoteCount() / (memberCount * 1.0))); + } + if (votedByIssueCount.intValue() != 0) { + entity.setAvgJoin(bigDecimal.divide(votedByIssueCount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(NumConstant.ONE_HUNDRED))); } - bigDecimal = bigDecimal.add(new BigDecimal(vote.getVoteCount() / (memberCount * 1.0))); - } - if (votedByIssueCount.intValue() != 0) { - entity.setAvgJoin(bigDecimal.divide(votedByIssueCount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(NumConstant.ONE_HUNDRED))); } - } - }); + }); + } screenUserJoinService.deleteAndInsertBatch(formDTO, new ArrayList<>(insertMap.values())); } + public static void main(String[] args) { + BigDecimal bigDecimal = new BigDecimal(0); + bigDecimal = bigDecimal.add(new BigDecimal(0 / (1 * 1.0))); + } + private void buildUserJoinEntity(ExtractScreenFormDTO formDTO, Object org, Map result) { DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(DateUtils.stringToDate(formDTO.getMonthId(), DateUtils.DATE_PATTERN_YYYYMM)); ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(dimIdBean, ScreenUserJoinEntity.class); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index 2ca72cacc5..74e3021a00 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -11,6 +11,10 @@ import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; +import com.epmet.service.evaluationindex.screen.ScreenProjectGridDailyService; +import com.epmet.service.evaluationindex.screen.ScreenProjectOrgDailyService; +import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityGridMonthlyService; +import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService; import com.epmet.service.stats.DimCustomerService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -50,11 +54,21 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { private PublicPartiTotalDataExtractService publicPartiTotalDataExtractService; @Autowired private IndexCalculateService indexCalculateService; - @Autowired private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService; @Autowired private ScreenGrassrootsGovernDataAbsorptionService screenGrassrootsGovernDataAbsorptionService; + @Autowired + private ScreenProjectQuantityGridMonthlyService screenProjectQuantityGridMonthlyService; + @Autowired + private ScreenProjectQuantityOrgMonthlyService screenProjectQuantityOrgMonthlyService; + @Autowired + private ScreenProjectGridDailyService screenProjectGridDailyService; + @Autowired + private ScreenProjectOrgDailyService screenProjectOrgDailyService; + @Autowired + private ScreenProjectSettleService screenProjectSettleService; + /** * @param extractOriginFormDTO * @Description 抽取数据到大屏【天】 @@ -165,10 +179,31 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { } //基层治理- 难点赌点 screen_difficulty_data | screen_difficulty_img_data try { + log.info("【难点赌点数据上报开始------】 当前客户Id{}",param.getCustomerId()); screenGrassrootsGovernDataAbsorptionService.difficultyDataHub(param); + log.info("【难点赌点数据上报结束------】 当前客户Id{}",param.getCustomerId()); }catch (Exception e){ log.error("基层治理-难点赌点抽取到大屏失败,customerId为:"+customerId+"dateId为:"+dateId, e); } + try { + // 项目(事件)分析按网格_按天统计 + screenProjectGridDailyService.extractionProjectGridDaily(customerId, dateId); + }catch (Exception e){ + log.error("项目(事件)分析按网格_按天统计失败,customerId为:"+customerId+"dateId为:"+dateId, e); + } + try { + // 项目(事件)分析按组织_按天统计 + screenProjectOrgDailyService.extractionProjectOrgDaily(customerId, dateId); + }catch (Exception e){ + log.error("项目(事件)分析按组织_按天统计失败,customerId为:"+customerId+"dateId为:"+dateId, e); + } + //项目分类打标签未上线,暂时屏蔽 + /*try{ + //大屏项目数据抽取_按天抽取 + screenProjectSettleService.extractScreenData(param); + }catch (Exception e){ + log.error("大屏项目数据抽取_按天抽取_按天统计失败,customerId为:"+customerId+"dateId为:"+dateId, e); + }*/ log.info("===== extractDaily method end ======"); } @@ -245,6 +280,18 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { }catch(Exception e){ log.error("大屏热心市民/党员得分数据写入失败,参数为:{}" + JSON.toJSONString(formDTO), e); } + try { + // 项目(事件)数量分析按网格_按月统计 + screenProjectQuantityGridMonthlyService.extractionProjectGridMonthly(customerId, monthId); + }catch (Exception e){ + log.error("项目(事件)数量分析按网格_按月统计失败,参数为{}" + JSON.toJSONString(formDTO),e); + } + try { + // 项目(事件)数量分析按组织_按月统计 + screenProjectQuantityOrgMonthlyService.extractionProjectOrgMonthly(customerId, monthId); + }catch (Exception e){ + log.error("项目(事件)数量分析按组织_按月统计失败,参数为{}" + JSON.toJSONString(formDTO),e); + } //此方法保持在最后即可 计算指标分数 todo 优化 手动创建线程池 控制任务数量 ExecutorService pool = Executors.newSingleThreadExecutor(); pool.submit(() -> { @@ -254,7 +301,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { formDTO1.setMonthId(monthId); formDTO1.setCustomerId(customerId); Boolean aBoolean = indexCalculateService.indexCalculate(formDTO1); - HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + formDTO.getCustomerId() + ",calculateAll全部指标计算完成,是否成功:" + aBoolean + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒"); + HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + formDTO.getCustomerId() + ";monthId:" + formDTO1.getMonthId() + ",calculateAll全部指标计算完成,是否成功:" + aBoolean + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒"); } catch (Exception e) { log.error("extractMonthly 计算分数异常,参数:{}", JSON.toJSONString(formDTO1)); } 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 2f6f0b6a44..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,9 @@ 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/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java new file mode 100644 index 0000000000..590f8c3df6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -0,0 +1,164 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.ScreenProjectImgDataDTO; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.dto.screen.ScreenProjectProcessDTO; +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; +import com.epmet.entity.project.ProjectEntity; +import com.epmet.service.Issue.IssueService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenProjectSettleService; +import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; +import com.epmet.service.evaluationindex.screen.ScreenProjectImgDataService; +import com.epmet.service.evaluationindex.screen.ScreenProjectProcessAttachmentService; +import com.epmet.service.evaluationindex.screen.ScreenProjectProcessService; +import com.epmet.service.project.ProjectProcessService; +import com.epmet.service.project.ProjectService; +import com.epmet.service.topic.TopicService; +import com.epmet.service.user.UserService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Description + * @ClassName ScreenProjectSettleServiceImpl + * @Auth wangc + * @Date 2021-03-04 23:10 + */ +@Service +@Slf4j +public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleService { + + + @Autowired + private ScreenProjectDataService targetDbService; + @Autowired + private FactOriginProjectMainDailyService originMainService; + @Autowired + private ProjectService projectService; + @Autowired + private ProjectProcessService processService; + @Autowired + private TopicService topicService; + @Autowired + private UserService userService; + @Autowired + private IssueService issueService; + @Autowired + private ScreenProjectProcessService targetProcessService; + @Autowired + private ScreenProjectImgDataService targetImgService; + @Autowired + private ScreenProjectProcessAttachmentService targetAttachmentService; + + /** + * @Description 抽取项目数据到screen_project_* + * @param param + * @return void + * @author wangc + * @date 2021.03.04 23:09 + */ + @Override + public void extractScreenData(ScreenCentralZoneDataFormDTO param) { + int rows = targetDbService.checkIfExisted(param.getCustomerId()); + List exceedParams = projectService.getProjectExceedParams(param.getCustomerId()); + Integer exceedLimit = NumConstant.FIVE; + Integer about2ExceedLimit = NumConstant.FIVE; + + + if(!CollectionUtils.isEmpty(exceedParams)){ + for(ProjectExceedParamsResultDTO ex :exceedParams){ + if(null != ex.getDefaultExceedLimit()){ + exceedLimit = null == ex.getExceedLimit() ? ex.getDefaultExceedLimit() : ex.getExceedLimit(); + } + if(null != ex.getDefaultAbout2ExceedLimit()){ + about2ExceedLimit = null == ex.getAbout2ExceedLimit() ? ex.getDefaultAbout2ExceedLimit() : ex.getDefaultAbout2ExceedLimit(); + } + } + } + //因为即将超期提醒时间(天)就是即将超期期限,在表中存储的是超期前多少天 + //所以这里要换算成滞留日 + about2ExceedLimit = exceedLimit >= about2ExceedLimit ? exceedLimit - about2ExceedLimit : exceedLimit; + List metaData = + originMainService.initNewScreenProjectData(param.getCustomerId(), rows , param.getDateId(),exceedLimit,about2ExceedLimit); + + if(!CollectionUtils.isEmpty(metaData)) { + List info = projectService.getProjectInfo(metaData.stream().map(ScreenProjectDataDTO::getProjectId).collect(Collectors.toList())); + if(!CollectionUtils.isEmpty(info)){ + metaData = metaData.stream().flatMap(meta -> info.stream().filter(nature -> StringUtils.equals(meta.getProjectId(), + nature.getId())).map(projectInfo -> { + meta.setProjectCreateTime(projectInfo.getCreatedTime()); + meta.setProjectTitle(projectInfo.getTitle()); + return meta; + })).collect(Collectors.toList()); + } + topicService.fillScreenProjectData(metaData); + //metaData = Optional.ofNullable(topicService.getScreenProjectData(metaData)).orElse(metaData); + userService.fillScreenProjectData(metaData); + //metaData = Optional.ofNullable(userService.getScreenProjectData(metaData)).orElse(metaData); + } + + ScreenProjectDataDTO orientCase = new ScreenProjectDataDTO(); + orientCase.setCustomerId(param.getCustomerId()); + //待更新的数据 需要检测更新的字段为:①projectStatusCode ②closeCaseTime ③allCategoryName ④projectLevel + List orientData = + targetDbService.getPending(orientCase,param.getDateId()); + + // 给metaData和orientData赋上分类信息 + List projectIds = + Optional.ofNullable(metaData.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())).orElse(new ArrayList<>()); + if(!CollectionUtils.isEmpty(orientData)) + projectIds.addAll(orientData.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())); + Map> categoryMap = projectService.getProjectCategory(projectIds); + if(!CollectionUtils.isEmpty(categoryMap)){ + Map integratedProjectCategoryMap = issueService.getIntegratedProjectCategory(categoryMap, param.getCustomerId()); + if(!CollectionUtils.isEmpty(integratedProjectCategoryMap)){ + metaData.forEach(meta -> { + meta.setAllCategoryName(integratedProjectCategoryMap.get(meta.getProjectId())); + }); + orientData.forEach(orient -> { + orient.setAllCategoryName(integratedProjectCategoryMap.get(orient.getProjectId())); + }); + } + } + + //重新计算orientData的级别 有现成的方法 fact_origin_project_org_period_daily + originMainService.computerIfExceed(orientData, exceedLimit,about2ExceedLimit); + processService.updateProjectCloseTime(metaData); + //更新结案时间和结案状态 + processService.updateProjectStatus(orientData,param.getDateId(),param.getCustomerId()); + + targetDbService.insertOrUpdateBatch(param.getCustomerId(),param.getDateId(),metaData,orientData); + + if(!CollectionUtils.isEmpty(metaData)){ + List imgs = topicService.buildNewScreenProjectImgData(metaData); + if(!CollectionUtils.isEmpty(imgs)){ + + targetImgService.insertBatch(imgs); + } + } + + // + List processes = processService.buildNewScreenProjectProcessData(param.getCustomerId(), param.getDateId(),!targetProcessService.checkIfHistoricalDataExists(param.getCustomerId())); + if(!CollectionUtils.isEmpty(processes)){ + targetProcessService.insertBatch(processes,param.getCustomerId(),param.getDateId()); + List attachments = processService.buildProcessAttachmentData(processes.stream().map(ScreenProjectProcessDTO::getProcessId).distinct().collect(Collectors.toList())); + if(!CollectionUtils.isEmpty(attachments)){ + + targetAttachmentService.insertBatch(attachments); + } + } + + + } + +} 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/IndexCalculateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java index 7866473d6f..d5d41e48a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java @@ -1,6 +1,8 @@ package com.epmet.service.evaluationindex.indexcal; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.CustomerSubInfoDTO; +import com.epmet.dto.indexcal.IndexStatisticsFormDTO; /** * 指标计算service @@ -16,4 +18,16 @@ public interface IndexCalculateService { * @return */ Boolean indexCalculate(CalculateCommonFormDTO formDTO); + + Boolean indexStatistics(IndexStatisticsFormDTO formDTO); + + /** + * @return void + * @param formDTO + * @description 单独将分数插入screen_index_data_monthly,screen_index_data_yearly + * @Date 2021/3/4 18:54 + **/ + void toScreenIndexData(CalculateCommonFormDTO formDTO); + + CustomerSubInfoDTO getCustomerSubInfo(String customerId); } 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..693f02c50d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -11,6 +11,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.constant.ProjectConstant; +import com.epmet.constant.ScreenConstant; import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao; import com.epmet.dao.evaluationindex.indexcal.CommunitySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.CommunitySubScoreDao; @@ -81,29 +82,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 +589,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.selectPublishArticleCountMapbyAreaCodeNotSelf( 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.selectCommunityGovernAbilityExistsSubNotSelf(form.getMonthId(),form.getCustomerAreaCode(), ScreenConstant.COMMUNITY); + 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.selectActivityCountMapExistsSubNotSelf(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(),form.getCustomerId()); + 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..9c3328f6ca 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -23,6 +23,7 @@ import com.epmet.dto.indexcal.AgencyCalResultDTO; import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; +import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; import com.epmet.entity.evaluationindex.indexcal.AgencySelfSubScoreEntity; import com.epmet.entity.evaluationindex.indexcal.AgencySubScoreEntity; @@ -79,29 +80,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(); @@ -202,6 +226,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); + log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString()); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); } else if (subGridPartyAvgScore.size() > NumConstant.ZERO) { @@ -224,6 +249,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } else { // 区名义发文数量 List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL); + log.info("publishArticleCountList:::"+publishArticleCountList.toString()); if (CollectionUtils.isEmpty(publishArticleCountList)) { log.warn(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); } else { @@ -278,6 +304,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); + log.info("districtGovernAvgList:::"+districtGovernAvgList.toString()); for (int i = 0; i < districtGovernAvgList.size(); i++) { if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ districtGovernAvgList.remove(districtGovernAvgList.get(i)); @@ -304,6 +331,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + log.info("deptScoreAvgList:::"+deptScoreAvgList.toString()); for (int i = 0; i < deptScoreAvgList.size(); i++) { if (deptScoreAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ deptScoreAvgList.remove(deptScoreAvgList.get(i)); @@ -358,6 +386,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); + log.info("subStreetAvgList:::"+subStreetAvgList.toString()); for (int i = 0; i < subStreetAvgList.size(); i++) { if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ subStreetAvgList.remove(subStreetAvgList.get(i)); @@ -407,6 +436,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict public Boolean districtRelate(String customerId, String monthId) { List detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); List agencyScoreList = agencyScoreDao.selectAgencyScoreInfo(customerId, monthId, IndexCalConstant.DISTRICT_LEVEL); + log.info("agencyScoreList:::"+agencyScoreList.toString()); detailListByParentCode.forEach(detail -> { agencyScoreList.forEach(community -> { if (detail.getIndexCode().equals(community.getIndexCode())) { @@ -562,4 +592,288 @@ 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(),form.getCustomerAreaCode()); + log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString()); + 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); + }else { + pid.put(c.getAgencyId(), customerAgencyDao.selectPid(c.getAgencyId())); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + } + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); + indexInputVOS.add(index1VO); + }); + } + } else { + // 区名义发文数量 + List> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubNotSelf(monthId,form.getCustomerAreaCode()); + log.info("publishArticleCountList:::"+publishArticleCountList.toString()); + 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(),form.getCustomerAreaCode()); + log.info("districtGovernAvgList:::"+districtGovernAvgList.toString()); + 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); + }else { + pid.put(c.getAgencyId(), customerAgencyDao.selectPid(c.getAgencyId())); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + } + }); + BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc); + indexInputVOS.add(index1VO); + }); + } + } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ + List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvgExistsSubNotSelf(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); + log.info("deptScoreAvgList:::"+deptScoreAvgList.toString()); + 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(),form.getCustomerAreaCode()); + log.info("subStreetAvgList:::"+subStreetAvgList.toString()); + for (int i = 0; i < subStreetAvgList.size(); i++) { + if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ + subStreetAvgList.remove(subStreetAvgList.get(i)); + } + } + 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); + }else { + pid.put(c.getAgencyId(), customerAgencyDao.selectPid(c.getAgencyId())); + SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + index1SampleValues.add(s); + } + }); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), IndexCodeEnum.isAvgIndex(detail.getIndexCode()), sc1); + indexInputVOS.add(index1VO); + }); + } + } 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.selectAgencyScoreInfoExistsSubSelf(form.getCustomerAreaCode(),monthId, IndexCalConstant.DISTRICT_LEVEL,form.getCustomerId()); + log.info("agencyScoreList:::"+agencyScoreList.toString()); + 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); + }); + log.info("result:::"+result.toString()); + 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..01d7f5d581 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java @@ -2,20 +2,27 @@ package com.epmet.service.evaluationindex.indexcal.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.CustomerSubInfoDTO; +import com.epmet.dto.indexcal.IndexStatisticsFormDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.redis.IndexCalRedis; +import com.epmet.service.crm.CustomerRelationService; +import com.epmet.service.evaluationindex.extract.dataToIndex.IndexOriginExtractService; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import java.util.ArrayList; @@ -50,7 +57,10 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { private FactIndexCollectService factIndexCollectService; @Autowired private ScreenCustomerAgencyDao screenCustomerAgencyDao; - + @Autowired + private CustomerRelationService customerRelationService; + @Autowired + private IndexOriginExtractService indexOriginExtractService; @Override public Boolean indexCalculate(CalculateCommonFormDTO formDTO) { @@ -71,15 +81,25 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { } else { customerIds.add(formDTO.getCustomerId()); } + + Boolean flag = false; for (String customerId : customerIds) { CalculateCommonFormDTO param = new CalculateCommonFormDTO(); param.setCustomerId(customerId); param.setMonthId(formDTO.getMonthId()); + //01.14 add 查询客户编码、以及下一级客户列表 + CustomerSubInfoDTO customerSubInfoDTO=this.getCustomerSubInfo(customerId); + if (null != customerSubInfoDTO) { + param.setCustomerAreaCode(customerSubInfoDTO.getCustomerAreaCode()); + param.setSubCustomerIds(customerSubInfoDTO.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 +142,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,13 +151,13 @@ 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); } - //计算区直属 + //计算部门相关 start = System.currentTimeMillis(); try { flag = deptScoreService.calculateDeptCorreLation(formDTO); @@ -149,7 +169,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 +183,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 +198,71 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { } return false; } + + /** + * @param customerId + * @author yinzuomei + * @description 查询当前客户的area_code信息、以及下一级客户列表 + * @Date 2021/1/21 11:28 + **/ + @Override + public CustomerSubInfoDTO getCustomerSubInfo(String customerId) { + return customerRelationService.getCustomerSubInfo(customerId); + } + + @Async + @Override + public Boolean indexStatistics(IndexStatisticsFormDTO formDTO) { + List customerIds = new ArrayList<>(); + if (StringUtils.isEmpty(formDTO.getCustomerId())){ + Result> externalCustomerIds = epmetCommonServiceOpenFeignClient.getExternalCustomerIds(); + if (!externalCustomerIds.success()){ + log.error("indexCalculate epmetCommonServiceOpenFeignClient.getExternalCustomerIds return fail"); + return false; + } + customerIds = externalCustomerIds.getData(); + }else customerIds.add(formDTO.getCustomerId()); + List monthIds = new ArrayList<>(); + if (StringUtils.isNotEmpty(formDTO.getStartMonth()) && StringUtils.isNotEmpty(formDTO.getEndMonth())){ + monthIds = DateUtils.getMonthBetween(formDTO.getStartMonth(),formDTO.getEndMonth()); + log.info(JSON.toJSONString(monthIds)); + }else { + if (StringUtils.isEmpty(formDTO.getMonthId())){ + // 默认上月 + monthIds.add(DimIdGenerator.getMonthDimId(DateUtils.addDateMonths(new Date(), -1))); + }else monthIds.add(formDTO.getMonthId()); + } + List finalMonthIds = monthIds; + customerIds.forEach(customerId -> { + finalMonthIds.forEach(monthId -> { + CalculateCommonFormDTO extractFormDTO = new CalculateCommonFormDTO(); + extractFormDTO.setCustomerId(customerId); + extractFormDTO.setMonthId(monthId); + long start = System.currentTimeMillis(); + boolean calFlag=this.indexCalculate(extractFormDTO); + HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() + "客户Id:" + extractFormDTO.getCustomerId() + ";monthId:" + extractFormDTO.getMonthId() + ",calculateAll全部指标计算完成,是否成功:" + calFlag + ",总耗时:" + (System.currentTimeMillis() - start) / 1000 + "秒"); + }); + }); + return true; + } + + /** + * @param formDTO + * @return void + * @description 单独将分数插入screen_index_data_monthly, screen_index_data_yearly + * @Date 2021/3/4 18:54 + **/ + @Override + public void toScreenIndexData(CalculateCommonFormDTO formDTO) { + //查询客户编码、以及下一级客户列表 add01.14 + CustomerSubInfoDTO customerSubInfoDTO = this.getCustomerSubInfo(formDTO.getCustomerId()); + log.info("customerInfoMap: " + JSON.toJSONString(customerSubInfoDTO, true)); + //01.14 add + if (null != customerSubInfoDTO) { + formDTO.setCustomerAreaCode(customerSubInfoDTO.getCustomerAreaCode()); + formDTO.setSubCustomerIds(customerSubInfoDTO.getSubCustomerIds()); + } + log.info("入参: " + JSON.toJSONString(formDTO, true)); + factIndexCollectService.insertScreenIndexDataMonthlyAndYearly(formDTO); + } } 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..552efefa9d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -8,10 +8,7 @@ import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.constant.DataSourceConstant; -import com.epmet.constant.IndexCalConstant; -import com.epmet.constant.OrgTypeConstant; -import com.epmet.constant.ProjectConstant; +import com.epmet.constant.*; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao; import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao; @@ -20,10 +17,12 @@ import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dto.indexcal.AgencyCalResultDTO; import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; +import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; import com.epmet.entity.evaluationindex.indexcal.AgencySelfSubScoreEntity; import com.epmet.entity.evaluationindex.indexcal.AgencySubScoreEntity; @@ -49,6 +48,7 @@ import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.util.*; +import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; /** @@ -80,31 +80,56 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ private IndexGroupDetailDao indexGroupDetailDao; @Autowired private AgencySelfSubScoreDao agencySelfSubScoreDao; + @Autowired + private ScreenCustomerAgencyDao customerAgencyDao; /** - * @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 +593,351 @@ 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 dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode()); + List subCommPartyAvgScore = disposeSubAvg(dispose, form); + 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 -> { + c.setParentId(customerAgencyDao.selectAgencyId(form.getCustomerAreaCode())); + 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.selectPublishArticleCountMapExistSubStreet(monthId,form.getCustomerAreaCode()); + 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 dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); + List subGridGovernAvg = disposeSubAvg(dispose,form); + 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 -> { + c.setParentId(customerAgencyDao.selectAgencyId(form.getCustomerAreaCode())); + 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 = disposeFiveLevel(form); + 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 dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode()); + List subCommServiceAvg = disposeSubAvg(dispose,form); + 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 -> { + c.setParentId(customerAgencyDao.selectAgencyId(form.getCustomerAreaCode())); + 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 = disposeActivityCount(form); + 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(), monthId, IndexCalConstant.STREET_LEVEL,form.getCustomerId()); + 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; + } + + public List disposeSubAvg(List avgScore, CalculateCommonFormDTO formDTO){ + List orgIds = customerAgencyDao.selectAgencyByParentAreaCode(formDTO.getCustomerAreaCode()); + List subAvgScores = new ArrayList<>(); + orgIds.forEach(org -> { + SubCommunityAvgResultDTO s = new SubCommunityAvgResultDTO(); + s.setAgencyId(org.getOrgId()); + subAvgScores.add(s); + }); + subAvgScores.forEach(subScore -> { + if (!CollectionUtils.isEmpty(avgScore)){ + avgScore.forEach(avg -> { + if (subScore.getAgencyId().equals(avg.getParentId())){ + subScore.setScore(avg.getScore()); + avg.setScoreStatus(true); + } + }); + } + }); + Map> groupByStatus = avgScore.stream().collect(Collectors.groupingBy(SubCommunityAvgResultDTO::getScoreStatus)); + List subAvgResultDTOS = groupByStatus.get(false); + if (!CollectionUtils.isEmpty(subAvgResultDTOS)){ + AtomicReference finalScore = new AtomicReference<>(new BigDecimal(NumConstant.ZERO)); + subAvgResultDTOS.forEach(sub -> { + finalScore.set(finalScore.get().add(sub.getScore())); + }); + BigDecimal divide = finalScore.get().divide(new BigDecimal(subAvgResultDTOS.size())); + subAvgScores.forEach(s -> { + if (s.getAgencyId().equals("1234085031077498881")){ + s.setScore(divide); + } + }); + } + return subAvgScores; + } + + public List> disposeFiveLevel(CalculateCommonFormDTO formDTO){ + List> result = new ArrayList<>(); + List> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(formDTO.getMonthId(),formDTO.getCustomerAreaCode(), ScreenConstant.STREET); + List> kongCunGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode()); + if (!CollectionUtils.isEmpty(kongCunGovernAbility)){ + kongCunGovernAbility.forEach(k -> { + k.put("AGENCY_ID",k.get("PARENT_ID")); + k.put("PARENT_ID",NumConstant.ZERO_STR); + }); + } + if (!CollectionUtils.isEmpty(communityGovernAbility)){ + result.addAll(communityGovernAbility); + } + if (!CollectionUtils.isEmpty(kongCunGovernAbility)){ + result.addAll(kongCunGovernAbility); + } + return result; + } + + public List> disposeActivityCount(CalculateCommonFormDTO formDTO){ + List> result = new ArrayList<>(); + List> ActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSub(formDTO.getMonthId(),formDTO.getCustomerAreaCode()); + List> kongCunActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode()); + if (!CollectionUtils.isEmpty(kongCunActivityCountList)){ + kongCunActivityCountList.forEach(k -> { + k.put("AGENCY_ID",k.get("PARENT_ID")); + k.put("PARENT_ID",NumConstant.ZERO_STR); + }); + } + if (!CollectionUtils.isEmpty(ActivityCountList)){ + result.addAll(ActivityCountList); + } + if (!CollectionUtils.isEmpty(kongCunActivityCountList)){ + result.addAll(kongCunActivityCountList); + } + return result; + } } 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..7df7c2920d 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()); @@ -515,7 +518,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } if ("".equals(agencyName)) { - log.error("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + communityScore.getKey()); + log.error("1)在screen_customer_agency表中未查询到该客户下的组织名称:当前计算的customerId =" + customerId + ", agencyId = " + communityScore.getKey()); continue; } // 补充表中其他字段 @@ -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 -> { @@ -745,7 +753,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } if ("".equals(agencyName)) { - log.error("在screen_customer_agency表中未查询到该客户下的组织名称:customerId =" + customerId + ", agencyId = " + agencyScore.getKey()); + log.error("2)在screen_customer_agency表中未查询到该客户下的组织名称:当前计算的customerId =" + customerId + ", agencyId = " + agencyScore.getKey()); continue; } // 补充表中其他字段 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java index 15a9d72a35..a347d5286d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java @@ -17,7 +17,7 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 16:41 */ - void communityProjectProfile(ScreenCollFormDTO formDTO,String customerId); + void communityProjectProfile(ScreenCollFormDTO formDTO); /** * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 @@ -27,7 +27,7 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 17:19 */ - void pmRank(ScreenCollFormDTO formDTO,String customerId); + void pmRank(ScreenCollFormDTO formDTO); /** * @Description 安宁大屏数据采集 - 基层党员-各类总数 @@ -37,7 +37,7 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 17:20 */ - void pmTotal(ScreenCollFormDTO formDTO,String customerId); + void pmTotal(ScreenCollFormDTO formDTO); /** * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 @@ -46,7 +46,7 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 17:22 */ - void grassrootsOrg(ScreenCollFormDTO formDTO,String customerId); + void grassrootsOrg(ScreenCollFormDTO formDTO); /** * @Description 安宁大屏数据采集 - 基层治理-各类数 @@ -55,5 +55,5 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 17:23 */ - void grassrootsGovern(ScreenCollFormDTO formDTO,String customerId); + void grassrootsGovern(ScreenCollFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/KcScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/KcScreenCollService.java index 492a951156..5eaca5388c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/KcScreenCollService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/KcScreenCollService.java @@ -17,12 +17,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertPlatFormSummary(ScreenCollFormDTO formDTO, String customerId); + void insertPlatFormSummary(ScreenCollFormDTO formDTO); /** * 2、议题分析-各类总数 @@ -30,12 +29,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertIssueSummary(ScreenCollFormDTO formDTO, String customerId); + void insertIssueSummary(ScreenCollFormDTO formDTO); /** * 3、议题分析-参与趋势 @@ -43,12 +41,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertIssueTrend(ScreenCollFormDTO formDTO, String customerId); + void insertIssueTrend(ScreenCollFormDTO formDTO); /** * 4、用户分析-各类总数 @@ -56,12 +53,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertUserSummary(ScreenCollFormDTO formDTO, String customerId); + void insertUserSummary(ScreenCollFormDTO formDTO); /** * 5、公益互助-志愿者公益时长排名 @@ -69,12 +65,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertVolunteerHeartRank(ScreenCollFormDTO formDTO, String customerId); + void insertVolunteerHeartRank(ScreenCollFormDTO formDTO); /** * 6、用户分析-用户趋势 @@ -82,12 +77,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertUserHeartRank(ScreenCollFormDTO formDTO, String customerId); + void insertUserHeartRank(ScreenCollFormDTO formDTO); /** * 7、公益互助-活动各类总数 @@ -95,12 +89,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertActSummary(ScreenCollFormDTO formDTO, String customerId); + void insertActSummary(ScreenCollFormDTO formDTO); /** * 8、公益互助-活动次数趋势 @@ -108,12 +101,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertActTrend(ScreenCollFormDTO formDTO, String customerId); + void insertActTrend(ScreenCollFormDTO formDTO); /** * 9、公益互助-志愿者画像 @@ -121,12 +113,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertVolunteerSummary(ScreenCollFormDTO formDTO, String customerId); + void insertVolunteerSummary(ScreenCollFormDTO formDTO); /** * 10、项目分析-各类总数 @@ -134,12 +125,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertProjectSummary(ScreenCollFormDTO formDTO, String customerId); + void insertProjectSummary(ScreenCollFormDTO formDTO); /** * 11、项目分析-按分类统计 @@ -147,12 +137,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertCategorySummary(ScreenCollFormDTO formDTO, String customerId); + void insertCategorySummary(ScreenCollFormDTO formDTO); /** * 12、项目分析-满意度分析 @@ -160,12 +149,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertProjectSatisanalysis(ScreenCollFormDTO formDTO, String customerId); + void insertProjectSatisanalysis(ScreenCollFormDTO formDTO); /** * 13、党建声音-新闻各类总数汇总 @@ -173,12 +161,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertNewsSummary(ScreenCollFormDTO formDTO, String customerId); + void insertNewsSummary(ScreenCollFormDTO formDTO); /** * 14、党建声音-新闻阅读参与趋势 @@ -186,12 +173,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertNewsTrend(ScreenCollFormDTO formDTO, String customerId); + void insertNewsTrend(ScreenCollFormDTO formDTO); /** * 15、党建声音-热度新闻排行 @@ -199,12 +185,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertNewsHotRank(ScreenCollFormDTO formDTO, String customerId); + void insertNewsHotRank(ScreenCollFormDTO formDTO); /** * 16、党建声音-新闻按类别统计 @@ -212,12 +197,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertNewsCategoryAnalysis(ScreenCollFormDTO formDTO, String customerId); + void insertNewsCategoryAnalysis(ScreenCollFormDTO formDTO); /** * 17、邻里党群-各类总数汇总 @@ -225,12 +209,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertGroupSummary(ScreenCollFormDTO formDTO, String customerId); + void insertGroupSummary(ScreenCollFormDTO formDTO); /** * 18、邻里党群-小组详情 @@ -238,12 +221,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertGroupDetail(ScreenCollFormDTO formDTO, String customerId); + void insertGroupDetail(ScreenCollFormDTO formDTO); /** * 19、邻里党群-话题参与趋势 @@ -251,10 +233,9 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertGroupTopicTrend(ScreenCollFormDTO formDTO, String customerId); + void insertGroupTopicTrend(ScreenCollFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java index 314bd3181a..de2b431ded 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCpcBaseDataService.java @@ -43,12 +43,11 @@ public interface ScreenCpcBaseDataService extends BaseService orgIds); + Integer deleteOldPartyBaseInfo(String customerId, List orgIds); /** * @Description 查询党员信息【根据agencyId来查】 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..da711d85e3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridDailyService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.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 param + * @return void + */ + void collect(ScreenCollFormDTO param); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryOrgDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryOrgDailyService.java new file mode 100644 index 0000000000..ce71722794 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryOrgDailyService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.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 param + * @return void + */ + void collect(ScreenCollFormDTO param); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java new file mode 100644 index 0000000000..b6f2c25c15 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.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.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(ScreenCollFormDTO param); + + + /** + * @Description 查询是否存在客户的数据 + * @param customerId + * @return int + * @author wangc + * @date 2021.03.04 23:35 + */ + int checkIfExisted(String customerId); + + /** + * @Description 获取客户下已经入库而且未结案的数据集 + * @param + * @return + * @author wangc + * @date 2021.03.08 09:32 + */ + List getPending(ScreenProjectDataDTO param,String dateId); + + /** + * @Description collect或更新 + * @param + * @return void + * @author wangc + * @date 2021.03.09 17:36 + */ + void insertOrUpdateBatch(String customerId,String dateId,List meta,List orient); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/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..7702f0cfd1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectGridDailyService.java @@ -0,0 +1,113 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + void collect(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..fb170d618d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectImgDataService.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; + +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); + + void insertBatch(List list); + +} 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..ee1f4bf1e7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectOrgDailyService.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.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 data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + void collect(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..44289bdfc7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessAttachmentService.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.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); + + void insertBatch(List list); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessService.java new file mode 100644 index 0000000000..62be8b8746 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessService.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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(ScreenCollFormDTO param); + + boolean checkIfHistoricalDataExists(String customerId); + + void insertBatch(List list,String customerId,String dateId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/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..da29112ad7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java @@ -0,0 +1,113 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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 data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + void collect(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..6088a6dba4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.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.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 data + * @return void + * @author wangc + * @date 2021.01.28 09:33 + */ + void collect(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/AnScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java index e5229f146b..30adab1c63 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java @@ -4,11 +4,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; -import com.epmet.dao.evaluationindex.screen.ScreenAnCommunityProjectProfileDao; -import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsGovernMonthlyDao; -import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsOrgMonthlyDao; -import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmRankDao; -import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmTotalMonthlyDao; +import com.epmet.dao.evaluationindex.screen.*; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.AnScreenCollService; @@ -17,10 +13,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - - -import java.util.List; /** @@ -56,17 +48,17 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void communityProjectProfile(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void communityProjectProfile(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = communityProjectProfileDao.deleteBatch(customerId); + int affectRows = communityProjectProfileDao.deleteBatch(formDTO.getCustomerId()); while(affectRows >= NumConstant.ONE){ - affectRows = communityProjectProfileDao.deleteBatch(customerId); + affectRows = communityProjectProfileDao.deleteBatch(formDTO.getCustomerId()); } } Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { - communityProjectProfileDao.insertBatch(list,customerId); + communityProjectProfileDao.insertBatch(list,formDTO.getCustomerId()); }); } @@ -81,17 +73,17 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void pmRank(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void pmRank(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = pmRankDao.deleteBatch(customerId,formDTO.getMonthId()); + int affectRows = pmRankDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); while(affectRows >= NumConstant.ONE){ - affectRows = pmRankDao.deleteBatch(customerId,formDTO.getMonthId()); + affectRows = pmRankDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); } } Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { - pmRankDao.insertBatch(list,customerId); + pmRankDao.insertBatch(list,formDTO.getCustomerId()); }); } @@ -105,21 +97,21 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void pmTotal(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void pmTotal(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = pmTotalMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + int affectRows = pmTotalMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); while(affectRows >= NumConstant.ONE){ - affectRows = pmTotalMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + affectRows = pmTotalMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); } } String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { pmTotalMonthlyDao.insertBatch(list, - customerId, + formDTO.getCustomerId(), formDTO.getMonthId(), quarterId, yearId); @@ -136,21 +128,21 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void grassrootsOrg(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void grassrootsOrg(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = orgMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + int affectRows = orgMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); while(affectRows >= NumConstant.ONE){ - affectRows = orgMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + affectRows = orgMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); } } String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { orgMonthlyDao.insertBatch(list, - customerId, + formDTO.getCustomerId(), formDTO.getMonthId(), quarterId, yearId); @@ -167,21 +159,21 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void grassrootsGovern(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void grassrootsGovern(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = governMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + int affectRows = governMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); while(affectRows >= NumConstant.ONE){ - affectRows = governMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + affectRows = governMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); } } String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { governMonthlyDao.insertBatch(list, - customerId, + formDTO.getCustomerId(), formDTO.getMonthId(), quarterId, yearId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/KcScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/KcScreenCollServiceImpl.java index 2e4abd79df..dc3bed6bd7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/KcScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/KcScreenCollServiceImpl.java @@ -82,285 +82,285 @@ public class KcScreenCollServiceImpl implements KcScreenCollService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertPlatFormSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertPlatFormSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcPlatformSummaryDailyDao.deletePlatFormSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcPlatformSummaryDailyDao.deletePlatFormSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcPlatformSummaryDailyDao.batchInsertPlatFormSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcPlatformSummaryDailyDao.batchInsertPlatFormSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertIssueSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertIssueSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcIssueSummaryGridDailyDao.deleteIssueSummaryGrid(customerId, formDTO.getDateId()); + deleteNum = screenKcIssueSummaryGridDailyDao.deleteIssueSummaryGrid(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcIssueSummaryGridDailyDao.batchInsertIssueSummaryGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcIssueSummaryGridDailyDao.batchInsertIssueSummaryGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertIssueTrend(ScreenCollFormDTO formDTO, String customerId) { + public void insertIssueTrend(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcIssueTrendGridMonthlyDao.deleteIssueTrendGrid(customerId, formDTO.getMonthId()); + deleteNum = screenKcIssueTrendGridMonthlyDao.deleteIssueTrendGrid(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcIssueTrendGridMonthlyDao.batchInsertIssueTrendGrid(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcIssueTrendGridMonthlyDao.batchInsertIssueTrendGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertUserSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertUserSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcUserSummaryDailyDao.deleteUserSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcUserSummaryDailyDao.deleteUserSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcUserSummaryDailyDao.batchInsertUserSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcUserSummaryDailyDao.batchInsertUserSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertVolunteerHeartRank(ScreenCollFormDTO formDTO, String customerId) { + public void insertVolunteerHeartRank(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcVolunteerHeatRankGridDailyDao.deleteVolunteerHeatRankGrid(customerId); + deleteNum = screenKcVolunteerHeatRankGridDailyDao.deleteVolunteerHeatRankGrid(formDTO.getCustomerId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcVolunteerHeatRankGridDailyDao.batchInsertVolunteerHeatRankGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcVolunteerHeatRankGridDailyDao.batchInsertVolunteerHeatRankGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertUserHeartRank(ScreenCollFormDTO formDTO, String customerId) { + public void insertUserHeartRank(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcUserTrendGridMonthlyDao.deleteUserTrendGrid(customerId, formDTO.getMonthId()); + deleteNum = screenKcUserTrendGridMonthlyDao.deleteUserTrendGrid(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcUserTrendGridMonthlyDao.batchInsertUserTrendGrid(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcUserTrendGridMonthlyDao.batchInsertUserTrendGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertActSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertActSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcActSummaryDailyDao.deleteActSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcActSummaryDailyDao.deleteActSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcActSummaryDailyDao.batchInsertActSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcActSummaryDailyDao.batchInsertActSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertActTrend(ScreenCollFormDTO formDTO, String customerId) { + public void insertActTrend(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcActTrendMonthlyDao.deleteActTrend(customerId, formDTO.getMonthId()); + deleteNum = screenKcActTrendMonthlyDao.deleteActTrend(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcActTrendMonthlyDao.batchInsertActTrend(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcActTrendMonthlyDao.batchInsertActTrend(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertVolunteerSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertVolunteerSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcVolunteerSummaryDailyDao.deleteVolunteerSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcVolunteerSummaryDailyDao.deleteVolunteerSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcVolunteerSummaryDailyDao.batchInsertVolunteerSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcVolunteerSummaryDailyDao.batchInsertVolunteerSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertProjectSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertProjectSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcProjectSummaryGridDailyDao.deleteProjectSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcProjectSummaryGridDailyDao.deleteProjectSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcProjectSummaryGridDailyDao.batchInsertProjectSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcProjectSummaryGridDailyDao.batchInsertProjectSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertCategorySummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertCategorySummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcProjectCategoryGridDailyDao.deleteCategoryGrid(customerId, formDTO.getDateId()); + deleteNum = screenKcProjectCategoryGridDailyDao.deleteCategoryGrid(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcProjectCategoryGridDailyDao.batchInsertCategoryGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcProjectCategoryGridDailyDao.batchInsertCategoryGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertProjectSatisanalysis(ScreenCollFormDTO formDTO, String customerId) { + public void insertProjectSatisanalysis(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcProjectSatisGridMonthlyDao.deleteProjectSatisGrid(customerId, formDTO.getMonthId()); + deleteNum = screenKcProjectSatisGridMonthlyDao.deleteProjectSatisGrid(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcProjectSatisGridMonthlyDao.batchInsertProjectSatisGrid(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcProjectSatisGridMonthlyDao.batchInsertProjectSatisGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertNewsSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertNewsSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcNewsSummaryDailyDao.deleteNewsSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcNewsSummaryDailyDao.deleteNewsSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcNewsSummaryDailyDao.batchInsertNewsSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcNewsSummaryDailyDao.batchInsertNewsSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertNewsTrend(ScreenCollFormDTO formDTO, String customerId) { + public void insertNewsTrend(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcNewsTrendMonthlyDao.deleteNewsTrend(customerId, formDTO.getMonthId()); + deleteNum = screenKcNewsTrendMonthlyDao.deleteNewsTrend(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcNewsTrendMonthlyDao.batchInsertNewsTrend(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcNewsTrendMonthlyDao.batchInsertNewsTrend(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertNewsHotRank(ScreenCollFormDTO formDTO, String customerId) { + public void insertNewsHotRank(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcNewsRankDao.deleteNewsRank(customerId); + deleteNum = screenKcNewsRankDao.deleteNewsRank(formDTO.getCustomerId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcNewsRankDao.batchInsertNewsRank(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcNewsRankDao.batchInsertNewsRank(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertNewsCategoryAnalysis(ScreenCollFormDTO formDTO, String customerId) { + public void insertNewsCategoryAnalysis(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcNewsCategoryAnalysisDao.deleteNewsCategoryAnalysis(customerId, formDTO.getDateId()); + deleteNum = screenKcNewsCategoryAnalysisDao.deleteNewsCategoryAnalysis(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcNewsCategoryAnalysisDao.batchInsertNewsCategoryAnalysis(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcNewsCategoryAnalysisDao.batchInsertNewsCategoryAnalysis(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGroupSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertGroupSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcGroupSummaryGridDailyDao.deleteGroupSummaryGrid(customerId, formDTO.getDateId()); + deleteNum = screenKcGroupSummaryGridDailyDao.deleteGroupSummaryGrid(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcGroupSummaryGridDailyDao.batchInsertGroupSummaryGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcGroupSummaryGridDailyDao.batchInsertGroupSummaryGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGroupDetail(ScreenCollFormDTO formDTO, String customerId) { + public void insertGroupDetail(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcGroupDetailGridDailyDao.deleteGroupDetailGrid(customerId, formDTO.getDateId()); + deleteNum = screenKcGroupDetailGridDailyDao.deleteGroupDetailGrid(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcGroupDetailGridDailyDao.batchInsertGroupDetailGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcGroupDetailGridDailyDao.batchInsertGroupDetailGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGroupTopicTrend(ScreenCollFormDTO formDTO, String customerId) { + public void insertGroupTopicTrend(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcTopicTrendGridMonthlyDao.deleteTopicTrendGrid(customerId, formDTO.getMonthId()); + deleteNum = screenKcTopicTrendGridMonthlyDao.deleteTopicTrendGrid(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcTopicTrendGridMonthlyDao.batchInsertTopicTrendGrid(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcTopicTrendGridMonthlyDao.batchInsertTopicTrendGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java index 7505476087..5c0ec9a676 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCpcBaseDataServiceImpl.java @@ -51,14 +51,13 @@ public class ScreenCpcBaseDataServiceImpl extends BaseServiceImpl orgIds) { - return baseDao.deleteOldPartyBaseInfo(customerId, dateId,orgIds); + public Integer deleteOldPartyBaseInfo(String customerId, List orgIds) { + return baseDao.deleteOldPartyBaseInfo(customerId,orgIds); } /** 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.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.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 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 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 param + * @return void + * @author zhaoqifeng + * @date 2021/2/24 10:16 + */ + @Override + public void collect(ScreenCollFormDTO param) { + if(param.getIsFirst()){ + int deleteNum; + do { + deleteNum = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(),param.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(param.getDataList())) { + param.getDataList().forEach(item -> { + item.setCustomerId(param.getCustomerId()); + 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..5660fad150 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java @@ -0,0 +1,134 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.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 param + * @return void + * @author zhaoqifeng + * @date 2021/2/24 10:17 + */ + @Override + public void collect(ScreenCollFormDTO param) { + if(param.getIsFirst()){ + int deleteNum; + do { + deleteNum = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(),param.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(param.getDataList())) { + param.getDataList().forEach(item -> { + item.setCustomerId(param.getCustomerId()); + 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..501bfa2c43 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java @@ -0,0 +1,285 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.*; +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 com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.text.ParseException; +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 +@DataSource(value = DataSourceConstant.EVALUATION_INDEX) +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(ScreenCollFormDTO param) { + if (param.getIsFirst()) { + int affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); + while (affectedRows > 0) { + affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); + } + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date today = new Date(); + param.getDataList().forEach(item -> { + String projectStatusCode = item.getProjectStatusCode(); + + //2021.3.8 epmet中,调用方传level,这边不再计算 + if(item.getProjectLevel() == null){ + //todo 动态获取超时时间 + //如果结案 结案时间立项时间; + if ("closed_case".equals(projectStatusCode)) { + try { + Date createTime = sdf.parse(item.getProjectCreateTime()); + Date closeCaseTime = sdf.parse(item.getCloseCaseTime()); + + if (closeCaseTime.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 4) { + //如果结案时间-立项时间小于等于4天 未超期 level3 + item.setProjectLevel(3); + } else if (closeCaseTime.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 5) { + //如果结案时间-立项时间大于4天小于5天 即将超期 level2 + item.setProjectLevel(2); + } else { + //大于5天 已超期 level1 + item.setProjectLevel(1); + } + } catch (ParseException e) { + e.printStackTrace(); + } + } 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(param.getCustomerId()), "customer_id", param.getCustomerId()); + baseDao.delete(deleteWrapper); + QueryWrapper screenProjectImgDataEntityQueryWrapper = new QueryWrapper<>(); + screenProjectImgDataEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) + .eq(StringUtils.isNotBlank(param.getCustomerId()), "customer_id", param.getCustomerId()); + 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(param.getCustomerId()); + 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(param.getCustomerId()); + screenProjectImgDataEntity.setProjectId(item.getProjectId()); + screenProjectImgDataEntity.setProjectImgUrl(projectImgUrl[i]); + screenProjectImgDataEntity.setSort(i); + screenProjectImgDataDao.insert(screenProjectImgDataEntity); + } + } + }); + } + + + /** + * @Description 查询是否存在客户的数据 + * @param customerId + * @return int + * @author wangc + * @date 2021.03.04 23:35 + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX) + public int checkIfExisted(String customerId) { + return baseDao.checkIfExisted(customerId); + } + + /** + * @Description 获取客户下已经入库而且未结案的数据集 + * @param + * @return j + * @author wangc + * @date 2021.03.08 09:32 + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX) + public List getPending(ScreenProjectDataDTO param,String dateId) { + param.setDataEndTime(dateId); + return baseDao.selectPending(param); + } + + /** + * @Description collect或更新 + * @param + * @return void + * @author wangc + * @date 2021.03.09 17:36 + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX) + public void insertOrUpdateBatch(String customerId, String dateId, List meta, List orient) { + //内部数据抽取的逻辑是,不管dateId指定的哪一天,只要在抽取时,目标数据库中没有相应数据 + //就抽取指定日期及其之前的所有数据,因此在删除时只需对指定日期删除即可,上述情况是因为 + //库中无数据,范围性删除无意义,只是针对在数据库有历史数据的情况下,保证对同一天进行反 + //复采集时数不会重复 + if(!CollectionUtils.isEmpty(meta)){ + int affectedRows = baseDao.deleteByProjectTimeAndCustomerId(customerId,dateId); + while (affectedRows > 0) { + affectedRows = baseDao.deleteByProjectTimeAndCustomerId(customerId, dateId); + } + List> partition = ListUtils.partition(meta, NumConstant.ONE_HUNDRED); + partition.forEach(part -> baseDao.insertBatch(part)); + } + + + if(!CollectionUtils.isEmpty(orient)){ + List> partition = ListUtils.partition(orient, NumConstant.ONE_HUNDRED); + partition.forEach(part -> baseDao.updateBatch(part,dateId)); + } + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/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..64cb66e04c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java @@ -0,0 +1,276 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.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 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(ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteByDateIdAndCustomerId(data.getCustomerId(),data.getDateId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteByDateIdAndCustomerId(data.getCustomerId(),data.getDateId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,data.getCustomerId(),"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)){ + log.warn(String.format(PingYinConstants.GRID_INFO_IS_ZERO,customerId)); + return; + } + // 查询 项目总数 + 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..cb1217f055 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectImgDataServiceImpl.java @@ -0,0 +1,112 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.ScreenProjectImgDataDao; +import com.epmet.dto.screen.ScreenProjectImgDataDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenProjectImgDataService; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 中央区-项目数据图片 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Service +@DataSource(value = DataSourceConstant.EVALUATION_INDEX) +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)); + } + + @Override + public void insertBatch(List list) { + baseDao.deleteByProjectIds(list.stream().map(ScreenProjectImgDataDTO::getProjectId).distinct().collect(Collectors.toList())); + List> partition = ListUtils.partition(list, NumConstant.ONE_HUNDRED); + partition.forEach(part -> baseDao.insertBatch(list)); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/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..98fc2f38f7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java @@ -0,0 +1,237 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.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.entity.org.CustomerAgencyEntity; +import com.epmet.service.crm.CustomerRelationService; +import com.epmet.service.evaluationindex.screen.ScreenProjectOrgDailyService; +import com.epmet.service.org.CustomerAgencyService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.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; + @Autowired + private CustomerRelationService customerRelationService; + @Autowired + private CustomerAgencyService customerAgencyService; + + @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 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(ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteByDateIdAndCustomerId(data.getCustomerId(),data.getDateId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteByDateIdAndCustomerId(data.getCustomerId(),data.getDateId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,data.getCustomerId(),"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 = new ArrayList<>(); + //如果有子客户要按照跟组织的area_code查询组织列表 + if(customerRelationService.haveSubCustomer(customerId)){ + // + CustomerAgencyEntity rootAgency=customerAgencyService.getRootAgencyInfo(customerId); + agencyInfos=agencyDao.selectAgencyByAreaCode(rootAgency.getAreaCode()); + }else{ + agencyInfos=agencyDao.selectAgencyByCustomer(customerId); + } + if (CollectionUtils.isEmpty(agencyInfos)){ + log.warn(String.format(PingYinConstants.AGENCY_INFO_IS_ZERO,customerId)); + return; + } + 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..e750394f9b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessAttachmentServiceImpl.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.ScreenProjectProcessAttachmentDao; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity; +import com.epmet.service.evaluationindex.screen.ScreenProjectProcessAttachmentService; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 中央区-项目数据处理节点附件表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Service +@DataSource(value = DataSourceConstant.EVALUATION_INDEX) +public class ScreenProjectProcessAttachmentServiceImpl extends BaseServiceImpl implements ScreenProjectProcessAttachmentService { + @Override + public PageData page(Map params) { + 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)); + } + + @Override + public void insertBatch(List list) { + baseDao.deleteByProcessId(list.stream().map(ScreenProjectProcessAttachmentDTO::getProcessId).distinct().collect(Collectors.toList())); + List> partition = ListUtils.partition(list,NumConstant.ONE_HUNDRED); + partition.forEach(part -> baseDao.insertBatch(part)); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java new file mode 100644 index 0000000000..863b119c07 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java @@ -0,0 +1,177 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.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.collections4.ListUtils; +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 +@DataSource(value = DataSourceConstant.EVALUATION_INDEX) +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(ScreenCollFormDTO param) { + if (param.getIsFirst()) { + int affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); + while (affectedRows > 0) { + affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); + } + } + param.getDataList().forEach(item -> { + //先删除旧数据 + QueryWrapper screenProjectProcessEntityQueryWrapper = new QueryWrapper<>(); + screenProjectProcessEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) + .eq(StringUtils.isNotBlank(param.getCustomerId()), "customer_id", param.getCustomerId()) + .eq(StringUtils.isNotBlank(item.getProcessId()), "process_id", item.getProcessId()); + baseDao.delete(screenProjectProcessEntityQueryWrapper); + + QueryWrapper screenProjectProcessAttachmentEntityQueryWrapper = new QueryWrapper<>(); + screenProjectProcessAttachmentEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) + .eq(StringUtils.isNotBlank(param.getCustomerId()), "customer_id", param.getCustomerId()) + .eq(StringUtils.isNotBlank(item.getProcessId()), "process_id", item.getProcessId()); + screenProjectProcessAttachmentDao.delete(screenProjectProcessAttachmentEntityQueryWrapper); + //插入 + ScreenProjectProcessEntity screenProjectProcessEntity = ConvertUtils.sourceToTarget(item, ScreenProjectProcessEntity.class); + screenProjectProcessEntity.setCustomerId(param.getCustomerId()); + 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(param.getCustomerId()); + attachmentEntity.setProcessId(item.getProcessId()); + attachmentEntity.setProjectId(item.getProjectId()); + if (attachmentEntity.getSort() == null) { + attachmentEntity.setSort(i); + } + screenProjectProcessAttachmentDao.insert(attachmentEntity); + } + } + }); + + } + + @Override + public boolean checkIfHistoricalDataExists(String customerId) { + return baseDao.countByCustomerId(customerId) > NumConstant.ZERO; + } + + @Override + public void insertBatch(List list,String customerId,String dateId) { + int affectedRows = baseDao.deleteByProcessTimeAndCustomerId(customerId, dateId); + while (affectedRows > 0) { + affectedRows = baseDao.deleteByProcessTimeAndCustomerId(customerId, dateId); + } + + List> partition = ListUtils.partition(list,NumConstant.ONE_HUNDRED); + partition.forEach(part -> { + baseDao.insertBatch(part); + }); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/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..ea99b5148a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java @@ -0,0 +1,252 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.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 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(ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteByMonthIdAndCustomerId(data.getCustomerId(),data.getMonthId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteByMonthIdAndCustomerId(data.getCustomerId(),data.getMonthId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,data.getCustomerId(),"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)){ + log.warn(String.format(PingYinConstants.GRID_INFO_IS_ZERO,customerId)); + return; + } + 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..91917d22b7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java @@ -0,0 +1,229 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.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.entity.org.CustomerAgencyEntity; +import com.epmet.service.crm.CustomerRelationService; +import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService; +import com.epmet.service.org.CustomerAgencyService; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.ListUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)数量分析按组织_按月统计 + * + * @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; + @Autowired + private CustomerRelationService customerRelationService; + @Autowired + private CustomerAgencyService customerAgencyService; + @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 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(ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteByMonthIdAndCustomerId(data.getCustomerId(),data.getMonthId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteByMonthIdAndCustomerId(data.getCustomerId(),data.getMonthId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,data.getCustomerId(),"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 = new ArrayList<>(); + //如果有子客户要按照跟组织的area_code查询组织列表 + if(customerRelationService.haveSubCustomer(customerId)){ + CustomerAgencyEntity rootAgency=customerAgencyService.getRootAgencyInfo(customerId); + screenProjectOrgDailyDTOS=agencyDao.selectAgencyByAreaCode(rootAgency.getAreaCode()); + }else{ + screenProjectOrgDailyDTOS=agencyDao.selectAgencyByCustomer(customerId); + } + if (CollectionUtils.isEmpty(screenProjectOrgDailyDTOS)){ + log.warn(String.format(PingYinConstants.AGENCY_INFO_IS_ZERO,customerId)); + return; + } + + List agencyInfos = ConvertUtils.sourceToTarget(screenProjectOrgDailyDTOS, ScreenProjectQuantityOrgMonthlyDTO.class); + List projectOrg = baseDao.selectQuantityOrgMonthly(agencyInfos, monthId); + if (!CollectionUtils.isEmpty(projectOrg)){ + 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(null == p.getClosedIncr() ? NumConstant.ZERO : p.getClosedIncr()); + a.setProjectIncr(null == p.getProjectIncr() ? NumConstant.ZERO : p.getProjectIncr()); + a.setProjectIncr(null == p.getProjectIncr() ? NumConstant.ZERO : p.getProjectIncr()); + } + }); + } + if (!CollectionUtils.isEmpty(projectGrandOrg)){ + projectGrandOrg.forEach(p -> { + if (a.getAreaCode().equals(p.getAreaCode())){ + a.setClosedTotal(null == p.getClosedTotal() ? NumConstant.ZERO : p.getClosedTotal()); + a.setProjectTotal(null == p.getProjectTotal() ? NumConstant.ZERO : p.getProjectTotal()); + a.setUnClosedTotal(null == p.getUnClosedTotal() ? NumConstant.ZERO : p.getUnClosedTotal()); + a.setProjectIncr(null == p.getProjectIncr() ? NumConstant.ZERO : p.getProjectIncr()); + } + }); + } + }); + 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..b3aa943ada 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java @@ -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,14 @@ 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); + + CustomerAgencyEntity getRootAgencyInfo(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java index 4813309176..8a8fae83b8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java @@ -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,24 @@ 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<>(); + } + + @Override + public CustomerAgencyEntity getRootAgencyInfo(String customerId) { + return customerAgencyDao.getRootAgencyInfo(customerId); + } } 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..98d18d8339 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenCustomerWorkRecordDictService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.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 data + * @return void + * @author wangc + * @date 2021.02.04 15:27 + */ + void collect(ScreenCollFormDTO data); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgDailyService.java new file mode 100644 index 0000000000..c14291c641 --- /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(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..7804957e4e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.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.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 data + * @return void + * @author wangc + * @date 2021.02.04 15:27 + */ + void collect(ScreenCollFormDTO data); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/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..7a6291717a --- /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(ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteBatch(data.getCustomerId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteBatch(data.getCustomerId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,data.getCustomerId(),data.getDateId()); + }); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/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..8f4d4f7c84 --- /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(ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteBatch(data.getCustomerId(),data.getDateId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteBatch(data.getCustomerId(),data.getDateId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,data.getCustomerId(),data.getDateId()); + }); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java new file mode 100644 index 0000000000..7ecd3c4eb6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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 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(ScreenCollFormDTO data) { + if(data.getIsFirst()){ + int affectedRows = baseDao.deleteBatch(data.getCustomerId(),data.getMonthId()); + while(affectedRows > 0){ + affectedRows = baseDao.deleteBatch(data.getCustomerId(),data.getMonthId()); + } + } + Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + baseDao.insertBatch(list,data.getCustomerId(),data.getMonthId()); + }); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java index 36409f2927..84386e9ec3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java @@ -22,6 +22,9 @@ import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.ProcessInfoDTO; import com.epmet.dto.project.result.ProjectLatestOperationResultDTO; import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.dto.screen.ScreenProjectProcessDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; @@ -97,14 +100,13 @@ public interface ProjectProcessService extends BaseService /** * @Description 直接从项目业务改造获取项目节点耗时信息 - * @param isFirst * @param customerId * @param date * @return java.util.List * @author wangc * @date 2020.10.23 09:10 */ - List getProjectPeriodDirectly(Boolean isFirst,String customerId, String date); + List getProjectPeriodDirectly(String customerId, String date); /** * 获取办结组织 @@ -125,4 +127,43 @@ public interface ProjectProcessService extends BaseService * @date 2020.09.28 14:44 */ Map getLatestOperation(List list, String customerId); + + /** + * @Description 查询指定日期关闭的项目 然后将状态由【pending】改为【closed_case】,并加上结案时间 + * @param list + * @param dateId + * @return void + * @author wangc + * @date 2021.03.09 09:54 + */ + void updateProjectStatus(List list, String dateId,String customerId); + + /** + * @Description 查询指定日期关闭的项目 然后将状态由【pending】改为【closed_case】,并加上结案时间 + * @param list + * @return void + * @author wangc + * @date 2021.03.09 09:54 + */ + void updateProjectCloseTime(List list); + + /** + * @Description 构建大屏项目进展数据 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author wangc + * @date 2021.03.09 14:49 + */ + List buildNewScreenProjectProcessData(String customerId,String dateId,boolean ifRanged); + + /** + * @Description 构建节点附件数据 + * @param processIds + * @return java.util.List + * @author wangc + * @date 2021.03.09 16:56 + */ + List buildProcessAttachmentData(List processIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index 2dc0e88aa6..6f283b852a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -21,10 +21,13 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectGridDTO; -import com.epmet.dto.project.ProjectInfoDTO; +import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.entity.project.ProjectEntity; +import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; +import java.util.Set; /** * 项目表 @@ -109,4 +112,33 @@ public interface ProjectService extends BaseService { * @date 2020.11.06 14:14 */ Integer getOvertimeProjectByParameter(String customerId); + + /** + * @Description 查找客户项目超期参数 + * + * @param customerId + * @return java.util.List + * @author wangc + * @date 2021.03.05 17:52 + */ + List getProjectExceedParams(@Param("customerId") String customerId); + + /** + * @Description 获取项目相关信息 + * @param projectIds + * @return java.util.List + * @author wangc + * @date 2021.03.08 10:28 + */ + List getProjectInfo(List projectIds); + + /** + * @Description 获取项目的所有标签名称 用-连接 + * @param projectIds + * @return java.util.Map> + * @author wangc + * @date 2021.03.08 23:46 + */ + Map> getProjectCategory(List projectIds); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java index 09d3d2f652..d16db0530e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java @@ -20,16 +20,18 @@ package com.epmet.service.project.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.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.project.ProjectProcessDao; -import com.epmet.dto.form.CommonStaffIdFormDTO; +import com.epmet.dto.ProjectProcessDTO; import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.ProcessInfoDTO; -import com.epmet.dto.project.ProjectOrgRelationDTO; +import com.epmet.dto.project.ProjectStaffDTO; import com.epmet.dto.project.result.ProjectLatestOperationResultDTO; import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; -import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.dto.screen.ScreenProjectProcessDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; import com.epmet.service.project.ProjectProcessService; @@ -39,7 +41,6 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.*; -import java.util.stream.Collector; import java.util.stream.Collectors; /** @@ -91,7 +92,7 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl @@ -99,13 +100,8 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl getProjectPeriodDirectly(Boolean isFirst, String customerId, String date) { - if(isFirst){ - return baseDao.selectProjectOrgPeriodDirectly(customerId,null,null); - }else{ - return baseDao.selectProjectOrgPeriodDirectly(customerId,null,date); - } - + public List getProjectPeriodDirectly( String customerId, String date) { + return baseDao.selectProjectOrgPeriodDirectly(customerId,null,null); } @Override @@ -130,4 +126,93 @@ public class ProjectProcessServiceImpl extends BaseServiceImplo,(a,n)-> a)); } } + + /** + * @Description 查询指定日期关闭的项目 然后将状态由【pending】改为【closed_case】,并加上结案时间 + * @param list + * @param dateId + * @return void + * @author wangc + * @date 2021.03.09 09:54 + */ + @Override + public void updateProjectStatus(List list,String dateId,String customerId) { + if(CollectionUtils.isEmpty(list)) return; + List closedInfo = baseDao.selectClosedProjectOnAppointedDay(customerId, dateId); + if(CollectionUtils.isEmpty(closedInfo)) return; + + list = list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( + merge -> { + target.setProjectStatusCode("closed_case"); + target.setCloseCaseTime(DateUtils.format(merge.getCreatedTime(),DateUtils.DATE_TIME_PATTERN)); + return target; + } + )).collect(Collectors.toList()); + } + + /** + * @Description 查询指定日期关闭的项目 然后将状态由【pending】改为【closed_case】,并加上结案时间 + * @param list + * @return void + * @author wangc + * @date 2021.03.09 09:54 + */ + @Override + public void updateProjectCloseTime(List list) { + if(CollectionUtils.isEmpty(list)) return; + List closedInfo = baseDao.selectClosedProjectByProjectIds(list.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())); + if(CollectionUtils.isEmpty(closedInfo)) return; + + list = list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( + merge -> { + //target.setProjectStatusCode("closed_case"); + target.setCloseCaseTime(DateUtils.format(merge.getCreatedTime(),DateUtils.DATE_TIME_PATTERN)); + return target; + } + )).collect(Collectors.toList()); + } + + /** + * @Description 构建大屏项目进展数据 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author wangc + * @date 2021.03.09 14:49 + */ + @Override + public List buildNewScreenProjectProcessData(String customerId, String dateId, boolean ifRanged) { + List processes = baseDao.selectProjectProcessAndDirection(customerId, ifRanged ? null : dateId, dateId); + if(CollectionUtils.isEmpty(processes)) return null; + return processes.stream().map(target -> { + List points = target.getPoints(); + if(!CollectionUtils.isEmpty(points)){ + List orgIds = points.stream().map(ProjectStaffDTO::getOrgId).distinct().collect(Collectors.toList()); + List names = points.stream().map(ProjectStaffDTO::getDepartmentName).distinct().collect(Collectors.toList()); + StringBuilder builder1 = new StringBuilder(); + orgIds.forEach(orgId -> builder1.append(orgId).append(",")); + StringBuilder builder2 = new StringBuilder(); + names.forEach(name -> builder2.append(name).append(",")); + target.setTransferDeptIds(builder1.substring(NumConstant.ZERO,builder1.length() - NumConstant.TWO)); + target.setTransferDeptName(builder2.substring(NumConstant.ZERO,builder2.length() - NumConstant.TWO)); + } + return target; + }).collect(Collectors.toList()); + + } + + + + /** + * @Description 构建节点附件数据 + * @param processIds + * @return java.util.List + * @author wangc + * @date 2021.03.09 16:56 + */ + @Override + public List buildProcessAttachmentData(List processIds) { + return baseDao.selectProcessAttachment(processIds); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index 5ba8ea04d6..294d0e4f31 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -24,13 +24,20 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.dao.project.ProjectDao; import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectCategoryDTO; import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.service.project.ProjectService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; /** * 项目表 @@ -97,4 +104,52 @@ public class ProjectServiceImpl extends BaseServiceImpl + * @author wangc + * @date 2021.03.05 17:52 + */ + @Override + public List getProjectExceedParams(String customerId) { + return baseDao.selectProjectExceedParams(customerId); + } + + /** + * @Description 获取项目相关信息 + * @param projectIds + * @return java.util.List + * @author wangc + * @date 2021.03.08 10:28 + */ + @Override + public List getProjectInfo(List projectIds) { + return baseDao.batchSelectProjectInfo(projectIds); + } + + /** + * @Description 获取项目的所有标签名称 用-连接 + * @param projectIds + * @return java.util.Map> + * @author wangc + * @date 2021.03.08 10:28 + */ + @Override + public Map> getProjectCategory(List projectIds) { + if(CollectionUtils.isEmpty(projectIds)) return null; + List categories = baseDao.selectProjectCategory(projectIds); + if(CollectionUtils.isEmpty(categories)) return null; + Map> map = new HashMap<>(); + Map> projectMap = categories.stream().collect(Collectors.groupingBy(ProjectCategoryDTO::getProjectId)); + projectMap.forEach((k,v) -> { + Set categoryIds = v.stream().map(ProjectCategoryDTO::getCategoryId).collect(Collectors.toSet()); + map.put(k,categoryIds); + }); + return map; + } + + + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/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 getGridAttributes(String customerId,List gridIds) { - if(CollectionUtils.isEmpty(gridIds)) return Collections.EMPTY_LIST; + return baseDao.selectGridAttributes(customerId,gridIds); } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java index 8acaa3c3ac..5dc7b17392 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java @@ -2,6 +2,8 @@ package com.epmet.service.topic; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.result.TopicInfoResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.topic.result.TopicStatisticalData; @@ -83,4 +85,23 @@ public interface TopicService { * @date 2020.09.28 16:28 */ Map getTopicContent(List list); + + /** + * @Description 获取大屏项目相关信息 + * + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:16 + */ + List fillScreenProjectData(List list); + + /** + * @Description 构建新增的大屏项目图片数据 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.09 13:59 + */ + List buildNewScreenProjectImgData(List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 61c926507d..83e3b9da38 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -2,11 +2,14 @@ package com.epmet.service.topic.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.topic.TopicDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.result.TopicInfoResultDTO; import com.epmet.dto.group.result.TopicContentResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.topic.*; @@ -144,7 +147,7 @@ public class TopicServiceImpl implements TopicService { List imgs = topicDao.selectTopicImgs(list); if(CollectionUtils.isEmpty(imgs)) return Collections.EMPTY_MAP; //key -> topicId | value -> projectId - Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId)); + Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId,(o,n)->n)); //key -> topicId Map> result = imgs.stream().collect(Collectors.groupingBy(ScreenDifficultyImgDataEntity :: getEventId)); @@ -175,7 +178,7 @@ public class TopicServiceImpl implements TopicService { if(CollectionUtils.isEmpty(contents)) return Collections.EMPTY_MAP; Map topicContentMap = contents.stream().collect(Collectors.toMap(TopicContentResultDTO :: getTopicId,TopicContentResultDTO::getContent)); //key -> topicId | value -> projectId - Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId)); + Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId,(o,n)->n)); Map result = new HashMap<>(); projectTopicMap.forEach((topic,project) -> { result.put(project,topicContentMap.get(topic)); @@ -183,6 +186,52 @@ public class TopicServiceImpl implements TopicService { return result; } + /** + * @Description 获取大屏项目相关信息 + * + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:16 + */ + @Override + public List fillScreenProjectData(List list) { + List collection = topicDao.selectScreenProjectData(list); + if(!CollectionUtils.isEmpty(collection)){ + list = list.stream().flatMap(target -> collection.stream().filter( + res -> StringUtils.equals(target.getTopicId(),res.getTopicId()) + ).map(merge -> { + target.setLatitude(merge.getLatitude()); + target.setLongitude(merge.getLongitude()); + target.setProjectContent(merge.getProjectContent()); + target.setProjectAddress(merge.getProjectAddress()); + return target; + })).collect(Collectors.toList()); + } + return collection; + } + + /** + * @Description 构建新增的大屏项目图片数据 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.09 13:59 + */ + @Override + public List buildNewScreenProjectImgData(List list) { + List imgs = topicDao.initNewScreenProjectImgData(list.get(NumConstant.ZERO).getCustomerId(), list); + if(CollectionUtils.isEmpty(imgs)) return null; + return imgs.stream().flatMap(img -> list.stream().filter(project -> StringUtils.equals(img.getTopicId(),project.getTopicId())).map( + match -> { + ScreenProjectImgDataDTO matchedImg + = ConvertUtils.sourceToTarget(img,ScreenProjectImgDataDTO.class); + matchedImg.setProjectId(match.getProjectId()); + return matchedImg; + } + )).collect(Collectors.toList()); + } + /** * @Description 初始化机关-所有下级网格Map * @param pid - 固定一个机关Id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java index 767af842b0..36229bfbb2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java @@ -2,10 +2,10 @@ package com.epmet.service.user; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.GridHeartedFormDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.user.result.UserStatisticalData; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import com.epmet.util.DimIdGenerator; -import org.apache.ibatis.annotations.Param; import java.util.Date; import java.util.List; @@ -75,4 +75,13 @@ public interface UserService { * @date 2020.09.25 13:54 **/ List getRegisteredUserList(String customerId); + + /** + * @Description 获取大屏项目相关信息 联系人 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:16 + */ + List fillScreenProjectData(List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index bc0a9e83d2..db739b79ab 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -8,6 +8,7 @@ import com.epmet.dao.user.UserDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.result.UserPartyResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.user.*; import com.epmet.dto.stats.user.result.UserStatisticalData; import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; @@ -728,4 +729,24 @@ public class UserServiceImpl implements UserService { return userList; } + /** + * @Description 获取大屏项目相关信息 联系人 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:16 + */ + @Override + public List fillScreenProjectData(List list) { + List collection = userDao.selectScreenProjectData(list); + if(!CollectionUtils.isEmpty(collection)){ + list = list.stream().flatMap(target -> collection.stream().filter(res -> StringUtils.equals(target.getLinkName(),res.getTopicId())) + .map(merge -> { + target.setLinkName(merge.getLinkName()); + target.setLinkMobile(merge.getLinkMobile()); + return target;})).collect(Collectors.toList()); + } + return collection; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml index 8f22922df8..bc14f070f8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /data/stats @@ -198,3 +199,9 @@ dingTalk: robot: webHook: @dingTalk.robot.webHook@ secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.5__screen_org_add_source_col.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.5__screen_org_add_source_col.sql new file mode 100644 index 0000000000..decea637ee --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.5__screen_org_add_source_col.sql @@ -0,0 +1,41 @@ +-- 一、epmet_evaluation_index执行以下sql, +-- 1、五级指标表,采集增加分子分母列 +alter table fact_index_party_ablity_grid_monthly add column SHIFTED_PROJECT_TOTAL int(11) DEFAULT 0 COMMENT 'V2升级字段:issueToProjectRatio的分子:评价周期内转为项目的数量'; +alter table fact_index_party_ablity_grid_monthly add column ISSUE_TOTAL int(11) DEFAULT 0 COMMENT 'V2升级字段:issueToProjectRatio的分母:评价周期内网格内居民提出的议题数目'; + +alter table fact_index_service_ablity_grid_monthly add column PARTY_VOLUNTEER_TOTAL int(11) DEFAULT 0 COMMENT 'V2升级字段:partyVolunteerRatio的分子:网格党员志愿者数'; +alter table fact_index_service_ablity_grid_monthly add column VOLUNTEER_TOTAL int(11) DEFAULT 0 COMMENT 'V2升级字段:partyVolunteerRatio的分母:志愿者总数'; +alter table fact_index_service_ablity_grid_monthly add column VOLUNTEER_USER_TOTAL int(11) DEFAULT 0 COMMENT 'V2升级字段:volunteerRatio的分子:居民且注册志愿者的总人数'; +alter table fact_index_service_ablity_grid_monthly add column REG_USER_TOTAL int(11) DEFAULT 0 COMMENT 'V2升级字段:volunteerRatio的分母:网格内注册居民数'; + +alter table fact_index_govrn_ablity_grid_monthly add column TRANSFER_RIGHT_RATIO_FZ decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_grid_monthly add column TRANSFER_RIGHT_RATIO_FM decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_grid_monthly add column SATISFACTION_RATIO_FZ decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_grid_monthly add column SATISFACTION_RATIO_FM decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_grid_monthly add column ISSUE_TO_PROJECT_RATIO_FZ decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_grid_monthly add column ISSUE_TO_PROJECT_RATIO_FM decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; + +alter table fact_index_govrn_ablity_dept_monthly add column RESP_PROJECT_RATIO_FZ decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_dept_monthly add column RESP_PROJECT_RATIO_FM decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_dept_monthly add column HANDLE_PROJECT_RATIO_FZ decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_dept_monthly add column HANDLE_PROJECT_RATIO_FM decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_dept_monthly add column CLOSED_PROJECT_RATIO_FZ decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_dept_monthly add column CLOSED_PROJECT_RATIO_FM decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_dept_monthly add column SATISFACTION_RATIO_FZ decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_dept_monthly add column SATISFACTION_RATIO_FM decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; + +alter table fact_index_govrn_ablity_org_monthly add column RESP_PROJECT_RATIO_FZ decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_org_monthly add column RESP_PROJECT_RATIO_FM decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_org_monthly add column CLOSED_PROJECT_RATIO_FZ decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_org_monthly add column CLOSED_PROJECT_RATIO_FM decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_org_monthly add column SATISFACTION_RATIO_FZ decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_org_monthly add column SATISFACTION_RATIO_FM decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_org_monthly add column OVERDUE_PROJECT_RATIO_FZ decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_org_monthly add column OVERDUE_PROJECT_RATIO_FM decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_org_monthly add column HANDLE_PROJECT_RATIO_FZ decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; +alter table fact_index_govrn_ablity_org_monthly add column HANDLE_PROJECT_RATIO_FM decimal(14,6) DEFAULT 0 COMMENT 'V2升级新增字段, 详见说明文档'; + +-- 2、epmet_evaluation_index、epmet_data_statistical_display 都要执行,网格和部门增加area_code +alter table screen_customer_grid add column AREA_CODE varchar(30) DEFAULT NULL COMMENT 'V2升级必传参数:当前网格所属行政地区编码,去除末尾0'; +alter table screen_customer_dept add column AREA_CODE varchar(30) DEFAULT NULL COMMENT 'V2升级必传参数:当前部门所属行政地区编码,去除末尾0'; +alter table screen_customer_agency add column `PARENT_AREA_CODE` varchar(30) DEFAULT NULL COMMENT '当前组织的上级行政地区编码add0204;举例平阴县370124对应的是济南市3701'; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.6__alter_dimcustomer_add_areaCode_col.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.6__alter_dimcustomer_add_areaCode_col.sql new file mode 100644 index 0000000000..e4ab88b03d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.6__alter_dimcustomer_add_areaCode_col.sql @@ -0,0 +1,3 @@ +-- 一、epmet_data_statistical 库sql脚本: +-- 1、客户维度表新增 area_code列 +alter table dim_customer add COLUMN AREA_CODE varchar(12) default '' comment '客户所属行政地区编码,取值来自客户根组织的area_code(01.14 add)'after CUSTOMER_NAME; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.7__update_agencytb_adduptocal.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.7__update_agencytb_adduptocal.sql new file mode 100644 index 0000000000..eb7ed9fb05 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.7__update_agencytb_adduptocal.sql @@ -0,0 +1,5 @@ +-- 一、epmet_evaluation_index、epmet_data_statistical_display 都要执行 +-- 1、网格、部门、组织新增 一列标识是否参与向上计算 +alter table screen_customer_grid add column UP_TO_CAL varchar(10) DEFAULT 'yes' COMMENT '是否参与上级计算yes:参与;no:不参与'; +alter table screen_customer_dept add column UP_TO_CAL varchar(10) DEFAULT 'yes' COMMENT '是否参与上级计算yes:参与;no:不参与'; +alter table screen_customer_agency add column UP_TO_CAL varchar(10) DEFAULT 'yes' COMMENT '是否参与上级计算yes:参与;no:不参与'; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.8__add_plugins_table.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.8__add_plugins_table.sql new file mode 100644 index 0000000000..74480896cb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.8__add_plugins_table.sql @@ -0,0 +1,132 @@ +-- 插件数据上报:146、工作日志; +-- epmet_evaluation_index、epmet_data_statistical_display 都要执行 + +-- 1、146体系新增3张表 +drop table if EXISTS screen_bid_info; +CREATE TABLE `screen_bid_info` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `DATE_ID` varchar(8) NOT NULL COMMENT '截止日期eg:20200101', + `BID_ID` varchar(64) NOT NULL COMMENT '竞标项目id', + `BID_NAME` varchar(512) NOT NULL COMMENT '竞标项目名称', + `STATUS_CODE` varchar(64) NOT NULL COMMENT '状态编码', + `STATUS_DESC` varchar(128) NOT NULL COMMENT '状态描述eg:已中标、未中标、投标中、', + `AMOUNT` double(20,4) NOT NULL COMMENT '金额单位万元', + `RELEASE_TIME` datetime NOT NULL COMMENT '发布时间', + `TOWN_IDS` varchar(1024) NOT NULL COMMENT '发布村镇,以英文逗号隔开', + `TOWN_NAMES` varchar(1024) NOT NULL COMMENT '发布村镇名称,以英文逗号隔开', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='146:竞标管理'; + +drop table if EXISTS screen_contract_info; +CREATE TABLE `screen_contract_info` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `DATE_ID` varchar(8) NOT NULL COMMENT '截止日期eg:20200101', + `CONTRACT_ID` varchar(64) NOT NULL COMMENT '合同id', + `CONTRACT_NAME` varchar(255) NOT NULL COMMENT '合同名称', + `CATEGORY_CODE` varchar(64) NOT NULL COMMENT '合同所属类别编码', + `CATEGORY_NAME` varchar(255) NOT NULL COMMENT '合同所属类别名称', + `DUE_DATE` date NOT NULL COMMENT '合同到期日期:2020-12-31', + `TOWN_IDS` varchar(1024) NOT NULL COMMENT '发布村镇,以英文逗号隔开', + `TOWN_NAMES` varchar(1024) NOT NULL COMMENT '发布村镇名称,以英文逗号隔开', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='146:合同基本信息'; + + +drop table if EXISTS screen_list_info; +CREATE TABLE `screen_list_info` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `DATE_ID` varchar(8) NOT NULL COMMENT '截止日期eg:20200101', + `LIST_ID` varchar(64) NOT NULL COMMENT '清单id', + `LIST_CODE` varchar(64) DEFAULT NULL COMMENT '清单编码', + `LIST_NAME` varchar(512) NOT NULL COMMENT '名称', + `SORT` int(11) NOT NULL COMMENT '排序', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='146:一张清单列表'; + +-- 2、工作日志新增 +drop table if EXISTS screen_customer_work_record_dict; +CREATE TABLE `screen_customer_work_record_dict` ( + `ID` varchar(32) NOT NULL COMMENT '主键(客户每次上传,直接根据customerId全删全增)', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至日期eg:20200101', + `DICT_ID` varchar(32) NOT NULL COMMENT '资源id', + `PID` varchar(32) NOT NULL COMMENT '父资源ID;如果是一级分类pid=0', + `RESOURCE_TYPE` varchar(32) DEFAULT NULL COMMENT '资源类型', + `RESOURCE_CODE` varchar(32) NOT NULL COMMENT '资源编码', + `RESOURCE_LABEL` varchar(128) NOT NULL COMMENT '资源标签名', + `SHOW_FLAG` varchar(1) NOT NULL COMMENT '显示标识:0否,1是', + `SORT` int(10) NOT NULL DEFAULT '0' COMMENT '排序', + `DATA_TYPE` varchar(32) DEFAULT 'party' COMMENT '数据类别 :party:支部建设; union:联合建设;党员志愿服务:voluntaryservice;所有的一级分类需要对应到这三个key中', + `LEVEL` int(11) NOT NULL COMMENT '当前资源属于几级,例如:1、2、3、4....', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '逻辑删除标识', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作日志资源字典表'; + +drop table if EXISTS screen_work_record_org_monthly; +CREATE TABLE `screen_work_record_org_monthly` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id:yyyyMM', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Idor网格id', + `ORG_NAME` varchar(255) DEFAULT NULL COMMENT '组织名或网格名', + `MEETING_CODE` varchar(255) DEFAULT NULL COMMENT '会议类型编码;对应screen_customer_work_record_dict的资源编码', + `TYPE_CODE` varchar(255) NOT NULL COMMENT '随手记类型编码;对应screen_customer_work_record_dict的资源编码', + `ORGANIZE_TOTAL` int(11) NOT NULL COMMENT '组织次数', + `PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '参与人数', + `AVG_PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '平均参与人数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作日志-组织按月统计(增量)'; + + +drop table if EXISTS screen_work_record_org_daily; +CREATE TABLE `screen_work_record_org_daily` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `DATE_ID` varchar(8) NOT NULL COMMENT '日期Id:yyyyMMdd', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Idor网格id', + `ORG_NAME` varchar(255) DEFAULT NULL COMMENT '组织名或网格名', + `MEETING_CODE` varchar(255) DEFAULT NULL COMMENT '会议类型编码;对应screen_customer_work_record_dict的资源编码', + `TYPE_CODE` varchar(255) NOT NULL COMMENT '随手记类型编码;对应screen_customer_work_record_dict的资源编码', + `ORGANIZE_TOTAL` int(11) NOT NULL COMMENT '组织次数', + `PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '参与人数', + `AVG_PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '平均参与人数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='工作日志-组织按日统计(累计值)'; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.9__add_event_analysis.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.9__add_event_analysis.sql new file mode 100644 index 0000000000..2ee65f59c2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.9__add_event_analysis.sql @@ -0,0 +1,99 @@ +-- !!!epmet_evaluation_index、epmet_data_statistical_display 都要执行 +-- 1、平阴大屏 事件分析相关新增以下表 +drop table if EXISTS screen_project_grid_daily; +CREATE TABLE `screen_project_grid_daily` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `DATE_ID` varchar(8) NOT NULL COMMENT '日期yyyyMMdd', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格id', + `PID` varchar(64) NOT NULL COMMENT '网格所属的组织id', + `PIDS` varchar(255) NOT NULL COMMENT '网格所有的父级id,以英文:或者英文,隔开', + `PROJECT_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '截止到当前日期,网格内项目总数', + `RESOLVED_NUM` int(11) NOT NULL DEFAULT '0' COMMENT '截止到当前日期,网格内已解决的项目总数', + `RESOLVED_RATIO` decimal(10,6) NOT NULL DEFAULT '0.000000' COMMENT '解决率=RESOLVED_NUM/PROJECT_TOTAL,存储小数即可,保留小数点后4位', + `EVALUATE_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '对当前网格内项目,参与满意度评价的总次数', + `GOOD_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '对当前网格内项目,满意+非常满意的总次数', + `BAD_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '对当前网格内项目,不满意总次数', + `GOOD_RATIO` decimal(10,6) NOT NULL DEFAULT '0.000000' COMMENT '满意率=good_total/evaluate_total', + `BAD_RATIO` decimal(10,6) NOT NULL DEFAULT '0.000000' COMMENT '不满意率=bad_total/evaluate_total', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', + `REVISION` int(10) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目(事件)分析按网格_按天统计'; + +drop table if EXISTS screen_project_org_daily; +CREATE TABLE `screen_project_org_daily` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `DATE_ID` varchar(8) NOT NULL COMMENT '日期yyyyMMdd', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织id', + `ORG_TYPE` varchar(64) NOT NULL COMMENT '社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province', + `PID` varchar(64) NOT NULL COMMENT '当前orgId所属的上级id', + `PIDS` varchar(255) NOT NULL COMMENT 'orgId所有的父级id,以英文:或者英文,隔开', + `PROJECT_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '截止到当前日期,网格内项目总数', + `RESOLVED_NUM` int(11) NOT NULL DEFAULT '0' COMMENT '截止到当前日期,网格内已解决的项目总数', + `RESOLVED_RATIO` decimal(10,6) NOT NULL COMMENT '解决率=RESOLVED_NUM/PROJECT_TOTAL,存储小数即可,保留小数点后4位', + `EVALUATE_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '对当前组织内项目,参与满意度评价的总次数', + `GOOD_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '对当前组织内项目,满意+非常满意的总次数', + `BAD_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '对当前组织内项目,不满意总次数', + `GOOD_RATIO` decimal(10,6) NOT NULL COMMENT '满意率=good_total/evaluate_total', + `BAD_RATIO` decimal(10,6) NOT NULL COMMENT '不满意率=bad_total/evaluate_total', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', + `REVISION` int(10) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目(事件)分析按组织_按天统计'; + +drop table if EXISTS screen_project_quantity_grid_monthly; +CREATE TABLE `screen_project_quantity_grid_monthly` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `MONTH_ID` varchar(6) NOT NULL COMMENT '日期yyyyMMdd', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格id', + `PID` varchar(64) NOT NULL COMMENT '网格所属的组织id', + `PIDS` varchar(255) NOT NULL COMMENT '网格所有的父级id,以英文:或者英文,隔开', + `PROJECT_INCR` int(11) NOT NULL DEFAULT '0' COMMENT '当前网格,本月新增的项目数量:转项目日期在当前月份内', + `PROJECT_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '截止到当前月份:累计项目总数', + `UN_CLOSED_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '截止到当前月份:累计未结项目总数', + `CLOSED_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '截止到当前月份:累计已结项目', + `CLOSED_INCR` int(11) NOT NULL DEFAULT '0' COMMENT '本月新增结案项目数', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', + `REVISION` int(10) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目(事件)数量分析按网格_按月统计'; + + +drop table if EXISTS screen_project_quantity_org_monthly; +CREATE TABLE `screen_project_quantity_org_monthly` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `MONTH_ID` varchar(6) NOT NULL COMMENT '日期yyyyMMdd', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织id', + `ORG_TYPE` varchar(64) NOT NULL COMMENT '社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province', + `PID` varchar(64) NOT NULL COMMENT '当前orgId所属的上级id', + `PIDS` varchar(255) NOT NULL COMMENT 'orgId所有的父级id,以英文:或者英文,隔开', + `PROJECT_INCR` int(11) NOT NULL DEFAULT '0' COMMENT '当前组织内,本月新增的项目数量:转项目日期在当前月份内', + `PROJECT_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '截止到当前月份:累计项目总数', + `UN_CLOSED_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '截止到当前月份:累计未结项目总数', + `CLOSED_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '截止到当前月份:累计已结项目', + `CLOSED_INCR` int(11) NOT NULL DEFAULT '0' COMMENT '本月新增结案项目数', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', + `REVISION` int(10) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目(事件)数量分析按组织_按月统计'; + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerRelationDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerRelationDao.xml new file mode 100644 index 0000000000..88c12c8deb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerRelationDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml index 2717a8cb5e..db5dc8b583 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -97,7 +97,7 @@ - + DELETE FROM fact_origin_group_main_daily @@ -287,8 +287,8 @@ WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId} - AND MONTH_ID = #{monthId} AND GROUP_STATE = 'approved' + AND IS_OWNER_PARTY = 1 AND ( @@ -338,4 +338,4 @@ AND f.GROUP_STATE = 'approved' GROUP BY f.AGENCY_ID - \ No newline at end of file + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml index d54794d323..521ef174e4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml @@ -153,4 +153,28 @@ and m.PIDS LIKE CONCAT(#{pids},'%') + + + \ 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..89ba03036c 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,133 @@ 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..0790001c64 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml @@ -39,9 +39,12 @@ fact_origin_project_org_period_daily WHERE DEL_FLAG = '0' - - PROJECT_ID = #{item} - + AND CUSTOMER_ID = #{customerId} + + + PROJECT_ID = #{item} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 9de83a3a9a..f776956bf0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -124,4 +124,101 @@ AND MONTH_ID = #{monthId} ORDER BY AGENCY_ID + + + + + + + + + + + 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..28eda4f99c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml @@ -122,4 +122,72 @@ 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..7f3545b825 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 @@ -38,6 +38,7 @@ WHERE fidc.del_flag = '0' AND fidc.IS_TOTAL = '0' + AND sca.level = 'district' AND fidc.customer_id = #{customerId} AND fidc.month_id = #{monthId} AND fidc.index_code = #{indexCode} @@ -150,4 +151,47 @@ 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..cee52bfea1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml @@ -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..3dbe2956ed 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -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,81 @@ 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..eeddf7a408 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -112,4 +112,78 @@ 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..da861138bd 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,65 @@ AND customer_id = #{customerId} AND month_id = #{monthId} + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml index 9de96650b5..e059bc271e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml @@ -187,7 +187,6 @@ delete from screen_cpc_base_data where CUSTOMER_ID = #{customerId} - and DATA_END_TIME = #{dateId} and ( 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..fe274542a0 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,57 @@ 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/ScreenPioneerDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml index c2ad6b5722..de20dd018c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml @@ -188,7 +188,14 @@ CREATED_TIME, UPDATED_BY, UPDATED_TIME, - DATA_END_TIME + DATA_END_TIME, + PLAT_ISSUE_TOTAL, + PLAT_JOIN_USER_TOTAL, + PLAT_JOIN_PARTY_TOTAL, + PLAT_JOIN_PARTY_RATIO, + PLAT_TOPIC_TOTAL, + PLAT_PUBLISH_ISSUE_TOTAL, + PLAT_CLOSED_PROJECT_TOTAL ) values ( @@ -214,7 +221,14 @@ now(), 'APP_USER', now(), - #{item.dataEndTime} + #{item.dataEndTime}, + #{item.platIssueTotal}, + #{item.platJoinUserTotal}, + #{item.platJoinPartyTotal}, + #{item.platJoinPartyRatio}, + #{item.platTopicTotal}, + #{item.platPublishIssueTotal}, + #{item.platClosedProjectTotal} ) 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..51c75a1c17 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_project_data + where customer_id = #{customerId} + and DATA_END_TIME = #{dateId} + limit 1000 + + + + delete from screen_project_data + where customer_id = #{customerId} + and DATE_FORMAT(PROJECT_CREATE_TIME,'%Y%m%d') = #{dateId} + limit 1000 + + + + + + + + INSERT INTO screen_project_data + ( + id, + customer_id, + org_type, + org_id, + parent_id, + org_name, + project_id, + project_title, + project_create_time, + link_name, + link_mobile, + project_content, + project_level, + project_address, + all_category_name, + longitude, + latitude, + close_case_time, + data_end_time, + all_parent_ids, + project_status_code, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.projectId}, + #{item.projectTitle}, + #{item.projectCreateTime}, + #{item.linkName}, + #{item.linkMobile}, + #{item.projectContent}, + #{item.projectLevel}, + #{item.projectAddress}, + #{item.allCategoryName}, + #{item.longitude}, + #{item.latitude}, + #{item.closeCaseTime}, + #{item.dataEndTime}, + #{item.allParentIds}, + #{item.projectStatusCode}, + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + + + + update screen_project_data + + + + + when PROJECT_ID=#{i.projectId} then #{i.projectStatusCode} + + + + + + + when PROJECT_ID=#{i.projectId} then #{i.closeCaseTime} + + + + + + + when PROJECT_ID=#{i.projectId} then #{i.allCategoryName} + + + + + + + when PROJECT_ID=#{i.projectId} then #{i.projectLevel} + + + + + + #{dateId} + + + now() + + + + where + + PROJECT_ID=#{i.projectId} + + + 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..a9caf4992e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + delete from screen_project_img_data + + + PROJECT_ID = #{projectId} + + + + + + + INSERT INTO screen_project_img_data + ( + id, + customer_id, + project_id, + project_img_url, + sort, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.projectId}, + #{item.projectImgUrl}, + #{item.sort}, + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml new file mode 100644 index 0000000000..ace5879e53 --- /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..953f2bee72 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_project_process_attachment + + + PROCESS_ID = #{processId} + + + + + + + INSERT INTO screen_project_process_attachment + ( + id, + attachment_id, + customer_id, + project_id, + process_id, + file_place, + file_name, + attachment_name, + attachment_size, + attachment_format, + attachment_type, + attachment_url, + sort, + duration, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.attachmentId}, + #{item.customerId}, + #{item.projectId}, + #{item.processId}, + #{item.filePlace}, + #{item.fileName}, + #{item.attachmentName}, + #{item.attachmentSize}, + #{item.attachmentFormat}, + #{item.attachmentType}, + #{item.attachmentUrl}, + #{item.sort}, + #{item.duration}, + '0', + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml new file mode 100644 index 0000000000..fc19f60add --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml @@ -0,0 +1,76 @@ + + + + + + + delete from screen_project_process + where customer_id = #{customerId} + and DATA_END_TIME = #{dateId} + limit 1000 + + + + delete from screen_project_process + where customer_id = #{customerId} + and DATE_FORMAT(PROCESS_TIME,'%Y%m%d') = #{dateId} + limit 1000 + + + + + + INSERT INTO screen_project_process + ( + id, + customer_id, + process_id, + project_id, + transfer_dept_ids, + transfer_dept_name, + handler_name, + handler_id, + handler_type, + org_id_path, + operation, + public_reply, + internal_remark, + process_time, + data_end_time, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.processId}, + #{item.projectId}, + #{item.transferDeptName}, + #{item.transferDeptIds}, + #{item.handlerName}, + #{item.handlerId}, + #{item.handlerType}, + #{item.orgIdPath}, + #{item.operation}, + #{item.publicReply}, + #{item.internalRemark}, + #{item.processTime}, + #{item.dataEndTime}, + '0', + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/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..70fe070738 --- /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/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml index f47b266eba..9b6da626dc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -186,7 +186,7 @@ oper.UPDATED_TIME AS joinDate, IF(groupp.CREATED_BY = oper.CUSTOMER_USER_ID,'leader','member') AS leaderFlag, groupp.CREATED_BY AS groupOwnerId, - 'join' AS actionCode + IF(groupp.CREATED_BY = oper.CUSTOMER_USER_ID,'join','create') AS actionCode FROM RESI_GROUP groupp diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml index 945fd7b0e3..b4619ff0a2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml @@ -159,11 +159,10 @@ i.GRID_ID AS "gridId" FROM issue i - INNER JOIN issue_project_relation ipr ON i.ID = ipr.ISSUE_ID + INNER JOIN issue_project_relation ipr ON (i.ID = ipr.ISSUE_ID AND ipr.DEL_FLAG = '0') WHERE i.DEL_FLAG = '0' - AND ipr.DEL_FLAG = '0' - AND CUSTOMER_ID = #{customerId} + AND i.CUSTOMER_ID = #{customerId} + + \ No newline at end of file diff --git a/epmet-module/data-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..d5ead92c47 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml @@ -94,10 +94,35 @@ 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/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index 08c8d78d5b..2a8699d341 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -105,5 +105,34 @@ and CUSTOMER_ID = #{customerId} and PARAMETER_KEY ='detention_days' + + + + + + \ 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..e9079abc3b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -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' @@ -309,4 +311,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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 @@ \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml index 700c7fde61..f272c6f692 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -225,6 +225,7 @@ resi_topic_attachment WHERE DEL_FLAG = '0' + AND ATTACHMENT_TYPE = 'image' TOPIC_ID = #{item.sourceId} @@ -241,4 +242,34 @@ ID = #{item.sourceId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 90c573cb4a..969a848ae3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -17,11 +17,14 @@ - AND PARTICIPATION = '1' + AND ( + ( FIRST_REGISTER = '1' AND REGISTER = '1' AND PARTICIPATION = '1' ) + OR ( FIRST_REGISTER = '0' AND REGISTER = '0' AND PARTICIPATION = '1' ) + ) - AND REGISTER = '1' + AND FIRST_REGISTER = '1' @@ -52,11 +55,14 @@ - AND PARTICIPATION = '1' + AND ( + ( FIRST_REGISTER = '1' AND REGISTER = '1' AND PARTICIPATION = '1' ) + OR ( FIRST_REGISTER = '0' AND REGISTER = '0' AND PARTICIPATION = '1' ) + ) - AND REGISTER = '1' + AND FIRST_REGISTER = '1' @@ -91,11 +97,14 @@ - AND PARTICIPATION = '1' + AND ( + ( FIRST_REGISTER = '1' AND REGISTER = '1' AND PARTICIPATION = '1' ) + OR ( FIRST_REGISTER = '0' AND REGISTER = '0' AND PARTICIPATION = '1' ) + ) - AND REGISTER = '1' + AND FIRST_REGISTER = '1' @@ -131,11 +140,14 @@ - AND PARTICIPATION = '1' + AND ( + ( FIRST_REGISTER = '1' AND REGISTER = '1' AND PARTICIPATION = '1' ) + OR ( FIRST_REGISTER = '0' AND REGISTER = '0' AND PARTICIPATION = '1' ) + ) - AND REGISTER = '1' + AND FIRST_REGISTER = '1' @@ -299,11 +311,14 @@ - AND PARTICIPATION = '1' + AND ( + ( FIRST_REGISTER = '1' AND REGISTER = '1' AND PARTICIPATION = '1' ) + OR ( FIRST_REGISTER = '0' AND REGISTER = '0' AND PARTICIPATION = '1' ) + ) - AND REGISTER = '1' + AND FIRST_REGISTER = '1' @@ -332,11 +347,14 @@ - AND PARTICIPATION = '1' + AND ( + ( FIRST_REGISTER = '1' AND REGISTER = '1' AND PARTICIPATION = '1' ) + OR ( FIRST_REGISTER = '0' AND REGISTER = '0' AND PARTICIPATION = '1' ) + ) - AND REGISTER = '1' + AND FIRST_REGISTER = '1' @@ -496,4 +514,20 @@ AND register.CUSTOMER_ID = #{customerId} AND register.FIRST_REGISTER = '1' + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/数据值略小时可能的情况.txt b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/数据值略小时可能的情况.txt index cb778584e1..9551602a63 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/数据值略小时可能的情况.txt +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/数据值略小时可能的情况.txt @@ -4,4 +4,8 @@ 文档地址: 1. 大屏指标项文档说明:https://www.kdocs.cn/view/l/svtSfaUyzNYZ?f=130 - 2. 大屏或手机端:https://www.kdocs.cn/view/l/suilmk0Ziss1?f=130 \ No newline at end of file + 2. 大屏或手机端:https://www.kdocs.cn/view/l/suilmk0Ziss1?f=130 + +01.14问题记录: +1、孔村、锦水这两个项目的组织树level与产品定义不匹配。举例:孔村镇应属于街道级street客户,实际定义的是district +2、孔村镇的行政区域与实际业务建立的组织有些匹配不上,比如:孔村社区。 diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/Dockerfile b/epmet-module/epmet-activiti/epmet-activiti-server/Dockerfile index 40a62488b2..a578c93035 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/Dockerfile +++ b/epmet-module/epmet-activiti/epmet-activiti-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./epmet-activiti.jar EXPOSE 8086 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml index f9a372c94e..110490c3af 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /activiti diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/AreaCodeChildDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/AreaCodeChildDTO.java new file mode 100644 index 0000000000..31f68bc86f --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/AreaCodeChildDTO.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * (4-5)街道/城镇和社区/村地区code + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-07 + */ +@Data +public class AreaCodeChildDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 省份code + */ + private String code; + + /** + * 省份名称 + */ + private String name; + + /** + * 父级code + */ + private String pCode; + + /** + * 区域级别 + */ + private Integer level; + + /** + * 城乡分类代码 +111表示主城区 +112表示城乡结合区 +121表示镇中心区 +122表示镇乡结合区 +123表示特殊区域 +210表示乡中心区 +220表示村庄 + */ + private String catagory; + + /** + * 删除标识 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/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/AreaCodeDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/AreaCodeDTO.java new file mode 100644 index 0000000000..4666bc9883 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/AreaCodeDTO.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 大陆省市区地区码 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-07 + */ +@Data +public class AreaCodeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private Integer id; + + /** + * 省份code + */ + private String provinceCode; + + /** + * 省份名称 + */ + private String provinceName; + + /** + * 城市code + */ + private String cityCode; + + /** + * 城市名称 + */ + private String cityName; + + /** + * 区县code + */ + private String countyCode; + + /** + * 区县名称 + */ + private String countyName; + + /** + * 删除标识 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/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AddAreaCodeDictFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AddAreaCodeDictFormDTO.java new file mode 100644 index 0000000000..d97379ec72 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AddAreaCodeDictFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 003、新增街道或者社区地区编码 入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/5 17:39 + */ +@Data +public class AddAreaCodeDictFormDTO implements Serializable { + /** + * 街道或者社区所属的上一级areaCode + */ + @NotBlank(message = "parentAreaCode不能为空") + private String parentAreaCode; + + /** + * 新增的街道或者社区名称 + */ + @NotBlank(message = "name不能为空") + private String name; + + /** + * 传入此列时,代表修改名称 + */ + private String code; +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeDictFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeDictFormDTO.java new file mode 100644 index 0000000000..4340d4d015 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/AreaCodeDictFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/7 下午1:26 + */ +@Data +public class AreaCodeDictFormDTO implements Serializable { + + private static final long serialVersionUID = 5780301376757138238L; + + /** + * 根结点code 不传,则返回全部 + */ + private String rootAreaCode; + + /** + * 省级:province; 市级: city; 区县级: district ;乡(镇、街道)级:street ;社区级:community + */ + private String rootAreaLevel; +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AreaCodeDictResultDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AreaCodeDictResultDTO.java new file mode 100644 index 0000000000..eb9a658257 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/AreaCodeDictResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/1/7 下午1:32 + */ +@Data +public class AreaCodeDictResultDTO implements Serializable { + + private static final long serialVersionUID = -1312164785403693464L; + + /** + * 编码 + */ + private String code; + + /** + * 名称 + */ + private String name; + + /** + * 下一级 + */ + private List children; + + private String parentCode; + + public AreaCodeDictResultDTO() { + this.code = ""; + this.name = ""; + this.parentCode = ""; + this.children = new ArrayList<>(); + } +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/GetJwtAccessTokenResultDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/GetJwtAccessTokenResultDTO.java index 58cf9ecc6f..19a64acfa3 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/GetJwtAccessTokenResultDTO.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/GetJwtAccessTokenResultDTO.java @@ -12,5 +12,5 @@ public class GetJwtAccessTokenResultDTO { private String customerId; private String token; private Long ts; - + private String appId; } diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java index a29e1f5203..66a1f46ee7 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java @@ -2,17 +2,11 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.CostDayFormDTO; -import com.epmet.dto.form.ExternalAppAuthFormDTO; -import com.epmet.dto.form.GetJwtAccessTokenFormDTO; -import com.epmet.dto.form.WorkDayFormDTO; -import com.epmet.dto.result.CostDayResultDTO; -import com.epmet.dto.form.WorkMinuteFormDTO; -import com.epmet.dto.result.AppIdInfoResultDTO; -import com.epmet.dto.result.ExternalAppAuthResultDTO; -import com.epmet.dto.result.WorkDayResultDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; import com.epmet.feign.fallback.EpmetCommonServiceOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -26,7 +20,7 @@ import java.util.Map; * @date 2020/6/4 10:28 */ @FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class) -//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class, url = "http://localhost:8103") +// @FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class, url = "http://localhost:8103") public interface EpmetCommonServiceOpenFeignClient { /** * @param formDTO @@ -101,4 +95,22 @@ public interface EpmetCommonServiceOpenFeignClient { */ @PostMapping("commonservice/workday/workminutes") Result> workMinutes(@RequestBody WorkMinuteFormDTO param); + + /** + * @Description 行政地区编码查询 + * @Param formDTO + * @author zxc + * @date 2021/1/7 下午1:41 + */ + @PostMapping("commonservice/areacode/areacodedicttree") + Result> areaCodeDictTree(@RequestBody AreaCodeDictFormDTO formDTO); + + /** + * @param formDTO + * @author yinzuomei + * @description 003、新增街道或者社区地区编码 + * @Date 2021/2/5 17:39 + **/ + @PostMapping(value = "commonservice/areacode/addstreetcommareacode", consumes = MediaType.APPLICATION_JSON_VALUE) + Result addStreetCommAreaCode(@RequestBody AddAreaCodeDictFormDTO formDTO); } diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java index bd397df1d0..d9731558cd 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java @@ -3,15 +3,8 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.form.CostDayFormDTO; -import com.epmet.dto.form.ExternalAppAuthFormDTO; -import com.epmet.dto.form.GetJwtAccessTokenFormDTO; -import com.epmet.dto.form.WorkDayFormDTO; -import com.epmet.dto.form.WorkMinuteFormDTO; -import com.epmet.dto.result.CostDayResultDTO; -import com.epmet.dto.result.AppIdInfoResultDTO; -import com.epmet.dto.result.ExternalAppAuthResultDTO; -import com.epmet.dto.result.WorkDayResultDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import org.springframework.stereotype.Component; @@ -86,4 +79,14 @@ public class EpmetCommonServiceOpenFeignClientFallback implements EpmetCommonSer public Result> workMinutes(WorkMinuteFormDTO param) { return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "workMinutes", param); } + + @Override + public Result> areaCodeDictTree(AreaCodeDictFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "areaCodeDictTree", formDTO); + } + + @Override + public Result addStreetCommAreaCode(AddAreaCodeDictFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "addStreetCommAreaCode", formDTO); + } } diff --git a/epmet-module/epmet-common-service/common-service-server/Dockerfile b/epmet-module/epmet-common-service/common-service-server/Dockerfile index fe3d1a6f63..b0366f9c27 100644 --- a/epmet-module/epmet-common-service/common-service-server/Dockerfile +++ b/epmet-module/epmet-common-service/common-service-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./common-service.jar EXPOSE 8103 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml index ce46139cfe..bbf8441c97 100644 --- a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: common-service-server: container_name: common-service-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/common-service-server:0.3.24 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/common-service-server:0.3.26 ports: - "8103:8103" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index 46e103344a..c863208d25 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.24 + 0.3.26 com.epmet epmet-common-service diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/AreaCodeConstant.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/AreaCodeConstant.java new file mode 100644 index 0000000000..3ee44fec5f --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/AreaCodeConstant.java @@ -0,0 +1,29 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2021/1/7 下午4:53 + */ +public interface AreaCodeConstant { + + /** + * redis的key + */ + String SCREEN_TREE = "epmet:screen:tree:areacode"; + + String THREE_SCREEN_TREE = "epmet:screen:tree:threeareacode"; + + /** + * 省级:province; 市级: city; 区县级: district ;乡(镇、街道)级:street ;社区级:community + */ + String PROVINCE = "province"; + String CITY = "city"; + String DISTRICT = "district"; + String STREET = "street"; + String COMMUNITY = "community"; + + String ROOT_AGENCY_LEVEL_IS_LEVEL = "RootAreaLevel为空......"; + + String LEVEL_ERROR = "RootAreaLevel填写错误【%s】"; + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeChildController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeChildController.java new file mode 100644 index 0000000000..9925428237 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeChildController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.AreaCodeChildDTO; +import com.epmet.service.AreaCodeChildService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * (4-5)街道/城镇和社区/村地区code + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-07 + */ +@RestController +@RequestMapping("areacodechild") +public class AreaCodeChildController { + + @Autowired + private AreaCodeChildService areaCodeChildService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = areaCodeChildService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + AreaCodeChildDTO data = areaCodeChildService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody AreaCodeChildDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + areaCodeChildService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody AreaCodeChildDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + areaCodeChildService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + areaCodeChildService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeController.java new file mode 100644 index 0000000000..af8ecf093f --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/AreaCodeController.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.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.AreaCodeDTO; +import com.epmet.dto.form.AddAreaCodeDictFormDTO; +import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.result.AreaCodeDictResultDTO; +import com.epmet.service.AreaCodeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + + +/** + * 大陆省市区地区码 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-07 + */ +@RestController +@RequestMapping("areacode") +public class AreaCodeController { + + @Autowired + private AreaCodeService areaCodeService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = areaCodeService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + AreaCodeDTO data = areaCodeService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody AreaCodeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + areaCodeService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody AreaCodeDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + areaCodeService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + areaCodeService.delete(ids); + return new Result(); + } + + /** + * @Description 行政地区编码查询 + * @Param formDTO + * @author zxc + * @date 2021/1/7 下午1:41 + */ + @PostMapping("areacodedicttree") + public Result> areaCodeDictTree(@RequestBody AreaCodeDictFormDTO formDTO){ + return new Result>().ok(areaCodeService.areaCodeDictTreePlus(formDTO)); + } + + /** + * @param formDTO + * @author yinzuomei + * @description 003、新增街道或者社区地区编码 + * @Date 2021/2/5 17:39 + **/ + @PostMapping("addstreetcommareacode") + Result addStreetCommAreaCode(@RequestBody AddAreaCodeDictFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(areaCodeService.addStreetCommAreaCode(formDTO)); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/HelperController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/HelperController.java new file mode 100644 index 0000000000..d06e522e77 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/HelperController.java @@ -0,0 +1,23 @@ +package com.epmet.controller; + +import com.epmet.entity.HelperVideoEntity; +import com.epmet.service.HelperVideoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +@RequestMapping("helper") +public class HelperController { + + @Autowired + private HelperVideoService helperVideoService; + + @GetMapping("helper-video") + public String getHelpVideo() { + HelperVideoEntity enableHelperVideo = helperVideoService.getEnableHelperVideo(); + return "redirect:" + enableHelperVideo.getPath(); + } + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeChildDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeChildDao.java new file mode 100644 index 0000000000..24339f6397 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeChildDao.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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.AreaCodeChildDTO; +import com.epmet.entity.AreaCodeChildEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * (4-5)街道/城镇和社区/村地区code + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-07 + */ +@Mapper +public interface AreaCodeChildDao extends BaseDao { + + List selectAllChild(); + + AreaCodeChildDTO selectByCode(@Param("code") String code); + + List selectByPCodeAndName(@Param("parentAreaCode") String parentAreaCode, @Param("name") String name); + + AreaCodeChildDTO selectMaxChild(@Param("parentAreaCode") String parentAreaCode); +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.java new file mode 100644 index 0000000000..a5496cecc4 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/AreaCodeDao.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; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.AreaCodeDTO; +import com.epmet.entity.AreaCodeEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 大陆省市区地区码 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-07 + */ +@Mapper +public interface AreaCodeDao extends BaseDao { + + List selectAllArea(); + + AreaCodeDTO selectByCountyCode(String countyCode); +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/HelperVideoDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/HelperVideoDao.java new file mode 100644 index 0000000000..989989f347 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/HelperVideoDao.java @@ -0,0 +1,34 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.HelperVideoEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 宣传视频 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-01 + */ +@Mapper +public interface HelperVideoDao extends BaseDao { + + HelperVideoEntity getEnableHelperVideo(); +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/AreaCodeChildEntity.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/AreaCodeChildEntity.java new file mode 100644 index 0000000000..071cb5856f --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/AreaCodeChildEntity.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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; + +/** + * (4-5)街道/城镇和社区/村地区code + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("area_code_child") +public class AreaCodeChildEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 省份code + */ + private String code; + + /** + * 省份名称 + */ + private String name; + + /** + * 父级code + */ + private String pCode; + + /** + * 区域级别 + */ + private Integer level; + + /** + * 城乡分类代码 +111表示主城区 +112表示城乡结合区 +121表示镇中心区 +122表示镇乡结合区 +123表示特殊区域 +210表示乡中心区 +220表示村庄 + */ + private String catagory; + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/AreaCodeEntity.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/AreaCodeEntity.java new file mode 100644 index 0000000000..5e44df06ae --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/AreaCodeEntity.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 大陆省市区地区码 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-07 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("area_code") +public class AreaCodeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 省份code + */ + private String provinceCode; + + /** + * 省份名称 + */ + private String provinceName; + + /** + * 城市code + */ + private String cityCode; + + /** + * 城市名称 + */ + private String cityName; + + /** + * 区县code + */ + private String countyCode; + + /** + * 区县名称 + */ + private String countyName; + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/HelperVideoEntity.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/HelperVideoEntity.java new file mode 100644 index 0000000000..d94043acec --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/HelperVideoEntity.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.entity; + +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-01 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("helper_video") +public class HelperVideoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 存储路径 + */ + private String path; + + /** + * 是否启用 + */ + private Integer enable; + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/redis/AreaCodeChildRedis.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/redis/AreaCodeChildRedis.java new file mode 100644 index 0000000000..897c785eed --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/redis/AreaCodeChildRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * (4-5)街道/城镇和社区/村地区code + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-07 + */ +@Component +public class AreaCodeChildRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/redis/AreaCodeRedis.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/redis/AreaCodeRedis.java new file mode 100644 index 0000000000..d1c6218ea0 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/redis/AreaCodeRedis.java @@ -0,0 +1,52 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 大陆省市区地区码 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-07 + */ +@Component +public class AreaCodeRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(String key,Object o){ + redisUtils.set(key,o, NumConstant.ONE_NEG); + } + + public String get(String key){ + Object o = redisUtils.get(key); + if (null != o){ + return o.toString(); + } + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeChildService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeChildService.java new file mode 100644 index 0000000000..eb6ed813d3 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeChildService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.AreaCodeChildDTO; +import com.epmet.entity.AreaCodeChildEntity; + +import java.util.List; +import java.util.Map; + +/** + * (4-5)街道/城镇和社区/村地区code + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-07 + */ +public interface AreaCodeChildService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-01-07 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-01-07 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return AreaCodeChildDTO + * @author generator + * @date 2021-01-07 + */ + AreaCodeChildDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-07 + */ + void save(AreaCodeChildDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-07 + */ + void update(AreaCodeChildDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-01-07 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeService.java new file mode 100644 index 0000000000..415712de43 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/AreaCodeService.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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.AreaCodeDTO; +import com.epmet.dto.form.AddAreaCodeDictFormDTO; +import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.result.AreaCodeDictResultDTO; +import com.epmet.entity.AreaCodeEntity; + +import java.util.List; +import java.util.Map; + +/** + * 大陆省市区地区码 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-07 + */ +public interface AreaCodeService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-01-07 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-01-07 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return AreaCodeDTO + * @author generator + * @date 2021-01-07 + */ + AreaCodeDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-07 + */ + void save(AreaCodeDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-07 + */ + void update(AreaCodeDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-01-07 + */ + void delete(String[] ids); + + /** + * @Description 行政地区编码查询 + * @Param formDTO + * @author zxc + * @date 2021/1/7 下午1:41 + */ + List areaCodeDictTree(AreaCodeDictFormDTO formDTO); + + List areaCodeDictTreePlus(AreaCodeDictFormDTO formDTO); + + /** + * @param formDTO + * @author yinzuomei + * @description 003、新增街道或者社区地区编码 + * @Date 2021/2/5 17:39 + **/ + String addStreetCommAreaCode(AddAreaCodeDictFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/HelperVideoService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/HelperVideoService.java new file mode 100644 index 0000000000..63d348075c --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/HelperVideoService.java @@ -0,0 +1,7 @@ +package com.epmet.service; + +import com.epmet.entity.HelperVideoEntity; + +public interface HelperVideoService { + HelperVideoEntity getEnableHelperVideo(); +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeChildServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeChildServiceImpl.java new file mode 100644 index 0000000000..3b6aeaf587 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeChildServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.AreaCodeChildDao; +import com.epmet.dto.AreaCodeChildDTO; +import com.epmet.entity.AreaCodeChildEntity; +import com.epmet.redis.AreaCodeChildRedis; +import com.epmet.service.AreaCodeChildService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * (4-5)街道/城镇和社区/村地区code + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-07 + */ +@Service +public class AreaCodeChildServiceImpl extends BaseServiceImpl implements AreaCodeChildService { + + @Autowired + private AreaCodeChildRedis areaCodeChildRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, AreaCodeChildDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, AreaCodeChildDTO.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 AreaCodeChildDTO get(String id) { + AreaCodeChildEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, AreaCodeChildDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(AreaCodeChildDTO dto) { + AreaCodeChildEntity entity = ConvertUtils.sourceToTarget(dto, AreaCodeChildEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(AreaCodeChildDTO dto) { + AreaCodeChildEntity entity = ConvertUtils.sourceToTarget(dto, AreaCodeChildEntity.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/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java new file mode 100644 index 0000000000..5e865cfc44 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/AreaCodeServiceImpl.java @@ -0,0 +1,657 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import cn.hutool.core.collection.CollUtil; +import com.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.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.AreaCodeConstant; +import com.epmet.dao.AreaCodeChildDao; +import com.epmet.dao.AreaCodeDao; +import com.epmet.dto.AreaCodeChildDTO; +import com.epmet.dto.AreaCodeDTO; +import com.epmet.dto.form.AddAreaCodeDictFormDTO; +import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.result.AreaCodeDictResultDTO; +import com.epmet.entity.AreaCodeEntity; +import com.epmet.redis.AreaCodeRedis; +import com.epmet.service.AreaCodeChildService; +import com.epmet.service.AreaCodeService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 大陆省市区地区码 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-07 + */ +@Slf4j +@Service +public class AreaCodeServiceImpl extends BaseServiceImpl implements AreaCodeService { + + @Autowired + private AreaCodeRedis areaCodeRedis; + @Autowired + private AreaCodeChildDao childDao; + @Autowired + private AreaCodeChildService areaCodeChildService; + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, AreaCodeDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, AreaCodeDTO.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 AreaCodeDTO get(String id) { + AreaCodeEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, AreaCodeDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(AreaCodeDTO dto) { + AreaCodeEntity entity = ConvertUtils.sourceToTarget(dto, AreaCodeEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(AreaCodeDTO dto) { + AreaCodeEntity entity = ConvertUtils.sourceToTarget(dto, AreaCodeEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 行政地区编码查询 + * @Param formDTO + * @author zxc + * @date 2021/1/7 下午1:41 + */ + @Override + public List areaCodeDictTree(AreaCodeDictFormDTO formDTO) { + List tree = new ArrayList<>(); + String s = areaCodeRedis.get(AreaCodeConstant.SCREEN_TREE); + if (StringUtils.isNotBlank(s)){ + tree = JSON.parseArray(s,AreaCodeDictResultDTO.class); + }else { + List areaCodeDictResultDTOS = disposeTree(); + areaCodeRedis.set(AreaCodeConstant.SCREEN_TREE,areaCodeDictResultDTOS); + tree = areaCodeDictResultDTOS; + } + if (StringUtils.isBlank(formDTO.getRootAreaCode())){ + return tree; + } + List treeByRootAreaCode = getTreeByRootAreaCode(tree, formDTO.getRootAreaCode()); + return treeByRootAreaCode; + } + + /** + * @Description 行政区树查询 + * @Param + * @author zxc + * @date 2021/1/8 上午8:57 + */ + public List disposeTree(){ + // 查询所有省市区 + List areaCodeDTOS = baseDao.selectAllArea(); + // 查询所有街道、社区 + List areaCodeChildDTOS = childDao.selectAllChild(); + List result = new ArrayList<>(); + List fourResult = new ArrayList<>(); + List cityResult = new ArrayList<>(); + + // 街道-社区 + Map> groupByLevel = areaCodeChildDTOS.stream().collect(Collectors.groupingBy(AreaCodeChildDTO::getLevel)); + List levelFive = groupByLevel.get(NumConstant.FIVE); + Map> groupByPCode = levelFive.stream().collect(Collectors.groupingBy(AreaCodeChildDTO::getPCode)); + List levelFour = groupByLevel.get(NumConstant.FOUR); + levelFour.forEach(four -> { + AreaCodeDictResultDTO dto = new AreaCodeDictResultDTO(); + dto.setCode(four.getCode()); + dto.setName(four.getName()); + dto.setParentCode(four.getPCode()); + groupByPCode.forEach((pCode,v) -> { + if (dto.getCode().equals(pCode)){ + List fiveResult = new ArrayList<>(); + v.forEach(five -> { + AreaCodeDictResultDTO fiveDto = new AreaCodeDictResultDTO(); + fiveDto.setCode(five.getCode()); + fiveDto.setName(five.getName()); + fiveResult.add(fiveDto); + }); + List fiveSort = fiveResult.stream().sorted(Comparator.comparing(AreaCodeDictResultDTO::getCode)).collect(Collectors.toList()); + dto.setChildren(fiveSort); + } + }); + fourResult.add(dto); + }); + List fourSort = new ArrayList<>(); + if (!CollectionUtils.isEmpty(fourResult)){ + fourSort = fourResult.stream().sorted(Comparator.comparing(AreaCodeDictResultDTO::getCode)).collect(Collectors.toList()); + } + + // 省市区 + Map> groupByCity = areaCodeDTOS.stream().collect(Collectors.groupingBy(AreaCodeDTO::getCityCode)); + Map> groupByProvince = areaCodeDTOS.stream().collect(Collectors.groupingBy(AreaCodeDTO::getProvinceCode)); + List finalFourSort = fourSort; + groupByCity.forEach((c, v) -> { + AreaCodeDictResultDTO cityDto = new AreaCodeDictResultDTO(); + cityDto.setName(v.get(NumConstant.ZERO).getCityName()); + cityDto.setCode(v.get(NumConstant.ZERO).getCityCode()); + cityDto.setParentCode(v.get(NumConstant.ZERO).getProvinceCode()); + List threeResult = new ArrayList<>(); + v.forEach(three -> { + AreaCodeDictResultDTO dto = new AreaCodeDictResultDTO(); + dto.setCode(three.getCountyCode()); + dto.setName(three.getCountyName()); + List fourOnceResult = new ArrayList<>(); + finalFourSort.forEach(four -> { + if (dto.getCode().equals(four.getParentCode())){ + fourOnceResult.add(four); + } + }); + dto.setChildren(fourOnceResult); + threeResult.add(dto); + }); + List threeSort = threeResult.stream().sorted(Comparator.comparing(AreaCodeDictResultDTO::getCode)).collect(Collectors.toList()); + cityDto.setChildren(threeSort); + cityResult.add(cityDto); + }); + groupByProvince.forEach((p,v) -> { + AreaCodeDictResultDTO dto = new AreaCodeDictResultDTO(); + dto.setCode(p); + dto.setName(v.get(NumConstant.ZERO).getProvinceName()); + List cityOnceResult = new ArrayList<>(); + cityResult.forEach(c -> { + if (dto.getCode().equals(c.getParentCode())){ + cityOnceResult.add(c); + } + }); + List citySort = cityOnceResult.stream().sorted(Comparator.comparing(AreaCodeDictResultDTO::getCode)).collect(Collectors.toList()); + dto.setChildren(citySort); + result.add(dto); + }); + List collect = result.stream().sorted(Comparator.comparing(AreaCodeDictResultDTO::getCode)).collect(Collectors.toList()); + return collect; + } + + /** + * @Description 根据节点获取组织区域树【遍历】,传参只能是 省,市,区级别 【暂时这样,循环太多了】 + * + * + * 暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样 + * ==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样== + * 暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样==暂时这样 + * + * + * + * @Param tree + * @Param rootAreaCode + * @author zxc + * @date 2021/1/8 上午10:02 + */ + public List getTreeByRootAreaCode(List tree , String rootAreaCode){ + List result = new ArrayList<>(); + if (!CollectionUtils.isEmpty(tree)){ + // 省级获取 + for (AreaCodeDictResultDTO dto : tree) { + if (rootAreaCode.equals(dto.getCode())){ + result.add(dto); + return result; + } + // 市级获取 + if (!CollectionUtils.isEmpty(dto.getChildren())){ + for (AreaCodeDictResultDTO child : dto.getChildren()) { + if (rootAreaCode.equals(child.getCode())){ + result.add(child); + return result; + } + // 区级获取 + if (!CollectionUtils.isEmpty(child.getChildren())){ + for (AreaCodeDictResultDTO threeChild : child.getChildren()) { + if (rootAreaCode.equals(threeChild.getCode())){ + result.add(threeChild); + return result; + } + // 街道获取 + if (!CollectionUtils.isEmpty(threeChild.getChildren())){ + for (AreaCodeDictResultDTO fourChild : threeChild.getChildren()) { + if (rootAreaCode.equals(fourChild.getCode())){ + result.add(fourChild); + return result; + } + // 社区获取 + if (!CollectionUtils.isEmpty(fourChild.getChildren())){ + for (AreaCodeDictResultDTO fiveChild : fourChild.getChildren()) { + if (rootAreaCode.equals(fiveChild.getCode())){ + result.add(fiveChild); + return result; + } + } + } + } + } + } + } + } + } + } + } + return result; + } + + @Override + public List areaCodeDictTreePlus(AreaCodeDictFormDTO formDTO){ + List tree = new ArrayList<>(); + String s = areaCodeRedis.get(AreaCodeConstant.THREE_SCREEN_TREE); + if (StringUtils.isNotBlank(s)){ + tree = JSON.parseArray(s,AreaCodeDictResultDTO.class); + }else { + List threeTree = beforeThreeTree(); + areaCodeRedis.set(AreaCodeConstant.THREE_SCREEN_TREE,threeTree); + tree = threeTree; + } + if (StringUtils.isBlank(formDTO.getRootAreaCode())){ + return tree; + } + if (StringUtils.isBlank(formDTO.getRootAreaLevel())){ + throw new RenException(AreaCodeConstant.ROOT_AGENCY_LEVEL_IS_LEVEL); + } + // 传参为街道-社区级 + if (formDTO.getRootAreaLevel().equals(AreaCodeConstant.STREET) || formDTO.getRootAreaLevel().equals(AreaCodeConstant.COMMUNITY)){ + tree = disposeAfterTwoLevel(formDTO); + }else if (formDTO.getRootAreaLevel().equals(AreaCodeConstant.PROVINCE) || formDTO.getRootAreaLevel().equals(AreaCodeConstant.CITY) || formDTO.getRootAreaLevel().equals(AreaCodeConstant.DISTRICT)){ + tree = disposeBeforeThreeLevelFinal(formDTO,tree); + }else { + throw new RenException(String.format(AreaCodeConstant.LEVEL_ERROR,formDTO.getRootAreaLevel())); + } + return tree; + } + + /** + * @Description 省市区三级联动查询 + * @Param + * @author zxc + * @date 2021/1/11 上午9:35 + */ + public List beforeThreeTree(){ + // 查询所有省市区 + List areaCodeDTOS = baseDao.selectAllArea(); + Map> groupByCity = areaCodeDTOS.stream().collect(Collectors.groupingBy(AreaCodeDTO::getCityCode)); + Map> groupByProvince = areaCodeDTOS.stream().collect(Collectors.groupingBy(AreaCodeDTO::getProvinceCode)); + List result = new ArrayList<>(); + List cityResult = new ArrayList<>(); + groupByCity.forEach((c, v) -> { + AreaCodeDictResultDTO cityDto = new AreaCodeDictResultDTO(); + cityDto.setName(v.get(NumConstant.ZERO).getCityName()); + cityDto.setCode(v.get(NumConstant.ZERO).getCityCode()); + cityDto.setParentCode(v.get(NumConstant.ZERO).getProvinceCode()); + List threeResult = new ArrayList<>(); + v.forEach(three -> { + AreaCodeDictResultDTO dto = new AreaCodeDictResultDTO(); + dto.setCode(three.getCountyCode()); + dto.setName(three.getCountyName()); + //区县的上一级取city_code + dto.setParentCode(three.getCityCode()); + threeResult.add(dto); + }); + List threeSort = threeResult.stream().sorted(Comparator.comparing(AreaCodeDictResultDTO::getCode)).collect(Collectors.toList()); + cityDto.setChildren(threeSort); + cityResult.add(cityDto); + }); + groupByProvince.forEach((p,v) -> { + AreaCodeDictResultDTO dto = new AreaCodeDictResultDTO(); + dto.setCode(p); + dto.setName(v.get(NumConstant.ZERO).getProvinceName()); + List cityOnceResult = new ArrayList<>(); + cityResult.forEach(c -> { + if (dto.getCode().equals(c.getParentCode())){ + cityOnceResult.add(c); + } + }); + List citySort = cityOnceResult.stream().sorted(Comparator.comparing(AreaCodeDictResultDTO::getCode)).collect(Collectors.toList()); + dto.setChildren(citySort); + //一级行政地区parent_code设置为0 + dto.setParentCode("0"); + result.add(dto); + }); + List collect = result.stream().sorted(Comparator.comparing(AreaCodeDictResultDTO::getCode)).collect(Collectors.toList()); + return collect; + } + + /** + * @Description 街道-社区组织树查询 + * @Param + * @author zxc + * @date 2021/1/11 上午9:48 + */ + public List afterTwoTree(){ + // 查询所有街道、社区 + List areaCodeChildDTOS = childDao.selectAllChild(); + List fourResult = new ArrayList<>(); + List fiveResult = new ArrayList<>(); + // 街道-社区 + Map> groupByLevel = areaCodeChildDTOS.stream().collect(Collectors.groupingBy(AreaCodeChildDTO::getLevel)); + //社区 + List levelFive = groupByLevel.get(NumConstant.FIVE); + Map> groupByPCode = levelFive.stream().collect(Collectors.groupingBy(AreaCodeChildDTO::getPCode)); + //街道 + List levelFour = groupByLevel.get(NumConstant.FOUR); + // 6级 + List levelSix = groupByLevel.get(NumConstant.SIX); + Map> groupBySixPCode = levelSix.stream().collect(Collectors.groupingBy(AreaCodeChildDTO::getPCode)); + + levelFive.forEach(f -> { + AreaCodeDictResultDTO dto = new AreaCodeDictResultDTO(); + dto.setCode(f.getCode()); + dto.setName(f.getName()); + dto.setParentCode(f.getPCode()); + groupBySixPCode.forEach((k,v) -> { + if (dto.getCode().equals(k)){ + List six = new ArrayList<>(); + v.forEach(s -> { + AreaCodeDictResultDTO sixDto = new AreaCodeDictResultDTO(); + sixDto.setCode(s.getCode()); + sixDto.setName(s.getName()); + sixDto.setParentCode(k); + six.add(sixDto); + }); + List collect = six.stream().sorted(Comparator.comparing(AreaCodeDictResultDTO::getCode)).collect(Collectors.toList()); + dto.setChildren(collect); + } + }); + fiveResult.add(dto); + }); + Map> groupByFivePCode = fiveResult.stream().collect(Collectors.groupingBy(AreaCodeDictResultDTO::getParentCode)); + levelFour.forEach(four -> { + AreaCodeDictResultDTO dto = new AreaCodeDictResultDTO(); + dto.setCode(four.getCode()); + dto.setName(four.getName()); + dto.setParentCode(four.getPCode()); + groupByFivePCode.forEach((pCode,v) -> { + if (dto.getCode().equals(pCode)){ + dto.setChildren(v); + } + }); + fourResult.add(dto); + }); + List collect = fourResult.stream().sorted(Comparator.comparing(AreaCodeDictResultDTO::getCode)).collect(Collectors.toList()); + return collect; + } + + /** + * @Description 街道-社区组织树处理 + * @Param form + * @author zxc + * @date 2021/1/11 上午9:58 + */ + public List disposeAfterTwoLevel(AreaCodeDictFormDTO form){ + List result = new ArrayList<>(); + List areaCodeDictResultDTOS = afterTwoTree(); + if (CollectionUtils.isEmpty(areaCodeDictResultDTOS)){ + return new ArrayList<>(); + } + if (form.getRootAreaLevel().equals(AreaCodeConstant.STREET)){ + for (AreaCodeDictResultDTO dto : areaCodeDictResultDTOS) { + if (dto.getCode().equals(form.getRootAreaCode())){ + result.add(dto); + } + } + }else { + for (AreaCodeDictResultDTO dto : areaCodeDictResultDTOS) { + if (!CollectionUtils.isEmpty(dto.getChildren())){ + for (AreaCodeDictResultDTO child : dto.getChildren()) { + if (child.getCode().equals(form.getRootAreaCode())){ + result.add(child); + } + } + } + } + } + return result; + } + + /** + * @Description 省市区获取 + * @Param form + * @Param tree + * @author zxc + * @date 2021/1/12 上午9:22 + */ + public List disposeBeforeThreeLevel(AreaCodeDictFormDTO form,List tree){ + List result = new ArrayList<>(); + if (CollectionUtils.isEmpty(tree)){ + return new ArrayList<>(); + } + if (form.getRootAreaLevel().equals(AreaCodeConstant.PROVINCE)){ + for (AreaCodeDictResultDTO dto : tree) { + if (dto.getCode().equals(form.getRootAreaCode())){ + result.add(dto); + return result; + } + } + }else if (form.getRootAreaLevel().equals(AreaCodeConstant.CITY)){ + for (AreaCodeDictResultDTO dto : tree) { + if (!CollectionUtils.isEmpty(dto.getChildren())){ + for (AreaCodeDictResultDTO city : dto.getChildren()) { + if (city.getCode().equals(form.getRootAreaCode())){ + result.add(city); + return result; + } + } + } + } + }else if (form.getRootAreaLevel().equals(AreaCodeConstant.DISTRICT)){ + for (AreaCodeDictResultDTO dto : tree) { + if (!CollectionUtils.isEmpty(dto.getChildren())){ + for (AreaCodeDictResultDTO city : dto.getChildren()) { + if (!CollectionUtils.isEmpty(city.getChildren())){ + for (AreaCodeDictResultDTO child : city.getChildren()) { + if (child.getCode().equals(form.getRootAreaCode())){ + result.add(child); + return result; + } + } + } + } + } + } + } + return result; + } + + /** + * @Description 拼接 街道-社区 + * @Param form + * @Param tree + * @author zxc + * @date 2021/1/12 上午9:21 + */ + public List disposeBeforeThreeLevelFinal(AreaCodeDictFormDTO form,List tree){ + List threeDto = disposeBeforeThreeLevel(form, tree); + List twoDto = afterTwoTree(); + if (CollectionUtils.isEmpty(threeDto)){ + return new ArrayList<>(); + } + if (!CollectionUtils.isEmpty(twoDto)){ + if (form.getRootAreaLevel().equals(AreaCodeConstant.PROVINCE)){ + for (AreaCodeDictResultDTO dto : tree) { + if (dto.getCode().equals(form.getRootAreaCode())){ + if (!CollectionUtils.isEmpty(dto.getChildren())){ + for (AreaCodeDictResultDTO city : dto.getChildren()) { + if (!CollectionUtils.isEmpty(city.getChildren())){ + for (AreaCodeDictResultDTO child : city.getChildren()) { + List areaList = new ArrayList<>(); + for (AreaCodeDictResultDTO area : twoDto) { + if (child.getCode().equals(area.getParentCode())){ + areaList.add(area); + } + } + child.setChildren(areaList); + } + } + } + } + } + } + }else if (form.getRootAreaLevel().equals(AreaCodeConstant.CITY)){ + for (AreaCodeDictResultDTO dto : threeDto) { + if (!CollectionUtils.isEmpty(dto.getChildren())){ + for (AreaCodeDictResultDTO child : dto.getChildren()) { + List areaList = new ArrayList<>(); + for (AreaCodeDictResultDTO area : twoDto) { + if (child.getCode().equals(area.getParentCode())){ + areaList.add(area); + } + } + child.setChildren(areaList); + } + } + } + }else{ + for (AreaCodeDictResultDTO dto : threeDto) { + List areaList = new ArrayList<>(); + for (AreaCodeDictResultDTO area : twoDto) { + if (dto.getCode().equals(area.getParentCode())){ + areaList.add(area); + } + } + dto.setChildren(areaList); + } + } + } + return threeDto; + } + + /** + * @param formDTO + * @author yinzuomei + * @description 003、新增街道或者社区地区编码 + * @Date 2021/2/5 17:39 + **/ + @Override + public String addStreetCommAreaCode(AddAreaCodeDictFormDTO formDTO) { + String originalParentCode = formDTO.getParentAreaCode().replaceAll("_UD", ""); + if (originalParentCode.length() < NumConstant.SIX) { + throw new RenException("目前只允许添加街道或社区"); + } + if (StringUtils.isNotBlank(formDTO.getCode())) { + AreaCodeChildDTO areaCodeChildDTO = childDao.selectByCode(formDTO.getCode().trim()); + if (null == areaCodeChildDTO) { + throw new RenException("code不存在"); + } + areaCodeChildDTO.setName(formDTO.getName().trim()); + areaCodeChildService.update(areaCodeChildDTO); + return areaCodeChildDTO.getCode(); + } + AreaCodeChildDTO parent = childDao.selectByCode(formDTO.getParentAreaCode().trim()); + if (null == parent) { + AreaCodeDTO areaCodeDTOP = baseDao.selectByCountyCode(formDTO.getParentAreaCode().trim()); + if (null == areaCodeDTOP) { + throw new RenException("parentAreaCode不存在"); + } + } + + //同一级不允许重名 + List list = childDao.selectByPCodeAndName(formDTO.getParentAreaCode().trim(), formDTO.getName().trim()); + if (CollUtil.isNotEmpty(list)) { + throw new RenException("name已存在"); + } + AreaCodeChildDTO areaCodeChildDTO = new AreaCodeChildDTO(); + areaCodeChildDTO.setName(formDTO.getName().trim()); + areaCodeChildDTO.setPCode(formDTO.getParentAreaCode().trim()); + if (formDTO.getParentAreaCode().length() == NumConstant.SIX) { + //如果是增加街道 + areaCodeChildDTO.setLevel(NumConstant.FOUR); + } else { + areaCodeChildDTO.setLevel(null != parent && null != parent.getLevel() ? parent.getLevel() + 1 : null); + } + //获取子级中最大的编码 + AreaCodeChildDTO maxChildDto = childDao.selectMaxChild(formDTO.getParentAreaCode().trim()); + if (null == maxChildDto) { + //默认添加001 + areaCodeChildDTO.setCode(formDTO.getParentAreaCode().concat("001_UD")); + } else { + //去掉_UD +1赋值;370124001225_UD 锦源社区 + /*String[] codeArr = maxChildDto.getCode().split(StrConstant.UNDER_LINE); + long code = Long.parseLong(codeArr[NumConstant.ZERO]) + NumConstant.ONE; + areaCodeChildDTO.setCode(String.valueOf(code).concat("_UD"));*/ + String subStr = maxChildDto.getCode().replaceAll(formDTO.getParentAreaCode(), ""); + String[] codeArr = subStr.split(StrConstant.UNDER_LINE); + long num = Long.parseLong(codeArr[NumConstant.ZERO]) + NumConstant.ONE; + String numStr = String.valueOf(num); + String temp = ""; + if (numStr.length() == 2) { + temp = "0".concat(numStr); + } else if (numStr.length() == 1) { + temp = "00".concat(numStr); + } else { + temp = numStr; + } + areaCodeChildDTO.setCode(formDTO.getParentAreaCode().concat(temp).concat("_UD")); + /*log.info("最大="+maxChildDto.getCode()+";去初父级("+formDTO.getParentAreaCode()+"):"+subStr); + log.info("数字位+1="+num); + log.info("temp="+temp);*/ + } + //保存到area_code_child表 + areaCodeChildService.save(areaCodeChildDTO); + return areaCodeChildDTO.getCode(); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java index 7b4229b3a1..9d7fee1483 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppServiceImpl.java @@ -44,7 +44,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import java.util.HashMap; import java.util.List; import java.util.UUID; @@ -212,7 +211,7 @@ public class ExternalAppServiceImpl implements ExternalAppService { long ts = System.currentTimeMillis(); String token = tokenUtils.genToken(secret, appId, customerId, ts); - return new GetJwtAccessTokenResultDTO(customerId, token, ts); + return new GetJwtAccessTokenResultDTO(customerId, token, ts,appId); } @Override public AppIdInfoResultDTO appIdInfo(String appId) { diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/HelperVideoServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/HelperVideoServiceImpl.java new file mode 100644 index 0000000000..2de1313d45 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/HelperVideoServiceImpl.java @@ -0,0 +1,19 @@ +package com.epmet.service.impl; + +import com.epmet.dao.HelperVideoDao; +import com.epmet.entity.HelperVideoEntity; +import com.epmet.service.HelperVideoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class HelperVideoServiceImpl implements HelperVideoService { + + @Autowired + private HelperVideoDao helperVideoDao; + + @Override + public HelperVideoEntity getEnableHelperVideo() { + return helperVideoDao.getEnableHelperVideo(); + } +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java index 1714ed728a..83e9e2902a 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java @@ -71,9 +71,9 @@ public class ExtAppJwtTokenUtils { // String customrId = "2fe0065f70ca0e23ce4c26fca5f1d933"; //测试-模拟客户 - String secret = "c4096eb0497943c78327c5192621b209c38f20592f6a49cc8c79e8b77f3bd5c8"; - String appId = "f358d63a89f3670c197c62ca4c3a0366"; - String customrId = "45687aa479955f9d06204d415238f7cc"; + String secret = "723b8e61b55345e0a5a51798c7c1ad4aad388eed4fc8429eb8efeed1cd8564cb"; + String appId = "d536736d93b4262970a7bbac29cae4fa"; + String customrId = "613cc61a6b8ce4c70d21bd413dac72cc"; long ts = System.currentTimeMillis() + 1000 * 60 * 1; System.out.println("时间戳:" + ts); diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml index 83b7ee086a..8348460f3f 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /commonservice @@ -130,4 +131,10 @@ elink: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.10__areaCodeChild.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.10__areaCodeChild.sql new file mode 100644 index 0000000000..25345e13c0 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.10__areaCodeChild.sql @@ -0,0 +1,383 @@ +CREATE TABLE `area_code_child` ( + `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `CODE` varchar(16) DEFAULT NULL COMMENT '省份code', + `NAME` varchar(128) DEFAULT NULL COMMENT '省份名称', + `P_CODE` varchar(16) DEFAULT NULL COMMENT '父级code', + `LEVEL` tinyint(2) DEFAULT NULL COMMENT '区域级别', + `CATAGORY` varchar(8) DEFAULT NULL COMMENT '城乡分类代码\n111表示主城区\n112表示城乡结合区\n121表示镇中心区\n122表示镇乡结合区\n123表示特殊区域\n210表示乡中心区\n220表示村庄', + `DEL_FLAG` varchar(1) DEFAULT NULL COMMENT '删除标识 0-否,1-是', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁 查询时添加版本号,新加的事件需要更新版本号', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + UNIQUE KEY `unx_code` (`CODE`) +) ENGINE=InnoDB AUTO_INCREMENT=362 DEFAULT CHARSET=utf8mb4 COMMENT='(4-5)街道/城镇和社区/村地区code'; + +-- ---------------------------- +-- Records of area_code_child +-- ---------------------------- +BEGIN; +INSERT INTO `area_code_child` VALUES (1, '370124001', '榆山街道', '370124', 4, '', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (2, '370124001001', '东南沟居委会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (3, '370124001002', '南门居委会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (4, '370124001003', '东关居委会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (5, '370124001004', '西关居委会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (6, '370124001005', '北门居委会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (7, '370124001006', '北山东居委会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (8, '370124001007', '北山西居委会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (9, '370124001008', '东三里居委会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (10, '370124001009', '白庄居委会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (11, '370124001010', '龙山社区居民委员会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (12, '370124001011', '文汇社区居民委员会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (13, '370124001012', '五岭社区居民委员会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (14, '370124001013', '翠屏社区居民委员会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (15, '370124001014', '环秀社区居民委员会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (16, '370124001015', '会仙山社区居民委员会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (17, '370124001016', '文昌社区居民委员会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (18, '370124001017', '锦绣社区居民委员会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (19, '370124001018', '锦东社区居民委员会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (20, '370124001019', '云翠社区居民委员会', '370124001', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (21, '370124001201', '西桥口村民委员会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (22, '370124001202', '中桥口村民委员会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (23, '370124001203', '东桥口村民委员会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (24, '370124001204', '分水岭村民委员会', '370124001', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (25, '370124001205', '三山峪村民委员会', '370124001', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (26, '370124001206', '孙官庄村民委员会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (27, '370124001207', '东蛮子村民委员会', '370124001', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (28, '370124001208', '西蛮子村民委员会', '370124001', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (29, '370124001209', '洪口村民委员会', '370124001', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (30, '370124001210', '胡庄村民委员会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (31, '370124001211', '毕庄村民委员会', '370124001', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (32, '370124001212', '胡山口村民委员会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (33, '370124001213', '老博士村民委员会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (34, '370124001214', '新博士村民委员会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (35, '370124001215', '刘官庄村民委员会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (36, '370124001216', '石庄村民委员会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (37, '370124001217', '东阮二村民委员会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (38, '370124001218', '丁山头村民委员会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (39, '370124001219', '十里铺村委会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (40, '370124001220', '于庄村委会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (41, '370124001221', '葛庄村委会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (42, '370124001222', '尹庄村委会', '370124001', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (43, '370124001223', '田山村委会', '370124001', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (44, '370124001224', '翟庄村委会', '370124001', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (45, '370124002', '锦水街道', '370124', 4, '', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (46, '370124002001', '玫瑰苑社区居民委员会', '370124002', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (47, '370124002002', '大佛寺社区居民委员会', '370124002', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (48, '370124002003', '玫瑰湖社区居民委员会', '370124002', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (49, '370124002004', '锦水园社区居民委员会', '370124002', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (50, '370124002201', '西三里村委会', '370124002', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (51, '370124002207', '堡子村委会', '370124002', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (52, '370124002208', '南土楼村委会', '370124002', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (53, '370124002209', '中土楼村委会', '370124002', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (54, '370124002210', '北土楼村委会', '370124002', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (55, '370124002211', '山头村委会', '370124002', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (56, '370124002212', '上盆王村委会', '370124002', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (57, '370124002213', '下盆王村委会', '370124002', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (58, '370124002214', '前阮二村委会', '370124002', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (59, '370124002215', '后寨村委会', '370124002', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (60, '370124002216', '前寨村委会', '370124002', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (61, '370124002217', '凌庄村委会', '370124002', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (62, '370124002218', '东子顺南村委会', '370124002', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (63, '370124002219', '东子顺北村委会', '370124002', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (64, '370124002220', '毕海洋村委会', '370124002', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (65, '370124002221', '大李子顺村委会', '370124002', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (66, '370124002222', '李山头村委会', '370124002', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (67, '370124002223', '宋子顺村委会', '370124002', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (68, '370124002224', '西子顺村委会', '370124002', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (69, '370124002225', '东孙庄村委会', '370124002', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (70, '370124002226', '龙桥村委会', '370124002', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (71, '370124102', '东阿镇', '370124', 4, '', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (72, '370124102201', '东门村委会', '370124102', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (73, '370124102202', '衙前村委会', '370124102', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (74, '370124102203', '姜沟村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (75, '370124102204', '庞庄村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (76, '370124102205', '范庄村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (77, '370124102206', '赵庄村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (78, '370124102207', '魏院村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (79, '370124102208', '贾庄村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (80, '370124102209', '西山村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (81, '370124102210', '北门村委会', '370124102', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (82, '370124102211', '南门里村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (83, '370124102212', '南门外村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (84, '370124102213', '西南坝村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (85, '370124102214', '南坛村委会', '370124102', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (86, '370124102215', '窑头村委会', '370124102', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (87, '370124102216', '邢沟村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (88, '370124102217', '仁和村委会', '370124102', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (89, '370124102218', '孟庄村委会', '370124102', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (90, '370124102219', '乔庄村委会', '370124102', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (91, '370124102220', '北张村委会', '370124102', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (92, '370124102221', '东山村委会', '370124102', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (93, '370124102222', '苏桥村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (94, '370124102223', '铁杨村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (95, '370124102224', '大河口村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (96, '370124102225', '小河口村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (97, '370124102226', '刘庄村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (98, '370124102227', '司桥村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (99, '370124102228', '太平村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (100, '370124102229', '黄山村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (101, '370124102230', '小庙头村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (102, '370124102231', '于庄村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (103, '370124102232', '臧庙村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (104, '370124102233', '白塔村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (105, '370124102234', '三合村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (106, '370124102235', '乔楼村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (107, '370124102236', '北市村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (108, '370124102237', '杨山村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (109, '370124102238', '小屯村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (110, '370124102239', '桃园村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (111, '370124102240', '太和村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (112, '370124102241', '南市村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (113, '370124102242', '侯庄村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (114, '370124102243', '殷六村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (115, '370124102244', '辛庄村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (116, '370124102245', '王庄村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (117, '370124102246', '花石崖村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (118, '370124102247', '龙王峪村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (119, '370124102248', '北直沟村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (120, '370124102249', '东直沟村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (121, '370124102250', '西直沟村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (122, '370124102251', '西黑山村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (123, '370124102252', '东黑山村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (124, '370124102253', '苏山头村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (125, '370124102254', '直东峪村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (126, '370124102255', '新西直沟村委会', '370124102', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (127, '370124103', '孝直镇', '370124', 4, '', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (128, '370124103201', '孝直村委会', '370124103', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (129, '370124103202', '李庄村委会', '370124103', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (130, '370124103203', '贾庄村委会', '370124103', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (131, '370124103204', '天兴村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (132, '370124103205', '大兴村委会', '370124103', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (133, '370124103206', '后兴村委会', '370124103', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (134, '370124103207', '吴庄村委会', '370124103', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (135, '370124103208', '张平村委会', '370124103', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (136, '370124103209', '泊头村委会', '370124103', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (137, '370124103210', '凤凰庄村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (138, '370124103211', '赵桥村委会', '370124103', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (139, '370124103212', '张屯村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (140, '370124103213', '张沟村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (141, '370124103214', '张庄村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (142, '370124103215', '大天宫村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (143, '370124103216', '小天宫村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (144, '370124103217', '营子村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (145, '370124103218', '东辛庄村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (146, '370124103219', '西辛庄村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (147, '370124103220', '前庄科村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (148, '370124103221', '后庄科村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (149, '370124103222', '刁鹅岭村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (150, '370124103223', '商庄村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (151, '370124103224', '亓集村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (152, '370124103225', '付庄村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (153, '370124103226', '黄庄村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (154, '370124103227', '谷楼村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (155, '370124103228', '张小山村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (156, '370124103229', '野场村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (157, '370124103230', '廉庄村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (158, '370124103231', '南孔庄村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (159, '370124103232', '东湿口山村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (160, '370124103233', '西湿口山村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (161, '370124103234', '马跑泉村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (162, '370124103235', '刘家庄村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (163, '370124103236', '薄庄村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (164, '370124103237', '罗圈崖村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (165, '370124103238', '焦庄村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (166, '370124103239', '许小山村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (167, '370124103240', '刘所村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (168, '370124103241', '前店子村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (169, '370124103242', '后店子村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (170, '370124103243', '二虎庙村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (171, '370124103244', '沙岭村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (172, '370124103245', '龙洼村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (173, '370124103246', '邱林村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (174, '370124103247', '丁屯村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (175, '370124103248', '盛屯村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (176, '370124103249', '夏庄村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (177, '370124103250', '东白庄村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (178, '370124103251', '东江庄村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (179, '370124103252', '柳滩村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (180, '370124103261', '宋柳沟村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (181, '370124103262', '曲柳沟村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (182, '370124103263', '焦柳沟村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (183, '370124103264', '王柳沟村委会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (184, '370124103265', '和圣苑村民委员会', '370124103', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (185, '370124104', '孔村镇', '370124', 4, '', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (186, '370124104001', '卧龙山社区居民委员会', '370124104', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (187, '370124104201', '孔村村委会', '370124104', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (188, '370124104202', '合楼村委会', '370124104', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (189, '370124104203', '尹庄村委会', '370124104', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (190, '370124104204', '孙庄村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (191, '370124104205', '北孔庄村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (192, '370124104206', '王小屯村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (193, '370124104207', '东天宫村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (194, '370124104208', '前转湾村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (195, '370124104209', '后转村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (196, '370124104210', '王庄村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (197, '370124104211', '张山头村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (198, '370124104212', '前套村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (199, '370124104213', '后套村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (200, '370124104214', '陈屯村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (201, '370124104215', '郭柳沟村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (202, '370124104216', '范皮村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (203, '370124104217', '刘小庄村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (204, '370124104218', '臧庄村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (205, '370124104219', '太平村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (206, '370124104220', '蒋沟村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (207, '370124104221', '南官庄村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (208, '370124104222', '前岭村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (209, '370124104223', '孔子山村委会', '370124104', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (210, '370124104224', '金沟村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (211, '370124104225', '柿子园村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (212, '370124104226', '李沟村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (213, '370124104227', '晁峪村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (214, '370124104228', '王楼村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (215, '370124104229', '半边井村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (216, '370124104230', '前大峪村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (217, '370124104231', '后大峪村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (218, '370124104232', '黄坡村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (219, '370124104233', '小峪村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (220, '370124104234', '胡坡村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (221, '370124104235', '安子山村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (222, '370124104236', '大荆山村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (223, '370124104237', '值金寨村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (224, '370124104238', '白云峪村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (225, '370124104239', '孔庄村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (226, '370124104240', '北毛峪村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (227, '370124104241', '尚辛庄村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (228, '370124104242', '高路桥村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (229, '370124104243', '柿子峪村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (230, '370124104244', '团山沟村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (231, '370124104245', '石板台村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (232, '370124104246', '南毛峪村委会', '370124104', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (233, '370124105', '洪范池镇', '370124', 4, '', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (234, '370124105201', '东池村委会', '370124105', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (235, '370124105202', '西池村委会', '370124105', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (236, '370124105203', '大寨村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (237, '370124105204', '丁泉村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (238, '370124105205', '白雁泉村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (239, '370124105206', '长尾崖村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (240, '370124105207', '郭沟村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (241, '370124105208', '大黄崖村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (242, '370124105209', '小黄村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (243, '370124105210', '陶峪村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (244, '370124105211', '辛庄村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (245, '370124105212', '前杨村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (246, '370124105213', '后杨村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (247, '370124105214', '纸坊村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (248, '370124105215', '刘庙村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (249, '370124105216', '南张村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (250, '370124105217', '苗海村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (251, '370124105218', '杜庄村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (252, '370124105219', '谢庄村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (253, '370124105220', '周河村委会', '370124105', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (254, '370124105221', '书院村委会', '370124105', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (255, '370124105222', '北崖村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (256, '370124105223', '南崖村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (257, '370124105224', '张海村委会', '370124105', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (258, '370124105225', '候庄村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (259, '370124105226', '王山头村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (260, '370124105227', '臧庄村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (261, '370124105228', '周庄村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (262, '370124105229', '西北李村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (263, '370124105230', '闫庄村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (264, '370124105231', '陈庄村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (265, '370124105232', '任庄村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (266, '370124105233', '李山头村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (267, '370124105234', '刘庄村委会', '370124105', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (268, '370124106', '玫瑰镇', '370124', 4, '', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (269, '370124106201', '焦庄村委会', '370124106', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (270, '370124106202', '夏沟村委会', '370124106', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (271, '370124106203', '老张庄村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (272, '370124106204', '野仙沟村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (273, '370124106205', '罗寨村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (274, '370124106206', '西唐村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (275, '370124106207', '东唐村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (276, '370124106208', '陈山头村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (277, '370124106209', '葛庄村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (278, '370124106210', '王桥村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (279, '370124106211', '胡庄村委会', '370124106', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (280, '370124106212', '北新村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (281, '370124106213', '陶庄村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (282, '370124106214', '王镐店村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (283, '370124106215', '彭庄村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (284, '370124106216', '刘店村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (285, '370124106217', '庞口村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (286, '370124106218', '庄科村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (287, '370124106219', '北石硖村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (288, '370124106220', '南石硖村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (289, '370124106221', '李庄村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (290, '370124106222', '赵台村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (291, '370124106223', '高辛村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (292, '370124106224', '南泉村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (293, '370124106225', '北泉村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (294, '370124106226', '高套村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (295, '370124106227', '韩套村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (296, '370124106228', '刁山坡村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (297, '370124106229', '吉庄村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (298, '370124106230', '张洼村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (299, '370124106231', '大孙庄村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (300, '370124106232', '俄庄村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (301, '370124106233', '江庄村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (302, '370124106234', '孔集村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (303, '370124106235', '东豆山村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (304, '370124106236', '西豆山村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (305, '370124106237', '外山村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (306, '370124106238', '崔山头村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (307, '370124106239', '站东村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (308, '370124106240', '站西村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (309, '370124106241', '李屯村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (310, '370124106242', '丁口村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (311, '370124106243', '王小庄村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (312, '370124106244', '郭套村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (313, '370124106245', '李塘村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (314, '370124106246', '新屯村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (315, '370124106247', '东站村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (316, '370124106248', '南台村委会', '370124106', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (317, '370124107', '安城镇', '370124', 4, '', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (318, '370124107201', '安城村村委会', '370124107', 5, '121', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (319, '370124107202', '东土寨村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (320, '370124107203', '西土寨村委会', '370124107', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (321, '370124107204', '北圣井村委会', '370124107', 5, '122', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (322, '370124107205', '南圣井村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (323, '370124107206', '小官村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (324, '370124107207', '邱庄村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (325, '370124107208', '张天井村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (326, '370124107209', '常天井村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (327, '370124107210', '段天井村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (328, '370124107211', '铁山村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (329, '370124107212', '双井村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (330, '370124107213', '林洼村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (331, '370124107214', '大官村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (332, '370124107215', '东凤凰村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (333, '370124107216', '冷饭店村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (334, '370124107217', '刘庄村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (335, '370124107218', '东毛铺村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (336, '370124107219', '西毛铺村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (337, '370124107220', '皂火村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (338, '370124107221', '南栾湾村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (339, '370124107222', '中栾湾村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (340, '370124107223', '北栾湾村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (341, '370124107224', '南贵平村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (342, '370124107225', '北贵平村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (343, '370124107226', '让庄铺村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (344, '370124107227', '东平洛村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (345, '370124107228', '西平洛村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (346, '370124107229', '望口山村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (347, '370124107230', '胜利村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (348, '370124107231', '近镇村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (349, '370124107232', '三皇殿村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (350, '370124107233', '柳河圈村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (351, '370124107234', '辛庄村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (352, '370124107235', '王营村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (353, '370124107236', '东张营村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (354, '370124107237', '西张营村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (355, '370124107238', '南王店村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (356, '370124107239', '西瓜店村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (357, '370124107240', '西凤村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (358, '370124107241', '董庄村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (359, '370124107242', '宋庄村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (360, '370124107243', '兴隆镇村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code_child` VALUES (361, '370124107244', '虎豹川村委会', '370124107', 5, '220', NULL, NULL, NULL, NULL, NULL, NULL); +COMMIT; diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.8__createHelperVideo.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.8__createHelperVideo.sql new file mode 100644 index 0000000000..bc17eca33d --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.8__createHelperVideo.sql @@ -0,0 +1,18 @@ +-- create database epmet_adv default character set utf8mb4; + +-- CREATE USER epmet_adv_user@'%' IDENTIFIED BY 'EpmEt-db-UsEr'; +-- GRANT ALL ON `epmet_adv%`.* TO 'epmet_adv_user'@'%'; +-- flush privileges; + +CREATE TABLE `helper_video` ( + `ID` varchar(64) NOT NULL COMMENT 'id', + `PATH` varchar(255) NOT NULL COMMENT '存储路径', + `ENABLE` tinyint(1) NOT NULL COMMENT '是否启用', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `DEL_FLAG` int(11) unsigned DEFAULT NULL COMMENT '删除标识 0:未删除 1:删除', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建者', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新者', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='宣传视频' \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.9__areaCode.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.9__areaCode.sql new file mode 100644 index 0000000000..54a2058b5d --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.9__areaCode.sql @@ -0,0 +1,3298 @@ +CREATE TABLE `area_code` ( + `ID` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + `PROVINCE_CODE` varchar(16) DEFAULT NULL COMMENT '省份code', + `PROVINCE_NAME` varchar(128) DEFAULT NULL COMMENT '省份名称', + `CITY_CODE` varchar(16) DEFAULT NULL COMMENT '城市code', + `CITY_NAME` varchar(128) DEFAULT NULL COMMENT '城市名称', + `COUNTY_CODE` varchar(16) DEFAULT NULL COMMENT '区县code', + `COUNTY_NAME` varchar(128) DEFAULT NULL COMMENT '区县名称', + `DEL_FLAG` varchar(1) DEFAULT NULL COMMENT '删除标识 0-否,1-是', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁 查询时添加版本号,新加的事件需要更新版本号', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE, + UNIQUE KEY `unx_county_code` (`COUNTY_CODE`) +) ENGINE=InnoDB AUTO_INCREMENT=4552 DEFAULT CHARSET=utf8mb4 COMMENT='大陆省市区地区码'; + +-- ---------------------------- +-- Records of area_code +-- ---------------------------- +BEGIN; +INSERT INTO `area_code` VALUES (1, '11', '北京市', '1101', '市辖区', '110101', '东城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2, '11', '北京市', '1101', '市辖区', '110102', '西城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3, '11', '北京市', '1101', '市辖区', '110105', '朝阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4, '11', '北京市', '1101', '市辖区', '110106', '丰台区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (5, '11', '北京市', '1101', '市辖区', '110107', '石景山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (6, '11', '北京市', '1101', '市辖区', '110108', '海淀区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (7, '11', '北京市', '1101', '市辖区', '110109', '门头沟区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (8, '11', '北京市', '1101', '市辖区', '110111', '房山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (9, '11', '北京市', '1101', '市辖区', '110112', '通州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (10, '11', '北京市', '1101', '市辖区', '110113', '顺义区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (11, '11', '北京市', '1101', '市辖区', '110114', '昌平区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (12, '11', '北京市', '1101', '市辖区', '110115', '大兴区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (13, '11', '北京市', '1101', '市辖区', '110116', '怀柔区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (14, '11', '北京市', '1101', '市辖区', '110117', '平谷区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (15, '11', '北京市', '1101', '市辖区', '110118', '密云区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (16, '11', '北京市', '1101', '市辖区', '110119', '延庆区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (17, '12', '天津市', '1201', '市辖区', '120101', '和平区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (18, '12', '天津市', '1201', '市辖区', '120102', '河东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (19, '12', '天津市', '1201', '市辖区', '120103', '河西区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (20, '12', '天津市', '1201', '市辖区', '120104', '南开区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (21, '12', '天津市', '1201', '市辖区', '120105', '河北区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (22, '12', '天津市', '1201', '市辖区', '120106', '红桥区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (23, '12', '天津市', '1201', '市辖区', '120110', '东丽区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (24, '12', '天津市', '1201', '市辖区', '120111', '西青区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (25, '12', '天津市', '1201', '市辖区', '120112', '津南区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (26, '12', '天津市', '1201', '市辖区', '120113', '北辰区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (27, '12', '天津市', '1201', '市辖区', '120114', '武清区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (28, '12', '天津市', '1201', '市辖区', '120115', '宝坻区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (29, '12', '天津市', '1201', '市辖区', '120116', '滨海新区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (30, '12', '天津市', '1201', '市辖区', '120117', '宁河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (31, '12', '天津市', '1201', '市辖区', '120118', '静海区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (32, '12', '天津市', '1201', '市辖区', '120119', '蓟州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (33, '13', '河北省', '1301', '石家庄市', '130101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (34, '13', '河北省', '1301', '石家庄市', '130102', '长安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (35, '13', '河北省', '1301', '石家庄市', '130104', '桥西区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (36, '13', '河北省', '1301', '石家庄市', '130105', '新华区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (37, '13', '河北省', '1301', '石家庄市', '130107', '井陉矿区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (38, '13', '河北省', '1301', '石家庄市', '130108', '裕华区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (39, '13', '河北省', '1301', '石家庄市', '130109', '藁城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (40, '13', '河北省', '1301', '石家庄市', '130110', '鹿泉区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (41, '13', '河北省', '1301', '石家庄市', '130111', '栾城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (42, '13', '河北省', '1301', '石家庄市', '130121', '井陉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (43, '13', '河北省', '1301', '石家庄市', '130123', '正定县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (44, '13', '河北省', '1301', '石家庄市', '130125', '行唐县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (45, '13', '河北省', '1301', '石家庄市', '130126', '灵寿县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (46, '13', '河北省', '1301', '石家庄市', '130127', '高邑县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (47, '13', '河北省', '1301', '石家庄市', '130128', '深泽县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (48, '13', '河北省', '1301', '石家庄市', '130129', '赞皇县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (49, '13', '河北省', '1301', '石家庄市', '130130', '无极县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (50, '13', '河北省', '1301', '石家庄市', '130131', '平山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (51, '13', '河北省', '1301', '石家庄市', '130132', '元氏县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (52, '13', '河北省', '1301', '石家庄市', '130133', '赵县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (53, '13', '河北省', '1301', '石家庄市', '130171', '石家庄高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (54, '13', '河北省', '1301', '石家庄市', '130172', '石家庄循环化工园区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (55, '13', '河北省', '1301', '石家庄市', '130181', '辛集市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (56, '13', '河北省', '1301', '石家庄市', '130183', '晋州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (57, '13', '河北省', '1301', '石家庄市', '130184', '新乐市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (58, '13', '河北省', '1302', '唐山市', '130201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (59, '13', '河北省', '1302', '唐山市', '130202', '路南区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (60, '13', '河北省', '1302', '唐山市', '130203', '路北区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (61, '13', '河北省', '1302', '唐山市', '130204', '古冶区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (62, '13', '河北省', '1302', '唐山市', '130205', '开平区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (63, '13', '河北省', '1302', '唐山市', '130207', '丰南区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (64, '13', '河北省', '1302', '唐山市', '130208', '丰润区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (65, '13', '河北省', '1302', '唐山市', '130209', '曹妃甸区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (66, '13', '河北省', '1302', '唐山市', '130224', '滦南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (67, '13', '河北省', '1302', '唐山市', '130225', '乐亭县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (68, '13', '河北省', '1302', '唐山市', '130227', '迁西县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (69, '13', '河北省', '1302', '唐山市', '130229', '玉田县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (70, '13', '河北省', '1302', '唐山市', '130271', '河北唐山芦台经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (71, '13', '河北省', '1302', '唐山市', '130272', '唐山市汉沽管理区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (72, '13', '河北省', '1302', '唐山市', '130273', '唐山高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (73, '13', '河北省', '1302', '唐山市', '130274', '河北唐山海港经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (74, '13', '河北省', '1302', '唐山市', '130281', '遵化市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (75, '13', '河北省', '1302', '唐山市', '130283', '迁安市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (76, '13', '河北省', '1302', '唐山市', '130284', '滦州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (77, '13', '河北省', '1303', '秦皇岛市', '130301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (78, '13', '河北省', '1303', '秦皇岛市', '130302', '海港区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (79, '13', '河北省', '1303', '秦皇岛市', '130303', '山海关区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (80, '13', '河北省', '1303', '秦皇岛市', '130304', '北戴河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (81, '13', '河北省', '1303', '秦皇岛市', '130306', '抚宁区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (82, '13', '河北省', '1303', '秦皇岛市', '130321', '青龙满族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (83, '13', '河北省', '1303', '秦皇岛市', '130322', '昌黎县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (84, '13', '河北省', '1303', '秦皇岛市', '130324', '卢龙县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (85, '13', '河北省', '1303', '秦皇岛市', '130371', '秦皇岛市经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (86, '13', '河北省', '1303', '秦皇岛市', '130372', '北戴河新区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (87, '13', '河北省', '1304', '邯郸市', '130401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (88, '13', '河北省', '1304', '邯郸市', '130402', '邯山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (89, '13', '河北省', '1304', '邯郸市', '130403', '丛台区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (90, '13', '河北省', '1304', '邯郸市', '130404', '复兴区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (91, '13', '河北省', '1304', '邯郸市', '130406', '峰峰矿区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (92, '13', '河北省', '1304', '邯郸市', '130407', '肥乡区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (93, '13', '河北省', '1304', '邯郸市', '130408', '永年区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (94, '13', '河北省', '1304', '邯郸市', '130423', '临漳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (95, '13', '河北省', '1304', '邯郸市', '130424', '成安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (96, '13', '河北省', '1304', '邯郸市', '130425', '大名县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (97, '13', '河北省', '1304', '邯郸市', '130426', '涉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (98, '13', '河北省', '1304', '邯郸市', '130427', '磁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (99, '13', '河北省', '1304', '邯郸市', '130430', '邱县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (100, '13', '河北省', '1304', '邯郸市', '130431', '鸡泽县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (101, '13', '河北省', '1304', '邯郸市', '130432', '广平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (102, '13', '河北省', '1304', '邯郸市', '130433', '馆陶县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (103, '13', '河北省', '1304', '邯郸市', '130434', '魏县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (104, '13', '河北省', '1304', '邯郸市', '130435', '曲周县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (105, '13', '河北省', '1304', '邯郸市', '130471', '邯郸经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (106, '13', '河北省', '1304', '邯郸市', '130473', '邯郸冀南新区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (107, '13', '河北省', '1304', '邯郸市', '130481', '武安市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (108, '13', '河北省', '1305', '邢台市', '130501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (109, '13', '河北省', '1305', '邢台市', '130502', '襄都区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (110, '13', '河北省', '1305', '邢台市', '130503', '信都区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (111, '13', '河北省', '1305', '邢台市', '130505', '任泽区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (112, '13', '河北省', '1305', '邢台市', '130506', '南和区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (113, '13', '河北省', '1305', '邢台市', '130522', '临城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (114, '13', '河北省', '1305', '邢台市', '130523', '内丘县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (115, '13', '河北省', '1305', '邢台市', '130524', '柏乡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (116, '13', '河北省', '1305', '邢台市', '130525', '隆尧县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (117, '13', '河北省', '1305', '邢台市', '130528', '宁晋县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (118, '13', '河北省', '1305', '邢台市', '130529', '巨鹿县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (119, '13', '河北省', '1305', '邢台市', '130530', '新河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (120, '13', '河北省', '1305', '邢台市', '130531', '广宗县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (121, '13', '河北省', '1305', '邢台市', '130532', '平乡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (122, '13', '河北省', '1305', '邢台市', '130533', '威县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (123, '13', '河北省', '1305', '邢台市', '130534', '清河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (124, '13', '河北省', '1305', '邢台市', '130535', '临西县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (125, '13', '河北省', '1305', '邢台市', '130571', '河北邢台经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (126, '13', '河北省', '1305', '邢台市', '130581', '南宫市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (127, '13', '河北省', '1305', '邢台市', '130582', '沙河市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (128, '13', '河北省', '1306', '保定市', '130601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (129, '13', '河北省', '1306', '保定市', '130602', '竞秀区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (130, '13', '河北省', '1306', '保定市', '130606', '莲池区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (131, '13', '河北省', '1306', '保定市', '130607', '满城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (132, '13', '河北省', '1306', '保定市', '130608', '清苑区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (133, '13', '河北省', '1306', '保定市', '130609', '徐水区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (134, '13', '河北省', '1306', '保定市', '130623', '涞水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (135, '13', '河北省', '1306', '保定市', '130624', '阜平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (136, '13', '河北省', '1306', '保定市', '130626', '定兴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (137, '13', '河北省', '1306', '保定市', '130627', '唐县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (138, '13', '河北省', '1306', '保定市', '130628', '高阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (139, '13', '河北省', '1306', '保定市', '130629', '容城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (140, '13', '河北省', '1306', '保定市', '130630', '涞源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (141, '13', '河北省', '1306', '保定市', '130631', '望都县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (142, '13', '河北省', '1306', '保定市', '130632', '安新县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (143, '13', '河北省', '1306', '保定市', '130633', '易县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (144, '13', '河北省', '1306', '保定市', '130634', '曲阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (145, '13', '河北省', '1306', '保定市', '130635', '蠡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (146, '13', '河北省', '1306', '保定市', '130636', '顺平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (147, '13', '河北省', '1306', '保定市', '130637', '博野县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (148, '13', '河北省', '1306', '保定市', '130638', '雄县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (149, '13', '河北省', '1306', '保定市', '130671', '保定高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (150, '13', '河北省', '1306', '保定市', '130672', '保定白沟新城', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (151, '13', '河北省', '1306', '保定市', '130681', '涿州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (152, '13', '河北省', '1306', '保定市', '130682', '定州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (153, '13', '河北省', '1306', '保定市', '130683', '安国市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (154, '13', '河北省', '1306', '保定市', '130684', '高碑店市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (155, '13', '河北省', '1307', '张家口市', '130701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (156, '13', '河北省', '1307', '张家口市', '130702', '桥东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (157, '13', '河北省', '1307', '张家口市', '130703', '桥西区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (158, '13', '河北省', '1307', '张家口市', '130705', '宣化区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (159, '13', '河北省', '1307', '张家口市', '130706', '下花园区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (160, '13', '河北省', '1307', '张家口市', '130708', '万全区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (161, '13', '河北省', '1307', '张家口市', '130709', '崇礼区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (162, '13', '河北省', '1307', '张家口市', '130722', '张北县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (163, '13', '河北省', '1307', '张家口市', '130723', '康保县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (164, '13', '河北省', '1307', '张家口市', '130724', '沽源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (165, '13', '河北省', '1307', '张家口市', '130725', '尚义县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (166, '13', '河北省', '1307', '张家口市', '130726', '蔚县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (167, '13', '河北省', '1307', '张家口市', '130727', '阳原县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (168, '13', '河北省', '1307', '张家口市', '130728', '怀安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (169, '13', '河北省', '1307', '张家口市', '130730', '怀来县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (170, '13', '河北省', '1307', '张家口市', '130731', '涿鹿县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (171, '13', '河北省', '1307', '张家口市', '130732', '赤城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (172, '13', '河北省', '1307', '张家口市', '130771', '张家口经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (173, '13', '河北省', '1307', '张家口市', '130772', '张家口市察北管理区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (174, '13', '河北省', '1307', '张家口市', '130773', '张家口市塞北管理区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (175, '13', '河北省', '1308', '承德市', '130801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (176, '13', '河北省', '1308', '承德市', '130802', '双桥区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (177, '13', '河北省', '1308', '承德市', '130803', '双滦区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (178, '13', '河北省', '1308', '承德市', '130804', '鹰手营子矿区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (179, '13', '河北省', '1308', '承德市', '130821', '承德县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (180, '13', '河北省', '1308', '承德市', '130822', '兴隆县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (181, '13', '河北省', '1308', '承德市', '130824', '滦平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (182, '13', '河北省', '1308', '承德市', '130825', '隆化县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (183, '13', '河北省', '1308', '承德市', '130826', '丰宁满族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (184, '13', '河北省', '1308', '承德市', '130827', '宽城满族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (185, '13', '河北省', '1308', '承德市', '130828', '围场满族蒙古族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (186, '13', '河北省', '1308', '承德市', '130871', '承德高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (187, '13', '河北省', '1308', '承德市', '130881', '平泉市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (188, '13', '河北省', '1309', '沧州市', '130901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (189, '13', '河北省', '1309', '沧州市', '130902', '新华区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (190, '13', '河北省', '1309', '沧州市', '130903', '运河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (191, '13', '河北省', '1309', '沧州市', '130921', '沧县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (192, '13', '河北省', '1309', '沧州市', '130922', '青县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (193, '13', '河北省', '1309', '沧州市', '130923', '东光县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (194, '13', '河北省', '1309', '沧州市', '130924', '海兴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (195, '13', '河北省', '1309', '沧州市', '130925', '盐山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (196, '13', '河北省', '1309', '沧州市', '130926', '肃宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (197, '13', '河北省', '1309', '沧州市', '130927', '南皮县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (198, '13', '河北省', '1309', '沧州市', '130928', '吴桥县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (199, '13', '河北省', '1309', '沧州市', '130929', '献县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (200, '13', '河北省', '1309', '沧州市', '130930', '孟村回族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (201, '13', '河北省', '1309', '沧州市', '130971', '河北沧州经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (202, '13', '河北省', '1309', '沧州市', '130972', '沧州高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (203, '13', '河北省', '1309', '沧州市', '130973', '沧州渤海新区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (204, '13', '河北省', '1309', '沧州市', '130981', '泊头市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (205, '13', '河北省', '1309', '沧州市', '130982', '任丘市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (206, '13', '河北省', '1309', '沧州市', '130983', '黄骅市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (207, '13', '河北省', '1309', '沧州市', '130984', '河间市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (208, '13', '河北省', '1310', '廊坊市', '131001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (209, '13', '河北省', '1310', '廊坊市', '131002', '安次区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (210, '13', '河北省', '1310', '廊坊市', '131003', '广阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (211, '13', '河北省', '1310', '廊坊市', '131022', '固安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (212, '13', '河北省', '1310', '廊坊市', '131023', '永清县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (213, '13', '河北省', '1310', '廊坊市', '131024', '香河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (214, '13', '河北省', '1310', '廊坊市', '131025', '大城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (215, '13', '河北省', '1310', '廊坊市', '131026', '文安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (216, '13', '河北省', '1310', '廊坊市', '131028', '大厂回族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (217, '13', '河北省', '1310', '廊坊市', '131071', '廊坊经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (218, '13', '河北省', '1310', '廊坊市', '131081', '霸州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (219, '13', '河北省', '1310', '廊坊市', '131082', '三河市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (220, '13', '河北省', '1311', '衡水市', '131101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (221, '13', '河北省', '1311', '衡水市', '131102', '桃城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (222, '13', '河北省', '1311', '衡水市', '131103', '冀州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (223, '13', '河北省', '1311', '衡水市', '131121', '枣强县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (224, '13', '河北省', '1311', '衡水市', '131122', '武邑县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (225, '13', '河北省', '1311', '衡水市', '131123', '武强县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (226, '13', '河北省', '1311', '衡水市', '131124', '饶阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (227, '13', '河北省', '1311', '衡水市', '131125', '安平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (228, '13', '河北省', '1311', '衡水市', '131126', '故城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (229, '13', '河北省', '1311', '衡水市', '131127', '景县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (230, '13', '河北省', '1311', '衡水市', '131128', '阜城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (231, '13', '河北省', '1311', '衡水市', '131171', '河北衡水高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (232, '13', '河北省', '1311', '衡水市', '131172', '衡水滨湖新区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (233, '13', '河北省', '1311', '衡水市', '131182', '深州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (234, '14', '山西省', '1401', '太原市', '140101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (235, '14', '山西省', '1401', '太原市', '140105', '小店区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (236, '14', '山西省', '1401', '太原市', '140106', '迎泽区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (237, '14', '山西省', '1401', '太原市', '140107', '杏花岭区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (238, '14', '山西省', '1401', '太原市', '140108', '尖草坪区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (239, '14', '山西省', '1401', '太原市', '140109', '万柏林区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (240, '14', '山西省', '1401', '太原市', '140110', '晋源区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (241, '14', '山西省', '1401', '太原市', '140121', '清徐县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (242, '14', '山西省', '1401', '太原市', '140122', '阳曲县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (243, '14', '山西省', '1401', '太原市', '140123', '娄烦县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (244, '14', '山西省', '1401', '太原市', '140171', '山西转型综合改革示范区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (245, '14', '山西省', '1401', '太原市', '140181', '古交市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (246, '14', '山西省', '1402', '大同市', '140201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (247, '14', '山西省', '1402', '大同市', '140212', '新荣区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (248, '14', '山西省', '1402', '大同市', '140213', '平城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (249, '14', '山西省', '1402', '大同市', '140214', '云冈区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (250, '14', '山西省', '1402', '大同市', '140215', '云州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (251, '14', '山西省', '1402', '大同市', '140221', '阳高县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (252, '14', '山西省', '1402', '大同市', '140222', '天镇县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (253, '14', '山西省', '1402', '大同市', '140223', '广灵县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (254, '14', '山西省', '1402', '大同市', '140224', '灵丘县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (255, '14', '山西省', '1402', '大同市', '140225', '浑源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (256, '14', '山西省', '1402', '大同市', '140226', '左云县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (257, '14', '山西省', '1402', '大同市', '140271', '山西大同经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (258, '14', '山西省', '1403', '阳泉市', '140301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (259, '14', '山西省', '1403', '阳泉市', '140302', '城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (260, '14', '山西省', '1403', '阳泉市', '140303', '矿区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (261, '14', '山西省', '1403', '阳泉市', '140311', '郊区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (262, '14', '山西省', '1403', '阳泉市', '140321', '平定县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (263, '14', '山西省', '1403', '阳泉市', '140322', '盂县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (264, '14', '山西省', '1404', '长治市', '140401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (265, '14', '山西省', '1404', '长治市', '140403', '潞州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (266, '14', '山西省', '1404', '长治市', '140404', '上党区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (267, '14', '山西省', '1404', '长治市', '140405', '屯留区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (268, '14', '山西省', '1404', '长治市', '140406', '潞城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (269, '14', '山西省', '1404', '长治市', '140423', '襄垣县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (270, '14', '山西省', '1404', '长治市', '140425', '平顺县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (271, '14', '山西省', '1404', '长治市', '140426', '黎城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (272, '14', '山西省', '1404', '长治市', '140427', '壶关县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (273, '14', '山西省', '1404', '长治市', '140428', '长子县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (274, '14', '山西省', '1404', '长治市', '140429', '武乡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (275, '14', '山西省', '1404', '长治市', '140430', '沁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (276, '14', '山西省', '1404', '长治市', '140431', '沁源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (277, '14', '山西省', '1404', '长治市', '140471', '山西长治高新技术产业园区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (278, '14', '山西省', '1405', '晋城市', '140501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (279, '14', '山西省', '1405', '晋城市', '140502', '城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (280, '14', '山西省', '1405', '晋城市', '140521', '沁水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (281, '14', '山西省', '1405', '晋城市', '140522', '阳城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (282, '14', '山西省', '1405', '晋城市', '140524', '陵川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (283, '14', '山西省', '1405', '晋城市', '140525', '泽州县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (284, '14', '山西省', '1405', '晋城市', '140581', '高平市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (285, '14', '山西省', '1406', '朔州市', '140601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (286, '14', '山西省', '1406', '朔州市', '140602', '朔城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (287, '14', '山西省', '1406', '朔州市', '140603', '平鲁区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (288, '14', '山西省', '1406', '朔州市', '140621', '山阴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (289, '14', '山西省', '1406', '朔州市', '140622', '应县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (290, '14', '山西省', '1406', '朔州市', '140623', '右玉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (291, '14', '山西省', '1406', '朔州市', '140671', '山西朔州经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (292, '14', '山西省', '1406', '朔州市', '140681', '怀仁市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (293, '14', '山西省', '1407', '晋中市', '140701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (294, '14', '山西省', '1407', '晋中市', '140702', '榆次区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (295, '14', '山西省', '1407', '晋中市', '140703', '太谷区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (296, '14', '山西省', '1407', '晋中市', '140721', '榆社县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (297, '14', '山西省', '1407', '晋中市', '140722', '左权县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (298, '14', '山西省', '1407', '晋中市', '140723', '和顺县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (299, '14', '山西省', '1407', '晋中市', '140724', '昔阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (300, '14', '山西省', '1407', '晋中市', '140725', '寿阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (301, '14', '山西省', '1407', '晋中市', '140727', '祁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (302, '14', '山西省', '1407', '晋中市', '140728', '平遥县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (303, '14', '山西省', '1407', '晋中市', '140729', '灵石县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (304, '14', '山西省', '1407', '晋中市', '140781', '介休市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (305, '14', '山西省', '1408', '运城市', '140801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (306, '14', '山西省', '1408', '运城市', '140802', '盐湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (307, '14', '山西省', '1408', '运城市', '140821', '临猗县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (308, '14', '山西省', '1408', '运城市', '140822', '万荣县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (309, '14', '山西省', '1408', '运城市', '140823', '闻喜县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (310, '14', '山西省', '1408', '运城市', '140824', '稷山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (311, '14', '山西省', '1408', '运城市', '140825', '新绛县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (312, '14', '山西省', '1408', '运城市', '140826', '绛县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (313, '14', '山西省', '1408', '运城市', '140827', '垣曲县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (314, '14', '山西省', '1408', '运城市', '140828', '夏县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (315, '14', '山西省', '1408', '运城市', '140829', '平陆县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (316, '14', '山西省', '1408', '运城市', '140830', '芮城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (317, '14', '山西省', '1408', '运城市', '140881', '永济市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (318, '14', '山西省', '1408', '运城市', '140882', '河津市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (319, '14', '山西省', '1409', '忻州市', '140901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (320, '14', '山西省', '1409', '忻州市', '140902', '忻府区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (321, '14', '山西省', '1409', '忻州市', '140921', '定襄县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (322, '14', '山西省', '1409', '忻州市', '140922', '五台县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (323, '14', '山西省', '1409', '忻州市', '140923', '代县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (324, '14', '山西省', '1409', '忻州市', '140924', '繁峙县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (325, '14', '山西省', '1409', '忻州市', '140925', '宁武县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (326, '14', '山西省', '1409', '忻州市', '140926', '静乐县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (327, '14', '山西省', '1409', '忻州市', '140927', '神池县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (328, '14', '山西省', '1409', '忻州市', '140928', '五寨县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (329, '14', '山西省', '1409', '忻州市', '140929', '岢岚县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (330, '14', '山西省', '1409', '忻州市', '140930', '河曲县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (331, '14', '山西省', '1409', '忻州市', '140931', '保德县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (332, '14', '山西省', '1409', '忻州市', '140932', '偏关县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (333, '14', '山西省', '1409', '忻州市', '140971', '五台山风景名胜区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (334, '14', '山西省', '1409', '忻州市', '140981', '原平市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (335, '14', '山西省', '1410', '临汾市', '141001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (336, '14', '山西省', '1410', '临汾市', '141002', '尧都区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (337, '14', '山西省', '1410', '临汾市', '141021', '曲沃县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (338, '14', '山西省', '1410', '临汾市', '141022', '翼城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (339, '14', '山西省', '1410', '临汾市', '141023', '襄汾县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (340, '14', '山西省', '1410', '临汾市', '141024', '洪洞县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (341, '14', '山西省', '1410', '临汾市', '141025', '古县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (342, '14', '山西省', '1410', '临汾市', '141026', '安泽县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (343, '14', '山西省', '1410', '临汾市', '141027', '浮山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (344, '14', '山西省', '1410', '临汾市', '141028', '吉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (345, '14', '山西省', '1410', '临汾市', '141029', '乡宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (346, '14', '山西省', '1410', '临汾市', '141030', '大宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (347, '14', '山西省', '1410', '临汾市', '141031', '隰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (348, '14', '山西省', '1410', '临汾市', '141032', '永和县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (349, '14', '山西省', '1410', '临汾市', '141033', '蒲县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (350, '14', '山西省', '1410', '临汾市', '141034', '汾西县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (351, '14', '山西省', '1410', '临汾市', '141081', '侯马市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (352, '14', '山西省', '1410', '临汾市', '141082', '霍州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (353, '14', '山西省', '1411', '吕梁市', '141101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (354, '14', '山西省', '1411', '吕梁市', '141102', '离石区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (355, '14', '山西省', '1411', '吕梁市', '141121', '文水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (356, '14', '山西省', '1411', '吕梁市', '141122', '交城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (357, '14', '山西省', '1411', '吕梁市', '141123', '兴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (358, '14', '山西省', '1411', '吕梁市', '141124', '临县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (359, '14', '山西省', '1411', '吕梁市', '141125', '柳林县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (360, '14', '山西省', '1411', '吕梁市', '141126', '石楼县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (361, '14', '山西省', '1411', '吕梁市', '141127', '岚县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (362, '14', '山西省', '1411', '吕梁市', '141128', '方山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (363, '14', '山西省', '1411', '吕梁市', '141129', '中阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (364, '14', '山西省', '1411', '吕梁市', '141130', '交口县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (365, '14', '山西省', '1411', '吕梁市', '141181', '孝义市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (366, '14', '山西省', '1411', '吕梁市', '141182', '汾阳市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (367, '15', '内蒙古自治区', '1501', '呼和浩特市', '150101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (368, '15', '内蒙古自治区', '1501', '呼和浩特市', '150102', '新城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (369, '15', '内蒙古自治区', '1501', '呼和浩特市', '150103', '回民区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (370, '15', '内蒙古自治区', '1501', '呼和浩特市', '150104', '玉泉区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (371, '15', '内蒙古自治区', '1501', '呼和浩特市', '150105', '赛罕区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (372, '15', '内蒙古自治区', '1501', '呼和浩特市', '150121', '土默特左旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (373, '15', '内蒙古自治区', '1501', '呼和浩特市', '150122', '托克托县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (374, '15', '内蒙古自治区', '1501', '呼和浩特市', '150123', '和林格尔县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (375, '15', '内蒙古自治区', '1501', '呼和浩特市', '150124', '清水河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (376, '15', '内蒙古自治区', '1501', '呼和浩特市', '150125', '武川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (377, '15', '内蒙古自治区', '1501', '呼和浩特市', '150172', '呼和浩特经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (378, '15', '内蒙古自治区', '1502', '包头市', '150201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (379, '15', '内蒙古自治区', '1502', '包头市', '150202', '东河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (380, '15', '内蒙古自治区', '1502', '包头市', '150203', '昆都仑区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (381, '15', '内蒙古自治区', '1502', '包头市', '150204', '青山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (382, '15', '内蒙古自治区', '1502', '包头市', '150205', '石拐区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (383, '15', '内蒙古自治区', '1502', '包头市', '150206', '白云鄂博矿区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (384, '15', '内蒙古自治区', '1502', '包头市', '150207', '九原区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (385, '15', '内蒙古自治区', '1502', '包头市', '150221', '土默特右旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (386, '15', '内蒙古自治区', '1502', '包头市', '150222', '固阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (387, '15', '内蒙古自治区', '1502', '包头市', '150223', '达尔罕茂明安联合旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (388, '15', '内蒙古自治区', '1502', '包头市', '150271', '包头稀土高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (389, '15', '内蒙古自治区', '1503', '乌海市', '150301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (390, '15', '内蒙古自治区', '1503', '乌海市', '150302', '海勃湾区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (391, '15', '内蒙古自治区', '1503', '乌海市', '150303', '海南区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (392, '15', '内蒙古自治区', '1503', '乌海市', '150304', '乌达区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (393, '15', '内蒙古自治区', '1504', '赤峰市', '150401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (394, '15', '内蒙古自治区', '1504', '赤峰市', '150402', '红山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (395, '15', '内蒙古自治区', '1504', '赤峰市', '150403', '元宝山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (396, '15', '内蒙古自治区', '1504', '赤峰市', '150404', '松山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (397, '15', '内蒙古自治区', '1504', '赤峰市', '150421', '阿鲁科尔沁旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (398, '15', '内蒙古自治区', '1504', '赤峰市', '150422', '巴林左旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (399, '15', '内蒙古自治区', '1504', '赤峰市', '150423', '巴林右旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (400, '15', '内蒙古自治区', '1504', '赤峰市', '150424', '林西县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (401, '15', '内蒙古自治区', '1504', '赤峰市', '150425', '克什克腾旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (402, '15', '内蒙古自治区', '1504', '赤峰市', '150426', '翁牛特旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (403, '15', '内蒙古自治区', '1504', '赤峰市', '150428', '喀喇沁旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (404, '15', '内蒙古自治区', '1504', '赤峰市', '150429', '宁城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (405, '15', '内蒙古自治区', '1504', '赤峰市', '150430', '敖汉旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (406, '15', '内蒙古自治区', '1505', '通辽市', '150501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (407, '15', '内蒙古自治区', '1505', '通辽市', '150502', '科尔沁区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (408, '15', '内蒙古自治区', '1505', '通辽市', '150521', '科尔沁左翼中旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (409, '15', '内蒙古自治区', '1505', '通辽市', '150522', '科尔沁左翼后旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (410, '15', '内蒙古自治区', '1505', '通辽市', '150523', '开鲁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (411, '15', '内蒙古自治区', '1505', '通辽市', '150524', '库伦旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (412, '15', '内蒙古自治区', '1505', '通辽市', '150525', '奈曼旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (413, '15', '内蒙古自治区', '1505', '通辽市', '150526', '扎鲁特旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (414, '15', '内蒙古自治区', '1505', '通辽市', '150571', '通辽经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (415, '15', '内蒙古自治区', '1505', '通辽市', '150581', '霍林郭勒市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (416, '15', '内蒙古自治区', '1506', '鄂尔多斯市', '150601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (417, '15', '内蒙古自治区', '1506', '鄂尔多斯市', '150602', '东胜区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (418, '15', '内蒙古自治区', '1506', '鄂尔多斯市', '150603', '康巴什区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (419, '15', '内蒙古自治区', '1506', '鄂尔多斯市', '150621', '达拉特旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (420, '15', '内蒙古自治区', '1506', '鄂尔多斯市', '150622', '准格尔旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (421, '15', '内蒙古自治区', '1506', '鄂尔多斯市', '150623', '鄂托克前旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (422, '15', '内蒙古自治区', '1506', '鄂尔多斯市', '150624', '鄂托克旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (423, '15', '内蒙古自治区', '1506', '鄂尔多斯市', '150625', '杭锦旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (424, '15', '内蒙古自治区', '1506', '鄂尔多斯市', '150626', '乌审旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (425, '15', '内蒙古自治区', '1506', '鄂尔多斯市', '150627', '伊金霍洛旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (426, '15', '内蒙古自治区', '1507', '呼伦贝尔市', '150701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (427, '15', '内蒙古自治区', '1507', '呼伦贝尔市', '150702', '海拉尔区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (428, '15', '内蒙古自治区', '1507', '呼伦贝尔市', '150703', '扎赉诺尔区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (429, '15', '内蒙古自治区', '1507', '呼伦贝尔市', '150721', '阿荣旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (430, '15', '内蒙古自治区', '1507', '呼伦贝尔市', '150722', '莫力达瓦达斡尔族自治旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (431, '15', '内蒙古自治区', '1507', '呼伦贝尔市', '150723', '鄂伦春自治旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (432, '15', '内蒙古自治区', '1507', '呼伦贝尔市', '150724', '鄂温克族自治旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (433, '15', '内蒙古自治区', '1507', '呼伦贝尔市', '150725', '陈巴尔虎旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (434, '15', '内蒙古自治区', '1507', '呼伦贝尔市', '150726', '新巴尔虎左旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (435, '15', '内蒙古自治区', '1507', '呼伦贝尔市', '150727', '新巴尔虎右旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (436, '15', '内蒙古自治区', '1507', '呼伦贝尔市', '150781', '满洲里市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (437, '15', '内蒙古自治区', '1507', '呼伦贝尔市', '150782', '牙克石市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (438, '15', '内蒙古自治区', '1507', '呼伦贝尔市', '150783', '扎兰屯市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (439, '15', '内蒙古自治区', '1507', '呼伦贝尔市', '150784', '额尔古纳市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (440, '15', '内蒙古自治区', '1507', '呼伦贝尔市', '150785', '根河市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (441, '15', '内蒙古自治区', '1508', '巴彦淖尔市', '150801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (442, '15', '内蒙古自治区', '1508', '巴彦淖尔市', '150802', '临河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (443, '15', '内蒙古自治区', '1508', '巴彦淖尔市', '150821', '五原县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (444, '15', '内蒙古自治区', '1508', '巴彦淖尔市', '150822', '磴口县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (445, '15', '内蒙古自治区', '1508', '巴彦淖尔市', '150823', '乌拉特前旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (446, '15', '内蒙古自治区', '1508', '巴彦淖尔市', '150824', '乌拉特中旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (447, '15', '内蒙古自治区', '1508', '巴彦淖尔市', '150825', '乌拉特后旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (448, '15', '内蒙古自治区', '1508', '巴彦淖尔市', '150826', '杭锦后旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (449, '15', '内蒙古自治区', '1509', '乌兰察布市', '150901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (450, '15', '内蒙古自治区', '1509', '乌兰察布市', '150902', '集宁区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (451, '15', '内蒙古自治区', '1509', '乌兰察布市', '150921', '卓资县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (452, '15', '内蒙古自治区', '1509', '乌兰察布市', '150922', '化德县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (453, '15', '内蒙古自治区', '1509', '乌兰察布市', '150923', '商都县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (454, '15', '内蒙古自治区', '1509', '乌兰察布市', '150924', '兴和县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (455, '15', '内蒙古自治区', '1509', '乌兰察布市', '150925', '凉城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (456, '15', '内蒙古自治区', '1509', '乌兰察布市', '150926', '察哈尔右翼前旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (457, '15', '内蒙古自治区', '1509', '乌兰察布市', '150927', '察哈尔右翼中旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (458, '15', '内蒙古自治区', '1509', '乌兰察布市', '150928', '察哈尔右翼后旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (459, '15', '内蒙古自治区', '1509', '乌兰察布市', '150929', '四子王旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (460, '15', '内蒙古自治区', '1509', '乌兰察布市', '150981', '丰镇市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (461, '15', '内蒙古自治区', '1522', '兴安盟', '152201', '乌兰浩特市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (462, '15', '内蒙古自治区', '1522', '兴安盟', '152202', '阿尔山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (463, '15', '内蒙古自治区', '1522', '兴安盟', '152221', '科尔沁右翼前旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (464, '15', '内蒙古自治区', '1522', '兴安盟', '152222', '科尔沁右翼中旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (465, '15', '内蒙古自治区', '1522', '兴安盟', '152223', '扎赉特旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (466, '15', '内蒙古自治区', '1522', '兴安盟', '152224', '突泉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (467, '15', '内蒙古自治区', '1525', '锡林郭勒盟', '152501', '二连浩特市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (468, '15', '内蒙古自治区', '1525', '锡林郭勒盟', '152502', '锡林浩特市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (469, '15', '内蒙古自治区', '1525', '锡林郭勒盟', '152522', '阿巴嘎旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (470, '15', '内蒙古自治区', '1525', '锡林郭勒盟', '152523', '苏尼特左旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (471, '15', '内蒙古自治区', '1525', '锡林郭勒盟', '152524', '苏尼特右旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (472, '15', '内蒙古自治区', '1525', '锡林郭勒盟', '152525', '东乌珠穆沁旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (473, '15', '内蒙古自治区', '1525', '锡林郭勒盟', '152526', '西乌珠穆沁旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (474, '15', '内蒙古自治区', '1525', '锡林郭勒盟', '152527', '太仆寺旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (475, '15', '内蒙古自治区', '1525', '锡林郭勒盟', '152528', '镶黄旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (476, '15', '内蒙古自治区', '1525', '锡林郭勒盟', '152529', '正镶白旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (477, '15', '内蒙古自治区', '1525', '锡林郭勒盟', '152530', '正蓝旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (478, '15', '内蒙古自治区', '1525', '锡林郭勒盟', '152531', '多伦县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (479, '15', '内蒙古自治区', '1525', '锡林郭勒盟', '152571', '乌拉盖管委会', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (480, '15', '内蒙古自治区', '1529', '阿拉善盟', '152921', '阿拉善左旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (481, '15', '内蒙古自治区', '1529', '阿拉善盟', '152922', '阿拉善右旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (482, '15', '内蒙古自治区', '1529', '阿拉善盟', '152923', '额济纳旗', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (483, '15', '内蒙古自治区', '1529', '阿拉善盟', '152971', '内蒙古阿拉善经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (484, '21', '辽宁省', '2101', '沈阳市', '210101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (485, '21', '辽宁省', '2101', '沈阳市', '210102', '和平区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (486, '21', '辽宁省', '2101', '沈阳市', '210103', '沈河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (487, '21', '辽宁省', '2101', '沈阳市', '210104', '大东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (488, '21', '辽宁省', '2101', '沈阳市', '210105', '皇姑区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (489, '21', '辽宁省', '2101', '沈阳市', '210106', '铁西区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (490, '21', '辽宁省', '2101', '沈阳市', '210111', '苏家屯区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (491, '21', '辽宁省', '2101', '沈阳市', '210112', '浑南区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (492, '21', '辽宁省', '2101', '沈阳市', '210113', '沈北新区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (493, '21', '辽宁省', '2101', '沈阳市', '210114', '于洪区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (494, '21', '辽宁省', '2101', '沈阳市', '210115', '辽中区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (495, '21', '辽宁省', '2101', '沈阳市', '210123', '康平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (496, '21', '辽宁省', '2101', '沈阳市', '210124', '法库县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (497, '21', '辽宁省', '2101', '沈阳市', '210181', '新民市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (498, '21', '辽宁省', '2102', '大连市', '210201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (499, '21', '辽宁省', '2102', '大连市', '210202', '中山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (500, '21', '辽宁省', '2102', '大连市', '210203', '西岗区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (501, '21', '辽宁省', '2102', '大连市', '210204', '沙河口区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (502, '21', '辽宁省', '2102', '大连市', '210211', '甘井子区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (503, '21', '辽宁省', '2102', '大连市', '210212', '旅顺口区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (504, '21', '辽宁省', '2102', '大连市', '210213', '金州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (505, '21', '辽宁省', '2102', '大连市', '210214', '普兰店区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (506, '21', '辽宁省', '2102', '大连市', '210224', '长海县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (507, '21', '辽宁省', '2102', '大连市', '210281', '瓦房店市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (508, '21', '辽宁省', '2102', '大连市', '210283', '庄河市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (509, '21', '辽宁省', '2103', '鞍山市', '210301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (510, '21', '辽宁省', '2103', '鞍山市', '210302', '铁东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (511, '21', '辽宁省', '2103', '鞍山市', '210303', '铁西区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (512, '21', '辽宁省', '2103', '鞍山市', '210304', '立山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (513, '21', '辽宁省', '2103', '鞍山市', '210311', '千山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (514, '21', '辽宁省', '2103', '鞍山市', '210321', '台安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (515, '21', '辽宁省', '2103', '鞍山市', '210323', '岫岩满族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (516, '21', '辽宁省', '2103', '鞍山市', '210381', '海城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (517, '21', '辽宁省', '2104', '抚顺市', '210401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (518, '21', '辽宁省', '2104', '抚顺市', '210402', '新抚区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (519, '21', '辽宁省', '2104', '抚顺市', '210403', '东洲区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (520, '21', '辽宁省', '2104', '抚顺市', '210404', '望花区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (521, '21', '辽宁省', '2104', '抚顺市', '210411', '顺城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (522, '21', '辽宁省', '2104', '抚顺市', '210421', '抚顺县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (523, '21', '辽宁省', '2104', '抚顺市', '210422', '新宾满族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (524, '21', '辽宁省', '2104', '抚顺市', '210423', '清原满族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (525, '21', '辽宁省', '2105', '本溪市', '210501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (526, '21', '辽宁省', '2105', '本溪市', '210502', '平山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (527, '21', '辽宁省', '2105', '本溪市', '210503', '溪湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (528, '21', '辽宁省', '2105', '本溪市', '210504', '明山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (529, '21', '辽宁省', '2105', '本溪市', '210505', '南芬区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (530, '21', '辽宁省', '2105', '本溪市', '210521', '本溪满族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (531, '21', '辽宁省', '2105', '本溪市', '210522', '桓仁满族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (532, '21', '辽宁省', '2106', '丹东市', '210601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (533, '21', '辽宁省', '2106', '丹东市', '210602', '元宝区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (534, '21', '辽宁省', '2106', '丹东市', '210603', '振兴区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (535, '21', '辽宁省', '2106', '丹东市', '210604', '振安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (536, '21', '辽宁省', '2106', '丹东市', '210624', '宽甸满族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (537, '21', '辽宁省', '2106', '丹东市', '210681', '东港市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (538, '21', '辽宁省', '2106', '丹东市', '210682', '凤城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (539, '21', '辽宁省', '2107', '锦州市', '210701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (540, '21', '辽宁省', '2107', '锦州市', '210702', '古塔区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (541, '21', '辽宁省', '2107', '锦州市', '210703', '凌河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (542, '21', '辽宁省', '2107', '锦州市', '210711', '太和区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (543, '21', '辽宁省', '2107', '锦州市', '210726', '黑山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (544, '21', '辽宁省', '2107', '锦州市', '210727', '义县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (545, '21', '辽宁省', '2107', '锦州市', '210781', '凌海市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (546, '21', '辽宁省', '2107', '锦州市', '210782', '北镇市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (547, '21', '辽宁省', '2108', '营口市', '210801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (548, '21', '辽宁省', '2108', '营口市', '210802', '站前区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (549, '21', '辽宁省', '2108', '营口市', '210803', '西市区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (550, '21', '辽宁省', '2108', '营口市', '210804', '鲅鱼圈区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (551, '21', '辽宁省', '2108', '营口市', '210811', '老边区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (552, '21', '辽宁省', '2108', '营口市', '210881', '盖州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (553, '21', '辽宁省', '2108', '营口市', '210882', '大石桥市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (554, '21', '辽宁省', '2109', '阜新市', '210901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (555, '21', '辽宁省', '2109', '阜新市', '210902', '海州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (556, '21', '辽宁省', '2109', '阜新市', '210903', '新邱区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (557, '21', '辽宁省', '2109', '阜新市', '210904', '太平区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (558, '21', '辽宁省', '2109', '阜新市', '210905', '清河门区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (559, '21', '辽宁省', '2109', '阜新市', '210911', '细河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (560, '21', '辽宁省', '2109', '阜新市', '210921', '阜新蒙古族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (561, '21', '辽宁省', '2109', '阜新市', '210922', '彰武县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (562, '21', '辽宁省', '2110', '辽阳市', '211001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (563, '21', '辽宁省', '2110', '辽阳市', '211002', '白塔区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (564, '21', '辽宁省', '2110', '辽阳市', '211003', '文圣区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (565, '21', '辽宁省', '2110', '辽阳市', '211004', '宏伟区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (566, '21', '辽宁省', '2110', '辽阳市', '211005', '弓长岭区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (567, '21', '辽宁省', '2110', '辽阳市', '211011', '太子河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (568, '21', '辽宁省', '2110', '辽阳市', '211021', '辽阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (569, '21', '辽宁省', '2110', '辽阳市', '211081', '灯塔市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (570, '21', '辽宁省', '2111', '盘锦市', '211101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (571, '21', '辽宁省', '2111', '盘锦市', '211102', '双台子区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (572, '21', '辽宁省', '2111', '盘锦市', '211103', '兴隆台区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (573, '21', '辽宁省', '2111', '盘锦市', '211104', '大洼区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (574, '21', '辽宁省', '2111', '盘锦市', '211122', '盘山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (575, '21', '辽宁省', '2112', '铁岭市', '211201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (576, '21', '辽宁省', '2112', '铁岭市', '211202', '银州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (577, '21', '辽宁省', '2112', '铁岭市', '211204', '清河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (578, '21', '辽宁省', '2112', '铁岭市', '211221', '铁岭县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (579, '21', '辽宁省', '2112', '铁岭市', '211223', '西丰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (580, '21', '辽宁省', '2112', '铁岭市', '211224', '昌图县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (581, '21', '辽宁省', '2112', '铁岭市', '211281', '调兵山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (582, '21', '辽宁省', '2112', '铁岭市', '211282', '开原市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (583, '21', '辽宁省', '2113', '朝阳市', '211301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (584, '21', '辽宁省', '2113', '朝阳市', '211302', '双塔区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (585, '21', '辽宁省', '2113', '朝阳市', '211303', '龙城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (586, '21', '辽宁省', '2113', '朝阳市', '211321', '朝阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (587, '21', '辽宁省', '2113', '朝阳市', '211322', '建平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (588, '21', '辽宁省', '2113', '朝阳市', '211324', '喀喇沁左翼蒙古族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (589, '21', '辽宁省', '2113', '朝阳市', '211381', '北票市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (590, '21', '辽宁省', '2113', '朝阳市', '211382', '凌源市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (591, '21', '辽宁省', '2114', '葫芦岛市', '211401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (592, '21', '辽宁省', '2114', '葫芦岛市', '211402', '连山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (593, '21', '辽宁省', '2114', '葫芦岛市', '211403', '龙港区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (594, '21', '辽宁省', '2114', '葫芦岛市', '211404', '南票区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (595, '21', '辽宁省', '2114', '葫芦岛市', '211421', '绥中县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (596, '21', '辽宁省', '2114', '葫芦岛市', '211422', '建昌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (597, '21', '辽宁省', '2114', '葫芦岛市', '211481', '兴城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (598, '22', '吉林省', '2201', '长春市', '220101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (599, '22', '吉林省', '2201', '长春市', '220102', '南关区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (600, '22', '吉林省', '2201', '长春市', '220103', '宽城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (601, '22', '吉林省', '2201', '长春市', '220104', '朝阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (602, '22', '吉林省', '2201', '长春市', '220105', '二道区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (603, '22', '吉林省', '2201', '长春市', '220106', '绿园区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (604, '22', '吉林省', '2201', '长春市', '220112', '双阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (605, '22', '吉林省', '2201', '长春市', '220113', '九台区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (606, '22', '吉林省', '2201', '长春市', '220122', '农安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (607, '22', '吉林省', '2201', '长春市', '220171', '长春经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (608, '22', '吉林省', '2201', '长春市', '220172', '长春净月高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (609, '22', '吉林省', '2201', '长春市', '220173', '长春高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (610, '22', '吉林省', '2201', '长春市', '220174', '长春汽车经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (611, '22', '吉林省', '2201', '长春市', '220182', '榆树市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (612, '22', '吉林省', '2201', '长春市', '220183', '德惠市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (613, '22', '吉林省', '2201', '长春市', '220184', '公主岭市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (614, '22', '吉林省', '2202', '吉林市', '220201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (615, '22', '吉林省', '2202', '吉林市', '220202', '昌邑区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (616, '22', '吉林省', '2202', '吉林市', '220203', '龙潭区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (617, '22', '吉林省', '2202', '吉林市', '220204', '船营区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (618, '22', '吉林省', '2202', '吉林市', '220211', '丰满区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (619, '22', '吉林省', '2202', '吉林市', '220221', '永吉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (620, '22', '吉林省', '2202', '吉林市', '220271', '吉林经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (621, '22', '吉林省', '2202', '吉林市', '220272', '吉林高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (622, '22', '吉林省', '2202', '吉林市', '220273', '吉林中国新加坡食品区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (623, '22', '吉林省', '2202', '吉林市', '220281', '蛟河市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (624, '22', '吉林省', '2202', '吉林市', '220282', '桦甸市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (625, '22', '吉林省', '2202', '吉林市', '220283', '舒兰市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (626, '22', '吉林省', '2202', '吉林市', '220284', '磐石市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (627, '22', '吉林省', '2203', '四平市', '220301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (628, '22', '吉林省', '2203', '四平市', '220302', '铁西区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (629, '22', '吉林省', '2203', '四平市', '220303', '铁东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (630, '22', '吉林省', '2203', '四平市', '220322', '梨树县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (631, '22', '吉林省', '2203', '四平市', '220323', '伊通满族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (632, '22', '吉林省', '2203', '四平市', '220382', '双辽市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (633, '22', '吉林省', '2204', '辽源市', '220401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (634, '22', '吉林省', '2204', '辽源市', '220402', '龙山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (635, '22', '吉林省', '2204', '辽源市', '220403', '西安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (636, '22', '吉林省', '2204', '辽源市', '220421', '东丰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (637, '22', '吉林省', '2204', '辽源市', '220422', '东辽县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (638, '22', '吉林省', '2205', '通化市', '220501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (639, '22', '吉林省', '2205', '通化市', '220502', '东昌区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (640, '22', '吉林省', '2205', '通化市', '220503', '二道江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (641, '22', '吉林省', '2205', '通化市', '220521', '通化县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (642, '22', '吉林省', '2205', '通化市', '220523', '辉南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (643, '22', '吉林省', '2205', '通化市', '220524', '柳河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (644, '22', '吉林省', '2205', '通化市', '220581', '梅河口市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (645, '22', '吉林省', '2205', '通化市', '220582', '集安市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (646, '22', '吉林省', '2206', '白山市', '220601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (647, '22', '吉林省', '2206', '白山市', '220602', '浑江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (648, '22', '吉林省', '2206', '白山市', '220605', '江源区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (649, '22', '吉林省', '2206', '白山市', '220621', '抚松县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (650, '22', '吉林省', '2206', '白山市', '220622', '靖宇县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (651, '22', '吉林省', '2206', '白山市', '220623', '长白朝鲜族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (652, '22', '吉林省', '2206', '白山市', '220681', '临江市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (653, '22', '吉林省', '2207', '松原市', '220701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (654, '22', '吉林省', '2207', '松原市', '220702', '宁江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (655, '22', '吉林省', '2207', '松原市', '220721', '前郭尔罗斯蒙古族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (656, '22', '吉林省', '2207', '松原市', '220722', '长岭县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (657, '22', '吉林省', '2207', '松原市', '220723', '乾安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (658, '22', '吉林省', '2207', '松原市', '220771', '吉林松原经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (659, '22', '吉林省', '2207', '松原市', '220781', '扶余市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (660, '22', '吉林省', '2208', '白城市', '220801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (661, '22', '吉林省', '2208', '白城市', '220802', '洮北区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (662, '22', '吉林省', '2208', '白城市', '220821', '镇赉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (663, '22', '吉林省', '2208', '白城市', '220822', '通榆县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (664, '22', '吉林省', '2208', '白城市', '220871', '吉林白城经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (665, '22', '吉林省', '2208', '白城市', '220881', '洮南市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (666, '22', '吉林省', '2208', '白城市', '220882', '大安市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (667, '22', '吉林省', '2224', '延边朝鲜族自治州', '222401', '延吉市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (668, '22', '吉林省', '2224', '延边朝鲜族自治州', '222402', '图们市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (669, '22', '吉林省', '2224', '延边朝鲜族自治州', '222403', '敦化市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (670, '22', '吉林省', '2224', '延边朝鲜族自治州', '222404', '珲春市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (671, '22', '吉林省', '2224', '延边朝鲜族自治州', '222405', '龙井市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (672, '22', '吉林省', '2224', '延边朝鲜族自治州', '222406', '和龙市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (673, '22', '吉林省', '2224', '延边朝鲜族自治州', '222424', '汪清县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (674, '22', '吉林省', '2224', '延边朝鲜族自治州', '222426', '安图县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (675, '23', '黑龙江省', '2301', '哈尔滨市', '230101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (676, '23', '黑龙江省', '2301', '哈尔滨市', '230102', '道里区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (677, '23', '黑龙江省', '2301', '哈尔滨市', '230103', '南岗区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (678, '23', '黑龙江省', '2301', '哈尔滨市', '230104', '道外区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (679, '23', '黑龙江省', '2301', '哈尔滨市', '230108', '平房区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (680, '23', '黑龙江省', '2301', '哈尔滨市', '230109', '松北区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (681, '23', '黑龙江省', '2301', '哈尔滨市', '230110', '香坊区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (682, '23', '黑龙江省', '2301', '哈尔滨市', '230111', '呼兰区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (683, '23', '黑龙江省', '2301', '哈尔滨市', '230112', '阿城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (684, '23', '黑龙江省', '2301', '哈尔滨市', '230113', '双城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (685, '23', '黑龙江省', '2301', '哈尔滨市', '230123', '依兰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (686, '23', '黑龙江省', '2301', '哈尔滨市', '230124', '方正县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (687, '23', '黑龙江省', '2301', '哈尔滨市', '230125', '宾县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (688, '23', '黑龙江省', '2301', '哈尔滨市', '230126', '巴彦县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (689, '23', '黑龙江省', '2301', '哈尔滨市', '230127', '木兰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (690, '23', '黑龙江省', '2301', '哈尔滨市', '230128', '通河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (691, '23', '黑龙江省', '2301', '哈尔滨市', '230129', '延寿县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (692, '23', '黑龙江省', '2301', '哈尔滨市', '230183', '尚志市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (693, '23', '黑龙江省', '2301', '哈尔滨市', '230184', '五常市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (694, '23', '黑龙江省', '2302', '齐齐哈尔市', '230201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (695, '23', '黑龙江省', '2302', '齐齐哈尔市', '230202', '龙沙区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (696, '23', '黑龙江省', '2302', '齐齐哈尔市', '230203', '建华区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (697, '23', '黑龙江省', '2302', '齐齐哈尔市', '230204', '铁锋区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (698, '23', '黑龙江省', '2302', '齐齐哈尔市', '230205', '昂昂溪区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (699, '23', '黑龙江省', '2302', '齐齐哈尔市', '230206', '富拉尔基区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (700, '23', '黑龙江省', '2302', '齐齐哈尔市', '230207', '碾子山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (701, '23', '黑龙江省', '2302', '齐齐哈尔市', '230208', '梅里斯达斡尔族区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (702, '23', '黑龙江省', '2302', '齐齐哈尔市', '230221', '龙江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (703, '23', '黑龙江省', '2302', '齐齐哈尔市', '230223', '依安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (704, '23', '黑龙江省', '2302', '齐齐哈尔市', '230224', '泰来县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (705, '23', '黑龙江省', '2302', '齐齐哈尔市', '230225', '甘南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (706, '23', '黑龙江省', '2302', '齐齐哈尔市', '230227', '富裕县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (707, '23', '黑龙江省', '2302', '齐齐哈尔市', '230229', '克山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (708, '23', '黑龙江省', '2302', '齐齐哈尔市', '230230', '克东县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (709, '23', '黑龙江省', '2302', '齐齐哈尔市', '230231', '拜泉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (710, '23', '黑龙江省', '2302', '齐齐哈尔市', '230281', '讷河市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (711, '23', '黑龙江省', '2303', '鸡西市', '230301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (712, '23', '黑龙江省', '2303', '鸡西市', '230302', '鸡冠区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (713, '23', '黑龙江省', '2303', '鸡西市', '230303', '恒山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (714, '23', '黑龙江省', '2303', '鸡西市', '230304', '滴道区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (715, '23', '黑龙江省', '2303', '鸡西市', '230305', '梨树区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (716, '23', '黑龙江省', '2303', '鸡西市', '230306', '城子河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (717, '23', '黑龙江省', '2303', '鸡西市', '230307', '麻山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (718, '23', '黑龙江省', '2303', '鸡西市', '230321', '鸡东县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (719, '23', '黑龙江省', '2303', '鸡西市', '230381', '虎林市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (720, '23', '黑龙江省', '2303', '鸡西市', '230382', '密山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (721, '23', '黑龙江省', '2304', '鹤岗市', '230401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (722, '23', '黑龙江省', '2304', '鹤岗市', '230402', '向阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (723, '23', '黑龙江省', '2304', '鹤岗市', '230403', '工农区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (724, '23', '黑龙江省', '2304', '鹤岗市', '230404', '南山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (725, '23', '黑龙江省', '2304', '鹤岗市', '230405', '兴安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (726, '23', '黑龙江省', '2304', '鹤岗市', '230406', '东山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (727, '23', '黑龙江省', '2304', '鹤岗市', '230407', '兴山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (728, '23', '黑龙江省', '2304', '鹤岗市', '230421', '萝北县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (729, '23', '黑龙江省', '2304', '鹤岗市', '230422', '绥滨县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (730, '23', '黑龙江省', '2305', '双鸭山市', '230501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (731, '23', '黑龙江省', '2305', '双鸭山市', '230502', '尖山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (732, '23', '黑龙江省', '2305', '双鸭山市', '230503', '岭东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (733, '23', '黑龙江省', '2305', '双鸭山市', '230505', '四方台区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (734, '23', '黑龙江省', '2305', '双鸭山市', '230506', '宝山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (735, '23', '黑龙江省', '2305', '双鸭山市', '230521', '集贤县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (736, '23', '黑龙江省', '2305', '双鸭山市', '230522', '友谊县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (737, '23', '黑龙江省', '2305', '双鸭山市', '230523', '宝清县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (738, '23', '黑龙江省', '2305', '双鸭山市', '230524', '饶河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (739, '23', '黑龙江省', '2306', '大庆市', '230601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (740, '23', '黑龙江省', '2306', '大庆市', '230602', '萨尔图区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (741, '23', '黑龙江省', '2306', '大庆市', '230603', '龙凤区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (742, '23', '黑龙江省', '2306', '大庆市', '230604', '让胡路区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (743, '23', '黑龙江省', '2306', '大庆市', '230605', '红岗区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (744, '23', '黑龙江省', '2306', '大庆市', '230606', '大同区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (745, '23', '黑龙江省', '2306', '大庆市', '230621', '肇州县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (746, '23', '黑龙江省', '2306', '大庆市', '230622', '肇源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (747, '23', '黑龙江省', '2306', '大庆市', '230623', '林甸县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (748, '23', '黑龙江省', '2306', '大庆市', '230624', '杜尔伯特蒙古族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (749, '23', '黑龙江省', '2306', '大庆市', '230671', '大庆高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (750, '23', '黑龙江省', '2307', '伊春市', '230701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (751, '23', '黑龙江省', '2307', '伊春市', '230717', '伊美区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (752, '23', '黑龙江省', '2307', '伊春市', '230718', '乌翠区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (753, '23', '黑龙江省', '2307', '伊春市', '230719', '友好区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (754, '23', '黑龙江省', '2307', '伊春市', '230722', '嘉荫县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (755, '23', '黑龙江省', '2307', '伊春市', '230723', '汤旺县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (756, '23', '黑龙江省', '2307', '伊春市', '230724', '丰林县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (757, '23', '黑龙江省', '2307', '伊春市', '230725', '大箐山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (758, '23', '黑龙江省', '2307', '伊春市', '230726', '南岔县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (759, '23', '黑龙江省', '2307', '伊春市', '230751', '金林区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (760, '23', '黑龙江省', '2307', '伊春市', '230781', '铁力市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (761, '23', '黑龙江省', '2308', '佳木斯市', '230801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (762, '23', '黑龙江省', '2308', '佳木斯市', '230803', '向阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (763, '23', '黑龙江省', '2308', '佳木斯市', '230804', '前进区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (764, '23', '黑龙江省', '2308', '佳木斯市', '230805', '东风区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (765, '23', '黑龙江省', '2308', '佳木斯市', '230811', '郊区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (766, '23', '黑龙江省', '2308', '佳木斯市', '230822', '桦南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (767, '23', '黑龙江省', '2308', '佳木斯市', '230826', '桦川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (768, '23', '黑龙江省', '2308', '佳木斯市', '230828', '汤原县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (769, '23', '黑龙江省', '2308', '佳木斯市', '230881', '同江市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (770, '23', '黑龙江省', '2308', '佳木斯市', '230882', '富锦市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (771, '23', '黑龙江省', '2308', '佳木斯市', '230883', '抚远市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (772, '23', '黑龙江省', '2309', '七台河市', '230901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (773, '23', '黑龙江省', '2309', '七台河市', '230902', '新兴区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (774, '23', '黑龙江省', '2309', '七台河市', '230903', '桃山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (775, '23', '黑龙江省', '2309', '七台河市', '230904', '茄子河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (776, '23', '黑龙江省', '2309', '七台河市', '230921', '勃利县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (777, '23', '黑龙江省', '2310', '牡丹江市', '231001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (778, '23', '黑龙江省', '2310', '牡丹江市', '231002', '东安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (779, '23', '黑龙江省', '2310', '牡丹江市', '231003', '阳明区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (780, '23', '黑龙江省', '2310', '牡丹江市', '231004', '爱民区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (781, '23', '黑龙江省', '2310', '牡丹江市', '231005', '西安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (782, '23', '黑龙江省', '2310', '牡丹江市', '231025', '林口县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (783, '23', '黑龙江省', '2310', '牡丹江市', '231071', '牡丹江经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (784, '23', '黑龙江省', '2310', '牡丹江市', '231081', '绥芬河市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (785, '23', '黑龙江省', '2310', '牡丹江市', '231083', '海林市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (786, '23', '黑龙江省', '2310', '牡丹江市', '231084', '宁安市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (787, '23', '黑龙江省', '2310', '牡丹江市', '231085', '穆棱市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (788, '23', '黑龙江省', '2310', '牡丹江市', '231086', '东宁市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (789, '23', '黑龙江省', '2311', '黑河市', '231101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (790, '23', '黑龙江省', '2311', '黑河市', '231102', '爱辉区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (791, '23', '黑龙江省', '2311', '黑河市', '231123', '逊克县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (792, '23', '黑龙江省', '2311', '黑河市', '231124', '孙吴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (793, '23', '黑龙江省', '2311', '黑河市', '231181', '北安市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (794, '23', '黑龙江省', '2311', '黑河市', '231182', '五大连池市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (795, '23', '黑龙江省', '2311', '黑河市', '231183', '嫩江市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (796, '23', '黑龙江省', '2312', '绥化市', '231201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (797, '23', '黑龙江省', '2312', '绥化市', '231202', '北林区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (798, '23', '黑龙江省', '2312', '绥化市', '231221', '望奎县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (799, '23', '黑龙江省', '2312', '绥化市', '231222', '兰西县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (800, '23', '黑龙江省', '2312', '绥化市', '231223', '青冈县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (801, '23', '黑龙江省', '2312', '绥化市', '231224', '庆安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (802, '23', '黑龙江省', '2312', '绥化市', '231225', '明水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (803, '23', '黑龙江省', '2312', '绥化市', '231226', '绥棱县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (804, '23', '黑龙江省', '2312', '绥化市', '231281', '安达市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (805, '23', '黑龙江省', '2312', '绥化市', '231282', '肇东市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (806, '23', '黑龙江省', '2312', '绥化市', '231283', '海伦市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (807, '23', '黑龙江省', '2327', '大兴安岭地区', '232701', '漠河市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (808, '23', '黑龙江省', '2327', '大兴安岭地区', '232721', '呼玛县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (809, '23', '黑龙江省', '2327', '大兴安岭地区', '232722', '塔河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (810, '23', '黑龙江省', '2327', '大兴安岭地区', '232761', '加格达奇区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (811, '23', '黑龙江省', '2327', '大兴安岭地区', '232762', '松岭区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (812, '23', '黑龙江省', '2327', '大兴安岭地区', '232763', '新林区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (813, '23', '黑龙江省', '2327', '大兴安岭地区', '232764', '呼中区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (814, '31', '上海市', '3101', '市辖区', '310101', '黄浦区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (815, '31', '上海市', '3101', '市辖区', '310104', '徐汇区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (816, '31', '上海市', '3101', '市辖区', '310105', '长宁区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (817, '31', '上海市', '3101', '市辖区', '310106', '静安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (818, '31', '上海市', '3101', '市辖区', '310107', '普陀区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (819, '31', '上海市', '3101', '市辖区', '310109', '虹口区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (820, '31', '上海市', '3101', '市辖区', '310110', '杨浦区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (821, '31', '上海市', '3101', '市辖区', '310112', '闵行区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (822, '31', '上海市', '3101', '市辖区', '310113', '宝山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (823, '31', '上海市', '3101', '市辖区', '310114', '嘉定区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (824, '31', '上海市', '3101', '市辖区', '310115', '浦东新区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (825, '31', '上海市', '3101', '市辖区', '310116', '金山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (826, '31', '上海市', '3101', '市辖区', '310117', '松江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (827, '31', '上海市', '3101', '市辖区', '310118', '青浦区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (828, '31', '上海市', '3101', '市辖区', '310120', '奉贤区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (829, '31', '上海市', '3101', '市辖区', '310151', '崇明区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (830, '32', '江苏省', '3201', '南京市', '320101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (831, '32', '江苏省', '3201', '南京市', '320102', '玄武区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (832, '32', '江苏省', '3201', '南京市', '320104', '秦淮区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (833, '32', '江苏省', '3201', '南京市', '320105', '建邺区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (834, '32', '江苏省', '3201', '南京市', '320106', '鼓楼区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (835, '32', '江苏省', '3201', '南京市', '320111', '浦口区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (836, '32', '江苏省', '3201', '南京市', '320113', '栖霞区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (837, '32', '江苏省', '3201', '南京市', '320114', '雨花台区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (838, '32', '江苏省', '3201', '南京市', '320115', '江宁区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (839, '32', '江苏省', '3201', '南京市', '320116', '六合区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (840, '32', '江苏省', '3201', '南京市', '320117', '溧水区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (841, '32', '江苏省', '3201', '南京市', '320118', '高淳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (842, '32', '江苏省', '3202', '无锡市', '320201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (843, '32', '江苏省', '3202', '无锡市', '320205', '锡山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (844, '32', '江苏省', '3202', '无锡市', '320206', '惠山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (845, '32', '江苏省', '3202', '无锡市', '320211', '滨湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (846, '32', '江苏省', '3202', '无锡市', '320213', '梁溪区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (847, '32', '江苏省', '3202', '无锡市', '320214', '新吴区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (848, '32', '江苏省', '3202', '无锡市', '320281', '江阴市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (849, '32', '江苏省', '3202', '无锡市', '320282', '宜兴市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (850, '32', '江苏省', '3203', '徐州市', '320301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (851, '32', '江苏省', '3203', '徐州市', '320302', '鼓楼区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (852, '32', '江苏省', '3203', '徐州市', '320303', '云龙区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (853, '32', '江苏省', '3203', '徐州市', '320305', '贾汪区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (854, '32', '江苏省', '3203', '徐州市', '320311', '泉山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (855, '32', '江苏省', '3203', '徐州市', '320312', '铜山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (856, '32', '江苏省', '3203', '徐州市', '320321', '丰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (857, '32', '江苏省', '3203', '徐州市', '320322', '沛县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (858, '32', '江苏省', '3203', '徐州市', '320324', '睢宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (859, '32', '江苏省', '3203', '徐州市', '320371', '徐州经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (860, '32', '江苏省', '3203', '徐州市', '320381', '新沂市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (861, '32', '江苏省', '3203', '徐州市', '320382', '邳州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (862, '32', '江苏省', '3204', '常州市', '320401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (863, '32', '江苏省', '3204', '常州市', '320402', '天宁区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (864, '32', '江苏省', '3204', '常州市', '320404', '钟楼区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (865, '32', '江苏省', '3204', '常州市', '320411', '新北区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (866, '32', '江苏省', '3204', '常州市', '320412', '武进区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (867, '32', '江苏省', '3204', '常州市', '320413', '金坛区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (868, '32', '江苏省', '3204', '常州市', '320481', '溧阳市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (869, '32', '江苏省', '3205', '苏州市', '320501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (870, '32', '江苏省', '3205', '苏州市', '320505', '虎丘区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (871, '32', '江苏省', '3205', '苏州市', '320506', '吴中区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (872, '32', '江苏省', '3205', '苏州市', '320507', '相城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (873, '32', '江苏省', '3205', '苏州市', '320508', '姑苏区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (874, '32', '江苏省', '3205', '苏州市', '320509', '吴江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (875, '32', '江苏省', '3205', '苏州市', '320571', '苏州工业园区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (876, '32', '江苏省', '3205', '苏州市', '320581', '常熟市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (877, '32', '江苏省', '3205', '苏州市', '320582', '张家港市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (878, '32', '江苏省', '3205', '苏州市', '320583', '昆山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (879, '32', '江苏省', '3205', '苏州市', '320585', '太仓市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (880, '32', '江苏省', '3206', '南通市', '320601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (881, '32', '江苏省', '3206', '南通市', '320602', '崇川区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (882, '32', '江苏省', '3206', '南通市', '320611', '港闸区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (883, '32', '江苏省', '3206', '南通市', '320612', '通州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (884, '32', '江苏省', '3206', '南通市', '320623', '如东县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (885, '32', '江苏省', '3206', '南通市', '320671', '南通经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (886, '32', '江苏省', '3206', '南通市', '320681', '启东市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (887, '32', '江苏省', '3206', '南通市', '320682', '如皋市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (888, '32', '江苏省', '3206', '南通市', '320684', '海门市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (889, '32', '江苏省', '3206', '南通市', '320685', '海安市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (890, '32', '江苏省', '3207', '连云港市', '320701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (891, '32', '江苏省', '3207', '连云港市', '320703', '连云区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (892, '32', '江苏省', '3207', '连云港市', '320706', '海州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (893, '32', '江苏省', '3207', '连云港市', '320707', '赣榆区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (894, '32', '江苏省', '3207', '连云港市', '320722', '东海县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (895, '32', '江苏省', '3207', '连云港市', '320723', '灌云县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (896, '32', '江苏省', '3207', '连云港市', '320724', '灌南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (897, '32', '江苏省', '3207', '连云港市', '320771', '连云港经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (898, '32', '江苏省', '3207', '连云港市', '320772', '连云港高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (899, '32', '江苏省', '3208', '淮安市', '320801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (900, '32', '江苏省', '3208', '淮安市', '320803', '淮安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (901, '32', '江苏省', '3208', '淮安市', '320804', '淮阴区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (902, '32', '江苏省', '3208', '淮安市', '320812', '清江浦区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (903, '32', '江苏省', '3208', '淮安市', '320813', '洪泽区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (904, '32', '江苏省', '3208', '淮安市', '320826', '涟水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (905, '32', '江苏省', '3208', '淮安市', '320830', '盱眙县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (906, '32', '江苏省', '3208', '淮安市', '320831', '金湖县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (907, '32', '江苏省', '3208', '淮安市', '320871', '淮安经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (908, '32', '江苏省', '3209', '盐城市', '320901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (909, '32', '江苏省', '3209', '盐城市', '320902', '亭湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (910, '32', '江苏省', '3209', '盐城市', '320903', '盐都区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (911, '32', '江苏省', '3209', '盐城市', '320904', '大丰区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (912, '32', '江苏省', '3209', '盐城市', '320921', '响水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (913, '32', '江苏省', '3209', '盐城市', '320922', '滨海县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (914, '32', '江苏省', '3209', '盐城市', '320923', '阜宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (915, '32', '江苏省', '3209', '盐城市', '320924', '射阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (916, '32', '江苏省', '3209', '盐城市', '320925', '建湖县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (917, '32', '江苏省', '3209', '盐城市', '320971', '盐城经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (918, '32', '江苏省', '3209', '盐城市', '320981', '东台市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (919, '32', '江苏省', '3210', '扬州市', '321001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (920, '32', '江苏省', '3210', '扬州市', '321002', '广陵区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (921, '32', '江苏省', '3210', '扬州市', '321003', '邗江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (922, '32', '江苏省', '3210', '扬州市', '321012', '江都区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (923, '32', '江苏省', '3210', '扬州市', '321023', '宝应县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (924, '32', '江苏省', '3210', '扬州市', '321071', '扬州经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (925, '32', '江苏省', '3210', '扬州市', '321081', '仪征市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (926, '32', '江苏省', '3210', '扬州市', '321084', '高邮市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (927, '32', '江苏省', '3211', '镇江市', '321101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (928, '32', '江苏省', '3211', '镇江市', '321102', '京口区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (929, '32', '江苏省', '3211', '镇江市', '321111', '润州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (930, '32', '江苏省', '3211', '镇江市', '321112', '丹徒区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (931, '32', '江苏省', '3211', '镇江市', '321171', '镇江新区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (932, '32', '江苏省', '3211', '镇江市', '321181', '丹阳市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (933, '32', '江苏省', '3211', '镇江市', '321182', '扬中市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (934, '32', '江苏省', '3211', '镇江市', '321183', '句容市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (935, '32', '江苏省', '3212', '泰州市', '321201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (936, '32', '江苏省', '3212', '泰州市', '321202', '海陵区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (937, '32', '江苏省', '3212', '泰州市', '321203', '高港区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (938, '32', '江苏省', '3212', '泰州市', '321204', '姜堰区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (939, '32', '江苏省', '3212', '泰州市', '321271', '泰州医药高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (940, '32', '江苏省', '3212', '泰州市', '321281', '兴化市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (941, '32', '江苏省', '3212', '泰州市', '321282', '靖江市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (942, '32', '江苏省', '3212', '泰州市', '321283', '泰兴市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (943, '32', '江苏省', '3213', '宿迁市', '321301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (944, '32', '江苏省', '3213', '宿迁市', '321302', '宿城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (945, '32', '江苏省', '3213', '宿迁市', '321311', '宿豫区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (946, '32', '江苏省', '3213', '宿迁市', '321322', '沭阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (947, '32', '江苏省', '3213', '宿迁市', '321323', '泗阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (948, '32', '江苏省', '3213', '宿迁市', '321324', '泗洪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (949, '32', '江苏省', '3213', '宿迁市', '321371', '宿迁经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (950, '33', '浙江省', '3301', '杭州市', '330101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (951, '33', '浙江省', '3301', '杭州市', '330102', '上城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (952, '33', '浙江省', '3301', '杭州市', '330103', '下城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (953, '33', '浙江省', '3301', '杭州市', '330104', '江干区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (954, '33', '浙江省', '3301', '杭州市', '330105', '拱墅区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (955, '33', '浙江省', '3301', '杭州市', '330106', '西湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (956, '33', '浙江省', '3301', '杭州市', '330108', '滨江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (957, '33', '浙江省', '3301', '杭州市', '330109', '萧山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (958, '33', '浙江省', '3301', '杭州市', '330110', '余杭区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (959, '33', '浙江省', '3301', '杭州市', '330111', '富阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (960, '33', '浙江省', '3301', '杭州市', '330112', '临安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (961, '33', '浙江省', '3301', '杭州市', '330122', '桐庐县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (962, '33', '浙江省', '3301', '杭州市', '330127', '淳安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (963, '33', '浙江省', '3301', '杭州市', '330182', '建德市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (964, '33', '浙江省', '3302', '宁波市', '330201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (965, '33', '浙江省', '3302', '宁波市', '330203', '海曙区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (966, '33', '浙江省', '3302', '宁波市', '330205', '江北区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (967, '33', '浙江省', '3302', '宁波市', '330206', '北仑区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (968, '33', '浙江省', '3302', '宁波市', '330211', '镇海区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (969, '33', '浙江省', '3302', '宁波市', '330212', '鄞州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (970, '33', '浙江省', '3302', '宁波市', '330213', '奉化区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (971, '33', '浙江省', '3302', '宁波市', '330225', '象山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (972, '33', '浙江省', '3302', '宁波市', '330226', '宁海县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (973, '33', '浙江省', '3302', '宁波市', '330281', '余姚市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (974, '33', '浙江省', '3302', '宁波市', '330282', '慈溪市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (975, '33', '浙江省', '3303', '温州市', '330301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (976, '33', '浙江省', '3303', '温州市', '330302', '鹿城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (977, '33', '浙江省', '3303', '温州市', '330303', '龙湾区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (978, '33', '浙江省', '3303', '温州市', '330304', '瓯海区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (979, '33', '浙江省', '3303', '温州市', '330305', '洞头区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (980, '33', '浙江省', '3303', '温州市', '330324', '永嘉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (981, '33', '浙江省', '3303', '温州市', '330326', '平阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (982, '33', '浙江省', '3303', '温州市', '330327', '苍南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (983, '33', '浙江省', '3303', '温州市', '330328', '文成县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (984, '33', '浙江省', '3303', '温州市', '330329', '泰顺县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (985, '33', '浙江省', '3303', '温州市', '330371', '温州经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (986, '33', '浙江省', '3303', '温州市', '330381', '瑞安市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (987, '33', '浙江省', '3303', '温州市', '330382', '乐清市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (988, '33', '浙江省', '3303', '温州市', '330383', '龙港市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (989, '33', '浙江省', '3304', '嘉兴市', '330401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (990, '33', '浙江省', '3304', '嘉兴市', '330402', '南湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (991, '33', '浙江省', '3304', '嘉兴市', '330411', '秀洲区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (992, '33', '浙江省', '3304', '嘉兴市', '330421', '嘉善县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (993, '33', '浙江省', '3304', '嘉兴市', '330424', '海盐县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (994, '33', '浙江省', '3304', '嘉兴市', '330481', '海宁市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (995, '33', '浙江省', '3304', '嘉兴市', '330482', '平湖市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (996, '33', '浙江省', '3304', '嘉兴市', '330483', '桐乡市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (997, '33', '浙江省', '3305', '湖州市', '330501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (998, '33', '浙江省', '3305', '湖州市', '330502', '吴兴区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (999, '33', '浙江省', '3305', '湖州市', '330503', '南浔区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1000, '33', '浙江省', '3305', '湖州市', '330521', '德清县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1001, '33', '浙江省', '3305', '湖州市', '330522', '长兴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1002, '33', '浙江省', '3305', '湖州市', '330523', '安吉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1003, '33', '浙江省', '3306', '绍兴市', '330601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1004, '33', '浙江省', '3306', '绍兴市', '330602', '越城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1005, '33', '浙江省', '3306', '绍兴市', '330603', '柯桥区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1006, '33', '浙江省', '3306', '绍兴市', '330604', '上虞区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1007, '33', '浙江省', '3306', '绍兴市', '330624', '新昌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1008, '33', '浙江省', '3306', '绍兴市', '330681', '诸暨市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1009, '33', '浙江省', '3306', '绍兴市', '330683', '嵊州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1010, '33', '浙江省', '3307', '金华市', '330701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1011, '33', '浙江省', '3307', '金华市', '330702', '婺城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1012, '33', '浙江省', '3307', '金华市', '330703', '金东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1013, '33', '浙江省', '3307', '金华市', '330723', '武义县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1014, '33', '浙江省', '3307', '金华市', '330726', '浦江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1015, '33', '浙江省', '3307', '金华市', '330727', '磐安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1016, '33', '浙江省', '3307', '金华市', '330781', '兰溪市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1017, '33', '浙江省', '3307', '金华市', '330782', '义乌市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1018, '33', '浙江省', '3307', '金华市', '330783', '东阳市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1019, '33', '浙江省', '3307', '金华市', '330784', '永康市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1020, '33', '浙江省', '3308', '衢州市', '330801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1021, '33', '浙江省', '3308', '衢州市', '330802', '柯城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1022, '33', '浙江省', '3308', '衢州市', '330803', '衢江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1023, '33', '浙江省', '3308', '衢州市', '330822', '常山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1024, '33', '浙江省', '3308', '衢州市', '330824', '开化县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1025, '33', '浙江省', '3308', '衢州市', '330825', '龙游县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1026, '33', '浙江省', '3308', '衢州市', '330881', '江山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1027, '33', '浙江省', '3309', '舟山市', '330901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1028, '33', '浙江省', '3309', '舟山市', '330902', '定海区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1029, '33', '浙江省', '3309', '舟山市', '330903', '普陀区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1030, '33', '浙江省', '3309', '舟山市', '330921', '岱山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1031, '33', '浙江省', '3309', '舟山市', '330922', '嵊泗县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1032, '33', '浙江省', '3310', '台州市', '331001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1033, '33', '浙江省', '3310', '台州市', '331002', '椒江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1034, '33', '浙江省', '3310', '台州市', '331003', '黄岩区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1035, '33', '浙江省', '3310', '台州市', '331004', '路桥区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1036, '33', '浙江省', '3310', '台州市', '331022', '三门县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1037, '33', '浙江省', '3310', '台州市', '331023', '天台县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1038, '33', '浙江省', '3310', '台州市', '331024', '仙居县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1039, '33', '浙江省', '3310', '台州市', '331081', '温岭市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1040, '33', '浙江省', '3310', '台州市', '331082', '临海市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1041, '33', '浙江省', '3310', '台州市', '331083', '玉环市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1042, '33', '浙江省', '3311', '丽水市', '331101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1043, '33', '浙江省', '3311', '丽水市', '331102', '莲都区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1044, '33', '浙江省', '3311', '丽水市', '331121', '青田县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1045, '33', '浙江省', '3311', '丽水市', '331122', '缙云县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1046, '33', '浙江省', '3311', '丽水市', '331123', '遂昌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1047, '33', '浙江省', '3311', '丽水市', '331124', '松阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1048, '33', '浙江省', '3311', '丽水市', '331125', '云和县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1049, '33', '浙江省', '3311', '丽水市', '331126', '庆元县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1050, '33', '浙江省', '3311', '丽水市', '331127', '景宁畲族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1051, '33', '浙江省', '3311', '丽水市', '331181', '龙泉市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1052, '34', '安徽省', '3401', '合肥市', '340101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1053, '34', '安徽省', '3401', '合肥市', '340102', '瑶海区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1054, '34', '安徽省', '3401', '合肥市', '340103', '庐阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1055, '34', '安徽省', '3401', '合肥市', '340104', '蜀山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1056, '34', '安徽省', '3401', '合肥市', '340111', '包河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1057, '34', '安徽省', '3401', '合肥市', '340121', '长丰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1058, '34', '安徽省', '3401', '合肥市', '340122', '肥东县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1059, '34', '安徽省', '3401', '合肥市', '340123', '肥西县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1060, '34', '安徽省', '3401', '合肥市', '340124', '庐江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1061, '34', '安徽省', '3401', '合肥市', '340171', '合肥高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1062, '34', '安徽省', '3401', '合肥市', '340172', '合肥经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1063, '34', '安徽省', '3401', '合肥市', '340173', '合肥新站高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1064, '34', '安徽省', '3401', '合肥市', '340181', '巢湖市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1065, '34', '安徽省', '3402', '芜湖市', '340201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1066, '34', '安徽省', '3402', '芜湖市', '340202', '镜湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1067, '34', '安徽省', '3402', '芜湖市', '340203', '弋江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1068, '34', '安徽省', '3402', '芜湖市', '340207', '鸠江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1069, '34', '安徽省', '3402', '芜湖市', '340208', '三山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1070, '34', '安徽省', '3402', '芜湖市', '340221', '芜湖县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1071, '34', '安徽省', '3402', '芜湖市', '340222', '繁昌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1072, '34', '安徽省', '3402', '芜湖市', '340223', '南陵县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1073, '34', '安徽省', '3402', '芜湖市', '340271', '芜湖经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1074, '34', '安徽省', '3402', '芜湖市', '340272', '安徽芜湖长江大桥经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1075, '34', '安徽省', '3402', '芜湖市', '340281', '无为市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1076, '34', '安徽省', '3403', '蚌埠市', '340301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1077, '34', '安徽省', '3403', '蚌埠市', '340302', '龙子湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1078, '34', '安徽省', '3403', '蚌埠市', '340303', '蚌山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1079, '34', '安徽省', '3403', '蚌埠市', '340304', '禹会区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1080, '34', '安徽省', '3403', '蚌埠市', '340311', '淮上区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1081, '34', '安徽省', '3403', '蚌埠市', '340321', '怀远县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1082, '34', '安徽省', '3403', '蚌埠市', '340322', '五河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1083, '34', '安徽省', '3403', '蚌埠市', '340323', '固镇县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1084, '34', '安徽省', '3403', '蚌埠市', '340371', '蚌埠市高新技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1085, '34', '安徽省', '3403', '蚌埠市', '340372', '蚌埠市经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1086, '34', '安徽省', '3404', '淮南市', '340401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1087, '34', '安徽省', '3404', '淮南市', '340402', '大通区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1088, '34', '安徽省', '3404', '淮南市', '340403', '田家庵区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1089, '34', '安徽省', '3404', '淮南市', '340404', '谢家集区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1090, '34', '安徽省', '3404', '淮南市', '340405', '八公山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1091, '34', '安徽省', '3404', '淮南市', '340406', '潘集区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1092, '34', '安徽省', '3404', '淮南市', '340421', '凤台县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1093, '34', '安徽省', '3404', '淮南市', '340422', '寿县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1094, '34', '安徽省', '3405', '马鞍山市', '340501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1095, '34', '安徽省', '3405', '马鞍山市', '340503', '花山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1096, '34', '安徽省', '3405', '马鞍山市', '340504', '雨山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1097, '34', '安徽省', '3405', '马鞍山市', '340506', '博望区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1098, '34', '安徽省', '3405', '马鞍山市', '340521', '当涂县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1099, '34', '安徽省', '3405', '马鞍山市', '340522', '含山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1100, '34', '安徽省', '3405', '马鞍山市', '340523', '和县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1101, '34', '安徽省', '3406', '淮北市', '340601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1102, '34', '安徽省', '3406', '淮北市', '340602', '杜集区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1103, '34', '安徽省', '3406', '淮北市', '340603', '相山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1104, '34', '安徽省', '3406', '淮北市', '340604', '烈山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1105, '34', '安徽省', '3406', '淮北市', '340621', '濉溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1106, '34', '安徽省', '3407', '铜陵市', '340701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1107, '34', '安徽省', '3407', '铜陵市', '340705', '铜官区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1108, '34', '安徽省', '3407', '铜陵市', '340706', '义安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1109, '34', '安徽省', '3407', '铜陵市', '340711', '郊区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1110, '34', '安徽省', '3407', '铜陵市', '340722', '枞阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1111, '34', '安徽省', '3408', '安庆市', '340801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1112, '34', '安徽省', '3408', '安庆市', '340802', '迎江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1113, '34', '安徽省', '3408', '安庆市', '340803', '大观区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1114, '34', '安徽省', '3408', '安庆市', '340811', '宜秀区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1115, '34', '安徽省', '3408', '安庆市', '340822', '怀宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1116, '34', '安徽省', '3408', '安庆市', '340825', '太湖县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1117, '34', '安徽省', '3408', '安庆市', '340826', '宿松县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1118, '34', '安徽省', '3408', '安庆市', '340827', '望江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1119, '34', '安徽省', '3408', '安庆市', '340828', '岳西县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1120, '34', '安徽省', '3408', '安庆市', '340871', '安徽安庆经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1121, '34', '安徽省', '3408', '安庆市', '340881', '桐城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1122, '34', '安徽省', '3408', '安庆市', '340882', '潜山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1123, '34', '安徽省', '3410', '黄山市', '341001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1124, '34', '安徽省', '3410', '黄山市', '341002', '屯溪区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1125, '34', '安徽省', '3410', '黄山市', '341003', '黄山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1126, '34', '安徽省', '3410', '黄山市', '341004', '徽州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1127, '34', '安徽省', '3410', '黄山市', '341021', '歙县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1128, '34', '安徽省', '3410', '黄山市', '341022', '休宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1129, '34', '安徽省', '3410', '黄山市', '341023', '黟县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1130, '34', '安徽省', '3410', '黄山市', '341024', '祁门县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1131, '34', '安徽省', '3411', '滁州市', '341101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1132, '34', '安徽省', '3411', '滁州市', '341102', '琅琊区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1133, '34', '安徽省', '3411', '滁州市', '341103', '南谯区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1134, '34', '安徽省', '3411', '滁州市', '341122', '来安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1135, '34', '安徽省', '3411', '滁州市', '341124', '全椒县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1136, '34', '安徽省', '3411', '滁州市', '341125', '定远县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1137, '34', '安徽省', '3411', '滁州市', '341126', '凤阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1138, '34', '安徽省', '3411', '滁州市', '341171', '苏滁现代产业园', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1139, '34', '安徽省', '3411', '滁州市', '341172', '滁州经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1140, '34', '安徽省', '3411', '滁州市', '341181', '天长市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1141, '34', '安徽省', '3411', '滁州市', '341182', '明光市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1142, '34', '安徽省', '3412', '阜阳市', '341201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1143, '34', '安徽省', '3412', '阜阳市', '341202', '颍州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1144, '34', '安徽省', '3412', '阜阳市', '341203', '颍东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1145, '34', '安徽省', '3412', '阜阳市', '341204', '颍泉区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1146, '34', '安徽省', '3412', '阜阳市', '341221', '临泉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1147, '34', '安徽省', '3412', '阜阳市', '341222', '太和县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1148, '34', '安徽省', '3412', '阜阳市', '341225', '阜南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1149, '34', '安徽省', '3412', '阜阳市', '341226', '颍上县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1150, '34', '安徽省', '3412', '阜阳市', '341271', '阜阳合肥现代产业园区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1151, '34', '安徽省', '3412', '阜阳市', '341272', '阜阳经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1152, '34', '安徽省', '3412', '阜阳市', '341282', '界首市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1153, '34', '安徽省', '3413', '宿州市', '341301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1154, '34', '安徽省', '3413', '宿州市', '341302', '�桥区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1155, '34', '安徽省', '3413', '宿州市', '341321', '砀山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1156, '34', '安徽省', '3413', '宿州市', '341322', '萧县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1157, '34', '安徽省', '3413', '宿州市', '341323', '灵璧县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1158, '34', '安徽省', '3413', '宿州市', '341324', '泗县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1159, '34', '安徽省', '3413', '宿州市', '341371', '宿州马鞍山现代产业园区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1160, '34', '安徽省', '3413', '宿州市', '341372', '宿州经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1161, '34', '安徽省', '3415', '六安市', '341501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1162, '34', '安徽省', '3415', '六安市', '341502', '金安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1163, '34', '安徽省', '3415', '六安市', '341503', '裕安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1164, '34', '安徽省', '3415', '六安市', '341504', '叶集区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1165, '34', '安徽省', '3415', '六安市', '341522', '霍邱县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1166, '34', '安徽省', '3415', '六安市', '341523', '舒城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1167, '34', '安徽省', '3415', '六安市', '341524', '金寨县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1168, '34', '安徽省', '3415', '六安市', '341525', '霍山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1169, '34', '安徽省', '3416', '亳州市', '341601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1170, '34', '安徽省', '3416', '亳州市', '341602', '谯城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1171, '34', '安徽省', '3416', '亳州市', '341621', '涡阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1172, '34', '安徽省', '3416', '亳州市', '341622', '蒙城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1173, '34', '安徽省', '3416', '亳州市', '341623', '利辛县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1174, '34', '安徽省', '3417', '池州市', '341701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1175, '34', '安徽省', '3417', '池州市', '341702', '贵池区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1176, '34', '安徽省', '3417', '池州市', '341721', '东至县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1177, '34', '安徽省', '3417', '池州市', '341722', '石台县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1178, '34', '安徽省', '3417', '池州市', '341723', '青阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1179, '34', '安徽省', '3418', '宣城市', '341801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1180, '34', '安徽省', '3418', '宣城市', '341802', '宣州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1181, '34', '安徽省', '3418', '宣城市', '341821', '郎溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1182, '34', '安徽省', '3418', '宣城市', '341823', '泾县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1183, '34', '安徽省', '3418', '宣城市', '341824', '绩溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1184, '34', '安徽省', '3418', '宣城市', '341825', '旌德县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1185, '34', '安徽省', '3418', '宣城市', '341871', '宣城市经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1186, '34', '安徽省', '3418', '宣城市', '341881', '宁国市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (1187, '34', '安徽省', '3418', '宣城市', '341882', '广德市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2391, '35', '福建省', '3501', '福州市', '350101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2392, '35', '福建省', '3501', '福州市', '350102', '鼓楼区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2393, '35', '福建省', '3501', '福州市', '350103', '台江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2394, '35', '福建省', '3501', '福州市', '350104', '仓山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2395, '35', '福建省', '3501', '福州市', '350105', '马尾区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2396, '35', '福建省', '3501', '福州市', '350111', '晋安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2397, '35', '福建省', '3501', '福州市', '350112', '长乐区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2398, '35', '福建省', '3501', '福州市', '350121', '闽侯县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2399, '35', '福建省', '3501', '福州市', '350122', '连江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2400, '35', '福建省', '3501', '福州市', '350123', '罗源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2401, '35', '福建省', '3501', '福州市', '350124', '闽清县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2402, '35', '福建省', '3501', '福州市', '350125', '永泰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2403, '35', '福建省', '3501', '福州市', '350128', '平潭县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2404, '35', '福建省', '3501', '福州市', '350181', '福清市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2405, '35', '福建省', '3502', '厦门市', '350201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2406, '35', '福建省', '3502', '厦门市', '350203', '思明区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2407, '35', '福建省', '3502', '厦门市', '350205', '海沧区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2408, '35', '福建省', '3502', '厦门市', '350206', '湖里区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2409, '35', '福建省', '3502', '厦门市', '350211', '集美区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2410, '35', '福建省', '3502', '厦门市', '350212', '同安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2411, '35', '福建省', '3502', '厦门市', '350213', '翔安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2412, '35', '福建省', '3503', '莆田市', '350301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2413, '35', '福建省', '3503', '莆田市', '350302', '城厢区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2414, '35', '福建省', '3503', '莆田市', '350303', '涵江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2415, '35', '福建省', '3503', '莆田市', '350304', '荔城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2416, '35', '福建省', '3503', '莆田市', '350305', '秀屿区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2417, '35', '福建省', '3503', '莆田市', '350322', '仙游县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2418, '35', '福建省', '3504', '三明市', '350401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2419, '35', '福建省', '3504', '三明市', '350402', '梅列区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2420, '35', '福建省', '3504', '三明市', '350403', '三元区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2421, '35', '福建省', '3504', '三明市', '350421', '明溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2422, '35', '福建省', '3504', '三明市', '350423', '清流县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2423, '35', '福建省', '3504', '三明市', '350424', '宁化县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2424, '35', '福建省', '3504', '三明市', '350425', '大田县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2425, '35', '福建省', '3504', '三明市', '350426', '尤溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2426, '35', '福建省', '3504', '三明市', '350427', '沙县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2427, '35', '福建省', '3504', '三明市', '350428', '将乐县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2428, '35', '福建省', '3504', '三明市', '350429', '泰宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2429, '35', '福建省', '3504', '三明市', '350430', '建宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2430, '35', '福建省', '3504', '三明市', '350481', '永安市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2431, '35', '福建省', '3505', '泉州市', '350501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2432, '35', '福建省', '3505', '泉州市', '350502', '鲤城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2433, '35', '福建省', '3505', '泉州市', '350503', '丰泽区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2434, '35', '福建省', '3505', '泉州市', '350504', '洛江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2435, '35', '福建省', '3505', '泉州市', '350505', '泉港区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2436, '35', '福建省', '3505', '泉州市', '350521', '惠安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2437, '35', '福建省', '3505', '泉州市', '350524', '安溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2438, '35', '福建省', '3505', '泉州市', '350525', '永春县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2439, '35', '福建省', '3505', '泉州市', '350526', '德化县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2440, '35', '福建省', '3505', '泉州市', '350527', '金门县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2441, '35', '福建省', '3505', '泉州市', '350581', '石狮市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2442, '35', '福建省', '3505', '泉州市', '350582', '晋江市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2443, '35', '福建省', '3505', '泉州市', '350583', '南安市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2444, '35', '福建省', '3506', '漳州市', '350601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2445, '35', '福建省', '3506', '漳州市', '350602', '芗城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2446, '35', '福建省', '3506', '漳州市', '350603', '龙文区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2447, '35', '福建省', '3506', '漳州市', '350622', '云霄县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2448, '35', '福建省', '3506', '漳州市', '350623', '漳浦县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2449, '35', '福建省', '3506', '漳州市', '350624', '诏安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2450, '35', '福建省', '3506', '漳州市', '350625', '长泰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2451, '35', '福建省', '3506', '漳州市', '350626', '东山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2452, '35', '福建省', '3506', '漳州市', '350627', '南靖县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2453, '35', '福建省', '3506', '漳州市', '350628', '平和县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2454, '35', '福建省', '3506', '漳州市', '350629', '华安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2455, '35', '福建省', '3506', '漳州市', '350681', '龙海市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2456, '35', '福建省', '3507', '南平市', '350701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2457, '35', '福建省', '3507', '南平市', '350702', '延平区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2458, '35', '福建省', '3507', '南平市', '350703', '建阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2459, '35', '福建省', '3507', '南平市', '350721', '顺昌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2460, '35', '福建省', '3507', '南平市', '350722', '浦城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2461, '35', '福建省', '3507', '南平市', '350723', '光泽县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2462, '35', '福建省', '3507', '南平市', '350724', '松溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2463, '35', '福建省', '3507', '南平市', '350725', '政和县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2464, '35', '福建省', '3507', '南平市', '350781', '邵武市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2465, '35', '福建省', '3507', '南平市', '350782', '武夷山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2466, '35', '福建省', '3507', '南平市', '350783', '建瓯市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2467, '35', '福建省', '3508', '龙岩市', '350801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2468, '35', '福建省', '3508', '龙岩市', '350802', '新罗区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2469, '35', '福建省', '3508', '龙岩市', '350803', '永定区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2470, '35', '福建省', '3508', '龙岩市', '350821', '长汀县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2471, '35', '福建省', '3508', '龙岩市', '350823', '上杭县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2472, '35', '福建省', '3508', '龙岩市', '350824', '武平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2473, '35', '福建省', '3508', '龙岩市', '350825', '连城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2474, '35', '福建省', '3508', '龙岩市', '350881', '漳平市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2475, '35', '福建省', '3509', '宁德市', '350901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2476, '35', '福建省', '3509', '宁德市', '350902', '蕉城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2477, '35', '福建省', '3509', '宁德市', '350921', '霞浦县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2478, '35', '福建省', '3509', '宁德市', '350922', '古田县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2479, '35', '福建省', '3509', '宁德市', '350923', '屏南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2480, '35', '福建省', '3509', '宁德市', '350924', '寿宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2481, '35', '福建省', '3509', '宁德市', '350925', '周宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2482, '35', '福建省', '3509', '宁德市', '350926', '柘荣县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2483, '35', '福建省', '3509', '宁德市', '350981', '福安市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2484, '35', '福建省', '3509', '宁德市', '350982', '福鼎市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2485, '36', '江西省', '3601', '南昌市', '360101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2486, '36', '江西省', '3601', '南昌市', '360102', '东湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2487, '36', '江西省', '3601', '南昌市', '360103', '西湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2488, '36', '江西省', '3601', '南昌市', '360104', '青云谱区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2489, '36', '江西省', '3601', '南昌市', '360111', '青山湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2490, '36', '江西省', '3601', '南昌市', '360112', '新建区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2491, '36', '江西省', '3601', '南昌市', '360113', '红谷滩区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2492, '36', '江西省', '3601', '南昌市', '360121', '南昌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2493, '36', '江西省', '3601', '南昌市', '360123', '安义县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2494, '36', '江西省', '3601', '南昌市', '360124', '进贤县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2495, '36', '江西省', '3602', '景德镇市', '360201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2496, '36', '江西省', '3602', '景德镇市', '360202', '昌江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2497, '36', '江西省', '3602', '景德镇市', '360203', '珠山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2498, '36', '江西省', '3602', '景德镇市', '360222', '浮梁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2499, '36', '江西省', '3602', '景德镇市', '360281', '乐平市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2500, '36', '江西省', '3603', '萍乡市', '360301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2501, '36', '江西省', '3603', '萍乡市', '360302', '安源区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2502, '36', '江西省', '3603', '萍乡市', '360313', '湘东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2503, '36', '江西省', '3603', '萍乡市', '360321', '莲花县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2504, '36', '江西省', '3603', '萍乡市', '360322', '上栗县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2505, '36', '江西省', '3603', '萍乡市', '360323', '芦溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2506, '36', '江西省', '3604', '九江市', '360401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2507, '36', '江西省', '3604', '九江市', '360402', '濂溪区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2508, '36', '江西省', '3604', '九江市', '360403', '浔阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2509, '36', '江西省', '3604', '九江市', '360404', '柴桑区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2510, '36', '江西省', '3604', '九江市', '360423', '武宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2511, '36', '江西省', '3604', '九江市', '360424', '修水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2512, '36', '江西省', '3604', '九江市', '360425', '永修县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2513, '36', '江西省', '3604', '九江市', '360426', '德安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2514, '36', '江西省', '3604', '九江市', '360428', '都昌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2515, '36', '江西省', '3604', '九江市', '360429', '湖口县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2516, '36', '江西省', '3604', '九江市', '360430', '彭泽县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2517, '36', '江西省', '3604', '九江市', '360481', '瑞昌市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2518, '36', '江西省', '3604', '九江市', '360482', '共青城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2519, '36', '江西省', '3604', '九江市', '360483', '庐山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2520, '36', '江西省', '3605', '新余市', '360501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2521, '36', '江西省', '3605', '新余市', '360502', '渝水区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2522, '36', '江西省', '3605', '新余市', '360521', '分宜县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2523, '36', '江西省', '3606', '鹰潭市', '360601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2524, '36', '江西省', '3606', '鹰潭市', '360602', '月湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2525, '36', '江西省', '3606', '鹰潭市', '360603', '余江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2526, '36', '江西省', '3606', '鹰潭市', '360681', '贵溪市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2527, '36', '江西省', '3607', '赣州市', '360701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2528, '36', '江西省', '3607', '赣州市', '360702', '章贡区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2529, '36', '江西省', '3607', '赣州市', '360703', '南康区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2530, '36', '江西省', '3607', '赣州市', '360704', '赣县区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2531, '36', '江西省', '3607', '赣州市', '360722', '信丰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2532, '36', '江西省', '3607', '赣州市', '360723', '大余县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2533, '36', '江西省', '3607', '赣州市', '360724', '上犹县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2534, '36', '江西省', '3607', '赣州市', '360725', '崇义县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2535, '36', '江西省', '3607', '赣州市', '360726', '安远县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2536, '36', '江西省', '3607', '赣州市', '360728', '定南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2537, '36', '江西省', '3607', '赣州市', '360729', '全南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2538, '36', '江西省', '3607', '赣州市', '360730', '宁都县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2539, '36', '江西省', '3607', '赣州市', '360731', '于都县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2540, '36', '江西省', '3607', '赣州市', '360732', '兴国县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2541, '36', '江西省', '3607', '赣州市', '360733', '会昌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2542, '36', '江西省', '3607', '赣州市', '360734', '寻乌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2543, '36', '江西省', '3607', '赣州市', '360735', '石城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2544, '36', '江西省', '3607', '赣州市', '360781', '瑞金市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2545, '36', '江西省', '3607', '赣州市', '360783', '龙南市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2546, '36', '江西省', '3608', '吉安市', '360801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2547, '36', '江西省', '3608', '吉安市', '360802', '吉州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2548, '36', '江西省', '3608', '吉安市', '360803', '青原区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2549, '36', '江西省', '3608', '吉安市', '360821', '吉安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2550, '36', '江西省', '3608', '吉安市', '360822', '吉水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2551, '36', '江西省', '3608', '吉安市', '360823', '峡江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2552, '36', '江西省', '3608', '吉安市', '360824', '新干县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2553, '36', '江西省', '3608', '吉安市', '360825', '永丰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2554, '36', '江西省', '3608', '吉安市', '360826', '泰和县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2555, '36', '江西省', '3608', '吉安市', '360827', '遂川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2556, '36', '江西省', '3608', '吉安市', '360828', '万安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2557, '36', '江西省', '3608', '吉安市', '360829', '安福县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2558, '36', '江西省', '3608', '吉安市', '360830', '永新县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2559, '36', '江西省', '3608', '吉安市', '360881', '井冈山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2560, '36', '江西省', '3609', '宜春市', '360901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2561, '36', '江西省', '3609', '宜春市', '360902', '袁州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2562, '36', '江西省', '3609', '宜春市', '360921', '奉新县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2563, '36', '江西省', '3609', '宜春市', '360922', '万载县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2564, '36', '江西省', '3609', '宜春市', '360923', '上高县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2565, '36', '江西省', '3609', '宜春市', '360924', '宜丰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2566, '36', '江西省', '3609', '宜春市', '360925', '靖安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2567, '36', '江西省', '3609', '宜春市', '360926', '铜鼓县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2568, '36', '江西省', '3609', '宜春市', '360981', '丰城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2569, '36', '江西省', '3609', '宜春市', '360982', '樟树市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2570, '36', '江西省', '3609', '宜春市', '360983', '高安市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2571, '36', '江西省', '3610', '抚州市', '361001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2572, '36', '江西省', '3610', '抚州市', '361002', '临川区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2573, '36', '江西省', '3610', '抚州市', '361003', '东乡区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2574, '36', '江西省', '3610', '抚州市', '361021', '南城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2575, '36', '江西省', '3610', '抚州市', '361022', '黎川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2576, '36', '江西省', '3610', '抚州市', '361023', '南丰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2577, '36', '江西省', '3610', '抚州市', '361024', '崇仁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2578, '36', '江西省', '3610', '抚州市', '361025', '乐安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2579, '36', '江西省', '3610', '抚州市', '361026', '宜黄县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2580, '36', '江西省', '3610', '抚州市', '361027', '金溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2581, '36', '江西省', '3610', '抚州市', '361028', '资溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2582, '36', '江西省', '3610', '抚州市', '361030', '广昌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2583, '36', '江西省', '3611', '上饶市', '361101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2584, '36', '江西省', '3611', '上饶市', '361102', '信州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2585, '36', '江西省', '3611', '上饶市', '361103', '广丰区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2586, '36', '江西省', '3611', '上饶市', '361104', '广信区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2587, '36', '江西省', '3611', '上饶市', '361123', '玉山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2588, '36', '江西省', '3611', '上饶市', '361124', '铅山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2589, '36', '江西省', '3611', '上饶市', '361125', '横峰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2590, '36', '江西省', '3611', '上饶市', '361126', '弋阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2591, '36', '江西省', '3611', '上饶市', '361127', '余干县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2592, '36', '江西省', '3611', '上饶市', '361128', '鄱阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2593, '36', '江西省', '3611', '上饶市', '361129', '万年县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2594, '36', '江西省', '3611', '上饶市', '361130', '婺源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2595, '36', '江西省', '3611', '上饶市', '361181', '德兴市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2596, '37', '山东省', '3701', '济南市', '370101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2597, '37', '山东省', '3701', '济南市', '370102', '历下区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2598, '37', '山东省', '3701', '济南市', '370103', '市中区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2599, '37', '山东省', '3701', '济南市', '370104', '槐荫区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2600, '37', '山东省', '3701', '济南市', '370105', '天桥区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2601, '37', '山东省', '3701', '济南市', '370112', '历城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2602, '37', '山东省', '3701', '济南市', '370113', '长清区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2603, '37', '山东省', '3701', '济南市', '370114', '章丘区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2604, '37', '山东省', '3701', '济南市', '370115', '济阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2605, '37', '山东省', '3701', '济南市', '370116', '莱芜区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2606, '37', '山东省', '3701', '济南市', '370117', '钢城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2607, '37', '山东省', '3701', '济南市', '370124', '平阴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2608, '37', '山东省', '3701', '济南市', '370126', '商河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2609, '37', '山东省', '3701', '济南市', '370171', '济南高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2610, '37', '山东省', '3702', '青岛市', '370201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2611, '37', '山东省', '3702', '青岛市', '370202', '市南区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2612, '37', '山东省', '3702', '青岛市', '370203', '市北区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2613, '37', '山东省', '3702', '青岛市', '370211', '黄岛区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2614, '37', '山东省', '3702', '青岛市', '370212', '崂山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2615, '37', '山东省', '3702', '青岛市', '370213', '李沧区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2616, '37', '山东省', '3702', '青岛市', '370214', '城阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2617, '37', '山东省', '3702', '青岛市', '370215', '即墨区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2618, '37', '山东省', '3702', '青岛市', '370271', '青岛高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2619, '37', '山东省', '3702', '青岛市', '370281', '胶州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2620, '37', '山东省', '3702', '青岛市', '370283', '平度市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2621, '37', '山东省', '3702', '青岛市', '370285', '莱西市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2622, '37', '山东省', '3703', '淄博市', '370301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2623, '37', '山东省', '3703', '淄博市', '370302', '淄川区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2624, '37', '山东省', '3703', '淄博市', '370303', '张店区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2625, '37', '山东省', '3703', '淄博市', '370304', '博山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2626, '37', '山东省', '3703', '淄博市', '370305', '临淄区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2627, '37', '山东省', '3703', '淄博市', '370306', '周村区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2628, '37', '山东省', '3703', '淄博市', '370321', '桓台县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2629, '37', '山东省', '3703', '淄博市', '370322', '高青县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2630, '37', '山东省', '3703', '淄博市', '370323', '沂源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2631, '37', '山东省', '3704', '枣庄市', '370401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2632, '37', '山东省', '3704', '枣庄市', '370402', '市中区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2633, '37', '山东省', '3704', '枣庄市', '370403', '薛城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2634, '37', '山东省', '3704', '枣庄市', '370404', '峄城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2635, '37', '山东省', '3704', '枣庄市', '370405', '台儿庄区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2636, '37', '山东省', '3704', '枣庄市', '370406', '山亭区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2637, '37', '山东省', '3704', '枣庄市', '370481', '滕州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2638, '37', '山东省', '3705', '东营市', '370501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2639, '37', '山东省', '3705', '东营市', '370502', '东营区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2640, '37', '山东省', '3705', '东营市', '370503', '河口区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2641, '37', '山东省', '3705', '东营市', '370505', '垦利区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2642, '37', '山东省', '3705', '东营市', '370522', '利津县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2643, '37', '山东省', '3705', '东营市', '370523', '广饶县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2644, '37', '山东省', '3705', '东营市', '370571', '东营经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2645, '37', '山东省', '3705', '东营市', '370572', '东营港经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2646, '37', '山东省', '3706', '烟台市', '370601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2647, '37', '山东省', '3706', '烟台市', '370602', '芝罘区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2648, '37', '山东省', '3706', '烟台市', '370611', '福山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2649, '37', '山东省', '3706', '烟台市', '370612', '牟平区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2650, '37', '山东省', '3706', '烟台市', '370613', '莱山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2651, '37', '山东省', '3706', '烟台市', '370614', '蓬莱区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2652, '37', '山东省', '3706', '烟台市', '370671', '烟台高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2653, '37', '山东省', '3706', '烟台市', '370672', '烟台经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2654, '37', '山东省', '3706', '烟台市', '370681', '龙口市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2655, '37', '山东省', '3706', '烟台市', '370682', '莱阳市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2656, '37', '山东省', '3706', '烟台市', '370683', '莱州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2657, '37', '山东省', '3706', '烟台市', '370685', '招远市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2658, '37', '山东省', '3706', '烟台市', '370686', '栖霞市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2659, '37', '山东省', '3706', '烟台市', '370687', '海阳市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2660, '37', '山东省', '3707', '潍坊市', '370701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2661, '37', '山东省', '3707', '潍坊市', '370702', '潍城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2662, '37', '山东省', '3707', '潍坊市', '370703', '寒亭区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2663, '37', '山东省', '3707', '潍坊市', '370704', '坊子区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2664, '37', '山东省', '3707', '潍坊市', '370705', '奎文区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2665, '37', '山东省', '3707', '潍坊市', '370724', '临朐县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2666, '37', '山东省', '3707', '潍坊市', '370725', '昌乐县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2667, '37', '山东省', '3707', '潍坊市', '370772', '潍坊滨海经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2668, '37', '山东省', '3707', '潍坊市', '370781', '青州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2669, '37', '山东省', '3707', '潍坊市', '370782', '诸城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2670, '37', '山东省', '3707', '潍坊市', '370783', '寿光市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2671, '37', '山东省', '3707', '潍坊市', '370784', '安丘市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2672, '37', '山东省', '3707', '潍坊市', '370785', '高密市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2673, '37', '山东省', '3707', '潍坊市', '370786', '昌邑市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2674, '37', '山东省', '3708', '济宁市', '370801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2675, '37', '山东省', '3708', '济宁市', '370811', '任城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2676, '37', '山东省', '3708', '济宁市', '370812', '兖州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2677, '37', '山东省', '3708', '济宁市', '370826', '微山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2678, '37', '山东省', '3708', '济宁市', '370827', '鱼台县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2679, '37', '山东省', '3708', '济宁市', '370828', '金乡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2680, '37', '山东省', '3708', '济宁市', '370829', '嘉祥县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2681, '37', '山东省', '3708', '济宁市', '370830', '汶上县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2682, '37', '山东省', '3708', '济宁市', '370831', '泗水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2683, '37', '山东省', '3708', '济宁市', '370832', '梁山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2684, '37', '山东省', '3708', '济宁市', '370871', '济宁高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2685, '37', '山东省', '3708', '济宁市', '370881', '曲阜市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2686, '37', '山东省', '3708', '济宁市', '370883', '邹城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2687, '37', '山东省', '3709', '泰安市', '370901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2688, '37', '山东省', '3709', '泰安市', '370902', '泰山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2689, '37', '山东省', '3709', '泰安市', '370911', '岱岳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2690, '37', '山东省', '3709', '泰安市', '370921', '宁阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2691, '37', '山东省', '3709', '泰安市', '370923', '东平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2692, '37', '山东省', '3709', '泰安市', '370982', '新泰市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2693, '37', '山东省', '3709', '泰安市', '370983', '肥城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2694, '37', '山东省', '3710', '威海市', '371001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2695, '37', '山东省', '3710', '威海市', '371002', '环翠区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2696, '37', '山东省', '3710', '威海市', '371003', '文登区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2697, '37', '山东省', '3710', '威海市', '371071', '威海火炬高技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2698, '37', '山东省', '3710', '威海市', '371072', '威海经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2699, '37', '山东省', '3710', '威海市', '371073', '威海临港经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2700, '37', '山东省', '3710', '威海市', '371082', '荣成市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2701, '37', '山东省', '3710', '威海市', '371083', '乳山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2702, '37', '山东省', '3711', '日照市', '371101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2703, '37', '山东省', '3711', '日照市', '371102', '东港区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2704, '37', '山东省', '3711', '日照市', '371103', '岚山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2705, '37', '山东省', '3711', '日照市', '371121', '五莲县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2706, '37', '山东省', '3711', '日照市', '371122', '莒县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2707, '37', '山东省', '3711', '日照市', '371171', '日照经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2708, '37', '山东省', '3713', '临沂市', '371301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2709, '37', '山东省', '3713', '临沂市', '371302', '兰山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2710, '37', '山东省', '3713', '临沂市', '371311', '罗庄区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2711, '37', '山东省', '3713', '临沂市', '371312', '河东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2712, '37', '山东省', '3713', '临沂市', '371321', '沂南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2713, '37', '山东省', '3713', '临沂市', '371322', '郯城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2714, '37', '山东省', '3713', '临沂市', '371323', '沂水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2715, '37', '山东省', '3713', '临沂市', '371324', '兰陵县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2716, '37', '山东省', '3713', '临沂市', '371325', '费县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2717, '37', '山东省', '3713', '临沂市', '371326', '平邑县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2718, '37', '山东省', '3713', '临沂市', '371327', '莒南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2719, '37', '山东省', '3713', '临沂市', '371328', '蒙阴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2720, '37', '山东省', '3713', '临沂市', '371329', '临沭县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2721, '37', '山东省', '3713', '临沂市', '371371', '临沂高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2722, '37', '山东省', '3714', '德州市', '371401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2723, '37', '山东省', '3714', '德州市', '371402', '德城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2724, '37', '山东省', '3714', '德州市', '371403', '陵城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2725, '37', '山东省', '3714', '德州市', '371422', '宁津县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2726, '37', '山东省', '3714', '德州市', '371423', '庆云县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2727, '37', '山东省', '3714', '德州市', '371424', '临邑县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2728, '37', '山东省', '3714', '德州市', '371425', '齐河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2729, '37', '山东省', '3714', '德州市', '371426', '平原县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2730, '37', '山东省', '3714', '德州市', '371427', '夏津县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2731, '37', '山东省', '3714', '德州市', '371428', '武城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2732, '37', '山东省', '3714', '德州市', '371471', '德州经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2733, '37', '山东省', '3714', '德州市', '371472', '德州运河经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2734, '37', '山东省', '3714', '德州市', '371481', '乐陵市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2735, '37', '山东省', '3714', '德州市', '371482', '禹城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2736, '37', '山东省', '3715', '聊城市', '371501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2737, '37', '山东省', '3715', '聊城市', '371502', '东昌府区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2738, '37', '山东省', '3715', '聊城市', '371503', '茌平区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2739, '37', '山东省', '3715', '聊城市', '371521', '阳谷县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2740, '37', '山东省', '3715', '聊城市', '371522', '莘县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2741, '37', '山东省', '3715', '聊城市', '371524', '东阿县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2742, '37', '山东省', '3715', '聊城市', '371525', '冠县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2743, '37', '山东省', '3715', '聊城市', '371526', '高唐县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2744, '37', '山东省', '3715', '聊城市', '371581', '临清市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2745, '37', '山东省', '3716', '滨州市', '371601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2746, '37', '山东省', '3716', '滨州市', '371602', '滨城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2747, '37', '山东省', '3716', '滨州市', '371603', '沾化区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2748, '37', '山东省', '3716', '滨州市', '371621', '惠民县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2749, '37', '山东省', '3716', '滨州市', '371622', '阳信县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2750, '37', '山东省', '3716', '滨州市', '371623', '无棣县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2751, '37', '山东省', '3716', '滨州市', '371625', '博兴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2752, '37', '山东省', '3716', '滨州市', '371681', '邹平市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2753, '37', '山东省', '3717', '菏泽市', '371701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2754, '37', '山东省', '3717', '菏泽市', '371702', '牡丹区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2755, '37', '山东省', '3717', '菏泽市', '371703', '定陶区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2756, '37', '山东省', '3717', '菏泽市', '371721', '曹县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2757, '37', '山东省', '3717', '菏泽市', '371722', '单县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2758, '37', '山东省', '3717', '菏泽市', '371723', '成武县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2759, '37', '山东省', '3717', '菏泽市', '371724', '巨野县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2760, '37', '山东省', '3717', '菏泽市', '371725', '郓城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2761, '37', '山东省', '3717', '菏泽市', '371726', '鄄城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2762, '37', '山东省', '3717', '菏泽市', '371728', '东明县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2763, '37', '山东省', '3717', '菏泽市', '371771', '菏泽经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2764, '37', '山东省', '3717', '菏泽市', '371772', '菏泽高新技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2765, '41', '河南省', '4101', '郑州市', '410101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2766, '41', '河南省', '4101', '郑州市', '410102', '中原区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2767, '41', '河南省', '4101', '郑州市', '410103', '二七区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2768, '41', '河南省', '4101', '郑州市', '410104', '管城回族区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2769, '41', '河南省', '4101', '郑州市', '410105', '金水区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2770, '41', '河南省', '4101', '郑州市', '410106', '上街区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2771, '41', '河南省', '4101', '郑州市', '410108', '惠济区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2772, '41', '河南省', '4101', '郑州市', '410122', '中牟县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2773, '41', '河南省', '4101', '郑州市', '410171', '郑州经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2774, '41', '河南省', '4101', '郑州市', '410172', '郑州高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2775, '41', '河南省', '4101', '郑州市', '410173', '郑州航空港经济综合实验区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2776, '41', '河南省', '4101', '郑州市', '410181', '巩义市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2777, '41', '河南省', '4101', '郑州市', '410182', '荥阳市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2778, '41', '河南省', '4101', '郑州市', '410183', '新密市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2779, '41', '河南省', '4101', '郑州市', '410184', '新郑市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2780, '41', '河南省', '4101', '郑州市', '410185', '登封市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2781, '41', '河南省', '4102', '开封市', '410201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2782, '41', '河南省', '4102', '开封市', '410202', '龙亭区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2783, '41', '河南省', '4102', '开封市', '410203', '顺河回族区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2784, '41', '河南省', '4102', '开封市', '410204', '鼓楼区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2785, '41', '河南省', '4102', '开封市', '410205', '禹王台区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2786, '41', '河南省', '4102', '开封市', '410212', '祥符区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2787, '41', '河南省', '4102', '开封市', '410221', '杞县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2788, '41', '河南省', '4102', '开封市', '410222', '通许县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2789, '41', '河南省', '4102', '开封市', '410223', '尉氏县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2790, '41', '河南省', '4102', '开封市', '410225', '兰考县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2791, '41', '河南省', '4103', '洛阳市', '410301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2792, '41', '河南省', '4103', '洛阳市', '410302', '老城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2793, '41', '河南省', '4103', '洛阳市', '410303', '西工区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2794, '41', '河南省', '4103', '洛阳市', '410304', '�河回族区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2795, '41', '河南省', '4103', '洛阳市', '410305', '涧西区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2796, '41', '河南省', '4103', '洛阳市', '410306', '吉利区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2797, '41', '河南省', '4103', '洛阳市', '410311', '洛龙区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2798, '41', '河南省', '4103', '洛阳市', '410322', '孟津县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2799, '41', '河南省', '4103', '洛阳市', '410323', '新安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2800, '41', '河南省', '4103', '洛阳市', '410324', '栾川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2801, '41', '河南省', '4103', '洛阳市', '410325', '嵩县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2802, '41', '河南省', '4103', '洛阳市', '410326', '汝阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2803, '41', '河南省', '4103', '洛阳市', '410327', '宜阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2804, '41', '河南省', '4103', '洛阳市', '410328', '洛宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2805, '41', '河南省', '4103', '洛阳市', '410329', '伊川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2806, '41', '河南省', '4103', '洛阳市', '410371', '洛阳高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2807, '41', '河南省', '4103', '洛阳市', '410381', '偃师市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2808, '41', '河南省', '4104', '平顶山市', '410401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2809, '41', '河南省', '4104', '平顶山市', '410402', '新华区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2810, '41', '河南省', '4104', '平顶山市', '410403', '卫东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2811, '41', '河南省', '4104', '平顶山市', '410404', '石龙区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2812, '41', '河南省', '4104', '平顶山市', '410411', '湛河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2813, '41', '河南省', '4104', '平顶山市', '410421', '宝丰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2814, '41', '河南省', '4104', '平顶山市', '410422', '叶县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2815, '41', '河南省', '4104', '平顶山市', '410423', '鲁山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2816, '41', '河南省', '4104', '平顶山市', '410425', '郏县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2817, '41', '河南省', '4104', '平顶山市', '410471', '平顶山高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2818, '41', '河南省', '4104', '平顶山市', '410472', '平顶山市城乡一体化示范区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2819, '41', '河南省', '4104', '平顶山市', '410481', '舞钢市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2820, '41', '河南省', '4104', '平顶山市', '410482', '汝州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2821, '41', '河南省', '4105', '安阳市', '410501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2822, '41', '河南省', '4105', '安阳市', '410502', '文峰区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2823, '41', '河南省', '4105', '安阳市', '410503', '北关区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2824, '41', '河南省', '4105', '安阳市', '410505', '殷都区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2825, '41', '河南省', '4105', '安阳市', '410506', '龙安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2826, '41', '河南省', '4105', '安阳市', '410522', '安阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2827, '41', '河南省', '4105', '安阳市', '410523', '汤阴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2828, '41', '河南省', '4105', '安阳市', '410526', '滑县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2829, '41', '河南省', '4105', '安阳市', '410527', '内黄县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2830, '41', '河南省', '4105', '安阳市', '410571', '安阳高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2831, '41', '河南省', '4105', '安阳市', '410581', '林州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2832, '41', '河南省', '4106', '鹤壁市', '410601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2833, '41', '河南省', '4106', '鹤壁市', '410602', '鹤山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2834, '41', '河南省', '4106', '鹤壁市', '410603', '山城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2835, '41', '河南省', '4106', '鹤壁市', '410611', '淇滨区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2836, '41', '河南省', '4106', '鹤壁市', '410621', '浚县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2837, '41', '河南省', '4106', '鹤壁市', '410622', '淇县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2838, '41', '河南省', '4106', '鹤壁市', '410671', '鹤壁经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2839, '41', '河南省', '4107', '新乡市', '410701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2840, '41', '河南省', '4107', '新乡市', '410702', '红旗区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2841, '41', '河南省', '4107', '新乡市', '410703', '卫滨区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2842, '41', '河南省', '4107', '新乡市', '410704', '凤泉区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2843, '41', '河南省', '4107', '新乡市', '410711', '牧野区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2844, '41', '河南省', '4107', '新乡市', '410721', '新乡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2845, '41', '河南省', '4107', '新乡市', '410724', '获嘉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2846, '41', '河南省', '4107', '新乡市', '410725', '原阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2847, '41', '河南省', '4107', '新乡市', '410726', '延津县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2848, '41', '河南省', '4107', '新乡市', '410727', '封丘县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2849, '41', '河南省', '4107', '新乡市', '410771', '新乡高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2850, '41', '河南省', '4107', '新乡市', '410772', '新乡经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2851, '41', '河南省', '4107', '新乡市', '410773', '新乡市平原城乡一体化示范区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2852, '41', '河南省', '4107', '新乡市', '410781', '卫辉市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2853, '41', '河南省', '4107', '新乡市', '410782', '辉县市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2854, '41', '河南省', '4107', '新乡市', '410783', '长垣市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2855, '41', '河南省', '4108', '焦作市', '410801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2856, '41', '河南省', '4108', '焦作市', '410802', '解放区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2857, '41', '河南省', '4108', '焦作市', '410803', '中站区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2858, '41', '河南省', '4108', '焦作市', '410804', '马村区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2859, '41', '河南省', '4108', '焦作市', '410811', '山阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2860, '41', '河南省', '4108', '焦作市', '410821', '修武县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2861, '41', '河南省', '4108', '焦作市', '410822', '博爱县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2862, '41', '河南省', '4108', '焦作市', '410823', '武陟县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2863, '41', '河南省', '4108', '焦作市', '410825', '温县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2864, '41', '河南省', '4108', '焦作市', '410871', '焦作城乡一体化示范区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2865, '41', '河南省', '4108', '焦作市', '410882', '沁阳市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2866, '41', '河南省', '4108', '焦作市', '410883', '孟州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2867, '41', '河南省', '4109', '濮阳市', '410901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2868, '41', '河南省', '4109', '濮阳市', '410902', '华龙区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2869, '41', '河南省', '4109', '濮阳市', '410922', '清丰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2870, '41', '河南省', '4109', '濮阳市', '410923', '南乐县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2871, '41', '河南省', '4109', '濮阳市', '410926', '范县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2872, '41', '河南省', '4109', '濮阳市', '410927', '台前县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2873, '41', '河南省', '4109', '濮阳市', '410928', '濮阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2874, '41', '河南省', '4109', '濮阳市', '410971', '河南濮阳工业园区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2875, '41', '河南省', '4109', '濮阳市', '410972', '濮阳经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2876, '41', '河南省', '4110', '许昌市', '411001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2877, '41', '河南省', '4110', '许昌市', '411002', '魏都区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2878, '41', '河南省', '4110', '许昌市', '411003', '建安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2879, '41', '河南省', '4110', '许昌市', '411024', '鄢陵县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2880, '41', '河南省', '4110', '许昌市', '411025', '襄城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2881, '41', '河南省', '4110', '许昌市', '411071', '许昌经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2882, '41', '河南省', '4110', '许昌市', '411081', '禹州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2883, '41', '河南省', '4110', '许昌市', '411082', '长葛市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2884, '41', '河南省', '4111', '漯河市', '411101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2885, '41', '河南省', '4111', '漯河市', '411102', '源汇区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2886, '41', '河南省', '4111', '漯河市', '411103', '郾城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2887, '41', '河南省', '4111', '漯河市', '411104', '召陵区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2888, '41', '河南省', '4111', '漯河市', '411121', '舞阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2889, '41', '河南省', '4111', '漯河市', '411122', '临颍县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2890, '41', '河南省', '4111', '漯河市', '411171', '漯河经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2891, '41', '河南省', '4112', '三门峡市', '411201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2892, '41', '河南省', '4112', '三门峡市', '411202', '湖滨区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2893, '41', '河南省', '4112', '三门峡市', '411203', '陕州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2894, '41', '河南省', '4112', '三门峡市', '411221', '渑池县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2895, '41', '河南省', '4112', '三门峡市', '411224', '卢氏县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2896, '41', '河南省', '4112', '三门峡市', '411271', '河南三门峡经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2897, '41', '河南省', '4112', '三门峡市', '411281', '义马市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2898, '41', '河南省', '4112', '三门峡市', '411282', '灵宝市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2899, '41', '河南省', '4113', '南阳市', '411301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2900, '41', '河南省', '4113', '南阳市', '411302', '宛城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2901, '41', '河南省', '4113', '南阳市', '411303', '卧龙区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2902, '41', '河南省', '4113', '南阳市', '411321', '南召县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2903, '41', '河南省', '4113', '南阳市', '411322', '方城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2904, '41', '河南省', '4113', '南阳市', '411323', '西峡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2905, '41', '河南省', '4113', '南阳市', '411324', '镇平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2906, '41', '河南省', '4113', '南阳市', '411325', '内乡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2907, '41', '河南省', '4113', '南阳市', '411326', '淅川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2908, '41', '河南省', '4113', '南阳市', '411327', '社旗县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2909, '41', '河南省', '4113', '南阳市', '411328', '唐河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2910, '41', '河南省', '4113', '南阳市', '411329', '新野县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2911, '41', '河南省', '4113', '南阳市', '411330', '桐柏县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2912, '41', '河南省', '4113', '南阳市', '411371', '南阳高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2913, '41', '河南省', '4113', '南阳市', '411372', '南阳市城乡一体化示范区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2914, '41', '河南省', '4113', '南阳市', '411381', '邓州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2915, '41', '河南省', '4114', '商丘市', '411401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2916, '41', '河南省', '4114', '商丘市', '411402', '梁园区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2917, '41', '河南省', '4114', '商丘市', '411403', '睢阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2918, '41', '河南省', '4114', '商丘市', '411421', '民权县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2919, '41', '河南省', '4114', '商丘市', '411422', '睢县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2920, '41', '河南省', '4114', '商丘市', '411423', '宁陵县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2921, '41', '河南省', '4114', '商丘市', '411424', '柘城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2922, '41', '河南省', '4114', '商丘市', '411425', '虞城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2923, '41', '河南省', '4114', '商丘市', '411426', '夏邑县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2924, '41', '河南省', '4114', '商丘市', '411471', '豫东综合物流产业聚集区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2925, '41', '河南省', '4114', '商丘市', '411472', '河南商丘经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2926, '41', '河南省', '4114', '商丘市', '411481', '永城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2927, '41', '河南省', '4115', '信阳市', '411501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2928, '41', '河南省', '4115', '信阳市', '411502', '�河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2929, '41', '河南省', '4115', '信阳市', '411503', '平桥区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2930, '41', '河南省', '4115', '信阳市', '411521', '罗山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2931, '41', '河南省', '4115', '信阳市', '411522', '光山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2932, '41', '河南省', '4115', '信阳市', '411523', '新县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2933, '41', '河南省', '4115', '信阳市', '411524', '商城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2934, '41', '河南省', '4115', '信阳市', '411525', '固始县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2935, '41', '河南省', '4115', '信阳市', '411526', '潢川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2936, '41', '河南省', '4115', '信阳市', '411527', '淮滨县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2937, '41', '河南省', '4115', '信阳市', '411528', '息县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2938, '41', '河南省', '4115', '信阳市', '411571', '信阳高新技术产业开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2939, '41', '河南省', '4116', '周口市', '411601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2940, '41', '河南省', '4116', '周口市', '411602', '川汇区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2941, '41', '河南省', '4116', '周口市', '411603', '淮阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2942, '41', '河南省', '4116', '周口市', '411621', '扶沟县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2943, '41', '河南省', '4116', '周口市', '411622', '西华县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2944, '41', '河南省', '4116', '周口市', '411623', '商水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2945, '41', '河南省', '4116', '周口市', '411624', '沈丘县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2946, '41', '河南省', '4116', '周口市', '411625', '郸城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2947, '41', '河南省', '4116', '周口市', '411627', '太康县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2948, '41', '河南省', '4116', '周口市', '411628', '鹿邑县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2949, '41', '河南省', '4116', '周口市', '411671', '河南周口经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2950, '41', '河南省', '4116', '周口市', '411681', '项城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2951, '41', '河南省', '4117', '驻马店市', '411701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2952, '41', '河南省', '4117', '驻马店市', '411702', '驿城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2953, '41', '河南省', '4117', '驻马店市', '411721', '西平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2954, '41', '河南省', '4117', '驻马店市', '411722', '上蔡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2955, '41', '河南省', '4117', '驻马店市', '411723', '平舆县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2956, '41', '河南省', '4117', '驻马店市', '411724', '正阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2957, '41', '河南省', '4117', '驻马店市', '411725', '确山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2958, '41', '河南省', '4117', '驻马店市', '411726', '泌阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2959, '41', '河南省', '4117', '驻马店市', '411727', '汝南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2960, '41', '河南省', '4117', '驻马店市', '411728', '遂平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2961, '41', '河南省', '4117', '驻马店市', '411729', '新蔡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2962, '41', '河南省', '4117', '驻马店市', '411771', '河南驻马店经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2963, '41', '河南省', '4190', '省直辖县级行政区划', '419001', '济源市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2964, '42', '湖北省', '4201', '武汉市', '420101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2965, '42', '湖北省', '4201', '武汉市', '420102', '江岸区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2966, '42', '湖北省', '4201', '武汉市', '420103', '江汉区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2967, '42', '湖北省', '4201', '武汉市', '420104', '�口区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2968, '42', '湖北省', '4201', '武汉市', '420105', '汉阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2969, '42', '湖北省', '4201', '武汉市', '420106', '武昌区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2970, '42', '湖北省', '4201', '武汉市', '420107', '青山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2971, '42', '湖北省', '4201', '武汉市', '420111', '洪山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2972, '42', '湖北省', '4201', '武汉市', '420112', '东西湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2973, '42', '湖北省', '4201', '武汉市', '420113', '汉南区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2974, '42', '湖北省', '4201', '武汉市', '420114', '蔡甸区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2975, '42', '湖北省', '4201', '武汉市', '420115', '江夏区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2976, '42', '湖北省', '4201', '武汉市', '420116', '黄陂区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2977, '42', '湖北省', '4201', '武汉市', '420117', '新洲区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2978, '42', '湖北省', '4202', '黄石市', '420201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2979, '42', '湖北省', '4202', '黄石市', '420202', '黄石港区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2980, '42', '湖北省', '4202', '黄石市', '420203', '西塞山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2981, '42', '湖北省', '4202', '黄石市', '420204', '下陆区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2982, '42', '湖北省', '4202', '黄石市', '420205', '铁山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2983, '42', '湖北省', '4202', '黄石市', '420222', '阳新县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2984, '42', '湖北省', '4202', '黄石市', '420281', '大冶市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2985, '42', '湖北省', '4203', '十堰市', '420301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2986, '42', '湖北省', '4203', '十堰市', '420302', '茅箭区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2987, '42', '湖北省', '4203', '十堰市', '420303', '张湾区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2988, '42', '湖北省', '4203', '十堰市', '420304', '郧阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2989, '42', '湖北省', '4203', '十堰市', '420322', '郧西县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2990, '42', '湖北省', '4203', '十堰市', '420323', '竹山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2991, '42', '湖北省', '4203', '十堰市', '420324', '竹溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2992, '42', '湖北省', '4203', '十堰市', '420325', '房县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2993, '42', '湖北省', '4203', '十堰市', '420381', '丹江口市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2994, '42', '湖北省', '4205', '宜昌市', '420501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2995, '42', '湖北省', '4205', '宜昌市', '420502', '西陵区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2996, '42', '湖北省', '4205', '宜昌市', '420503', '伍家岗区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2997, '42', '湖北省', '4205', '宜昌市', '420504', '点军区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2998, '42', '湖北省', '4205', '宜昌市', '420505', '�亭区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (2999, '42', '湖北省', '4205', '宜昌市', '420506', '夷陵区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3000, '42', '湖北省', '4205', '宜昌市', '420525', '远安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3001, '42', '湖北省', '4205', '宜昌市', '420526', '兴山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3002, '42', '湖北省', '4205', '宜昌市', '420527', '秭归县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3003, '42', '湖北省', '4205', '宜昌市', '420528', '长阳土家族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3004, '42', '湖北省', '4205', '宜昌市', '420529', '五峰土家族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3005, '42', '湖北省', '4205', '宜昌市', '420581', '宜都市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3006, '42', '湖北省', '4205', '宜昌市', '420582', '当阳市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3007, '42', '湖北省', '4205', '宜昌市', '420583', '枝江市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3008, '42', '湖北省', '4206', '襄阳市', '420601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3009, '42', '湖北省', '4206', '襄阳市', '420602', '襄城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3010, '42', '湖北省', '4206', '襄阳市', '420606', '樊城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3011, '42', '湖北省', '4206', '襄阳市', '420607', '襄州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3012, '42', '湖北省', '4206', '襄阳市', '420624', '南漳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3013, '42', '湖北省', '4206', '襄阳市', '420625', '谷城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3014, '42', '湖北省', '4206', '襄阳市', '420626', '保康县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3015, '42', '湖北省', '4206', '襄阳市', '420682', '老河口市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3016, '42', '湖北省', '4206', '襄阳市', '420683', '枣阳市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3017, '42', '湖北省', '4206', '襄阳市', '420684', '宜城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3018, '42', '湖北省', '4207', '鄂州市', '420701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3019, '42', '湖北省', '4207', '鄂州市', '420702', '梁子湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3020, '42', '湖北省', '4207', '鄂州市', '420703', '华容区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3021, '42', '湖北省', '4207', '鄂州市', '420704', '鄂城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3022, '42', '湖北省', '4208', '荆门市', '420801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3023, '42', '湖北省', '4208', '荆门市', '420802', '东宝区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3024, '42', '湖北省', '4208', '荆门市', '420804', '掇刀区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3025, '42', '湖北省', '4208', '荆门市', '420822', '沙洋县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3026, '42', '湖北省', '4208', '荆门市', '420881', '钟祥市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3027, '42', '湖北省', '4208', '荆门市', '420882', '京山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3028, '42', '湖北省', '4209', '孝感市', '420901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3029, '42', '湖北省', '4209', '孝感市', '420902', '孝南区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3030, '42', '湖北省', '4209', '孝感市', '420921', '孝昌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3031, '42', '湖北省', '4209', '孝感市', '420922', '大悟县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3032, '42', '湖北省', '4209', '孝感市', '420923', '云梦县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3033, '42', '湖北省', '4209', '孝感市', '420981', '应城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3034, '42', '湖北省', '4209', '孝感市', '420982', '安陆市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3035, '42', '湖北省', '4209', '孝感市', '420984', '汉川市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3036, '42', '湖北省', '4210', '荆州市', '421001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3037, '42', '湖北省', '4210', '荆州市', '421002', '沙市区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3038, '42', '湖北省', '4210', '荆州市', '421003', '荆州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3039, '42', '湖北省', '4210', '荆州市', '421022', '公安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3040, '42', '湖北省', '4210', '荆州市', '421023', '监利县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3041, '42', '湖北省', '4210', '荆州市', '421024', '江陵县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3042, '42', '湖北省', '4210', '荆州市', '421071', '荆州经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3043, '42', '湖北省', '4210', '荆州市', '421081', '石首市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3044, '42', '湖北省', '4210', '荆州市', '421083', '洪湖市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3045, '42', '湖北省', '4210', '荆州市', '421087', '松滋市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3046, '42', '湖北省', '4211', '黄冈市', '421101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3047, '42', '湖北省', '4211', '黄冈市', '421102', '黄州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3048, '42', '湖北省', '4211', '黄冈市', '421121', '团风县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3049, '42', '湖北省', '4211', '黄冈市', '421122', '红安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3050, '42', '湖北省', '4211', '黄冈市', '421123', '罗田县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3051, '42', '湖北省', '4211', '黄冈市', '421124', '英山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3052, '42', '湖北省', '4211', '黄冈市', '421125', '浠水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3053, '42', '湖北省', '4211', '黄冈市', '421126', '蕲春县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3054, '42', '湖北省', '4211', '黄冈市', '421127', '黄梅县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3055, '42', '湖北省', '4211', '黄冈市', '421171', '龙感湖管理区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3056, '42', '湖北省', '4211', '黄冈市', '421181', '麻城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3057, '42', '湖北省', '4211', '黄冈市', '421182', '武穴市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3058, '42', '湖北省', '4212', '咸宁市', '421201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3059, '42', '湖北省', '4212', '咸宁市', '421202', '咸安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3060, '42', '湖北省', '4212', '咸宁市', '421221', '嘉鱼县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3061, '42', '湖北省', '4212', '咸宁市', '421222', '通城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3062, '42', '湖北省', '4212', '咸宁市', '421223', '崇阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3063, '42', '湖北省', '4212', '咸宁市', '421224', '通山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3064, '42', '湖北省', '4212', '咸宁市', '421281', '赤壁市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3065, '42', '湖北省', '4213', '随州市', '421301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3066, '42', '湖北省', '4213', '随州市', '421303', '曾都区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3067, '42', '湖北省', '4213', '随州市', '421321', '随县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3068, '42', '湖北省', '4213', '随州市', '421381', '广水市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3069, '42', '湖北省', '4228', '恩施土家族苗族自治州', '422801', '恩施市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3070, '42', '湖北省', '4228', '恩施土家族苗族自治州', '422802', '利川市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3071, '42', '湖北省', '4228', '恩施土家族苗族自治州', '422822', '建始县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3072, '42', '湖北省', '4228', '恩施土家族苗族自治州', '422823', '巴东县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3073, '42', '湖北省', '4228', '恩施土家族苗族自治州', '422825', '宣恩县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3074, '42', '湖北省', '4228', '恩施土家族苗族自治州', '422826', '咸丰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3075, '42', '湖北省', '4228', '恩施土家族苗族自治州', '422827', '来凤县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3076, '42', '湖北省', '4228', '恩施土家族苗族自治州', '422828', '鹤峰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3077, '42', '湖北省', '4290', '省直辖县级行政区划', '429004', '仙桃市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3078, '42', '湖北省', '4290', '省直辖县级行政区划', '429005', '潜江市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3079, '42', '湖北省', '4290', '省直辖县级行政区划', '429006', '天门市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3080, '42', '湖北省', '4290', '省直辖县级行政区划', '429021', '神农架林区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3081, '43', '湖南省', '4301', '长沙市', '430101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3082, '43', '湖南省', '4301', '长沙市', '430102', '芙蓉区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3083, '43', '湖南省', '4301', '长沙市', '430103', '天心区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3084, '43', '湖南省', '4301', '长沙市', '430104', '岳麓区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3085, '43', '湖南省', '4301', '长沙市', '430105', '开福区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3086, '43', '湖南省', '4301', '长沙市', '430111', '雨花区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3087, '43', '湖南省', '4301', '长沙市', '430112', '望城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3088, '43', '湖南省', '4301', '长沙市', '430121', '长沙县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3089, '43', '湖南省', '4301', '长沙市', '430181', '浏阳市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3090, '43', '湖南省', '4301', '长沙市', '430182', '宁乡市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3091, '43', '湖南省', '4302', '株洲市', '430201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3092, '43', '湖南省', '4302', '株洲市', '430202', '荷塘区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3093, '43', '湖南省', '4302', '株洲市', '430203', '芦淞区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3094, '43', '湖南省', '4302', '株洲市', '430204', '石峰区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3095, '43', '湖南省', '4302', '株洲市', '430211', '天元区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3096, '43', '湖南省', '4302', '株洲市', '430212', '渌口区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3097, '43', '湖南省', '4302', '株洲市', '430223', '攸县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3098, '43', '湖南省', '4302', '株洲市', '430224', '茶陵县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3099, '43', '湖南省', '4302', '株洲市', '430225', '炎陵县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3100, '43', '湖南省', '4302', '株洲市', '430271', '云龙示范区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3101, '43', '湖南省', '4302', '株洲市', '430281', '醴陵市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3102, '43', '湖南省', '4303', '湘潭市', '430301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3103, '43', '湖南省', '4303', '湘潭市', '430302', '雨湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3104, '43', '湖南省', '4303', '湘潭市', '430304', '岳塘区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3105, '43', '湖南省', '4303', '湘潭市', '430321', '湘潭县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3106, '43', '湖南省', '4303', '湘潭市', '430371', '湖南湘潭高新技术产业园区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3107, '43', '湖南省', '4303', '湘潭市', '430372', '湘潭昭山示范区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3108, '43', '湖南省', '4303', '湘潭市', '430373', '湘潭九华示范区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3109, '43', '湖南省', '4303', '湘潭市', '430381', '湘乡市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3110, '43', '湖南省', '4303', '湘潭市', '430382', '韶山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3111, '43', '湖南省', '4304', '衡阳市', '430401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3112, '43', '湖南省', '4304', '衡阳市', '430405', '珠晖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3113, '43', '湖南省', '4304', '衡阳市', '430406', '雁峰区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3114, '43', '湖南省', '4304', '衡阳市', '430407', '石鼓区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3115, '43', '湖南省', '4304', '衡阳市', '430408', '蒸湘区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3116, '43', '湖南省', '4304', '衡阳市', '430412', '南岳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3117, '43', '湖南省', '4304', '衡阳市', '430421', '衡阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3118, '43', '湖南省', '4304', '衡阳市', '430422', '衡南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3119, '43', '湖南省', '4304', '衡阳市', '430423', '衡山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3120, '43', '湖南省', '4304', '衡阳市', '430424', '衡东县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3121, '43', '湖南省', '4304', '衡阳市', '430426', '祁东县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3122, '43', '湖南省', '4304', '衡阳市', '430471', '衡阳综合保税区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3123, '43', '湖南省', '4304', '衡阳市', '430472', '湖南衡阳高新技术产业园区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3124, '43', '湖南省', '4304', '衡阳市', '430473', '湖南衡阳松木经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3125, '43', '湖南省', '4304', '衡阳市', '430481', '耒阳市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3126, '43', '湖南省', '4304', '衡阳市', '430482', '常宁市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3127, '43', '湖南省', '4305', '邵阳市', '430501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3128, '43', '湖南省', '4305', '邵阳市', '430502', '双清区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3129, '43', '湖南省', '4305', '邵阳市', '430503', '大祥区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3130, '43', '湖南省', '4305', '邵阳市', '430511', '北塔区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3131, '43', '湖南省', '4305', '邵阳市', '430522', '新邵县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3132, '43', '湖南省', '4305', '邵阳市', '430523', '邵阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3133, '43', '湖南省', '4305', '邵阳市', '430524', '隆回县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3134, '43', '湖南省', '4305', '邵阳市', '430525', '洞口县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3135, '43', '湖南省', '4305', '邵阳市', '430527', '绥宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3136, '43', '湖南省', '4305', '邵阳市', '430528', '新宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3137, '43', '湖南省', '4305', '邵阳市', '430529', '城步苗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3138, '43', '湖南省', '4305', '邵阳市', '430581', '武冈市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3139, '43', '湖南省', '4305', '邵阳市', '430582', '邵东市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3140, '43', '湖南省', '4306', '岳阳市', '430601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3141, '43', '湖南省', '4306', '岳阳市', '430602', '岳阳楼区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3142, '43', '湖南省', '4306', '岳阳市', '430603', '云溪区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3143, '43', '湖南省', '4306', '岳阳市', '430611', '君山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3144, '43', '湖南省', '4306', '岳阳市', '430621', '岳阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3145, '43', '湖南省', '4306', '岳阳市', '430623', '华容县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3146, '43', '湖南省', '4306', '岳阳市', '430624', '湘阴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3147, '43', '湖南省', '4306', '岳阳市', '430626', '平江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3148, '43', '湖南省', '4306', '岳阳市', '430671', '岳阳市屈原管理区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3149, '43', '湖南省', '4306', '岳阳市', '430681', '汨罗市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3150, '43', '湖南省', '4306', '岳阳市', '430682', '临湘市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3151, '43', '湖南省', '4307', '常德市', '430701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3152, '43', '湖南省', '4307', '常德市', '430702', '武陵区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3153, '43', '湖南省', '4307', '常德市', '430703', '鼎城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3154, '43', '湖南省', '4307', '常德市', '430721', '安乡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3155, '43', '湖南省', '4307', '常德市', '430722', '汉寿县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3156, '43', '湖南省', '4307', '常德市', '430723', '澧县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3157, '43', '湖南省', '4307', '常德市', '430724', '临澧县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3158, '43', '湖南省', '4307', '常德市', '430725', '桃源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3159, '43', '湖南省', '4307', '常德市', '430726', '石门县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3160, '43', '湖南省', '4307', '常德市', '430771', '常德市西洞庭管理区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3161, '43', '湖南省', '4307', '常德市', '430781', '津市市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3162, '43', '湖南省', '4308', '张家界市', '430801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3163, '43', '湖南省', '4308', '张家界市', '430802', '永定区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3164, '43', '湖南省', '4308', '张家界市', '430811', '武陵源区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3165, '43', '湖南省', '4308', '张家界市', '430821', '慈利县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3166, '43', '湖南省', '4308', '张家界市', '430822', '桑植县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3167, '43', '湖南省', '4309', '益阳市', '430901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3168, '43', '湖南省', '4309', '益阳市', '430902', '资阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3169, '43', '湖南省', '4309', '益阳市', '430903', '赫山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3170, '43', '湖南省', '4309', '益阳市', '430921', '南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3171, '43', '湖南省', '4309', '益阳市', '430922', '桃江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3172, '43', '湖南省', '4309', '益阳市', '430923', '安化县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3173, '43', '湖南省', '4309', '益阳市', '430971', '益阳市大通湖管理区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3174, '43', '湖南省', '4309', '益阳市', '430972', '湖南益阳高新技术产业园区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3175, '43', '湖南省', '4309', '益阳市', '430981', '沅江市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3176, '43', '湖南省', '4310', '郴州市', '431001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3177, '43', '湖南省', '4310', '郴州市', '431002', '北湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3178, '43', '湖南省', '4310', '郴州市', '431003', '苏仙区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3179, '43', '湖南省', '4310', '郴州市', '431021', '桂阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3180, '43', '湖南省', '4310', '郴州市', '431022', '宜章县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3181, '43', '湖南省', '4310', '郴州市', '431023', '永兴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3182, '43', '湖南省', '4310', '郴州市', '431024', '嘉禾县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3183, '43', '湖南省', '4310', '郴州市', '431025', '临武县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3184, '43', '湖南省', '4310', '郴州市', '431026', '汝城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3185, '43', '湖南省', '4310', '郴州市', '431027', '桂东县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3186, '43', '湖南省', '4310', '郴州市', '431028', '安仁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3187, '43', '湖南省', '4310', '郴州市', '431081', '资兴市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3188, '43', '湖南省', '4311', '永州市', '431101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3189, '43', '湖南省', '4311', '永州市', '431102', '零陵区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3190, '43', '湖南省', '4311', '永州市', '431103', '冷水滩区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3191, '43', '湖南省', '4311', '永州市', '431121', '祁阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3192, '43', '湖南省', '4311', '永州市', '431122', '东安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3193, '43', '湖南省', '4311', '永州市', '431123', '双牌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3194, '43', '湖南省', '4311', '永州市', '431124', '道县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3195, '43', '湖南省', '4311', '永州市', '431125', '江永县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3196, '43', '湖南省', '4311', '永州市', '431126', '宁远县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3197, '43', '湖南省', '4311', '永州市', '431127', '蓝山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3198, '43', '湖南省', '4311', '永州市', '431128', '新田县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3199, '43', '湖南省', '4311', '永州市', '431129', '江华瑶族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3200, '43', '湖南省', '4311', '永州市', '431171', '永州经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3201, '43', '湖南省', '4311', '永州市', '431172', '永州市金洞管理区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3202, '43', '湖南省', '4311', '永州市', '431173', '永州市回龙圩管理区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3203, '43', '湖南省', '4312', '怀化市', '431201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3204, '43', '湖南省', '4312', '怀化市', '431202', '鹤城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3205, '43', '湖南省', '4312', '怀化市', '431221', '中方县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3206, '43', '湖南省', '4312', '怀化市', '431222', '沅陵县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3207, '43', '湖南省', '4312', '怀化市', '431223', '辰溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3208, '43', '湖南省', '4312', '怀化市', '431224', '溆浦县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3209, '43', '湖南省', '4312', '怀化市', '431225', '会同县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3210, '43', '湖南省', '4312', '怀化市', '431226', '麻阳苗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3211, '43', '湖南省', '4312', '怀化市', '431227', '新晃侗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3212, '43', '湖南省', '4312', '怀化市', '431228', '芷江侗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3213, '43', '湖南省', '4312', '怀化市', '431229', '靖州苗族侗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3214, '43', '湖南省', '4312', '怀化市', '431230', '通道侗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3215, '43', '湖南省', '4312', '怀化市', '431271', '怀化市洪江管理区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3216, '43', '湖南省', '4312', '怀化市', '431281', '洪江市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3217, '43', '湖南省', '4313', '娄底市', '431301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3218, '43', '湖南省', '4313', '娄底市', '431302', '娄星区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3219, '43', '湖南省', '4313', '娄底市', '431321', '双峰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3220, '43', '湖南省', '4313', '娄底市', '431322', '新化县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3221, '43', '湖南省', '4313', '娄底市', '431381', '冷水江市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3222, '43', '湖南省', '4313', '娄底市', '431382', '涟源市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3223, '43', '湖南省', '4331', '湘西土家族苗族自治州', '433101', '吉首市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3224, '43', '湖南省', '4331', '湘西土家族苗族自治州', '433122', '泸溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3225, '43', '湖南省', '4331', '湘西土家族苗族自治州', '433123', '凤凰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3226, '43', '湖南省', '4331', '湘西土家族苗族自治州', '433124', '花垣县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3227, '43', '湖南省', '4331', '湘西土家族苗族自治州', '433125', '保靖县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3228, '43', '湖南省', '4331', '湘西土家族苗族自治州', '433126', '古丈县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3229, '43', '湖南省', '4331', '湘西土家族苗族自治州', '433127', '永顺县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3230, '43', '湖南省', '4331', '湘西土家族苗族自治州', '433130', '龙山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3231, '44', '广东省', '4401', '广州市', '440101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3232, '44', '广东省', '4401', '广州市', '440103', '荔湾区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3233, '44', '广东省', '4401', '广州市', '440104', '越秀区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3234, '44', '广东省', '4401', '广州市', '440105', '海珠区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3235, '44', '广东省', '4401', '广州市', '440106', '天河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3236, '44', '广东省', '4401', '广州市', '440111', '白云区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3237, '44', '广东省', '4401', '广州市', '440112', '黄埔区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3238, '44', '广东省', '4401', '广州市', '440113', '番禺区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3239, '44', '广东省', '4401', '广州市', '440114', '花都区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3240, '44', '广东省', '4401', '广州市', '440115', '南沙区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3241, '44', '广东省', '4401', '广州市', '440117', '从化区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3242, '44', '广东省', '4401', '广州市', '440118', '增城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3243, '44', '广东省', '4402', '韶关市', '440201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3244, '44', '广东省', '4402', '韶关市', '440203', '武江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3245, '44', '广东省', '4402', '韶关市', '440204', '浈江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3246, '44', '广东省', '4402', '韶关市', '440205', '曲江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3247, '44', '广东省', '4402', '韶关市', '440222', '始兴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3248, '44', '广东省', '4402', '韶关市', '440224', '仁化县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3249, '44', '广东省', '4402', '韶关市', '440229', '翁源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3250, '44', '广东省', '4402', '韶关市', '440232', '乳源瑶族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3251, '44', '广东省', '4402', '韶关市', '440233', '新丰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3252, '44', '广东省', '4402', '韶关市', '440281', '乐昌市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3253, '44', '广东省', '4402', '韶关市', '440282', '南雄市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3254, '44', '广东省', '4403', '深圳市', '440301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3255, '44', '广东省', '4403', '深圳市', '440303', '罗湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3256, '44', '广东省', '4403', '深圳市', '440304', '福田区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3257, '44', '广东省', '4403', '深圳市', '440305', '南山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3258, '44', '广东省', '4403', '深圳市', '440306', '宝安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3259, '44', '广东省', '4403', '深圳市', '440307', '龙岗区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3260, '44', '广东省', '4403', '深圳市', '440308', '盐田区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3261, '44', '广东省', '4403', '深圳市', '440309', '龙华区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3262, '44', '广东省', '4403', '深圳市', '440310', '坪山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3263, '44', '广东省', '4403', '深圳市', '440311', '光明区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3264, '44', '广东省', '4404', '珠海市', '440401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3265, '44', '广东省', '4404', '珠海市', '440402', '香洲区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3266, '44', '广东省', '4404', '珠海市', '440403', '斗门区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3267, '44', '广东省', '4404', '珠海市', '440404', '金湾区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3268, '44', '广东省', '4405', '汕头市', '440501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3269, '44', '广东省', '4405', '汕头市', '440507', '龙湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3270, '44', '广东省', '4405', '汕头市', '440511', '金平区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3271, '44', '广东省', '4405', '汕头市', '440512', '濠江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3272, '44', '广东省', '4405', '汕头市', '440513', '潮阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3273, '44', '广东省', '4405', '汕头市', '440514', '潮南区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3274, '44', '广东省', '4405', '汕头市', '440515', '澄海区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3275, '44', '广东省', '4405', '汕头市', '440523', '南澳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3276, '44', '广东省', '4406', '佛山市', '440601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3277, '44', '广东省', '4406', '佛山市', '440604', '禅城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3278, '44', '广东省', '4406', '佛山市', '440605', '南海区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3279, '44', '广东省', '4406', '佛山市', '440606', '顺德区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3280, '44', '广东省', '4406', '佛山市', '440607', '三水区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3281, '44', '广东省', '4406', '佛山市', '440608', '高明区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3282, '44', '广东省', '4407', '江门市', '440701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3283, '44', '广东省', '4407', '江门市', '440703', '蓬江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3284, '44', '广东省', '4407', '江门市', '440704', '江海区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3285, '44', '广东省', '4407', '江门市', '440705', '新会区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3286, '44', '广东省', '4407', '江门市', '440781', '台山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3287, '44', '广东省', '4407', '江门市', '440783', '开平市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3288, '44', '广东省', '4407', '江门市', '440784', '鹤山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3289, '44', '广东省', '4407', '江门市', '440785', '恩平市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3290, '44', '广东省', '4408', '湛江市', '440801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3291, '44', '广东省', '4408', '湛江市', '440802', '赤坎区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3292, '44', '广东省', '4408', '湛江市', '440803', '霞山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3293, '44', '广东省', '4408', '湛江市', '440804', '坡头区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3294, '44', '广东省', '4408', '湛江市', '440811', '麻章区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3295, '44', '广东省', '4408', '湛江市', '440823', '遂溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3296, '44', '广东省', '4408', '湛江市', '440825', '徐闻县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3297, '44', '广东省', '4408', '湛江市', '440881', '廉江市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3298, '44', '广东省', '4408', '湛江市', '440882', '雷州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3299, '44', '广东省', '4408', '湛江市', '440883', '吴川市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3300, '44', '广东省', '4409', '茂名市', '440901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3301, '44', '广东省', '4409', '茂名市', '440902', '茂南区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3302, '44', '广东省', '4409', '茂名市', '440904', '电白区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3303, '44', '广东省', '4409', '茂名市', '440981', '高州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3304, '44', '广东省', '4409', '茂名市', '440982', '化州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3305, '44', '广东省', '4409', '茂名市', '440983', '信宜市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3306, '44', '广东省', '4412', '肇庆市', '441201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3307, '44', '广东省', '4412', '肇庆市', '441202', '端州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3308, '44', '广东省', '4412', '肇庆市', '441203', '鼎湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3309, '44', '广东省', '4412', '肇庆市', '441204', '高要区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3310, '44', '广东省', '4412', '肇庆市', '441223', '广宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3311, '44', '广东省', '4412', '肇庆市', '441224', '怀集县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3312, '44', '广东省', '4412', '肇庆市', '441225', '封开县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3313, '44', '广东省', '4412', '肇庆市', '441226', '德庆县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3314, '44', '广东省', '4412', '肇庆市', '441284', '四会市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3315, '44', '广东省', '4413', '惠州市', '441301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3316, '44', '广东省', '4413', '惠州市', '441302', '惠城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3317, '44', '广东省', '4413', '惠州市', '441303', '惠阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3318, '44', '广东省', '4413', '惠州市', '441322', '博罗县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3319, '44', '广东省', '4413', '惠州市', '441323', '惠东县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3320, '44', '广东省', '4413', '惠州市', '441324', '龙门县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3321, '44', '广东省', '4414', '梅州市', '441401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3322, '44', '广东省', '4414', '梅州市', '441402', '梅江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3323, '44', '广东省', '4414', '梅州市', '441403', '梅县区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3324, '44', '广东省', '4414', '梅州市', '441422', '大埔县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3325, '44', '广东省', '4414', '梅州市', '441423', '丰顺县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3326, '44', '广东省', '4414', '梅州市', '441424', '五华县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3327, '44', '广东省', '4414', '梅州市', '441426', '平远县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3328, '44', '广东省', '4414', '梅州市', '441427', '蕉岭县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3329, '44', '广东省', '4414', '梅州市', '441481', '兴宁市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3330, '44', '广东省', '4415', '汕尾市', '441501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3331, '44', '广东省', '4415', '汕尾市', '441502', '城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3332, '44', '广东省', '4415', '汕尾市', '441521', '海丰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3333, '44', '广东省', '4415', '汕尾市', '441523', '陆河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3334, '44', '广东省', '4415', '汕尾市', '441581', '陆丰市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3335, '44', '广东省', '4416', '河源市', '441601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3336, '44', '广东省', '4416', '河源市', '441602', '源城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3337, '44', '广东省', '4416', '河源市', '441621', '紫金县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3338, '44', '广东省', '4416', '河源市', '441622', '龙川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3339, '44', '广东省', '4416', '河源市', '441623', '连平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3340, '44', '广东省', '4416', '河源市', '441624', '和平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3341, '44', '广东省', '4416', '河源市', '441625', '东源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3342, '44', '广东省', '4417', '阳江市', '441701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3343, '44', '广东省', '4417', '阳江市', '441702', '江城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3344, '44', '广东省', '4417', '阳江市', '441704', '阳东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3345, '44', '广东省', '4417', '阳江市', '441721', '阳西县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3346, '44', '广东省', '4417', '阳江市', '441781', '阳春市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3347, '44', '广东省', '4418', '清远市', '441801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3348, '44', '广东省', '4418', '清远市', '441802', '清城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3349, '44', '广东省', '4418', '清远市', '441803', '清新区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3350, '44', '广东省', '4418', '清远市', '441821', '佛冈县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3351, '44', '广东省', '4418', '清远市', '441823', '阳山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3352, '44', '广东省', '4418', '清远市', '441825', '连山壮族瑶族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3353, '44', '广东省', '4418', '清远市', '441826', '连南瑶族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3354, '44', '广东省', '4418', '清远市', '441881', '英德市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3355, '44', '广东省', '4418', '清远市', '441882', '连州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3356, '44', '广东省', '4419', '东莞市', '441900', '东城街道', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3357, '44', '广东省', '4420', '中山市', '442000', '石岐街道', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3358, '44', '广东省', '4451', '潮州市', '445101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3359, '44', '广东省', '4451', '潮州市', '445102', '湘桥区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3360, '44', '广东省', '4451', '潮州市', '445103', '潮安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3361, '44', '广东省', '4451', '潮州市', '445122', '饶平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3362, '44', '广东省', '4452', '揭阳市', '445201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3363, '44', '广东省', '4452', '揭阳市', '445202', '榕城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3364, '44', '广东省', '4452', '揭阳市', '445203', '揭东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3365, '44', '广东省', '4452', '揭阳市', '445222', '揭西县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3366, '44', '广东省', '4452', '揭阳市', '445224', '惠来县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3367, '44', '广东省', '4452', '揭阳市', '445281', '普宁市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3368, '44', '广东省', '4453', '云浮市', '445301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3369, '44', '广东省', '4453', '云浮市', '445302', '云城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3370, '44', '广东省', '4453', '云浮市', '445303', '云安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3371, '44', '广东省', '4453', '云浮市', '445321', '新兴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3372, '44', '广东省', '4453', '云浮市', '445322', '郁南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3373, '44', '广东省', '4453', '云浮市', '445381', '罗定市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3431, '45', '广西壮族自治区', '4501', '南宁市', '450101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3432, '45', '广西壮族自治区', '4501', '南宁市', '450102', '兴宁区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3433, '45', '广西壮族自治区', '4501', '南宁市', '450103', '青秀区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3434, '45', '广西壮族自治区', '4501', '南宁市', '450105', '江南区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3435, '45', '广西壮族自治区', '4501', '南宁市', '450107', '西乡塘区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3436, '45', '广西壮族自治区', '4501', '南宁市', '450108', '良庆区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3437, '45', '广西壮族自治区', '4501', '南宁市', '450109', '邕宁区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3438, '45', '广西壮族自治区', '4501', '南宁市', '450110', '武鸣区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3439, '45', '广西壮族自治区', '4501', '南宁市', '450123', '隆安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3440, '45', '广西壮族自治区', '4501', '南宁市', '450124', '马山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3441, '45', '广西壮族自治区', '4501', '南宁市', '450125', '上林县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3442, '45', '广西壮族自治区', '4501', '南宁市', '450126', '宾阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3443, '45', '广西壮族自治区', '4501', '南宁市', '450127', '横县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3444, '45', '广西壮族自治区', '4502', '柳州市', '450201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3445, '45', '广西壮族自治区', '4502', '柳州市', '450202', '城中区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3446, '45', '广西壮族自治区', '4502', '柳州市', '450203', '鱼峰区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3447, '45', '广西壮族自治区', '4502', '柳州市', '450204', '柳南区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3448, '45', '广西壮族自治区', '4502', '柳州市', '450205', '柳北区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3449, '45', '广西壮族自治区', '4502', '柳州市', '450206', '柳江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3450, '45', '广西壮族自治区', '4502', '柳州市', '450222', '柳城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3451, '45', '广西壮族自治区', '4502', '柳州市', '450223', '鹿寨县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3452, '45', '广西壮族自治区', '4502', '柳州市', '450224', '融安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3453, '45', '广西壮族自治区', '4502', '柳州市', '450225', '融水苗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3454, '45', '广西壮族自治区', '4502', '柳州市', '450226', '三江侗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3455, '45', '广西壮族自治区', '4503', '桂林市', '450301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3456, '45', '广西壮族自治区', '4503', '桂林市', '450302', '秀峰区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3457, '45', '广西壮族自治区', '4503', '桂林市', '450303', '叠彩区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3458, '45', '广西壮族自治区', '4503', '桂林市', '450304', '象山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3459, '45', '广西壮族自治区', '4503', '桂林市', '450305', '七星区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3460, '45', '广西壮族自治区', '4503', '桂林市', '450311', '雁山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3461, '45', '广西壮族自治区', '4503', '桂林市', '450312', '临桂区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3462, '45', '广西壮族自治区', '4503', '桂林市', '450321', '阳朔县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3463, '45', '广西壮族自治区', '4503', '桂林市', '450323', '灵川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3464, '45', '广西壮族自治区', '4503', '桂林市', '450324', '全州县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3465, '45', '广西壮族自治区', '4503', '桂林市', '450325', '兴安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3466, '45', '广西壮族自治区', '4503', '桂林市', '450326', '永福县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3467, '45', '广西壮族自治区', '4503', '桂林市', '450327', '灌阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3468, '45', '广西壮族自治区', '4503', '桂林市', '450328', '龙胜各族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3469, '45', '广西壮族自治区', '4503', '桂林市', '450329', '资源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3470, '45', '广西壮族自治区', '4503', '桂林市', '450330', '平乐县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3471, '45', '广西壮族自治区', '4503', '桂林市', '450332', '恭城瑶族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3472, '45', '广西壮族自治区', '4503', '桂林市', '450381', '荔浦市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3473, '45', '广西壮族自治区', '4504', '梧州市', '450401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3474, '45', '广西壮族自治区', '4504', '梧州市', '450403', '万秀区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3475, '45', '广西壮族自治区', '4504', '梧州市', '450405', '长洲区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3476, '45', '广西壮族自治区', '4504', '梧州市', '450406', '龙圩区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3477, '45', '广西壮族自治区', '4504', '梧州市', '450421', '苍梧县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3478, '45', '广西壮族自治区', '4504', '梧州市', '450422', '藤县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3479, '45', '广西壮族自治区', '4504', '梧州市', '450423', '蒙山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3480, '45', '广西壮族自治区', '4504', '梧州市', '450481', '岑溪市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3481, '45', '广西壮族自治区', '4505', '北海市', '450501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3482, '45', '广西壮族自治区', '4505', '北海市', '450502', '海城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3483, '45', '广西壮族自治区', '4505', '北海市', '450503', '银海区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3484, '45', '广西壮族自治区', '4505', '北海市', '450512', '铁山港区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3485, '45', '广西壮族自治区', '4505', '北海市', '450521', '合浦县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3486, '45', '广西壮族自治区', '4506', '防城港市', '450601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3487, '45', '广西壮族自治区', '4506', '防城港市', '450602', '港口区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3488, '45', '广西壮族自治区', '4506', '防城港市', '450603', '防城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3489, '45', '广西壮族自治区', '4506', '防城港市', '450621', '上思县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3490, '45', '广西壮族自治区', '4506', '防城港市', '450681', '东兴市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3491, '45', '广西壮族自治区', '4507', '钦州市', '450701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3492, '45', '广西壮族自治区', '4507', '钦州市', '450702', '钦南区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3493, '45', '广西壮族自治区', '4507', '钦州市', '450703', '钦北区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3494, '45', '广西壮族自治区', '4507', '钦州市', '450721', '灵山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3495, '45', '广西壮族自治区', '4507', '钦州市', '450722', '浦北县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3496, '45', '广西壮族自治区', '4508', '贵港市', '450801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3497, '45', '广西壮族自治区', '4508', '贵港市', '450802', '港北区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3498, '45', '广西壮族自治区', '4508', '贵港市', '450803', '港南区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3499, '45', '广西壮族自治区', '4508', '贵港市', '450804', '覃塘区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3500, '45', '广西壮族自治区', '4508', '贵港市', '450821', '平南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3501, '45', '广西壮族自治区', '4508', '贵港市', '450881', '桂平市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3502, '45', '广西壮族自治区', '4509', '玉林市', '450901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3503, '45', '广西壮族自治区', '4509', '玉林市', '450902', '玉州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3504, '45', '广西壮族自治区', '4509', '玉林市', '450903', '福绵区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3505, '45', '广西壮族自治区', '4509', '玉林市', '450921', '容县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3506, '45', '广西壮族自治区', '4509', '玉林市', '450922', '陆川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3507, '45', '广西壮族自治区', '4509', '玉林市', '450923', '博白县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3508, '45', '广西壮族自治区', '4509', '玉林市', '450924', '兴业县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3509, '45', '广西壮族自治区', '4509', '玉林市', '450981', '北流市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3510, '45', '广西壮族自治区', '4510', '百色市', '451001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3511, '45', '广西壮族自治区', '4510', '百色市', '451002', '右江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3512, '45', '广西壮族自治区', '4510', '百色市', '451003', '田阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3513, '45', '广西壮族自治区', '4510', '百色市', '451022', '田东县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3514, '45', '广西壮族自治区', '4510', '百色市', '451024', '德保县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3515, '45', '广西壮族自治区', '4510', '百色市', '451026', '那坡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3516, '45', '广西壮族自治区', '4510', '百色市', '451027', '凌云县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3517, '45', '广西壮族自治区', '4510', '百色市', '451028', '乐业县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3518, '45', '广西壮族自治区', '4510', '百色市', '451029', '田林县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3519, '45', '广西壮族自治区', '4510', '百色市', '451030', '西林县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3520, '45', '广西壮族自治区', '4510', '百色市', '451031', '隆林各族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3521, '45', '广西壮族自治区', '4510', '百色市', '451081', '靖西市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3522, '45', '广西壮族自治区', '4510', '百色市', '451082', '平果市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3523, '45', '广西壮族自治区', '4511', '贺州市', '451101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3524, '45', '广西壮族自治区', '4511', '贺州市', '451102', '八步区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3525, '45', '广西壮族自治区', '4511', '贺州市', '451103', '平桂区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3526, '45', '广西壮族自治区', '4511', '贺州市', '451121', '昭平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3527, '45', '广西壮族自治区', '4511', '贺州市', '451122', '钟山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3528, '45', '广西壮族自治区', '4511', '贺州市', '451123', '富川瑶族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3529, '45', '广西壮族自治区', '4512', '河池市', '451201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3530, '45', '广西壮族自治区', '4512', '河池市', '451202', '金城江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3531, '45', '广西壮族自治区', '4512', '河池市', '451203', '宜州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3532, '45', '广西壮族自治区', '4512', '河池市', '451221', '南丹县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3533, '45', '广西壮族自治区', '4512', '河池市', '451222', '天峨县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3534, '45', '广西壮族自治区', '4512', '河池市', '451223', '凤山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3535, '45', '广西壮族自治区', '4512', '河池市', '451224', '东兰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3536, '45', '广西壮族自治区', '4512', '河池市', '451225', '罗城仫佬族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3537, '45', '广西壮族自治区', '4512', '河池市', '451226', '环江毛南族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3538, '45', '广西壮族自治区', '4512', '河池市', '451227', '巴马瑶族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3539, '45', '广西壮族自治区', '4512', '河池市', '451228', '都安瑶族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3540, '45', '广西壮族自治区', '4512', '河池市', '451229', '大化瑶族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3541, '45', '广西壮族自治区', '4513', '来宾市', '451301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3542, '45', '广西壮族自治区', '4513', '来宾市', '451302', '兴宾区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3543, '45', '广西壮族自治区', '4513', '来宾市', '451321', '忻城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3544, '45', '广西壮族自治区', '4513', '来宾市', '451322', '象州县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3545, '45', '广西壮族自治区', '4513', '来宾市', '451323', '武宣县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3546, '45', '广西壮族自治区', '4513', '来宾市', '451324', '金秀瑶族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3547, '45', '广西壮族自治区', '4513', '来宾市', '451381', '合山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3548, '45', '广西壮族自治区', '4514', '崇左市', '451401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3549, '45', '广西壮族自治区', '4514', '崇左市', '451402', '江州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3550, '45', '广西壮族自治区', '4514', '崇左市', '451421', '扶绥县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3551, '45', '广西壮族自治区', '4514', '崇左市', '451422', '宁明县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3552, '45', '广西壮族自治区', '4514', '崇左市', '451423', '龙州县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3553, '45', '广西壮族自治区', '4514', '崇左市', '451424', '大新县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3554, '45', '广西壮族自治区', '4514', '崇左市', '451425', '天等县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3555, '45', '广西壮族自治区', '4514', '崇左市', '451481', '凭祥市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3556, '46', '海南省', '4601', '海口市', '460101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3557, '46', '海南省', '4601', '海口市', '460105', '秀英区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3558, '46', '海南省', '4601', '海口市', '460106', '龙华区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3559, '46', '海南省', '4601', '海口市', '460107', '琼山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3560, '46', '海南省', '4601', '海口市', '460108', '美兰区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3561, '46', '海南省', '4602', '三亚市', '460201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3562, '46', '海南省', '4602', '三亚市', '460202', '海棠区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3563, '46', '海南省', '4602', '三亚市', '460203', '吉阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3564, '46', '海南省', '4602', '三亚市', '460204', '天涯区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3565, '46', '海南省', '4602', '三亚市', '460205', '崖州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3566, '46', '海南省', '4603', '三沙市', '460321', '西沙群岛', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3567, '46', '海南省', '4603', '三沙市', '460322', '南沙群岛', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3568, '46', '海南省', '4603', '三沙市', '460323', '中沙群岛的岛礁及其海域', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3569, '46', '海南省', '4604', '儋州市', '460400', '那大镇', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3570, '46', '海南省', '4690', '省直辖县级行政区划', '469001', '五指山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3571, '46', '海南省', '4690', '省直辖县级行政区划', '469002', '琼海市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3572, '46', '海南省', '4690', '省直辖县级行政区划', '469005', '文昌市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3573, '46', '海南省', '4690', '省直辖县级行政区划', '469006', '万宁市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3574, '46', '海南省', '4690', '省直辖县级行政区划', '469007', '东方市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3575, '46', '海南省', '4690', '省直辖县级行政区划', '469021', '定安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3576, '46', '海南省', '4690', '省直辖县级行政区划', '469022', '屯昌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3577, '46', '海南省', '4690', '省直辖县级行政区划', '469023', '澄迈县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3578, '46', '海南省', '4690', '省直辖县级行政区划', '469024', '临高县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3579, '46', '海南省', '4690', '省直辖县级行政区划', '469025', '白沙黎族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3580, '46', '海南省', '4690', '省直辖县级行政区划', '469026', '昌江黎族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3581, '46', '海南省', '4690', '省直辖县级行政区划', '469027', '乐东黎族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3582, '46', '海南省', '4690', '省直辖县级行政区划', '469028', '陵水黎族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3583, '46', '海南省', '4690', '省直辖县级行政区划', '469029', '保亭黎族苗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3584, '46', '海南省', '4690', '省直辖县级行政区划', '469030', '琼中黎族苗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3602, '50', '重庆市', '5001', '市辖区', '500101', '万州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3603, '50', '重庆市', '5001', '市辖区', '500102', '涪陵区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3604, '50', '重庆市', '5001', '市辖区', '500103', '渝中区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3605, '50', '重庆市', '5001', '市辖区', '500104', '大渡口区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3606, '50', '重庆市', '5001', '市辖区', '500105', '江北区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3607, '50', '重庆市', '5001', '市辖区', '500106', '沙坪坝区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3608, '50', '重庆市', '5001', '市辖区', '500107', '九龙坡区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3609, '50', '重庆市', '5001', '市辖区', '500108', '南岸区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3610, '50', '重庆市', '5001', '市辖区', '500109', '北碚区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3611, '50', '重庆市', '5001', '市辖区', '500110', '綦江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3612, '50', '重庆市', '5001', '市辖区', '500111', '大足区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3613, '50', '重庆市', '5001', '市辖区', '500112', '渝北区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3614, '50', '重庆市', '5001', '市辖区', '500113', '巴南区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3615, '50', '重庆市', '5001', '市辖区', '500114', '黔江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3616, '50', '重庆市', '5001', '市辖区', '500115', '长寿区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3617, '50', '重庆市', '5001', '市辖区', '500116', '江津区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3618, '50', '重庆市', '5001', '市辖区', '500117', '合川区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3619, '50', '重庆市', '5001', '市辖区', '500118', '永川区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3620, '50', '重庆市', '5001', '市辖区', '500119', '南川区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3621, '50', '重庆市', '5001', '市辖区', '500120', '璧山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3622, '50', '重庆市', '5001', '市辖区', '500151', '铜梁区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3623, '50', '重庆市', '5001', '市辖区', '500152', '潼南区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3624, '50', '重庆市', '5001', '市辖区', '500153', '荣昌区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3625, '50', '重庆市', '5001', '市辖区', '500154', '开州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3626, '50', '重庆市', '5001', '市辖区', '500155', '梁平区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3627, '50', '重庆市', '5001', '市辖区', '500156', '武隆区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3628, '50', '重庆市', '5002', '县', '500229', '城口县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3629, '50', '重庆市', '5002', '县', '500230', '丰都县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3630, '50', '重庆市', '5002', '县', '500231', '垫江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3631, '50', '重庆市', '5002', '县', '500233', '忠县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3632, '50', '重庆市', '5002', '县', '500235', '云阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3633, '50', '重庆市', '5002', '县', '500236', '奉节县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3634, '50', '重庆市', '5002', '县', '500237', '巫山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3635, '50', '重庆市', '5002', '县', '500238', '巫溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3636, '50', '重庆市', '5002', '县', '500240', '石柱土家族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3637, '50', '重庆市', '5002', '县', '500241', '秀山土家族苗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3638, '50', '重庆市', '5002', '县', '500242', '酉阳土家族苗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3639, '50', '重庆市', '5002', '县', '500243', '彭水苗族土家族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3640, '51', '四川省', '5101', '成都市', '510101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3641, '51', '四川省', '5101', '成都市', '510104', '锦江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3642, '51', '四川省', '5101', '成都市', '510105', '青羊区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3643, '51', '四川省', '5101', '成都市', '510106', '金牛区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3644, '51', '四川省', '5101', '成都市', '510107', '武侯区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3645, '51', '四川省', '5101', '成都市', '510108', '成华区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3646, '51', '四川省', '5101', '成都市', '510112', '龙泉驿区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3647, '51', '四川省', '5101', '成都市', '510113', '青白江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3648, '51', '四川省', '5101', '成都市', '510114', '新都区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3649, '51', '四川省', '5101', '成都市', '510115', '温江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3650, '51', '四川省', '5101', '成都市', '510116', '双流区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3651, '51', '四川省', '5101', '成都市', '510117', '郫都区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3652, '51', '四川省', '5101', '成都市', '510118', '新津区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3653, '51', '四川省', '5101', '成都市', '510121', '金堂县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3654, '51', '四川省', '5101', '成都市', '510129', '大邑县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3655, '51', '四川省', '5101', '成都市', '510131', '蒲江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3656, '51', '四川省', '5101', '成都市', '510181', '都江堰市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3657, '51', '四川省', '5101', '成都市', '510182', '彭州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3658, '51', '四川省', '5101', '成都市', '510183', '邛崃市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3659, '51', '四川省', '5101', '成都市', '510184', '崇州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3660, '51', '四川省', '5101', '成都市', '510185', '简阳市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3661, '51', '四川省', '5103', '自贡市', '510301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3662, '51', '四川省', '5103', '自贡市', '510302', '自流井区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3663, '51', '四川省', '5103', '自贡市', '510303', '贡井区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3664, '51', '四川省', '5103', '自贡市', '510304', '大安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3665, '51', '四川省', '5103', '自贡市', '510311', '沿滩区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3666, '51', '四川省', '5103', '自贡市', '510321', '荣县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3667, '51', '四川省', '5103', '自贡市', '510322', '富顺县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3668, '51', '四川省', '5104', '攀枝花市', '510401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3669, '51', '四川省', '5104', '攀枝花市', '510402', '东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3670, '51', '四川省', '5104', '攀枝花市', '510403', '西区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3671, '51', '四川省', '5104', '攀枝花市', '510411', '仁和区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3672, '51', '四川省', '5104', '攀枝花市', '510421', '米易县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3673, '51', '四川省', '5104', '攀枝花市', '510422', '盐边县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3674, '51', '四川省', '5105', '泸州市', '510501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3675, '51', '四川省', '5105', '泸州市', '510502', '江阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3676, '51', '四川省', '5105', '泸州市', '510503', '纳溪区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3677, '51', '四川省', '5105', '泸州市', '510504', '龙马潭区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3678, '51', '四川省', '5105', '泸州市', '510521', '泸县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3679, '51', '四川省', '5105', '泸州市', '510522', '合江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3680, '51', '四川省', '5105', '泸州市', '510524', '叙永县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3681, '51', '四川省', '5105', '泸州市', '510525', '古蔺县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3682, '51', '四川省', '5106', '德阳市', '510601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3683, '51', '四川省', '5106', '德阳市', '510603', '旌阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3684, '51', '四川省', '5106', '德阳市', '510604', '罗江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3685, '51', '四川省', '5106', '德阳市', '510623', '中江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3686, '51', '四川省', '5106', '德阳市', '510681', '广汉市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3687, '51', '四川省', '5106', '德阳市', '510682', '什邡市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3688, '51', '四川省', '5106', '德阳市', '510683', '绵竹市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3689, '51', '四川省', '5107', '绵阳市', '510701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3690, '51', '四川省', '5107', '绵阳市', '510703', '涪城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3691, '51', '四川省', '5107', '绵阳市', '510704', '游仙区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3692, '51', '四川省', '5107', '绵阳市', '510705', '安州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3693, '51', '四川省', '5107', '绵阳市', '510722', '三台县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3694, '51', '四川省', '5107', '绵阳市', '510723', '盐亭县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3695, '51', '四川省', '5107', '绵阳市', '510725', '梓潼县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3696, '51', '四川省', '5107', '绵阳市', '510726', '北川羌族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3697, '51', '四川省', '5107', '绵阳市', '510727', '平武县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3698, '51', '四川省', '5107', '绵阳市', '510781', '江油市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3699, '51', '四川省', '5108', '广元市', '510801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3700, '51', '四川省', '5108', '广元市', '510802', '利州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3701, '51', '四川省', '5108', '广元市', '510811', '昭化区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3702, '51', '四川省', '5108', '广元市', '510812', '朝天区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3703, '51', '四川省', '5108', '广元市', '510821', '旺苍县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3704, '51', '四川省', '5108', '广元市', '510822', '青川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3705, '51', '四川省', '5108', '广元市', '510823', '剑阁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3706, '51', '四川省', '5108', '广元市', '510824', '苍溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3707, '51', '四川省', '5109', '遂宁市', '510901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3708, '51', '四川省', '5109', '遂宁市', '510903', '船山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3709, '51', '四川省', '5109', '遂宁市', '510904', '安居区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3710, '51', '四川省', '5109', '遂宁市', '510921', '蓬溪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3711, '51', '四川省', '5109', '遂宁市', '510923', '大英县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3712, '51', '四川省', '5109', '遂宁市', '510981', '射洪市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3713, '51', '四川省', '5110', '内江市', '511001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3714, '51', '四川省', '5110', '内江市', '511002', '市中区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3715, '51', '四川省', '5110', '内江市', '511011', '东兴区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3716, '51', '四川省', '5110', '内江市', '511024', '威远县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3717, '51', '四川省', '5110', '内江市', '511025', '资中县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3718, '51', '四川省', '5110', '内江市', '511071', '内江经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3719, '51', '四川省', '5110', '内江市', '511083', '隆昌市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3720, '51', '四川省', '5111', '乐山市', '511101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3721, '51', '四川省', '5111', '乐山市', '511102', '市中区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3722, '51', '四川省', '5111', '乐山市', '511111', '沙湾区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3723, '51', '四川省', '5111', '乐山市', '511112', '五通桥区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3724, '51', '四川省', '5111', '乐山市', '511113', '金口河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3725, '51', '四川省', '5111', '乐山市', '511123', '犍为县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3726, '51', '四川省', '5111', '乐山市', '511124', '井研县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3727, '51', '四川省', '5111', '乐山市', '511126', '夹江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3728, '51', '四川省', '5111', '乐山市', '511129', '沐川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3729, '51', '四川省', '5111', '乐山市', '511132', '峨边彝族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3730, '51', '四川省', '5111', '乐山市', '511133', '马边彝族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3731, '51', '四川省', '5111', '乐山市', '511181', '峨眉山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3732, '51', '四川省', '5113', '南充市', '511301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3733, '51', '四川省', '5113', '南充市', '511302', '顺庆区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3734, '51', '四川省', '5113', '南充市', '511303', '高坪区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3735, '51', '四川省', '5113', '南充市', '511304', '嘉陵区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3736, '51', '四川省', '5113', '南充市', '511321', '南部县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3737, '51', '四川省', '5113', '南充市', '511322', '营山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3738, '51', '四川省', '5113', '南充市', '511323', '蓬安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3739, '51', '四川省', '5113', '南充市', '511324', '仪陇县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3740, '51', '四川省', '5113', '南充市', '511325', '西充县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3741, '51', '四川省', '5113', '南充市', '511381', '阆中市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3742, '51', '四川省', '5114', '眉山市', '511401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3743, '51', '四川省', '5114', '眉山市', '511402', '东坡区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3744, '51', '四川省', '5114', '眉山市', '511403', '彭山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3745, '51', '四川省', '5114', '眉山市', '511421', '仁寿县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3746, '51', '四川省', '5114', '眉山市', '511423', '洪雅县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3747, '51', '四川省', '5114', '眉山市', '511424', '丹棱县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3748, '51', '四川省', '5114', '眉山市', '511425', '青神县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3749, '51', '四川省', '5115', '宜宾市', '511501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3750, '51', '四川省', '5115', '宜宾市', '511502', '翠屏区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3751, '51', '四川省', '5115', '宜宾市', '511503', '南溪区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3752, '51', '四川省', '5115', '宜宾市', '511504', '叙州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3753, '51', '四川省', '5115', '宜宾市', '511523', '江安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3754, '51', '四川省', '5115', '宜宾市', '511524', '长宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3755, '51', '四川省', '5115', '宜宾市', '511525', '高县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3756, '51', '四川省', '5115', '宜宾市', '511526', '珙县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3757, '51', '四川省', '5115', '宜宾市', '511527', '筠连县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3758, '51', '四川省', '5115', '宜宾市', '511528', '兴文县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3759, '51', '四川省', '5115', '宜宾市', '511529', '屏山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3760, '51', '四川省', '5116', '广安市', '511601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3761, '51', '四川省', '5116', '广安市', '511602', '广安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3762, '51', '四川省', '5116', '广安市', '511603', '前锋区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3763, '51', '四川省', '5116', '广安市', '511621', '岳池县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3764, '51', '四川省', '5116', '广安市', '511622', '武胜县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3765, '51', '四川省', '5116', '广安市', '511623', '邻水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3766, '51', '四川省', '5116', '广安市', '511681', '华蓥市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3767, '51', '四川省', '5117', '达州市', '511701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3768, '51', '四川省', '5117', '达州市', '511702', '通川区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3769, '51', '四川省', '5117', '达州市', '511703', '达川区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3770, '51', '四川省', '5117', '达州市', '511722', '宣汉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3771, '51', '四川省', '5117', '达州市', '511723', '开江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3772, '51', '四川省', '5117', '达州市', '511724', '大竹县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3773, '51', '四川省', '5117', '达州市', '511725', '渠县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3774, '51', '四川省', '5117', '达州市', '511771', '达州经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3775, '51', '四川省', '5117', '达州市', '511781', '万源市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3776, '51', '四川省', '5118', '雅安市', '511801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3777, '51', '四川省', '5118', '雅安市', '511802', '雨城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3778, '51', '四川省', '5118', '雅安市', '511803', '名山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3779, '51', '四川省', '5118', '雅安市', '511822', '荥经县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3780, '51', '四川省', '5118', '雅安市', '511823', '汉源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3781, '51', '四川省', '5118', '雅安市', '511824', '石棉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3782, '51', '四川省', '5118', '雅安市', '511825', '天全县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3783, '51', '四川省', '5118', '雅安市', '511826', '芦山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3784, '51', '四川省', '5118', '雅安市', '511827', '宝兴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3785, '51', '四川省', '5119', '巴中市', '511901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3786, '51', '四川省', '5119', '巴中市', '511902', '巴州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3787, '51', '四川省', '5119', '巴中市', '511903', '恩阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3788, '51', '四川省', '5119', '巴中市', '511921', '通江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3789, '51', '四川省', '5119', '巴中市', '511922', '南江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3790, '51', '四川省', '5119', '巴中市', '511923', '平昌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3791, '51', '四川省', '5119', '巴中市', '511971', '巴中经济开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3792, '51', '四川省', '5120', '资阳市', '512001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3793, '51', '四川省', '5120', '资阳市', '512002', '雁江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3794, '51', '四川省', '5120', '资阳市', '512021', '安岳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3795, '51', '四川省', '5120', '资阳市', '512022', '乐至县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3796, '51', '四川省', '5132', '阿坝藏族羌族自治州', '513201', '马尔康市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3797, '51', '四川省', '5132', '阿坝藏族羌族自治州', '513221', '汶川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3798, '51', '四川省', '5132', '阿坝藏族羌族自治州', '513222', '理县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3799, '51', '四川省', '5132', '阿坝藏族羌族自治州', '513223', '茂县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3800, '51', '四川省', '5132', '阿坝藏族羌族自治州', '513224', '松潘县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3801, '51', '四川省', '5132', '阿坝藏族羌族自治州', '513225', '九寨沟县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3802, '51', '四川省', '5132', '阿坝藏族羌族自治州', '513226', '金川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3803, '51', '四川省', '5132', '阿坝藏族羌族自治州', '513227', '小金县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3804, '51', '四川省', '5132', '阿坝藏族羌族自治州', '513228', '黑水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3805, '51', '四川省', '5132', '阿坝藏族羌族自治州', '513230', '壤塘县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3806, '51', '四川省', '5132', '阿坝藏族羌族自治州', '513231', '阿坝县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3807, '51', '四川省', '5132', '阿坝藏族羌族自治州', '513232', '若尔盖县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3808, '51', '四川省', '5132', '阿坝藏族羌族自治州', '513233', '红原县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3809, '51', '四川省', '5133', '甘孜藏族自治州', '513301', '康定市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3810, '51', '四川省', '5133', '甘孜藏族自治州', '513322', '泸定县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3811, '51', '四川省', '5133', '甘孜藏族自治州', '513323', '丹巴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3812, '51', '四川省', '5133', '甘孜藏族自治州', '513324', '九龙县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3813, '51', '四川省', '5133', '甘孜藏族自治州', '513325', '雅江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3814, '51', '四川省', '5133', '甘孜藏族自治州', '513326', '道孚县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3815, '51', '四川省', '5133', '甘孜藏族自治州', '513327', '炉霍县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3816, '51', '四川省', '5133', '甘孜藏族自治州', '513328', '甘孜县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3817, '51', '四川省', '5133', '甘孜藏族自治州', '513329', '新龙县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3818, '51', '四川省', '5133', '甘孜藏族自治州', '513330', '德格县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3819, '51', '四川省', '5133', '甘孜藏族自治州', '513331', '白玉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3820, '51', '四川省', '5133', '甘孜藏族自治州', '513332', '石渠县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3821, '51', '四川省', '5133', '甘孜藏族自治州', '513333', '色达县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3822, '51', '四川省', '5133', '甘孜藏族自治州', '513334', '理塘县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3823, '51', '四川省', '5133', '甘孜藏族自治州', '513335', '巴塘县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3824, '51', '四川省', '5133', '甘孜藏族自治州', '513336', '乡城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3825, '51', '四川省', '5133', '甘孜藏族自治州', '513337', '稻城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3826, '51', '四川省', '5133', '甘孜藏族自治州', '513338', '得荣县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3827, '51', '四川省', '5134', '凉山彝族自治州', '513401', '西昌市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3828, '51', '四川省', '5134', '凉山彝族自治州', '513422', '木里藏族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3829, '51', '四川省', '5134', '凉山彝族自治州', '513423', '盐源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3830, '51', '四川省', '5134', '凉山彝族自治州', '513424', '德昌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3831, '51', '四川省', '5134', '凉山彝族自治州', '513425', '会理县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3832, '51', '四川省', '5134', '凉山彝族自治州', '513426', '会东县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3833, '51', '四川省', '5134', '凉山彝族自治州', '513427', '宁南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3834, '51', '四川省', '5134', '凉山彝族自治州', '513428', '普格县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3835, '51', '四川省', '5134', '凉山彝族自治州', '513429', '布拖县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3836, '51', '四川省', '5134', '凉山彝族自治州', '513430', '金阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3837, '51', '四川省', '5134', '凉山彝族自治州', '513431', '昭觉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3838, '51', '四川省', '5134', '凉山彝族自治州', '513432', '喜德县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3839, '51', '四川省', '5134', '凉山彝族自治州', '513433', '冕宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3840, '51', '四川省', '5134', '凉山彝族自治州', '513434', '越西县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3841, '51', '四川省', '5134', '凉山彝族自治州', '513435', '甘洛县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3842, '51', '四川省', '5134', '凉山彝族自治州', '513436', '美姑县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3843, '51', '四川省', '5134', '凉山彝族自治州', '513437', '雷波县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3844, '52', '贵州省', '5201', '贵阳市', '520101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3845, '52', '贵州省', '5201', '贵阳市', '520102', '南明区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3846, '52', '贵州省', '5201', '贵阳市', '520103', '云岩区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3847, '52', '贵州省', '5201', '贵阳市', '520111', '花溪区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3848, '52', '贵州省', '5201', '贵阳市', '520112', '乌当区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3849, '52', '贵州省', '5201', '贵阳市', '520113', '白云区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3850, '52', '贵州省', '5201', '贵阳市', '520115', '观山湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3851, '52', '贵州省', '5201', '贵阳市', '520121', '开阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3852, '52', '贵州省', '5201', '贵阳市', '520122', '息烽县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3853, '52', '贵州省', '5201', '贵阳市', '520123', '修文县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3854, '52', '贵州省', '5201', '贵阳市', '520181', '清镇市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3855, '52', '贵州省', '5202', '六盘水市', '520201', '钟山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3856, '52', '贵州省', '5202', '六盘水市', '520203', '六枝特区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3857, '52', '贵州省', '5202', '六盘水市', '520221', '水城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3858, '52', '贵州省', '5202', '六盘水市', '520281', '盘州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3859, '52', '贵州省', '5203', '遵义市', '520301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3860, '52', '贵州省', '5203', '遵义市', '520302', '红花岗区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3861, '52', '贵州省', '5203', '遵义市', '520303', '汇川区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3862, '52', '贵州省', '5203', '遵义市', '520304', '播州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3863, '52', '贵州省', '5203', '遵义市', '520322', '桐梓县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3864, '52', '贵州省', '5203', '遵义市', '520323', '绥阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3865, '52', '贵州省', '5203', '遵义市', '520324', '正安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3866, '52', '贵州省', '5203', '遵义市', '520325', '道真仡佬族苗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3867, '52', '贵州省', '5203', '遵义市', '520326', '务川仡佬族苗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3868, '52', '贵州省', '5203', '遵义市', '520327', '凤冈县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3869, '52', '贵州省', '5203', '遵义市', '520328', '湄潭县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3870, '52', '贵州省', '5203', '遵义市', '520329', '余庆县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3871, '52', '贵州省', '5203', '遵义市', '520330', '习水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3872, '52', '贵州省', '5203', '遵义市', '520381', '赤水市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3873, '52', '贵州省', '5203', '遵义市', '520382', '仁怀市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3874, '52', '贵州省', '5204', '安顺市', '520401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3875, '52', '贵州省', '5204', '安顺市', '520402', '西秀区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3876, '52', '贵州省', '5204', '安顺市', '520403', '平坝区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3877, '52', '贵州省', '5204', '安顺市', '520422', '普定县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3878, '52', '贵州省', '5204', '安顺市', '520423', '镇宁布依族苗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3879, '52', '贵州省', '5204', '安顺市', '520424', '关岭布依族苗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3880, '52', '贵州省', '5204', '安顺市', '520425', '紫云苗族布依族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3881, '52', '贵州省', '5205', '毕节市', '520501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3882, '52', '贵州省', '5205', '毕节市', '520502', '七星关区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3883, '52', '贵州省', '5205', '毕节市', '520521', '大方县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3884, '52', '贵州省', '5205', '毕节市', '520522', '黔西县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3885, '52', '贵州省', '5205', '毕节市', '520523', '金沙县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3886, '52', '贵州省', '5205', '毕节市', '520524', '织金县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3887, '52', '贵州省', '5205', '毕节市', '520525', '纳雍县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3888, '52', '贵州省', '5205', '毕节市', '520526', '威宁彝族回族苗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3889, '52', '贵州省', '5205', '毕节市', '520527', '赫章县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3890, '52', '贵州省', '5206', '铜仁市', '520601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3891, '52', '贵州省', '5206', '铜仁市', '520602', '碧江区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3892, '52', '贵州省', '5206', '铜仁市', '520603', '万山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3893, '52', '贵州省', '5206', '铜仁市', '520621', '江口县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3894, '52', '贵州省', '5206', '铜仁市', '520622', '玉屏侗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3895, '52', '贵州省', '5206', '铜仁市', '520623', '石阡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3896, '52', '贵州省', '5206', '铜仁市', '520624', '思南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3897, '52', '贵州省', '5206', '铜仁市', '520625', '印江土家族苗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3898, '52', '贵州省', '5206', '铜仁市', '520626', '德江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3899, '52', '贵州省', '5206', '铜仁市', '520627', '沿河土家族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3900, '52', '贵州省', '5206', '铜仁市', '520628', '松桃苗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3901, '52', '贵州省', '5223', '黔西南布依族苗族自治州', '522301', '兴义市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3902, '52', '贵州省', '5223', '黔西南布依族苗族自治州', '522302', '兴仁市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3903, '52', '贵州省', '5223', '黔西南布依族苗族自治州', '522323', '普安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3904, '52', '贵州省', '5223', '黔西南布依族苗族自治州', '522324', '晴隆县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3905, '52', '贵州省', '5223', '黔西南布依族苗族自治州', '522325', '贞丰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3906, '52', '贵州省', '5223', '黔西南布依族苗族自治州', '522326', '望谟县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3907, '52', '贵州省', '5223', '黔西南布依族苗族自治州', '522327', '册亨县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3908, '52', '贵州省', '5223', '黔西南布依族苗族自治州', '522328', '安龙县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3909, '52', '贵州省', '5226', '黔东南苗族侗族自治州', '522601', '凯里市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3910, '52', '贵州省', '5226', '黔东南苗族侗族自治州', '522622', '黄平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3911, '52', '贵州省', '5226', '黔东南苗族侗族自治州', '522623', '施秉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3912, '52', '贵州省', '5226', '黔东南苗族侗族自治州', '522624', '三穗县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3913, '52', '贵州省', '5226', '黔东南苗族侗族自治州', '522625', '镇远县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3914, '52', '贵州省', '5226', '黔东南苗族侗族自治州', '522626', '岑巩县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3915, '52', '贵州省', '5226', '黔东南苗族侗族自治州', '522627', '天柱县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3916, '52', '贵州省', '5226', '黔东南苗族侗族自治州', '522628', '锦屏县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3917, '52', '贵州省', '5226', '黔东南苗族侗族自治州', '522629', '剑河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3918, '52', '贵州省', '5226', '黔东南苗族侗族自治州', '522630', '台江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3919, '52', '贵州省', '5226', '黔东南苗族侗族自治州', '522631', '黎平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3920, '52', '贵州省', '5226', '黔东南苗族侗族自治州', '522632', '榕江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3921, '52', '贵州省', '5226', '黔东南苗族侗族自治州', '522633', '从江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3922, '52', '贵州省', '5226', '黔东南苗族侗族自治州', '522634', '雷山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3923, '52', '贵州省', '5226', '黔东南苗族侗族自治州', '522635', '麻江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3924, '52', '贵州省', '5226', '黔东南苗族侗族自治州', '522636', '丹寨县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3925, '52', '贵州省', '5227', '黔南布依族苗族自治州', '522701', '都匀市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3926, '52', '贵州省', '5227', '黔南布依族苗族自治州', '522702', '福泉市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3927, '52', '贵州省', '5227', '黔南布依族苗族自治州', '522722', '荔波县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3928, '52', '贵州省', '5227', '黔南布依族苗族自治州', '522723', '贵定县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3929, '52', '贵州省', '5227', '黔南布依族苗族自治州', '522725', '瓮安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3930, '52', '贵州省', '5227', '黔南布依族苗族自治州', '522726', '独山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3931, '52', '贵州省', '5227', '黔南布依族苗族自治州', '522727', '平塘县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3932, '52', '贵州省', '5227', '黔南布依族苗族自治州', '522728', '罗甸县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3933, '52', '贵州省', '5227', '黔南布依族苗族自治州', '522729', '长顺县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3934, '52', '贵州省', '5227', '黔南布依族苗族自治州', '522730', '龙里县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3935, '52', '贵州省', '5227', '黔南布依族苗族自治州', '522731', '惠水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3936, '52', '贵州省', '5227', '黔南布依族苗族自治州', '522732', '三都水族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3937, '53', '云南省', '5301', '昆明市', '530101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3938, '53', '云南省', '5301', '昆明市', '530102', '五华区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3939, '53', '云南省', '5301', '昆明市', '530103', '盘龙区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3940, '53', '云南省', '5301', '昆明市', '530111', '官渡区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3941, '53', '云南省', '5301', '昆明市', '530112', '西山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3942, '53', '云南省', '5301', '昆明市', '530113', '东川区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3943, '53', '云南省', '5301', '昆明市', '530114', '呈贡区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3944, '53', '云南省', '5301', '昆明市', '530115', '晋宁区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3945, '53', '云南省', '5301', '昆明市', '530124', '富民县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3946, '53', '云南省', '5301', '昆明市', '530125', '宜良县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3947, '53', '云南省', '5301', '昆明市', '530126', '石林彝族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3948, '53', '云南省', '5301', '昆明市', '530127', '嵩明县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3949, '53', '云南省', '5301', '昆明市', '530128', '禄劝彝族苗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3950, '53', '云南省', '5301', '昆明市', '530129', '寻甸回族彝族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3951, '53', '云南省', '5301', '昆明市', '530181', '安宁市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3952, '53', '云南省', '5303', '曲靖市', '530301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3953, '53', '云南省', '5303', '曲靖市', '530302', '麒麟区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3954, '53', '云南省', '5303', '曲靖市', '530303', '沾益区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3955, '53', '云南省', '5303', '曲靖市', '530304', '马龙区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3956, '53', '云南省', '5303', '曲靖市', '530322', '陆良县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3957, '53', '云南省', '5303', '曲靖市', '530323', '师宗县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3958, '53', '云南省', '5303', '曲靖市', '530324', '罗平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3959, '53', '云南省', '5303', '曲靖市', '530325', '富源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3960, '53', '云南省', '5303', '曲靖市', '530326', '会泽县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3961, '53', '云南省', '5303', '曲靖市', '530381', '宣威市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3962, '53', '云南省', '5304', '玉溪市', '530401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3963, '53', '云南省', '5304', '玉溪市', '530402', '红塔区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3964, '53', '云南省', '5304', '玉溪市', '530403', '江川区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3965, '53', '云南省', '5304', '玉溪市', '530423', '通海县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3966, '53', '云南省', '5304', '玉溪市', '530424', '华宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3967, '53', '云南省', '5304', '玉溪市', '530425', '易门县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3968, '53', '云南省', '5304', '玉溪市', '530426', '峨山彝族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3969, '53', '云南省', '5304', '玉溪市', '530427', '新平彝族傣族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3970, '53', '云南省', '5304', '玉溪市', '530428', '元江哈尼族彝族傣族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3971, '53', '云南省', '5304', '玉溪市', '530481', '澄江市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3972, '53', '云南省', '5305', '保山市', '530501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3973, '53', '云南省', '5305', '保山市', '530502', '隆阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3974, '53', '云南省', '5305', '保山市', '530521', '施甸县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3975, '53', '云南省', '5305', '保山市', '530523', '龙陵县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3976, '53', '云南省', '5305', '保山市', '530524', '昌宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3977, '53', '云南省', '5305', '保山市', '530581', '腾冲市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3978, '53', '云南省', '5306', '昭通市', '530601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3979, '53', '云南省', '5306', '昭通市', '530602', '昭阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3980, '53', '云南省', '5306', '昭通市', '530621', '鲁甸县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3981, '53', '云南省', '5306', '昭通市', '530622', '巧家县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3982, '53', '云南省', '5306', '昭通市', '530623', '盐津县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3983, '53', '云南省', '5306', '昭通市', '530624', '大关县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3984, '53', '云南省', '5306', '昭通市', '530625', '永善县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3985, '53', '云南省', '5306', '昭通市', '530626', '绥江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3986, '53', '云南省', '5306', '昭通市', '530627', '镇雄县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3987, '53', '云南省', '5306', '昭通市', '530628', '彝良县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3988, '53', '云南省', '5306', '昭通市', '530629', '威信县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3989, '53', '云南省', '5306', '昭通市', '530681', '水富市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3990, '53', '云南省', '5307', '丽江市', '530701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3991, '53', '云南省', '5307', '丽江市', '530702', '古城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3992, '53', '云南省', '5307', '丽江市', '530721', '玉龙纳西族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3993, '53', '云南省', '5307', '丽江市', '530722', '永胜县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3994, '53', '云南省', '5307', '丽江市', '530723', '华坪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3995, '53', '云南省', '5307', '丽江市', '530724', '宁蒗彝族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3996, '53', '云南省', '5308', '普洱市', '530801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3997, '53', '云南省', '5308', '普洱市', '530802', '思茅区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3998, '53', '云南省', '5308', '普洱市', '530821', '宁洱哈尼族彝族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (3999, '53', '云南省', '5308', '普洱市', '530822', '墨江哈尼族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4000, '53', '云南省', '5308', '普洱市', '530823', '景东彝族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4001, '53', '云南省', '5308', '普洱市', '530824', '景谷傣族彝族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4002, '53', '云南省', '5308', '普洱市', '530825', '镇沅彝族哈尼族拉祜族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4003, '53', '云南省', '5308', '普洱市', '530826', '江城哈尼族彝族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4004, '53', '云南省', '5308', '普洱市', '530827', '孟连傣族拉祜族佤族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4005, '53', '云南省', '5308', '普洱市', '530828', '澜沧拉祜族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4006, '53', '云南省', '5308', '普洱市', '530829', '西盟佤族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4007, '53', '云南省', '5309', '临沧市', '530901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4008, '53', '云南省', '5309', '临沧市', '530902', '临翔区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4009, '53', '云南省', '5309', '临沧市', '530921', '凤庆县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4010, '53', '云南省', '5309', '临沧市', '530922', '云县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4011, '53', '云南省', '5309', '临沧市', '530923', '永德县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4012, '53', '云南省', '5309', '临沧市', '530924', '镇康县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4013, '53', '云南省', '5309', '临沧市', '530925', '双江拉祜族佤族布朗族傣族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4014, '53', '云南省', '5309', '临沧市', '530926', '耿马傣族佤族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4015, '53', '云南省', '5309', '临沧市', '530927', '沧源佤族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4016, '53', '云南省', '5323', '楚雄彝族自治州', '532301', '楚雄市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4017, '53', '云南省', '5323', '楚雄彝族自治州', '532322', '双柏县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4018, '53', '云南省', '5323', '楚雄彝族自治州', '532323', '牟定县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4019, '53', '云南省', '5323', '楚雄彝族自治州', '532324', '南华县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4020, '53', '云南省', '5323', '楚雄彝族自治州', '532325', '姚安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4021, '53', '云南省', '5323', '楚雄彝族自治州', '532326', '大姚县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4022, '53', '云南省', '5323', '楚雄彝族自治州', '532327', '永仁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4023, '53', '云南省', '5323', '楚雄彝族自治州', '532328', '元谋县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4024, '53', '云南省', '5323', '楚雄彝族自治州', '532329', '武定县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4025, '53', '云南省', '5323', '楚雄彝族自治州', '532331', '禄丰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4026, '53', '云南省', '5325', '红河哈尼族彝族自治州', '532501', '个旧市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4027, '53', '云南省', '5325', '红河哈尼族彝族自治州', '532502', '开远市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4028, '53', '云南省', '5325', '红河哈尼族彝族自治州', '532503', '蒙自市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4029, '53', '云南省', '5325', '红河哈尼族彝族自治州', '532504', '弥勒市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4030, '53', '云南省', '5325', '红河哈尼族彝族自治州', '532523', '屏边苗族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4031, '53', '云南省', '5325', '红河哈尼族彝族自治州', '532524', '建水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4032, '53', '云南省', '5325', '红河哈尼族彝族自治州', '532525', '石屏县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4033, '53', '云南省', '5325', '红河哈尼族彝族自治州', '532527', '泸西县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4034, '53', '云南省', '5325', '红河哈尼族彝族自治州', '532528', '元阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4035, '53', '云南省', '5325', '红河哈尼族彝族自治州', '532529', '红河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4036, '53', '云南省', '5325', '红河哈尼族彝族自治州', '532530', '金平苗族瑶族傣族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4037, '53', '云南省', '5325', '红河哈尼族彝族自治州', '532531', '绿春县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4038, '53', '云南省', '5325', '红河哈尼族彝族自治州', '532532', '河口瑶族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4039, '53', '云南省', '5326', '文山壮族苗族自治州', '532601', '文山市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4040, '53', '云南省', '5326', '文山壮族苗族自治州', '532622', '砚山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4041, '53', '云南省', '5326', '文山壮族苗族自治州', '532623', '西畴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4042, '53', '云南省', '5326', '文山壮族苗族自治州', '532624', '麻栗坡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4043, '53', '云南省', '5326', '文山壮族苗族自治州', '532625', '马关县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4044, '53', '云南省', '5326', '文山壮族苗族自治州', '532626', '丘北县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4045, '53', '云南省', '5326', '文山壮族苗族自治州', '532627', '广南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4046, '53', '云南省', '5326', '文山壮族苗族自治州', '532628', '富宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4047, '53', '云南省', '5328', '西双版纳傣族自治州', '532801', '景洪市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4048, '53', '云南省', '5328', '西双版纳傣族自治州', '532822', '勐海县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4049, '53', '云南省', '5328', '西双版纳傣族自治州', '532823', '勐腊县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4050, '53', '云南省', '5329', '大理白族自治州', '532901', '大理市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4051, '53', '云南省', '5329', '大理白族自治州', '532922', '漾濞彝族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4052, '53', '云南省', '5329', '大理白族自治州', '532923', '祥云县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4053, '53', '云南省', '5329', '大理白族自治州', '532924', '宾川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4054, '53', '云南省', '5329', '大理白族自治州', '532925', '弥渡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4055, '53', '云南省', '5329', '大理白族自治州', '532926', '南涧彝族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4056, '53', '云南省', '5329', '大理白族自治州', '532927', '巍山彝族回族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4057, '53', '云南省', '5329', '大理白族自治州', '532928', '永平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4058, '53', '云南省', '5329', '大理白族自治州', '532929', '云龙县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4059, '53', '云南省', '5329', '大理白族自治州', '532930', '洱源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4060, '53', '云南省', '5329', '大理白族自治州', '532931', '剑川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4061, '53', '云南省', '5329', '大理白族自治州', '532932', '鹤庆县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4062, '53', '云南省', '5331', '德宏傣族景颇族自治州', '533102', '瑞丽市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4063, '53', '云南省', '5331', '德宏傣族景颇族自治州', '533103', '芒市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4064, '53', '云南省', '5331', '德宏傣族景颇族自治州', '533122', '梁河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4065, '53', '云南省', '5331', '德宏傣族景颇族自治州', '533123', '盈江县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4066, '53', '云南省', '5331', '德宏傣族景颇族自治州', '533124', '陇川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4067, '53', '云南省', '5333', '怒江傈僳族自治州', '533301', '泸水市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4068, '53', '云南省', '5333', '怒江傈僳族自治州', '533323', '福贡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4069, '53', '云南省', '5333', '怒江傈僳族自治州', '533324', '贡山独龙族怒族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4070, '53', '云南省', '5333', '怒江傈僳族自治州', '533325', '兰坪白族普米族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4071, '53', '云南省', '5334', '迪庆藏族自治州', '533401', '香格里拉市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4072, '53', '云南省', '5334', '迪庆藏族自治州', '533422', '德钦县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4073, '53', '云南省', '5334', '迪庆藏族自治州', '533423', '维西傈僳族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4074, '54', '西藏自治区', '5401', '拉萨市', '540101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4075, '54', '西藏自治区', '5401', '拉萨市', '540102', '城关区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4076, '54', '西藏自治区', '5401', '拉萨市', '540103', '堆龙德庆区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4077, '54', '西藏自治区', '5401', '拉萨市', '540104', '达孜区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4078, '54', '西藏自治区', '5401', '拉萨市', '540121', '林周县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4079, '54', '西藏自治区', '5401', '拉萨市', '540122', '当雄县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4080, '54', '西藏自治区', '5401', '拉萨市', '540123', '尼木县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4081, '54', '西藏自治区', '5401', '拉萨市', '540124', '曲水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4082, '54', '西藏自治区', '5401', '拉萨市', '540127', '墨竹工卡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4083, '54', '西藏自治区', '5401', '拉萨市', '540171', '格尔木藏青工业园区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4084, '54', '西藏自治区', '5401', '拉萨市', '540172', '拉萨经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4085, '54', '西藏自治区', '5401', '拉萨市', '540173', '西藏文化旅游创意园区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4086, '54', '西藏自治区', '5401', '拉萨市', '540174', '达孜工业园区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4087, '54', '西藏自治区', '5402', '日喀则市', '540202', '桑珠孜区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4088, '54', '西藏自治区', '5402', '日喀则市', '540221', '南木林县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4089, '54', '西藏自治区', '5402', '日喀则市', '540222', '江孜县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4090, '54', '西藏自治区', '5402', '日喀则市', '540223', '定日县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4091, '54', '西藏自治区', '5402', '日喀则市', '540224', '萨迦县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4092, '54', '西藏自治区', '5402', '日喀则市', '540225', '拉孜县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4093, '54', '西藏自治区', '5402', '日喀则市', '540226', '昂仁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4094, '54', '西藏自治区', '5402', '日喀则市', '540227', '谢通门县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4095, '54', '西藏自治区', '5402', '日喀则市', '540228', '白朗县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4096, '54', '西藏自治区', '5402', '日喀则市', '540229', '仁布县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4097, '54', '西藏自治区', '5402', '日喀则市', '540230', '康马县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4098, '54', '西藏自治区', '5402', '日喀则市', '540231', '定结县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4099, '54', '西藏自治区', '5402', '日喀则市', '540232', '仲巴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4100, '54', '西藏自治区', '5402', '日喀则市', '540233', '亚东县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4101, '54', '西藏自治区', '5402', '日喀则市', '540234', '吉隆县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4102, '54', '西藏自治区', '5402', '日喀则市', '540235', '聂拉木县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4103, '54', '西藏自治区', '5402', '日喀则市', '540236', '萨嘎县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4104, '54', '西藏自治区', '5402', '日喀则市', '540237', '岗巴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4105, '54', '西藏自治区', '5403', '昌都市', '540302', '卡若区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4106, '54', '西藏自治区', '5403', '昌都市', '540321', '江达县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4107, '54', '西藏自治区', '5403', '昌都市', '540322', '贡觉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4108, '54', '西藏自治区', '5403', '昌都市', '540323', '类乌齐县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4109, '54', '西藏自治区', '5403', '昌都市', '540324', '丁青县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4110, '54', '西藏自治区', '5403', '昌都市', '540325', '察雅县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4111, '54', '西藏自治区', '5403', '昌都市', '540326', '八宿县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4112, '54', '西藏自治区', '5403', '昌都市', '540327', '左贡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4113, '54', '西藏自治区', '5403', '昌都市', '540328', '芒康县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4114, '54', '西藏自治区', '5403', '昌都市', '540329', '洛隆县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4115, '54', '西藏自治区', '5403', '昌都市', '540330', '边坝县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4116, '54', '西藏自治区', '5404', '林芝市', '540402', '巴宜区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4117, '54', '西藏自治区', '5404', '林芝市', '540421', '工布江达县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4118, '54', '西藏自治区', '5404', '林芝市', '540422', '米林县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4119, '54', '西藏自治区', '5404', '林芝市', '540423', '墨脱县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4120, '54', '西藏自治区', '5404', '林芝市', '540424', '波密县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4121, '54', '西藏自治区', '5404', '林芝市', '540425', '察隅县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4122, '54', '西藏自治区', '5404', '林芝市', '540426', '朗县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4123, '54', '西藏自治区', '5405', '山南市', '540501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4124, '54', '西藏自治区', '5405', '山南市', '540502', '乃东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4125, '54', '西藏自治区', '5405', '山南市', '540521', '扎囊县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4126, '54', '西藏自治区', '5405', '山南市', '540522', '贡嘎县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4127, '54', '西藏自治区', '5405', '山南市', '540523', '桑日县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4128, '54', '西藏自治区', '5405', '山南市', '540524', '琼结县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4129, '54', '西藏自治区', '5405', '山南市', '540525', '曲松县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4130, '54', '西藏自治区', '5405', '山南市', '540526', '措美县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4131, '54', '西藏自治区', '5405', '山南市', '540527', '洛扎县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4132, '54', '西藏自治区', '5405', '山南市', '540528', '加查县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4133, '54', '西藏自治区', '5405', '山南市', '540529', '隆子县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4134, '54', '西藏自治区', '5405', '山南市', '540530', '错那县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4135, '54', '西藏自治区', '5405', '山南市', '540531', '浪卡子县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4136, '54', '西藏自治区', '5406', '那曲市', '540602', '色尼区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4137, '54', '西藏自治区', '5406', '那曲市', '540621', '嘉黎县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4138, '54', '西藏自治区', '5406', '那曲市', '540622', '比如县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4139, '54', '西藏自治区', '5406', '那曲市', '540623', '聂荣县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4140, '54', '西藏自治区', '5406', '那曲市', '540624', '安多县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4141, '54', '西藏自治区', '5406', '那曲市', '540625', '申扎县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4142, '54', '西藏自治区', '5406', '那曲市', '540626', '索县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4143, '54', '西藏自治区', '5406', '那曲市', '540627', '班戈县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4144, '54', '西藏自治区', '5406', '那曲市', '540628', '巴青县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4145, '54', '西藏自治区', '5406', '那曲市', '540629', '尼玛县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4146, '54', '西藏自治区', '5406', '那曲市', '540630', '双湖县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4147, '54', '西藏自治区', '5425', '阿里地区', '542521', '普兰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4148, '54', '西藏自治区', '5425', '阿里地区', '542522', '札达县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4149, '54', '西藏自治区', '5425', '阿里地区', '542523', '噶尔县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4150, '54', '西藏自治区', '5425', '阿里地区', '542524', '日土县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4151, '54', '西藏自治区', '5425', '阿里地区', '542525', '革吉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4152, '54', '西藏自治区', '5425', '阿里地区', '542526', '改则县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4153, '54', '西藏自治区', '5425', '阿里地区', '542527', '措勤县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4154, '61', '陕西省', '6101', '西安市', '610101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4155, '61', '陕西省', '6101', '西安市', '610102', '新城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4156, '61', '陕西省', '6101', '西安市', '610103', '碑林区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4157, '61', '陕西省', '6101', '西安市', '610104', '莲湖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4158, '61', '陕西省', '6101', '西安市', '610111', '灞桥区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4159, '61', '陕西省', '6101', '西安市', '610112', '未央区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4160, '61', '陕西省', '6101', '西安市', '610113', '雁塔区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4161, '61', '陕西省', '6101', '西安市', '610114', '阎良区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4162, '61', '陕西省', '6101', '西安市', '610115', '临潼区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4163, '61', '陕西省', '6101', '西安市', '610116', '长安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4164, '61', '陕西省', '6101', '西安市', '610117', '高陵区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4165, '61', '陕西省', '6101', '西安市', '610118', '�邑区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4166, '61', '陕西省', '6101', '西安市', '610122', '蓝田县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4167, '61', '陕西省', '6101', '西安市', '610124', '周至县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4168, '61', '陕西省', '6102', '铜川市', '610201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4169, '61', '陕西省', '6102', '铜川市', '610202', '王益区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4170, '61', '陕西省', '6102', '铜川市', '610203', '印台区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4171, '61', '陕西省', '6102', '铜川市', '610204', '耀州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4172, '61', '陕西省', '6102', '铜川市', '610222', '宜君县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4173, '61', '陕西省', '6103', '宝鸡市', '610301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4174, '61', '陕西省', '6103', '宝鸡市', '610302', '渭滨区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4175, '61', '陕西省', '6103', '宝鸡市', '610303', '金台区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4176, '61', '陕西省', '6103', '宝鸡市', '610304', '陈仓区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4177, '61', '陕西省', '6103', '宝鸡市', '610322', '凤翔县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4178, '61', '陕西省', '6103', '宝鸡市', '610323', '岐山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4179, '61', '陕西省', '6103', '宝鸡市', '610324', '扶风县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4180, '61', '陕西省', '6103', '宝鸡市', '610326', '眉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4181, '61', '陕西省', '6103', '宝鸡市', '610327', '陇县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4182, '61', '陕西省', '6103', '宝鸡市', '610328', '千阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4183, '61', '陕西省', '6103', '宝鸡市', '610329', '麟游县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4184, '61', '陕西省', '6103', '宝鸡市', '610330', '凤县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4185, '61', '陕西省', '6103', '宝鸡市', '610331', '太白县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4186, '61', '陕西省', '6104', '咸阳市', '610401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4187, '61', '陕西省', '6104', '咸阳市', '610402', '秦都区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4188, '61', '陕西省', '6104', '咸阳市', '610403', '杨陵区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4189, '61', '陕西省', '6104', '咸阳市', '610404', '渭城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4190, '61', '陕西省', '6104', '咸阳市', '610422', '三原县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4191, '61', '陕西省', '6104', '咸阳市', '610423', '泾阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4192, '61', '陕西省', '6104', '咸阳市', '610424', '乾县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4193, '61', '陕西省', '6104', '咸阳市', '610425', '礼泉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4194, '61', '陕西省', '6104', '咸阳市', '610426', '永寿县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4195, '61', '陕西省', '6104', '咸阳市', '610428', '长武县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4196, '61', '陕西省', '6104', '咸阳市', '610429', '旬邑县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4197, '61', '陕西省', '6104', '咸阳市', '610430', '淳化县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4198, '61', '陕西省', '6104', '咸阳市', '610431', '武功县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4199, '61', '陕西省', '6104', '咸阳市', '610481', '兴平市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4200, '61', '陕西省', '6104', '咸阳市', '610482', '彬州市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4201, '61', '陕西省', '6105', '渭南市', '610501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4202, '61', '陕西省', '6105', '渭南市', '610502', '临渭区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4203, '61', '陕西省', '6105', '渭南市', '610503', '华州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4204, '61', '陕西省', '6105', '渭南市', '610522', '潼关县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4205, '61', '陕西省', '6105', '渭南市', '610523', '大荔县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4206, '61', '陕西省', '6105', '渭南市', '610524', '合阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4207, '61', '陕西省', '6105', '渭南市', '610525', '澄城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4208, '61', '陕西省', '6105', '渭南市', '610526', '蒲城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4209, '61', '陕西省', '6105', '渭南市', '610527', '白水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4210, '61', '陕西省', '6105', '渭南市', '610528', '富平县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4211, '61', '陕西省', '6105', '渭南市', '610581', '韩城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4212, '61', '陕西省', '6105', '渭南市', '610582', '华阴市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4213, '61', '陕西省', '6106', '延安市', '610601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4214, '61', '陕西省', '6106', '延安市', '610602', '宝塔区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4215, '61', '陕西省', '6106', '延安市', '610603', '安塞区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4216, '61', '陕西省', '6106', '延安市', '610621', '延长县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4217, '61', '陕西省', '6106', '延安市', '610622', '延川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4218, '61', '陕西省', '6106', '延安市', '610625', '志丹县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4219, '61', '陕西省', '6106', '延安市', '610626', '吴起县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4220, '61', '陕西省', '6106', '延安市', '610627', '甘泉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4221, '61', '陕西省', '6106', '延安市', '610628', '富县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4222, '61', '陕西省', '6106', '延安市', '610629', '洛川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4223, '61', '陕西省', '6106', '延安市', '610630', '宜川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4224, '61', '陕西省', '6106', '延安市', '610631', '黄龙县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4225, '61', '陕西省', '6106', '延安市', '610632', '黄陵县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4226, '61', '陕西省', '6106', '延安市', '610681', '子长市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4227, '61', '陕西省', '6107', '汉中市', '610701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4228, '61', '陕西省', '6107', '汉中市', '610702', '汉台区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4229, '61', '陕西省', '6107', '汉中市', '610703', '南郑区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4230, '61', '陕西省', '6107', '汉中市', '610722', '城固县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4231, '61', '陕西省', '6107', '汉中市', '610723', '洋县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4232, '61', '陕西省', '6107', '汉中市', '610724', '西乡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4233, '61', '陕西省', '6107', '汉中市', '610725', '勉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4234, '61', '陕西省', '6107', '汉中市', '610726', '宁强县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4235, '61', '陕西省', '6107', '汉中市', '610727', '略阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4236, '61', '陕西省', '6107', '汉中市', '610728', '镇巴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4237, '61', '陕西省', '6107', '汉中市', '610729', '留坝县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4238, '61', '陕西省', '6107', '汉中市', '610730', '佛坪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4239, '61', '陕西省', '6108', '榆林市', '610801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4240, '61', '陕西省', '6108', '榆林市', '610802', '榆阳区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4241, '61', '陕西省', '6108', '榆林市', '610803', '横山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4242, '61', '陕西省', '6108', '榆林市', '610822', '府谷县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4243, '61', '陕西省', '6108', '榆林市', '610824', '靖边县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4244, '61', '陕西省', '6108', '榆林市', '610825', '定边县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4245, '61', '陕西省', '6108', '榆林市', '610826', '绥德县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4246, '61', '陕西省', '6108', '榆林市', '610827', '米脂县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4247, '61', '陕西省', '6108', '榆林市', '610828', '佳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4248, '61', '陕西省', '6108', '榆林市', '610829', '吴堡县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4249, '61', '陕西省', '6108', '榆林市', '610830', '清涧县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4250, '61', '陕西省', '6108', '榆林市', '610831', '子洲县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4251, '61', '陕西省', '6108', '榆林市', '610881', '神木市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4252, '61', '陕西省', '6109', '安康市', '610901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4253, '61', '陕西省', '6109', '安康市', '610902', '汉滨区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4254, '61', '陕西省', '6109', '安康市', '610921', '汉阴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4255, '61', '陕西省', '6109', '安康市', '610922', '石泉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4256, '61', '陕西省', '6109', '安康市', '610923', '宁陕县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4257, '61', '陕西省', '6109', '安康市', '610924', '紫阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4258, '61', '陕西省', '6109', '安康市', '610925', '岚皋县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4259, '61', '陕西省', '6109', '安康市', '610926', '平利县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4260, '61', '陕西省', '6109', '安康市', '610927', '镇坪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4261, '61', '陕西省', '6109', '安康市', '610928', '旬阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4262, '61', '陕西省', '6109', '安康市', '610929', '白河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4263, '61', '陕西省', '6110', '商洛市', '611001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4264, '61', '陕西省', '6110', '商洛市', '611002', '商州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4265, '61', '陕西省', '6110', '商洛市', '611021', '洛南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4266, '61', '陕西省', '6110', '商洛市', '611022', '丹凤县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4267, '61', '陕西省', '6110', '商洛市', '611023', '商南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4268, '61', '陕西省', '6110', '商洛市', '611024', '山阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4269, '61', '陕西省', '6110', '商洛市', '611025', '镇安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4270, '61', '陕西省', '6110', '商洛市', '611026', '柞水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4271, '62', '甘肃省', '6201', '兰州市', '620101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4272, '62', '甘肃省', '6201', '兰州市', '620102', '城关区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4273, '62', '甘肃省', '6201', '兰州市', '620103', '七里河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4274, '62', '甘肃省', '6201', '兰州市', '620104', '西固区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4275, '62', '甘肃省', '6201', '兰州市', '620105', '安宁区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4276, '62', '甘肃省', '6201', '兰州市', '620111', '红古区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4277, '62', '甘肃省', '6201', '兰州市', '620121', '永登县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4278, '62', '甘肃省', '6201', '兰州市', '620122', '皋兰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4279, '62', '甘肃省', '6201', '兰州市', '620123', '榆中县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4280, '62', '甘肃省', '6201', '兰州市', '620171', '兰州新区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4281, '62', '甘肃省', '6202', '嘉峪关市', '620201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4282, '62', '甘肃省', '6203', '金昌市', '620301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4283, '62', '甘肃省', '6203', '金昌市', '620302', '金川区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4284, '62', '甘肃省', '6203', '金昌市', '620321', '永昌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4285, '62', '甘肃省', '6204', '白银市', '620401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4286, '62', '甘肃省', '6204', '白银市', '620402', '白银区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4287, '62', '甘肃省', '6204', '白银市', '620403', '平川区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4288, '62', '甘肃省', '6204', '白银市', '620421', '靖远县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4289, '62', '甘肃省', '6204', '白银市', '620422', '会宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4290, '62', '甘肃省', '6204', '白银市', '620423', '景泰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4291, '62', '甘肃省', '6205', '天水市', '620501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4292, '62', '甘肃省', '6205', '天水市', '620502', '秦州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4293, '62', '甘肃省', '6205', '天水市', '620503', '麦积区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4294, '62', '甘肃省', '6205', '天水市', '620521', '清水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4295, '62', '甘肃省', '6205', '天水市', '620522', '秦安县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4296, '62', '甘肃省', '6205', '天水市', '620523', '甘谷县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4297, '62', '甘肃省', '6205', '天水市', '620524', '武山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4298, '62', '甘肃省', '6205', '天水市', '620525', '张家川回族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4299, '62', '甘肃省', '6206', '武威市', '620601', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4300, '62', '甘肃省', '6206', '武威市', '620602', '凉州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4301, '62', '甘肃省', '6206', '武威市', '620621', '民勤县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4302, '62', '甘肃省', '6206', '武威市', '620622', '古浪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4303, '62', '甘肃省', '6206', '武威市', '620623', '天祝藏族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4304, '62', '甘肃省', '6207', '张掖市', '620701', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4305, '62', '甘肃省', '6207', '张掖市', '620702', '甘州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4306, '62', '甘肃省', '6207', '张掖市', '620721', '肃南裕固族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4307, '62', '甘肃省', '6207', '张掖市', '620722', '民乐县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4308, '62', '甘肃省', '6207', '张掖市', '620723', '临泽县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4309, '62', '甘肃省', '6207', '张掖市', '620724', '高台县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4310, '62', '甘肃省', '6207', '张掖市', '620725', '山丹县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4311, '62', '甘肃省', '6208', '平凉市', '620801', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4312, '62', '甘肃省', '6208', '平凉市', '620802', '崆峒区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4313, '62', '甘肃省', '6208', '平凉市', '620821', '泾川县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4314, '62', '甘肃省', '6208', '平凉市', '620822', '灵台县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4315, '62', '甘肃省', '6208', '平凉市', '620823', '崇信县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4316, '62', '甘肃省', '6208', '平凉市', '620825', '庄浪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4317, '62', '甘肃省', '6208', '平凉市', '620826', '静宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4318, '62', '甘肃省', '6208', '平凉市', '620881', '华亭市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4319, '62', '甘肃省', '6209', '酒泉市', '620901', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4320, '62', '甘肃省', '6209', '酒泉市', '620902', '肃州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4321, '62', '甘肃省', '6209', '酒泉市', '620921', '金塔县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4322, '62', '甘肃省', '6209', '酒泉市', '620922', '瓜州县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4323, '62', '甘肃省', '6209', '酒泉市', '620923', '肃北蒙古族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4324, '62', '甘肃省', '6209', '酒泉市', '620924', '阿克塞哈萨克族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4325, '62', '甘肃省', '6209', '酒泉市', '620981', '玉门市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4326, '62', '甘肃省', '6209', '酒泉市', '620982', '敦煌市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4327, '62', '甘肃省', '6210', '庆阳市', '621001', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4328, '62', '甘肃省', '6210', '庆阳市', '621002', '西峰区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4329, '62', '甘肃省', '6210', '庆阳市', '621021', '庆城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4330, '62', '甘肃省', '6210', '庆阳市', '621022', '环县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4331, '62', '甘肃省', '6210', '庆阳市', '621023', '华池县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4332, '62', '甘肃省', '6210', '庆阳市', '621024', '合水县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4333, '62', '甘肃省', '6210', '庆阳市', '621025', '正宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4334, '62', '甘肃省', '6210', '庆阳市', '621026', '宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4335, '62', '甘肃省', '6210', '庆阳市', '621027', '镇原县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4336, '62', '甘肃省', '6211', '定西市', '621101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4337, '62', '甘肃省', '6211', '定西市', '621102', '安定区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4338, '62', '甘肃省', '6211', '定西市', '621121', '通渭县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4339, '62', '甘肃省', '6211', '定西市', '621122', '陇西县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4340, '62', '甘肃省', '6211', '定西市', '621123', '渭源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4341, '62', '甘肃省', '6211', '定西市', '621124', '临洮县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4342, '62', '甘肃省', '6211', '定西市', '621125', '漳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4343, '62', '甘肃省', '6211', '定西市', '621126', '岷县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4344, '62', '甘肃省', '6212', '陇南市', '621201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4345, '62', '甘肃省', '6212', '陇南市', '621202', '武都区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4346, '62', '甘肃省', '6212', '陇南市', '621221', '成县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4347, '62', '甘肃省', '6212', '陇南市', '621222', '文县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4348, '62', '甘肃省', '6212', '陇南市', '621223', '宕昌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4349, '62', '甘肃省', '6212', '陇南市', '621224', '康县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4350, '62', '甘肃省', '6212', '陇南市', '621225', '西和县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4351, '62', '甘肃省', '6212', '陇南市', '621226', '礼县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4352, '62', '甘肃省', '6212', '陇南市', '621227', '徽县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4353, '62', '甘肃省', '6212', '陇南市', '621228', '两当县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4354, '62', '甘肃省', '6229', '临夏回族自治州', '622901', '临夏市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4355, '62', '甘肃省', '6229', '临夏回族自治州', '622921', '临夏县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4356, '62', '甘肃省', '6229', '临夏回族自治州', '622922', '康乐县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4357, '62', '甘肃省', '6229', '临夏回族自治州', '622923', '永靖县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4358, '62', '甘肃省', '6229', '临夏回族自治州', '622924', '广河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4359, '62', '甘肃省', '6229', '临夏回族自治州', '622925', '和政县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4360, '62', '甘肃省', '6229', '临夏回族自治州', '622926', '东乡族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4361, '62', '甘肃省', '6229', '临夏回族自治州', '622927', '积石山保安族东乡族撒拉族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4362, '62', '甘肃省', '6230', '甘南藏族自治州', '623001', '合作市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4363, '62', '甘肃省', '6230', '甘南藏族自治州', '623021', '临潭县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4364, '62', '甘肃省', '6230', '甘南藏族自治州', '623022', '卓尼县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4365, '62', '甘肃省', '6230', '甘南藏族自治州', '623023', '舟曲县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4366, '62', '甘肃省', '6230', '甘南藏族自治州', '623024', '迭部县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4367, '62', '甘肃省', '6230', '甘南藏族自治州', '623025', '玛曲县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4368, '62', '甘肃省', '6230', '甘南藏族自治州', '623026', '碌曲县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4369, '62', '甘肃省', '6230', '甘南藏族自治州', '623027', '夏河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4370, '63', '青海省', '6301', '西宁市', '630101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4371, '63', '青海省', '6301', '西宁市', '630102', '城东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4372, '63', '青海省', '6301', '西宁市', '630103', '城中区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4373, '63', '青海省', '6301', '西宁市', '630104', '城西区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4374, '63', '青海省', '6301', '西宁市', '630105', '城北区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4375, '63', '青海省', '6301', '西宁市', '630106', '湟中区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4376, '63', '青海省', '6301', '西宁市', '630121', '大通回族土族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4377, '63', '青海省', '6301', '西宁市', '630123', '湟源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4378, '63', '青海省', '6302', '海东市', '630202', '乐都区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4379, '63', '青海省', '6302', '海东市', '630203', '平安区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4380, '63', '青海省', '6302', '海东市', '630222', '民和回族土族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4381, '63', '青海省', '6302', '海东市', '630223', '互助土族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4382, '63', '青海省', '6302', '海东市', '630224', '化隆回族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4383, '63', '青海省', '6302', '海东市', '630225', '循化撒拉族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4384, '63', '青海省', '6322', '海北藏族自治州', '632221', '门源回族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4385, '63', '青海省', '6322', '海北藏族自治州', '632222', '祁连县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4386, '63', '青海省', '6322', '海北藏族自治州', '632223', '海晏县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4387, '63', '青海省', '6322', '海北藏族自治州', '632224', '刚察县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4388, '63', '青海省', '6323', '黄南藏族自治州', '632321', '同仁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4389, '63', '青海省', '6323', '黄南藏族自治州', '632322', '尖扎县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4390, '63', '青海省', '6323', '黄南藏族自治州', '632323', '泽库县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4391, '63', '青海省', '6323', '黄南藏族自治州', '632324', '河南蒙古族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4392, '63', '青海省', '6325', '海南藏族自治州', '632521', '共和县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4393, '63', '青海省', '6325', '海南藏族自治州', '632522', '同德县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4394, '63', '青海省', '6325', '海南藏族自治州', '632523', '贵德县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4395, '63', '青海省', '6325', '海南藏族自治州', '632524', '兴海县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4396, '63', '青海省', '6325', '海南藏族自治州', '632525', '贵南县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4397, '63', '青海省', '6326', '果洛藏族自治州', '632621', '玛沁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4398, '63', '青海省', '6326', '果洛藏族自治州', '632622', '班玛县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4399, '63', '青海省', '6326', '果洛藏族自治州', '632623', '甘德县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4400, '63', '青海省', '6326', '果洛藏族自治州', '632624', '达日县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4401, '63', '青海省', '6326', '果洛藏族自治州', '632625', '久治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4402, '63', '青海省', '6326', '果洛藏族自治州', '632626', '玛多县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4403, '63', '青海省', '6327', '玉树藏族自治州', '632701', '玉树市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4404, '63', '青海省', '6327', '玉树藏族自治州', '632722', '杂多县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4405, '63', '青海省', '6327', '玉树藏族自治州', '632723', '称多县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4406, '63', '青海省', '6327', '玉树藏族自治州', '632724', '治多县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4407, '63', '青海省', '6327', '玉树藏族自治州', '632725', '囊谦县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4408, '63', '青海省', '6327', '玉树藏族自治州', '632726', '曲麻莱县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4409, '63', '青海省', '6328', '海西蒙古族藏族自治州', '632801', '格尔木市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4410, '63', '青海省', '6328', '海西蒙古族藏族自治州', '632802', '德令哈市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4411, '63', '青海省', '6328', '海西蒙古族藏族自治州', '632803', '茫崖市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4412, '63', '青海省', '6328', '海西蒙古族藏族自治州', '632821', '乌兰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4413, '63', '青海省', '6328', '海西蒙古族藏族自治州', '632822', '都兰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4414, '63', '青海省', '6328', '海西蒙古族藏族自治州', '632823', '天峻县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4415, '63', '青海省', '6328', '海西蒙古族藏族自治州', '632857', '大柴旦行政委员会', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4416, '64', '宁夏回族自治区', '6401', '银川市', '640101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4417, '64', '宁夏回族自治区', '6401', '银川市', '640104', '兴庆区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4418, '64', '宁夏回族自治区', '6401', '银川市', '640105', '西夏区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4419, '64', '宁夏回族自治区', '6401', '银川市', '640106', '金凤区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4420, '64', '宁夏回族自治区', '6401', '银川市', '640121', '永宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4421, '64', '宁夏回族自治区', '6401', '银川市', '640122', '贺兰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4422, '64', '宁夏回族自治区', '6401', '银川市', '640181', '灵武市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4423, '64', '宁夏回族自治区', '6402', '石嘴山市', '640201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4424, '64', '宁夏回族自治区', '6402', '石嘴山市', '640202', '大武口区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4425, '64', '宁夏回族自治区', '6402', '石嘴山市', '640205', '惠农区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4426, '64', '宁夏回族自治区', '6402', '石嘴山市', '640221', '平罗县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4427, '64', '宁夏回族自治区', '6403', '吴忠市', '640301', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4428, '64', '宁夏回族自治区', '6403', '吴忠市', '640302', '利通区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4429, '64', '宁夏回族自治区', '6403', '吴忠市', '640303', '红寺堡区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4430, '64', '宁夏回族自治区', '6403', '吴忠市', '640323', '盐池县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4431, '64', '宁夏回族自治区', '6403', '吴忠市', '640324', '同心县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4432, '64', '宁夏回族自治区', '6403', '吴忠市', '640381', '青铜峡市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4433, '64', '宁夏回族自治区', '6404', '固原市', '640401', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4434, '64', '宁夏回族自治区', '6404', '固原市', '640402', '原州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4435, '64', '宁夏回族自治区', '6404', '固原市', '640422', '西吉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4436, '64', '宁夏回族自治区', '6404', '固原市', '640423', '隆德县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4437, '64', '宁夏回族自治区', '6404', '固原市', '640424', '泾源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4438, '64', '宁夏回族自治区', '6404', '固原市', '640425', '彭阳县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4439, '64', '宁夏回族自治区', '6405', '中卫市', '640501', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4440, '64', '宁夏回族自治区', '6405', '中卫市', '640502', '沙坡头区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4441, '64', '宁夏回族自治区', '6405', '中卫市', '640521', '中宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4442, '64', '宁夏回族自治区', '6405', '中卫市', '640522', '海原县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4443, '65', '新疆维吾尔自治区', '6501', '乌鲁木齐市', '650101', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4444, '65', '新疆维吾尔自治区', '6501', '乌鲁木齐市', '650102', '天山区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4445, '65', '新疆维吾尔自治区', '6501', '乌鲁木齐市', '650103', '沙依巴克区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4446, '65', '新疆维吾尔自治区', '6501', '乌鲁木齐市', '650104', '新市区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4447, '65', '新疆维吾尔自治区', '6501', '乌鲁木齐市', '650105', '水磨沟区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4448, '65', '新疆维吾尔自治区', '6501', '乌鲁木齐市', '650106', '头屯河区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4449, '65', '新疆维吾尔自治区', '6501', '乌鲁木齐市', '650107', '达坂城区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4450, '65', '新疆维吾尔自治区', '6501', '乌鲁木齐市', '650109', '米东区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4451, '65', '新疆维吾尔自治区', '6501', '乌鲁木齐市', '650121', '乌鲁木齐县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4452, '65', '新疆维吾尔自治区', '6502', '克拉玛依市', '650201', '市辖区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4453, '65', '新疆维吾尔自治区', '6502', '克拉玛依市', '650202', '独山子区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4454, '65', '新疆维吾尔自治区', '6502', '克拉玛依市', '650203', '克拉玛依区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4455, '65', '新疆维吾尔自治区', '6502', '克拉玛依市', '650204', '白碱滩区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4456, '65', '新疆维吾尔自治区', '6502', '克拉玛依市', '650205', '乌尔禾区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4457, '65', '新疆维吾尔自治区', '6504', '吐鲁番市', '650402', '高昌区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4458, '65', '新疆维吾尔自治区', '6504', '吐鲁番市', '650421', '鄯善县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4459, '65', '新疆维吾尔自治区', '6504', '吐鲁番市', '650422', '托克逊县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4460, '65', '新疆维吾尔自治区', '6505', '哈密市', '650502', '伊州区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4461, '65', '新疆维吾尔自治区', '6505', '哈密市', '650521', '巴里坤哈萨克自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4462, '65', '新疆维吾尔自治区', '6505', '哈密市', '650522', '伊吾县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4463, '65', '新疆维吾尔自治区', '6523', '昌吉回族自治州', '652301', '昌吉市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4464, '65', '新疆维吾尔自治区', '6523', '昌吉回族自治州', '652302', '阜康市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4465, '65', '新疆维吾尔自治区', '6523', '昌吉回族自治州', '652323', '呼图壁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4466, '65', '新疆维吾尔自治区', '6523', '昌吉回族自治州', '652324', '玛纳斯县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4467, '65', '新疆维吾尔自治区', '6523', '昌吉回族自治州', '652325', '奇台县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4468, '65', '新疆维吾尔自治区', '6523', '昌吉回族自治州', '652327', '吉木萨尔县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4469, '65', '新疆维吾尔自治区', '6523', '昌吉回族自治州', '652328', '木垒哈萨克自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4470, '65', '新疆维吾尔自治区', '6527', '博尔塔拉蒙古自治州', '652701', '博乐市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4471, '65', '新疆维吾尔自治区', '6527', '博尔塔拉蒙古自治州', '652702', '阿拉山口市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4472, '65', '新疆维吾尔自治区', '6527', '博尔塔拉蒙古自治州', '652722', '精河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4473, '65', '新疆维吾尔自治区', '6527', '博尔塔拉蒙古自治州', '652723', '温泉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4474, '65', '新疆维吾尔自治区', '6528', '巴音郭楞蒙古自治州', '652801', '库尔勒市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4475, '65', '新疆维吾尔自治区', '6528', '巴音郭楞蒙古自治州', '652822', '轮台县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4476, '65', '新疆维吾尔自治区', '6528', '巴音郭楞蒙古自治州', '652823', '尉犁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4477, '65', '新疆维吾尔自治区', '6528', '巴音郭楞蒙古自治州', '652824', '若羌县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4478, '65', '新疆维吾尔自治区', '6528', '巴音郭楞蒙古自治州', '652825', '且末县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4479, '65', '新疆维吾尔自治区', '6528', '巴音郭楞蒙古自治州', '652826', '焉耆回族自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4480, '65', '新疆维吾尔自治区', '6528', '巴音郭楞蒙古自治州', '652827', '和静县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4481, '65', '新疆维吾尔自治区', '6528', '巴音郭楞蒙古自治州', '652828', '和硕县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4482, '65', '新疆维吾尔自治区', '6528', '巴音郭楞蒙古自治州', '652829', '博湖县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4483, '65', '新疆维吾尔自治区', '6528', '巴音郭楞蒙古自治州', '652871', '库尔勒经济技术开发区', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4484, '65', '新疆维吾尔自治区', '6529', '阿克苏地区', '652901', '阿克苏市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4485, '65', '新疆维吾尔自治区', '6529', '阿克苏地区', '652902', '库车市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4486, '65', '新疆维吾尔自治区', '6529', '阿克苏地区', '652922', '温宿县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4487, '65', '新疆维吾尔自治区', '6529', '阿克苏地区', '652924', '沙雅县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4488, '65', '新疆维吾尔自治区', '6529', '阿克苏地区', '652925', '新和县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4489, '65', '新疆维吾尔自治区', '6529', '阿克苏地区', '652926', '拜城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4490, '65', '新疆维吾尔自治区', '6529', '阿克苏地区', '652927', '乌什县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4491, '65', '新疆维吾尔自治区', '6529', '阿克苏地区', '652928', '阿瓦提县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4492, '65', '新疆维吾尔自治区', '6529', '阿克苏地区', '652929', '柯坪县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4493, '65', '新疆维吾尔自治区', '6530', '克孜勒苏柯尔克孜自治州', '653001', '阿图什市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4494, '65', '新疆维吾尔自治区', '6530', '克孜勒苏柯尔克孜自治州', '653022', '阿克陶县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4495, '65', '新疆维吾尔自治区', '6530', '克孜勒苏柯尔克孜自治州', '653023', '阿合奇县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4496, '65', '新疆维吾尔自治区', '6530', '克孜勒苏柯尔克孜自治州', '653024', '乌恰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4497, '65', '新疆维吾尔自治区', '6531', '喀什地区', '653101', '喀什市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4498, '65', '新疆维吾尔自治区', '6531', '喀什地区', '653121', '疏附县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4499, '65', '新疆维吾尔自治区', '6531', '喀什地区', '653122', '疏勒县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4500, '65', '新疆维吾尔自治区', '6531', '喀什地区', '653123', '英吉沙县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4501, '65', '新疆维吾尔自治区', '6531', '喀什地区', '653124', '泽普县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4502, '65', '新疆维吾尔自治区', '6531', '喀什地区', '653125', '莎车县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4503, '65', '新疆维吾尔自治区', '6531', '喀什地区', '653126', '叶城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4504, '65', '新疆维吾尔自治区', '6531', '喀什地区', '653127', '麦盖提县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4505, '65', '新疆维吾尔自治区', '6531', '喀什地区', '653128', '岳普湖县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4506, '65', '新疆维吾尔自治区', '6531', '喀什地区', '653129', '伽师县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4507, '65', '新疆维吾尔自治区', '6531', '喀什地区', '653130', '巴楚县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4508, '65', '新疆维吾尔自治区', '6531', '喀什地区', '653131', '塔什库尔干塔吉克自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4509, '65', '新疆维吾尔自治区', '6532', '和田地区', '653201', '和田市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4510, '65', '新疆维吾尔自治区', '6532', '和田地区', '653221', '和田县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4511, '65', '新疆维吾尔自治区', '6532', '和田地区', '653222', '墨玉县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4512, '65', '新疆维吾尔自治区', '6532', '和田地区', '653223', '皮山县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4513, '65', '新疆维吾尔自治区', '6532', '和田地区', '653224', '洛浦县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4514, '65', '新疆维吾尔自治区', '6532', '和田地区', '653225', '策勒县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4515, '65', '新疆维吾尔自治区', '6532', '和田地区', '653226', '于田县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4516, '65', '新疆维吾尔自治区', '6532', '和田地区', '653227', '民丰县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4517, '65', '新疆维吾尔自治区', '6540', '伊犁哈萨克自治州', '654002', '伊宁市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4518, '65', '新疆维吾尔自治区', '6540', '伊犁哈萨克自治州', '654003', '奎屯市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4519, '65', '新疆维吾尔自治区', '6540', '伊犁哈萨克自治州', '654004', '霍尔果斯市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4520, '65', '新疆维吾尔自治区', '6540', '伊犁哈萨克自治州', '654021', '伊宁县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4521, '65', '新疆维吾尔自治区', '6540', '伊犁哈萨克自治州', '654022', '察布查尔锡伯自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4522, '65', '新疆维吾尔自治区', '6540', '伊犁哈萨克自治州', '654023', '霍城县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4523, '65', '新疆维吾尔自治区', '6540', '伊犁哈萨克自治州', '654024', '巩留县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4524, '65', '新疆维吾尔自治区', '6540', '伊犁哈萨克自治州', '654025', '新源县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4525, '65', '新疆维吾尔自治区', '6540', '伊犁哈萨克自治州', '654026', '昭苏县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4526, '65', '新疆维吾尔自治区', '6540', '伊犁哈萨克自治州', '654027', '特克斯县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4527, '65', '新疆维吾尔自治区', '6540', '伊犁哈萨克自治州', '654028', '尼勒克县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4528, '65', '新疆维吾尔自治区', '6542', '塔城地区', '654201', '塔城市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4529, '65', '新疆维吾尔自治区', '6542', '塔城地区', '654202', '乌苏市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4530, '65', '新疆维吾尔自治区', '6542', '塔城地区', '654221', '额敏县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4531, '65', '新疆维吾尔自治区', '6542', '塔城地区', '654223', '沙湾县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4532, '65', '新疆维吾尔自治区', '6542', '塔城地区', '654224', '托里县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4533, '65', '新疆维吾尔自治区', '6542', '塔城地区', '654225', '裕民县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4534, '65', '新疆维吾尔自治区', '6542', '塔城地区', '654226', '和布克赛尔蒙古自治县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4535, '65', '新疆维吾尔自治区', '6543', '阿勒泰地区', '654301', '阿勒泰市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4536, '65', '新疆维吾尔自治区', '6543', '阿勒泰地区', '654321', '布尔津县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4537, '65', '新疆维吾尔自治区', '6543', '阿勒泰地区', '654322', '富蕴县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4538, '65', '新疆维吾尔自治区', '6543', '阿勒泰地区', '654323', '福海县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4539, '65', '新疆维吾尔自治区', '6543', '阿勒泰地区', '654324', '哈巴河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4540, '65', '新疆维吾尔自治区', '6543', '阿勒泰地区', '654325', '青河县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4541, '65', '新疆维吾尔自治区', '6543', '阿勒泰地区', '654326', '吉木乃县', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4542, '65', '新疆维吾尔自治区', '6590', '自治区直辖县级行政区划', '659001', '石河子市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4543, '65', '新疆维吾尔自治区', '6590', '自治区直辖县级行政区划', '659002', '阿拉尔市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4544, '65', '新疆维吾尔自治区', '6590', '自治区直辖县级行政区划', '659003', '图木舒克市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4545, '65', '新疆维吾尔自治区', '6590', '自治区直辖县级行政区划', '659004', '五家渠市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4546, '65', '新疆维吾尔自治区', '6590', '自治区直辖县级行政区划', '659005', '北屯市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4547, '65', '新疆维吾尔自治区', '6590', '自治区直辖县级行政区划', '659006', '铁门关市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4548, '65', '新疆维吾尔自治区', '6590', '自治区直辖县级行政区划', '659007', '双河市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4549, '65', '新疆维吾尔自治区', '6590', '自治区直辖县级行政区划', '659008', '可克达拉市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4550, '65', '新疆维吾尔自治区', '6590', '自治区直辖县级行政区划', '659009', '昆玉市', NULL, NULL, NULL, NULL, NULL, NULL); +INSERT INTO `area_code` VALUES (4551, '65', '新疆维吾尔自治区', '6590', '自治区直辖县级行政区划', '659010', '胡杨河市', NULL, NULL, NULL, NULL, NULL, NULL); +COMMIT; + diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeChildDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeChildDao.xml new file mode 100644 index 0000000000..c918bb7702 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeChildDao.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + \ 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 new file mode 100644 index 0000000000..d12886bdc7 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/AreaCodeDao.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/HelperVideoDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/HelperVideoDao.xml new file mode 100644 index 0000000000..848e4de084 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/HelperVideoDao.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml index 1352c66f87..e131231414 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /demo diff --git a/epmet-module/epmet-ext/epmet-ext-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..3d27d589ab --- /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 parentAreaCode; +} 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/Dockerfile b/epmet-module/epmet-ext/epmet-ext-server/Dockerfile index d6734953ee..72a70e41f9 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/Dockerfile +++ b/epmet-module/epmet-ext/epmet-ext-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./epmet-ext.jar EXPOSE 8113 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml index a5ec527cf3..7ba47e2fc3 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-ext-server: container_name: epmet-ext-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-ext-server:0.0.8 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-ext-server:0.0.13 ports: - "8113:8113" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-ext/epmet-ext-server/pom.xml b/epmet-module/epmet-ext/epmet-ext-server/pom.xml index f8ff8b712c..f33a428e27 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/pom.xml +++ b/epmet-module/epmet-ext/epmet-ext-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.8 + 0.0.13 com.epmet @@ -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-ext/epmet-ext-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml index 55f2ba49f8..7a067d1606 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /epmet/ext @@ -102,4 +103,10 @@ pagehelper: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/epmet-heart/epmet-heart-server/Dockerfile b/epmet-module/epmet-heart/epmet-heart-server/Dockerfile index 94fd0f1809..2c90d35d42 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/Dockerfile +++ b/epmet-module/epmet-heart/epmet-heart-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./epmet-heart.jar EXPOSE 8090 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml index 15d0c6a0b6..c31a8c85a3 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-heart-server: container_name: epmet-heart-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-heart-server:0.0.54 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-heart-server:0.0.57 ports: - "8111:8111" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-heart/epmet-heart-server/pom.xml b/epmet-module/epmet-heart/epmet-heart-server/pom.xml index 298e8b79f3..5a89de3a2d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/pom.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.54 + 0.0.57 com.epmet epmet-heart diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml index 0ac5876e27..2cd6e68458 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /heart @@ -138,3 +139,9 @@ dingTalk: robot: webHook: @dingTalk.robot.webHook@ secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/epmet-job/epmet-job-server/Dockerfile b/epmet-module/epmet-job/epmet-job-server/Dockerfile index 283ed5f94b..62d98c605d 100644 --- a/epmet-module/epmet-job/epmet-job-server/Dockerfile +++ b/epmet-module/epmet-job/epmet-job-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./epmet-job.jar EXPOSE 8084 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-prod.yml index 4f6a9719b1..eb51914b5a 100644 --- a/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-job-server: container_name: epmet-job-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-job-server:0.3.27 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-job-server:0.3.29 ports: - "8084:8084" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-job/epmet-job-server/pom.xml b/epmet-module/epmet-job/epmet-job-server/pom.xml index c189901e1b..0aae470684 100644 --- a/epmet-module/epmet-job/epmet-job-server/pom.xml +++ b/epmet-module/epmet-job/epmet-job-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.27 + 0.3.29 com.epmet epmet-job @@ -79,6 +79,12 @@ feign-httpclient 10.3.0 + + com.epmet + resi-group-client + 2.0.0 + compile + diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/TopicAutoAuditService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/TopicAutoAuditService.java new file mode 100644 index 0000000000..0102b54370 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/TopicAutoAuditService.java @@ -0,0 +1,12 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/12/29 17:45 + */ +public interface TopicAutoAuditService { + Result autoAudit(); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/TopicAutoAuditServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/TopicAutoAuditServiceImpl.java new file mode 100644 index 0000000000..2e497497e0 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/TopicAutoAuditServiceImpl.java @@ -0,0 +1,24 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; +import com.epmet.service.TopicAutoAuditService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/12/29 17:46 + */ +@Service +public class TopicAutoAuditServiceImpl implements TopicAutoAuditService { + + @Autowired + private ResiGroupOpenFeignClient resiGroupOpenFeignClient; + + @Override + public Result autoAudit() { + return resiGroupOpenFeignClient.autoAudit(); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/TopicAutoAuditTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/TopicAutoAuditTask.java new file mode 100644 index 0000000000..6bc7bb3c4b --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/TopicAutoAuditTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.TopicAutoAuditService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/12/29 17:43 + */ +@Slf4j +@Component("topicAutoAuditTask") +public class TopicAutoAuditTask implements ITask { + + @Autowired + private TopicAutoAuditService topicAutoAuditService; + + @Override + public void run(String params) { + log.info("TopicAutoAuditTask定时任务正在执行,参数为:{}", params); + Result result = topicAutoAuditService.autoAudit(); + if (result.success()) { + log.info("TopicAutoAuditTask定时任务执行成功"); + } else { + log.error("TopicAutoAuditTask定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml index 4488897fcf..85974efb60 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-job/epmet-job-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /job @@ -122,3 +123,9 @@ dingTalk: robot: webHook: @dingTalk.robot.webHook@ secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java index 3bfac0e8f7..c5647e5edf 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SmsTemplateConstant.java @@ -27,4 +27,14 @@ public interface SmsTemplateConstant { * 修改密码验证码 */ String CHANGE_PASSWORD = "SMS_150731393"; + + /** + * 项目被吹哨提醒 + */ + String PROJECT_TRANSFER = "SMS_200187239"; + + /** + * 项目滞留提醒 + */ + String PROJECT_OVERDUE = "SMS_206885207"; } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SysSmsConstant.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SysSmsConstant.java new file mode 100644 index 0000000000..32be48a287 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SysSmsConstant.java @@ -0,0 +1,19 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2021/1/4 下午1:42 + */ +public interface SysSmsConstant { + + String IS_NULL_PARAM_LIST = "项目流转或滞留推送短信提醒入参集合为空......"; + + String SELECT_PARAMETER_INFO_FAILURE = "查询客户配置参数失败......"; + + String PARAMETER_INFO_IS_ZERO = "未查到客户配置参数......"; + + String NOT_ENOUGH_BALANCE = "客户:%s ,当前余额为:%s"; + + String NOT_ON_SWITCH = "客户:%s ,【%s】开关未开启"; + +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageSendApproach.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageSendApproach.java new file mode 100644 index 0000000000..7406175d87 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageSendApproach.java @@ -0,0 +1,7 @@ +package com.epmet.constant; + +public interface SystemMessageSendApproach { + + String MQ = "mq"; + +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java new file mode 100644 index 0000000000..382b96e275 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/SystemMessageType.java @@ -0,0 +1,13 @@ +package com.epmet.constant; + +/** + * 系统消息类型 + */ +public interface SystemMessageType { + + /** + * 初始化客户 + */ + String INIT_CUSTOMER = "init_customer"; + +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/WxmpMessageConstant.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/WxmpMessageConstant.java new file mode 100644 index 0000000000..5c8b364e1f --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/WxmpMessageConstant.java @@ -0,0 +1,88 @@ +package com.epmet.constant; + +import java.util.HashMap; +import java.util.Map; + +/** + * @description: 微信订阅消息常量 + * @author: liushaowen + * @date: 2020/10/21 17:45 + */ + +public interface WxmpMessageConstant { + String SEND_MESSAGE = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="; + + String ERR_CODE = "errcode"; + + String ERR_MSG = "errmsg"; + + int USER_REFUSED = 43101; + + String AUTHORIZER_ACCESS_TOKEN = "authorizerAccessToken"; + + String RESI = "resi"; + + String GOV_REDIS = "work"; + + String GOV_DB = "gov"; + + String ACCESS_TOKEN = "access_token"; + + String TOUSER = "touser"; + + String TEMPLATE_ID = "template_id"; + /*站内信模板start*/ + String MESSAGE_TEMPLATE_TYPE = "1832"; + String MESSAGE_TITLE = "thing5"; + String MESSAGE_CONTENT = "thing4"; + String MESSAGE_TIME = "date2"; + /*站内信模板end*/ + + /**关注更新提醒模板start**/ + String CONCERN_UPDATE_TEMPLATE_TYPE = "8171"; + String CONCERN_UPDATE_TITLE = "thing5"; + String CONCERN_UPDATE_TITLE_TEXT = "话题状态提醒"; + String CONCERN_UPDATE_CONTENT = "thing7"; + String CONCERN_UPDATE_CONTENT_TEXT = "你关注的话题已被转为议题,请点击查看。"; + String CONCERN_UPDATE_TIME = "time6"; + /**关注更新提醒模板end**/ + + /**内容更新消息通知模板start**/ + String CONTENT_UPDATE_TEMPLATE_TYPE = "2092"; + String CONTENT_UPDATE_TITLE = "name4"; + String CONTENT_UPDATE_TITLE_TEXT = "新评论提醒"; + String CONTENT_UPDATE_CONTENT = "thing9"; + String CONTENT_UPDATE_CONTENT_TEXT = "你关注的话题收到新评论,请点击查看。"; + String CONTENT_UPDATE_TIME = "date3"; + /**内容更新消息通知模板end**/ + + /** 消息来源start**/ + //话题 + String SOURCE_TYPE_TOPIC = "topic"; + //议题 + String SOURCE_TYPE_ISSUE = "issue"; + /** 消息来源end**/ + + String PAGE = "page"; + + String MESSAGE_PAGE_URL = "/subpages/mine/pages/message/skip"; + + String UPDATE_PAGE_URL = "/pages/index/subscribe?id="; + + int TITLE_LIMIT = 20; + + int MESSAGE_CONTENT_LIMIT = 20; + + String DATA = "data"; + + String MINIPROGRAM_STATE = "miniprogram_state"; + + String SUCCESS = "success"; + + String ERROR = "error"; + + String STATE_DEV = "developer"; + + String STATE_TEST = "trial"; + +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpUpdateSendDataDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpUpdateSendDataDTO.java new file mode 100644 index 0000000000..75696d1a4e --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpUpdateSendDataDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 订阅消息发送数据表(内容更新消息提醒、关注更新提醒) + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-04 + */ +@Data +public class WxmpUpdateSendDataDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 来源类型 (话题:topic 议题:issue 项目project 爱心互助heart 党建声音voice) + */ + private String sourceType; + + /** + * 来源对应ID + */ + private String sourceId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID agencyId + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组Id + */ + private String groupId; + + /** + * 工作人员Id + */ + private String staffId; + + /** + * 消息接收者 + */ + private String msgUserId; + + /** + * 删除标识 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/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpUpdateSendRecordDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpUpdateSendRecordDTO.java new file mode 100644 index 0000000000..a1e8a23d8e --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpUpdateSendRecordDTO.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 订阅消息发送记录表(内容更新消息提醒、关注更新提醒) + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-12-30 + */ +@Data +public class WxmpUpdateSendRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id (居民端跟网格有关的则有值,工作端以及一些居民端和网格没关的存*) + */ + private String gridId; + + /** + * 所属端类型 居民端:resi 工作端:gov + */ + private String clientType; + + /** + * 消息模板Id + */ + private String templateId; + + /** + * 用户Id + */ + private String userId; + + /** + * openId + */ + private String wxOpenId; + + /** + * 行为类型: 关注更新提醒、内容更新消息通知 + */ + private String behaviorType; + + /** + * 消息标题 + */ + private String title; + + /** + * 消息内容 + */ + private String content; + + /** + * 消息时间 + */ + private Date time; + + /** + * 发送结果(成功:success 失败:error) + */ + private String result; + + /** + * 发送失败的原因,成功可以不记录 + */ + private String reason; + + /** + * 删除标识 + */ + 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/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ProjectSendMsgFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ProjectSendMsgFormDTO.java new file mode 100644 index 0000000000..cd1e10f820 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ProjectSendMsgFormDTO.java @@ -0,0 +1,43 @@ +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; + +/** + * 项目提醒--根据手机号、短信模板编码,发送短信 验证码 + * + * @author sun + */ +@Data +public class ProjectSendMsgFormDTO implements Serializable { + private static final long serialVersionUID = 8894395590639206399L; + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class}) + private String mobile; + /** + * 场景: + */ + @NotBlank(message = "短信模板编码不能为空", groups = {AddUserInternalGroup.class}) + private String aliyunTemplateCode; + + /** + * 客户ID + */ + @NotBlank(message = "客户ID不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + + /** + * 参数KEY(发短信:send_msg;) + */ + @NotBlank(message = "参数KEY不能为空", groups = {AddUserInternalGroup.class}) + private String parameterKey; + + public interface AddUserInternalGroup {} + + public interface AddUserShowGroup extends CustomerClientShowGroup {} +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java new file mode 100644 index 0000000000..c0fc9308b8 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SystemMsgFormDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; + +@Data +public class SystemMsgFormDTO { + + @NotNull(message = "消息类型不能为空") + private String messageType; + + @NotNull(message = "消息内容不能为空") + private Object content; +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxSubscribeUpdateFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxSubscribeUpdateFormDTO.java new file mode 100644 index 0000000000..3361ed6295 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxSubscribeUpdateFormDTO.java @@ -0,0 +1,86 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.Date; + +/** + * @description: 微信订阅消息FormDTO + * @author: liushaowen + * @date: 2020/10/21 14:29 + */ +@Data +public class WxSubscribeUpdateFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空") + private String customerId; + /** + * 客户端类型 居民端:resi 工作端:work + */ + @NotBlank(message = "客户端类型不能为空") + private String clientType; + + /** + * 接收者(用户)的 userId + */ + @NotBlank(message = "接收用户id不能为空") + private String userId; + + /** + * 来源类型 (话题:topic 议题:issue 项目project 爱心互助heart 党建声音voice)等 + */ + @NotBlank(message = "来源类型不能为空") + private String sourceType; + /** + * 来源对应id + */ + @NotBlank(message = "来源id不能为空") + private String sourceId; + + /** + * 行为类型 传模板的tid + */ + @NotBlank(message = "行为类型不能为空") + private String behaviorType; + + @NotBlank(message = "消息标题不能为空") + private String messageTitle; + + /** + * 消息内容 + */ + @NotBlank(message = "消息内容不能为空") + private String messageContent; + + /** + * 消息时间 + */ + @NotNull(message = "消息时间不能为空") + private Date messageTime; + + /** + * 网格id + */ + private String gridId; + /** + * 工作人员id + */ + private String staffId; + + /** + * 群id + */ + private String groupId; + /** + * 组织id + */ + private String agencyId; + + +} diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java index 1035ab1552..ff085c7bc0 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/EpmetMessageOpenFeignClient.java @@ -3,9 +3,12 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.SysSmsDTO; +import com.epmet.dto.form.ProjectSendMsgFormDTO; import com.epmet.dto.form.SendVerificationCodeFormDTO; +import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.form.WxSubscribeMessageFormDTO; +import com.epmet.dto.form.WxSubscribeUpdateFormDTO; import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.feign.fallback.EpmetMessageOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; @@ -77,4 +80,30 @@ public interface EpmetMessageOpenFeignClient { **/ @PostMapping(value = "message/wxmpmessage/sendwxsubscribemessage", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result sendWxSubscribeMessage(List msgList); + + /** + * @param formDTOList + * @author sun + * @description 项目流转或滞留推送短信提醒 + **/ + @PostMapping(value = "message/sms/projectsendmsg", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result projectSendMsg(List formDTOList); + + /** + * @param msgList + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Description 发送微信订阅消息 + **/ + @PostMapping(value = "message/wxmpmessage/sendwxsubscribeupdate", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result sendWxSubscribeUpdate(List msgList); + + /** + * @Description 通过mq发送系统消息 + * @return + * @author wxz + * @date 2021.01.06 15:16 + */ + @PostMapping("/message/system/send-by-mq") + Result sendSystemMsgByMQ(@RequestBody SystemMsgFormDTO form); } diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java index 889569147f..a77d9152db 100644 --- a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/feign/fallback/EpmetMessageOpenFeignClientFallback.java @@ -4,9 +4,12 @@ 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.SysSmsDTO; +import com.epmet.dto.form.ProjectSendMsgFormDTO; import com.epmet.dto.form.SendVerificationCodeFormDTO; +import com.epmet.dto.form.SystemMsgFormDTO; import com.epmet.dto.form.UserMessageFormDTO; import com.epmet.dto.form.WxSubscribeMessageFormDTO; +import com.epmet.dto.form.WxSubscribeUpdateFormDTO; import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.feign.EpmetMessageOpenFeignClient; import org.springframework.stereotype.Component; @@ -51,4 +54,19 @@ public class EpmetMessageOpenFeignClientFallback implements EpmetMessageOpenFeig public Result sendWxSubscribeMessage(List msgList) { return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendWxSubscribeMessage", msgList); } + + @Override + public Result projectSendMsg(List formDTOList) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "projectSendMsg", formDTOList); + } + + @Override + public Result sendWxSubscribeUpdate(List msgList) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendWxSubscribeUpdate", msgList); + } + + @Override + public Result sendSystemMsgByMQ(SystemMsgFormDTO form) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_MESSAGE_SERVER, "sendSystemMsgByMQ", form); + } } diff --git a/epmet-module/epmet-message/epmet-message-server/Dockerfile b/epmet-module/epmet-message/epmet-message-server/Dockerfile index 49f97b4c0e..ef183014e3 100644 --- a/epmet-module/epmet-message/epmet-message-server/Dockerfile +++ b/epmet-module/epmet-message/epmet-message-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./epmet-message.jar EXPOSE 8085 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-prod.yml index 45405c1456..23750b4168 100644 --- a/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-message-server: container_name: epmet-message-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-message-server:0.3.29 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-message-server:0.3.33 ports: - "8085:8085" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index 89291741a5..ccfcf76ec3 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.29 + 0.3.33 com.epmet epmet-message @@ -112,6 +112,19 @@ 2.0.0 compile + + + com.epmet + oper-crm-client + 2.0.0 + + + + + com.epmet + epmet-commons-rocketmq + 2.0.0 + @@ -178,6 +191,10 @@ SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + 192.168.1.130:9876;192.168.1.132:9876 + epmet_message @@ -222,6 +239,10 @@ SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + 192.168.1.130:9876;192.168.1.132:9876 + epmet_message @@ -266,6 +287,10 @@ SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + 192.168.10.161:9876 + epmet_message @@ -307,6 +332,10 @@ SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + + + 192.168.11.187:9876;192.168.11.184:9876 + epmet_message 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/constant/WxmpMessageConstant.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/constant/WxmpMessageConstant.java deleted file mode 100644 index 62c9e16dcb..0000000000 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/constant/WxmpMessageConstant.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.epmet.constant; - -import java.util.HashMap; -import java.util.Map; - -/** - * @description: 微信订阅消息常量 - * @author: liushaowen - * @date: 2020/10/21 17:45 - */ - -public interface WxmpMessageConstant { - String SEND_MESSAGE = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="; - - String ERR_CODE = "errcode"; - - String ERR_MSG = "errmsg"; - - int USER_REFUSED = 43101; - - String AUTHORIZER_ACCESS_TOKEN = "authorizerAccessToken"; - - String RESI = "resi"; - - String GOV_REDIS = "work"; - - String GOV_DB = "gov"; - - String ACCESS_TOKEN = "access_token"; - - String TOUSER = "touser"; - - String TEMPLATE_ID = "template_id"; - - String TEMPLATE_TYPE = "1832"; - - String PAGE = "page"; - - String PAGE_URL = "/subpages/mine/pages/message/skip"; - - String TITLE = "thing5"; - - int TITLE_LIMIT = 20; - - String MESSAGE_CONTENT = "thing4"; - - int MESSAGE_CONTENT_LIMIT = 20; - - String MESSAGE_TIME = "date2"; - - String DATA = "data"; - - String MINIPROGRAM_STATE = "miniprogram_state"; - - String SUCCESS = "success"; - - String ERROR = "error"; - - String STATE_DEV = "developer"; - - String STATE_TEST = "trial"; - -} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java index 0a0f534a0a..8f3ced6845 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SmsController.java @@ -16,6 +16,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AliyunGroup; import com.epmet.commons.tools.validator.group.QcloudGroup; import com.epmet.dto.SysSmsDTO; +import com.epmet.dto.form.ProjectSendMsgFormDTO; import com.epmet.dto.form.SendVerificationCodeFormDTO; import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.enums.PlatformEnum; @@ -32,6 +33,7 @@ import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; import java.util.Arrays; +import java.util.List; import java.util.Map; /** @@ -139,4 +141,19 @@ public class SmsController { SendVerificationCodeResultDTO resultDTO=sysSmsService.sendVerificationCode(formDTO); return new Result().ok(resultDTO); } + + /** + * @param formDTOList + * @author sun + * @description 项目流转或滞留推送短信提醒 + **/ + @PostMapping("projectsendmsg") + public Result projectSendMsg(@RequestBody List formDTOList) { + for (ProjectSendMsgFormDTO formDTO : formDTOList) { + ValidatorUtils.validateEntity(formDTO, ProjectSendMsgFormDTO.AddUserShowGroup.class, ProjectSendMsgFormDTO.AddUserInternalGroup.class); + } + sysSmsService.projectSendMsg(formDTOList); + return new Result(); + } + } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SystemMessageController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SystemMessageController.java new file mode 100644 index 0000000000..7a31e91785 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/SystemMessageController.java @@ -0,0 +1,27 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.SystemMsgFormDTO; +import com.epmet.service.SystemMessageService; +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; + +@RestController +@RequestMapping("system") +public class SystemMessageController { + + @Autowired + private SystemMessageService systemMessageService; + + @PostMapping("send-by-mq") + public Result sendSystemMsgByMQ(@RequestBody SystemMsgFormDTO form) { + ValidatorUtils.validateEntity(form); + systemMessageService.sendMQMessage(form.getMessageType(), form.getContent()); + return new Result(); + } + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpMessageController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpMessageController.java index b600285971..1847afb396 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpMessageController.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpMessageController.java @@ -21,11 +21,9 @@ import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.form.ActivationSubscribeFormDTO; -import com.epmet.dto.form.GetTemplateListFormDTO; -import com.epmet.dto.form.WxMsgAuthInfoFormDTO; -import com.epmet.dto.form.WxSubscribeMessageFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.GetTemplateListResultDTO; +import com.epmet.dto.result.TemplateListV2ResultDTO; import com.epmet.dto.result.WxMsgAuthInfoResultDTO; import com.epmet.service.WxmpMessageService; import org.slf4j.Logger; @@ -100,9 +98,27 @@ public class WxmpMessageController { return new Result(); } + @PostMapping("sendwxsubscribeupdate") + public Result sendWxSubscribeUpdate(@RequestBody List msgList){ + for (WxSubscribeUpdateFormDTO wxSubscribeUpdateFormDTO : msgList) { + ValidatorUtils.validateEntity(wxSubscribeUpdateFormDTO); + } + executorService.execute(() -> { + try { + long startTs = System.currentTimeMillis(); + wxmpMessageService.sendWxSubscribeUpdate(msgList); + long endTs = System.currentTimeMillis(); + logger.info("异步发送消息成功,执行时长:{}", endTs - startTs); + } catch (Exception e) { + logger.error("异步发送消息失败,错误信息:{}", ExceptionUtils.getErrorStackTrace(e)); + } + }); + return new Result(); + } + /** * @return - * @Description 居民端、工作端-获取客户小程序模板列表 + * @Description 居民端、工作端-获取客户小程序模板列表(只有站内信模板) * @author sun */ @PostMapping("templatelist") @@ -110,6 +126,18 @@ public class WxmpMessageController { ValidatorUtils.validateEntity(formDTO, GetTemplateListFormDTO.AddUserInternalGroup.class); return new Result>().ok(wxmpMessageService.templateList(formDTO)); } + /** + * @Description 居民端、工作端-获取客户小程序模板列表(除了站内信模板) + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2020/12/29 13:18 + */ + @PostMapping("templatelistv2") + public Result> templateListV2(@RequestBody TemplateListV2FormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(wxmpMessageService.templateListV2(formDTO)); + } /** * @Description 查询用户授权信息 @@ -159,4 +187,4 @@ public class WxmpMessageController { return new Result(); } -} \ No newline at end of file +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpUpdateSendDataController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpUpdateSendDataController.java new file mode 100644 index 0000000000..0704f912c6 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpUpdateSendDataController.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.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.WxmpUpdateSendDataDTO; +import com.epmet.excel.WxmpUpdateSendDataExcel; +import com.epmet.service.WxmpUpdateSendDataService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 订阅消息发送数据表(内容更新消息提醒、关注更新提醒) + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-04 + */ +@RestController +@RequestMapping("wxmpupdatesenddata") +public class WxmpUpdateSendDataController { + + @Autowired + private WxmpUpdateSendDataService wxmpUpdateSendDataService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = wxmpUpdateSendDataService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + if (StringUtils.isBlank(id) || "undefined".equals(id)){ + return new Result().error(8000,"id不能为空"); + } + WxmpUpdateSendDataDTO data = wxmpUpdateSendDataService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody WxmpUpdateSendDataDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + wxmpUpdateSendDataService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody WxmpUpdateSendDataDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + wxmpUpdateSendDataService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + wxmpUpdateSendDataService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = wxmpUpdateSendDataService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, WxmpUpdateSendDataExcel.class); + } + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpUpdateSendRecordController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpUpdateSendRecordController.java new file mode 100644 index 0000000000..42daed9b09 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/WxmpUpdateSendRecordController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.WxmpUpdateSendRecordDTO; +import com.epmet.excel.WxmpUpdateSendRecordExcel; +import com.epmet.service.WxmpUpdateSendRecordService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 订阅消息发送记录表(内容更新消息提醒、关注更新提醒) + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-12-30 + */ +@RestController +@RequestMapping("wxmpupdatesendrecord") +public class WxmpUpdateSendRecordController { + + @Autowired + private WxmpUpdateSendRecordService wxmpUpdateSendRecordService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = wxmpUpdateSendRecordService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + WxmpUpdateSendRecordDTO data = wxmpUpdateSendRecordService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody WxmpUpdateSendRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + wxmpUpdateSendRecordService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody WxmpUpdateSendRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + wxmpUpdateSendRecordService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + wxmpUpdateSendRecordService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = wxmpUpdateSendRecordService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, WxmpUpdateSendRecordExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/SystemMessageDao.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/SystemMessageDao.java new file mode 100644 index 0000000000..7770c58547 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/SystemMessageDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.SystemMessageEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 系统消息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-06 + */ +@Mapper +public interface SystemMessageDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpUpdateSendDataDao.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpUpdateSendDataDao.java new file mode 100644 index 0000000000..89af78b681 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpUpdateSendDataDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.WxmpUpdateSendDataEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 订阅消息发送数据表(内容更新消息提醒、关注更新提醒) + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-04 + */ +@Mapper +public interface WxmpUpdateSendDataDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpUpdateSendRecordDao.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpUpdateSendRecordDao.java new file mode 100644 index 0000000000..63b8812bb0 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/WxmpUpdateSendRecordDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.WxmpUpdateSendRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 订阅消息发送记录表(内容更新消息提醒、关注更新提醒) + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-12-30 + */ +@Mapper +public interface WxmpUpdateSendRecordDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/SystemMessageEntity.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/SystemMessageEntity.java new file mode 100644 index 0000000000..effdb2d59b --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/SystemMessageEntity.java @@ -0,0 +1,57 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; +import org.omg.CORBA.StringHolder; + +import java.util.Date; + +/** + * 系统消息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-01-06 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("system_message") +public class SystemMessageEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 消息类型 + */ + private String msgType; + + /** + * 发送途径 + */ + private String sendApproach; + + /** + * 消息内容 + */ + private String content; + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpUpdateSendDataEntity.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpUpdateSendDataEntity.java new file mode 100644 index 0000000000..a4395a1bf9 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpUpdateSendDataEntity.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; + +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-01-04 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("wxmp_update_send_data") +public class WxmpUpdateSendDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 来源类型 (话题:topic 议题:issue 项目project 爱心互助heart 党建声音voice) + */ + private String sourceType; + + /** + * 来源对应ID + */ + private String sourceId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID agencyId + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组Id + */ + private String groupId; + + /** + * 工作人员Id + */ + private String staffId; + + /** + * 消息接收者 + */ + private String msgUserId; + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpUpdateSendRecordEntity.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpUpdateSendRecordEntity.java new file mode 100644 index 0000000000..9497a3475e --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/entity/WxmpUpdateSendRecordEntity.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +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 2020-12-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("wxmp_update_send_record") +public class WxmpUpdateSendRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id (居民端跟网格有关的则有值,工作端以及一些居民端和网格没关的存*) + */ + private String gridId; + + /** + * 所属端类型 居民端:resi 工作端:gov + */ + private String clientType; + + /** + * 消息模板Id + */ + private String templateId; + + /** + * 用户Id + */ + private String userId; + + /** + * openId + */ + private String wxOpenId; + + /** + * 行为类型: 关注更新提醒、内容更新消息通知 + */ + private String behaviorType; + + /** + * 消息标题 + */ + private String title; + + /** + * 消息内容 + */ + private String content; + + /** + * 消息时间 + */ + private Date time; + + /** + * 发送结果(成功:success 失败:error) + */ + private String result; + + /** + * 发送失败的原因,成功可以不记录 + */ + private String reason; + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpUpdateSendDataExcel.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpUpdateSendDataExcel.java new file mode 100644 index 0000000000..5c1c3f07f3 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpUpdateSendDataExcel.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 订阅消息发送数据表(内容更新消息提醒、关注更新提醒) + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-04 + */ +@Data +public class WxmpUpdateSendDataExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "来源类型 (话题:topic 议题:issue 项目project 爱心互助heart 党建声音voice)") + private String sourceType; + + @Excel(name = "来源对应ID") + private String sourceId; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "组织ID agencyId") + private String agencyId; + + @Excel(name = "网格ID ") + private String gridId; + + @Excel(name = "小组Id") + private String groupId; + + @Excel(name = "工作人员Id") + private String staffId; + + @Excel(name = "消息接收者") + private String msgUserId; + + @Excel(name = "删除标识 0未删除、1已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpUpdateSendRecordExcel.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpUpdateSendRecordExcel.java new file mode 100644 index 0000000000..bec6cbe551 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/excel/WxmpUpdateSendRecordExcel.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 订阅消息发送记录表(内容更新消息提醒、关注更新提醒) + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-12-30 + */ +@Data +public class WxmpUpdateSendRecordExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户Id ") + private String customerId; + + @Excel(name = "网格Id (居民端跟网格有关的则有值,工作端以及一些居民端和网格没关的存*)") + private String gridId; + + @Excel(name = "所属端类型 居民端:resi 工作端:gov") + private String clientType; + + @Excel(name = "消息模板Id ") + private String templateId; + + @Excel(name = "用户Id") + private String userId; + + @Excel(name = "openId ") + private String wxOpenId; + + @Excel(name = "行为类型: 关注更新提醒、内容更新消息通知") + private String behaviorType; + + @Excel(name = "消息标题 ") + private String title; + + @Excel(name = "消息内容 ") + private String content; + + @Excel(name = "消息时间 ") + private Date time; + + @Excel(name = "发送结果(成功:success 失败:error)") + private String result; + + @Excel(name = "发送失败的原因,成功可以不记录") + private String reason; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpUpdateSendDataRedis.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpUpdateSendDataRedis.java new file mode 100644 index 0000000000..48cc7ac397 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpUpdateSendDataRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 订阅消息发送数据表(内容更新消息提醒、关注更新提醒) + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-04 + */ +@Component +public class WxmpUpdateSendDataRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpUpdateSendRecordRedis.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpUpdateSendRecordRedis.java new file mode 100644 index 0000000000..05235661a1 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/redis/WxmpUpdateSendRecordRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 订阅消息发送记录表(内容更新消息提醒、关注更新提醒) + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-12-30 + */ +@Component +public class WxmpUpdateSendRecordRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SysSmsService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SysSmsService.java index 1e67125423..8bb9cb2a8e 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SysSmsService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SysSmsService.java @@ -12,11 +12,13 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.SysSmsDTO; +import com.epmet.dto.form.ProjectSendMsgFormDTO; import com.epmet.dto.form.SendVerificationCodeFormDTO; import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.entity.SysSmsEntity; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; /** @@ -58,5 +60,13 @@ public interface SysSmsService extends BaseService { * @Date 2020/6/23 21:07 **/ SendVerificationCodeResultDTO sendVerificationCode(SendVerificationCodeFormDTO formDTO); + + /** + * @param formDTOList + * @author sun + * @description 项目流转或滞留推送短信提醒 + **/ + void projectSendMsg(List formDTOList); + } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SystemMessageService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SystemMessageService.java new file mode 100644 index 0000000000..2985b550c9 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/SystemMessageService.java @@ -0,0 +1,7 @@ +package com.epmet.service; + +public interface SystemMessageService { + + void sendMQMessage(String messageType, Object content); + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpMessageService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpMessageService.java index 315bf5c6d6..c2e3439bc2 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpMessageService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpMessageService.java @@ -17,10 +17,9 @@ package com.epmet.service; -import com.epmet.dto.form.ActivationSubscribeFormDTO; -import com.epmet.dto.form.GetTemplateListFormDTO; -import com.epmet.dto.form.WxSubscribeMessageFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.GetTemplateListResultDTO; +import com.epmet.dto.result.TemplateListV2ResultDTO; import com.epmet.dto.result.WxMsgAuthInfoResultDTO; import java.util.List; @@ -41,7 +40,7 @@ public interface WxmpMessageService { String behaviorType, String userId); /** - * @Description 发送订阅消息 + * @Description 发送站内信订阅消息 * @param msgList * @return void * @Author liushaowen @@ -51,7 +50,7 @@ public interface WxmpMessageService { /** * @return - * @Description 居民端、工作端-获取客户小程序模板列表 + * @Description 居民端、工作端-获取客户小程序模板列表(只有站内信消息模板) * @author sun */ List templateList(GetTemplateListFormDTO formDTO); @@ -62,4 +61,21 @@ public interface WxmpMessageService { * @author sun */ void activationSubscribe(ActivationSubscribeFormDTO formDTO); + /** + * @Description 居民端、工作端-获取客户小程序模板列表(不包括站内信消息模板) + * @param formDTO + * @return java.util.List + * @Author liushaowen + * @Date 2020/12/29 13:26 + */ + List templateListV2(TemplateListV2FormDTO formDTO); + + /** + * @Description 发送(内容更新消息提醒、关注更新提醒)订阅消息 + * @param msgList + * @return void + * @Author liushaowen + * @Date 2020/12/30 13:36 + */ + void sendWxSubscribeUpdate(List msgList); } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpUpdateSendDataService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpUpdateSendDataService.java new file mode 100644 index 0000000000..5d21093d61 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpUpdateSendDataService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.WxmpUpdateSendDataDTO; +import com.epmet.entity.WxmpUpdateSendDataEntity; + +import java.util.List; +import java.util.Map; + +/** + * 订阅消息发送数据表(内容更新消息提醒、关注更新提醒) + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-04 + */ +public interface WxmpUpdateSendDataService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-01-04 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-01-04 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return WxmpUpdateSendDataDTO + * @author generator + * @date 2021-01-04 + */ + WxmpUpdateSendDataDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-04 + */ + void save(WxmpUpdateSendDataDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-01-04 + */ + void update(WxmpUpdateSendDataDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-01-04 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpUpdateSendRecordService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpUpdateSendRecordService.java new file mode 100644 index 0000000000..cf67d914fe --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/WxmpUpdateSendRecordService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.WxmpUpdateSendRecordDTO; +import com.epmet.entity.WxmpUpdateSendRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 订阅消息发送记录表(内容更新消息提醒、关注更新提醒) + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-12-30 + */ +public interface WxmpUpdateSendRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-30 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-30 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return WxmpUpdateSendRecordDTO + * @author generator + * @date 2020-12-30 + */ + WxmpUpdateSendRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-30 + */ + void save(WxmpUpdateSendRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-30 + */ + void update(WxmpUpdateSendRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-30 + */ + void delete(String[] ids); +} \ No newline at end of file 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 2c254701d2..e2c1d1f864 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java @@ -17,14 +17,20 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.SysSmsConstant; import com.epmet.dao.SysSmsDao; import com.epmet.dto.SysSmsDTO; +import com.epmet.dto.form.CrmParameterFormDTO; +import com.epmet.dto.form.ProjectSendMsgFormDTO; import com.epmet.dto.form.SendVerificationCodeFormDTO; +import com.epmet.dto.result.CrmParameterResultDTO; import com.epmet.dto.result.SendVerificationCodeResultDTO; import com.epmet.entity.SysSmsEntity; import com.epmet.exception.ModuleErrorCode; import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.service.SysSmsService; import com.epmet.sms.AbstractSmsService; import com.epmet.sms.SmsFactory; @@ -35,10 +41,13 @@ 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.util.HashMap; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; +import java.util.stream.Collectors; @Service public class SysSmsServiceImpl extends BaseServiceImpl implements SysSmsService { @@ -47,6 +56,8 @@ public class SysSmsServiceImpl extends BaseServiceImpl @Autowired private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; @Override public PageData page(Map params) { @@ -181,4 +192,99 @@ public class SysSmsServiceImpl extends BaseServiceImpl } return data; } + + /** + * @param formDTOList + * @author sun + * @description 项目流转或滞留推送短信提醒 + **/ + @Override + public void projectSendMsg(List formDTOList) { + if (CollectionUtils.isEmpty(formDTOList)){ + logger.warn(SysSmsConstant.IS_NULL_PARAM_LIST); + return; + } + Map> groupByCustomer = formDTOList.stream().collect(Collectors.groupingBy(ProjectSendMsgFormDTO::getCustomerId)); + List formDTOS = ConvertUtils.sourceToTarget(formDTOList, CrmParameterFormDTO.class); + List parameterFormDTOS = formDTOS.stream().distinct().collect(Collectors.toList()); + Result> listResult = operCrmOpenFeignClient.selectParamInfo(parameterFormDTOS); + if (!listResult.success()){ + throw new RenException(SysSmsConstant.SELECT_PARAMETER_INFO_FAILURE); + } + List parameterResult = listResult.getData(); + if (CollectionUtils.isEmpty(parameterResult)){ + logger.warn(SysSmsConstant.PARAMETER_INFO_IS_ZERO); + return; + } + groupByCustomer.forEach((customerId,v) -> { + parameterResult.forEach(p -> { + if (customerId.equals(p.getCustomerId())){ + p.setBalanceStatus(Integer.valueOf(p.getParameterValue()) >= v.size() ? true : false); + p.setSubtractParameterValue(String.valueOf(Integer.valueOf(p.getParameterValue()) - v.size())); + } + }); + }); + try { + groupByCustomer.forEach((customerId,v) -> { + parameterResult.forEach(p -> { + if (customerId.equals(p.getCustomerId())){ + // 判断参数开关是否打开,false:未打开 + if (p.getSwitchStatus() == false){ + logger.warn(String.format(SysSmsConstant.NOT_ON_SWITCH,customerId,p.getParameterKey())); + }else { + // 判断余额状态 false:余额不足 + if (p.getBalanceStatus() == false){ + logger.warn(String.format(SysSmsConstant.NOT_ENOUGH_BALANCE,customerId,p.getParameterValue())); + }else { + v.forEach(dto->{ + SysSmsDTO sysSmsDTO = new SysSmsDTO(); + sysSmsDTO.setMobile(dto.getMobile()); + sysSmsDTO.setAliyunTemplateCode(dto.getAliyunTemplateCode()); + //推送短信 + this.sendMsg(sysSmsDTO); + }); + } + } + } + }); + }); + }catch (RenException e){ + logger.warn(e.getInternalMsg()); + } + Map> groupBySwitch = parameterResult.stream().collect(Collectors.groupingBy(CrmParameterResultDTO::getSwitchStatus)); + List crmParameterTrue = groupBySwitch.get(true); + 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); + } + } + } + + /** + * @author sun + * @description 推送短信信箱,出错不中断 + **/ + private void sendMsg(SysSmsDTO sysSmsDTO) { + logger.info(String.format("固定短信模板推送短信信息接口入参:%s", JSON.toJSONString(sysSmsDTO))); + LinkedHashMap map = null; + try { + //短信服务 + AbstractSmsService service = SmsFactory.build(); + if (service == null) { + logger.warn("发送短信异常,ErrorCode:%s,异常AbstractSmsService is null", ModuleErrorCode.SMS_CONFIG); + } + //发送短信 + if (StringUtils.isNotBlank(sysSmsDTO.getAliyunTemplateCode())) { + service.sendSmsByAliyunTemplateCode(sysSmsDTO.getMobile(), map, sysSmsDTO.getAliyunTemplateCode()); + } else { + service.sendSms(sysSmsDTO.getMobile(), map); + } + } catch (Exception e) { + logger.warn(String.format("项目提醒发送短信失败,失败手机号:%s,ErrorCode:%s", sysSmsDTO.getMobile(), e.getMessage())); + } + } + } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java new file mode 100644 index 0000000000..64a067af56 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SystemMessageServiceImpl.java @@ -0,0 +1,70 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.TopicConstants; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.SystemMessageSendApproach; +import com.epmet.constant.SystemMessageType; +import com.epmet.dao.SystemMessageDao; +import com.epmet.entity.SystemMessageEntity; +import com.epmet.service.SystemMessageService; +import org.apache.rocketmq.common.message.Message; +import org.apache.rocketmq.remoting.common.RemotingHelper; +import org.apache.rocketmq.spring.core.RocketMQTemplate; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +@Service +public class SystemMessageServiceImpl implements SystemMessageService { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private SystemMessageDao systemMessageDao; + + @Autowired + private RocketMQTemplate rocketMQTemplate; + + @Transactional(rollbackFor = Exception.class) + @Override + public void sendMQMessage(String messageType, Object content) { + String contentStr = JSON.toJSONString(content); + //存储消息到表 + SystemMessageEntity systemMessageEntity = new SystemMessageEntity(); + systemMessageEntity.setMsgType(messageType); + systemMessageEntity.setSendApproach(SystemMessageSendApproach.MQ); + systemMessageEntity.setContent(contentStr); + systemMessageDao.insert(systemMessageEntity); + + //发送mq消息 + try { + Message meMessage = new Message(getTopicByMsgType(messageType), contentStr.getBytes(RemotingHelper.DEFAULT_CHARSET)); + rocketMQTemplate.getProducer().send(meMessage); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error("发送系统消息失败,堆栈信息:{}", errorStackTrace); + throw new RenException(EpmetErrorCode.SYSTEM_MQ_MSG_SEND_FAIL.getCode()); + } + } + + /** + * @Description 根据消息类型获取topic + * @return + * @author wxz + * @date 2021.01.06 13:42 + */ + private String getTopicByMsgType(String msgType) { + String topic = null; + switch (msgType) { + case SystemMessageType.INIT_CUSTOMER: + topic = TopicConstants.INIT_CUSTOMER; + break; + } + return topic; + } +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageExtServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageExtServiceImpl.java index f9d1e17a67..4dc7c78948 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageExtServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpMessageExtServiceImpl.java @@ -50,8 +50,9 @@ public class WxmpMessageExtServiceImpl implements WxmpMessageExtService { if (ExtConstant.APP_RESI.equals(dto.getApp())){ wxSubscribeMessageFormDTO.setClientType(ExtConstant.APP_RESI); } + //2020.12.23 sun 数据库字段key值有work改成gov 外挂接口直接传的gov不用再转换 if (ExtConstant.APP_GOV.equals(dto.getApp())){ - wxSubscribeMessageFormDTO.setClientType(ExtConstant.APP_WORK); + wxSubscribeMessageFormDTO.setClientType(ExtConstant.APP_GOV); } wxSubscribeMessageFormDTO.setBehaviorType(dto.getTitle()); wxSubscribeMessageFormDTO.setMessageTime(new Date()); 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 0d390bfc31..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.*; @@ -40,6 +42,8 @@ import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.redis.WxmpMessageRedis; import com.epmet.service.WxmpMessageService; import com.epmet.service.WxmpMsgSendRecordService; +import com.epmet.service.WxmpUpdateSendDataService; +import com.epmet.service.WxmpUpdateSendRecordService; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,10 +53,7 @@ import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 微信消息订阅Service @@ -82,9 +83,15 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { @Autowired private WxmpMsgSendRecordService wxmpMsgSendRecordService; + @Autowired + private WxmpUpdateSendRecordService wxmpUpdateSendRecordService; + @Autowired private WxmpUserSubscribeRecordDao subscribeRecordDao; + @Autowired + private WxmpUpdateSendDataService wxmpUpdateSendDataService; + /** * @return void * @Description 保存系统授权信息 @@ -125,7 +132,7 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { /** * @param msgList * @return void - * @Description 发送订阅消息 + * @Description 发送站内信订阅消息 * @Author liushaowen * @Date 2020/10/21 15:34 */ @@ -135,11 +142,18 @@ 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(); customerTemplateListFormDTO.setCustomerId(msgList.get(0).getCustomerId()); - customerTemplateListFormDTO.setPublicId(WxmpMessageConstant.TEMPLATE_TYPE); + customerTemplateListFormDTO.setPublicId(WxmpMessageConstant.MESSAGE_TEMPLATE_TYPE); List customerTemplateListResultDTOS = customerTemplateList(customerTemplateListFormDTO); // 获取AccessToken Map accessTokenMap = getAccessToken(msgList.get(0).getCustomerId()); @@ -151,32 +165,7 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { String templateId = null; String openId = null; //通过userId获取openId - try { - if (WxmpMessageConstant.RESI.equals(clientType)) { - UserBasicInfoFormDTO userBasicInfoFormDTO = new UserBasicInfoFormDTO(); - userBasicInfoFormDTO.setUserId(userId); - Result userBasicInfo = epmetUserOpenFeignClient.getUserBasicInfo(userBasicInfoFormDTO); - if (userBasicInfo.getCode() != 0){ - throw new Exception(userBasicInfo.getInternalMsg()); - }else { - openId = userBasicInfo.getData().getOpenId(); - } - } else if (WxmpMessageConstant.GOV_DB.equals(clientType)) { - StaffBasicInfoFormDTO staffBasicInfoFormDTO = new StaffBasicInfoFormDTO(); - staffBasicInfoFormDTO.setStaffId(userId); - Result staffBasicInfo = epmetUserOpenFeignClient.getStaffBasicInfo(staffBasicInfoFormDTO);; - if (staffBasicInfo.getCode() != 0){ - throw new Exception(staffBasicInfo.getInternalMsg()); - }else { - openId = staffBasicInfo.getData().getOpenId(); - } - } else { - throw new WxSubscribeException("clientType有误", "", openId); - } - } catch (Exception e) { - e.printStackTrace(); - throw new WxSubscribeException("获取openId失败:" + e.getMessage(), "", ""); - } + openId = getUserOpenId(userId, clientType, openId); if (StringUtils.isBlank(openId)) { throw new WxSubscribeException("该userId未查询到关联的openId", "", ""); @@ -234,7 +223,7 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { String title = "您有一条" + msg.getBehaviorType(); JSONObject titleJson = new JSONObject(); titleJson.put("value", title.length() > WxmpMessageConstant.TITLE_LIMIT ? title.substring(0, WxmpMessageConstant.TITLE_LIMIT) : title); - data.put(WxmpMessageConstant.TITLE, titleJson); + data.put(WxmpMessageConstant.MESSAGE_TITLE, titleJson); //内容 JSONObject contentJson = new JSONObject(); contentJson.put("value", msg.getMessageContent().length() > WxmpMessageConstant.MESSAGE_CONTENT_LIMIT ? msg.getMessageContent().substring(0, WxmpMessageConstant.MESSAGE_CONTENT_LIMIT) : msg.getMessageContent()); @@ -247,11 +236,11 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { EnvEnum envEnum = EnvEnum.getCurrentEnv(); //选填项 if (WxmpMessageConstant.RESI.equals(clientType)) { - StringBuilder resiPage = new StringBuilder(WxmpMessageConstant.PAGE_URL); + StringBuilder resiPage = new StringBuilder(WxmpMessageConstant.MESSAGE_PAGE_URL); resiPage.append("?customerId=").append(customerId).append("&gridId=").append(msg.getGridId()); jsonObject.put(WxmpMessageConstant.PAGE, resiPage.toString()); } else if (WxmpMessageConstant.GOV_DB.equals(clientType)) { - StringBuilder govPage = new StringBuilder(WxmpMessageConstant.PAGE_URL); + StringBuilder govPage = new StringBuilder(WxmpMessageConstant.MESSAGE_PAGE_URL); govPage.append("?customerId=").append(customerId).append("&staffId=").append(userId); jsonObject.put(WxmpMessageConstant.PAGE, govPage.toString()); } @@ -281,7 +270,7 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { logger.warn("消息{}发送成功但订阅条数-1失败", JSON.toJSONString(msg)); } //存表 - int saveRes = wxmpMsgSendRecordService.saveRecord(initRecord(msg, templateId, openId, WxmpMessageConstant.SUCCESS)); + int saveRes = wxmpMsgSendRecordService.saveRecord(initWxmpMsgSendRecord(msg, templateId, openId, WxmpMessageConstant.SUCCESS)); if (saveRes == 0) { logger.warn("消息{}发送成功但存入记录表失败", JSON.toJSONString(msg)); } @@ -312,7 +301,7 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { // } if (e instanceof WxSubscribeException) { //存表 - WxmpMsgSendRecordEntity wxmpMsgSendRecordEntity = initRecord(msg, ((WxSubscribeException) e).getTemplateId(), ((WxSubscribeException) e).getOpenId(), WxmpMessageConstant.ERROR); + WxmpMsgSendRecordEntity wxmpMsgSendRecordEntity = initWxmpMsgSendRecord(msg, ((WxSubscribeException) e).getTemplateId(), ((WxSubscribeException) e).getOpenId(), WxmpMessageConstant.ERROR); wxmpMsgSendRecordEntity.setReason(errMsg); int saveRes = wxmpMsgSendRecordService.saveRecord(wxmpMsgSendRecordEntity); if (saveRes == 0) { @@ -328,7 +317,7 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { } //初始化记录对象 - private WxmpMsgSendRecordEntity initRecord(WxSubscribeMessageFormDTO msg, String templateId, String openId, String status) { + private WxmpMsgSendRecordEntity initWxmpMsgSendRecord(WxSubscribeMessageFormDTO msg, String templateId, String openId, String status) { WxmpMsgSendRecordEntity wxmpMsgSendRecordEntity = new WxmpMsgSendRecordEntity(); wxmpMsgSendRecordEntity.setCustomerId(msg.getCustomerId()); wxmpMsgSendRecordEntity.setClientType(msg.getClientType()); @@ -345,6 +334,222 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { return wxmpMsgSendRecordEntity; } + /** + * @param msgList + * @return void + * @Description 发送(内容更新消息提醒、关注更新提醒)订阅消息 + * @Author liushaowen + * @Date 2020/12/30 13:36 + */ + @Override + public void sendWxSubscribeUpdate(List msgList) { + 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()); + //获取工作端的 + templateListV2FormDTO.setApp(WxmpMessageConstant.GOV_REDIS); + List workTemplates = templateListV2(templateListV2FormDTO); + //获取居民端的 + templateListV2FormDTO.setApp(WxmpMessageConstant.RESI); + List resiTemplates = templateListV2(templateListV2FormDTO); + + //获取AccessToken + Map accessTokenMap = getAccessToken(msgList.get(0).getCustomerId()); + + for (WxSubscribeUpdateFormDTO msg : msgList) { + //生成属性表id + String dataId = UUID.randomUUID().toString().replace("-",""); + try { + String userId = msg.getUserId(); + String clientType = msg.getClientType(); + String customerId = msg.getCustomerId(); + String templateId = null; + String openId = null; + //通过userId获取openId + openId = getUserOpenId(userId, clientType, openId); + if (StringUtils.isBlank(openId)) { + throw new WxSubscribeException("该userId未查询到关联的openId", "", ""); + } + + //获取模板id + if (WxmpMessageConstant.GOV_DB.equals(msg.getClientType())&& workTemplates.size() > NumConstant.ZERO) { + for (TemplateListV2ResultDTO workTemplate : workTemplates) { + if (workTemplate.getTid().equals(msg.getBehaviorType())){ + templateId = workTemplate.getTemplateId(); + break; + }; + } + } else if (WxmpMessageConstant.RESI.equals(msg.getClientType())&& resiTemplates.size() > NumConstant.ZERO) { + for (TemplateListV2ResultDTO resiTemplate : resiTemplates) { + if (resiTemplate.getTid().equals(msg.getBehaviorType())){ + templateId = resiTemplate.getTemplateId(); + break; + }; + } + }else { + throw new WxSubscribeException("获取模板id失败", "", openId); + } + if (StringUtils.isBlank(templateId)) { + throw new WxSubscribeException("获取模板id失败", "", openId); + } + + //获取accessToken + String accessToken = null; + if (WxmpMessageConstant.RESI.equals(clientType)) { + accessToken = accessTokenMap.get("resiToken"); + } else if (WxmpMessageConstant.GOV_DB.equals(clientType)) { + accessToken = accessTokenMap.get("govToken"); + } + if (StringUtils.isBlank(accessToken)) { + throw new WxSubscribeException("accessToken获取失败"+accessTokenMap.get("errorMsg"), "", openId); + } + //发送消息 + JSONObject jsonObject = new JSONObject(); + JSONObject data = new JSONObject(); + //必填项 + jsonObject.put(WxmpMessageConstant.ACCESS_TOKEN, accessToken); + jsonObject.put(WxmpMessageConstant.TOUSER, openId); + jsonObject.put(WxmpMessageConstant.TEMPLATE_ID, templateId); + //标题 + JSONObject titleJson = new JSONObject(); + titleJson.put("value", msg.getMessageTitle().length() > WxmpMessageConstant.TITLE_LIMIT ? msg.getMessageTitle().substring(0, WxmpMessageConstant.TITLE_LIMIT) : msg.getMessageTitle()); + //内容 + JSONObject contentJson = new JSONObject(); + contentJson.put("value", msg.getMessageContent().length() > WxmpMessageConstant.MESSAGE_CONTENT_LIMIT ? msg.getMessageContent().substring(0, WxmpMessageConstant.MESSAGE_CONTENT_LIMIT) : msg.getMessageContent()); + //时间 + JSONObject timeJson = new JSONObject(); + timeJson.put("value", new SimpleDateFormat("yyyy-MM-dd HH:mm").format(msg.getMessageTime())); + + if (WxmpMessageConstant.CONCERN_UPDATE_TEMPLATE_TYPE.equals(msg.getBehaviorType())){ + data.put(WxmpMessageConstant.CONCERN_UPDATE_TITLE, titleJson); + data.put(WxmpMessageConstant.CONCERN_UPDATE_CONTENT, contentJson); + data.put(WxmpMessageConstant.CONCERN_UPDATE_TIME ,timeJson); + } + if (WxmpMessageConstant.CONTENT_UPDATE_TEMPLATE_TYPE.equals(msg.getBehaviorType())){ + data.put(WxmpMessageConstant.CONTENT_UPDATE_TITLE, titleJson); + data.put(WxmpMessageConstant.CONTENT_UPDATE_CONTENT, contentJson); + data.put(WxmpMessageConstant.CONTENT_UPDATE_TIME, timeJson); + } + // + jsonObject.put(WxmpMessageConstant.DATA, data); + EnvEnum envEnum = EnvEnum.getCurrentEnv(); + //选填项 + if (WxmpMessageConstant.RESI.equals(clientType)) { + StringBuilder resiPage = new StringBuilder(WxmpMessageConstant.UPDATE_PAGE_URL); + resiPage.append(dataId); + jsonObject.put(WxmpMessageConstant.PAGE, resiPage.toString()); + } else if (WxmpMessageConstant.GOV_DB.equals(clientType)) { + StringBuilder govPage = new StringBuilder(WxmpMessageConstant.UPDATE_PAGE_URL); + govPage.append(dataId); + jsonObject.put(WxmpMessageConstant.PAGE, govPage.toString()); + } + //开发环境 + if ("dev".equals(envEnum.getCode())) { + jsonObject.put(WxmpMessageConstant.MINIPROGRAM_STATE, WxmpMessageConstant.STATE_DEV); + } + //测试环境 + if ("test".equals(envEnum.getCode())) { + jsonObject.put(WxmpMessageConstant.MINIPROGRAM_STATE, WxmpMessageConstant.STATE_TEST); + } + + String resultStr = HttpClientManager.getInstance().sendPostByJSON(WxmpMessageConstant.SEND_MESSAGE + accessToken, JSON.toJSONString(jsonObject)).getData(); + Map resultMap = JSON.parseObject(resultStr, Map.class); + Object errcode = resultMap.get(WxmpMessageConstant.ERR_CODE); + if (errcode.equals(NumConstant.ZERO)) { + //发送成功 + //存数据表 + WxmpUpdateSendDataEntity wxmpUpdateSendDataEntity = new WxmpUpdateSendDataEntity(); + wxmpUpdateSendDataEntity.setId(dataId); + wxmpUpdateSendDataEntity.setMsgUserId(userId); + wxmpUpdateSendDataEntity.setAgencyId(msg.getAgencyId()); + wxmpUpdateSendDataEntity.setCustomerId(customerId); + wxmpUpdateSendDataEntity.setGridId(msg.getGridId()); + wxmpUpdateSendDataEntity.setGroupId(msg.getGroupId()); + wxmpUpdateSendDataEntity.setSourceId(msg.getSourceId()); + wxmpUpdateSendDataEntity.setSourceType(msg.getSourceType()); + wxmpUpdateSendDataEntity.setStaffId(msg.getStaffId()); + wxmpUpdateSendDataService.insert(wxmpUpdateSendDataEntity); + //存记录表 + wxmpUpdateSendRecordService.insert(initWxmpUpdateSendRecord(msg, templateId, openId, WxmpMessageConstant.SUCCESS)); + + } else { + //发送失败 + //抛出错误 + throw new WxSubscribeException(String.valueOf(resultMap.get(WxmpMessageConstant.ERR_MSG)), templateId, openId); + } + }catch (Exception e){ + String errMsg = e.getMessage(); + if (e instanceof WxSubscribeException) { + //存表 + WxmpUpdateSendRecordEntity wxmpUpdateSendRecordEntity = initWxmpUpdateSendRecord(msg, ((WxSubscribeException) e).getTemplateId(), ((WxSubscribeException) e).getOpenId(), WxmpMessageConstant.ERROR); + wxmpUpdateSendRecordEntity.setReason(errMsg); + wxmpUpdateSendRecordService.insert(wxmpUpdateSendRecordEntity); + } + logger.warn("消息:{}发送失败,原因是:{}", JSON.toJSONString(msg), errMsg); + continue; + } + } + } + + private WxmpUpdateSendRecordEntity initWxmpUpdateSendRecord(WxSubscribeUpdateFormDTO msg, String templateId, String openId, String status) { + WxmpUpdateSendRecordEntity wxmpUpdateSendRecordEntity = new WxmpUpdateSendRecordEntity(); + wxmpUpdateSendRecordEntity.setCustomerId(msg.getCustomerId()); + wxmpUpdateSendRecordEntity.setClientType(msg.getClientType()); + wxmpUpdateSendRecordEntity.setTemplateId(templateId); + wxmpUpdateSendRecordEntity.setGridId(msg.getGridId() == null ? "" : msg.getGridId()); + wxmpUpdateSendRecordEntity.setUserId(msg.getUserId()); + wxmpUpdateSendRecordEntity.setWxOpenId(openId); + wxmpUpdateSendRecordEntity.setBehaviorType(msg.getBehaviorType()); + wxmpUpdateSendRecordEntity.setTitle(msg.getMessageTitle()); + wxmpUpdateSendRecordEntity.setContent(msg.getMessageContent()); + wxmpUpdateSendRecordEntity.setTime(msg.getMessageTime()); + wxmpUpdateSendRecordEntity.setResult(status); + return wxmpUpdateSendRecordEntity; + } + + + private String getUserOpenId(String userId, String clientType, String openId) throws WxSubscribeException { + try { + if (WxmpMessageConstant.RESI.equals(clientType)) { + UserBasicInfoFormDTO userBasicInfoFormDTO = new UserBasicInfoFormDTO(); + userBasicInfoFormDTO.setUserId(userId); + Result userBasicInfo = epmetUserOpenFeignClient.getUserBasicInfo(userBasicInfoFormDTO); + if (userBasicInfo.getCode() != 0){ + throw new Exception(userBasicInfo.getInternalMsg()); + }else { + openId = userBasicInfo.getData().getOpenId(); + } + } else if (WxmpMessageConstant.GOV_DB.equals(clientType)) { + StaffBasicInfoFormDTO staffBasicInfoFormDTO = new StaffBasicInfoFormDTO(); + staffBasicInfoFormDTO.setStaffId(userId); + Result staffBasicInfo = epmetUserOpenFeignClient.getStaffBasicInfo(staffBasicInfoFormDTO);; + if (staffBasicInfo.getCode() != 0){ + throw new Exception(staffBasicInfo.getInternalMsg()); + }else { + openId = staffBasicInfo.getData().getOpenId(); + } + } else { + throw new WxSubscribeException("clientType有误", "", openId); + } + } catch (Exception e) { + e.printStackTrace(); + throw new WxSubscribeException("获取openId失败:" + e.getMessage(), "", ""); + } + return openId; + } + + + //获取AccessToken private Map getAccessToken(String customerId) { EnvEnum envEnum = EnvEnum.getCurrentEnv(); @@ -398,7 +603,7 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { /** * @return - * @Description 居民端、工作端-获取客户小程序模板列表 + * @Description 居民端、工作端-获取客户小程序模板列表(只包含站内信消息模板) * @author sun */ @Override @@ -430,6 +635,39 @@ public class WxmpMessageServiceImpl implements WxmpMessageService { return list;*/ } + /** + * @param formDTO + * @return java.util.List + * @Description 居民端、工作端-获取客户小程序模板列表(不包括站内信消息模板) + * @Author liushaowen + * @Date 2020/12/29 13:26 + */ + @Override + public List templateListV2(TemplateListV2FormDTO formDTO) { + String url = "https://epmet-cloud.elinkservice.cn/api/third/personaltemplate/templatelistv2"; +// String url = "http://localhost:8110/third/personaltemplate/templatelistv2"; + String data = HttpClientManager.getInstance().sendPostByJSON(url, JSON.toJSONString(formDTO)).getData(); + logger.info("ThirdLoginServiceImpl.templatelistv2:httpclient->url:" + url + ",结果->" + 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()) { + logger.error("调用epmet_third服务获取小程序消息订阅模板数据失败"); + throw new RenException(mapToResult.getCode()); + } + List resultList = (List) mapToResult.getData(); + List list = new ArrayList<>(); + //必须转换 + for(Object f:resultList){ + JSONObject json = JSON.parseObject(f.toString()); + TemplateListV2ResultDTO ff = ConvertUtils.mapToEntity(json, TemplateListV2ResultDTO.class); + list.add(ff); + } + return list; + } + /** * @return * @Description 查询客户两个端小程序对应的站内信模板Id @@ -651,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/java/com/epmet/service/impl/WxmpUpdateSendDataServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpUpdateSendDataServiceImpl.java new file mode 100644 index 0000000000..a3e1718233 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpUpdateSendDataServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.WxmpUpdateSendDataDao; +import com.epmet.dto.WxmpUpdateSendDataDTO; +import com.epmet.entity.WxmpUpdateSendDataEntity; +import com.epmet.redis.WxmpUpdateSendDataRedis; +import com.epmet.service.WxmpUpdateSendDataService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 订阅消息发送数据表(内容更新消息提醒、关注更新提醒) + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-01-04 + */ +@Service +public class WxmpUpdateSendDataServiceImpl extends BaseServiceImpl implements WxmpUpdateSendDataService { + + @Autowired + private WxmpUpdateSendDataRedis wxmpUpdateSendDataRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, WxmpUpdateSendDataDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, WxmpUpdateSendDataDTO.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 WxmpUpdateSendDataDTO get(String id) { + WxmpUpdateSendDataEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, WxmpUpdateSendDataDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(WxmpUpdateSendDataDTO dto) { + WxmpUpdateSendDataEntity entity = ConvertUtils.sourceToTarget(dto, WxmpUpdateSendDataEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(WxmpUpdateSendDataDTO dto) { + WxmpUpdateSendDataEntity entity = ConvertUtils.sourceToTarget(dto, WxmpUpdateSendDataEntity.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/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpUpdateSendRecordServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpUpdateSendRecordServiceImpl.java new file mode 100644 index 0000000000..98b61d4444 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/WxmpUpdateSendRecordServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.WxmpUpdateSendRecordDao; +import com.epmet.dto.WxmpUpdateSendRecordDTO; +import com.epmet.entity.WxmpUpdateSendRecordEntity; +import com.epmet.redis.WxmpUpdateSendRecordRedis; +import com.epmet.service.WxmpUpdateSendRecordService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 订阅消息发送记录表(内容更新消息提醒、关注更新提醒) + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2020-12-30 + */ +@Service +public class WxmpUpdateSendRecordServiceImpl extends BaseServiceImpl implements WxmpUpdateSendRecordService { + + @Autowired + private WxmpUpdateSendRecordRedis wxmpUpdateSendRecordRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, WxmpUpdateSendRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, WxmpUpdateSendRecordDTO.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 WxmpUpdateSendRecordDTO get(String id) { + WxmpUpdateSendRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, WxmpUpdateSendRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(WxmpUpdateSendRecordDTO dto) { + WxmpUpdateSendRecordEntity entity = ConvertUtils.sourceToTarget(dto, WxmpUpdateSendRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(WxmpUpdateSendRecordDTO dto) { + WxmpUpdateSendRecordEntity entity = ConvertUtils.sourceToTarget(dto, WxmpUpdateSendRecordEntity.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/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml index dcdcaab913..b361be7236 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /message @@ -131,4 +132,15 @@ thread: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 + +rocketmq: + name-server: @rocketmq.nameserver@ + producer: + group: @rocketmq.producer.group@ diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.12.6__add_subscribe_update.sql b/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.12.6__add_subscribe_update.sql new file mode 100644 index 0000000000..a14887a385 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/db/migration/V0.3.12.6__add_subscribe_update.sql @@ -0,0 +1,41 @@ +CREATE TABLE `wxmp_update_send_record` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id ', + `GRID_ID` varchar(64) DEFAULT NULL COMMENT '网格Id (居民端跟网格有关的则有值,工作端以及一些居民端和网格没关的存*)', + `CLIENT_TYPE` varchar(64) NOT NULL COMMENT '所属端类型 居民端:resi 工作端:gov', + `TEMPLATE_ID` varchar(64) NOT NULL COMMENT '消息模板Id ', + `USER_ID` varchar(64) NOT NULL COMMENT '用户Id', + `WX_OPEN_ID` varchar(64) DEFAULT NULL COMMENT 'openId ', + `BEHAVIOR_TYPE` varchar(128) NOT NULL COMMENT '行为类型: 关注更新提醒、内容更新消息通知', + `TITLE` varchar(128) NOT NULL COMMENT '消息标题 ', + `CONTENT` varchar(1024) NOT NULL COMMENT '消息内容 ', + `TIME` datetime NOT NULL COMMENT '消息时间 ', + `RESULT` varchar(32) NOT NULL COMMENT '发送结果(成功:success 失败:error)', + `REASON` varchar(1024) DEFAULT NULL COMMENT '发送失败的原因,成功可以不记录', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标识', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订阅消息发送记录表(内容更新消息提醒、关注更新提醒)'; + +CREATE TABLE `wxmp_update_send_data` ( + `ID` varchar(32) NOT NULL COMMENT '主键', + `SOURCE_TYPE` varchar(32) NOT NULL COMMENT '来源类型 (话题:topic 议题:issue 项目project 爱心互助heart 党建声音voice)', + `SOURCE_ID` varchar(32) NOT NULL COMMENT '来源对应ID', + `CUSTOMER_ID` varchar(32) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(32) DEFAULT NULL COMMENT '组织ID agencyId', + `GRID_ID` varchar(32) DEFAULT NULL COMMENT '网格ID ', + `GROUP_ID` varchar(32) DEFAULT NULL COMMENT '小组Id', + `STAFF_ID` varchar(32) DEFAULT NULL COMMENT '工作人员Id', + `MSG_USER_ID` varchar(1024) DEFAULT NULL COMMENT '消息接收者', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='订阅消息发送数据表(内容更新消息提醒、关注更新提醒)'; 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-message/epmet-message-server/src/main/resources/mapper/SystemMessageDao.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/SystemMessageDao.xml new file mode 100644 index 0000000000..a5ce6d9da5 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/SystemMessageDao.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpUpdateSendDataDao.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpUpdateSendDataDao.xml new file mode 100644 index 0000000000..3067841eaf --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpUpdateSendDataDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpUpdateSendRecordDao.xml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpUpdateSendRecordDao.xml new file mode 100644 index 0000000000..481ec4beea --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/mapper/WxmpUpdateSendRecordDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/constants/PrivacyType.java b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/constants/PrivacyType.java new file mode 100644 index 0000000000..3564f3ad1c --- /dev/null +++ b/epmet-module/epmet-oss/epmet-oss-client/src/main/java/com/epmet/constants/PrivacyType.java @@ -0,0 +1,9 @@ +package com.epmet.constants; + +/** + * 隐私类型 + */ +public interface PrivacyType { + String INTERNAL = "internal"; + String EXTERNAL = "external"; +} diff --git a/epmet-module/epmet-oss/epmet-oss-server/Dockerfile b/epmet-module/epmet-oss/epmet-oss-server/Dockerfile index ca3830ee6c..4c41cd08cb 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/Dockerfile +++ b/epmet-module/epmet-oss/epmet-oss-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./epmet-oss.jar EXPOSE 8083 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-prod.yml index 5fae8446ce..c58715456a 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-oss/epmet-oss-server/deploy/docker-compose-prod.yml @@ -3,7 +3,7 @@ services: epmet-oss-server: container_name: epmet-oss-server-prod # image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-test/epmet-oss-server:0.3.2 - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-oss-server:0.3.25 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-oss-server:0.3.28 ports: - "8083:8083" network_mode: host # 使用现有网络 @@ -16,4 +16,4 @@ services: resources: limits: cpus: '0.1' - memory: 600M \ No newline at end of file + memory: 600M diff --git a/epmet-module/epmet-oss/epmet-oss-server/pom.xml b/epmet-module/epmet-oss/epmet-oss-server/pom.xml index 3934ecd31a..a29c4474cc 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/pom.xml +++ b/epmet-module/epmet-oss/epmet-oss-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.25 + 0.3.28 com.epmet epmet-oss diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java index fd4002d57b..0eabc11add 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AbstractCloudStorageService.java @@ -9,6 +9,7 @@ package com.epmet.cloud; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constants.PrivacyType; import org.apache.commons.lang3.StringUtils; import java.io.IOException; @@ -31,34 +32,48 @@ public abstract class AbstractCloudStorageService { * @param suffix 后缀 * @return 返回上传路径 */ - public String getPath(String prefix, String suffix) { + public String getPath(String prefix, String suffix, String privacy) { //生成uuid String uuid = UUID.randomUUID().toString().replaceAll("-", ""); //文件路径 String path = DateUtils.format(new Date(), "yyyyMMdd") + "/" + uuid; if(StringUtils.isNotBlank(prefix)){ - path = prefix + "/" + path; + path = prefix + "/" + getPrivacyPath(privacy) + path; } return path + "." + suffix; } + /** + * @Description 根据隐私级别获取隐私文件夹(在epmet-cloud-internal这个bucket正式启用之前生效) + * @return + * @author wxz + * @date 2021.01.04 16:55 + */ + private String getPrivacyPath(String privacy) { + if (PrivacyType.INTERNAL.equalsIgnoreCase(privacy)) { + return "internal/"; + } + return ""; + } + /** * 文件上传 * @param data 文件字节数组 * @param path 文件路径,包含文件名 * @return 返回http地址 */ - public abstract String upload(byte[] data, String path); + public abstract String upload(byte[] data, String path, String privacyType); /** * 文件上传 * @param data 文件字节数组 * @param suffix 后缀 + * @param privacyType 隐私类型,默认external,外部 * @return 返回http地址 */ - public abstract String uploadSuffix(byte[] data, String suffix); + public abstract String uploadSuffix(byte[] data, String suffix, String privacyType); /** * 文件上传 @@ -66,7 +81,7 @@ public abstract class AbstractCloudStorageService { * @param path 文件路径,包含文件名 * @return 返回http地址 */ - public abstract String upload(InputStream inputStream, String path); + public abstract String upload(InputStream inputStream, String path, String privacyType); /** * 文件上传 @@ -74,12 +89,12 @@ public abstract class AbstractCloudStorageService { * @param suffix 后缀 * @return 返回http地址 */ - public abstract String uploadSuffix(InputStream inputStream, String suffix); + public abstract String uploadSuffix(InputStream inputStream, String suffix, String privacyType); /** * 文件下载 * sun */ - public abstract void down() throws IOException; + public abstract void down(String privacyType) throws IOException; } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java index e55449ad0f..472609fbcd 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/AliyunCloudStorageService.java @@ -12,6 +12,7 @@ import com.aliyun.oss.OSSClient; import com.aliyun.oss.model.DownloadFileRequest; import com.aliyun.oss.model.DownloadFileResult; import com.epmet.commons.tools.exception.RenException; +import com.epmet.constants.PrivacyType; import com.epmet.exception.ModuleErrorCode; import java.io.ByteArrayInputStream; @@ -29,39 +30,57 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { this.config = config; } + /** + * @Description 根据隐私类型获取属性。传递internal的时候会返回内部的,否则返回外部的,即公开的 + * @return + * @author wxz + * @date 2021.01.04 13:49 + */ + private CloudStorageConfig.AliyunCloudStorageConfigProps getPropsByprivacyType(String privacyType) { + if (PrivacyType.INTERNAL.equalsIgnoreCase(privacyType)) { + return config.getAliyun().getInternal(); + } else { + return config.getAliyun().getExternal(); + } + } + @Override - public String upload(byte[] data, String path) { - return upload(new ByteArrayInputStream(data), path); + public String upload(byte[] data, String path, String privacyType) { + return upload(new ByteArrayInputStream(data), path, privacyType); } @Override - public String upload(InputStream inputStream, String path) { - OSSClient client = new OSSClient(config.getAliyunEndPoint(), config.getAliyunAccessKeyId(), - config.getAliyunAccessKeySecret()); + public String upload(InputStream inputStream, String path, String privacyType) { + CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); + OSSClient client = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), + props.getAliyunAccessKeySecret()); try { - client.putObject(config.getAliyunBucketName(), path, inputStream); + client.putObject(props.getAliyunBucketName(), path, inputStream); client.shutdown(); } catch (Exception e){ throw new RenException(ModuleErrorCode.OSS_UPLOAD_FILE_ERROR, e, ""); } - return config.getAliyunDomain() + "/" + path; + return props.getAliyunDomain() + "/" + path; } @Override - public String uploadSuffix(byte[] data, String suffix) { - return upload(data, getPath(config.getAliyunPrefix(), suffix)); + public String uploadSuffix(byte[] data, String suffix, String privacyType) { + CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); + return upload(data, getPath(props.getAliyunPrefix(), suffix, privacyType), privacyType); } @Override - public String uploadSuffix(InputStream inputStream, String suffix) { - return upload(inputStream, getPath(config.getAliyunPrefix(), suffix)); + public String uploadSuffix(InputStream inputStream, String suffix, String privacyType) { + CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); + return upload(inputStream, getPath(props.getAliyunPrefix(), suffix, privacyType), privacyType); } @Override - public void down() throws IOException { - OSSClient client = new OSSClient(config.getAliyunEndPoint(), config.getAliyunAccessKeyId(), - config.getAliyunAccessKeySecret()); + public void down(String privacyType) throws IOException { + CloudStorageConfig.AliyunCloudStorageConfigProps props = getPropsByprivacyType(privacyType); + OSSClient client = new OSSClient(props.getAliyunEndPoint(), props.getAliyunAccessKeyId(), + props.getAliyunAccessKeySecret()); try { /* @@ -88,7 +107,7 @@ public class AliyunCloudStorageService extends AbstractCloudStorageService { }*/ //方式三 - DownloadFileRequest downloadFileRequest = new DownloadFileRequest(config.getAliyunBucketName(), "epmet/test/20201103/198f3c11490a44eb964c5c8e9989a507.jpg"); + DownloadFileRequest downloadFileRequest = new DownloadFileRequest(props.getAliyunBucketName(), "epmet/test/20201103/198f3c11490a44eb964c5c8e9989a507.jpg"); downloadFileRequest.setDownloadFile("C:/Users/Administrator/Desktop/dd/4.jpg");// 本地下载文件名称 downloadFileRequest.setPartSize(1 * 1024 * 1024);// 分片大小,取值范围为1B~5GB。 downloadFileRequest.setTaskNum(10);//10个任务并发下载,默认值为1 diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/CloudStorageConfig.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/CloudStorageConfig.java index 87be3fec93..ce0c102162 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/CloudStorageConfig.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/CloudStorageConfig.java @@ -56,29 +56,29 @@ public class CloudStorageConfig implements Serializable { @NotBlank(message="{qiniu.bucketname.require}", groups = QiniuGroup.class) private String qiniuBucketName; - @ApiModelProperty(value = "阿里云绑定的域名") - @NotBlank(message="{aliyun.domain.require}", groups = AliyunGroup.class) - @URL(message = "{aliyun.domain.url}", groups = AliyunGroup.class) - private String aliyunDomain; - - @ApiModelProperty(value = "阿里云路径前缀") - private String aliyunPrefix; - - @ApiModelProperty(value = "阿里云EndPoint") - @NotBlank(message="{aliyun.endPoint.require}", groups = AliyunGroup.class) - private String aliyunEndPoint; - - @ApiModelProperty(value = "阿里云AccessKeyId") - @NotBlank(message="{aliyun.accesskeyid.require}", groups = AliyunGroup.class) - private String aliyunAccessKeyId; - - @ApiModelProperty(value = "阿里云AccessKeySecret") - @NotBlank(message="{aliyun.accesskeysecret.require}", groups = AliyunGroup.class) - private String aliyunAccessKeySecret; - - @ApiModelProperty(value = "阿里云BucketName") - @NotBlank(message="{aliyun.bucketname.require}", groups = AliyunGroup.class) - private String aliyunBucketName; + //@ApiModelProperty(value = "阿里云绑定的域名") + //@NotBlank(message="{aliyun.domain.require}", groups = AliyunGroup.class) + //@URL(message = "{aliyun.domain.url}", groups = AliyunGroup.class) + //private String aliyunDomain; + // + //@ApiModelProperty(value = "阿里云路径前缀") + //private String aliyunPrefix; + // + //@ApiModelProperty(value = "阿里云EndPoint") + //@NotBlank(message="{aliyun.endPoint.require}", groups = AliyunGroup.class) + //private String aliyunEndPoint; + // + //@ApiModelProperty(value = "阿里云AccessKeyId") + //@NotBlank(message="{aliyun.accesskeyid.require}", groups = AliyunGroup.class) + //private String aliyunAccessKeyId; + // + //@ApiModelProperty(value = "阿里云AccessKeySecret") + //@NotBlank(message="{aliyun.accesskeysecret.require}", groups = AliyunGroup.class) + //private String aliyunAccessKeySecret; + // + //@ApiModelProperty(value = "阿里云BucketName") + //@NotBlank(message="{aliyun.bucketname.require}", groups = AliyunGroup.class) + //private String aliyunBucketName; @ApiModelProperty(value = "腾讯云绑定的域名") @NotBlank(message="{qcloud.domain.require}", groups = QcloudGroup.class) @@ -125,4 +125,44 @@ public class CloudStorageConfig implements Serializable { @NotBlank(message="{local.path.url}", groups = LocalGroup.class) private String localPath; + private AliyunCloudStorageConfig aliyun; + /** + * 阿里云存储配置 + */ + @Data + public static class AliyunCloudStorageConfig { + private AliyunCloudStorageConfigProps internal; + private AliyunCloudStorageConfigProps external; + } + + /** + * 阿里云存储配置属性 + */ + @Data + public static class AliyunCloudStorageConfigProps { + @ApiModelProperty(value = "阿里云绑定的域名") + @NotBlank(message="{aliyun.domain.require}", groups = AliyunGroup.class) + @URL(message = "{aliyun.domain.url}", groups = AliyunGroup.class) + private String aliyunDomain; + + @ApiModelProperty(value = "阿里云路径前缀") + private String aliyunPrefix; + + @ApiModelProperty(value = "阿里云EndPoint") + @NotBlank(message="{aliyun.endPoint.require}", groups = AliyunGroup.class) + private String aliyunEndPoint; + + @ApiModelProperty(value = "阿里云AccessKeyId") + @NotBlank(message="{aliyun.accesskeyid.require}", groups = AliyunGroup.class) + private String aliyunAccessKeyId; + + @ApiModelProperty(value = "阿里云AccessKeySecret") + @NotBlank(message="{aliyun.accesskeysecret.require}", groups = AliyunGroup.class) + private String aliyunAccessKeySecret; + + @ApiModelProperty(value = "阿里云BucketName") + @NotBlank(message="{aliyun.bucketname.require}", groups = AliyunGroup.class) + private String aliyunBucketName; + } + } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java index 9661e5f054..b5493c02b2 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/FastDFSCloudStorageService.java @@ -35,12 +35,12 @@ public class FastDFSCloudStorageService extends AbstractCloudStorageService { } @Override - public String upload(byte[] data, String path) { - return upload(new ByteArrayInputStream(data), path); + public String upload(byte[] data, String path, String privacyType) { + return upload(new ByteArrayInputStream(data), path, privacyType); } @Override - public String upload(InputStream inputStream, String suffix) { + public String upload(InputStream inputStream, String suffix, String privacyType) { StorePath storePath; try { storePath = defaultGenerateStorageClient.uploadFile("group1", inputStream, inputStream.available(), suffix); @@ -52,17 +52,17 @@ public class FastDFSCloudStorageService extends AbstractCloudStorageService { } @Override - public String uploadSuffix(byte[] data, String suffix) { - return upload(data, suffix); + public String uploadSuffix(byte[] data, String suffix, String privacyType) { + return upload(data, suffix, privacyType); } @Override - public String uploadSuffix(InputStream inputStream, String suffix) { - return upload(inputStream, suffix); + public String uploadSuffix(InputStream inputStream, String suffix, String privacyType) { + return upload(inputStream, suffix, privacyType); } @Override - public void down() throws IOException { + public void down(String privacyType) throws IOException { } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java index 71c17580c5..8143edaa0b 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/LocalCloudStorageService.java @@ -29,12 +29,12 @@ public class LocalCloudStorageService extends AbstractCloudStorageService { } @Override - public String upload(byte[] data, String path) { - return upload(new ByteArrayInputStream(data), path); + public String upload(byte[] data, String path, String privacyType) { + return upload(new ByteArrayInputStream(data), path, privacyType); } @Override - public String upload(InputStream inputStream, String path) { + public String upload(InputStream inputStream, String path, String privacyType) { File file = new File(config.getLocalPath() + File.separator + path); try { FileUtils.copyToFile(inputStream, file); @@ -45,17 +45,17 @@ public class LocalCloudStorageService extends AbstractCloudStorageService { } @Override - public String uploadSuffix(byte[] data, String suffix) { - return upload(data, getPath(config.getLocalPrefix(), suffix)); + public String uploadSuffix(byte[] data, String suffix, String privacyType) { + return upload(data, getPath(config.getLocalPrefix(), suffix, privacyType), privacyType); } @Override - public String uploadSuffix(InputStream inputStream, String suffix) { - return upload(inputStream, getPath(config.getLocalPrefix(), suffix)); + public String uploadSuffix(InputStream inputStream, String suffix, String privacyType) { + return upload(inputStream, getPath(config.getLocalPrefix(), suffix, privacyType), privacyType); } @Override - public void down() throws IOException { + public void down(String privacyType) throws IOException { } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java index 22d7da2219..80c5e494f4 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QcloudCloudStorageService.java @@ -48,12 +48,12 @@ public class QcloudCloudStorageService extends AbstractCloudStorageService { } @Override - public String upload(byte[] data, String path) { - return upload(new ByteArrayInputStream(data), path); + public String upload(byte[] data, String path, String privacyType) { + return upload(new ByteArrayInputStream(data), path, privacyType); } @Override - public String upload(InputStream inputStream, String path) { + public String upload(InputStream inputStream, String path, String privacyType) { try { COSClient client = new COSClient(credentials, clientConfig); @@ -75,17 +75,17 @@ public class QcloudCloudStorageService extends AbstractCloudStorageService { } @Override - public String uploadSuffix(byte[] data, String suffix) { - return upload(data, getPath(config.getQcloudPrefix(), suffix)); + public String uploadSuffix(byte[] data, String suffix, String privacyType) { + return upload(data, getPath(config.getQcloudPrefix(), suffix, privacyType), privacyType); } @Override - public String uploadSuffix(InputStream inputStream, String suffix) { - return upload(inputStream, getPath(config.getQcloudPrefix(), suffix)); + public String uploadSuffix(InputStream inputStream, String suffix, String privacyType) { + return upload(inputStream, getPath(config.getQcloudPrefix(), suffix, privacyType), privacyType); } @Override - public void down() throws IOException { + public void down(String privacyType) throws IOException { } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java index 0fa9ee9f7e..16515203dd 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/cloud/QiniuCloudStorageService.java @@ -45,7 +45,7 @@ public class QiniuCloudStorageService extends AbstractCloudStorageService { } @Override - public String upload(byte[] data, String path) { + public String upload(byte[] data, String path, String privacyType) { try { Response res = uploadManager.put(data, path, token); if (!res.isOK()) { @@ -59,27 +59,27 @@ public class QiniuCloudStorageService extends AbstractCloudStorageService { } @Override - public String upload(InputStream inputStream, String path) { + public String upload(InputStream inputStream, String path, String privacyType) { try { byte[] data = IOUtils.toByteArray(inputStream); - return this.upload(data, path); + return this.upload(data, path, privacyType); } catch (IOException e) { throw new RenException(ModuleErrorCode.OSS_UPLOAD_FILE_ERROR, e, ""); } } @Override - public String uploadSuffix(byte[] data, String suffix) { - return upload(data, getPath(config.getQiniuPrefix(), suffix)); + public String uploadSuffix(byte[] data, String suffix, String privacyType) { + return upload(data, getPath(config.getQiniuPrefix(), suffix, privacyType), privacyType); } @Override - public String uploadSuffix(InputStream inputStream, String suffix) { - return upload(inputStream, getPath(config.getQiniuPrefix(), suffix)); + public String uploadSuffix(InputStream inputStream, String suffix, String privacyType) { + return upload(inputStream, getPath(config.getQiniuPrefix(), suffix, privacyType), privacyType); } @Override - public void down() throws IOException { + public void down(String privacyType) throws IOException { } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java index 0f78958d58..1559d4160b 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java @@ -42,7 +42,6 @@ import springfox.documentation.annotations.ApiIgnore; import javax.imageio.ImageIO; import java.awt.image.BufferedImage; -import java.io.IOException; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; @@ -114,7 +113,7 @@ public class OssController { //上传文件 String extension = FilenameUtils.getExtension(file.getOriginalFilename()); - String url = OssFactory.build().uploadSuffix(file.getBytes(), extension); + String url = OssFactory.build().uploadSuffix(file.getBytes(), extension, null); //保存文件信息 OssEntity ossEntity = new OssEntity(); @@ -132,7 +131,7 @@ public class OssController { @DeleteMapping @ApiOperation(value = "删除") // @LogOperation("删除") - public Result delete(@RequestBody Long[] ids){ + public Result delete(@RequestBody String[] ids){ ossService.deleteBatchIds(Arrays.asList(ids)); return new Result(); @@ -147,17 +146,17 @@ public class OssController { **/ @PostMapping("uploadimg") public Result uploadImg(@RequestParam("file") MultipartFile file) { - return ossService.uploadImg(file); + return ossService.uploadImg(file, null); } @PostMapping("uploadwximg") public Result uploadWxImg(@RequestPart("media") MultipartFile media) { - return ossService.uploadImg(media); + return ossService.uploadImg(media, null); } @PostMapping("uploadqrcode") public Result uploadQrCode(@RequestPart(value = "file") MultipartFile file) { - return ossService.uploadImg(file); + return ossService.uploadImg(file, null); } /** @@ -183,7 +182,7 @@ public class OssController { , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); } - return ossService.uploadImg(file); + return ossService.uploadImg(file, null); } @PostMapping("function/upload") @@ -203,7 +202,7 @@ public class OssController { , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); } - return ossService.uploadImg(file); + return ossService.uploadImg(file, null); } @PostMapping("article/upload") @@ -225,7 +224,7 @@ public class OssController { , EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); } - return ossService.uploadImg(file); + return ossService.uploadImg(file, null); } @@ -255,7 +254,7 @@ public class OssController { , EpmetErrorCode.OPER_UPLOAD_IMG_SIZE_ERROR.getMsg()); } - return ossService.uploadImg(file); + return ossService.uploadImg(file, null); } /** @@ -269,7 +268,57 @@ public class OssController { //byte[] byteFile = file.getBytes(); InputStream inputStream = new ByteArrayInputStream(byteFile); MultipartFile filse = new MockMultipartFile(ContentType.APPLICATION_OCTET_STREAM.toString(), inputStream); - return ossService.extUpload(filse,fileName); + return ossService.extUpload(filse,fileName, null); + } + + /** + * @param file + * @Description 项目附件上传 + * @Author sun + **/ + @PostMapping("uploadvariedfile") + public Result uploadVariedFile(@RequestParam("file") MultipartFile file) { + String fileName = file.getOriginalFilename(); + String format = "-" + fileName.substring(fileName.lastIndexOf(".") + NumConstant.ONE) + "-"; + format = format.toLowerCase(); + //1.校验上传文件类型 + if (!ModuleConstant.PROJECT_FILE_CONTENT.contains(format)) { + log.error(String.format("上传文件类型格式错误,暂不支持此类文件上传,文件名->%s", fileName)); + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode(), EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg()); + } + + long size = file.getSize(); + //2.校验文件体积大小 + long maxSize = 0; + if (ModuleConstant.PROJECT_FILE_IMAGE.contains(format)) {//单个图片10M + maxSize = 10 * 1024 * 1024; + } else if (ModuleConstant.PROJECT_FILE_DOC.contains(format)) {//单个文件5M + maxSize = 5 * 1024 * 1024; + } else if (ModuleConstant.PROJECT_FILE_VIDEO.contains(format)) {//单个视频10M + maxSize = 10 * 1024 * 1024; + } + if (size > maxSize) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode(), EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); + } + + return ossService.uploadVariedFile(file); + } + + /** + * @param file + * @Description 上传语音文件 + * @Author sun + **/ + @PostMapping("uploadvoice") + public Result uploadVoice(@RequestParam("file") MultipartFile file) { + // 校验文件体积,不超过20M + long maxSize = 20 * 1024 * 1024; + long size = file.getSize(); + if (size > maxSize) { + throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode(), + EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg()); + } + return ossService.uploadVoice(file); } } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java index c67fec06f2..3253f78527 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java @@ -28,7 +28,11 @@ public interface OssService extends BaseService { int insertOssEntity(OssEntity ossEntity); - Result uploadImg(MultipartFile file); + Result uploadImg(MultipartFile file, String privacy); - Result extUpload(MultipartFile file, String fileName); + Result extUpload(MultipartFile file, String fileName, String privacy); + + Result uploadVariedFile(MultipartFile file); + + Result uploadVoice(MultipartFile file); } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java index cc44456c7e..3effd64fb8 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java @@ -16,6 +16,7 @@ import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; +import com.epmet.constants.PrivacyType; import com.epmet.dao.OssDao; import com.epmet.dto.result.UploadImgResultDTO; import com.epmet.entity.OssEntity; @@ -36,7 +37,7 @@ public class OssServiceImpl extends BaseServiceImpl implement @Override public PageData page(Map params) { IPage page = baseDao.selectPage( - getPage(params, Constant.CREATE_DATE, false), + getPage(params, Constant.CREATED_TIME, false), new QueryWrapper<>() ); return getPageData(page, OssEntity.class); @@ -48,7 +49,7 @@ public class OssServiceImpl extends BaseServiceImpl implement } @Override - public Result uploadImg(MultipartFile file) { + public Result uploadImg(MultipartFile file, String privacy) { if (file.isEmpty()) { return new Result().error(ModuleErrorCode.UPLOAD_FILE_EMPTY); } @@ -56,7 +57,7 @@ public class OssServiceImpl extends BaseServiceImpl implement String extension = FilenameUtils.getExtension(file.getOriginalFilename()); String url = null; try { - url = OssFactory.build().uploadSuffix(file.getBytes(), extension); + url = OssFactory.build().uploadSuffix(file.getBytes(), extension, privacy); } catch (IOException e) { e.printStackTrace(); logger.error("图片上传异常"); @@ -74,9 +75,9 @@ public class OssServiceImpl extends BaseServiceImpl implement } @Override - public Result extUpload(MultipartFile file, String fileName) { + public Result extUpload(MultipartFile file, String fileName, String privacy) { try { - OssFactory.build().down(); + OssFactory.build().down(privacy); } catch (IOException e) { e.printStackTrace(); } @@ -88,7 +89,7 @@ public class OssServiceImpl extends BaseServiceImpl implement String extension = FilenameUtils.getExtension(fileName); String url = null; try { - url = OssFactory.build().uploadSuffix(file.getBytes(), extension); + url = OssFactory.build().uploadSuffix(file.getBytes(), extension, privacy); } catch (IOException e) { e.printStackTrace(); logger.error("图片上传异常"); @@ -104,4 +105,62 @@ public class OssServiceImpl extends BaseServiceImpl implement dto.setUrl(url); return new Result().ok(dto); } + + @Override + public Result uploadVariedFile(MultipartFile file) { + if (file.isEmpty()) { + return new Result().error(ModuleErrorCode.UPLOAD_FILE_EMPTY); + } + //上传文件 + String extension = FilenameUtils.getExtension(file.getOriginalFilename()); + String url = null; + try { + url = OssFactory.build().uploadSuffix(file.getBytes(), extension, PrivacyType.INTERNAL); + } catch (IOException e) { + e.printStackTrace(); + logger.error("文件上传异常"); + throw new RenException("文件上传异常"); + } + //保存文件信息 + OssEntity ossEntity = new OssEntity(); + ossEntity.setUrl(url); + baseDao.insert(ossEntity); + //文件信息 + UploadImgResultDTO dto = new UploadImgResultDTO(); + dto.setUrl(url); + return new Result().ok(dto); + } + + + /** + * @param file + * @Description 上传语音 + * @Author sun + **/ + @Override + public Result uploadVoice(MultipartFile file) { + if (file.isEmpty()) { + return new Result().error(ModuleErrorCode.UPLOAD_FILE_EMPTY); + } + //上传文件 + String extension = FilenameUtils.getExtension(file.getOriginalFilename()); + String url = null; + try { + url = OssFactory.build().uploadSuffix(file.getBytes(), extension, null); + } catch (IOException e) { + e.printStackTrace(); + logger.error("语音上传异常"); + throw new RenException("语音上传异常"); + + } + //保存文件信息 + OssEntity ossEntity = new OssEntity(); + ossEntity.setUrl(url); + baseDao.insert(ossEntity); + //文件信息 + UploadImgResultDTO dto = new UploadImgResultDTO(); + dto.setUrl(url); + return new Result().ok(dto); + } + } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java index efa289bd61..a89b14fbd1 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java @@ -26,4 +26,25 @@ public interface ModuleConstant extends Constant { * jpg文件类型 */ String FILE_CONTENT_TYPE_JPG = "image/jpg"; + + /** + * 项目附件-允许上传的文件类型 + */ + String PROJECT_FILE_CONTENT = "-jpg-png-jpeg-bmp-gif-pdf-ppt-pptx-doc-docx-xls-xlsx-mp4-avi-mov-rmvb-rm-wmv-"; + /** + * 项目附件-允许的图片类型 + */ + String PROJECT_FILE_IMAGE = "-jpg-png-jpeg-bmp-gif-"; + /** + * 项目附件-允许的文件类型 + */ + String PROJECT_FILE_DOC = "-pdf-ppt-pptx-doc-docx-xls-xlsx-"; + /** + * 项目附件-允许的音频类型 + */ + String PROJECT_FILE_VOICE = "-mp3-wma-m4a-"; + /** + * 项目附件-允许的视频类型 + */ + String PROJECT_FILE_VIDEO = "-mp4-avi-mov-rmvb-rm-wmv-"; } diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml index a6d32431be..5b6b4b9e75 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /oss @@ -133,4 +134,10 @@ pagehelper: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiAroundPartyPointRankFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiAroundPartyPointRankFormDTO.java new file mode 100644 index 0000000000..ea20744f4c --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/ResiAroundPartyPointRankFormDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @Description 身边党员 积分排行接口 入参 + * @Auth zy + */ +@Data +public class ResiAroundPartyPointRankFormDTO implements Serializable { + private static final long serialVersionUID = 1534061512200591149L; + + /** + * 页码 + * */ + @Min(value = 1) + private Integer pageNo = 1; + + /** + * 每页数据条数 + * */ + private Integer pageSize = 10; + + /** + * 身边党员 grid 社区党员community + * */ + private String scope; + + /** + * 本月 monthly 总排行 all; + * */ + private String type; + + /** + * 当前网格id + * */ + private String gridId; + + /** + * 通过网格id,获取到的 网格下的 认证成功的党员 的用户id + * */ + private List userIds; +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiAroundPartyPointRankResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiAroundPartyPointRankResultDTO.java new file mode 100644 index 0000000000..33c9ba5ffb --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiAroundPartyPointRankResultDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 身边党员 积分排行接口返参DTO + * @Auth zy + */ +@Data +public class ResiAroundPartyPointRankResultDTO implements Serializable { + private static final long serialVersionUID = 685408245193506541L; + + /** + * 排序 + * */ + private Integer ranking; + + /** + * 积分 + * */ + private Integer point; + + /** + * 头像 + * */ + private String userHeadPhoto; + + /** + * 名称 + * */ + private String realName; + + /** + * 用户id + * */ + private String userId; +} 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/Dockerfile b/epmet-module/epmet-point/epmet-point-server/Dockerfile index eccf5af01b..9268360dd7 100644 --- a/epmet-module/epmet-point/epmet-point-server/Dockerfile +++ b/epmet-module/epmet-point/epmet-point-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./epmet-point.jar EXPOSE 8090 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml index 19dad360dd..d582216f11 100644 --- a/epmet-module/epmet-point/epmet-point-server/pom.xml +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -140,6 +140,12 @@ false + + + 5 + 8 + 10 + 30 https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -175,6 +181,12 @@ false + + + 5 + 8 + 10 + 30 https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -210,6 +222,12 @@ true + + + 5 + 8 + 10 + 30 https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 @@ -222,7 +240,7 @@ --> 8112 - test + prod @@ -245,6 +263,12 @@ true + + + 5 + 8 + 10 + 30 https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/AroundPartyConstant.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/AroundPartyConstant.java new file mode 100644 index 0000000000..43a1a8498a --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/common/enu/AroundPartyConstant.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.common.enu; + +import com.epmet.commons.tools.constant.Constant; + +/** + * 身边党员-积分排行 入参常量 + * + * @author Mark sunlightcs@gmail.com + * @since 1.1.0 + */ +public interface AroundPartyConstant extends Constant { + + String ALL = "all"; + + String MONTHLY = "monthly"; + + String GRID = "grid"; + + String COMMUNITY = "community"; +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/AsyncConfig.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/AsyncConfig.java new file mode 100644 index 0000000000..2573cbd4ab --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/config/AsyncConfig.java @@ -0,0 +1,49 @@ +package com.epmet.config; + +import com.epmet.properties.ThreadProperties; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.scheduling.annotation.EnableAsync; +import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; + +import java.util.concurrent.Executor; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.ThreadPoolExecutor; + +/** + * 线程池配置类 + */ +@Configuration +@EnableConfigurationProperties(ThreadProperties.class) +@EnableAsync +public class AsyncConfig { + + @Autowired + private ThreadProperties threadProperties; + + @Bean + public Executor executor() { + ThreadProperties.ThreadPoolProperties threadPoolProps = threadProperties.getThreadPool(); + + ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); + executor.setCorePoolSize(threadPoolProps.getCorePoolSize()); + executor.setMaxPoolSize(threadPoolProps.getMaxPoolSize()); + executor.setQueueCapacity(threadPoolProps.getQueueCapacity()); + executor.setThreadNamePrefix("epmet-point-"); + // rejection-policy:当pool已经达到max size的时候,如何处理新任务 + // CALLER_RUNS:不在新线程中执行任务,而是由调用者所在的线程来执行 + executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); //对拒绝task的处理策略 + executor.setKeepAliveSeconds(threadPoolProps.getKeepAlive()); + executor.initialize(); + return executor; + } + + @Bean + public ExecutorService executorService() { + ThreadPoolTaskExecutor executor = (ThreadPoolTaskExecutor) executor(); + return executor.getThreadPoolExecutor(); + } + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java index 535b717e0c..f610a25df6 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java @@ -97,4 +97,3 @@ public class AdjustmentController { return new Result(); } } - diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java index df85fc7a91..ed6f5c05e6 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/MqPointCallbackController.java @@ -117,5 +117,35 @@ public class MqPointCallbackController { log.info("pubActiveLive consumer success,formDTO:{}", JSON.toJSONString(formList)); return new Result().ok(true); } + + /** + * @Description 楼院小组积分事件统一回调入口 + * @param mqMsg + * @return com.epmet.commons.tools.utils.Result + * @author wangc + * @date 2020.12.23 09:33 + */ + @RequestMapping("resigrouppointcallback") + public Result resiGroupPointCallback(@RequestBody ReceiveMqMsg mqMsg){ + log.debug("resi_group point event callback receive mqMsg:{}", JSON.toJSONString(mqMsg)); + if (mqMsg == null || StringUtils.isBlank(mqMsg.getMsg())) { + log.warn("resi_group point event mqMsg is empty"); + return new Result().ok(true); + } + List formList = JSON.parseArray(mqMsg.getMsg(), BasePointEventMsg.class); + + try { + + formList.forEach(obj -> { + userPointActionLogService.grantPointByEvent(obj.getEventTag(),obj); + }); + + } catch (Exception e) { + logger.error("resi_group point event callback fail", e); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getMsg()); + } + log.info("resi_group point event callback success,formDTO:{}", JSON.toJSONString(formList)); + return new Result().ok(true); + } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java index f4e5ce6bb4..5c3b666fa1 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java @@ -6,11 +6,9 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.CommonPageUserFormDTO; import com.epmet.dto.form.CommonUserFormDTO; +import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; -import com.epmet.dto.result.PointExchangeResponseResultDTO; -import com.epmet.dto.result.ResiPointDetailResultDTO; -import com.epmet.dto.result.ResiPointLogListResultDTO; -import com.epmet.dto.result.ResiPointRankListResultDTO; +import com.epmet.dto.result.*; import com.epmet.service.PointVerificationLogService; import com.epmet.service.UserPointActionLogService; import com.epmet.service.UserPointStatisticalDailyService; @@ -141,4 +139,21 @@ public class ResiPointController { public Result exchangeCallback(@LoginUser TokenDto tokenDto){ return new Result().ok(pointVerificationLogService.resiExchangeCallback(tokenDto.getUserId())); } + + /** + * 身边党员-积分排行 + * 查询规则: scope : grid && type :monthly 表示:按网格统计,对本月党员增加的积分 进行排序 + * scope : grid && type :all 表示:按网格统计,对党员累计可用积分 排序 + * scope : community && type :monthly 表示:按社区统计,对本月党员增加的积分 进行排序 + * scope : community && type :all 表示:按社区统计,对党员累计可用积分 排序 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 16:17 2020-12-28 + **/ + @PostMapping("aroundparty") + public Result> aroundPartyPointRank( @RequestBody ResiAroundPartyPointRankFormDTO formDTO){ + List resultDTOS = userPointStatisticalDailyService.listAroundPartyPointRank(formDTO); + return new Result>().ok(resultDTOS); + } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java index 42d7cb404b..40c3277d6d 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java @@ -52,5 +52,5 @@ public interface UserPointActionLogDao extends BaseDao * @author wangc * @date 2020.07.31 15:11 **/ - Integer selectSumByEvent(@Param("userId") String userId, @Param("eventId") String eventId, @Param("sourceId") String sourceId, @Param("customerId") String customerId, @Param("dateCheck") Date dateCheck); + Integer selectSumByEvent(@Param("userId") String userId, @Param("eventId") String eventId, @Param("sourceId") String sourceId, @Param("customerId") String customerId, @Param("dateCheck") Date dateCheck,@Param("right")Date right); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java index 9f9783797d..63a3e68c1c 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointStatisticalDailyDao.java @@ -18,6 +18,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO; +import com.epmet.dto.result.ResiAroundPartyPointRankResultDTO; import com.epmet.dto.result.ResiPointRankResultDTO; import com.epmet.entity.UserPointStatisticalDailyEntity; import org.apache.ibatis.annotations.Mapper; @@ -62,4 +64,22 @@ public interface UserPointStatisticalDailyDao extends BaseDao + * @Author zhangyong + * @Date 09:24 2020-12-29 + **/ + List selectListGridPartyRankByUsablePoint(ResiAroundPartyPointRankFormDTO formDTO); + + /** + * 身边党员-积分排行 :按网格统计,对本月党员增加的积分 进行排序 + * @param formDTO + * @return java.util.List + * @Author zhangyong + * @Date 09:24 2020-12-29 + **/ + List selectListGridPartyRankByMonth(ResiAroundPartyPointRankFormDTO formDTO); +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/properties/ThreadProperties.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/properties/ThreadProperties.java new file mode 100644 index 0000000000..aaec7cb719 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/properties/ThreadProperties.java @@ -0,0 +1,25 @@ +package com.epmet.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; + +/** + * 线程池属性类 + */ +@ConfigurationProperties(prefix = "thread") +@Data +public class ThreadProperties { + + private ThreadPoolProperties threadPool; + + @Data + public static class ThreadPoolProperties { + private int corePoolSize; + private int maxPoolSize; + private int queueCapacity; + private int keepAlive; + + public ThreadPoolProperties() { + } + } +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java index 9d3f2d3ecf..6630a87891 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/UserPointStatisticalDailyService.java @@ -20,7 +20,9 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.UserPointStatisticalDailyDTO; +import com.epmet.dto.form.ResiAroundPartyPointRankFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; +import com.epmet.dto.result.ResiAroundPartyPointRankResultDTO; import com.epmet.dto.result.ResiPointRankListResultDTO; import com.epmet.entity.UserPointStatisticalDailyEntity; @@ -114,4 +116,13 @@ public interface UserPointStatisticalDailyService extends BaseService> + * @Author zhangyong + * @Date 16:17 2020-12-28 + **/ + List listAroundPartyPointRank(ResiAroundPartyPointRankFormDTO formDTO); +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java index 538615aaf0..8665b1921a 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointRuleServiceImpl.java @@ -25,10 +25,12 @@ import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.enums.CommonOperateTypeEnum; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.dao.PointRuleDao; import com.epmet.dao.PointRuleDefaultDao; import com.epmet.dao.RuleOperateLogDao; @@ -57,9 +59,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import java.util.*; +import java.util.concurrent.ExecutorService; import java.util.stream.Collectors; /** @@ -194,6 +195,7 @@ public class PointRuleServiceImpl extends BaseServiceImpl> customerListResult = operCrmOpenFeignClient.getAllCustomerList(); log.info("initPointRule operCrmOpenFeignClient.getAllCustomerList result:{}",JSON.toJSONString(customerListResult)); @@ -206,11 +208,42 @@ public class PointRuleServiceImpl extends BaseServiceImpl insertList = new ArrayList<>(); + List defaultEventCodeList = ruleDefaultEntities.stream().map(PointRuleDefaultEntity :: getEventCode).distinct().collect(Collectors.toList()); + List customerRule = baseDao.selectList(null); + if(!CollectionUtils.isEmpty(customerRule)){ + Map> customerRuleMap = + customerRule.stream().collect(Collectors.groupingBy(PointRuleEntity :: getCustomerId)); + customerRuleMap.forEach((customerId,ruleList) -> { + if(null != ruleList){ + List event = new LinkedList<>(defaultEventCodeList); + //取差集 + event.removeAll(ruleList.stream().map(PointRuleEntity :: getEventCode).distinct().collect(Collectors.toList())); + if(!CollectionUtils.isEmpty(event)){ + ruleDefaultEntities.stream().filter(rule -> event.contains(rule.getEventCode())).map(o -> { + PointRuleEntity entity = ConvertUtils.sourceToTarget(o, PointRuleEntity.class); + entity.setId(""); + entity.setCreatedBy(""); + entity.setCreatedTime(new Date()); + entity.setUpdatedBy(""); + entity.setUpdatedTime(new Date()); + entity.setCustomerId(customerId); + insertList.add(entity); + return entity; + }).collect(Collectors.toList()); + } + } + }); + } + + //从未被初始化的customerId List haveInitCustomerIds = baseDao.selectCustomerIds(); if (haveInitCustomerIds == null) { haveInitCustomerIds = new ArrayList<>(); } - List insertList = new ArrayList<>(); + for (PointRuleDefaultEntity defaultRule : ruleDefaultEntities) { for (CustomerDTO customerDTO : customerDTOList) { if (haveInitCustomerIds.contains(customerDTO.getId())) { @@ -218,15 +251,27 @@ public class PointRuleServiceImpl extends BaseServiceImpl { + insertList.forEach(o -> { + try { + insertOperateRecord(null, o,null, CommonOperateTypeEnum.ADD.getCode()); + }catch (Exception e) { + log.error("异步插入积分规则操作记录,错误信息:{}", ExceptionUtils.getErrorStackTrace(e)); + } + }); + }); + InitPointRuleResultDTO result = new InitPointRuleResultDTO(); result.setCustomerTotal(customerDTOList.size()); result.setInitedTotal(insertList.size()); diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java index 543fd72ad3..3fce5f3edd 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java @@ -189,8 +189,7 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl【%s】", JSON.toJSON(event))); throw new RenException("无法识别事件类型与积分规则"); } @@ -198,10 +197,13 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl NumConstant.ZERO){ //不按照sourceId查询,查询指定日期内的相关积分规则的总和 - Integer sum = baseDao.selectSumByEvent(event.getUserId(),eventCode,null,event.getCustomerId(),dateCheck); + Integer sum = baseDao.selectSumByEvent(event.getUserId(),eventCode,null,event.getCustomerId(),dateCheck,right); if(null == sum) sum = NumConstant.ZERO; if(StringUtils.equals(ModuleConstant.OPERATION_TYPE_PLUS,ruleInfo.getOperateType())){ if(ruleInfo.getPoint() < NumConstant.ZERO){ @@ -270,7 +281,7 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl【%s】", JSON.toJSON(event))); + log.warn(String.format("该用户获取此类事件的积分已达上限,详细数据->【%s】", JSON.toJSON(event))); return ; } } @@ -290,7 +301,7 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl page(Map params) { @@ -230,5 +236,104 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl listAroundPartyPointRank(ResiAroundPartyPointRankFormDTO formDTO) { + // 0、查询条件 + formDTO.setPageNo((formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize()); + List resultDTOS = new ArrayList<>(); + + // 增加边界条件 + if (StringUtils.isBlank(formDTO.getGridId()) || StringUtils.isBlank(formDTO.getScope()) || StringUtils.isBlank(formDTO.getType())){ + log.warn("入参错误 gridId:{} ; scope:{} ; type:{} ;", formDTO.getGridId(), formDTO.getScope(), formDTO.getType()); + return resultDTOS; + } + + List gridList = new ArrayList<>(); + // 1-1、获取参数中的网格id + if (AroundPartyConstant.GRID.equals(formDTO.getScope())){ + gridList.add(formDTO.getGridId()); + } + + // 1-2、获取社区(下的所有网格) 的网格id + if (AroundPartyConstant.COMMUNITY.equals(formDTO.getScope())){ + Result> gridInCommunity = govOrgOpenFeignClient.getGridIdsInCommunity(formDTO.getGridId()); + if (gridInCommunity.success() && null != gridInCommunity.getData() && gridInCommunity.getData().isEmpty()){ + log.warn("根据" + formDTO.getGridId() + "网格id, 查询不到同属于一个社区下的所有网格id"); + return resultDTOS; + } + gridList = gridInCommunity.getData(); + } + + // 2.根据网格id,获取网格下的所有党员(认证通过) + Result> partymemberInfo = resiPartyMemberOpenFeignClient.getPartymemberInfoByGridId(gridList); + if (partymemberInfo.success() && null != partymemberInfo.getData() && partymemberInfo.getData().isEmpty()){ + log.warn("根据" + formDTO.getGridId() + "网格id, 查询不到党员信息"); + return resultDTOS; + } + + // 2.1.获取认证通过党员的 用户id + List userIds = getUserIds(partymemberInfo.getData()); + formDTO.setUserIds(userIds); + + // 3.根据用户id(所有),查询积分信息,进行排名 + if (AroundPartyConstant.ALL.equals(formDTO.getType())){ + // type :all 表示:按网格(一个网格 或 社区下的所有网格)统计,对党员累计可用积分 排序 + resultDTOS = baseDao.selectListGridPartyRankByUsablePoint(formDTO); + + } else if (AroundPartyConstant.MONTHLY.equals(formDTO.getType())){ + // type :monthly 表示:按网格(一个网格 或 社区下的所有网格)统计,对本月党员增加的积分 进行排序 + resultDTOS = baseDao.selectListGridPartyRankByMonth(formDTO); + } -} \ No newline at end of file + // 4.给排好序的 身边党员-积分排行, 赋值 【头像、真实姓名】 + resultDTOS = getPartyBaseInfo(resultDTOS); + return resultDTOS; + } + + /** + * 获取认证通过的党员的 用户id + * + * @param partymemberInfo + * @return java.util.List + * @Author zhangyong + * @Date 14:11 2020-12-29 + **/ + private List getUserIds(List partymemberInfo){ + List userIds = new ArrayList<>(); + for (PartymemberInfoDTO dto : partymemberInfo){ + userIds.add(dto.getUserId()); + } + return userIds; + } + + /** + * 给排好序的 身边党员-积分排行, 赋值 【头像、真实姓名】 + * @param rankResultDTOS + * @return java.util.List + * @Author zhangyong + * @Date 10:14 2020-12-29 + **/ + private List getPartyBaseInfo(List rankResultDTOS){ + // 1.获取当前党员Id + List userIdParam = new LinkedList<>(); + for (ResiAroundPartyPointRankResultDTO formDTO : rankResultDTOS){ + userIdParam.add(formDTO.getUserId()); + } + if (userIdParam.size() == NumConstant.ZERO){ + return rankResultDTOS; + } + // 2.获取用户基本信息 + Result> myResiInfoResult = epmetUserOpenFeignClient.queryUserBaseInfo(userIdParam); + if(myResiInfoResult.success() && null != myResiInfoResult.getData() && !myResiInfoResult.getData().isEmpty()){ + for (UserBaseInfoResultDTO resiInfo : myResiInfoResult.getData()){ + for (ResiAroundPartyPointRankResultDTO formDTO : rankResultDTOS){ + if (formDTO.getUserId().equals(resiInfo.getUserId())){ + formDTO.setUserHeadPhoto(resiInfo.getHeadImgUrl()); + formDTO.setRealName(resiInfo.getRealName()); + } + } + } + } + return rankResultDTOS; + } +} 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/bootstrap.yml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml index 720887f6bd..a6233bb7a3 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /point @@ -118,7 +119,21 @@ pagehelper: helper-dialect: mysql reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 +thread: + # 线程池配置 + threadPool: + corePoolSize: @thread.pool.core-pool-size@ + maxPoolSize: @thread.pool.max-pool-size@ + queueCapacity: @thread.pool.queue-capacity@ + keepAlive: @thread.pool.keep-alive@ + dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.4__addNewRuleTemplate.sql b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.4__addNewRuleTemplate.sql new file mode 100644 index 0000000000..6c8838b5cf --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.4__addNewRuleTemplate.sql @@ -0,0 +1,66 @@ + +INSERT INTO point_rule_default ( + `ID`, + `RULE_NAME`, + `RULE_DESC`, + `EVENT_CODE`, + `FUNCTION_ID`, + `OPERATE_TYPE`, + `UP_LIMIT`, + `UP_LIMIT_DESC`, + `UP_LIMIT_PREFIX`, + `RULE_PERIOD`, + `POINT`, + `POINT_UNIT`, + `ENABLED_FLAG`, + `DEL_FLAG`, + `REVISION`, + `CREATED_BY`, + `CREATED_TIME`, + `UPDATED_BY`, + `UPDATED_TIME` +) +VALUES + ( + '3','发布话题', + '楼院小组内通过我有话说功能发布话题','publish_one_topic', + '1','plus', + 15,'每天上限为15分',null,'day',5,'time','0','0',0,'APP_USER',now(),'APP_USER',now() + ), + ( + '4','参与话题', + '对小组内话题进行15字以上评论','participate_one_topic', + '1','plus', + 6,'每天上限为6分',null,'day',2,'time','0','0',0,'APP_USER',now(),'APP_USER',now() + ), + ( + '5','话题被转为议题', + '小组中发布的话题被组长转为议题','topic_shifted_to_issue', + '1','plus', + 0,'无上限',null,'day',15,'time','0','0',0,'APP_USER',now(),'APP_USER',now() + ), + ( + '6','话题被转为项目', + '小组中发布的话题被组长转为议题 又被网格员转为项目','topic_shifted_to_project', + '1','plus', + 0,'无上限',null,'day',30,'time','0','0',0,'APP_USER',now(),'APP_USER',now() + ), + ( + '7','转话题为议题', + '将自建小组中话题转为议题','shift_topic_to_issue', + '1','plus', + 15,'每天上限为15分',null,'day',5,'time','0','0',0,'APP_USER',now(),'APP_USER',now() + ), + ( + '8','邀请新人入组', + '通过话题/议题分享链接邀请新用户入组,需注册居民成功入组方能获得','invite_new_resident_into_group', + '1','plus', + 0,'无上限',null,'day',30,'time','0','0',0,'APP_USER',now(),'APP_USER',now() + ), + ( + '9','邀请入组', + '通过话题/议题分享链接邀请已注册用户入组,需通过入组审核方能获得','invite_resident_into_group', + '1','plus', + 25,'每天上限为25分',null,'day',5,'time','0','0',0,'APP_USER',now(),'APP_USER',now() + ) + diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.5__editResiGroupRuleCode.sql b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.5__editResiGroupRuleCode.sql new file mode 100644 index 0000000000..4c3e4183f3 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.5__editResiGroupRuleCode.sql @@ -0,0 +1,4 @@ +update `point_rule_default` set event_code = 'invite_new_into_group' where event_code = 'invite_new_resident_into_group'; +update `point_rule_default` set event_code = 'invite_resi_into_group' where event_code = 'invite_resident_into_group'; +update `point_rule_default` set event_code = 'topic_to_issue' where event_code = 'topic_shifted_to_issue'; +update `point_rule_default` set event_code = 'topic_to_project' where event_code = 'topic_shifted_to_project'; \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.6__editResiGroupRuleUpLimitDesc.sql b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.6__editResiGroupRuleUpLimitDesc.sql new file mode 100644 index 0000000000..04ae7bf19d --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.6__editResiGroupRuleUpLimitDesc.sql @@ -0,0 +1,4 @@ +update `point_rule_default` set up_limit_desc = '每日该项所得积分总和上限,为0时表示没有积分上限' where event_code = 'publish_one_topic'; +update `point_rule_default` set up_limit_desc = '每日该项所得积分总和上限,为0时表示没有积分上限' where event_code = 'participate_one_topic'; +update `point_rule_default` set up_limit_desc = '每日该项所得积分总和上限,为0时表示没有积分上限' where event_code = 'shift_topic_to_issue'; +update `point_rule_default` set up_limit_desc = '每日该项所得积分总和上限,为0时表示没有积分上限' where event_code = 'invite_resi_into_group'; \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.7__updateAllRuleLimitDesc.sql b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.7__updateAllRuleLimitDesc.sql new file mode 100644 index 0000000000..a298e20369 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.7__updateAllRuleLimitDesc.sql @@ -0,0 +1,2 @@ +update `point_rule_default` set up_limit_desc = '每日该项所得积分总和上限,为0时表示没有积分上限'; +update `point_rule` set up_limit_desc = '每日该项所得积分总和上限,为0时表示没有积分上限' \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.8__updateRuleDesc.sql b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.8__updateRuleDesc.sql new file mode 100644 index 0000000000..b56029ee46 --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/db/migration/V0.0.8__updateRuleDesc.sql @@ -0,0 +1,13 @@ +update `point_rule_default` set rule_desc = '通过话题/议题分享链接邀请新用户入组,且注册居民成功入组' where event_code = 'invite_new_into_group' and rule_name = '邀请新人入组'; + +update `point_rule_default` set rule_desc = '通过话题/议题分享链接邀请已注册用户入组,且通过入组审核' where event_code = 'invite_resi_into_group' and rule_name = '邀请入组'; + +update `point_rule_default` set rule_desc = '小组中发布的话题被组长转为议题,又被网格员转为项目' where event_code = 'topic_to_project' and rule_name = '话题被转为项目'; + + + +update `point_rule` set rule_desc = '通过话题/议题分享链接邀请新用户入组,且注册居民成功入组' where event_code = 'invite_new_into_group' and rule_name = '邀请新人入组'; + +update `point_rule` set rule_desc = '通过话题/议题分享链接邀请已注册用户入组,且通过入组审核' where event_code = 'invite_resi_into_group' and rule_name = '邀请入组'; + +update `point_rule` set rule_desc = '小组中发布的话题被组长转为议题,又被网格员转为项目' where event_code = 'topic_to_project' and rule_name = '话题被转为项目'; \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml index 994bca4ad4..8e9a860b37 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml @@ -61,6 +61,8 @@ AND CREATED_TIME = ]]> #{dateCheck} - + + AND CREATED_TIME #{right} + \ No newline at end of file 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 9bb759ed72..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 @@ @@ -130,4 +135,53 @@ - \ No newline at end of file + + + + + + 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-client/src/main/java/com/epmet/dto/form/AddTemplateFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AddTemplateFormDTO.java index edb391eb73..16491eb32e 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AddTemplateFormDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AddTemplateFormDTO.java @@ -48,4 +48,9 @@ public class AddTemplateFormDTO implements Serializable { * 关键字名称 */ private List nameList; + + /** + * 是否同步到所有客户 + */ + private Boolean isSync = true; } diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/DelPersonalTempFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/DelPersonalTempFormDTO.java new file mode 100644 index 0000000000..9c49eeeccf --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/DelPersonalTempFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/1/11 14:53 + */ +@NoArgsConstructor +@Data +public class DelPersonalTempFormDTO implements Serializable { + + private static final long serialVersionUID = -1445036628319660147L; + /** + * 客户ID + */ + private String customerId; + /** + * 所属端 居民端resi 工作端work + */ + private String clientType; + /** + * 模板id + */ + private List tempIdList; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/InitAllFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/InitAllFormDTO.java new file mode 100644 index 0000000000..ed476cc3b6 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/InitAllFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/1/11 14:47 + */ +@NoArgsConstructor +@Data +public class InitAllFormDTO implements Serializable { + + private static final long serialVersionUID = 5198153778356904936L; + /** + * 测试号APPID + */ + private String appId; + /** + * 模板ID + */ + private String tempId; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/InitFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/InitFormDTO.java index ab154a196a..196128aff2 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/InitFormDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/InitFormDTO.java @@ -36,4 +36,9 @@ public class InitFormDTO implements Serializable { * 工作端需要同步的模板id数组 */ private List workTempIdList; + + /** + * 1 已同步,0 未同步 + */ + private String sync; } diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/TemplateListV2FormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/TemplateListV2FormDTO.java new file mode 100644 index 0000000000..3c9c0e09b1 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/TemplateListV2FormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2020/12/29 13:20 + */ +@Data +public class TemplateListV2FormDTO implements Serializable { + private static final long serialVersionUID = 1L; + @NotBlank(message = "customerId不能为空") + private String customerId; + @NotBlank(message = "app不能为空") + private String app; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateDTO.java index 0229316e01..1fccf69f2d 100644 --- a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateDTO.java +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateDTO.java @@ -17,9 +17,14 @@ public class TemplateDTO implements Serializable { */ private String id; /** - * 模板ID + * 公共模板ID */ private String tmplId; + private String personalId; + /** + * 客户模板ID + */ + private String personalTempId; /** * 标题 */ diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateListV2ResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateListV2ResultDTO.java new file mode 100644 index 0000000000..e5342c86c9 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateListV2ResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2020/12/29 13:19 + */ +@Data +public class TemplateListV2ResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + //类型id + private String tid; + //类型名称 + private String type; + + private String templateId; +} diff --git a/epmet-module/epmet-third/epmet-third-server/Dockerfile b/epmet-module/epmet-third/epmet-third-server/Dockerfile index af31808436..99663b0965 100644 --- a/epmet-module/epmet-third/epmet-third-server/Dockerfile +++ b/epmet-module/epmet-third/epmet-third-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./epmet-third.jar EXPOSE 8110 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml index f66482c564..60c4577050 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.149 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.157 ports: - "8110:8110" network_mode: host # 使用现有网络 diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml index f9cd95ca91..fdd764c6e0 100644 --- a/epmet-module/epmet-third/epmet-third-server/pom.xml +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.0.149 + 0.0.157 com.epmet @@ -148,13 +148,6 @@ compile - - - com.aliyun - alibaba-dingtalk-service-sdk - 1.0.1 - - diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/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/controller/PersonalTemplateController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PersonalTemplateController.java index dc6099d9fe..f2e210dde2 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PersonalTemplateController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PersonalTemplateController.java @@ -4,8 +4,10 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.CustomerTemplateListFormDTO; import com.epmet.dto.form.GetTemplateListFormDTO; +import com.epmet.dto.form.TemplateListV2FormDTO; import com.epmet.dto.result.CustomerTemplateListResultDTO; import com.epmet.dto.result.GetTemplateListResultDTO; +import com.epmet.dto.result.TemplateListV2ResultDTO; import com.epmet.service.PersonalTemplateService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -37,6 +39,12 @@ public class PersonalTemplateController { return new Result>().ok(personalTemplateService.templateList(formDTO)); } + @PostMapping("templatelistv2") + public Result> templateList(@RequestBody TemplateListV2FormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(personalTemplateService.templateListV2(formDTO)); + } + /** * @return * @Description 获取客户两个端站内信模板Id diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/SubscribeController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/SubscribeController.java index 47d3b6d653..63a31e73b2 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/SubscribeController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/SubscribeController.java @@ -146,4 +146,30 @@ public class SubscribeController { CustomerTempResultDTO result = subscribeService.getCustomerTemplate(formDTO); return new Result().ok(result); } + + /** + * 同步单一模板到所有客户 + * @author zhaoqifeng + * @date 2021/1/11 14:49 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("initall") + public Result initAll(@RequestBody InitAllFormDTO formDTO) { + subscribeService.initAll(formDTO); + return new Result(); + } + + /** + * 删除客户模板 + * @author zhaoqifeng + * @date 2021/1/11 14:54 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("delpersonaltemp") + public Result delPersonalTemp(@RequestBody DelPersonalTempFormDTO formDTO) { + subscribeService.delPersonalTemp(formDTO); + return new Result(); + } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PersonalTemplateDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PersonalTemplateDao.java index c89ed2aeba..054712bea0 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PersonalTemplateDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PersonalTemplateDao.java @@ -21,10 +21,8 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.PersonalTemplateDTO; import com.epmet.dto.form.CustomerTemplateListFormDTO; import com.epmet.dto.form.GetTemplateListFormDTO; -import com.epmet.dto.result.CustomerTempResultDTO; -import com.epmet.dto.result.CustomerTemplateListResultDTO; -import com.epmet.dto.result.GetTemplateListResultDTO; -import com.epmet.dto.result.TemplateDTO; +import com.epmet.dto.form.TemplateListV2FormDTO; +import com.epmet.dto.result.*; import com.epmet.entity.PersonalTemplateEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -105,4 +103,8 @@ public interface PersonalTemplateDao extends BaseDao { * @return java.util.List */ List selectListByKey(@Param("appId") String appId, @Param("tid") String tid, @Param("keyIds") String keyIds); -} \ No newline at end of file + + List selectTemplateListV2(TemplateListV2FormDTO formDTO); + + PersonalTemplateDTO getTempByPid(); +} 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/PersonalTemplateService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PersonalTemplateService.java index 1d69a7b16a..a586844667 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PersonalTemplateService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PersonalTemplateService.java @@ -22,9 +22,11 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.dto.PersonalTemplateDTO; import com.epmet.dto.form.CustomerTemplateListFormDTO; import com.epmet.dto.form.GetTemplateListFormDTO; +import com.epmet.dto.form.TemplateListV2FormDTO; import com.epmet.dto.result.CustomerTemplateListResultDTO; import com.epmet.dto.result.GetTemplateListResultDTO; import com.epmet.dto.result.TemplateDTO; +import com.epmet.dto.result.TemplateListV2ResultDTO; import com.epmet.entity.PersonalTemplateEntity; import java.util.List; @@ -152,4 +154,16 @@ public interface PersonalTemplateService extends BaseService */ List getListByKey(String appId, String tid, String keyIds); -} \ No newline at end of file + + List templateListV2(TemplateListV2FormDTO formDTO); + + /** + * 获取个人模板 + * @author zhaoqifeng + * @date 2021/1/11 15:32 + * @param customerId + * @param pid + * @return com.epmet.dto.PersonalTemplateDTO + */ + PersonalTemplateDTO getTempByPid(String customerId, String pid); +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/SubscribeService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/SubscribeService.java index c56d17487a..6790a2aa15 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/SubscribeService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/SubscribeService.java @@ -102,4 +102,22 @@ public interface SubscribeService { */ CustomerTempResultDTO getCustomerTemplate(InitFormDTO formDTO); + /** + * 同步单一模板到所有客户 + * @author zhaoqifeng + * @date 2021/1/11 14:49 + * @param formDTO + * @return void + */ + void initAll(InitAllFormDTO formDTO); + + /** + * 删除客户模板 + * @author zhaoqifeng + * @date 2021/1/11 14:54 + * @param formDTO + * @return void + */ + void delPersonalTemp(DelPersonalTempFormDTO formDTO); + } 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/java/com/epmet/service/impl/CustomerMpServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CustomerMpServiceImpl.java index b716dff1b9..f19b241bef 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CustomerMpServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CustomerMpServiceImpl.java @@ -142,6 +142,9 @@ public class CustomerMpServiceImpl extends BaseServiceImpl templateListV2(TemplateListV2FormDTO formDTO) { + return baseDao.selectTemplateListV2(formDTO); + } + + /** + * 获取个人模板 + * + * @param customerId + * @param pid + * @return com.epmet.dto.PersonalTemplateDTO + * @author zhaoqifeng + * @date 2021/1/11 15:32 + */ + @Override + public PersonalTemplateDTO getTempByPid(String customerId, String pid) { + return baseDao.selectSetTemp(customerId, pid); + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/SubscribeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/SubscribeServiceImpl.java index 4596bcf589..b51c32632e 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/SubscribeServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/SubscribeServiceImpl.java @@ -199,44 +199,46 @@ public class SubscribeServiceImpl implements SubscribeService { personalTemplateDTO.setKeyWords(keywords); personalTemplateDTO.setType(formDTO.getType()); personalTemplateService.save(personalTemplateDTO); - //获取客户列表 - List customerList = paCustomerService.getCustomerListByTestId(authInfo.getCustomerId()); - List customerNames = new ArrayList<>(); - if (null != customerList && customerList.size() > NumConstant.ZERO) { - for (PaCustomerDTO paCustomerDTO : customerList) { - //获取小程序调用令牌 - AuthorizationInfoDTO authDTO = authorizationInfoDao.getAuthInfoByCustomer(paCustomerDTO.getId(), authInfo.getClientType()); - if (null == authDTO) { - log.error("客户[" + paCustomerDTO.getCustomerName() + "]未授权"); - customerNames.add(paCustomerDTO.getCustomerName()); - continue; - } - WxResult wxResult1 = wxMaSubscribeService.addTemplate(authDTO.getAuthorizerAccessToken(), request); - if (!wxResult1.success()) { - log.error("客户[" + paCustomerDTO.getCustomerName() + "]添加模板失败,原因:" + wxResult1.getErrorCode() + wxResult1.getErrorMsg()); - customerNames.add(paCustomerDTO.getCustomerName()); - continue; + if (formDTO.getIsSync()) { + //获取客户列表 + List customerList = paCustomerService.getCustomerListByTestId(authInfo.getCustomerId()); + List customerNames = new ArrayList<>(); + if (null != customerList && customerList.size() > NumConstant.ZERO) { + for (PaCustomerDTO paCustomerDTO : customerList) { + //获取小程序调用令牌 + AuthorizationInfoDTO authDTO = authorizationInfoDao.getAuthInfoByCustomer(paCustomerDTO.getId(), authInfo.getClientType()); + if (null == authDTO) { + log.error("客户[" + paCustomerDTO.getCustomerName() + "]未授权"); + customerNames.add(paCustomerDTO.getCustomerName()); + continue; + } + WxResult wxResult1 = wxMaSubscribeService.addTemplate(authDTO.getAuthorizerAccessToken(), request); + if (!wxResult1.success()) { + log.error("客户[" + paCustomerDTO.getCustomerName() + "]添加模板失败,原因:" + wxResult1.getErrorCode() + wxResult1.getErrorMsg()); + customerNames.add(paCustomerDTO.getCustomerName()); + continue; + } + String tmplId = wxResult1.getData(); + PersonalTemplateDTO templateDTO = new PersonalTemplateDTO(); + templateDTO.setCustomerId(paCustomerDTO.getId()); + templateDTO.setClientType(authInfo.getClientType()); + templateDTO.setAppId(authDTO.getAuthorizerAppid()); + templateDTO.setPid(priTmplId); + templateDTO.setPriTmplId(tmplId); + templateDTO.setTid(formDTO.getTid()); + templateDTO.setKeyIds(keyIds); + templateDTO.setTitle(formDTO.getTitle()); + templateDTO.setSceneDesc(formDTO.getSceneDesc()); + templateDTO.setKeyWords(keywords); + templateDTO.setType(formDTO.getType()); + personalTemplateService.save(templateDTO); } - String tmplId = wxResult1.getData(); - PersonalTemplateDTO templateDTO = new PersonalTemplateDTO(); - templateDTO.setCustomerId(paCustomerDTO.getId()); - templateDTO.setClientType(authInfo.getClientType()); - templateDTO.setAppId(authDTO.getAuthorizerAppid()); - templateDTO.setPid(priTmplId); - templateDTO.setPriTmplId(tmplId); - templateDTO.setTid(formDTO.getTid()); - templateDTO.setKeyIds(keyIds); - templateDTO.setTitle(formDTO.getTitle()); - templateDTO.setSceneDesc(formDTO.getSceneDesc()); - templateDTO.setKeyWords(keywords); - templateDTO.setType(formDTO.getType()); - personalTemplateService.save(templateDTO); } - } - if (customerNames.size() > NumConstant.ZERO) { - String names = String.join(",", customerNames); - throw new RenException("客户[" + names + "]添加模板失败"); + if (customerNames.size() > NumConstant.ZERO) { + String names = String.join(",", customerNames); + throw new RenException("客户[" + names + "]添加模板失败"); + } } } @@ -284,6 +286,7 @@ public class SubscribeServiceImpl implements SubscribeService { } String tmplId = wxResult.getData(); PersonalTemplateDTO personalTemplate = ConvertUtils.sourceToTarget(templateDTO, PersonalTemplateDTO.class); + personalTemplate.setId(null); personalTemplate.setPriTmplId(tmplId); personalTemplate.setCustomerId(formDTO.getCustomerId()); personalTemplate.setClientType("resi"); @@ -312,9 +315,10 @@ public class SubscribeServiceImpl implements SubscribeService { } String tmplId = wxResult.getData(); PersonalTemplateDTO personalTemplate = ConvertUtils.sourceToTarget(templateDTO, PersonalTemplateDTO.class); + personalTemplate.setId(null); personalTemplate.setPriTmplId(tmplId); personalTemplate.setCustomerId(formDTO.getCustomerId()); - personalTemplate.setClientType("resi"); + personalTemplate.setClientType("work"); personalTemplate.setAppId(authInfo.getAuthorizerAppid()); personalTemplateService.save(personalTemplate); }); @@ -346,7 +350,6 @@ public class SubscribeServiceImpl implements SubscribeService { log.error("居民端同步失败:" + wxResult.getErrorCode() + wxResult.getErrorMsg()); } }); - resultDTO.setResiList(resiList); AuthorizationInfoDTO workAuthDTO = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), "work"); if (null == workAuthDTO) { @@ -369,10 +372,100 @@ public class SubscribeServiceImpl implements SubscribeService { log.error("工作端同步失败:" + wxResult.getErrorCode() + wxResult.getErrorMsg()); } }); + +// resultDTO.setResiList(resiList.stream().filter(item -> formDTO.getSync().equals(item.getState())).collect(Collectors.toList())); +// resultDTO.setWorkList(workList.stream().filter(item -> formDTO.getSync().equals(item.getState())).collect(Collectors.toList())); + resultDTO.setResiList(resiList); resultDTO.setWorkList(workList); return resultDTO; } + /** + * 同步单一模板到所有客户 + * + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2021/1/11 14:49 + */ + @Override + public void initAll(InitAllFormDTO formDTO) { + AuthorizationInfoDTO authInfo = authorizationInfoDao.selectInfoByAppId(formDTO.getAppId()); + PersonalTemplateDTO publicDTO = personalTemplateService.getTempByPid(authInfo.getCustomerId(), formDTO.getTempId()); + + //获取客户列表 + List customerList = paCustomerService.getCustomerListByTestId(authInfo.getCustomerId()); + List customerNames = new ArrayList<>(); + if (null != customerList && customerList.size() > NumConstant.ZERO) { + for (PaCustomerDTO paCustomerDTO : customerList) { + PersonalTemplateDTO personalTemplateDTO = personalTemplateService.getTempByPid(paCustomerDTO.getId(), publicDTO.getPriTmplId()); + if (null == personalTemplateDTO) { + //获取小程序调用令牌 + AuthorizationInfoDTO authDTO = authorizationInfoDao.getAuthInfoByCustomer(paCustomerDTO.getId(), authInfo.getClientType()); + + List keyIds = Arrays.asList(publicDTO.getKeyIds().split(",")); + List keyIdList = keyIds.stream().map(Integer::parseInt).collect(Collectors.toList()); + WxAddTemplateReq request = new WxAddTemplateReq(); + request.setTid(publicDTO.getTid()); + request.setKidList(keyIdList); + request.setSceneDesc(publicDTO.getSceneDesc()); + WxResult wxResult = wxMaSubscribeService.addTemplate(authInfo.getAuthorizerAccessToken(), request); + if (null == authDTO) { + log.error("客户[" + paCustomerDTO.getCustomerName() + "]未授权"); + customerNames.add(paCustomerDTO.getCustomerName()); + continue; + } + + String tmplId = wxResult.getData(); + PersonalTemplateDTO templateDTO = new PersonalTemplateDTO(); + templateDTO.setCustomerId(paCustomerDTO.getId()); + templateDTO.setClientType(authInfo.getClientType()); + templateDTO.setAppId(authDTO.getAuthorizerAppid()); + templateDTO.setPid(publicDTO.getPriTmplId()); + templateDTO.setPriTmplId(tmplId); + templateDTO.setTid(publicDTO.getTid()); + templateDTO.setKeyIds(publicDTO.getKeyIds()); + templateDTO.setTitle(publicDTO.getTitle()); + templateDTO.setSceneDesc(publicDTO.getSceneDesc()); + templateDTO.setKeyWords(publicDTO.getKeyWords()); + templateDTO.setType(publicDTO.getType()); + personalTemplateService.save(templateDTO); + } + } + } + + if (customerNames.size() > NumConstant.ZERO) { + String names = String.join(",", customerNames); + log.error("客户[" + names + "]添加模板失败"); + } + } + + /** + * 删除客户模板 + * + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2021/1/11 14:54 + */ + @Override + public void delPersonalTemp(DelPersonalTempFormDTO formDTO) { + AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); + if (null == authInfo) { + throw new RenException("未授权或token已过期"); + } + formDTO.getTempIdList().forEach(tempId -> { + PersonalTemplateDTO dto = personalTemplateService.get(tempId); + WxDelTemplateReq request = new WxDelTemplateReq(); + request.setPriTmplId(dto.getPriTmplId()); + WxResult wxResult = wxMaSubscribeService.delTemplate(authInfo.getAuthorizerAccessToken(), request); + if (!wxResult.success()) { + throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg()); + } + personalTemplateService.deleteById(dto.getId()); + }); + } + private WxGetCategoryResult getCategoryResult(String accessToken) { WxResult wxResult = wxMaSubscribeService.getCategory(accessToken); diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/enums/WxMaErrorMsgEnum.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/enums/WxMaErrorMsgEnum.java index 1e9425c7ec..4a798d7ee8 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/enums/WxMaErrorMsgEnum.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/enums/WxMaErrorMsgEnum.java @@ -551,6 +551,8 @@ public enum WxMaErrorMsgEnum { CODE_200021(200021, "场景描述 sceneDesc 参数错误"), + CODE_200022(200022, "该模板已存在"), + CODE_20002(20002, "商品id不存在"), CODE_1003(1003, "POST参数非法"), CODE_40005(40005, "上传素材文件格式不对"), diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml index 400d4810ed..0606e7f123 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /third @@ -122,6 +123,7 @@ third: - https://epmet-cloud.elinkservice.cn - https://epmet-dev.elinkservice.cn - https://epmet-test.elinkservice.cn + - https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com webviewDomain: - https://epmet-ext.elinkservice.cn - https://epmet-ext1.elinkservice.cn @@ -138,4 +140,10 @@ third: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 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/epmet-third/epmet-third-server/src/main/resources/mapper/PersonalTemplateDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PersonalTemplateDao.xml index 4cd31aeb95..644cda2bc6 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PersonalTemplateDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PersonalTemplateDao.xml @@ -35,10 +35,21 @@ FROM personal_template WHERE DEL_FLAG = '0' AND APP_ID = #{appId} + ORDER BY CREATED_TIME DESC - \ No newline at end of file + + diff --git a/epmet-module/gov-access/gov-access-server/Dockerfile b/epmet-module/gov-access/gov-access-server/Dockerfile index 660d423d2b..b1fa39dad0 100644 --- a/epmet-module/gov-access/gov-access-server/Dockerfile +++ b/epmet-module/gov-access/gov-access-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./gov-access.jar EXPOSE 8099 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-prod.yml b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-prod.yml index ababaa4a99..f8d0f80e18 100644 --- a/epmet-module/gov-access/gov-access-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-access/gov-access-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-access-server: container_name: gov-access-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-access-server:0.3.39 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-access-server:0.3.45 ports: - "8099:8099" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-access/gov-access-server/pom.xml b/epmet-module/gov-access/gov-access-server/pom.xml index 9c0b30d5c1..cb78960c44 100644 --- a/epmet-module/gov-access/gov-access-server/pom.xml +++ b/epmet-module/gov-access/gov-access-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.40 + 0.3.45 gov-access com.epmet diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml index 6fcc5979f5..c8fe1196c9 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /gov/access @@ -122,4 +123,4 @@ pagehelper: #feign 日志需要该配置 logging: level: - com.epmet: debug \ No newline at end of file + com.epmet: debug diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml index 0591776c96..7099cf43c6 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/OperationScopeDao.xml @@ -34,7 +34,9 @@ + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueShareLinkRecordDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueShareLinkRecordDao.xml new file mode 100644 index 0000000000..99bbe9d7e4 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueShareLinkRecordDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueShareLinkVisitRecordDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueShareLinkVisitRecordDao.xml new file mode 100644 index 0000000000..939dbb2f2b --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueShareLinkVisitRecordDao.xml @@ -0,0 +1,60 @@ + + + + + + + + + UPDATE + issue_share_link_visit_record + SET + is_invite_register = 0 + WHERE + del_flag = '0' + AND + share_link_rec_id = #{linkId} + AND + invitee_user_id = #{invitee} + + + + + + UPDATE + issue_share_link_visit_record + SET + if_join_group = 1 + WHERE + del_flag = '0' + AND + share_link_rec_id = #{linkId} + AND + invitee_user_id = #{invitee} + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueSuggestionDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueSuggestionDao.xml index c3bd6f3f31..f24f8fb90e 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueSuggestionDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueSuggestionDao.xml @@ -12,6 +12,7 @@ i.DEL_FLAG = '0' AND i.ISSUE_ID = #{issueId} AND i.CREATED_BY=#{userId} + order by i.CREATED_TIME desc limit 1 @@ -33,4 +34,11 @@ ORDER BY ig.CREATED_TIME DESC + + \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/Dockerfile b/epmet-module/gov-mine/gov-mine-server/Dockerfile index 61472572db..cbc73e687e 100644 --- a/epmet-module/gov-mine/gov-mine-server/Dockerfile +++ b/epmet-module/gov-mine/gov-mine-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./gov-mine.jar EXPOSE 8098 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml b/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml index fb5899dbc5..2bb561026b 100644 --- a/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-mine-server: container_name: gov-mine-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-mine-server:0.3.34 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-mine-server:0.3.36 ports: - "8098:8098" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index 00baee29cf..26a057cce8 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.34 + 0.3.36 com.epmet gov-mine 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-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java index 6c42e6e7dc..a025a0b74b 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/service/impl/StaffAgencyServiceImpl.java @@ -17,10 +17,10 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.constant.StaffAgencyConstant; import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.form.StaffGridVisitedFormDTO; import com.epmet.dto.form.SwitchGridFormDTO; @@ -68,8 +68,10 @@ public class StaffAgencyServiceImpl implements StaffAgencyService { public List getMyGrids(String staffId) { //1、获取拥有的所有网格 Result> govOrgResult = govOrgFeignClient.getMyGrids(staffId); - if (!govOrgResult.success() || (null == govOrgResult.getData() || govOrgResult.getData().size() < 1)) { - logger.error(String.format("调用gov-org-server服务查询工作人员网格列表失败返回结果", govOrgResult.toString())); + if (!govOrgResult.success()) { + throw new RenException(String.format("调用gov-org-server服务查询工作人员网格列表失败,返回结果:", govOrgResult.toString())); + } + if (null == govOrgResult.getData() || govOrgResult.getData().size() < 1) { return new ArrayList<>(); } List gridList = ConvertUtils.sourceToTarget(govOrgResult.getData(), StaffGridResultDTO.class); @@ -91,19 +93,19 @@ public class StaffAgencyServiceImpl implements StaffAgencyService { for (StaffGridResultDTO staffGridInfo : gridList) { if (this.checkGroupProcessing(staffGridInfo.getGridId(), groupProcessingList)) { staffGridInfo.setRedDot(true); - break; + continue; } if (this.checkResiProcessing(staffGridInfo.getGridId(), resiProcessingList)) { staffGridInfo.setRedDot(true); - break; + continue; } if (this.checkPartyMemberProcessing(staffGridInfo.getGridId(), partyMemberProcessingList)) { staffGridInfo.setRedDot(true); - break; + continue; } if (this.checkIssueProcessing(staffGridInfo.getGridId(), issueProcessingList)) { staffGridInfo.setRedDot(true); - break; + continue; } } return gridList; diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml index c49ee432c1..6c3a83e1f1 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /gov/mine @@ -99,3 +100,9 @@ dingTalk: robot: webHook: @dingTalk.robot.webHook@ secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 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-client/src/main/java/com/epmet/dto/result/GridInCommunityDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInCommunityDTO.java new file mode 100644 index 0000000000..52cfa389da --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInCommunityDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 根据网格id查询,它的父级 社区id + 最后返回 社区id 下的所有网格信息 + * @Author zy + * @Date 2020/12/28 23:16 + */ +@Data +public class GridInCommunityDTO implements Serializable { + private static final long serialVersionUID = 4360690752084258055L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 客户ID + */ + private String customerId; +} + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 2dab8452b3..fe67bef009 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -314,4 +314,14 @@ public interface GovOrgOpenFeignClient { **/ @PostMapping("/gov/org/customergrid/griddatafilter") Result gridDataFilter(CommonGridIdFormDTO gridForm); + + /** + * 根据 网格id,查询同属于一个社区下的所有网格id + * @param gridId + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 17:44 2020-12-28 + **/ + @GetMapping("/gov/org/customergrid/getGridIdsInCommunity/{gridId}") + Result> getGridIdsInCommunity(@PathVariable("gridId") String gridId); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 4776dec9b6..d9d5be0a84 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -181,6 +181,10 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { @Override public Result gridDataFilter(CommonGridIdFormDTO gridForm) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "gridDataFilter", gridForm); + } + @Override + public Result> getGridIdsInCommunity(String gridId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridIdsInCommunity", gridId); } } diff --git a/epmet-module/gov-org/gov-org-server/Dockerfile b/epmet-module/gov-org/gov-org-server/Dockerfile index 57ac019c29..b4f5ecffbb 100644 --- a/epmet-module/gov-org/gov-org-server/Dockerfile +++ b/epmet-module/gov-org/gov-org-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./gov-org.jar EXPOSE 8092 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml index 0f0c900f89..a42028726b 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-org-server:0.3.92 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-org-server:0.3.97 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index ecfdb329f1..595c20f348 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.92 + 0.3.97 com.epmet gov-org @@ -95,6 +95,12 @@ 2.0.0 compile + + + com.epmet + epmet-commons-rocketmq + 2.0.0 + @@ -156,6 +162,10 @@ SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + 192.168.1.130:9876;192.168.1.132:9876 + epmet_message @@ -194,6 +204,10 @@ SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + 192.168.1.130:9876;192.168.1.132:9876 + epmet_message @@ -233,6 +247,10 @@ SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + 192.168.10.161:9876 + epmet_message @@ -269,6 +287,10 @@ SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + + + 192.168.11.187:9876;192.168.11.184:9876 + epmet_message diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java index b86bb7df20..5068d6187f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java @@ -228,4 +228,16 @@ public class CustomerGridController { return new Result().ok(customerGridService.selectGridCount(customerIdFormDTO)); } + /** + * @param gridId + * @return com.epmet.commons.tools.utils.Result> + * @Author zy + * @Description 根据 网格id,查询同属于一个社区下的所有网格id + * @Date 2020/12/28 23:16 + **/ + @GetMapping("getGridIdsInCommunity/{gridId}") + public Result> getGridIdsInCommunity(@PathVariable("gridId") String gridId) { + List resultDTOS = customerGridService.listGridIdsInCommunity(gridId); + return new Result>().ok(resultDTOS); + } } 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 9c1735a886..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 @@ -206,4 +214,14 @@ public interface CustomerAgencyDao extends BaseDao { * @author sun **/ List selectAllSub(@Param("agencyId") String agencyId); + + /** + * @param agencyId 组织id + * @param operateUserId 当前操作人 + * @return int + * @author yinzuomei + * @description + * @Date 2020/12/15 10:04 + **/ + int delByAgencyId(@Param("agencyId") String agencyId, @Param("operateUserId") String operateUserId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java index 12d2b81c7e..eedb383a94 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerDepartmentDao.java @@ -18,12 +18,10 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerDepartmentDTO; import com.epmet.dto.CustomerIdDTO; import com.epmet.dto.result.AgencyDeptList; import com.epmet.dto.result.DepartmentListResultDTO; -import com.epmet.dto.result.SubListResultDTO; import com.epmet.entity.CustomerDepartmentEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -93,4 +91,14 @@ public interface CustomerDepartmentDao extends BaseDao * @return void */ void deleteStaffDep(@Param("staffId") String staffId); + + /** + * @return int + * @param deptId 部门id + * @param operateUserId 当前操作人id + * @author yinzuomei + * @description + * @Date 2020/12/15 10:05 + **/ + int delDeptById(@Param("deptId")String deptId,@Param("operateUserId") String operateUserId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java index 64274d1b69..a6c519d1ce 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java @@ -246,4 +246,13 @@ public interface CustomerGridDao extends BaseDao { List selectOrgInfoByAgency(@Param("orgIds")List orgIds); List selectOrgInfoByGrid(@Param("orgIds")List orgIds); List selectOrgInfoByDept(@Param("orgIds")List orgIds); -} \ No newline at end of file + + /** + * @param gridId + * @return com.epmet.commons.tools.utils.Result> + * @Author zy + * @Description 根据 网格id,查询同属于一个社区下的所有网格id + * @Date 2020/12/28 23:16 + **/ + List selectListGridIdsInCommunity(@Param("gridId") String gridId); +} 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/mq/RocketMQConsumerRegister.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java new file mode 100644 index 0000000000..b378946ff3 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/RocketMQConsumerRegister.java @@ -0,0 +1,62 @@ +package com.epmet.mq; + +import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants; +import com.epmet.commons.rocketmq.constants.TopicConstants; +import com.epmet.mq.listener.InitCustomerOrgRolesListener; +import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer; +import org.apache.rocketmq.client.consumer.listener.MessageListener; +import org.apache.rocketmq.client.exception.MQClientException; +import org.apache.rocketmq.common.protocol.heartbeat.MessageModel; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +import javax.annotation.PostConstruct; + +@Component +public class RocketMQConsumerRegister { + + @Value("${rocketmq.name-server}") + private String nameServer; + + /** + * @return + * @Description 注册监听器 + * @author wxz + * @date 2021.03.03 16:09 + */ + @PostConstruct + public void registerAllListeners() { + try { + register(nameServer, ConsomerGroupConstants.INIT_CUSTOMER_ORG_ROLES_GROUP, MessageModel.CLUSTERING, TopicConstants.INIT_CUSTOMER, "*", new InitCustomerOrgRolesListener()); + } catch (MQClientException e) { + e.printStackTrace(); + } + } + + public void register(String nameServer, String group, MessageModel messageModel, String topic, String subException, MessageListener listener) throws MQClientException { + // 实例化消费者 + DefaultMQPushConsumer consumer = new DefaultMQPushConsumer(group); + + // 设置NameServer的地址 + consumer.setNamesrvAddr(nameServer); + consumer.setMessageModel(messageModel); + consumer.setInstanceName(buildInstanceName()); + // 订阅一个或者多个Topic,以及Tag来过滤需要消费的消息 + consumer.subscribe(topic, subException); + // 注册回调实现类来处理从broker拉取回来的消息 + consumer.registerMessageListener(listener); + // 启动消费者实例 + consumer.start(); + } + + private String buildInstanceName() { + String instanceName = ""; + for (int i = 0; i < 4; i++) { + int t = (int) (Math.random() * 10); + instanceName = instanceName.concat(t + ""); + } + + return instanceName; + } + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/listener/InitCustomerOrgListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/listener/InitCustomerOrgListener.java new file mode 100644 index 0000000000..6ddc79801b --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/listener/InitCustomerOrgListener.java @@ -0,0 +1,100 @@ +package com.epmet.mq.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants; +import com.epmet.commons.rocketmq.constants.TopicConstants; +import com.epmet.commons.rocketmq.messages.InitCustomerMQMsg; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.UserWorkType; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.form.AddAgencyAndStaffFormDTO; +import com.epmet.dto.form.AdminStaffFromDTO; +import com.epmet.service.AgencyService; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.spring.annotation.MessageModel; +import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; +import org.apache.rocketmq.spring.core.RocketMQListener; +import org.redisson.api.RLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.concurrent.TimeUnit; + +/** + * 监听初始化客户动作,为客户初始化角色列表 + */ +//@RocketMQMessageListener(topic = TopicConstants.INIT_CUSTOMER, +// consumerGroup = ConsomerGroupConstants.INIT_CUSTOMER_ORG_ROLES_GROUP, +// messageModel = MessageModel.CLUSTERING, +// selectorExpression = "*") +//@Component +public class InitCustomerOrgListener implements RocketMQListener { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private AgencyService agencyService; + + @Autowired + private DistributedLock distributedLock; + + @Override + public void onMessage(MessageExt messageExt) { + String msg = new String(messageExt.getBody()); + logger.info("初始化客户-初始化组织信息-收到消息内容:{}", msg); + InitCustomerMQMsg msgObj = JSON.parseObject(msg, InitCustomerMQMsg.class); + + RLock lock = null; + try { + lock = distributedLock.getLock(String.format("lock:init_customer_org:%s", msgObj.getCustomerId()), + 30l, 30l, TimeUnit.SECONDS); + agencyService.saveRootAgency(constructRootAndAgencyDTO(msgObj)); + } catch (RenException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + logger.error("【RocketMQ】初始化客户组织失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + logger.error("【RocketMQ】初始化客户组织失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + distributedLock.unLock(lock); + } + } + + /** + * @Description 构造dto + * @return + * @author wxz + * @date 2021.01.06 15:03 + */ + private AddAgencyAndStaffFormDTO constructRootAndAgencyDTO(InitCustomerMQMsg msgObj) { + AddAgencyAndStaffFormDTO agencyAndStaff = new AddAgencyAndStaffFormDTO(); + //客户组织信息 + CustomerAgencyDTO agencyDTO = new CustomerAgencyDTO(); + agencyDTO.setId(msgObj.getAgency().getAgencyId()); + agencyDTO.setCustomerId(msgObj.getCustomerId()); + agencyDTO.setOrganizationName(msgObj.getAgency().getOrganizationName()); + agencyDTO.setLevel(msgObj.getAgency().getLevel()); + agencyDTO.setAreaCode(msgObj.getAgency().getAreaCode()); + agencyDTO.setProvince(msgObj.getAgency().getProvince()); + agencyDTO.setCity(msgObj.getAgency().getCity()); + agencyDTO.setDistrict(msgObj.getAgency().getDistrict()); + agencyAndStaff.setAgencyDTO(agencyDTO); + + //客户管理员信息 + AdminStaffFromDTO staffSubmitFrom = new AdminStaffFromDTO(); + staffSubmitFrom.setCustomerId(msgObj.getCustomerId()); + staffSubmitFrom.setAgencyId(msgObj.getStaff().getAgencyId()); + staffSubmitFrom.setGender(msgObj.getStaff().getGender()); + staffSubmitFrom.setMobile(msgObj.getStaff().getMobile()); + staffSubmitFrom.setName(msgObj.getStaff().getName()); + staffSubmitFrom.setWorkType(UserWorkType.FULL_TIME); + agencyAndStaff.setStaffDTO(staffSubmitFrom); + + return agencyAndStaff; + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/listener/InitCustomerOrgRolesListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/listener/InitCustomerOrgRolesListener.java new file mode 100644 index 0000000000..1225da9abd --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/mq/listener/InitCustomerOrgRolesListener.java @@ -0,0 +1,101 @@ +package com.epmet.mq.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.messages.InitCustomerMQMsg; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.SpringContextUtils; +import com.epmet.constant.UserWorkType; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.form.AddAgencyAndStaffFormDTO; +import com.epmet.dto.form.AdminStaffFromDTO; +import com.epmet.service.AgencyService; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyContext; +import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus; +import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently; +import org.apache.rocketmq.common.message.MessageExt; +import org.redisson.api.RLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * @Description 创建客户-组织和角色监听器 + * @return + * @author wxz + * @date 2021.03.03 16:10 +*/ +public class InitCustomerOrgRolesListener implements MessageListenerConcurrently { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Override + public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { + try { + msgs.forEach(msg -> consumeMessage(msg)); + } catch (Exception e) { + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + return ConsumeConcurrentlyStatus.CONSUME_SUCCESS; + } + + private void consumeMessage(MessageExt messageExt) { + String msg = new String(messageExt.getBody()); + logger.info("初始化客户-初始化组织信息-收到消息内容:{}", msg); + InitCustomerMQMsg msgObj = JSON.parseObject(msg, InitCustomerMQMsg.class); + + DistributedLock distributedLock = null; + RLock lock = null; + try { + distributedLock = SpringContextUtils.getBean(DistributedLock.class); + lock = distributedLock.getLock(String.format("lock:init_customer_org:%s", msgObj.getCustomerId()), + 30l, 30l, TimeUnit.SECONDS); + SpringContextUtils.getBean(AgencyService.class).saveRootAgency(constructRootAndAgencyDTO(msgObj)); + } catch (RenException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + logger.error("【RocketMQ】初始化客户组织失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + logger.error("【RocketMQ】初始化客户组织失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + distributedLock.unLock(lock); + } + } + + /** + * @Description 构造dto + * @return + * @author wxz + * @date 2021.01.06 15:03 + */ + private AddAgencyAndStaffFormDTO constructRootAndAgencyDTO(InitCustomerMQMsg msgObj) { + AddAgencyAndStaffFormDTO agencyAndStaff = new AddAgencyAndStaffFormDTO(); + //客户组织信息 + CustomerAgencyDTO agencyDTO = new CustomerAgencyDTO(); + agencyDTO.setId(msgObj.getAgency().getAgencyId()); + agencyDTO.setCustomerId(msgObj.getCustomerId()); + agencyDTO.setOrganizationName(msgObj.getAgency().getOrganizationName()); + agencyDTO.setLevel(msgObj.getAgency().getLevel()); + agencyDTO.setAreaCode(msgObj.getAgency().getAreaCode()); + agencyDTO.setProvince(msgObj.getAgency().getProvince()); + agencyDTO.setCity(msgObj.getAgency().getCity()); + agencyDTO.setDistrict(msgObj.getAgency().getDistrict()); + agencyAndStaff.setAgencyDTO(agencyDTO); + + //客户管理员信息 + AdminStaffFromDTO staffSubmitFrom = new AdminStaffFromDTO(); + staffSubmitFrom.setCustomerId(msgObj.getCustomerId()); + staffSubmitFrom.setAgencyId(msgObj.getStaff().getAgencyId()); + staffSubmitFrom.setGender(msgObj.getStaff().getGender()); + staffSubmitFrom.setMobile(msgObj.getStaff().getMobile()); + staffSubmitFrom.setName(msgObj.getStaff().getName()); + staffSubmitFrom.setWorkType(UserWorkType.FULL_TIME); + agencyAndStaff.setStaffDTO(staffSubmitFrom); + + return agencyAndStaff; + } +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java index f9e8610778..adb1d3c1e0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java @@ -39,7 +39,7 @@ import java.util.List; import java.util.Map; /** - * 客户网格表 + * 客户网格表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-16 @@ -277,4 +277,13 @@ public interface CustomerGridService extends BaseService { * @date 2020/11/10 2:55 下午 */ List selectOrgInfo(OrgInfoFormDTO orgInfoFormDTO); -} \ No newline at end of file + + /** + * @param gridId + * @return com.epmet.commons.tools.utils.Result> + * @Author zy + * @Description 根据 网格id,查询同属于一个社区下的所有网格id + * @Date 2020/12/28 23:16 + **/ + List listGridIdsInCommunity(String gridId); +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index afb9739daa..f507af7c29 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -21,6 +21,7 @@ import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerAgencyConstant; @@ -67,7 +68,8 @@ public class AgencyServiceImpl implements AgencyService { private StaffServiceImpl staffServiceImpl; @Autowired private CustomerGridDao customerGridDao; - + @Autowired + private LoginUserUtil loginUserUtil; /** * @param formDTO * @return @@ -199,7 +201,7 @@ public class AgencyServiceImpl implements AgencyService { return result; } //4:删除当前机关组织(逻辑删) - if (customerAgencyDao.deleteById(formDTO.getAgencyId()) < NumConstant.ONE) { + if (customerAgencyDao.delByAgencyId(formDTO.getAgencyId(),loginUserUtil.getLoginUserId()) < NumConstant.ONE) { log.error(CustomerAgencyConstant.DEL_EXCEPTION); throw new RenException(CustomerAgencyConstant.DEL_EXCEPTION); } @@ -349,7 +351,13 @@ public class AgencyServiceImpl implements AgencyService { throw new RenException(EpmetErrorCode.OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR.getCode()); } - //3.查询客户具有指定RoleKey的角色信息 + //3.调用epmet-user服务,初始化客户对应的角色;其内部会调用access服务给角色分配权限信息 + Result initResult = epmetUserOpenFeignClient.initGovStaffRolesForCustomer(agencyDTO.getCustomerId()); + if (!initResult.success()) { + throw new RenException("客户新增:调用user服务为客户初始化角色数据失败:".concat(initResult.toString())); + } + + //4.查询客户具有指定RoleKey的角色信息 CustomerRoleFormDTO customerRoleForm = new CustomerRoleFormDTO(); customerRoleForm.setCustomerId(agencyDTO.getCustomerId()); customerRoleForm.setRoleKey(RoleKeyConstants.ROLE_KEY_ROOT_MANAGER); @@ -359,7 +367,7 @@ public class AgencyServiceImpl implements AgencyService { throw new RenException("查询客户具有指定RoleKey的角色信息失败:".concat(getRoleResult.toString())); } - //4.新增客户管理员信息 + //5.新增客户管理员信息 StaffSubmitFromDTO staffSubmitFrom = ConvertUtils.sourceToTarget(staffDTO, StaffSubmitFromDTO.class); staffSubmitFrom.setRoles(Arrays.asList(getRoleResult.getData().getId())); staffSubmitFrom.setApp("gov"); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index df895b4f11..8302b1252f 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -692,4 +692,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl listGridIdsInCommunity(String gridId) { + return baseDao.selectListGridIdsInCommunity(gridId); + } } 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/java/com/epmet/service/impl/DepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java index 3e8dbaf9d1..5b53e49d0b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/DepartmentServiceImpl.java @@ -21,16 +21,16 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerDepartmentConstant; import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.CustomerDepartmentDao; import com.epmet.dao.CustomerStaffDepartmentDao; -import com.epmet.dto.CustomerIdDTO; import com.epmet.dto.CustomerDepartmentDTO; +import com.epmet.dto.CustomerIdDTO; import com.epmet.dto.CustomerStaffDepartmentDTO; -import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; @@ -49,7 +49,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; /** @@ -73,7 +72,8 @@ public class DepartmentServiceImpl implements DepartmentService { private CustomerStaffDepartmentService customerStaffDepartmentService; @Autowired private EpmetUserFeignClient epmetUserFeignClient; - + @Autowired + private LoginUserUtil loginUserUtil; /** * @param formDTO * @return @@ -139,7 +139,7 @@ public class DepartmentServiceImpl implements DepartmentService { return result; } //2:删除部门信息(逻辑删) - if (customerDepartmentDao.deleteById(formDTO.getDepartmentId()) < NumConstant.ONE) { + if (customerDepartmentDao.delDeptById(formDTO.getDepartmentId(),loginUserUtil.getLoginUserId()) < NumConstant.ONE) { log.error(CustomerDepartmentConstant.DEL_EXCEPTION); throw new RenException(CustomerDepartmentConstant.DEL_EXCEPTION); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml index 8651e49ce2..0a9653fd28 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /gov/org @@ -135,4 +136,13 @@ pagehelper: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 + +rocketmq: + name-server: @rocketmq.nameserver@ 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 b85f892aa1..87f00d6652 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 @@ -175,8 +175,8 @@ SELECT agency.ID AS agencyId, agency.ORGANIZATION_NAME AS agencyName, - agency.PIDS AS agencyIdPath, - agency.ALL_PARENT_NAME AS agencyNamePath, + IF((agency.PIDS IS NULL) || (TRIM(agency.PIDS) = '') ,agency.ID,CONCAT(agency.PIDS,':',agency.ID)) AS agencyIdPath, + IF(TRIM(IFNULL(agency.ALL_PARENT_NAME,'')) = '' ,agency.ORGANIZATION_NAME,CONCAT(agency.ALL_PARENT_NAME,':',agency.ORGANIZATION_NAME)) AS agencyNamePath, agency.CUSTOMER_ID AS customerId FROM CUSTOMER_STAFF_AGENCY staff @@ -188,12 +188,12 @@ + + select id,organization_name,customer_id from customer_agency where pid = #{pid} and customer_id = #{customerId} + + + update customer_agency + set updated_by = #{operateUserId}, + del_flag = '1', + UPDATED_TIME=NOW() + where id=#{agencyId} + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml index bf175e9127..fbfbe06478 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerDepartmentDao.xml @@ -76,4 +76,12 @@ AND ca.del_flag = '0' AND cd.agency_id = #{agencyId} + + + update customer_department + set updated_by = #{operateUserId}, + del_flag = '1', + UPDATED_TIME=NOW() + where id=#{deptId} + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index 99f24e8b85..ec5c6143ac 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -59,6 +59,9 @@ grid.del_flag = 0 AND grid.area_code LIKE CONCAT(#{areaCode},'%') + + AND grid.customer_id = #{customerId} + ORDER BY grid.customer_id, CONVERT ( gridName USING gbk ) ASC @@ -74,36 +77,72 @@ ( - SELECT - a.id AS grid_id, - a.customer_id, - concat( agency.fullname, '-', a.grid_name ) AS gridName - FROM - CUSTOMER_GRID a - - LEFT JOIN ( - SELECT - a1.id, - CASE - - WHEN a2.ORGANIZATION_NAME IS NULL THEN - a1.ORGANIZATION_NAME ELSE concat( a2.ORGANIZATION_NAME, '-', a1.ORGANIZATION_NAME ) - END AS fullname - FROM - customer_agency a1 - LEFT JOIN customer_agency a2 ON a1.PID = a2.ID - AND a1.del_flag = '0' - WHERE - a1.del_flag = '0' - ) agency ON a.PID = agency.ID - - - WHERE - a.del_flag = 0 - AND - a.area_code = #{areaCode} - ORDER BY - CONVERT ( gridName USING gbk ) ASC + ( + SELECT + a.id AS grid_id, + a.customer_id, + concat( agency.fullname, '-', a.grid_name ) AS gridName + FROM + CUSTOMER_GRID a + LEFT JOIN ( + SELECT + a1.id, + CASE + WHEN a2.ORGANIZATION_NAME IS NULL THEN + a1.ORGANIZATION_NAME ELSE concat( a2.ORGANIZATION_NAME, '-', a1.ORGANIZATION_NAME ) + END AS fullname + FROM + customer_agency a1 + LEFT JOIN customer_agency a2 ON a1.PID = a2.ID + AND a1.del_flag = '0' + WHERE + a1.del_flag = '0' + AND a1.customer_id = #{customerId} + ) agency ON a.PID = agency.ID + WHERE + a.del_flag = 0 + AND a.area_code = #{areaCode} + + AND a.customer_id = #{customerId} + + ORDER BY + CONVERT ( gridName USING gbk ) ASC + LIMIT 0,999999999999 + ) + UNION + ( + SELECT + b.id AS grid_id, + b.customer_id, + concat(agency.fullname , '-' ,b.grid_name) as gridName + FROM + CUSTOMER_GRID b + LEFT JOIN ( + SELECT + a1.id, + CASE + WHEN a2.ORGANIZATION_NAME IS NULL THEN + a1.ORGANIZATION_NAME ELSE concat( a2.ORGANIZATION_NAME, '-', a1.ORGANIZATION_NAME ) + END AS fullname + FROM + customer_agency a1 + LEFT JOIN customer_agency a2 ON a1.PID = a2.ID + AND a1.del_flag = '0' + WHERE + a1.del_flag = '0' + AND a1.customer_id = #{customerId} + ) agency ON b.PID = agency.ID + WHERE + b.del_flag = 0 + + AND b.customer_id = #{customerId} + + AND b.area_code LIKE CONCAT(#{cityCode},'%') + AND #{areaCode}]]> + ORDER BY + b.area_code DESC ,CONVERT ( gridName USING gbk ) ASC + LIMIT 0,999999999999 + ) ) c @@ -194,7 +233,8 @@ set grid_name = #{gridName}, manage_district = #{manageDistrict}, - updated_by = #{updatedBy} + updated_by = #{updatedBy}, + UPDATED_TIME=NOW() where id = #{id} @@ -205,7 +245,8 @@ customer_grid set updated_by = #{userId}, - del_flag = 1 + del_flag = 1, + UPDATED_TIME=NOW() where id = #{gridId} @@ -543,4 +584,20 @@ ID = #{orgId} + + + diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectProcessAttachmentDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectProcessAttachmentDTO.java new file mode 100644 index 0000000000..a64fbbe568 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectProcessAttachmentDTO.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; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目节点附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-21 + */ +@Data +public class ProjectProcessAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 项目进展表ID + */ + private String processId; + + /** + * 文件所属内容(内部备注: public 公开答复:internal) + */ + private String filePlace; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小 + */ + 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 Integer isRelease; + + /** + * 附件状态(审核中:auditing; + * auto_passed: 自动通过; + * review:结果不确定,需要人工审核; + * block: 结果违规; + * rejected:人工审核驳回; + * approved:人工审核通过) + * 现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 附件审核结果描述 + */ + private String reason; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectProcessScanTaskDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectProcessScanTaskDTO.java new file mode 100644 index 0000000000..2a62f79281 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectProcessScanTaskDTO.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 项目节点附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-21 + */ +@Data +public class ProjectProcessScanTaskDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 项目进展表(project_process)ID + */ + private String processId; + + /** + * 项目附件表主键,对应dataId + */ + private String projectProcessAttachmentId; + + /** + * 阿里云审核任务Id + */ + private String taskId; + + /** + * 审核状态【auditing: 审核中; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规;】 + */ + private String status; + + /** + * 附件类型(视频 - video、 语音 - voice 文件 - doc) + */ + private String attachmentType; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/FileDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/FileDTO.java new file mode 100644 index 0000000000..32b0bf76c8 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/FileDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/12/21 15:37 + */ +@NoArgsConstructor +@Data +public class FileDTO implements Serializable { + + private static final long serialVersionUID = -5307959406648243353L; + /** + * 文件名 + */ + private String name; + /** + * url地址 + */ + private String url; + /** + * 文件类型(图片 - image、 视频 - video、 语音 - voice、 文档 - doc) + */ + private String type; + /** + * 后缀名 + */ + private String format; + /** + * 文件大小 kb + */ + private Integer size; + /** + * 语音或视频文件时长,单位秒 + */ + private Integer duration; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProcessListV2FormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProcessListV2FormDTO.java new file mode 100644 index 0000000000..cad3cb0026 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProcessListV2FormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/12/21 下午3:24 + */ +@Data +public class ProcessListV2FormDTO implements Serializable { + + private static final long serialVersionUID = -7922290706507984148L; + + public interface ProcessListV2Form{} + + @NotBlank(message = "项目ID不能为空",groups = {ProcessListV2Form.class}) + private String projectId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectClosedFromDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectClosedFromDTO.java index 4b9e9a5ff6..75cf13e64e 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectClosedFromDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectClosedFromDTO.java @@ -5,6 +5,7 @@ import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; /** * @author zhaoqifeng @@ -46,4 +47,12 @@ public class ProjectClosedFromDTO implements Serializable { * 部门名 */ private String departmentName; + /** + * 公开答复对应文件集合 + */ + private List publicFile; + /** + * 内部备注对应文件集合 + */ + private List internalFile; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java index bd7a69b259..3f7f2a1c13 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java @@ -5,6 +5,7 @@ import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; /** * @author zhaoqifeng @@ -45,4 +46,13 @@ public class ProjectResponseFormDTO implements Serializable { * 部门名 */ private String departmentName; + /** + * 公开答复对应文件集合 + */ + private List publicFile; + /** + * 内部备注对应文件集合 + */ + private List internalFile; + } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReturnFromDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReturnFromDTO.java index 8b36b5ddcd..1bab0fbe08 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReturnFromDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReturnFromDTO.java @@ -5,6 +5,7 @@ import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; /** * @author zhaoqifeng @@ -46,4 +47,13 @@ public class ReturnFromDTO implements Serializable { * 部门名 */ private String departmentName; + + /** + * 公开答复对应文件集合 + */ + private List publicFile; + /** + * 内部备注对应文件集合 + */ + private List internalFile; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java index 9d078a27b5..4b9718122c 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java @@ -32,5 +32,13 @@ public class TransferFormDTO implements Serializable { @Valid private List staffList; + /** + * 公开答复对应文件集合 + */ + private List publicFile; + /** + * 内部备注对应文件集合 + */ + private List internalFile; } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessListV2ResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessListV2ResultDTO.java new file mode 100644 index 0000000000..1e7460c5ad --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessListV2ResultDTO.java @@ -0,0 +1,72 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/12/21 下午3:31 + */ +@Data +public class ProcessListV2ResultDTO implements Serializable { + + /** + * 项目ID + */ + private String projectId; + + /** + * 进展Id + */ + private String processId; + + /** + * 处理进展名称 + */ + private String processName; + + /** + * 处理进展时间 + */ + private Long processTime; + + /** + * 处理部门 + */ + private String departmentName; + + /** + * 公开答复 + */ + private String publicReply; + + /** + * 内部备注 + */ + private String internalRemark; + + /** + * + */ + private List publicFile; + + /** + * + */ + private List internalFile; + + public ProcessListV2ResultDTO() { + this.projectId = ""; + this.processId = ""; + this.processName = ""; + this.processTime = 0L; + this.departmentName = ""; + this.publicReply = ""; + this.internalRemark = ""; + this.publicFile = new ArrayList<>(); + this.internalFile = new ArrayList<>(); + } +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectInfoDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectInfoDTO.java new file mode 100644 index 0000000000..b427707f58 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectInfoDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/2/24 16:11 + */ +@Data +public class ProjectInfoDTO { + // 【事件 = 项目】 + private String projectId; + + /** + * 项目标题 + */ + private String eventTitle; + + /** + * 项目内容 + */ + private String eventContent; + + private String issueId; + private String gridName; + private String gridId; + + /** + * 项目附件图片集合 + */ + private List imgUrlList; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PublicAndInternalFileResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PublicAndInternalFileResultDTO.java new file mode 100644 index 0000000000..9da2bf5314 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PublicAndInternalFileResultDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/12/21 下午3:44 + */ +@Data +public class PublicAndInternalFileResultDTO implements Serializable { + + private static final long serialVersionUID = -4258868880494403603L; + + /** + * 文件名 + */ + private String name; + + /** + * url地址 + */ + private String url; + + /** + * 文件类型(图片 - image、 视频 - video、 语音 - voice、 文档 - doc) + */ + private String type; + + /** + * 后缀名 + */ + private String format; + + /** + * 文件大小 kb + */ + private Integer size; + + /** + * 语音或视频文件时长,单位秒 + */ + private Integer duration; + + /** + * 附件ID + */ + @JsonIgnore + private String attachmentId; + + @JsonIgnore + private String processId; + + @JsonIgnore + private String filePlace; + + public PublicAndInternalFileResultDTO() { + this.name = ""; + this.url = ""; + this.type = ""; + this.format = ""; + this.size = 0; + this.duration = 0; + } +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java index 2cd5f5f5fb..49b573f0be 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java @@ -6,13 +6,12 @@ import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.dto.form.ProjectByCreateTopicUserFormDTO; import com.epmet.dto.form.ProjectListFromDTO; -import com.epmet.dto.result.MyPartProjectsResultDTO; -import com.epmet.dto.result.PendProjectListResultDTO; -import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO; -import com.epmet.dto.result.ProjectOfCreateTopicUserResultDTO; +import com.epmet.dto.result.*; import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; 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; @@ -75,4 +74,7 @@ public interface GovProjectOpenFeignClient { */ @PostMapping("gov/project/project/list-by-createtopic-userid") Result> listProjectsByCreateTopicUserId(@RequestBody ProjectByCreateTopicUserFormDTO form); + + @GetMapping("gov/project/project/queryprojectinfobyprojectid/{projectId}") + Result queryProjectInfoByProjectId(@PathVariable("projectId")String projectId); } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java index fd478f1245..ca4488be17 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java @@ -7,10 +7,7 @@ import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.dto.form.ProjectByCreateTopicUserFormDTO; import com.epmet.dto.form.ProjectListFromDTO; -import com.epmet.dto.result.MyPartProjectsResultDTO; -import com.epmet.dto.result.PendProjectListResultDTO; -import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO; -import com.epmet.dto.result.ProjectOfCreateTopicUserResultDTO; +import com.epmet.dto.result.*; import com.epmet.feign.GovProjectOpenFeignClient; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.stereotype.Component; @@ -69,4 +66,9 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli public Result> listProjectsByCreateTopicUserId(ProjectByCreateTopicUserFormDTO form) { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "listProjectsByCreateTopicUserId", form); } + + @Override + public Result queryProjectInfoByProjectId(String projectId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "queryProjectInfoByProjectId", projectId); + } } diff --git a/epmet-module/gov-project/gov-project-server/Dockerfile b/epmet-module/gov-project/gov-project-server/Dockerfile index 372d5097ca..aed003692d 100644 --- a/epmet-module/gov-project/gov-project-server/Dockerfile +++ b/epmet-module/gov-project/gov-project-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./gov-project.jar EXPOSE 8102 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml index cee65e15cc..d472c2ac26 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-project-server: container_name: gov-project-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-project-server:0.3.46 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-project-server:0.3.48 ports: - "8102:8102" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 0dc357dada..12e29787df 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.46 + 0.3.48 gov-project com.epmet diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java index d529abf12e..c883ad7153 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -152,4 +152,10 @@ public interface ProjectConstant { * 非精准计算 */ String IMPRECISE_CALCULATION = "imprecise"; + + String PUBLIC = "public"; + + String INTERNAL = "internal"; + + String NOT_EXIST_PROJECT = "未查询带此项目信息......"; } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java index 3c3641dac5..05fe6c04b4 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java @@ -17,9 +17,7 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -33,6 +31,7 @@ import com.epmet.dto.result.*; import com.epmet.excel.ProjectExcel; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import com.epmet.service.ProjectService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -204,4 +203,18 @@ public class ProjectController { List projects = projectService.listProjectsByCreateTopicUserId(form.getUserId(), form.getCustomerId(), form.getPageNo(), form.getPageSize()); return new Result().ok(projects); } + + /** + * @param projectId + * @author yinzuomei + * @description 查询项目信息(龙湾临时调用) + * @Date 2021/2/24 17:04 + **/ + @GetMapping("queryprojectinfobyprojectid/{projectId}") + public Result queryProjectInfoByProjectId(@PathVariable("projectId")String projectId){ + if(StringUtils.isNotBlank(projectId)){ + return new Result().ok(projectService.queryProjectInfoByProjectId(projectId)); + } + return new Result<>(); + } } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectProcessAttachmentController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectProcessAttachmentController.java new file mode 100644 index 0000000000..e2552ca57c --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectProcessAttachmentController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ProjectProcessAttachmentDTO; +import com.epmet.excel.ProjectProcessAttachmentExcel; +import com.epmet.service.ProjectProcessAttachmentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 项目节点附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-21 + */ +@RestController +@RequestMapping("projectprocessattachment") +public class ProjectProcessAttachmentController { + + @Autowired + private ProjectProcessAttachmentService projectProcessAttachmentService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = projectProcessAttachmentService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ProjectProcessAttachmentDTO data = projectProcessAttachmentService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ProjectProcessAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + projectProcessAttachmentService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ProjectProcessAttachmentDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + projectProcessAttachmentService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + projectProcessAttachmentService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = projectProcessAttachmentService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ProjectProcessAttachmentExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectProcessScanTaskController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectProcessScanTaskController.java new file mode 100644 index 0000000000..2080c6c9bc --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectProcessScanTaskController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.ProjectProcessScanTaskDTO; +import com.epmet.excel.ProjectProcessScanTaskExcel; +import com.epmet.service.ProjectProcessScanTaskService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 项目节点附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-21 + */ +@RestController +@RequestMapping("projectprocessscantask") +public class ProjectProcessScanTaskController { + + @Autowired + private ProjectProcessScanTaskService projectProcessScanTaskService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = projectProcessScanTaskService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + ProjectProcessScanTaskDTO data = projectProcessScanTaskService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody ProjectProcessScanTaskDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + projectProcessScanTaskService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody ProjectProcessScanTaskDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + projectProcessScanTaskService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + projectProcessScanTaskService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = projectProcessScanTaskService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, ProjectProcessScanTaskExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java index 582d4e6413..db5d13ab24 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java @@ -121,6 +121,13 @@ public class ProjectTraceController { return new Result(); } + @PostMapping("closeproject-v2") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_CLOSE) + public Result closedV2(@LoginUser TokenDto tokenDto, @RequestBody ProjectClosedFromDTO fromDTO) { + projectTraceService.closedV2(tokenDto, fromDTO); + return new Result(); + } + /** * 可退回节点列表 * @@ -260,5 +267,57 @@ public class ProjectTraceController { projectTraceService.response(tokenDTO, formDTO); return new Result(); } + + /** + * @Description 项目处理进展列表V2 + * @Param formDTO + * @author zxc + * @date 2020/12/21 下午3:55 + */ + @PostMapping("processlist-v2") + public Result> processListV2(@RequestBody ProcessListV2FormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ProcessListV2FormDTO.ProcessListV2Form.class); + return new Result>().ok(projectTraceService.processListV2(formDTO)); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 项目跟踪-转其他部门2.0接口 + **/ + @PostMapping("transfer-v2") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_TRANSFER) + public Result transferV2(@LoginUser TokenDto tokenDTO, @RequestBody TransferFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + projectProcessService.transferV2(formDTO); + return new Result(); + } + + /** + * @param tokenDto fromDTO + * @Description 项目退回V2.0接口 + * @author sun + */ + @PostMapping("return-v2") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_RETURN) + public Result projectReturnV2(@LoginUser TokenDto tokenDto, @RequestBody ReturnFromDTO fromDTO) { + projectTraceService.projectReturnV2(tokenDto, fromDTO); + return new Result(); + } + + /** + * @param tokenDTO fromDTO + * @Description 处理响应V2.0接口 + * @author sun + */ + @PostMapping("response-v2") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_TRANSFER) + public Result responseV2(@LoginUser TokenDto tokenDTO, @RequestBody ProjectResponseFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + projectTraceService.responseV2(tokenDTO, formDTO); + return new Result(); + } + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java index e4dfd04800..5eccc08f67 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java @@ -23,10 +23,7 @@ import com.epmet.dto.ProjectStaffDTO; import com.epmet.dto.form.LatestListFormDTO; import com.epmet.dto.form.ProjectListFromDTO; import com.epmet.dto.form.ShiftProjectsFromDTO; -import com.epmet.dto.result.LatestListResultDTO; -import com.epmet.dto.result.MyPartProjectsResultDTO; -import com.epmet.dto.result.ProjectDetailResultDTO; -import com.epmet.dto.result.ProjectOfCreateTopicUserResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.ProjectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -148,4 +145,6 @@ public interface ProjectDao extends BaseDao { */ List listProjectsByCreateTopicUserId(@Param("userId") String userId, @Param("customerId") String customerId); + + ProjectInfoDTO queryProjectInfoByProjectId(String projectId); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectProcessAttachmentDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectProcessAttachmentDao.java new file mode 100644 index 0000000000..ea6d467deb --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectProcessAttachmentDao.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.PublicAndInternalFileResultDTO; +import com.epmet.entity.ProjectProcessAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 项目节点附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-21 + */ +@Mapper +public interface ProjectProcessAttachmentDao extends BaseDao { + + /** + * @Description 根据项目ID查询附件 + * @Param projectId + * @author zxc + * @date 2020/12/21 下午4:33 + */ + List selectAttachByProjectId(@Param("projectId")String projectId); + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectProcessDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectProcessDao.java index dc3260b2c8..80fa2b05a0 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectProcessDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectProcessDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.form.ProcessProjectIdFormDTO; import com.epmet.dto.form.ProjectIdFormDTO; +import com.epmet.dto.result.ProcessListV2ResultDTO; import com.epmet.dto.result.ProcesslistResultDTO; import com.epmet.dto.result.ProjectOrgRelationWhenResponseResultDTO; import com.epmet.dto.result.ProjectProcessListResultDTO; @@ -77,4 +78,12 @@ public interface ProjectProcessDao extends BaseDao { * @date 2020.09.17 17:56 **/ List selectResponseTrace(@Param("projects") List projects); + + /** + * @Description 查询项目进展 + * @Param projectId + * @author zxc + * @date 2020/12/21 下午4:18 + */ + List selectProcessList(@Param("projectId")String projectId); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectProcessScanTaskDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectProcessScanTaskDao.java new file mode 100644 index 0000000000..ccd1e96503 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectProcessScanTaskDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.ProjectProcessScanTaskEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目节点附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-21 + */ +@Mapper +public interface ProjectProcessScanTaskDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessAttachmentEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessAttachmentEntity.java new file mode 100644 index 0000000000..1515cbfe98 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessAttachmentEntity.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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目节点附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project_process_attachment") +public class ProjectProcessAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 项目进展表ID + */ + private String processId; + + /** + * 文件所属内容(内部备注: public 公开答复:internal) + */ + private String filePlace; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小 + */ + 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 Integer isRelease; + + /** + * 附件状态(审核中:auditing; + * auto_passed: 自动通过; + * review:结果不确定,需要人工审核; + * block: 结果违规; + * rejected:人工审核驳回; + * approved:人工审核通过) + * 现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 附件审核结果描述 + */ + private String reason; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessScanTaskEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessScanTaskEntity.java new file mode 100644 index 0000000000..bd4a6a41e5 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessScanTaskEntity.java @@ -0,0 +1,79 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 项目节点附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project_process_scan_task") +public class ProjectProcessScanTaskEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 项目进展表(project_process)ID + */ + private String processId; + + /** + * 项目附件表主键,对应dataId + */ + private String projectProcessAttachmentId; + + /** + * 阿里云审核任务Id + */ + private String taskId; + + /** + * 审核状态【auditing: 审核中; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规;】 + */ + private String status; + + /** + * 附件类型(视频 - video、 语音 - voice 文件 - doc) + */ + private String attachmentType; + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectProcessAttachmentExcel.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectProcessAttachmentExcel.java new file mode 100644 index 0000000000..1809357326 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectProcessAttachmentExcel.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.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 项目节点附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-21 + */ +@Data +public class ProjectProcessAttachmentExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "项目ID") + private String projectId; + + @Excel(name = "项目进展表ID") + private String processId; + + @Excel(name = "文件所属内容(内部备注: public 公开答复:internal)") + private String filePlace; + + @Excel(name = "文件名") + private String fileName; + + @Excel(name = "附件名(uuid随机生成)") + private String attachmentName; + + @Excel(name = "文件大小") + private Integer attachmentSize; + + @Excel(name = "文件格式(JPG、PNG、JPEG、BMP、GIF、PDF、PPT、PPTX、DOC、DOCX、XLS、XLSX、MP3、WMA、M4A、MP4、AVI、MOV、RMVB、RM、WMV)") + private String attachmentFormat; + + @Excel(name = "文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))") + private String attachmentType; + + @Excel(name = "url地址") + private String attachmentUrl; + + @Excel(name = "排序(需求确定,按上传顺序排序)") + private Integer sort; + + @Excel(name = "语音或视频时长,秒") + private Integer duration; + + @Excel(name = "是否强制发布(0:否 1:是)") + private Integer isRelease; + + @Excel(name = "附件审核状态") + private String status; + + @Excel(name = "附件审核结果描述") + private String reason; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectProcessScanTaskExcel.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectProcessScanTaskExcel.java new file mode 100644 index 0000000000..201b31b5b1 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectProcessScanTaskExcel.java @@ -0,0 +1,75 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 项目节点附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-21 + */ +@Data +public class ProjectProcessScanTaskExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "项目ID") + private String projectId; + + @Excel(name = "项目进展表(project_process)ID") + private String processId; + + @Excel(name = "项目附件表主键,对应dataId") + private String projectProcessAttachmentId; + + @Excel(name = "阿里云审核任务Id") + private String taskId; + + @Excel(name = "审核状态【auditing: 审核中; auto_passed: 自动通过;"+ + "review:结果不确定,需要人工审核;block: 结果违规;】") + private String status; + + @Excel(name = "附件类型(视频 - video、 语音 - voice 文件 - doc)") + private String attachmentType; + + @Excel(name = "删除标识:0.未删除 1.已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectProcessAttachmentRedis.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectProcessAttachmentRedis.java new file mode 100644 index 0000000000..1e91b2dcda --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectProcessAttachmentRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 项目节点附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-21 + */ +@Component +public class ProjectProcessAttachmentRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectProcessScanTaskRedis.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectProcessScanTaskRedis.java new file mode 100644 index 0000000000..5087a591e0 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectProcessScanTaskRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 项目节点附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-21 + */ +@Component +public class ProjectProcessScanTaskRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessAttachmentService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessAttachmentService.java new file mode 100644 index 0000000000..7b5858b5e5 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessAttachmentService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ProjectProcessAttachmentDTO; +import com.epmet.entity.ProjectProcessAttachmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目节点附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-21 + */ +public interface ProjectProcessAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-21 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-21 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ProjectProcessAttachmentDTO + * @author generator + * @date 2020-12-21 + */ + ProjectProcessAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-21 + */ + void save(ProjectProcessAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-21 + */ + void update(ProjectProcessAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-21 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessScanTaskService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessScanTaskService.java new file mode 100644 index 0000000000..079f46580a --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessScanTaskService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.ProjectProcessScanTaskDTO; +import com.epmet.entity.ProjectProcessScanTaskEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目节点附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-21 + */ +public interface ProjectProcessScanTaskService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-21 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-21 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ProjectProcessScanTaskDTO + * @author generator + * @date 2020-12-21 + */ + ProjectProcessScanTaskDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-21 + */ + void save(ProjectProcessScanTaskDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-21 + */ + void update(ProjectProcessScanTaskDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-21 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessService.java index 59f41ab307..3a7643f3a5 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessService.java @@ -151,4 +151,12 @@ public interface ProjectProcessService extends BaseService **/ List selectResponseTrace(List projects); + /** + * @param formDTO + * @return + * @Author sun + * @Description 项目跟踪-转其他部门2.0接口 + **/ + void transferV2(TransferFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java index 03bb5fc584..3216f2d576 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java @@ -146,6 +146,15 @@ public interface ProjectService extends BaseService { */ void closed(ProjectClosedFromDTO fromDTO); + /** + * 项目结案 + * @author zhaoqifeng + * @date 2020/5/13 9:54 + * @param fromDTO 参数 + * @return void + */ + void closedV2(ProjectClosedFromDTO fromDTO); + /** * 项目退回 * @author zhaoqifeng @@ -233,4 +242,38 @@ public interface ProjectService extends BaseService { * @date 2020.11.13 09:12 */ List listProjectsByCreateTopicUserId(String userId, String customerId, Integer pageNo, Integer pageSize); + + /** + * 项目处理节点附件保存 + * @author zhaoqifeng + * @date 2020/12/22 9:17 + * @param publicFile + * @param internalFile + * @param customerId + * @param projectId + * @param processId + * @return void + */ + void saveFile(List publicFile, List internalFile, String customerId, String projectId, String processId); + + /** + * @param fromDTO + * @Description 项目退回V2.0接口 + */ + void projectReturnV2(ReturnFromDTO fromDTO); + + /** + * @param formDTO + * @Description 处理响应V2.0接口 + * @author sun + */ + void responseV2(ProjectResponseFormDTO formDTO); + + /** + * @param projectId + * @author yinzuomei + * @description 查询项目信息(龙湾临时调用) + * @Date 2021/2/24 17:07 + **/ + ProjectInfoDTO queryProjectInfoByProjectId(String projectId); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java index d41408524c..3b5d227ea4 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java @@ -1,7 +1,6 @@ package com.epmet.service; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -68,6 +67,17 @@ public interface ProjectTraceService { */ void closed(TokenDto tokenDto, ProjectClosedFromDTO fromDTO); + /** + * 项目结案 + * + * @param tokenDto token + * @param fromDTO 入参 + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/5/11 16:27 + */ + void closedV2(TokenDto tokenDto, ProjectClosedFromDTO fromDTO); + /** * 可退回节点列表 * @@ -117,4 +127,26 @@ public interface ProjectTraceService { * @return void */ void response(TokenDto tokenDto, ProjectResponseFormDTO formDTO); + + /** + * @Description 项目处理进展列表V2 + * @Param formDTO + * @author zxc + * @date 2020/12/21 下午3:55 + */ + List processListV2(ProcessListV2FormDTO formDTO); + + /** + * @param tokenDto fromDTO + * @Description 项目退回V2.0接口 + * @author sun + */ + void projectReturnV2(TokenDto tokenDto, ReturnFromDTO fromDTO); + + /** + * @param formDTO + * @Description 处理响应V2.0接口 + * @author sun + */ + void responseV2(TokenDto tokenDto, ProjectResponseFormDTO formDTO); } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessAttachmentServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessAttachmentServiceImpl.java new file mode 100644 index 0000000000..cecb5cba05 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessAttachmentServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ProjectProcessAttachmentDao; +import com.epmet.dto.ProjectProcessAttachmentDTO; +import com.epmet.entity.ProjectProcessAttachmentEntity; +import com.epmet.redis.ProjectProcessAttachmentRedis; +import com.epmet.service.ProjectProcessAttachmentService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目节点附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-21 + */ +@Service +public class ProjectProcessAttachmentServiceImpl extends BaseServiceImpl implements ProjectProcessAttachmentService { + + @Autowired + private ProjectProcessAttachmentRedis projectProcessAttachmentRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ProjectProcessAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ProjectProcessAttachmentDTO.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 ProjectProcessAttachmentDTO get(String id) { + ProjectProcessAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ProjectProcessAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ProjectProcessAttachmentDTO dto) { + ProjectProcessAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ProjectProcessAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ProjectProcessAttachmentDTO dto) { + ProjectProcessAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ProjectProcessAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessScanTaskServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessScanTaskServiceImpl.java new file mode 100644 index 0000000000..34d303c6f7 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessScanTaskServiceImpl.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.ProjectProcessScanTaskDao; +import com.epmet.dto.ProjectProcessScanTaskDTO; +import com.epmet.entity.ProjectProcessScanTaskEntity; +import com.epmet.redis.ProjectProcessScanTaskRedis; +import com.epmet.service.ProjectProcessScanTaskService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目节点附件安全校验任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-21 + */ +@Service +public class ProjectProcessScanTaskServiceImpl extends BaseServiceImpl implements ProjectProcessScanTaskService { + + @Autowired + private ProjectProcessScanTaskRedis projectProcessScanTaskRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ProjectProcessScanTaskDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ProjectProcessScanTaskDTO.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 ProjectProcessScanTaskDTO get(String id) { + ProjectProcessScanTaskEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ProjectProcessScanTaskDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ProjectProcessScanTaskDTO dto) { + ProjectProcessScanTaskEntity entity = ConvertUtils.sourceToTarget(dto, ProjectProcessScanTaskEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ProjectProcessScanTaskDTO dto) { + ProjectProcessScanTaskEntity entity = ConvertUtils.sourceToTarget(dto, ProjectProcessScanTaskEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java index 759d57bcb2..8575f2d4a8 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java @@ -35,11 +35,13 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ProjectConstant; import com.epmet.constant.ReadFlagConstant; +import com.epmet.constant.SmsTemplateConstant; import com.epmet.constant.UserMessageConstant; import com.epmet.dao.ProjectOrgRelationDao; import com.epmet.dao.ProjectDao; import com.epmet.dao.ProjectProcessDao; import com.epmet.dao.ProjectStaffDao; +import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.ProjectDTO; import com.epmet.dto.ProjectProcessDTO; import com.epmet.dto.ProjectStaffDTO; @@ -305,6 +307,7 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl smsList = new ArrayList<>(); + staffList.forEach(staff -> { + CustomerStaffDTO staffDTO = new CustomerStaffDTO(); + staffDTO.setUserId(staff.getStaffId()); + Result staffResult = epmetUserFeignClient.getCustomerStaffInfoByUserId(staffDTO); + if (staffResult.success() && null != staffResult.getData()) { + ProjectSendMsgFormDTO sms = new ProjectSendMsgFormDTO(); + sms.setCustomerId(staffResult.getData().getCustomerId()); + sms.setMobile(staffResult.getData().getMobile()); + sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_TRANSFER); + sms.setParameterKey("send_msg"); + smsList.add(sms); + } + }); + Result result = epmetMessageOpenFeignClient.projectSendMsg(smsList); + if (!result.success()) { + logger.error("项目流转,发送手机短信失败" + JSON.toJSONString(result)); + } + } /** @@ -521,4 +545,189 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + + //1:更新项目人员关联表数据状态为已处理 + ProjectStaffEntity staffEntity = projectStaffDao.selectById(formDTO.getProjectStaffId()); + if (null == staffEntity) { + throw new RenException(ProjectConstant.SELECT_PROJECTSTAFF_EXCEPTION); + } + if (!ProjectConstant.UNHANDLED.equals(staffEntity.getIsHandle())) { + throw new RenException(ProjectConstant.UNHANDLED_EXCEPTION); + } + staffEntity.setIsHandle(ProjectConstant.HANDLE); + if (projectStaffDao.updateById(staffEntity) < NumConstant.ONE) { + throw new RenException(ProjectConstant.UPDATE_PROJECTSTAFF_EXCEPTION); + } + + //2:项目处理进展列表新增数据 + ProjectProcessEntity processEntity = ConvertUtils.sourceToTarget(formDTO, ProjectProcessEntity.class); + processEntity.setCustomerId(staffEntity.getCustomerId()); + processEntity.setDepartmentName(staffEntity.getDepartmentName()); + processEntity.setStaffId(staffEntity.getStaffId()); + processEntity.setOperation(ProjectConstant.OPERATION_TRANSFER); + processEntity.setOperationName(ProjectConstant.OPERATION_TRANSFER_NAME); + processEntity.setAgencyId(staffEntity.getOrgId()); + processEntity.setDepartmentId(staffEntity.getDepartmentId()); + processEntity.setGridId(staffEntity.getGridId()); + processEntity.setOrgIdPath(staffEntity.getOrgIdPath()); + projectProcessDao.insert(processEntity); + //2-1.项目附件表新增数据 + if ((null != formDTO.getPublicFile() && formDTO.getPublicFile().size() > NumConstant.ZERO) + || (null != formDTO.getInternalFile() && formDTO.getInternalFile().size() > NumConstant.ZERO)) { + projectService.saveFile(formDTO.getPublicFile(), formDTO.getInternalFile(), staffEntity.getCustomerId(), formDTO.getProjectId(), processEntity.getId()); + } + + //3:项目人员关联表新增部门流转数据 + List staffList = formDTO.getStaffList(); + if (null == staffList || staffList.size() < NumConstant.ONE) { + throw new RenException(ProjectConstant.DATE_EXCEPTION); + } + //3.1:调用gov-org服务,获取所有勾选人员对应的组织信息、部门信息、网格信息用于对处理部门和ORG_ID_PATH字段的赋值 + List agencyIdList = staffList.stream().map(TickStaffFormDTO::getAgencyId).collect(Collectors.toList()); + agencyIdList = new ArrayList(new LinkedHashSet<>(agencyIdList));agencyIdList.removeAll(Collections.singleton("")); + List deptIdList = staffList.stream().map(TickStaffFormDTO::getDepartmentId).collect(Collectors.toList()); + deptIdList = new ArrayList(new LinkedHashSet<>(deptIdList));deptIdList.removeAll(Collections.singleton("")); + List gridIdList = staffList.stream().map(TickStaffFormDTO::getGridId).collect(Collectors.toList()); + gridIdList = new ArrayList(new LinkedHashSet<>(gridIdList));gridIdList.removeAll(Collections.singleton("")); + AgencyDeptGridFormDTO agencyDeptGridFormDTO = new AgencyDeptGridFormDTO(); + agencyDeptGridFormDTO.setAgencyIdList(agencyIdList); + agencyDeptGridFormDTO.setDeptIdList(deptIdList); + agencyDeptGridFormDTO.setGridIdList(gridIdList); + Result resultDTO = govOrgFeignClient.getAgencyDeptGridList(agencyDeptGridFormDTO); + if (!resultDTO.success() || null == resultDTO.getData()) { + throw new RenException(ProjectConstant.SELECT_GOV_ORG_EXCEPTION); + } + AgencyDeptGridResultDTO agencyDeptGrid = resultDTO.getData(); + //3.2:批量新增项目人员关联表数据 + List entityList = new ArrayList<>(); + staffList.forEach(ts->{ + ProjectStaffEntity entity = ConvertUtils.sourceToTarget(ts, ProjectStaffEntity.class); + entity.setOrgId(ts.getAgencyId()); + entity.setProjectId(formDTO.getProjectId()); + entity.setProcessId(processEntity.getId()); + entity.setIsHandle(ProjectConstant.UNHANDLED); + agencyDeptGrid.getAgencyList().forEach(agency->{ + if (ts.getAgencyId().equals(agency.getId())) { + entity.setCustomerId(agency.getCustomerId()); + entity.setOrgIdPath(("".equals(agency.getPids()) ? "" : agency.getPids() + ":") + agency.getId()); + entity.setDepartmentName(agency.getOrganizationName()); + } + }); + if (StringUtils.isNotBlank(ts.getDepartmentId())) { + agencyDeptGrid.getDeptList().forEach(dept -> { + if (ts.getDepartmentId().equals(dept.getId())) { + entity.setDepartmentName(entity.getDepartmentName() + "-" + dept.getDepartmentName()); + } + }); + } + if (StringUtils.isNotBlank(ts.getGridId())) { + agencyDeptGrid.getGridList().forEach(grid -> { + if (ts.getGridId().equals(grid.getId())) { + entity.setDepartmentName(entity.getDepartmentName() + "-" + grid.getGridName()); + } + }); + } + entityList.add(entity); + }); + projectStaffService.insertBatch(entityList); + + //3.3 项目机关历时关系 project_org_relation 更新原来的 + ProjectOrgRelationEntity orientRelation = relationDao.selectByProjectStaffId(staffEntity.getId()); + if(null == orientRelation){ + log.error("com.epmet.service.impl.ProjectProcessServiceImpl.transfer,找不到项目节点机关历时记录,参数:{}",JSON.toJSONString(formDTO)); + } + Date current = new Date(); + WorkMinuteFormDTO timeParam = new WorkMinuteFormDTO(); + timeParam.setIfPrecise(ProjectConstant.IMPRECISE_CALCULATION); + timeParam.setIfCustom(ProjectConstant.CALCULATION_TYPE_DEFAULT); + TimestampIntervalFormDTO interval = new TimestampIntervalFormDTO(orientRelation.getProjectStaffId(),orientRelation.getInformedDate(),current); + List intervalList = new LinkedList<>();intervalList.add(interval); + timeParam.setTimeList(intervalList); + Result> timeResult = epmetCommonServiceOpenFeignClient.workMinutes(timeParam); + + if(timeResult.success() && !CollectionUtils.isEmpty(timeResult.getData()) && null != timeResult.getData().get(staffEntity.getId())){ + + ProjectOrgRelationEntity relationDto = new ProjectOrgRelationEntity(); + relationDto.setProjectStaffId(orientRelation.getProjectStaffId()); + relationDto.setHandledDate(current); + relationDto.setTotalPeriod(timeResult.getData().get(staffEntity.getId())); + relationDto.setOperation(ProjectConstant.OPERATION_TRANSFER); + if(null == orientRelation.getFirstDealtDate()){ + relationDto.setFirstDealtDate(current); + relationDto.setFirstReplyPeriod(relationDto.getTotalPeriod()); + } + relationDao.maintainTimePropertyConsistency(relationDto); + }else{ + log.error("com.epmet.service.impl.ProjectProcessServiceImpl.transfer,计算节点耗时失败,参数:{}", JSON.toJSONString(timeParam)); + throw new RenException("计算节点耗时失败"); + } + + //3.4 项目机关历时关系 project_org_relation 插入新增的 + List relationList = new LinkedList<>(); + entityList.forEach(staff -> { + ProjectOrgRelationEntity relation = new ProjectOrgRelationEntity(); + relation.setProjectStaffId(staff.getId()); + relation.setInformedDate(current); + relation.setSourceOperation(ProjectConstant.OPERATION_TRANSFER); + relationList.add(relation); + }); + relationDao.insertBatch(relationList); + + //4:调用epmet-message服务,给项目流转过程中的工作人员发送消息 + if (!transferMessage(formDTO).success()) { + throw new RenException(ProjectConstant.SAVE_MSG_EXCEPTION); + } + + //5:调用epmet-message服务,给项目流转过程中的工作人员发送订阅的微信消息 + if (!transferWxmpMessage(formDTO).success()) { + logger.error("项目流转,推送微信订阅消息失败"); + //throw new RenException(ProjectConstant.SAVE_WXMP_MSG_EXCEPTION); + } + + //短信消息 + List smsList = new ArrayList<>(); + staffList.forEach(staff -> { + CustomerStaffDTO staffDTO = new CustomerStaffDTO(); + staffDTO.setUserId(staff.getStaffId()); + Result staffResult = epmetUserFeignClient.getCustomerStaffInfoByUserId(staffDTO); + if (staffResult.success() && null != staffResult.getData()) { + ProjectSendMsgFormDTO sms = new ProjectSendMsgFormDTO(); + sms.setCustomerId(staffResult.getData().getCustomerId()); + sms.setMobile(staffResult.getData().getMobile()); + sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_TRANSFER); + sms.setParameterKey("send_msg"); + smsList.add(sms); + } + }); + Result result = epmetMessageOpenFeignClient.projectSendMsg(smsList); + if (!result.success()) { + logger.error("项目流转,发送手机短信失败" + JSON.toJSONString(result)); + } + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index be402ac8a4..e50f3944eb 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -33,6 +33,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ParameterKeyConstant; import com.epmet.constant.ProjectConstant; +import com.epmet.constant.SmsTemplateConstant; import com.epmet.constant.UserMessageConstant; import com.epmet.dao.ProjectDao; import com.epmet.dao.ProjectOrgRelationDao; @@ -106,6 +107,10 @@ public class ProjectServiceImpl extends BaseServiceImpl periodsToUpdate = relationDao.selectAllUnhandledProcess(fromDTO.getProjectId()); - //if(CollectionUtils.isEmpty(periodsToUpdate)){ - // log.error("com.epmet.service.impl.ProjectServiceImpl.closed,至少存在一条处理时间为空的项目节点耗时记录,但是没有找到,参数:{}",JSON.toJSONString(fromDTO)); - // throw new RenException("至少存在一条处理时间为空的项目节点耗时记录,但是没有找到"); - //} + ProjectOrgRelationEntity orientRelation = relationDao.selectByProjectStaffId(operatorProjectReference.getId()); + if(null == orientRelation){ + log.error("com.epmet.service.impl.ProjectServiceImpl.closed,找不到结案工作人员的节点耗时相关记录,参数:{}",JSON.toJSONString(fromDTO)); + throw new RenException("找不到结案工作人员的节点耗时相关记录"); + } + + Integer delta_t = calculateDelta_T(ProjectConstant.IMPRECISE_CALCULATION, + ProjectConstant.CALCULATION_TYPE_DEFAULT, operatorProjectReference.getId(),orientRelation.getInformedDate(),current); + ProjectOrgRelationEntity carrier = new ProjectOrgRelationEntity(); + carrier.setProjectStaffId(operatorProjectReference.getId()); + carrier.setOperation(ProjectConstant.OPERATION_CLOSE); + carrier.setTotalPeriod(delta_t); + carrier.setHandledDate(current); + if(null == orientRelation.getFirstDealtDate()){ + carrier.setFirstReplyPeriod(delta_t); + carrier.setFirstDealtDate(current); + } - //List intervalList = new LinkedList<>(); - //periodsToUpdate.forEach(local -> { - // TimestampIntervalFormDTO obj = new TimestampIntervalFormDTO(); - // obj.setId(local.getProjectStaffId()); - // obj.setLeft(local.getInformedDate()); - // obj.setRight(current); - // intervalList.add(obj); - //}); + relationDao.maintainTimePropertyConsistency(carrier); + + //通知 + List msgList = new ArrayList<>(); + //2020.10.26 添加项目结案发送微信订阅消息操作 sun + List wxmpMsgList = new ArrayList<>(); + //通知项目相关人员 + List personnelList = projectRelatedPersonnelService.getPersonnelListByProjectId(fromDTO.getProjectId()); + personnelList.forEach(p -> { + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(projectEntity.getCustomerId()); + messageFormDTO.setApp(p.getApp()); + messageFormDTO.setGridId(p.getGridId()); + messageFormDTO.setUserId(p.getUserId()); + messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE); + messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply())); + messageFormDTO.setReadFlag(Constant.UNREAD); + msgList.add(messageFormDTO); + WxSubscribeMessageFormDTO msg = new WxSubscribeMessageFormDTO(); + msg.setCustomerId(projectEntity.getCustomerId()); + msg.setClientType(p.getApp()); + msg.setUserId(p.getUserId()); + msg.setBehaviorType("项目消息"); + msg.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply())); + msg.setMessageTime(new Date()); + msg.setGridId(p.getGridId()); + wxmpMsgList.add(msg); + }); + //通知项目关联的部门人员 + List staffList = projectStaffService.getStaffsByProjectId(fromDTO.getProjectId()); + staffList.add(projectEntity.getCreatedBy()); + staffList.stream().distinct().forEach(s -> { + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(projectEntity.getCustomerId()); + messageFormDTO.setApp(ProjectConstant.GOV); + messageFormDTO.setGridId("*"); + messageFormDTO.setUserId(s); + messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE); + messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply())); + messageFormDTO.setReadFlag(Constant.UNREAD); + msgList.add(messageFormDTO); + WxSubscribeMessageFormDTO msg = new WxSubscribeMessageFormDTO(); + msg.setCustomerId(projectEntity.getCustomerId()); + msg.setClientType(AppClientConstant.APP_GOV); + msg.setUserId(s); + msg.setBehaviorType("项目消息"); + msg.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply())); + msg.setMessageTime(new Date()); + msg.setGridId("*"); + wxmpMsgList.add(msg); + }); + messageFeignClient.saveUserMessageList(msgList); + //2020.10.26 发送微信订阅消息 sun + logger.info("项目结案,开始推送微信订阅消息"); + Result result = epmetMessageOpenFeignClient.sendWxSubscribeMessage(wxmpMsgList); + if (!result.success()) { + logger.error("项目结案成功,发送微信订阅消息失败" + JSON.toJSONString(result)); + } + } + + /** + * 项目结案 + * + * @param fromDTO 参数 + * @return void + * @author zhaoqifeng + * @date 2020/5/13 9:54 + */ + @Override + public void closedV2(ProjectClosedFromDTO fromDTO) { + //公开回复内容审核 + if (StringUtils.isNotBlank(fromDTO.getPublicReply())) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + taskDTO.setContent(fromDTO.getPublicReply()); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + + //更新项目表状态 + ProjectEntity projectEntity = baseDao.selectById(fromDTO.getProjectId()); + if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) { + throw new RenException(EpmetErrorCode.PROJECT_IS_CLOSED.getCode()); + } + + Date current = new Date(); + projectEntity.setStatus(ProjectConstant.CLOSED); + projectEntity.setClosedStatus(fromDTO.getClosedStatus()); + baseDao.updateById(projectEntity); + //更新项目关联表 + ProjectStaffEntity projectStaffEntity = new ProjectStaffEntity(); + projectStaffEntity.setId(fromDTO.getProjectStaffId()); + projectStaffEntity.setIsHandle(ProjectConstant.HANDLE); + projectStaffService.updateById(projectStaffEntity); + + //查询结案人员的信息 + ProjectStaffEntity operatorProjectReference = projectStaffService.selectById(fromDTO.getProjectStaffId()); + if(null == operatorProjectReference){ + log.error("com.epmet.service.impl.ProjectServiceImpl.closed,找不到结案工作人员的相关记录,参数:{}",JSON.toJSONString(fromDTO)); + throw new RenException("找不到结案工作人员的相关记录"); + } + + //结案记录加入项目进展表 + ProjectProcessEntity projectProcessEntity = new ProjectProcessEntity(); + projectProcessEntity.setProjectId(fromDTO.getProjectId()); + projectProcessEntity.setCustomerId(operatorProjectReference.getCustomerId()); + projectProcessEntity.setDepartmentName(fromDTO.getDepartmentName()); + projectProcessEntity.setAgencyId(operatorProjectReference.getOrgId()); + projectProcessEntity.setGridId(operatorProjectReference.getGridId()); + projectProcessEntity.setDepartmentId(operatorProjectReference.getDepartmentId()); + projectProcessEntity.setOrgIdPath(operatorProjectReference.getOrgIdPath()); + projectProcessEntity.setEndTime(new Date()); + projectProcessEntity.setOperation(ProjectConstant.OPERATION_CLOSE); + projectProcessEntity.setOperationName(ProjectConstant.OPERATION_CLOSE_NAME); + projectProcessEntity.setPublicReply(fromDTO.getPublicReply()); + projectProcessEntity.setInternalRemark(fromDTO.getInternalRemark()); + projectProcessEntity.setStaffId(fromDTO.getUserId()); + ProjectDTO projectDto = ConvertUtils.sourceToTarget(projectEntity, ProjectDTO.class); + projectDto.setUpdatedTime(projectDto.getCreatedTime()); + projectProcessEntity.setCostWorkdays(getDetentionDays(projectDto)); + projectProcessService.insert(projectProcessEntity); + + //保存附件 + saveFile(fromDTO.getPublicFile(), fromDTO.getInternalFile(), operatorProjectReference.getCustomerId(), fromDTO.getProjectId(), + projectProcessEntity.getId()); ProjectOrgRelationEntity orientRelation = relationDao.selectByProjectStaffId(operatorProjectReference.getId()); if(null == orientRelation){ @@ -633,6 +774,24 @@ public class ProjectServiceImpl extends BaseServiceImpl smsList = new ArrayList<>(); + CustomerStaffDTO staffDTO = new CustomerStaffDTO(); + staffDTO.setUserId(projectStaffDTO.getStaffId()); + Result staffResult = epmetUserFeignClient.getCustomerStaffInfoByUserId(staffDTO); + if (staffResult.success() && null != staffResult.getData()) { + ProjectSendMsgFormDTO sms = new ProjectSendMsgFormDTO(); + sms.setCustomerId(staffResult.getData().getCustomerId()); + sms.setMobile(staffResult.getData().getMobile()); + sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_TRANSFER); + sms.setParameterKey("send_msg"); + smsList.add(sms); + } + result = epmetMessageOpenFeignClient.projectSendMsg(smsList); + if (!result.success()) { + logger.error("项目退回,发送手机短信失败" + JSON.toJSONString(result)); + } } @Override @@ -887,6 +1046,25 @@ public class ProjectServiceImpl extends BaseServiceImpl smsList = new ArrayList<>(); + staffList.forEach(staff -> { + CustomerStaffDTO staffDTO = new CustomerStaffDTO(); + staffDTO.setUserId(staff.getStaffId()); + Result staffDTOResult = epmetUserFeignClient.getCustomerStaffInfoByUserId(staffDTO); + if (staffDTOResult.success() && null != staffDTOResult.getData()) { + ProjectSendMsgFormDTO sms = new ProjectSendMsgFormDTO(); + sms.setCustomerId(staffDTOResult.getData().getCustomerId()); + sms.setMobile(staffDTOResult.getData().getMobile()); + sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_TRANSFER); + sms.setParameterKey("send_msg"); + smsList.add(sms); + } + }); + Result result = epmetMessageOpenFeignClient.projectSendMsg(smsList); + if (!result.success()) { + logger.error("项目吹哨,发送手机短信失败" + JSON.toJSONString(result)); + } return issueProjectResultDTO; } @@ -1275,6 +1453,8 @@ public class ProjectServiceImpl extends BaseServiceImpl msgList = new ArrayList<>(); //10.29 项目滞留提醒添加推送微信消息 sun List wxmpMsgList = new ArrayList<>(); + //短信消息 + List smsList = new ArrayList<>(); list.forEach(dto -> { String title; String msg; @@ -1324,6 +1504,19 @@ public class ProjectServiceImpl extends BaseServiceImpl staffDTOResult = epmetUserFeignClient.getCustomerStaffInfoByUserId(staffDTO); + if (staffDTOResult.success() && null != staffDTOResult.getData()) { + ProjectSendMsgFormDTO sms = new ProjectSendMsgFormDTO(); + sms.setCustomerId(staffDTOResult.getData().getCustomerId()); + sms.setMobile(staffDTOResult.getData().getMobile()); + sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_OVERDUE); + sms.setParameterKey("send_msg"); + smsList.add(sms); + } }); messageFeignClient.saveUserMessageList(msgList); logger.info("项目滞留提醒,开始推送微信订阅消息"); @@ -1331,6 +1524,10 @@ public class ProjectServiceImpl extends BaseServiceImpl publicFile, List internalFile, String customerId, String projectId, String processId) { + if (CollectionUtils.isNotEmpty(internalFile)) { + int i = 0; + List list = new ArrayList<>(); + for (FileDTO item : internalFile) { + ProjectProcessAttachmentEntity entity = new ProjectProcessAttachmentEntity(); + entity.setCustomerId(customerId); + entity.setProjectId(projectId); + entity.setProcessId(processId); + entity.setFilePlace("internal"); + entity.setFileName(item.getName()); + entity.setAttachmentName(""); + entity.setAttachmentSize(item.getSize()); + entity.setAttachmentFormat(item.getFormat()); + entity.setAttachmentType(item.getType()); + entity.setAttachmentUrl(item.getUrl()); + entity.setSort(i); + entity.setDuration(item.getDuration()); + entity.setIsRelease(NumConstant.ZERO); + list.add(entity); + i++; + } + projectProcessAttachmentService.insertBatch(list); + } + + if (CollectionUtils.isNotEmpty(publicFile)) { + //TODO 内容安全检查 + int i = 0; + List list = new ArrayList<>(); + for (FileDTO item : publicFile) { + ProjectProcessAttachmentEntity entity = new ProjectProcessAttachmentEntity(); + entity.setCustomerId(customerId); + entity.setProjectId(projectId); + entity.setProcessId(processId); + entity.setFilePlace("public"); + entity.setFileName(item.getName()); + entity.setAttachmentName(""); + entity.setAttachmentSize(item.getSize()); + entity.setAttachmentFormat(item.getFormat()); + entity.setAttachmentType(item.getType()); + entity.setAttachmentUrl(item.getUrl()); + entity.setSort(i); + entity.setDuration(item.getDuration()); + entity.setIsRelease(NumConstant.ZERO); + list.add(entity); + i++; + } + projectProcessAttachmentService.insertBatch(list); + } + } + + /** + * @param fromDTO + * @Description 项目退回V2.0接口 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void projectReturnV2(ReturnFromDTO fromDTO) { + //公开回复内容审核 + if (com.alibaba.nacos.client.utils.StringUtils.isNotBlank(fromDTO.getPublicReply())) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + taskDTO.setContent(fromDTO.getPublicReply()); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + + ProjectEntity projectEntity = baseDao.selectById(fromDTO.getProjectId()); + if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) { + throw new RenException(EpmetErrorCode.PROJECT_IS_CLOSED.getCode()); + } + + Date current = new Date(); + //更新项目关联表 + ProjectStaffEntity projectStaffEntity = new ProjectStaffEntity(); + projectStaffEntity.setId(fromDTO.getProjectStaffId()); + projectStaffEntity.setIsHandle(ProjectConstant.HANDLE); + projectStaffService.updateById(projectStaffEntity); + + //查找对应的project_staff的信息,为了取出机关的信息,给即将要生成的“退回”节点赋值 + ProjectStaffEntity sourceProjectStaff = projectStaffService.selectById(fromDTO.getProjectStaffId()); + if(null == sourceProjectStaff){ + log.error("com.epmet.service.impl.ProjectServiceImpl.projectReturn,找不到发起退回的项目相关人员的记录,参数:{}",JSON.toJSONString(fromDTO)); + throw new RenException("找不到发起退回的项目相关人员的记录"); + } + + + //结案记录加入项目进展表 + ProjectProcessEntity projectProcessEntity = new ProjectProcessEntity(); + projectProcessEntity.setProjectId(fromDTO.getProjectId()); + projectProcessEntity.setCustomerId(sourceProjectStaff.getCustomerId()); + projectProcessEntity.setDepartmentName(fromDTO.getDepartmentName()); + projectProcessEntity.setOrgIdPath(sourceProjectStaff.getOrgIdPath()); + projectProcessEntity.setGridId(sourceProjectStaff.getGridId()); + projectProcessEntity.setDepartmentId(sourceProjectStaff.getDepartmentId()); + projectProcessEntity.setAgencyId(sourceProjectStaff.getOrgId()); + projectProcessEntity.setOperation(ProjectConstant.OPERATION_RETURN); + projectProcessEntity.setOperationName(ProjectConstant.OPERATION_RETURN_NAME); + projectProcessEntity.setPublicReply(fromDTO.getPublicReply()); + projectProcessEntity.setInternalRemark(fromDTO.getInternalRemark()); + projectProcessEntity.setStaffId(fromDTO.getUserId()); + projectProcessService.insert(projectProcessEntity); + + //项目附件表新增数据 sun 2020.12.22 + if ((null != fromDTO.getPublicFile() && fromDTO.getPublicFile().size() > NumConstant.ZERO) + || (null != fromDTO.getInternalFile() && fromDTO.getInternalFile().size() > NumConstant.ZERO)) { + saveFile(fromDTO.getPublicFile(), fromDTO.getInternalFile(), sourceProjectStaff.getCustomerId(), fromDTO.getProjectId(), projectProcessEntity.getId()); + }//end + + //将人员关系添加到项目关联表 + ProjectStaffDTO projectStaffDTO = projectStaffService.getProjectStaffInfo(fromDTO.getProjectProcessId()); + ProjectStaffEntity projectStaff = ConvertUtils.sourceToTarget(projectStaffDTO, ProjectStaffEntity.class); + projectStaff.setId(null); + //防止将被退回的项目相关人员节点的创建时间赋值给新增的相关人员节点的创建时间,否则数据统计将出现误差 + projectStaff.setCreatedTime(current); + projectStaff.setUpdatedTime(current); + projectStaff.setProcessId(projectProcessEntity.getId()); + projectStaff.setIsHandle(ProjectConstant.UNHANDLED); + projectStaffService.insert(projectStaff); + + //更新退回发起人的节点耗时记录 + ProjectOrgRelationEntity orientRelation = relationDao.selectByProjectStaffId(fromDTO.getProjectStaffId()); + if(null == orientRelation){ + log.error("com.epmet.service.impl.ProjectServiceImpl.projectReturn,找不到发起退回的项目相关人员的节点耗时记录,参数:{}",JSON.toJSONString(fromDTO)); + throw new RenException("找不到发起退回的项目相关人员的节点耗时记录"); + } + ProjectOrgRelationEntity relationDto = new ProjectOrgRelationEntity(); + relationDto.setProjectStaffId(orientRelation.getProjectStaffId()); + relationDto.setHandledDate(current); + Integer costTime = calculateDelta_T(ProjectConstant.IMPRECISE_CALCULATION, + ProjectConstant.CALCULATION_TYPE_DEFAULT, + orientRelation.getProjectStaffId(), + orientRelation.getInformedDate(), + current); + relationDto.setTotalPeriod(costTime); + relationDto.setOperation(ProjectConstant.OPERATION_RETURN); + if(null == orientRelation.getFirstDealtDate()){ + relationDto.setFirstDealtDate(current); + relationDto.setFirstReplyPeriod(costTime); + } + relationDao.maintainTimePropertyConsistency(relationDto); + + //初始化被退回人的节点耗时记录 + ProjectOrgRelationEntity newRelation = new ProjectOrgRelationEntity(); + newRelation.setProjectStaffId(projectStaff.getId()); + newRelation.setSourceOperation(ProjectConstant.OPERATION_RETURN); + newRelation.setInformedDate(current); + relationDao.insert(newRelation); + + //通知 + List msgList = new ArrayList<>(); + UserMessageFormDTO messageFormDTO = new UserMessageFormDTO(); + messageFormDTO.setCustomerId(projectEntity.getCustomerId()); + messageFormDTO.setApp(ProjectConstant.GOV); + messageFormDTO.setGridId("*"); + messageFormDTO.setUserId(projectStaffDTO.getStaffId()); + messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE); + messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, projectEntity.getTitle())); + messageFormDTO.setReadFlag(Constant.UNREAD); + msgList.add(messageFormDTO); + messageFeignClient.saveUserMessageList(msgList); + //2020.10.26 添加项目退回给勾选人推送微信订阅消息 sun + List wxmpMsgList = new ArrayList<>(); + WxSubscribeMessageFormDTO msg = new WxSubscribeMessageFormDTO(); + msg.setCustomerId(projectEntity.getCustomerId()); + msg.setClientType(AppClientConstant.APP_GOV); + msg.setUserId(projectStaffDTO.getStaffId()); + msg.setBehaviorType("项目消息"); + msg.setMessageContent(String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, projectEntity.getTitle())); + msg.setMessageTime(new Date()); + msg.setGridId("*"); + wxmpMsgList.add(msg); + //发送微信订阅消息 sun + logger.info("项目退回,开始推送微信订阅消息"); + Result result = epmetMessageOpenFeignClient.sendWxSubscribeMessage(wxmpMsgList); + if (!result.success()) { + logger.error("项目退回成功,发送微信订阅消息失败" + JSON.toJSONString(result)); + } + + //短信消息 + List smsList = new ArrayList<>(); + CustomerStaffDTO staffDTO = new CustomerStaffDTO(); + staffDTO.setUserId(projectStaffDTO.getStaffId()); + Result staffResult = epmetUserFeignClient.getCustomerStaffInfoByUserId(staffDTO); + if (staffResult.success() && null != staffResult.getData()) { + ProjectSendMsgFormDTO sms = new ProjectSendMsgFormDTO(); + sms.setCustomerId(staffResult.getData().getCustomerId()); + sms.setMobile(staffResult.getData().getMobile()); + sms.setAliyunTemplateCode(SmsTemplateConstant.PROJECT_TRANSFER); + sms.setParameterKey("send_msg"); + smsList.add(sms); + } + result = epmetMessageOpenFeignClient.projectSendMsg(smsList); + if (!result.success()) { + logger.error("项目退回,发送手机短信失败" + JSON.toJSONString(result)); + } + } + + /** + * @param formDTO + * @Description 处理响应V2.0接口 + * @author sun + */ + @Override + public void responseV2(ProjectResponseFormDTO formDTO) { + //公开回复内容审核 + if (com.alibaba.nacos.client.utils.StringUtils.isNotBlank(formDTO.getPublicReply())) { + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + taskDTO.setContent(formDTO.getPublicReply()); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + + //获取项目相关信息 + ProjectEntity projectEntity = baseDao.selectById(formDTO.getProjectId()); + if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) { + throw new RenException(EpmetErrorCode.PROJECT_IS_CLOSED.getCode()); + } + ProjectStaffDTO projectStaff = projectStaffService.getLatestIdByProjectIdAndStaffId(formDTO.getProjectId(),formDTO.getUserId()); + if(null == projectStaff){ + log.error("com.epmet.service.impl.ProjectServiceImpl.response,project_staff表中没有与之对应的数据,传参:{}", JSON.toJSONString(formDTO)); + throw new RenException("未找到项目相关人员记录"); + } + if(StringUtils.isBlank(formDTO.getProjectStaffId())){ + formDTO.setProjectStaffId(projectStaff.getId()); + } + + //处理响应记录加入项目进展表 + ProjectProcessEntity projectProcessEntity = new ProjectProcessEntity(); + projectProcessEntity.setProjectId(formDTO.getProjectId()); + projectProcessEntity.setCustomerId(projectStaff.getCustomerId()); + projectProcessEntity.setDepartmentName(formDTO.getDepartmentName()); + projectProcessEntity.setOrgIdPath(projectStaff.getOrgIdPath()); + projectProcessEntity.setGridId(projectStaff.getGridId()); + projectProcessEntity.setDepartmentId(projectStaff.getDepartmentId()); + projectProcessEntity.setAgencyId(projectStaff.getOrgId()); + projectProcessEntity.setOperation(ProjectConstant.OPERATION_RESPONSES); + projectProcessEntity.setOperationName(ProjectConstant.OPERATION_RESPONSES_NAME); + projectProcessEntity.setPublicReply(formDTO.getPublicReply()); + projectProcessEntity.setInternalRemark(formDTO.getInternalRemark()); + projectProcessEntity.setStaffId(formDTO.getUserId()); + projectProcessService.insert(projectProcessEntity); + + //项目附件表新增数据 sun 2020.12.22 + if ((null != formDTO.getPublicFile() && formDTO.getPublicFile().size() > NumConstant.ZERO) + || (null != formDTO.getInternalFile() && formDTO.getInternalFile().size() > NumConstant.ZERO)) { + saveFile(formDTO.getPublicFile(), formDTO.getInternalFile(), projectStaff.getCustomerId(), formDTO.getProjectId(), projectProcessEntity.getId()); + }//end + + //项目节点历时 + ProjectOrgRelationEntity relationEntity = relationDao.selectByProjectStaffId(formDTO.getProjectStaffId()); + if(null != relationEntity){ + ProjectOrgRelationEntity relationDto = new ProjectOrgRelationEntity(); + relationDto.setProjectStaffId(relationEntity.getProjectStaffId()); + if(null == relationEntity.getFirstDealtDate()){ + Date current = new Date(); + relationDto.setFirstDealtDate(current); + relationDto.setFirstReplyPeriod(calculateDelta_T(ProjectConstant.IMPRECISE_CALCULATION, + ProjectConstant.CALCULATION_TYPE_DEFAULT,projectStaff.getId(), + relationEntity.getInformedDate(),current)); + relationDto.setOperation(ProjectConstant.OPERATION_RESPONSES); + relationDao.maintainTimePropertyConsistency(relationDto); + } + }else{ + log.error("com.epmet.service.impl.ProjectServiceImpl#response,没有找到相关的节点耗时记录,参数:{}",JSON.toJSONString(formDTO)); + throw new RenException("没有找到相关的节点耗时记录"); + } + + } + + /** + * @param projectId + * @author yinzuomei + * @description 查询项目信息(龙湾临时调用) + * @Date 2021/2/24 17:07 + **/ + @Override + public ProjectInfoDTO queryProjectInfoByProjectId(String projectId) { + ProjectInfoDTO projectInfoDTO=baseDao.queryProjectInfoByProjectId(projectId); + if (null != projectInfoDTO && StringUtils.isNotBlank(projectInfoDTO.getIssueId())) { + IssueDetailFormDTO formDTO=new IssueDetailFormDTO(); + formDTO.setIssueId(projectInfoDTO.getIssueId()); + Result issueDTOResult=govIssueOpenFeignClient.queryIssueDetail(formDTO); + if(issueDTOResult.success()&&null!=issueDTOResult.getData()){ + projectInfoDTO.setGridId(issueDTOResult.getData().getGridId()); + projectInfoDTO.setGridName(issueDTOResult.getData().getGridName()); + }else{ + log.warn("查询议题详情失败issueId="+formDTO.getIssueId()); + } + } + return projectInfoDTO; + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java index d8ddde09ba..f2801b0c25 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java @@ -4,6 +4,8 @@ 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.constant.ProjectConstant; +import com.epmet.dao.ProjectProcessAttachmentDao; +import com.epmet.dao.ProjectProcessDao; import com.epmet.dto.ProjectStaffDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -13,10 +15,15 @@ import com.epmet.service.ProjectProcessService; import com.epmet.service.ProjectService; import com.epmet.service.ProjectStaffService; import com.epmet.service.ProjectTraceService; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * @author zhaoqifeng @@ -24,6 +31,7 @@ import java.util.List; * @date 2020/5/11 16:35 */ @Service +@Slf4j public class ProjectTraceServiceImpl implements ProjectTraceService { @Autowired private ProjectService projectService; @@ -33,6 +41,10 @@ public class ProjectTraceServiceImpl implements ProjectTraceService { private ProjectStaffService projectStaffService; @Autowired private GovOrgFeignClient govOrgFeignClient; + @Autowired + private ProjectProcessDao projectProcessDao; + @Autowired + private ProjectProcessAttachmentDao attachmentDao; @Override public List getPendProjectList(TokenDto tokenDto, ProjectListFromDTO fromDTO) { @@ -64,6 +76,21 @@ public class ProjectTraceServiceImpl implements ProjectTraceService { projectService.closed(fromDTO); } + /** + * 项目结案 + * + * @param tokenDto token + * @param fromDTO 入参 + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/5/11 16:27 + */ + @Override + public void closedV2(TokenDto tokenDto, ProjectClosedFromDTO fromDTO) { + fromDTO.setUserId(tokenDto.getUserId()); + projectService.closedV2(fromDTO); + } + @Override public List getReturnableList(ReturnListFromDTO fromDTO) { return projectProcessService.getReturnableList(fromDTO); @@ -101,4 +128,58 @@ public class ProjectTraceServiceImpl implements ProjectTraceService { formDTO.setUserId(tokenDto.getUserId()); projectService.response(formDTO); } + + /** + * @Description 项目处理进展列表V2 + * @Param formDTO + * @author zxc + * @date 2020/12/21 下午3:55 + */ + @Override + public List processListV2(ProcessListV2FormDTO formDTO) { + // 查询项目进展列表 + List processList = projectProcessDao.selectProcessList(formDTO.getProjectId()); + if (CollectionUtils.isEmpty(processList)){ + log.warn(ProjectConstant.NOT_EXIST_PROJECT); + return new ArrayList<>(); + } + // 查询进展附件列表 + List files = attachmentDao.selectAttachByProjectId(formDTO.getProjectId()); + if (!CollectionUtils.isEmpty(files)){ + // 内部附件和公开附件分组 + Map> groupByPlace = files.stream().collect(Collectors.groupingBy(PublicAndInternalFileResultDTO::getFilePlace)); + List publicFiles = groupByPlace.get(ProjectConstant.PUBLIC); + if (!CollectionUtils.isEmpty(publicFiles)){ + processList.forEach(p -> publicFiles.stream().filter(f -> p.getProcessId().equals(f.getProcessId())).forEach(f -> p.getPublicFile().add(f))); + } + List internalFiles = groupByPlace.get(ProjectConstant.INTERNAL); + if (!CollectionUtils.isEmpty(internalFiles)){ + processList.forEach(p -> internalFiles.stream().filter(f -> p.getProcessId().equals(f.getProcessId())).forEach(f -> p.getInternalFile().add(f))); + } + } + return processList; + } + + /** + * @param tokenDto fromDTO + * @Description 项目退回V2.0接口 + * @author sun + */ + @Override + public void projectReturnV2(TokenDto tokenDto, ReturnFromDTO fromDTO) { + fromDTO.setUserId(tokenDto.getUserId()); + projectService.projectReturnV2(fromDTO); + } + + /** + * @param formDTO + * @Description 处理响应V2.0接口 + * @author sun + */ + @Override + public void responseV2(TokenDto tokenDto, ProjectResponseFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + projectService.responseV2(formDTO); + } + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml index 58ec92257b..2db2f15416 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /gov/project @@ -119,4 +120,11 @@ pagehelper: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ + + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.6__create_project_attachment.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.6__create_project_attachment.sql new file mode 100644 index 0000000000..24037d1a4c --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.6__create_project_attachment.sql @@ -0,0 +1,44 @@ + +CREATE TABLE `project_process_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `PROJECT_ID` varchar(64) NOT NULL COMMENT '项目ID', + `PROCESS_ID` varchar(64) NOT NULL COMMENT '项目进展表ID', + `FILE_PLACE` varchar(64) NOT NULL COMMENT '文件所属位置(内部备注: internal 公开答复:public)', + `FILE_NAME` varchar(255) DEFAULT NULL COMMENT '文件名', + `ATTACHMENT_NAME` varchar(255) DEFAULT NULL COMMENT '附件名(uuid随机生成)', + `ATTACHMENT_SIZE` int(11) DEFAULT NULL COMMENT '文件大小,单位b', + `ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、JPEG、BMP、GIF、PDF、PPT、PPTX、DOC、DOCX、XLS、XLSX、MP3、WMA、M4A、MP4、AVI、MOV、RMVB、RM、WMV)', + `ATTACHMENT_TYPE` varchar(64) DEFAULT NULL COMMENT '文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT 'url地址', + `SORT` int(11) NOT NULL COMMENT '排序(需求确定,按上传顺序排序)', + `DURATION` int(11) unsigned DEFAULT '0' COMMENT '语音或视频时长,秒', + `IS_RELEASE` int(1) NOT NULL DEFAULT '0' COMMENT '是否强制发布(0:否 1:是)', + `STATUS` varchar(32) DEFAULT NULL COMMENT '附件审核状态(审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)\r\n现在图片是同步审核的,所以图片只有auto_passed一种状态', + `REASON` varchar(128) DEFAULT NULL COMMENT '附件审核结果描述', + `DEL_FLAG` char(1) 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 '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目节点附件表'; + + +CREATE TABLE `project_process_scan_task` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `PROJECT_ID` varchar(64) NOT NULL COMMENT '项目ID', + `PROCESS_ID` varchar(64) NOT NULL COMMENT '项目进展表(project_process)ID', + `PROJECT_PROCESS_ATTACHMENT_ID` varchar(64) NOT NULL COMMENT '项目附件表主键,对应dataId', + `TASK_ID` varchar(64) NOT NULL COMMENT '阿里云审核任务Id', + `STATUS` varchar(32) NOT NULL COMMENT '审核状态【auditing: 审核中;\r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;】', + `ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型(视频 - video、 语音 - voice 文件 - doc)', + `DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目节点附件安全校验任务表'; diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index a3747fe72e..c47def3cc0 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -246,4 +246,26 @@ order by p.CREATED_TIME desc + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessAttachmentDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessAttachmentDao.xml new file mode 100644 index 0000000000..34fab9cff6 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessAttachmentDao.xml @@ -0,0 +1,23 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessDao.xml index ceb579138d..27bb86c807 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessDao.xml @@ -84,4 +84,20 @@ ) ORDER BY process.PROJECT_ID , process.STAFF_ID , process.CREATED_TIME ASC + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessScanTaskDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessScanTaskDao.xml new file mode 100644 index 0000000000..233b77baee --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessScanTaskDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/Dockerfile b/epmet-module/gov-voice/gov-voice-server/Dockerfile index 3f3ecf336d..503cab5fd2 100644 --- a/epmet-module/gov-voice/gov-voice-server/Dockerfile +++ b/epmet-module/gov-voice/gov-voice-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./gov-voice.jar EXPOSE 8105 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-prod.yml b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-prod.yml index edf7b68936..3dff43db41 100644 --- a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-voice-server: container_name: gov-voice-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-voice-server:0.3.68 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-voice-server:0.3.69 ports: - "8105:8105" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-voice/gov-voice-server/pom.xml b/epmet-module/gov-voice/gov-voice-server/pom.xml index f6b5b7d0a3..92ace2d57f 100644 --- a/epmet-module/gov-voice/gov-voice-server/pom.xml +++ b/epmet-module/gov-voice/gov-voice-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.3.68 + 0.3.69 gov-voice com.epmet diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml index 6bf735a325..c570e30147 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /gov/voice @@ -119,4 +120,10 @@ pagehelper: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/oper-access/oper-access-server/Dockerfile b/epmet-module/oper-access/oper-access-server/Dockerfile index eb72900e52..c4f36b4688 100644 --- a/epmet-module/oper-access/oper-access-server/Dockerfile +++ b/epmet-module/oper-access/oper-access-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./oper-access.jar EXPOSE 8093 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml index 34a3d56ae9..15ccaab5b1 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /oper/access @@ -122,4 +123,10 @@ pagehelper: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerParameterDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerParameterDTO.java new file mode 100644 index 0000000000..187553f93a --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerParameterDTO.java @@ -0,0 +1,82 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2021/1/4 上午10:59 + */ +@Data +public class CustomerParameterDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 参数KEY值 + */ + private String parameterKey; + + /** + * 参数名称 + */ + private String parameterName; + + /** + * 参数VALUE值 + */ + private String parameterValue; + + /** + * 参数开关:开启:on,关闭:off + */ + private String parameterSwitch; + + /** + * 说明 + */ + private String description; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} 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/form/CrmParameterFormDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CrmParameterFormDTO.java new file mode 100644 index 0000000000..ab31d56ae7 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/CrmParameterFormDTO.java @@ -0,0 +1,28 @@ +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/4 上午10:44 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class CrmParameterFormDTO implements Serializable { + + private static final long serialVersionUID = -1892384189805073724L; + + public interface CrmParameterForm{} + + @NotBlank(message = "客户ID不能为空",groups = {CrmParameterForm.class}) + private String customerId; + + @NotBlank(message = "参数KEY值不能为空",groups = {CrmParameterForm.class}) + private String parameterKey; +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CrmParameterResultDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CrmParameterResultDTO.java new file mode 100644 index 0000000000..23cca7c0d9 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CrmParameterResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dto.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/1/4 上午10:46 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class CrmParameterResultDTO implements Serializable { + + private static final long serialVersionUID = 8082721392714934568L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 参数KEY值 + */ + private String parameterKey; + + /** + * 参数VALUE值 + */ + private String parameterValue; + + /** + * 余额状态【parameterValue】true:充足,false:不足 + */ + private Boolean balanceStatus = true; + + /** + * 新的参数VALUE值 + */ + private String subtractParameterValue; + + /** + * 参数开关状态 true:开启,false:关闭 + */ + private Boolean switchStatus; +} 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 27d5c239d4..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,12 +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.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; @@ -22,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 = "118.190.150.119:48080/api") +// @FeignClient(name = ServiceConstant.OPER_CRM_SERVER, fallback = OperCrmOpenFeignClientFallback.class, url = "localhost:8090") public interface OperCrmOpenFeignClient { /** * 获取客户信息 @@ -74,4 +77,49 @@ public interface OperCrmOpenFeignClient { */ @PostMapping("/oper/crm/customer/getgridcount") Result getGridCount(@RequestBody GridCountFormDTO formDTO); + + /** + * @Description 查询客户配置信息 + * @Param formDTO + * @author zxc + * @date 2021/1/4 上午11:20 + */ + @PostMapping("/oper/crm/parameter/parameterinfo") + Result> selectParamInfo(@RequestBody List formDTOs); + + /** + * @Description 更新客户配置信息 + * @Param formDTOS + * @author zxc + * @date 2021/1/4 下午4:23 + */ + @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 f4ad95f4ca..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,10 +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.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; @@ -57,4 +58,41 @@ public class OperCrmOpenFeignClientFallback implements OperCrmOpenFeignClient { public Result getGridCount(GridCountFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getGridCount", formDTO); } + + @Override + public Result> selectParamInfo(List formDTOs) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "selectParamInfo", formDTOs); + } + + @Override + 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/Dockerfile b/epmet-module/oper-crm/oper-crm-server/Dockerfile index 98146177a2..ad4c30e13b 100644 --- a/epmet-module/oper-crm/oper-crm-server/Dockerfile +++ b/epmet-module/oper-crm/oper-crm-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./oper-crm.jar EXPOSE 8090 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml index 4f9efd0f12..3282657fca 100644 --- a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml +++ b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-crm-server: container_name: oper-crm-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-crm-server:0.3.71 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-crm-server:0.3.72 ports: - "8090:8090" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-crm/oper-crm-server/pom.xml b/epmet-module/oper-crm/oper-crm-server/pom.xml index a721c86f4f..cc8a8b2112 100644 --- a/epmet-module/oper-crm/oper-crm-server/pom.xml +++ b/epmet-module/oper-crm/oper-crm-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.71 + 0.3.72 com.epmet oper-crm @@ -87,6 +87,30 @@ 2.0.0 compile + + + com.epmet + epmet-message-client + 2.0.0 + + + + com.epmet + 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/controller/CustomerParameterController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerParameterController.java new file mode 100644 index 0000000000..006080bd6b --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerParameterController.java @@ -0,0 +1,53 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.CrmParameterFormDTO; +import com.epmet.dto.result.CrmParameterResultDTO; +import com.epmet.service.CustomerParameterService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/1/4 上午10:51 + */ +@RestController +@RequestMapping("parameter") +public class CustomerParameterController { + + @Autowired + private CustomerParameterService parameterService; + + /** + * @Description 查询客户配置信息 + * @Param formDTO + * @author zxc + * @date 2021/1/4 上午11:20 + */ + @PostMapping("parameterinfo") + public Result> selectParamInfo(@RequestBody List formDTOs){ + formDTOs.forEach(formDTO -> { + ValidatorUtils.validateEntity(formDTO, CrmParameterFormDTO.CrmParameterForm.class); + }); + return new Result>().ok(parameterService.selectParamInfo(formDTOs)); + } + + /** + * @Description 更新客户配置信息 + * @Param formDTOS + * @author zxc + * @date 2021/1/4 下午4:23 + */ + @PostMapping("parameterupdate") + public Result updateParamInfo(@RequestBody List formDTOS){ + parameterService.updateParamInfo(formDTOS); + return new Result(); + } + +} diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerParameterDao.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerParameterDao.java new file mode 100644 index 0000000000..5d11da7f96 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerParameterDao.java @@ -0,0 +1,34 @@ +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.CrmParameterFormDTO; +import com.epmet.dto.result.CrmParameterResultDTO; +import com.epmet.entity.CustomerParameterEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/1/4 上午11:01 + */ +@Mapper +public interface CustomerParameterDao extends BaseDao { + + /** + * @Description 查询客户的配置信息 + * @Param customerIds + * @author zxc + * @date 2021/1/4 上午11:07 + */ + List selectParamInfo(@Param("formDTOS")List formDTOS); + + /** + * @Description 更新客户配置信息 + * @Param formDTOS + * @author zxc + * @date 2021/1/4 下午4:12 + */ + void updateParamInfo(@Param("formDTOS")List formDTOS); +} 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/CustomerParameterEntity.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerParameterEntity.java new file mode 100644 index 0000000000..9ed4ae997a --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerParameterEntity.java @@ -0,0 +1,49 @@ +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * @Author zxc + * @DateTime 2021/1/4 上午11:03 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_parameter") +public class CustomerParameterEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 参数KEY值 + */ + private String parameterKey; + + /** + * 参数名称 + */ + private String parameterName; + + /** + * 参数VALUE值 + */ + private String parameterValue; + + /** + * 参数开关:开启:on,关闭:off + */ + private String parameterSwitch; + + /** + * 说明 + */ + private String description; + +} 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/CustomerParameterService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerParameterService.java new file mode 100644 index 0000000000..4ab868a9c1 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerParameterService.java @@ -0,0 +1,30 @@ +package com.epmet.service; + +import com.epmet.dto.form.CrmParameterFormDTO; +import com.epmet.dto.result.CrmParameterResultDTO; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/1/4 上午10:52 + */ +public interface CustomerParameterService { + + /** + * @Description 查询客户配置信息 + * @Param formDTO + * @author zxc + * @date 2021/1/4 上午11:20 + */ + List selectParamInfo(List formDTOs); + + /** + * @Description 更新客户配置信息 + * @Param formDTOS + * @author zxc + * @date 2021/1/4 下午4:10 + */ + void updateParamInfo(List formDTOS); + +} 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/CustomerParameterServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerParameterServiceImpl.java new file mode 100644 index 0000000000..001fab6aff --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerParameterServiceImpl.java @@ -0,0 +1,57 @@ +package com.epmet.service.impl; + +import com.epmet.dao.CustomerParameterDao; +import com.epmet.dto.form.CrmParameterFormDTO; +import com.epmet.dto.result.CrmParameterResultDTO; +import com.epmet.service.CustomerParameterService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/1/4 上午10:53 + */ +@Service +@Slf4j +public class CustomerParameterServiceImpl implements CustomerParameterService { + + @Autowired + private CustomerParameterDao parameterDao; + + /** + * @Description 查询客户配置信息 + * @Param formDTO + * @author zxc + * @date 2021/1/4 上午11:20 + */ + @Override + public List selectParamInfo(List formDTOs) { + if (CollectionUtils.isEmpty(formDTOs)){ + return new ArrayList<>(); + } + List result = parameterDao.selectParamInfo(formDTOs); + if (CollectionUtils.isEmpty(result)){ + return new ArrayList<>(); + } + return result; + } + + /** + * @Description 更新客户配置信息 + * @Param formDTOS + * @author zxc + * @date 2021/1/4 下午4:11 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void updateParamInfo(List formDTOS) { + if (CollectionUtils.isEmpty(formDTOS))return; + parameterDao.updateParamInfo(formDTOS); + } +} 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 9857f910c5..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 @@ -22,6 +22,7 @@ import com.alibaba.fastjson.JSONObject; 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.rocketmq.messages.InitCustomerMQMsg; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; @@ -32,14 +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; @@ -80,6 +85,14 @@ public class CustomerServiceImpl extends BaseServiceImpl page(Map params) { @@ -468,48 +481,62 @@ 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 + + } + + private InitCustomerMQMsg.InitCustomerStaff constructStaffInfo4CustomerInit(String agencyId, PaUserDTO paUser) { + InitCustomerMQMsg.InitCustomerStaff staff = new InitCustomerMQMsg.InitCustomerStaff(); + staff.setAgencyId(agencyId); + staff.setGender(Integer.parseInt(paUser.getGender())); + staff.setMobile(paUser.getPhone()); + staff.setName(paUser.getRealName()); + staff.setWorkType(UserWorkType.FULL_TIME); + return staff; + } + private InitCustomerMQMsg.InitCustomerAgency constructAgencyInfo4CustomerInit(PaCustomerAgencyDTO paAgency) { + InitCustomerMQMsg.InitCustomerAgency initCustomerAgency = new InitCustomerMQMsg.InitCustomerAgency(); + initCustomerAgency.setAgencyId(paAgency.getId()); + initCustomerAgency.setOrganizationName(paAgency.getAgencyName()); + initCustomerAgency.setLevel(paAgency.getLevel()); + initCustomerAgency.setAreaCode(paAgency.getAreaCode()); + initCustomerAgency.setProvince(paAgency.getProvince()); + initCustomerAgency.setCity(paAgency.getCity()); + initCustomerAgency.setDistrict(paAgency.getDistrict()); + return initCustomerAgency; } @Override @@ -698,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/bootstrap.yml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml index 7b14f2cad1..f8760dbee8 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /oper/crm @@ -128,4 +129,10 @@ pagehelper: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.3__customer_parameter.sql b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.3__customer_parameter.sql new file mode 100644 index 0000000000..1eda6e2cdf --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.3__customer_parameter.sql @@ -0,0 +1,52 @@ +CREATE TABLE `customer_parameter` +( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(32) NOT NULL COMMENT '客户ID', + `PARAMETER_KEY` varchar(32) NOT NULL COMMENT '参数KEY值(发短信:send_msg;)', + `PARAMETER_NAME` varchar(32) DEFAULT NULL COMMENT '参数名称(短信)', + `PARAMETER_VALUE` varchar(32) DEFAULT NULL COMMENT '参数VALUE值', + `DESCRIPTION` varchar(32) DEFAULT NULL COMMENT '说明', + `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 '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + ROW_FORMAT = COMPACT COMMENT ='客户配置表'; + + +#=================== 数据初始化 ============================ +INSERT INTO customer_parameter ( + ID, + CUSTOMER_ID, + PARAMETER_KEY, + PARAMETER_NAME, + PARAMETER_VALUE, + DESCRIPTION, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME +) +SELECT + MD5(uuid() + FLOOR(RAND() * 999999)), + id, + 'send_msg', + '短信', + '5000', + '客户短信可发送次数配置', + '0', + '0', + 'app_user', + NOW(), + 'app_user', + NOW() +FROM + customer +WHERE + DEL_FLAG = '0' \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.4__new_customer_parameter.sql b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.4__new_customer_parameter.sql new file mode 100644 index 0000000000..96754ce4d2 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.4__new_customer_parameter.sql @@ -0,0 +1,49 @@ +DROP TABLE IF EXISTS `customer_parameter`; +CREATE TABLE `customer_parameter` +( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(32) NOT NULL COMMENT '客户ID', + `PARAMETER_KEY` varchar(32) NOT NULL COMMENT '参数KEY值(发短信:send_msg;)', + `PARAMETER_NAME` varchar(32) DEFAULT NULL COMMENT '参数名称(短信)', + `PARAMETER_SWITCH` varchar(255) DEFAULT NULL COMMENT '参数开关:开启:on,关闭:off', + `PARAMETER_VALUE` varchar(32) DEFAULT NULL COMMENT '参数VALUE值', + `DESCRIPTION` varchar(32) DEFAULT NULL COMMENT '说明', + `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 '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 + ROW_FORMAT = COMPACT COMMENT ='客户配置表'; + + +#=================== 数据初始化 ============================ +INSERT INTO customer_parameter (ID, + CUSTOMER_ID, + PARAMETER_KEY, + PARAMETER_NAME, + PARAMETER_VALUE, + DESCRIPTION, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME) +SELECT MD5(uuid() + FLOOR(RAND() * 999999)), + id, + 'send_msg', + '短信', + '5000', + '客户短信可发送次数配置', + '0', + '0', + 'app_user', + NOW(), + 'app_user', + NOW() +FROM customer +WHERE DEL_FLAG = '0' \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.5__insert_customer_parameter.sql b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.5__insert_customer_parameter.sql new file mode 100644 index 0000000000..6aa4f84bba --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.5__insert_customer_parameter.sql @@ -0,0 +1,32 @@ +DELETE FROM customer_parameter; + + +#=================== 数据初始化 ============================ +INSERT INTO customer_parameter (ID, + CUSTOMER_ID, + PARAMETER_KEY, + PARAMETER_NAME, + PARAMETER_SWITCH, + PARAMETER_VALUE, + DESCRIPTION, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME) +SELECT MD5(uuid() + FLOOR(RAND() * 999999)), + id, + 'send_msg', + '短信', + 'off', + '5000', + '客户短信可发送次数配置', + '0', + '0', + 'app_user', + NOW(), + 'app_user', + NOW() +FROM customer +WHERE DEL_FLAG = '0' \ No newline at end of file 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/CustomerParameterDao.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerParameterDao.xml new file mode 100644 index 0000000000..2a5c38a13d --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerParameterDao.xml @@ -0,0 +1,33 @@ + + + + + + + + UPDATE customer_parameter + SET PARAMETER_VALUE = #{f.subtractParameterValue} + + DEL_FLAG = 0 + AND CUSTOMER_ID = #{f.customerId} + AND PARAMETER_KEY = #{f.parameterKey} + + + + + + + \ No newline at end of file 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/oper-customize/oper-customize-server/Dockerfile b/epmet-module/oper-customize/oper-customize-server/Dockerfile index d9b10d355b..ff1a306110 100644 --- a/epmet-module/oper-customize/oper-customize-server/Dockerfile +++ b/epmet-module/oper-customize/oper-customize-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./oper-customize.jar EXPOSE 8089 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index a36f6d46d1..5bd66523f2 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -70,6 +70,13 @@ 2.0.0 compile + + + + com.epmet + epmet-commons-rocketmq + 2.0.0 + @@ -129,6 +136,10 @@ SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + 192.168.1.130:9876;192.168.1.132:9876 + epmet_message @@ -167,6 +178,10 @@ SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + 192.168.1.130:9876;192.168.1.132:9876 + epmet_message @@ -205,6 +220,10 @@ SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + 192.168.10.161:9876 + epmet_message @@ -241,6 +260,10 @@ SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + + + 192.168.11.187:9876;192.168.11.184:9876 + epmet_message diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeDao.java index 42bc2824b4..c804d757ed 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.form.HomeDesignFormDTO; import com.epmet.entity.CustomerHomeEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -43,4 +44,6 @@ public interface CustomerHomeDao extends BaseDao { * @date 2020/3/16 14:02 **/ List selectCustomerHomeList(HomeDesignFormDTO formDTO); + + int countByCustomerId(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/mq/listener/InitCustomerCustomizeListener.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/mq/listener/InitCustomerCustomizeListener.java new file mode 100644 index 0000000000..6fa846c46c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/mq/listener/InitCustomerCustomizeListener.java @@ -0,0 +1,67 @@ +package com.epmet.mq.listener; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants; +import com.epmet.commons.rocketmq.constants.TopicConstants; +import com.epmet.commons.rocketmq.messages.InitCustomerMQMsg; +import com.epmet.commons.tools.distributedlock.DistributedLock; +import com.epmet.commons.tools.exception.ExceptionUtils; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dto.CustomerHomeDTO; +import com.epmet.service.CustomerHomeService; +import org.apache.rocketmq.common.message.MessageExt; +import org.apache.rocketmq.spring.annotation.MessageModel; +import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; +import org.apache.rocketmq.spring.core.RocketMQListener; +import org.redisson.api.RLock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.concurrent.TimeUnit; + +/** + * 监听初始化客户动作,为客户初始化角色列表 + */ +@RocketMQMessageListener(topic = TopicConstants.INIT_CUSTOMER, + consumerGroup = ConsomerGroupConstants.INIT_CUSTOMER_COMPONENTS_GROUP, + messageModel = MessageModel.CLUSTERING, + selectorExpression = "*") +@Component +public class InitCustomerCustomizeListener implements RocketMQListener { + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private CustomerHomeService customerHomeService; + + @Autowired + private DistributedLock distributedLock; + + @Override + public void onMessage(MessageExt messageExt) { + String msg = new String(messageExt.getBody()); + logger.info("初始化客户-初始化客户自定义信息-收到消息内容:{}", msg); + InitCustomerMQMsg msgObj = JSON.parseObject(msg, InitCustomerMQMsg.class); + + CustomerHomeDTO customerHomeDTO = new CustomerHomeDTO(); + customerHomeDTO.setCustomerId(msgObj.getCustomerId()); + + RLock lock = null; + try { + lock = distributedLock.getLock(String.format("lock:init_customer_home:%s", msgObj.getCustomerId()), + 30l, 30l, TimeUnit.SECONDS); + customerHomeService.init(customerHomeDTO); + } catch (RenException e) { + // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 + logger.error("【RocketMQ】初始化客户组件失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + } catch (Exception e) { + // 不是我们自己抛出的异常,可以让MQ重试 + logger.error("【RocketMQ】初始化客户组件失败:".concat(ExceptionUtils.getErrorStackTrace(e))); + throw e; + } finally { + distributedLock.unLock(lock); + } + } +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerHomeServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerHomeServiceImpl.java index 8ba5ba26bd..7b326bfbb3 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerHomeServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerHomeServiceImpl.java @@ -20,6 +20,8 @@ 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.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; @@ -119,6 +121,11 @@ public class CustomerHomeServiceImpl extends BaseServiceImpl 0) { + throw new RenException("用户Home组件已存在,请勿重复初始化"); + } + //居民端模板 List resiTempList = customerHomeTemplateService.getTemplateByClient(OperCustomizeConstant.RESIDENT); //居民端草稿 diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml index b6cb0ffbb8..360e2ad6e2 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /oper/customize @@ -122,4 +123,13 @@ pagehelper: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ + +rocketmq: + name-server: @rocketmq.nameserver@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeDao.xml index 3bc7dfdb23..76b5f185ef 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeDao.xml @@ -29,5 +29,11 @@ AND DEL_FLAG = '0' + + \ No newline at end of file diff --git a/epmet-module/pom.xml b/epmet-module/pom.xml index 2f4b8d2ff8..56b1452eec 100644 --- a/epmet-module/pom.xml +++ b/epmet-module/pom.xml @@ -43,6 +43,7 @@ epmet-heart epmet-point epmet-ext + data-aggregator diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java index 8a96cc23b4..5aa7c8d3a30 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicConstant.java @@ -78,4 +78,43 @@ public interface TopicConstant { String CREATE_TOPIC = "创建话题失败,话题内容为:%s"; String SHIFT_ISSUE = "转议题失败,标题为:%s , 建议为:%s"; + + /** + * 附件文件类型 + * 图片 - image、文档 - doc、语音 - voice、视频 - video + */ + String FILE_IMAGE = "image"; + String FILE_DOC = "doc"; + String FILE_VOICE = "voice"; + String FILE_VIDEO = "video"; + + String AUDITING = "auditing"; + String AUTO_PASSED = "auto_passed"; + String REVIEW = "review"; + String BLOCK = "block"; + String REJECTED = "rejected"; + String APPROVED = "approved"; + String SUBMIT = "submit"; + String IMAGE = "image"; + String VIDEO = "video"; + String VOICE = "voice"; + String DOC = "doc"; + + String GROUP_INFO_FAILURE = "根据groupId未查询到组信息......"; + + String CREATE_TOPIC_FAILURE = "发布话题加分失败......"; + + String COMMENT_TOPIC_FAILURE = "评论话题加分失败......"; + + String GET_CUSTOMER_ID_FAILURE = "查询客户ID失败......"; + + /** + * 字段 附件类型 小写 驼峰 + */ + String FIELD_TOPIC_ATTACHMENT_TYPE_HUMP = "attachmentType"; + + /** + * 字段 附件类型 大写 下划线 + */ + String FIELD_TOPIC_ATTACHMENT_TYPE = "ATTACHMENT_TYPE"; } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicShareConstant.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicShareConstant.java new file mode 100644 index 0000000000..affeac1fe2 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/constant/TopicShareConstant.java @@ -0,0 +1,15 @@ +package com.epmet.resi.group.constant; + +/** + * @Author zxc + * @DateTime 2020/12/18 上午10:53 + */ +public interface TopicShareConstant { + + String NOT_EXIST_TOPIC_INFO = "未查到该话题信息......"; + + String NOT_EXIST_TOPIC_BELONG_GROUP = "未查询到话题所属小组......"; + + String NOT_EXIST_INVITE_RECORD = "未查询到该邀请记录......"; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java index 169073eb68..1e4b79644c 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/group/form/CommonGridAndPageFormDTO.java @@ -37,4 +37,6 @@ public class CommonGridAndPageFormDTO implements Serializable { @Min(1) private Integer pageSize; + private String customerId; + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/GroupMemeberOperationDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/GroupMemeberOperationDTO.java index 751153861a..78f7c8fe77 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/GroupMemeberOperationDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/GroupMemeberOperationDTO.java @@ -62,7 +62,7 @@ public class GroupMemeberOperationDTO implements Serializable { private String operateStatus; /** - * 入群方式:(受邀请入群 - invited 、 主动加入 - join、created群主创建群自动进入群、扫码入群 - scancode) + * 入群方式:(受邀请入群 - invited 、 主动加入 - join、created群主创建群自动进入群、扫码入群 - scancode、话题分享链接 - topic_share_link、议题分享链接 - issue_share_link) */ private String enterGroupType; diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberDTO.java index c6cd651968..f1832f7958 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/ResiGroupMemberDTO.java @@ -54,7 +54,7 @@ public class ResiGroupMemberDTO implements Serializable { private String groupLeaderFlag; /** - * 入群方式:(受邀请入群 - invited 、 主动加入 - join、created群主创建群自动进入群、扫码入群 - scancode) + * 入群方式:(受邀请入群 - invited 、 主动加入 - join、created群主创建群自动进入群、扫码入群 - scancode、话题分享链接 - topic_share_link、议题分享链接 - issue_share_link) */ private String enterGroupType; diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/JoinGroupByShareLinkFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/JoinGroupByShareLinkFormDTO.java new file mode 100644 index 0000000000..86740bcb0e --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/form/JoinGroupByShareLinkFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.resi.group.dto.member.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 通过链接入组申请传参DTO + * @ClassName JoinGroupByShareLinkFormDTO + * @Auth wangc + * @Date 2020-12-22 10:34 + */ +@Data +public class JoinGroupByShareLinkFormDTO implements Serializable { + private static final long serialVersionUID = -4402483318595770636L; + + /** + * 分享链接Id + */ + @NotBlank(message = "分享链接Id不能为空") + private String shareLinkId; + + /** + * topic | issue + */ + @NotBlank(message = "链接类型不能为空") + private String shareLinkType; + + @NotBlank(message = "用户Id不能为空") + private String userId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/ApplyingMemberResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/ApplyingMemberResultDTO.java index 915523354b..352499d9a4 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/ApplyingMemberResultDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/ApplyingMemberResultDTO.java @@ -48,7 +48,7 @@ public class ApplyingMemberResultDTO implements Serializable { private String status; /** - * invited:通过链接加入 ; join:申请加入;scancode通过扫码加入 + * invited:通过链接加入 ; join:申请加入;scancode通过扫码加入;话题分享链接 - topic_share_link、议题分享链接 - issue_share_link */ private String enterGroupType; diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/JoinGroupApplyRealTimeResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/JoinGroupApplyRealTimeResultDTO.java new file mode 100644 index 0000000000..986372b1c0 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/member/result/JoinGroupApplyRealTimeResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.resi.group.dto.member.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 申请入群实时结果 + * @ClassName JoinGroupApplyRealTimeResultDTO + * @Auth wangc + * @Date 2020-12-22 10:32 + */ +@Data +public class JoinGroupApplyRealTimeResultDTO implements Serializable { + private static final long serialVersionUID = 6251288539242747659L; + + /** + * entered(已入组) auditing(审核中) + */ + private String status; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/scanapicallback/VoiceScanCallBackContentFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/scanapicallback/VoiceScanCallBackContentFormDTO.java new file mode 100644 index 0000000000..1907cbb8cf --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/scanapicallback/VoiceScanCallBackContentFormDTO.java @@ -0,0 +1,97 @@ +package com.epmet.resi.group.dto.scanapicallback; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 语音检测callBack入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/10 10:47 + */ +@Data +public class VoiceScanCallBackContentFormDTO implements Serializable { + + /** + * 错误码,和HTTP状态码一致。 + * 200:表示检测成功。 + * 280:表示处理中,需要继续轮询。 + * 其他:表示任务失败。 + * 更多信息,请参见公共错误码。 + * + * 说明 只有返回280表示任务还在进行,需要继续轮询该任务的检测结果。返回其他值均表示该语音检测任务已结束。如果实际上该语音检测没有结束,而是因为网络异常等原因异常结束,您可以重新提交语音异步检测任务。 + */ + private Integer code; + + /** + * 请求参数的响应信息。 + */ + private String msg; + + /** + * 检测对象对应的数据ID。 + * 说明 如果在检测请求参数中传入了dataId,则此处返回对应的dataId。 + */ + private String dataId; + + /** + * 该检测任务的ID。 + */ + private String taskId; + + /** + * 检测对象的URL。 + */ + private String url; + + /** + * 检测成功(code=200)时,返回的检测结果。该结果包含一个或多个元素,每个元素是个结构体,对应一个场景。关于每个元素的结构描述,请参见result。 + */ + private List results; + + + @Data + private static class ResultDTO{ + /** + * 检测结果的分类。取值: + * normal:正常文本 + * spam:含垃圾信息 + * ad:广告 + * politics:涉政 + * terrorism:暴恐 + * abuse:辱骂 + * porn:色情 + * flood:灌水 + * contraband:违禁 + * meaningless:无意义 + * customized:自定义(例如命中自定义关键词) + */ + private String label; + + /** + * 检测场景,和调用请求中的场景对应。唯一取值:antispam。 + */ + private String scene; + + /** + * 建议您执行的后续操作。取值: + * pass:结果正常,无需进行其余操作。 + * review:结果不确定,需要进行人工审核。 + * block:结果违规,建议直接删除或者限制公开。 + */ + private String suggestion; + + /** + * 置信度分数,取值范围:0(表示置信度最低)~100(表示置信度最高)。 + * 如果suggestion为pass,则置信度越高,表示内容正常的可能性越高;如果suggestion为review或block,则置信度越高,表示内容违规的可能性越高。 + * 注意 该值仅作为参考,强烈建议您不要在业务中使用。建议您参考suggestion和label(或者部分接口返回的sublabel)结果用于内容违规判定。 + */ + private Float rate; + //下面还有个details 语音对应的文本详情。每一句文本对应一个元素,包含一个或者多个元素。关于每个元素的结构描述,请参见detail。 + //暂时不解析了。 + } + + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicAttachmentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicAttachmentDTO.java index 2a6afb9d90..60d086d6fc 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicAttachmentDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicAttachmentDTO.java @@ -54,7 +54,7 @@ public class ResiTopicAttachmentDTO implements Serializable { private String attachmentFormat; /** - * 附件类型((图片 - figure、 视频 - video、 语音 - voice、 文档 - doc)) + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) */ private String attachmentType; @@ -63,6 +63,16 @@ public class ResiTopicAttachmentDTO implements Serializable { */ private String attachmentUrl; + /** + * 排序字段,解决多张图片的createdTime相同时的排序问题 + * */ + private Integer sort; + + /** + * 语音或视频时长,秒 + * */ + private Integer duration; + /** * 删除标记 0:未删除,1:已删除 */ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftAttachmentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftAttachmentDTO.java new file mode 100644 index 0000000000..378f03ae8a --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftAttachmentDTO.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.resi.group.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题草稿附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +public class TopicDraftAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 附件id + */ + private String id; + + /** + * 话题草稿id + */ + private String topicDraftId; + + /** + * 客户id + */ + private String customerId; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址url + */ + private String attachmentUrl; + + /** + * 排序字段(按附件类型分组排序) + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; + auto_passed: 自动通过; + review:结果不确定,需要人工审核; + block: 结果违规; + rejected:人工审核驳回; + approved:人工审核通过) + 现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + private String reason; + + /** + * 语音或视频时长,秒 + * */ + private Integer duration; + + /** + * 删除标记 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/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftDTO.java new file mode 100644 index 0000000000..80fcc43105 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftDTO.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.resi.group.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +public class TopicDraftDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 话题草稿id + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组Id + */ + private String groupId; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 话题草稿状态(审核中:auditing; + auto_passed: 自动通过; + review:结果不确定,需要人工审核; + block: 结果违规; + rejected:人工审核驳回; + approved:人工审核通过) + */ + private String draftStatus; + + /** + * 草稿审核理由 + */ + private String draftReason; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String area; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String dimension; + + /** + * 发布成功后的话题id + */ + private String topicId; + + /** + * 创建者是否可见(0是 1否) + */ + private String isSee; + + /** + * 删除标记 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/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftOperationDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftOperationDTO.java new file mode 100644 index 0000000000..b0629f991a --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftOperationDTO.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.resi.group.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题草稿操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +public class TopicDraftOperationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 话题草稿操作日志id + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 话题草稿id + */ + private String topicDraftId; + + /** + * 操作类型:submit:提交发布; + auto_passed: 自动审核-通过; + review:自动审核-结果不确定,需要人工审核; + block: 自动审核-结果违规; + rejected:人工审核驳回; + approved:人工审核通过 + */ + private String operateType; + + /** + * 操作时的备注,比如驳回理由 + */ + private String remark; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 操作人,API审核结果,存储为SCAN_USER或者APP_USER + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftScanTaskDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftScanTaskDTO.java new file mode 100644 index 0000000000..620f56d7ec --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftScanTaskDTO.java @@ -0,0 +1,104 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.resi.group.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题附件检测任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +@Data +public class TopicDraftScanTaskDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 话题草稿Id + */ + private String topicDraftId; + + /** + * 话题草稿附件表Id,对应dataId + */ + private String topicDraftAttachmentId; + + /** + * 阿里云审核任务Id + */ + private String taskId; + + /** + * 审核状态【auditing: 审核中; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规;】 + */ + private String status; + + /** + * 附件类型(视频 - video、 语音 - voice) + */ + private String attachmentType; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 操作人,API审核结果,存储为SCAN_USER或者APP_USER + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicShareLinkRecordDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicShareLinkRecordDTO.java new file mode 100644 index 0000000000..a7a0923715 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicShareLinkRecordDTO.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.resi.group.dto.topic; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 话题分享链接表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +@Data +public class TopicShareLinkRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 邀请ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题所属网格ID + */ + private String gridId; + + /** + * 小组ID + */ + private String groupId; + + /** + * 话题ID + */ + private String topicId; + + /** + * 分享人ID(当前登录用户) + */ + private String shareUserId; + + /** + * 邀请内容 + */ + private String inviteContent; + + /** + * 删除状态 0:正常,1:删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicShareLinkVisitRecordDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicShareLinkVisitRecordDTO.java new file mode 100644 index 0000000000..572160d9ee --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicShareLinkVisitRecordDTO.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.resi.group.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题分享链接访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +@Data +public class TopicShareLinkVisitRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 分享人【邀请人】ID + */ + private String shareUserId; + + /** + * 被邀请人ID + */ + private String inviteeUserId; + + /** + * 话题分享链接表id + */ + private String shareLinkRecId; + + /** + * 是否邀请注册:0:是,1:不是 + */ + private Integer isInviteRegister; + + /** + * 删除状态,0:正常,1:删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/AuditDraftTopicFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/AuditDraftTopicFormDTO.java new file mode 100644 index 0000000000..0605d39acb --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/AuditDraftTopicFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/12/18 15:03 + */ +@NoArgsConstructor +@Data +public class AuditDraftTopicFormDTO implements Serializable { + + private static final long serialVersionUID = -4766725540339231386L; + /** + * 草稿话题Id + */ + @NotBlank(message = "话题id不能为空") + private String topicDraftId; + /** + * 审核状态(通过:approved 驳回:rejected) + */ + @NotBlank(message = "审核状态不能为空") + private String auditType; + /** + * 审核原因 + */ + private String reason; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateTopicFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateTopicFormDTO.java new file mode 100644 index 0000000000..e8daa37b2d --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateTopicFormDTO.java @@ -0,0 +1,78 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/12/17 15:08 + */ +@Data +public class CreateTopicFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + private String customerId; + + private String gridId; + /** + * 小组Id + * */ + @NotBlank(message = "小组Id不能为空") + private String groupId; + + private String topicDraftId; + + private String topicContent; + + /** + * 经度 + * */ + private String longitude; + + /** + * 纬度 + * */ + private String dimension; + + /** + * 地址 + * */ + @NotBlank(message = "地址信息不能为空") + private String address; + + /** + * 省份 + * */ + private String province; + + /** + * 城市 + * */ + private String city; + + /** + * 地区 + * */ + private String area; + + /** + * 图片附件 + */ + private List imageList; + /** + * 文件附件 + */ + private List docList; + /** + * 语音附件 + */ + private List voiceList; + /** + * 视频附件 + */ + private List videoList; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateUrlFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateUrlFormDTO.java new file mode 100644 index 0000000000..905f0208e3 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/CreateUrlFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/12/18 上午10:02 + */ +@Data +public class CreateUrlFormDTO implements Serializable { + + private static final long serialVersionUID = -7661839148530902018L; + + public interface CreateUrlForm{} + + /** + * 话题ID + */ + @NotBlank(message = "话题ID不能为空",groups = {CreateUrlForm.class}) + private String topicId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/DraftDetailFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/DraftDetailFormDTO.java new file mode 100644 index 0000000000..e57f420d19 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/DraftDetailFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/12/18 14:53 + */ +@Data +public class DraftDetailFormDTO implements Serializable { + private static final long serialVersionUID = -240658534604688292L; + @NotBlank(message = "话题id不能为空") + private String topicDraftId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/FileDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/FileDTO.java new file mode 100644 index 0000000000..1288ebeac1 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/FileDTO.java @@ -0,0 +1,29 @@ +package com.epmet.resi.group.dto.topic.form; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/12/24 14:09 + */ +@NoArgsConstructor +@Data +public class FileDTO implements Serializable { + + private static final long serialVersionUID = -3930520724652521552L; + @JsonIgnore + private String name; + private String url; + @JsonIgnore + private String type; + @JsonIgnore + private String format; + @JsonIgnore + private Integer size; + private Integer duration; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/MyAuditingListFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/MyAuditingListFormDTO.java new file mode 100644 index 0000000000..dc4a989bed --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/MyAuditingListFormDTO.java @@ -0,0 +1,37 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; + +/** + * @Author sun + * @Description 个人中心-我发表的话题-审核中列表-接口入参 + */ +@Data +public class MyAuditingListFormDTO { + + /** + * 客户Id + */ + @NotBlank(message = "客户ID不能为空",groups = {MyAuditingListFormDTO.AuditingTopicForm.class}) + private String customerId; + /** + * 页码,从1开始 + */ + @Min(value = 1, message = "页码必须大于0", groups = { MyAuditingListFormDTO.AuditingTopicForm.class }) + private Integer pageNo; + /** + * 页容量,默认10页 + */ + @Min(value = 1, message = "每页条数必须大于0", groups = { MyAuditingListFormDTO.AuditingTopicForm.class }) + private Integer pageSize; + /** + * token中用户Id + */ + private String userId; + + public interface AuditingTopicForm{} + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/MyAuditingTopicFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/MyAuditingTopicFormDTO.java new file mode 100644 index 0000000000..47f2d7dd83 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/MyAuditingTopicFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/12/18 14:44 + */ +@NoArgsConstructor +@Data +public class MyAuditingTopicFormDTO implements Serializable { + + private static final long serialVersionUID = 9154103669944393282L; + private String customerId; + private String userId; + private Integer pageNo = 1; + private Integer pageSize = 20; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/SendWxmpUpdateSubscribeFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/SendWxmpUpdateSubscribeFormDTO.java new file mode 100644 index 0000000000..4247d7c266 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/SendWxmpUpdateSubscribeFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.resi.group.dto.topic.form; + +import com.epmet.commons.tools.security.dto.TokenDto; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2021/1/12 13:44 + */ +@Data +public class SendWxmpUpdateSubscribeFormDTO implements Serializable { + @NotNull + private TokenDto tokenDto; + @NotBlank + private String sourceId; + @NotBlank + private String sourceType; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/SharableTopicAndInviteeFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/SharableTopicAndInviteeFormDTO.java new file mode 100644 index 0000000000..18d54716e0 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/SharableTopicAndInviteeFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 话题分享链接和被邀请人入参Dto + * @ClassName SharableTopicAndInviteeFormDTO + * @Auth wangc + * @Date 2020-12-18 13:43 + */ +@Data +public class SharableTopicAndInviteeFormDTO implements Serializable { + + private static final long serialVersionUID = 4943940805360726855L; + + /** + * 话题分享链接 + */ + private String shareLinkId; + + /** + * 通过链接进入话题页面用户的Id + */ + private String inviteeId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ShareLinkTypeFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ShareLinkTypeFormDTO.java new file mode 100644 index 0000000000..da7887bc8d --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ShareLinkTypeFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 分享链接类型和Id入参 + * @ClassName ShareLinkTypefFormDTO + * @Auth wangc + * @Date 2020-12-29 14:53 + */ +@Data +public class ShareLinkTypeFormDTO implements Serializable { + + @NotBlank(message = "链接Id不能为空") + private String id; + + @NotBlank(message = "链接类型不能为空") + private String type; + + @NotBlank(message = "用户Id不能为空") + private String userId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicAttachmentFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicAttachmentFormDTO.java new file mode 100644 index 0000000000..24ab83af6e --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicAttachmentFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author sun + * @Description 获取话题附件信息-接口入参 + */ +@Data +public class TopicAttachmentFormDTO implements Serializable { + + private static final long serialVersionUID = -7661839148530902018L; + /** + * 话题ID + */ + @NotBlank(message = "话题ID不能为空",groups = {TopicForm.class}) + private String topicId; + + public interface TopicForm{} +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicAuditFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicAuditFormDTO.java new file mode 100644 index 0000000000..ba57670521 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicAuditFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.resi.group.dto.topic.form; + +import com.epmet.commons.tools.dto.form.PageFormDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/12/18 14:22 + */ +@NoArgsConstructor +@Data +public class TopicAuditFormDTO extends PageFormDTO implements Serializable { + + private static final long serialVersionUID = 2013373278734345918L; + /** + * 小组ID + */ + @NotBlank(message = "小组id不能为空") + private String groupId; + /** + * 审核状态(待审核:review 已驳回:rejected) + */ + @NotBlank(message = "审核状态不能为空") + private String status; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicBelongGroupFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicBelongGroupFormDTO.java new file mode 100644 index 0000000000..b749fd3c73 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicBelongGroupFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/12/18 下午2:06 + */ +@Data +public class TopicBelongGroupFormDTO implements Serializable { + + private static final long serialVersionUID = -1257699096393262959L; + + private String topicId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicEventFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicEventFormDTO.java new file mode 100644 index 0000000000..c6443c9d4a --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicEventFormDTO.java @@ -0,0 +1,45 @@ +package com.epmet.resi.group.dto.topic.form; + +import com.epmet.commons.tools.enums.EventEnum; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Description 话题相关积分入参dto + * @ClassName TopicEventFormDTO + * @Auth wangc + * @Date 2021-01-04 16:37 + */ +@Data +public class TopicEventFormDTO implements Serializable { + private static final long serialVersionUID = 2297474207576464905L; + + /** + * 话题Id + */ + @NotBlank(message = "话题Id不能为空") + private String topicId; + + /** + * 话题作者Id + */ + //private String topicAuthorId; + + /** + * 议题发起人Id + */ + private String issuePublisherId; + + /** + * 事件枚举 + */ + @NotNull(message = "楼院小组事件枚举类型不能为空") + private EventEnum event; + + /** + * 后续相关参数可再添加 + */ +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicVisitFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicVisitFormDTO.java new file mode 100644 index 0000000000..359d4be674 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/TopicVisitFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.resi.group.dto.topic.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/12/18 下午3:12 + */ +@Data +public class TopicVisitFormDTO implements Serializable { + + private static final long serialVersionUID = -7231684507046042401L; + + public interface TopicVisitForm{} + + /** + * 分享ID + */ + @NotBlank(message = "分享ID不能为空",groups = {TopicVisitForm.class}) + private String shareLinkId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/CreateUrlResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/CreateUrlResultDTO.java new file mode 100644 index 0000000000..7ec576aee5 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/CreateUrlResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.resi.group.dto.topic.result; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/12/18 上午10:01 + */ +@Data +@AllArgsConstructor +public class CreateUrlResultDTO implements Serializable { + + private static final long serialVersionUID = -8606257390921799432L; + + /** + * 分享链接ID + */ + private String shareLinkId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/DraftDetailResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/DraftDetailResultDTO.java new file mode 100644 index 0000000000..ed04fa23ac --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/DraftDetailResultDTO.java @@ -0,0 +1,61 @@ +package com.epmet.resi.group.dto.topic.result; + +import com.epmet.resi.group.dto.topic.form.FileDTO; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/12/18 14:50 + */ +@NoArgsConstructor +@Data +public class DraftDetailResultDTO implements Serializable { + + private static final long serialVersionUID = -7445417689558651158L; + private String groupId; + /** + * 话题草稿id + */ + private String topicDraftId; + /** + * 话题内容 + */ + private String topicContent; + /** + * 发布时间yyyy-MM-dd HH:mm + */ + private String releaseTime; + /** + * 发布人头像 + */ + private String releaseUserHeadPhoto; + /** + * 发布人名称 + */ + private String releaseUserName; + /** + * 发布地址 + */ + private String releaseAddress; + /** + * 驳回理由 + */ + private String reason; + private String status; + private String topicId; + /** + * 图片附件集合 + */ + private List imageList; + private List docList; + /** + * 音频附件集合 + */ + private List voiceList; + private List videoList; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MemberRelationBetweenGroupAndGridResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MemberRelationBetweenGroupAndGridResultDTO.java new file mode 100644 index 0000000000..e3b0446113 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MemberRelationBetweenGroupAndGridResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.resi.group.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 通过链接进入小程序的用户与链接所在的小组与网格的关系 + * @ClassName MemberRelationBetweenGroupAndGridResultDTO + * @Auth wangc + * @Date 2020-12-29 14:58 + */ +@Data +public class MemberRelationBetweenGroupAndGridResultDTO implements Serializable { + private static final long serialVersionUID = -5389490307870064071L; + + /** + * 是否存在入组待审核记录,true:存在,false:不存在 + */ + private Boolean awaitAudit = false; + + /** + * 是否在群内标志,已经在群内:true, 不在群内:false + */ + private Boolean inGroup = false; + + /** + * 此人有没有加入所在小组所属网格下的任何一个小组,true:加入,false:未加入 + */ + private Boolean inAnyGroup = false; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyAuditingListResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyAuditingListResultDTO.java new file mode 100644 index 0000000000..14b35755ec --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyAuditingListResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.resi.group.dto.topic.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 个人中心-我发表的话题-审核中列表-接口返参 + */ +@Data +public class MyAuditingListResultDTO implements Serializable { + + private static final long serialVersionUID = -703102629653169023L; + + /** + * 话题草稿id + */ + private String topicDraftId; + + /** + * 话题来源网格名称 + */ + private String releaseGridName; + @JsonIgnore + private String gridId; + + /** + * 发布时间戳 + */ + private Long releaseTime; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 小组名称 + */ + private String releaseGroupName; + + /** + * 状态 + */ + private String status; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyAuditingTopicResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyAuditingTopicResultDTO.java new file mode 100644 index 0000000000..efdb157adf --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/MyAuditingTopicResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.resi.group.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/12/18 14:41 + */ +@Data +public class MyAuditingTopicResultDTO implements Serializable { + private static final long serialVersionUID = -2876904175308968430L; + private String topicDraftId; + private String groupId; + private Long releaseTime; + private String topicContent; + private String releaseGroupName; + private String releaseGridId; + private String releaseGridName; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicAttachmentResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicAttachmentResultDTO.java new file mode 100644 index 0000000000..fa4bb92fdb --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicAttachmentResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.resi.group.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.LinkedList; + +/** + * @Author sun + * @Description 获取话题附件信息-接口返参 + */ +@Data +public class TopicAttachmentResultDTO implements Serializable { + + private static final long serialVersionUID = -8606257390921799432L; + + /** + * 文件附件Url集合 + */ + private LinkedList docList; + /** + * 语音附件Url集合 + */ + private LinkedList voiceList; + /** + * 视频附件Url集合 + */ + private LinkedList videoList; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicAuditResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicAuditResultDTO.java new file mode 100644 index 0000000000..d18a8ab0d5 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicAuditResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.resi.group.dto.topic.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/12/18 14:28 + */ +@NoArgsConstructor +@Data +public class TopicAuditResultDTO { + + /** + * 话题草稿id + */ + private String topicDraftId; + /** + * 话题内容 + */ + private String topicContent; + /** + * 组成员显示名称 + */ + private String userName; + /** + * 话题草稿的发布时间戳 + */ + private Long releaseTime; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicBelongGroupResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicBelongGroupResultDTO.java new file mode 100644 index 0000000000..f9de2af12b --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicBelongGroupResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.resi.group.dto.topic.result; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/12/18 下午2:12 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class TopicBelongGroupResultDTO implements Serializable { + + private static final long serialVersionUID = 8180287697221964032L; + + private String groupId; + + private String gridId; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicFileResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicFileResultDTO.java new file mode 100644 index 0000000000..88a3a0061c --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicFileResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.resi.group.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.LinkedList; + +/** + * @Author sun + * @Description 获取话题附件信息-接口返参 + */ +@Data +public class TopicFileResultDTO implements Serializable { + + private static final long serialVersionUID = -8606257390921799432L; + + /** + * 文件Url + */ + private String url; + /** + * 语音或视频文件的时长,单位毫秒 + */ + private Integer duration; + +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicVisitResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicVisitResultDTO.java new file mode 100644 index 0000000000..6191a5b6b9 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicVisitResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.resi.group.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/12/18 下午3:15 + */ +@Data +public class TopicVisitResultDTO implements Serializable { + + private static final long serialVersionUID = -8053248999188056579L; + + /** + * 是否存在入组待审核记录,true:存在,false:不存在 + */ + private Boolean awaitAudit; + + /** + * 是否在群内标志,已经在群内:true, 不在群内:false + */ + private Boolean inGroup; + + /** + * 小组ID + */ + private String groupId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 话题ID + */ + private String topicId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题屏蔽状态,true:已屏蔽,false:未屏蔽 + */ + private Boolean shieldStatus; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 574af0884f..3c8a358f1c 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -10,25 +10,20 @@ import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO; import com.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO; import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; +import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.*; -import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; -import com.epmet.resi.group.dto.topic.result.MyCreateTopicsResultDTO; -import com.epmet.resi.group.dto.topic.result.MyPartIssueResultDTO; -import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO; +import com.epmet.resi.group.dto.topic.result.*; import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; -import com.epmet.commons.tools.utils.Result; -import com.epmet.resi.group.dto.group.form.CreateGroupCodeFormDTO; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +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; import java.util.HashMap; import java.util.List; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -37,7 +32,7 @@ import org.springframework.web.bind.annotation.RequestBody; * @date 2020/6/4 13:16 */ @FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupOpenFeignClientFallback.class) -//@FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupOpenFeignClientFallback.class,url = "localhost:8095") +// @FeignClient(name = ServiceConstant.RESI_GROUP_SERVER, fallback = ResiGroupOpenFeignClientFallback.class,url = "localhost:8095") public interface ResiGroupOpenFeignClient { @PostMapping("/resi/group/group/gov-edit-auditing-list") @@ -148,4 +143,59 @@ public interface ResiGroupOpenFeignClient { */ @PostMapping("resi/group/topic/fetchtopicinfowhenauditissue") Result fetchTopicInfoWhenAuditIssue(@RequestBody ResiTopicTurnIssueFromDTO param); + + /** + * @Description 发送内容更新类的微信订阅 + * @return void + * @Author liushaowen + * @Date 2021/1/12 11:22 + */ + @PostMapping("resi/group/topic/sendwxmpupdatesubscribe") + Result sendWxmpUpdateSubscribe(@RequestBody SendWxmpUpdateSubscribeFormDTO fromDTO); + + /** + * @Description 查询话题所属小组 + * @Param formDTO + * @author zxc + * @date 2020/12/18 下午2:08 + */ + @PostMapping("resi/group/topicsharelink/topicbelonggroup") + Result selectTopicBelongGroup(@RequestBody TopicBelongGroupFormDTO formDTO); + + /** + * @Description 检查邀请关系,如果确实存在邀请关系则返回邀请人Id + * 符合条件: + * ① 链接Id对应 + * ② 邀请人Id对应 + * ③ 邀请人在被邀请时的状态为陌生人 + * @param param + * @return com.epmet.commons.tools.utils.Result + * @author wangc + * @date 2020.12.18 14:53 + */ + @PostMapping("resi/group/topicsharelinkvisitrecord/checkinviterelationship") + Result checkInviteRelationship(@RequestBody SharableTopicAndInviteeFormDTO param); + + + /** + * 自动审核 + * @author zhaoqifeng + * @date 2020/12/30 10:11 + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("resi/group/topicdraft/autoAudit") + Result autoAudit(); + + /** + * @Description 根据事件枚举发送积分事件 + * @param param + * @return void + * @author wangc + * @date 2021.01.04 16:41 + */ + @PostMapping("resi/group/topic/sendevent") + Result sendEvent(@RequestBody TopicEventFormDTO param); + + @GetMapping("resi/group/topic/querytopicinfobyissueid/{issueId}") + Result queryTopicInfoByIssueId(@PathVariable("issueId")String issueId); } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index 7df5d859cf..881569ea10 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -8,19 +8,14 @@ import com.epmet.resi.group.dto.group.form.*; import com.epmet.resi.group.dto.group.result.ApplicationDetailCopyResultDTO; import com.epmet.resi.group.dto.group.result.ApplyingGroupResultDTO; import com.epmet.resi.group.dto.group.result.GroupEditionDetailResultDTO; -import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO; -import com.epmet.resi.group.dto.group.form.GroupInfoFormDTO; -import com.epmet.resi.group.dto.group.result.ApplicationDetailCopyResultDTO; import com.epmet.resi.group.dto.group.result.GroupInfoResultDTO; import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; +import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; import com.epmet.resi.group.dto.topic.result.MyPartIssueResultDTO; import com.epmet.resi.group.dto.topic.result.ParticipatedTopicUnitResultDTO; -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.ModuleUtils; -import com.epmet.commons.tools.utils.Result; -import com.epmet.resi.group.dto.group.form.CreateGroupCodeFormDTO; +import com.epmet.resi.group.dto.topic.result.TopicBelongGroupResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.stereotype.Component; @@ -106,4 +101,42 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien public Result fetchTopicInfoWhenAuditIssue(ResiTopicTurnIssueFromDTO param) { return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "fetchTopicInfoWhenAuditIssue",param); } + + @Override + public Result sendWxmpUpdateSubscribe(SendWxmpUpdateSubscribeFormDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "sendWxmpUpdateSubscribe",fromDTO); + } + + + @Override + public Result selectTopicBelongGroup(TopicBelongGroupFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "selectTopicBelongGroup",formDTO); + } + + @Override + public Result checkInviteRelationship(SharableTopicAndInviteeFormDTO param) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "selectTopicBelongGroup", param); + } + + /** + * 自动审核 + * + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/12/30 10:11 + */ + @Override + public Result autoAudit() { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "autoAudit"); + } + + @Override + public Result sendEvent(TopicEventFormDTO param) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "sendEvent",param); + } + + @Override + public Result queryTopicInfoByIssueId(String issueId) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "queryTopicInfoByIssueId", issueId); + } } diff --git a/epmet-module/resi-group/resi-group-server/Dockerfile b/epmet-module/resi-group/resi-group-server/Dockerfile index b1fd9f6fab..29d71963fc 100644 --- a/epmet-module/resi-group/resi-group-server/Dockerfile +++ b/epmet-module/resi-group/resi-group-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./resi-group.jar EXPOSE 8095 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-prod.yml b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-prod.yml index 3d47c5a6be..8b618d43e3 100644 --- a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-group-server: container_name: resi-group-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-group-server:0.3.67 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-group-server:0.3.82 ports: - "8095:8095" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index 6585d78081..7f86290566 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.67 + 0.3.82 com.epmet resi-group @@ -159,6 +159,13 @@ false + + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c + https://epmet-dev.elinkservice.cn/api/epmetscan/api 5 @@ -204,6 +211,13 @@ false + + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 202007161443499985fa2d397436d10356542134c8f008c48 + 52d9d9b0e7d0eb5b8b81c205b579e07c + https://epmet-dev.elinkservice.cn/api/epmetscan/api 5 @@ -248,6 +262,13 @@ false true + + + https://epmet-dev.elinkservice.cn/estos/ + producerService/producer/sendMsg + 20200804181646184507453a2e9aab76edc550405f80920af + 96d788191a10ff57a125157183413004 + https://epmet-dev.elinkservice.cn/api/epmetscan/api 5 @@ -289,6 +310,13 @@ false true + + + https://estos.elinkservice.cn:7519/estos/ + producerService/producer/sendMsg + 202008141820598348026098a1b5dd0bc63a1e2418e275d1b + 7ce17f65826539ff3e8616dccd4b70fc + https://epmet-open.elinkservice.cn/api/epmetscan/api 5 diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/WxmpSubscribeConstant.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/WxmpSubscribeConstant.java new file mode 100644 index 0000000000..0c9c5f28b9 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/constant/WxmpSubscribeConstant.java @@ -0,0 +1,6 @@ +package com.epmet.modules.constant; + +public interface WxmpSubscribeConstant { + String TYPE_COMMENT = "comment"; + String TYPE_SHIFT_ISSUE = "shiftIssue"; +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java index d8e11dc942..569a9137b3 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/controller/ResiGroupController.java @@ -19,6 +19,7 @@ package com.epmet.modules.group.controller; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -405,7 +406,17 @@ public class ResiGroupController { */ @PostMapping("gov-edit-auditing-list") public Result> govEditAuditingList(@RequestBody CommonGridAndPageFormDTO param){ - return new Result>().ok(resiGroupService.getEditAuditingList(param)); + List list = resiGroupService.getEditAuditingList(param); + if (StrConstant.SPECIAL_CUSTOMER.equals(param.getCustomerId())) { + list.forEach(item -> { + if (item.getMessageText().contains("热心居民")) { + item.setMessageText(item.getMessageText().replace("热心居民", "组长")); + } else if (item.getMessageText().contains("居民")) { + item.setMessageText(item.getMessageText().replace("居民", "学员")); + } + }); + } + return new Result>().ok(list); } /** diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java index cdb6a245a9..9a11aa39c2 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/dao/ResiGroupDao.java @@ -19,6 +19,7 @@ package com.epmet.modules.group.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.group.entity.ResiGroupEntity; +import com.epmet.resi.group.dto.group.GroupProcessingCountResultDTO; import com.epmet.resi.group.dto.group.ResiGroupDTO; import com.epmet.resi.group.dto.group.form.*; import com.epmet.resi.group.dto.group.result.*; @@ -226,4 +227,13 @@ public interface ResiGroupDao extends BaseDao { * @Date 2020/11/23 10:07 **/ List selectListByIds(@Param("groupIds") List groupIds); + + /** + * @return java.util.List + * @param gridIdList + * @author yinzuomei + * @description 根据网格id查询,返回每个网格的待审核小组总数+变更小组信息申请数 + * @Date 2020/12/25 13:18 + **/ + List queryGroupProcessingCount(@Param("gridIdList") List gridIdList); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupCodeServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupCodeServiceImpl.java index 6615ca4bb1..55a15a3a39 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupCodeServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupCodeServiceImpl.java @@ -160,7 +160,7 @@ public class ResiGroupCodeServiceImpl extends BaseServiceImpl result = epmetUserFeignClient.getUserResiInfoDTO(resiUserInfoFormDTO); if (!result.success() || null == result.getData() || StringUtils.isBlank(result.getData().getRegMobile())) { logger.info(String.format("加入小组界面初始化查询成功,当前用户非注册居民,epmet-user-server接口入参%s,返回%s",JSON.toJSONString(resiUserInfoFormDTO),JSON.toJSONString(result))); - throw new RenException(EpmetErrorCode.CANNOT_JOIN_GROUP.getCode()); + if (StrConstant.SPECIAL_CUSTOMER.equals(initApplyGroupFormDTO.getCustomerId())) { + throw new RenException(8001, "只有注册学员才可以加入小组"); + } else { + throw new RenException(EpmetErrorCode.CANNOT_JOIN_GROUP.getCode()); + } + } } @@ -532,7 +532,11 @@ public class ResiGroupServiceImpl extends BaseServiceImpl msgList = new ArrayList<>(); msgList.add(wxSubscribeMessageFormDTO); epmetMessageOpenFeignClient.sendWxSubscribeMessage(msgList); - //更新政府端:工作-基层治理-党员认证reddot - resiGroupRedis.subtractWorkGrassrootsPartyAuthRedDotValue(resiGroupDTO.getGridId()); return new Result(); } @@ -702,8 +704,6 @@ public class ResiGroupServiceImpl extends BaseServiceImpl>().ok(baseDao.getApplyingGroupsByCustIdAndGridId(params)); + List list = baseDao.getApplyingGroupsByCustIdAndGridId(params); + if (StrConstant.SPECIAL_CUSTOMER.equals(params.getCustomerId())) { + list.forEach(item -> { + if (item.getMessageText().contains("热心居民")) { + item.setMessageText(item.getMessageText().replace("热心居民", "组长")); + } else if (item.getMessageText().contains("居民")) { + item.setMessageText(item.getMessageText().replace("居民", "学员")); + } + }); + } + return new Result>().ok(list); } /** @@ -908,21 +918,10 @@ public class ResiGroupServiceImpl extends BaseServiceImpl queryGroupProcessingCount(List gridIdList) { - List list=new ArrayList<>(); - for(String gridId:gridIdList){ - GroupProcessingCountResultDTO resultDTO=new GroupProcessingCountResultDTO(); - resultDTO.setGridId(gridId); - Integer auditingCreateGroupCount=Optional.ofNullable(resiGroupRedis.getWorkGrassrootsGroupRedDotValue(gridId)).orElse(NumConstant.ZERO); - Integer auditingGroupEditRecordCount=Optional.ofNullable(groupEditSubmitRecordDao.selectCountAuditingRec(gridId)).orElse(NumConstant.ZERO); - Integer auditingCount=auditingCreateGroupCount+auditingGroupEditRecordCount; - if (null == auditingCount) { - resultDTO.setCount(0); - } else { - resultDTO.setCount(auditingCount); - } - list.add(resultDTO); + if(CollectionUtils.isEmpty(gridIdList)){ + return Collections.EMPTY_LIST; } - return list; + return baseDao.queryGroupProcessingCount(gridIdList); } @@ -1230,7 +1229,6 @@ public class ResiGroupServiceImpl 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、校验是否已经注册居民 if(null==result.getData().getUserRoleList()||result.getData().getUserRoleList().size()==0){ - logger.error(String.format("用户同意邀请进组失败,返回角色列表为空错误编码%s,错误提示%s",EpmetErrorCode.CANNOT_JOIN_GROUP.getCode(),EpmetErrorCode.CANNOT_JOIN_GROUP.getMsg())); - throw new RenException(EpmetErrorCode.CANNOT_JOIN_GROUP.getCode()); + logger.warn(String.format("用户通过邀请链接入组失败,返回角色列表为空错误编码%s,错误提示%s",EpmetErrorCode.CANNOT_JOIN_GROUP.getCode(),EpmetErrorCode.CANNOT_JOIN_GROUP.getMsg())); + if (StrConstant.SPECIAL_CUSTOMER.equals(resiGroupDTO.getCustomerId())) { + throw new RenException(8001, "只有注册学员才可以加入小组"); + } else { + throw new RenException(EpmetErrorCode.CANNOT_JOIN_GROUP.getCode()); + } } UserRoleDTO userRoleDTO=this.getUserRoleDTO(result.getData().getUserRoleList()); //5、新增一条邀请入群、直接审核通过的入群记录 @@ -463,7 +467,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、校验是否已经注册居民 if(null==result.getData().getUserRoleList()||result.getData().getUserRoleList().size()==0){ - logger.error(String.format("用户同意邀请进组失败,返回角色列表为空错误编码%s,错误提示%s",EpmetErrorCode.CANNOT_JOIN_GROUP.getCode(),EpmetErrorCode.CANNOT_JOIN_GROUP.getMsg())); - throw new RenException(EpmetErrorCode.CANNOT_JOIN_GROUP.getCode()); + logger.warn(String.format("用户通过扫码入组失败,返回角色列表为空错误编码%s,错误提示%s",EpmetErrorCode.CANNOT_JOIN_GROUP.getCode(),EpmetErrorCode.CANNOT_JOIN_GROUP.getMsg())); + if (StrConstant.SPECIAL_CUSTOMER.equals(resiGroupDTO.getCustomerId())) { + throw new RenException(8001, "只有注册学员才可以加入小组"); + } else { + throw new RenException(EpmetErrorCode.CANNOT_JOIN_GROUP.getCode()); + } } //2020.11.17 sun 新增扫描或邀请进组是否需要审核的逻辑 start GroupMemeberOperationDTO groupMemeberOperation = new GroupMemeberOperationDTO(); @@ -602,6 +610,10 @@ public class GroupInvitationServiceImpl extends BaseServiceImpl().ok(resiGroupMemberService.votableCount(gridList)); } + /** + * @Description 通过话题/议题分享链接申请入组 + * @param param + * @return com.epmet.resi.group.dto.member.result.JoinGroupApplyRealTimeResultDTO + * @author wangc + * @date 2020.12.22 10:36 + */ + @PostMapping("applyenterbylink") + public Result applyEnterByLink(@LoginUser TokenDto token,@RequestBody JoinGroupByShareLinkFormDTO param){ + param.setUserId(token.getUserId()); + ValidatorUtils.validateEntity(param); + return new Result().ok(operationService.applyEnterByLink(param)); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/GroupMemeberOperationDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/GroupMemeberOperationDao.java index 8d56bd49af..49ecf7fbbe 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/GroupMemeberOperationDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/GroupMemeberOperationDao.java @@ -50,4 +50,13 @@ public interface GroupMemeberOperationDao extends BaseDao { * @date 2020.05.26 14:22 **/ List getGroupIdByUserIdAndGridId(@Param("gridId")String gridId,@Param("userId")String userId,@Param("roleFlag")String roleFlag); + + /** + * @Description 校验此人是不是在组内 + * @Param userId + * @Param groupId + * @author zxc + * @date 2020/12/18 下午4:33 + */ + Integer checkUserInGroup(@Param("userId")String userId,@Param("groupId")String groupId); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/GroupMemeberOperationEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/GroupMemeberOperationEntity.java index fd7537370c..8483de6627 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/GroupMemeberOperationEntity.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/GroupMemeberOperationEntity.java @@ -62,7 +62,7 @@ Ps: 1) 入群被拒绝之后,如果再申请是插入一条新的审核中的 private String operateStatus; /** - * 入群方式:(受邀请入群 - invited 、 主动加入 - join、扫码入群 - scancode) + * 入群方式:(受邀请入群 - invited 、 主动加入 - join、扫码入群 - scancode、话题分享链接 - topic_share_link、议题分享链接 - issue_share_link) */ private String enterGroupType; diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/ResiGroupMemberEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/ResiGroupMemberEntity.java index 6dc7d21ad2..ebcceb9566 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/ResiGroupMemberEntity.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/entity/ResiGroupMemberEntity.java @@ -54,7 +54,7 @@ public class ResiGroupMemberEntity extends BaseEpmetEntity { private String groupLeaderFlag; /** - * 入群方式:(受邀请入群 - invited 、 主动加入 - join、扫码入群 - scancode) + * 入群方式:(受邀请入群 - invited 、 主动加入 - join、扫码入群 - scancode、话题分享链接 - topic_share_link、议题分享链接 - issue_share_link) */ private String enterGroupType; diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/GroupMemeberOperationService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/GroupMemeberOperationService.java index ac04cf0742..32906be649 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/GroupMemeberOperationService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/GroupMemeberOperationService.java @@ -23,7 +23,9 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.modules.member.entity.GroupMemeberOperationEntity; import com.epmet.modules.member.entity.ResiGroupMemberEntity; import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO; +import com.epmet.resi.group.dto.member.form.JoinGroupByShareLinkFormDTO; import com.epmet.resi.group.dto.member.form.RemoveMemberFormDTO; +import com.epmet.resi.group.dto.member.result.JoinGroupApplyRealTimeResultDTO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -122,4 +124,13 @@ public interface GroupMemeberOperationService extends BaseService implements GroupMemeberOperationService { @Autowired private GroupMemeberOperationRedis groupMemeberOperationRedis; + @Autowired + private ResiGroupMemberDao resiGroupMemberDao; + @Autowired + private TopicShareLinkRecordDao topicShareLinkRecordDao; + @Autowired + private GovIssueOpenFeignClient issueOpenFeignClient; + @Autowired + private ResiTopicDao topicDao; + @Autowired + private GroupMemeberOperationDao operationDao; + @Autowired + private ResiGroupService groupService; + @Autowired + private ResiGroupMemberService memberService; + @Autowired + private ResiGroupRedis groupRedis; + @Autowired + private ResiGroupMemberRedis memberRedis; + @Autowired + private EpmetUserOpenFeignClient userClient; + @Autowired + private TopicShareLinkVisitRecordDao topicShareLinkVisitRecordDao; @Override public PageData page(Map params) { @@ -143,4 +205,212 @@ public class GroupMemeberOperationServiceImpl extends BaseServiceImpl response = issueOpenFeignClient.shareLinkInfo(param.getShareLinkId()); + if(response.success() && null != response.getData()){ + groupId = topicDao.selectGroupIdByIssueId(response.getData().getIssueId()); + inviter = response.getData().getShareUserId(); + } + } + if(StringUtils.isBlank(groupId)){ + throw new RenException("没有找到分享链接对应的组Id"); + } + if(StringUtils.isBlank(inviter)){ + throw new RenException("没有找到邀请人Id"); + } + //查询是否在群内 + ResiGroupMemberDTO groupMember = resiGroupMemberDao.selectGroupMemberInfo(groupId, param.getUserId()); + if (null != groupMember && !MemberStateConstant.REMOVED.equals(groupMember.getStatus())) { + log.info("已经在群内,直接返回成功,但是不发送积分事件"); + result.setStatus("entered"); + return result; + } + + //先判断用户是否有在审核的入组申请,有的话直接给提示 + GroupMemeberOperationDTO groupMemeberOperationDTO = operationDao.selectLatestRecord(groupId, param.getUserId()); + if (null != groupMemeberOperationDTO && MemberStateConstant.UNDER_AUDITTING.equals(groupMemeberOperationDTO.getOperateStatus())) { + log.info("已存在待审核入组申请,不能重复审核"); + result.setStatus("auditing"); + return result; + } + + ResiGroupDTO resiGroupDTO = groupService.get(groupId); + if(null == resiGroupDTO){ + log.error("没有找到对应的组,组Id:{}",groupId); + throw new RenException("没有找到对应的组"); + } + GetRoleKeyListFormDTO roleParam = new GetRoleKeyListFormDTO(); + roleParam.setFromApp("resi"); + roleParam.setUserId(param.getUserId()); + roleParam.setGridId(resiGroupDTO.getGridId()); + Result> userRoleResponse = userClient.getUserRoleKeyList(roleParam); + if(!userRoleResponse.success() || CollectionUtils.isEmpty(userRoleResponse.getData())){ + throw new RenException("未找到当前用户的有效身份信息"); + } + + + //进组是否需要审核的逻辑 + GroupMemeberOperationDTO groupMemeberOperation = new GroupMemeberOperationDTO(); + groupMemeberOperation.setGroupId(groupId); + groupMemeberOperation.setCustomerUserId(param.getUserId()); + groupMemeberOperation.setEnterGroupType(StringUtils.equals("topic",param.getShareLinkType()) ? ModuleConstant.ENTER_GROUP_TYPE_TOPIC_LINK : ModuleConstant.ENTER_GROUP_TYPE_ISSUE_LINK); + groupMemeberOperation.setGroupInvitationId(param.getShareLinkId()); + groupMemeberOperation.setOperateUserId(param.getUserId()); + ResiGroupMemberInfoRedisDTO memberInfo = memberRedis.get(groupId, inviter); + if(null != memberInfo && StringUtils.isNotBlank(memberInfo.getUserShowName())) + groupMemeberOperation.setOperateDes(String.format("通过%s的",memberInfo.getUserShowName()) + + (StringUtils.equals("topic",param.getShareLinkType()) ? "话题" : "议题" )+ "分享加入小组"); + else + groupMemeberOperation.setOperateDes(StringUtils.equals("topic",param.getShareLinkType()) ? "通过话题分享申请入组" : "通过议题分享申请入组" ); + //入组审核开关是开启状态则需要组长审核 + if (StringUtils.equals(GroupStateConstant.AUDIT_SWITCH_OPEN , resiGroupDTO.getAuditSwitch())) { + groupMemeberOperation.setOperateStatus(MemberStateConstant.UNDER_AUDITTING); + save(groupMemeberOperation); + //给组长推送站内信 + //memberService.sendMessageToGroupLeader(resiGroupDTO, param.getUserId()); + result.setStatus("auditing"); + return result; + } + + UserRoleDTO userRoleDTO = getUserRoleDTO(userRoleResponse.getData()); + //新增一条邀请入群、直接审核通过的入群记录 + groupMemeberOperation.setOperateStatus(MemberStateConstant.APPROVED); + save(groupMemeberOperation); + result.setStatus("entered"); + //发送积分事件 + boolean isNew = false; + + if(StringUtils.equals("topic",param.getShareLinkType())){ + TopicShareLinkVisitRecordEntity record = topicShareLinkVisitRecordDao.selectRecordByLinkIdAndInvitee(param.getShareLinkId(), param.getUserId()); + if(null == record){ + log.error("【{}】该用户入组方式为话题分享链接入组,但未查询到链接访问记录,链接Id【{}】",param.getUserId(),param.getShareLinkId()); + throw new RenException("未找到链接访问记录"); + } + if(NumConstant.ZERO == record.getIsInviteRegister()) isNew = true; + }else{ + Result visitRecordResult = issueOpenFeignClient.visitRecord(param.getShareLinkId(), param.getUserId()); + if(!visitRecordResult.success() || null == visitRecordResult.getData()){ + log.error("【{}】该用户入组方式为议题分享链接入组,但未查询到链接访问记录,链接Id【{}】",param.getUserId(),param.getShareLinkId()); + throw new RenException("未找到链接访问记录"); + } + if(NumConstant.ZERO == visitRecordResult.getData().getIsInviteRegister()) isNew = true; + } + + if(StringUtils.isNotBlank(inviter)){ + //mq的事件类型 + MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); + //事件code + mqBaseMsgDTO.setEventTag(isNew ? EventEnum.INVITE_NEW_RESIDENT_INTO_GROUP.getEventTag() : EventEnum.INVITE_RESIDENT_INTO_GROUP.getEventTag()); + mqBaseMsgDTO.setEventClass("resi_group"); + List pointEventMsgList = new ArrayList<>(); + BasePointEventMsg pointEventMsg = new BasePointEventMsg(); + pointEventMsg.setCustomerId(resiGroupDTO.getCustomerId()); + pointEventMsg.setUserId(inviter); + pointEventMsg.setActionFlag(MqConstant.PLUS); + pointEventMsg.setIsCommon(false); + pointEventMsg.setTargetDate(current); + pointEventMsg.setEventTag(mqBaseMsgDTO.getEventTag()); + //pointEventMsg.setRemark("通过".concat(StringUtils.equals(param.getShareLinkType(),"topic") + // ? "话题":"议题").concat("分享链接邀请").concat(isNew ? "新" : "").concat("用户进组")); + + List userParam = new LinkedList<>(); + userParam.add(param.getUserId()); + Result> userResponse = userClient.queryUserBaseInfo(userParam); + if(userResponse.success() && !CollectionUtils.isEmpty(userResponse.getData())){ + UserBaseInfoResultDTO user = userResponse.getData().get(NumConstant.ZERO); + pointEventMsg.setRemark( new StringBuilder("邀请") + .append(user.getStreet()).append("-").append(user.getSurname()) + .append(StringUtils.equals(NumConstant.ONE_STR,user.getGender()) ? "先生" : + StringUtils.equals(NumConstant.TWO_STR,user.getGender()) ? "女士" : "先生/女士") + .append("加入") + .append(resiGroupDTO.getGroupName()).append("小组").toString()); + } + pointEventMsgList.add(pointEventMsg); + + mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); + Result sendResult = SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + if(!sendResult.success()){ + log.error((isNew ? "拉新用户入组事件发送失败" : "邀请已注册用户入组事件发送失败").concat(",参数:{}"),JSON.toJSONString(param)); + } + } + + //直接加入群成员关系表 + //如果是之前被移除的,则修改resi_group_member记录 + ResiGroupMemberDTO resiGroupMemberDTO = new ResiGroupMemberDTO(); + ResiGroupMemberDTO resiGroupMember = resiGroupMemberDao.selectGroupMemberInfo(groupId, param.getUserId()); + if (null != resiGroupMember) { + resiGroupMemberDTO.setId(resiGroupMember.getId()); + } + resiGroupMemberDTO.setCustomerUserId(groupMemeberOperation.getCustomerUserId()); + resiGroupMemberDTO.setResiGroupId(groupMemeberOperation.getGroupId()); + resiGroupMemberDTO.setGroupLeaderFlag(LeaderFlagConstant.GROUP_MEMBER); + resiGroupMemberDTO.setEnterGroupType(groupMemeberOperation.getEnterGroupType()); + resiGroupMemberDTO.setStatus(MemberStateConstant.APPROVED); + resiGroupMemberDTO.setCreatedBy(groupMemeberOperation.getCustomerUserId()); + memberService.saveOrUpdate(resiGroupMemberDTO); + //修改群统计值 + resiGroupMemberDao.updateResiGroupStatistical(groupMemeberOperation.getGroupId(), userRoleDTO); + ResiGroupInfoRedisDTO groupCache = + groupRedis.get(groupId); + if(null != groupCache && null != groupCache.getGroupStatisticalInfo()){ + groupCache.getGroupStatisticalInfo().setTotalMembers( + null == groupCache.getGroupStatisticalInfo().getTotalMembers() ? NumConstant.TWO : groupCache.getGroupStatisticalInfo().getTotalMembers() +NumConstant.ONE + ); + if(StringUtils.equals(userRoleDTO.getPartymemberFlag(),NumConstant.ONE_STR)) groupCache.getGroupStatisticalInfo().setTotalPartyMembers( + null == groupCache.getGroupStatisticalInfo().getTotalPartyMembers() ? NumConstant.ONE : groupCache.getGroupStatisticalInfo().getTotalPartyMembers()+NumConstant.ONE + ); + if(StringUtils.equals(userRoleDTO.getRegisteredResiFlag(),NumConstant.ONE_STR)) groupCache.getGroupStatisticalInfo().setTotalNormalMembers( + null == groupCache.getGroupStatisticalInfo().getTotalNormalMembers() ? NumConstant.TWO : groupCache.getGroupStatisticalInfo().getTotalNormalMembers()+NumConstant.ONE + ); + if(StringUtils.equals(userRoleDTO.getWarmHeartedFlag(),NumConstant.ONE_STR)) groupCache.getGroupStatisticalInfo().setTotalEarnestMembers( + null == groupCache.getGroupStatisticalInfo().getTotalEarnestMembers() ? NumConstant.ONE : groupCache.getGroupStatisticalInfo().getTotalEarnestMembers()+NumConstant.ONE + ); + groupRedis.set(groupCache); + } + //发送消息 + //this.sendMessageToLeader(formDTO, resiGroupDTO,groupInvitationDTO); + + return result; + } + + + private UserRoleDTO getUserRoleDTO(List userRoleList) { + UserRoleDTO userRoleDTO=new UserRoleDTO(); + for (String roleKey : userRoleList) { + if (EpmetRoleKeyConstant.PARTYMEMBER.equals(roleKey)) { + userRoleDTO.setPartymemberFlag(NumConstant.ONE_STR); + } + if (EpmetRoleKeyConstant.WARMHEARTED.equals(roleKey)) { + userRoleDTO.setWarmHeartedFlag(NumConstant.ONE_STR); + } + if (EpmetRoleKeyConstant.REGISTERED_RESI.equals(roleKey)) { + userRoleDTO.setRegisteredResiFlag(NumConstant.ONE_STR); + } + } + return userRoleDTO; + } + + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java index 76ec2024c2..d420a7205b 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/service/impl/ResiGroupMemberServiceImpl.java @@ -21,20 +21,25 @@ import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.AppClientConstant; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.constant.*; +import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; +import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; +import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SendMqMsgUtils; import com.epmet.constant.ReadFlagConstant; +import com.epmet.dto.IssueShareLinkVisitRecordDTO; import com.epmet.dto.form.*; +import com.epmet.dto.result.UserBaseInfoResultDTO; +import com.epmet.dto.result.UserBasicInfo; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.modules.constant.GroupMemberConstant; import com.epmet.modules.constant.UserMessageConstant; import com.epmet.modules.feign.EpmetUserFeignClient; @@ -48,7 +53,10 @@ import com.epmet.modules.member.entity.ResiGroupMemberEntity; import com.epmet.modules.member.redis.ResiGroupMemberRedis; import com.epmet.modules.member.service.GroupMemeberOperationService; import com.epmet.modules.member.service.ResiGroupMemberService; +import com.epmet.modules.topic.dao.ResiTopicDao; +import com.epmet.modules.topic.entity.TopicShareLinkVisitRecordEntity; import com.epmet.modules.topic.service.ResiTopicService; +import com.epmet.modules.topic.service.TopicShareLinkVisitRecordService; import com.epmet.modules.utils.ModuleConstant; import com.epmet.resi.group.constant.EnterGroupTypeConstant; import com.epmet.resi.group.constant.LeaderFlagConstant; @@ -111,7 +119,6 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl page(Map params) { @@ -215,7 +226,11 @@ public class ResiGroupMemberServiceImpl extends BaseServiceImpl response = issueClient.visitRecord(groupMemeberOperationDTO.getGroupInvitationId(), groupMemeberOperationDTO.getCustomerUserId()); + if(response.success() && null != response){ + if(!response.getData().getIfJoinGroup()){ + logger.error("【{}】该用户入组方式为议题分享链接入组,但并不是通过该链接发起的入群申请,链接Id【{}】",groupMemeberOperationDTO.getCustomerUserId(),groupMemeberOperationDTO.getGroupInvitationId()); + return; + } + if(NumConstant.ZERO == response.getData().getIsInviteRegister()) isNew = true; + inviter = response.getData().getShareUserId(); + }else{ + logger.error("【{}】该用户入组方式为议题分享链接入组,但未查询到链接访问记录,链接Id【{}】",groupMemeberOperationDTO.getCustomerUserId(),groupMemeberOperationDTO.getGroupInvitationId()); + return; + } + } + if(StringUtils.isNotBlank(inviter)){ + //mq的事件类型 + MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); + mqBaseMsgDTO.setEventClass("resi_group"); + //事件code + mqBaseMsgDTO.setEventTag(isNew ? EventEnum.INVITE_NEW_RESIDENT_INTO_GROUP.getEventTag() : EventEnum.INVITE_RESIDENT_INTO_GROUP.getEventTag()); + List pointEventMsgList = new ArrayList<>(); + BasePointEventMsg pointEventMsg = new BasePointEventMsg(); + pointEventMsg.setCustomerId(groupCache.getCustomerId()); + pointEventMsg.setUserId(inviter); + pointEventMsg.setActionFlag(MqConstant.PLUS); + pointEventMsg.setIsCommon(false); + pointEventMsg.setTargetDate(groupMemeberOperationDTO.getCreatedTime()); + pointEventMsg.setEventTag(mqBaseMsgDTO.getEventTag()); + //pointEventMsg.setRemark("通过".concat(StringUtils.equals(groupMemeberOperationDTO.getEnterGroupType(),ModuleConstant.ENTER_GROUP_TYPE_TOPIC_LINK) + //? "话题":"议题").concat("分享链接邀请").concat(isNew ? "新" : "").concat("用户进组")); + List userParam = new LinkedList<>(); + userParam.add(groupMemeberOperationDTO.getCustomerUserId()); + Result> userResponse = userOpenFeignClient.queryUserBaseInfo(userParam); + if(userResponse.success() && !CollectionUtils.isEmpty(userResponse.getData())){ + UserBaseInfoResultDTO user = userResponse.getData().get(NumConstant.ZERO); + pointEventMsg.setRemark( new StringBuilder("邀请") + .append(user.getStreet()).append("-").append(user.getSurname()) + .append(StringUtils.equals(NumConstant.ONE_STR,user.getGender()) ? "先生" : + StringUtils.equals(NumConstant.TWO_STR,user.getGender()) ? "女士" : "先生/女士") + .append("加入") + .append(resiGroupDTO.getGroupName()).append("小组").toString()); + } + + pointEventMsgList.add(pointEventMsg); + + mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); + Result result= SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + if(!result.success()){ + logger.error((isNew ? "拉新用户入组事件发送失败" : "邀请已注册用户入组事件发送失败").concat(",参数:{}"),JSON.toJSONString(agreeApplyFormDTO)); + } + } } /** diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/test/TestController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/test/TestController.java index e68a222f27..c86286bfc5 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/test/TestController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/test/TestController.java @@ -18,4 +18,13 @@ public class TestController { return new Result().ok(requestServerNameAndPort); } + @PostMapping("shutdown") + public Result testShutdown() throws InterruptedException { + for (int i = 1; i <= 10; i++) { + System.out.println(i); + Thread.sleep(1000l); + } + return new Result(); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index 820dbc5821..60b593d88f 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java @@ -1,19 +1,28 @@ package com.epmet.modules.topic.controller; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.result.FirstTopicShiftedToIssueApplicationResultDTO; import com.epmet.modules.topic.service.ResiTopicService; +import com.epmet.resi.group.dto.scanapicallback.VoiceScanCallBackContentFormDTO; import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.TopicInfoDTO; import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.*; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.http.HttpStatus; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; import java.util.List; /** @@ -22,7 +31,7 @@ import java.util.List; * @Author wangc * @date 2020.03.31 13:03 */ - +@Slf4j @RestController @RequestMapping("topic") public class ResiTopicController { @@ -250,7 +259,7 @@ public class ResiTopicController { ValidatorUtils.validateEntity(topicTurnIssueFromDTO); return new Result().ok(topicService.shiftIssueV2(topicTurnIssueFromDTO)); } - + /** * @Description 话题转议题-重新编辑提交 * @param tokenDto @@ -349,5 +358,82 @@ public class ResiTopicController { return new Result().ok(topicService.selectMyPartTopic(myPartIssueFormDTO)); } + /** + * @Description 发送内容更新类的微信订阅 + * @return void + * @Author liushaowen + * @Date 2021/1/12 11:21 + */ + @PostMapping("sendwxmpupdatesubscribe") + public Result sendWxmpUpdateSubscribe(@RequestBody SendWxmpUpdateSubscribeFormDTO fromDTO){ + topicService.sendWxmpUpdateSubscribe(fromDTO.getTokenDto(),fromDTO.getSourceId(),fromDTO.getSourceType()); + return new Result(); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param checksum 字符串格式,由用户uid + seed + content拼成字符串,通过SHA256算法生成。用户UID即阿里云账号ID,可以在阿里云控制台查询。为防篡改,您可以在获取到推送结果时,按上述算法生成字符串,与checksum做一次校验。说明 用户UID必须是阿里云账号的UID,而不是RAM用户的UID。 + * @param content content:JSON字符串格式,请自行解析反转成JSON对象。关于content结果的示例,请参见查询异步检测结果的返回示例。 + * @author yinzuomei + * @description 测试语音异步检测回调方法 + * @Date 2020/12/11 9:07 + **/ + @PostMapping("callBackPublishTopic") + public Result callBackPublishTopic(@RequestParam("checksum") String checksum, @RequestParam("content") String content, HttpServletResponse response){ + // 原因是因为传参的关系,使字符串中保留这"\"线,可以使用String.replaceAll("\\\\","");将所有的"\"线替换为空串 + String contentStr=content.replaceAll("\\\\",""); + List formDTOList=new ArrayList<>(); + if(contentStr.startsWith("[")){ + log.info("入参content为数组:"+ JSON.toJSONString(contentStr,true)); + List list= JSONArray.parseArray(content.replaceAll("\\\\",""), VoiceScanCallBackContentFormDTO.class); + if(!CollectionUtils.isEmpty(list)){ + formDTOList.addAll(list); + } + }else if(contentStr.startsWith("{")){ + VoiceScanCallBackContentFormDTO formDTO= JSON.parseObject(contentStr, VoiceScanCallBackContentFormDTO.class); + log.info("入参content为对象:"+JSON.toJSONString(formDTO,true)); + formDTOList.add(formDTO); + } + formDTOList.forEach(dto->{ + log.info(dto.toString()); + }); + //TODO 判断检测任务结果,执行后续任务 + response.setStatus(HttpStatus.SC_OK); + return new Result<>(); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取话题附件信息 + **/ + @PostMapping(value = "topicattachmentlist") + public Result topicAttachmentList(@RequestBody TopicAttachmentFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, TopicAttachmentFormDTO.TopicForm.class); + return new Result().ok(topicService.topicAttachmentList(formDTO)); + } + + /** + * @Description 根据事件枚举发送积分事件 + * @param param + * @return void + * @author wangc + * @date 2021.01.04 16:41 + */ + @PostMapping("sendevent") + public Result sendEvent(@RequestBody TopicEventFormDTO param){ + ValidatorUtils.validateEntity(param); + topicService.sendTopicPointEventByEventType(param); + return new Result(); + } + + @GetMapping("querytopicinfobyissueid/{issueId}") + public Result queryTopicInfoByIssueId(@PathVariable("issueId") String issueId) { + if (StringUtils.isNotBlank(issueId)) { + return new Result().ok(topicService.queryTopicInfoByIssueId(issueId)); + } + return new Result<>(); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicDraftController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicDraftController.java new file mode 100644 index 0000000000..1c99d983c3 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicDraftController.java @@ -0,0 +1,195 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.modules.topic.excel.TopicDraftExcel; +import com.epmet.modules.topic.service.TopicDraftService; +import com.epmet.resi.group.dto.topic.TopicDraftDTO; +import com.epmet.resi.group.dto.topic.form.*; +import com.epmet.resi.group.dto.topic.result.DraftDetailResultDTO; +import com.epmet.resi.group.dto.topic.result.MyAuditingListResultDTO; +import com.epmet.resi.group.dto.topic.result.TopicAuditResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@RestController +@RequestMapping("topicdraft") +public class TopicDraftController { + + @Autowired + private TopicDraftService topicDraftService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = topicDraftService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + TopicDraftDTO data = topicDraftService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody TopicDraftDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + topicDraftService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody TopicDraftDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + topicDraftService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + topicDraftService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = topicDraftService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, TopicDraftExcel.class); + } + + /** + * 发布话题 + * @author zhaoqifeng + * @date 2020/12/17 15:49 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("createtopic") + public Result createTopic(@LoginUser TokenDto tokenDto, @RequestBody CreateTopicFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + topicDraftService.createTopic(tokenDto, formDTO); + return new Result(); + } + + /** + * 组管理界面-待审核/已驳回列表 + * @author zhaoqifeng + * @date 2020/12/18 14:32 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("auditlist") + public Result> auditList(@RequestBody TopicAuditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + List result = topicDraftService.auditList(formDTO); + return new Result>().ok(result); + } + + /** + * 话题草稿详情 + * @author zhaoqifeng + * @date 2020/12/18 14:55 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("detail") + public Result detail(@RequestBody DraftDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + DraftDetailResultDTO result = topicDraftService.detail(formDTO); + return new Result().ok(result); + } + + /** + * 删除已驳回话题 + * @author zhaoqifeng + * @date 2020/12/18 14:57 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("del") + public Result deleteDraft(@RequestBody DraftDetailFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + topicDraftService.deleteDraft(formDTO); + return new Result(); + } + + /** + * 组长审核 + * @author zhaoqifeng + * @date 2020/12/18 15:06 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("audit") + public Result audit(@LoginUser TokenDto tokenDto, @RequestBody AuditDraftTopicFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + topicDraftService.audit(tokenDto, formDTO); + return new Result(); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 个人中心-我发表的话题-审核中列表 + **/ + @PostMapping(value = "myauditinglist") + public Result> myAuditingList(@LoginUser TokenDto tokenDto, @RequestBody MyAuditingListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, MyAuditingListFormDTO.AuditingTopicForm.class); + formDTO.setUserId(tokenDto.getUserId()); + return new Result>().ok(topicDraftService.myAuditingList(formDTO)); + } + + /** + * 自动审核 + * @author zhaoqifeng + * @date 2020/12/30 10:11 + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("autoAudit") + public Result autoAudit() { + topicDraftService.autoAudit(); + return new Result(); + } +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicShareLinkRecordController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicShareLinkRecordController.java new file mode 100644 index 0000000000..bd138b5583 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicShareLinkRecordController.java @@ -0,0 +1,128 @@ +package com.epmet.modules.topic.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.modules.topic.service.TopicShareLinkRecordService; +import com.epmet.modules.topic.service.TopicShareLinkVisitRecordService; +import com.epmet.resi.group.dto.topic.TopicShareLinkRecordDTO; +import com.epmet.resi.group.dto.topic.form.CreateUrlFormDTO; +import com.epmet.resi.group.dto.topic.form.ShareLinkTypeFormDTO; +import com.epmet.resi.group.dto.topic.form.TopicBelongGroupFormDTO; +import com.epmet.resi.group.dto.topic.form.TopicVisitFormDTO; +import com.epmet.resi.group.dto.topic.result.CreateUrlResultDTO; +import com.epmet.resi.group.dto.topic.result.MemberRelationBetweenGroupAndGridResultDTO; +import com.epmet.resi.group.dto.topic.result.TopicBelongGroupResultDTO; +import com.epmet.resi.group.dto.topic.result.TopicVisitResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 话题分享链接表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +@RestController +@RequestMapping("topicsharelink") +public class TopicShareLinkRecordController { + + @Autowired + private TopicShareLinkRecordService topicShareLinkRecordService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = topicShareLinkRecordService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + TopicShareLinkRecordDTO data = topicShareLinkRecordService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody TopicShareLinkRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + topicShareLinkRecordService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody TopicShareLinkRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + topicShareLinkRecordService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + topicShareLinkRecordService.delete(ids); + return new Result(); + } + + /** + * @Description 分享话题邀请ID + * @Param createUrlFormDTO + * @author zxc + * @date 2020/12/18 上午10:14 + */ + @PostMapping("createurl") + public Result getCreateUrlId(@RequestBody CreateUrlFormDTO createUrlFormDTO, @LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(createUrlFormDTO, CreateUrlFormDTO.CreateUrlForm.class); + return new Result().ok(topicShareLinkRecordService.getCreateUrlId(createUrlFormDTO,tokenDto)); + } + + /** + * @Description 查询话题所属小组 + * @Param formDTO + * @author zxc + * @date 2020/12/18 下午2:08 + */ + @PostMapping("topicbelonggroup") + public Result selectTopicBelongGroup(@RequestBody TopicBelongGroupFormDTO formDTO){ + return new Result().ok(topicShareLinkRecordService.selectTopicBelongGroup(formDTO)); + } + + /** + * @Description 分享话题id获取信息 + * @Param formDTO + * @Param tokenDto + * @author zxc + * @date 2020/12/18 下午3:34 + */ + @PostMapping("visit") + public Result topicVisit(@RequestBody TopicVisitFormDTO formDTO,@LoginUser TokenDto tokenDto){ + ValidatorUtils.validateEntity(formDTO, TopicVisitFormDTO.TopicVisitForm.class); + return new Result().ok(topicShareLinkRecordService.topicVisit(formDTO,tokenDto)); + } + + /** + * @Description 根据链接信息查询被邀请人在组/网格内的状态 + * @param param + * @return com.epmet.resi.group.dto.topic.result.MemberRelationBetweenGroupAndGridResultDTO + * @author wangc + * @date 2020.12.29 15:01 + */ + @PostMapping("getstatus") + public Result getStatus(@LoginUser TokenDto token, @RequestBody ShareLinkTypeFormDTO param){ + param.setUserId(token.getUserId()); + ValidatorUtils.validateEntity(param); + return new Result().ok(topicShareLinkRecordService.getStatusByLinkAndInvitee(param)); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicShareLinkVisitRecordController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicShareLinkVisitRecordController.java new file mode 100644 index 0000000000..cf134cfea6 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicShareLinkVisitRecordController.java @@ -0,0 +1,83 @@ +package com.epmet.modules.topic.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.modules.topic.service.TopicShareLinkVisitRecordService; +import com.epmet.resi.group.dto.topic.TopicShareLinkVisitRecordDTO; +import com.epmet.resi.group.dto.topic.form.SharableTopicAndInviteeFormDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 话题分享链接访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +@RestController +@RequestMapping("topicsharelinkvisitrecord") +public class TopicShareLinkVisitRecordController { + + @Autowired + private TopicShareLinkVisitRecordService topicShareLinkVisitRecordService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = topicShareLinkVisitRecordService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + TopicShareLinkVisitRecordDTO data = topicShareLinkVisitRecordService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody TopicShareLinkVisitRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + topicShareLinkVisitRecordService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody TopicShareLinkVisitRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + topicShareLinkVisitRecordService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + topicShareLinkVisitRecordService.delete(ids); + return new Result(); + } + + /** + * @Description 检查邀请关系,如果确实存在邀请关系则返回邀请人Id + * 符合条件: + * ① 链接Id对应 + * ② 邀请人Id对应 + * ③ 邀请人在被邀请时的状态为陌生人 + * @param param + * @return com.epmet.commons.tools.utils.Result + * @author wangc + * @date 2020.12.18 14:53 + */ + @PostMapping("checkinviterelationship") + public Result checkInviteRelationship(@RequestBody SharableTopicAndInviteeFormDTO param){ + return new Result().ok(topicShareLinkVisitRecordService.checkInviteRelationship(param)); + } +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicAttachmentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicAttachmentDao.java index c58c7e59db..ae67648e60 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicAttachmentDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicAttachmentDao.java @@ -20,7 +20,9 @@ package com.epmet.modules.topic.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.topic.entity.ResiTopicAttachmentEntity; +import com.epmet.resi.group.dto.topic.ResiTopicAttachmentDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -51,4 +53,10 @@ public interface ResiTopicAttachmentDao extends BaseDao selectTopicAttachmentList(@Param("topicId") String topicId); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentDao.java index fd96ebed32..57ef0adc97 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicCommentDao.java @@ -22,7 +22,6 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.comment.entity.ResiTopicCommentEntity; import com.epmet.resi.group.dto.comment.form.ResiQueryCommentFormDTO; import com.epmet.resi.group.dto.comment.result.ResiCommentResultDTO; -import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -60,4 +59,12 @@ public interface ResiTopicCommentDao extends BaseDao { * @author sun */ List selectTopicList(@Param("userId") String userId); + + /** + * @Description 根据userId查询此人今日评论次数 + * @Param userId + * @author zxc + * @date 2020/12/23 上午11:09 + */ + Integer selectCommentCountByUserId(@Param("userId") String userId); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java index 6590732567..ebbab2046a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java @@ -193,4 +193,23 @@ public interface ResiTopicDao extends BaseDao { */ List selectTopicIdsByGroup(@Param("groupId") String groupId); + String selectGroupIdByIssueId(@Param("issueId") String issueId); + + /** + * @Description 查询此人今日发表话题数量 + * @Param userId + * @author zxc + * @date 2020/12/23 上午10:02 + */ + Integer selectPublishTopicCountByUserId(@Param("userId")String userId); + + /** + * @Description 根据topicId查询客户ID + * @Param topicId + * @author zxc + * @date 2020/12/23 下午2:25 + */ + String selectCustomerIdByTopicId(@Param("topicId")String topicId); + + ResiTopicDTO selectByIssueId(@Param("issueId") String issueId); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftAttachmentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftAttachmentDao.java new file mode 100644 index 0000000000..2cf15e3aff --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftAttachmentDao.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.TopicDraftAttachmentEntity; +import com.epmet.resi.group.dto.topic.TopicDraftAttachmentDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 话题草稿附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Mapper +public interface TopicDraftAttachmentDao extends BaseDao { + /** + * 获取附件列表 + * @author zhaoqifeng + * @date 2020/12/18 16:44 + * @param topicDraftId + * @param type + * @return java.util.List + */ + List selectFileList(@Param("topicDraftId") String topicDraftId, @Param("type") String type); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftDao.java new file mode 100644 index 0000000000..099a93ffe7 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftDao.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.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.TopicDraftEntity; +import com.epmet.resi.group.dto.topic.TopicDraftDTO; +import com.epmet.resi.group.dto.topic.result.DraftDetailResultDTO; +import com.epmet.resi.group.dto.topic.result.TopicAuditResultDTO; +import com.epmet.resi.group.dto.topic.form.MyAuditingListFormDTO; +import com.epmet.resi.group.dto.topic.result.MyAuditingListResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +import java.util.List; + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Mapper +public interface TopicDraftDao extends BaseDao { + /** + * 获取小组待审核/已驳回列表 + * @author zhaoqifeng + * @date 2020/12/18 15:47 + * @param groupId + * @param status + * @return com.epmet.resi.group.dto.topic.TopicDraftDTO + */ + List selectTopicDraftByGroup(@Param("groupId") String groupId, @Param("status") String status); + + /** + * 话题草稿详情 + * @author zhaoqifeng + * @date 2020/12/18 16:19 + * @param topicDraftId + * @return com.epmet.resi.group.dto.topic.result.DraftDetailResultDTO + */ + DraftDetailResultDTO selectTopicDraftDetail(@Param("topicDraftId") String topicDraftId); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 个人中心-我发表的话题-审核中列表 + **/ + List selectAuditingList(MyAuditingListFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftOperationDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftOperationDao.java new file mode 100644 index 0000000000..83350cea13 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftOperationDao.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.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.TopicDraftOperationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题草稿操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Mapper +public interface TopicDraftOperationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftScanTaskDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftScanTaskDao.java new file mode 100644 index 0000000000..ea0029cb1b --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftScanTaskDao.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.TopicDraftScanTaskEntity; +import com.epmet.resi.group.dto.topic.TopicDraftScanTaskDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 话题附件检测任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +@Mapper +public interface TopicDraftScanTaskDao extends BaseDao { + + void updateByTask(TopicDraftScanTaskEntity entity); + + /** + * 获取检测任务信息 + * @author zhaoqifeng + * @date 2020/12/29 14:30 + * @param taskId + * @return com.epmet.resi.group.dto.topic.TopicDraftScanTaskDTO + */ + TopicDraftScanTaskDTO selectScanByTask(@Param("taskId") String taskId); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicShareLinkRecordDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicShareLinkRecordDao.java new file mode 100644 index 0000000000..1f3a2ea96e --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicShareLinkRecordDao.java @@ -0,0 +1,35 @@ +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.TopicShareLinkRecordEntity; +import com.epmet.resi.group.dto.topic.result.TopicVisitResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 话题分享链接表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +@Mapper +public interface TopicShareLinkRecordDao extends BaseDao { + + /** + * @Description 根据话题ID查询对应信息 + * @Param topicId + * @author zxc + * @date 2020/12/18 上午10:28 + */ + TopicVisitResultDTO selectTopicInfoById(@Param("topicId") String topicId); + + /** + * @Description 校验此人此话题是否存在邀请记录 + * @Param topicId + * @Param userId + * @author zxc + * @date 2020/12/18 上午11:10 + */ + String checkRecord(@Param("topicId") String topicId,@Param("userId") String userId); + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicShareLinkVisitRecordDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicShareLinkVisitRecordDao.java new file mode 100644 index 0000000000..a59d4427a0 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicShareLinkVisitRecordDao.java @@ -0,0 +1,46 @@ +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.TopicShareLinkVisitRecordEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 话题分享链接访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +@Mapper +public interface TopicShareLinkVisitRecordDao extends BaseDao { + + /** + * @Description 根据邀请Id和邀请人Id查询邀请人的Id + * @param linkId + * @param invitee + * @return String + * @author wangc + * @date 2020.12.18 14:00 + */ + String selectByLinkIdAndInvitee(@Param("linkId") String linkId, @Param("invitee") String invitee); + + /** + * @Description 根据邀请Id和邀请人Id查询邀请人的Id + * @param linkId + * @param invitee + * @return String + * @author wangc + * @date 2020.12.18 14:00 + */ + TopicShareLinkVisitRecordEntity selectRecordByLinkIdAndInvitee(@Param("linkId") String linkId, @Param("invitee") String invitee); + + /** + * @Description 修改是否通过链接注册居民由0改为1 + * @param linkId + * @param invitee + * @return int + * @author wangc + * @date 2020.12.18 15:46 + */ + int updateInviteRegister(@Param("linkId") String linkId, @Param("invitee") String invitee); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicAttachmentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicAttachmentEntity.java index 16138229bf..6b63177921 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicAttachmentEntity.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicAttachmentEntity.java @@ -54,7 +54,7 @@ public class ResiTopicAttachmentEntity extends BaseEpmetEntity { private String attachmentFormat; /** - * 附件类型((图片 - figure、 视频 - video、 语音 - voice、 文档 - doc)) + * 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) */ private String attachmentType; @@ -68,4 +68,9 @@ public class ResiTopicAttachmentEntity extends BaseEpmetEntity { * */ private Integer sort; + /** + * 语音或视频时长,秒 + * */ + private Integer duration; + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftAttachmentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftAttachmentEntity.java new file mode 100644 index 0000000000..343e362ec4 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftAttachmentEntity.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.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题草稿附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("topic_draft_attachment") +public class TopicDraftAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 话题草稿id + */ + private String topicDraftId; + + /** + * 客户id + */ + private String customerId; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址url + */ + private String attachmentUrl; + + /** + * 排序字段(按附件类型分组排序) + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; + auto_passed: 自动通过; + review:结果不确定,需要人工审核; + block: 结果违规; + rejected:人工审核驳回; + approved:人工审核通过) + 现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + private String reason; + + /** + * 语音或视频时长,秒 + * */ + private Integer duration; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftEntity.java new file mode 100644 index 0000000000..513e03c4cf --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftEntity.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.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("topic_draft") +public class TopicDraftEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组Id + */ + private String groupId; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 话题草稿状态(审核中:auditing; + auto_passed: 自动通过; + review:结果不确定,需要人工审核; + block: 结果违规; + rejected:人工审核驳回; + approved:人工审核通过) + */ + private String draftStatus; + + /** + * 草稿审核理由 + */ + private String draftReason; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String area; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String dimension; + + /** + * 发布成功后的话题id + */ + private String topicId; + + /** + * 创建者是否可见(0是 1否) + */ + private String isSee; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftOperationEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftOperationEntity.java new file mode 100644 index 0000000000..e1092bbaf5 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftOperationEntity.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.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题草稿操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("topic_draft_operation") +public class TopicDraftOperationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 话题草稿id + */ + private String topicDraftId; + + /** + * 操作类型:submit:提交发布; + auto_passed: 自动审核-通过; + review:自动审核-结果不确定,需要人工审核; + block: 自动审核-结果违规; + rejected:人工审核驳回; + approved:人工审核通过 + */ + private String operateType; + + /** + * 操作时的备注,比如驳回理由 + */ + private String remark; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftScanTaskEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftScanTaskEntity.java new file mode 100644 index 0000000000..9e0cdbbaea --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftScanTaskEntity.java @@ -0,0 +1,74 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题附件检测任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("topic_draft_scan_task") +public class TopicDraftScanTaskEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 话题草稿Id + */ + private String topicDraftId; + + /** + * 话题草稿附件表Id,对应dataId + */ + private String topicDraftAttachmentId; + + /** + * 阿里云审核任务Id + */ + private String taskId; + + /** + * 审核状态【auditing: 审核中; +auto_passed: 自动通过; +review:结果不确定,需要人工审核; +block: 结果违规;】 + */ + private String status; + + /** + * 附件类型(视频 - video、 语音 - voice) + */ + private String attachmentType; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicShareLinkRecordEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicShareLinkRecordEntity.java new file mode 100644 index 0000000000..e7dd0448c4 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicShareLinkRecordEntity.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.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 话题分享链接表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("topic_share_link_record") +public class TopicShareLinkRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题所属网格ID + */ + private String gridId; + + /** + * 小组ID + */ + private String groupId; + + /** + * 话题ID + */ + private String topicId; + + /** + * 分享人ID(当前登录用户) + */ + private String shareUserId; + + /** + * 邀请内容 + */ + private String inviteContent; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicShareLinkVisitRecordEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicShareLinkVisitRecordEntity.java new file mode 100644 index 0000000000..44edb3624a --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicShareLinkVisitRecordEntity.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.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题分享链接访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("topic_share_link_visit_record") +public class TopicShareLinkVisitRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 分享人【邀请人】ID + */ + private String shareUserId; + + /** + * 被邀请人ID + */ + private String inviteeUserId; + + /** + * 话题分享链接表id + */ + private String shareLinkRecId; + + /** + * 是否邀请注册:0:是,1:不是 + */ + private Integer isInviteRegister; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftAttachmentExcel.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftAttachmentExcel.java new file mode 100644 index 0000000000..f16f960fb4 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftAttachmentExcel.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.modules.topic.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 话题草稿附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +public class TopicDraftAttachmentExcel { + + @Excel(name = "附件id") + private String id; + + @Excel(name = "话题草稿id") + private String topicDraftId; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "附件名(uuid随机生成)") + private String attachmentName; + + @Excel(name = "文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)") + private String attachmentFormat; + + @Excel(name = "附件类型((图片 - image、视频 - video、 语音 - voice、 文档 - doc))") + private String attachmentType; + + @Excel(name = "附件地址url") + private String attachmentUrl; + + @Excel(name = "排序字段(按附件类型分组排序)") + private Integer sort; + + @Excel(name = "附件状态(审核中:auditing;auto_passed: 自动通过;review:结果不确定,需要人工审核;"+ +"block: 结果违规;rejected:人工审核驳回;approved:人工审核通过)现在图片是同步审核的,所以图片只有auto_passed一种状态") + private String status; + + @Excel(name = "语音或视频时长,秒") + private Integer duration; + + @Excel(name = "删除标记 0:未删除,1:已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftExcel.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftExcel.java new file mode 100644 index 0000000000..2a7d97c8b9 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftExcel.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.modules.topic.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +public class TopicDraftExcel { + + @Excel(name = "话题草稿id") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "小组Id") + private String groupId; + + @Excel(name = "话题内容") + private String topicContent; + + @Excel(name = "话题草稿状态(审核中:auditing; auto_passed: 自动通过;review:结果不确定,需要人工审核;"+ +"block: 结果违规;rejected:人工审核驳回;approved:人工审核通过)") + private String draftStatus; + + @Excel(name = "草稿审核理由") + private String draftReason; + + @Excel(name = "省") + private String province; + + @Excel(name = "市") + private String city; + + @Excel(name = "区 ") + private String area; + + @Excel(name = "地址") + private String address; + + @Excel(name = "经度") + private String longitude; + + @Excel(name = "维度") + private String dimension; + + @Excel(name = "发布成功后的话题id") + private String topicId; + + @Excel(name = "创建者是否可见(0是 1否)") + private String isSee; + + @Excel(name = "删除标记 0:未删除,1:已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "话题发布人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftOperationExcel.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftOperationExcel.java new file mode 100644 index 0000000000..428b9c4140 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftOperationExcel.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.modules.topic.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 话题草稿操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +public class TopicDraftOperationExcel { + + @Excel(name = "话题草稿操作日志id") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "话题草稿id") + private String topicDraftId; + + @Excel(name = "操作类型:submit:提交发布; auto_passed: 自动审核-通过;review:自动审核-结果不确定,需要人工审核;"+ +"block: 自动审核-结果违规;rejected:人工审核驳回;approved:人工审核通过") + private String operateType; + + @Excel(name = "操作时的备注,比如驳回理由") + private String remark; + + @Excel(name = "删除标记 0:未删除,1:已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "操作人,API审核结果,存储为SCAN_USER或者APP_USER") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java index 53140e4fef..20f234d9aa 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java @@ -258,7 +258,7 @@ public interface ResiTopicService extends BaseService { * @date 2020.11.20 10:26 */ FirstTopicShiftedToIssueApplicationResultDTO shiftIssueV2(ResiTopicTurnIssueFromDTO param); - + /** * @Description 工作端审核议题通过时获取一些议题相关信息 * @param param @@ -267,7 +267,7 @@ public interface ResiTopicService extends BaseService { * @date 2020.11.20 18:09 */ IssueShiftedFromTopicFormDTO getIssueInfoWhenAudit(ResiTopicTurnIssueFromDTO param); - + /** * @Description 政府端查看议题详情时的话题相关信息 * @param govTopicIssueInfoFormDTO @@ -324,4 +324,32 @@ public interface ResiTopicService extends BaseService { */ List getTopicIdsByGroup(String groupId); -} \ No newline at end of file + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取话题附件信息 + **/ + TopicAttachmentResultDTO topicAttachmentList(TopicAttachmentFormDTO formDTO); + /** + * @Description 向关注话题的人发送微信订阅 + * @param tokenDto + * @param id + * @param type 订阅类型 comment / shiftIssue + * @return void + * @Author liushaowen + * @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); + + ResiTopicDTO queryTopicInfoByIssueId(String issueId); +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftAttachmentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftAttachmentService.java new file mode 100644 index 0000000000..193ee4ee09 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftAttachmentService.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.modules.topic.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.topic.entity.TopicDraftAttachmentEntity; +import com.epmet.resi.group.dto.topic.TopicDraftAttachmentDTO; + +import java.util.List; +import java.util.Map; + +/** + * 话题草稿附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +public interface TopicDraftAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TopicDraftAttachmentDTO + * @author generator + * @date 2020-12-17 + */ + TopicDraftAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-17 + */ + void save(TopicDraftAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-17 + */ + void update(TopicDraftAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-17 + */ + void delete(String[] ids); + + /** + * 获取附件列表 + * @author zhaoqifeng + * @date 2020/12/18 16:42 + * @param topicDraftId + * @param type + * @return java.util.List + */ + List getFileList(String topicDraftId, String type); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftOperationService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftOperationService.java new file mode 100644 index 0000000000..f118236a8d --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftOperationService.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.modules.topic.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.topic.entity.TopicDraftOperationEntity; +import com.epmet.resi.group.dto.topic.TopicDraftOperationDTO; + +import java.util.List; +import java.util.Map; + +/** + * 话题草稿操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +public interface TopicDraftOperationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TopicDraftOperationDTO + * @author generator + * @date 2020-12-17 + */ + TopicDraftOperationDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-17 + */ + void save(TopicDraftOperationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-17 + */ + void update(TopicDraftOperationDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftScanTaskService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftScanTaskService.java new file mode 100644 index 0000000000..003b716a97 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftScanTaskService.java @@ -0,0 +1,109 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.topic.entity.TopicDraftScanTaskEntity; +import com.epmet.resi.group.dto.topic.TopicDraftScanTaskDTO; + +import java.util.List; +import java.util.Map; + +/** + * 话题附件检测任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +public interface TopicDraftScanTaskService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TopicDraftScanTaskDTO + * @author generator + * @date 2020-12-18 + */ + TopicDraftScanTaskDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-18 + */ + void save(TopicDraftScanTaskDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-18 + */ + void update(TopicDraftScanTaskDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-18 + */ + void delete(String[] ids); + + void updateByTask(TopicDraftScanTaskDTO dto); + + TopicDraftScanTaskDTO getScanByTask(String taskId); + + /** + * 获取审核中的数据 + * @author zhaoqifeng + * @date 2020/12/29 17:57 + * @param draftId + * @param status + * @return java.util.List + */ + List getScanTaskList(String draftId, String status); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftService.java new file mode 100644 index 0000000000..b6646cf19c --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftService.java @@ -0,0 +1,165 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.modules.topic.entity.TopicDraftEntity; +import com.epmet.resi.group.dto.topic.TopicDraftDTO; +import com.epmet.resi.group.dto.topic.form.*; +import com.epmet.resi.group.dto.topic.result.DraftDetailResultDTO; +import com.epmet.resi.group.dto.topic.result.MyAuditingTopicResultDTO; +import com.epmet.resi.group.dto.topic.result.TopicAuditResultDTO; +import com.epmet.resi.group.dto.topic.form.MyAuditingListFormDTO; +import com.epmet.resi.group.dto.topic.result.MyAuditingListResultDTO; + +import java.util.List; +import java.util.Map; + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +public interface TopicDraftService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TopicDraftDTO + * @author generator + * @date 2020-12-17 + */ + TopicDraftDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-17 + */ + void save(TopicDraftDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-17 + */ + void update(TopicDraftDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-17 + */ + void delete(String[] ids); + + /** + * 发布话题 + * @author zhaoqifeng + * @date 2020/12/17 15:49 + * @param tokenDto + * @param formDTO + * @return void + */ + void createTopic(TokenDto tokenDto, CreateTopicFormDTO formDTO); + + /** + * 组管理界面-待审核/已驳回列表 + * @author zhaoqifeng + * @date 2020/12/18 14:34 + * @param formDTO + * @return java.util.List + */ + List auditList(TopicAuditFormDTO formDTO); + + /** + * 话题草稿详情 + * @author zhaoqifeng + * @date 2020/12/18 14:55 + * @param formDTO + * @return com.epmet.resi.group.dto.topic.result.DraftDetailResultDTO + */ + DraftDetailResultDTO detail(DraftDetailFormDTO formDTO); + + /** + * 删除已驳回话题 + * @author zhaoqifeng + * @date 2020/12/18 14:58 + * @param formDTO + * @return void + */ + void deleteDraft(DraftDetailFormDTO formDTO); + + /** + * 组长审核 + * @author zhaoqifeng + * @date 2020/12/18 15:06 + * @param formDTO + * @return void + */ + void audit(TokenDto tokenDto, AuditDraftTopicFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 个人中心-我发表的话题-审核中列表 + **/ + List myAuditingList(MyAuditingListFormDTO formDTO); + + /** + * 自动审核 + * @author zhaoqifeng + * @date 2020/12/29 17:51 + * @param + * @return void + */ + void autoAudit(); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicShareLinkRecordService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicShareLinkRecordService.java new file mode 100644 index 0000000000..ec3bd6000d --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicShareLinkRecordService.java @@ -0,0 +1,121 @@ +package com.epmet.modules.topic.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.modules.topic.entity.TopicShareLinkRecordEntity; +import com.epmet.resi.group.dto.topic.TopicShareLinkRecordDTO; +import com.epmet.resi.group.dto.topic.form.CreateUrlFormDTO; +import com.epmet.resi.group.dto.topic.form.ShareLinkTypeFormDTO; +import com.epmet.resi.group.dto.topic.form.TopicBelongGroupFormDTO; +import com.epmet.resi.group.dto.topic.form.TopicVisitFormDTO; +import com.epmet.resi.group.dto.topic.result.CreateUrlResultDTO; +import com.epmet.resi.group.dto.topic.result.MemberRelationBetweenGroupAndGridResultDTO; +import com.epmet.resi.group.dto.topic.result.TopicBelongGroupResultDTO; +import com.epmet.resi.group.dto.topic.result.TopicVisitResultDTO; + +import java.util.List; +import java.util.Map; + +/** + * 话题分享链接表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +public interface TopicShareLinkRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TopicShareLinkRecordDTO + * @author generator + * @date 2020-12-18 + */ + TopicShareLinkRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-18 + */ + void save(TopicShareLinkRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-18 + */ + void update(TopicShareLinkRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-18 + */ + void delete(String[] ids); + + /** + * @Description 分享话题邀请ID + * @Param createUrlFormDTO + * @author zxc + * @date 2020/12/18 上午10:14 + */ + CreateUrlResultDTO getCreateUrlId(CreateUrlFormDTO createUrlFormDTO, TokenDto tokenDto); + + /** + * @Description 查询话题所属小组 + * @Param formDTO + * @author zxc + * @date 2020/12/18 下午2:08 + */ + TopicBelongGroupResultDTO selectTopicBelongGroup(TopicBelongGroupFormDTO formDTO); + + /** + * @Description 分享话题id获取信息 + * @Param formDTO + * @Param tokenDto + * @author zxc + * @date 2020/12/18 下午3:34 + */ + TopicVisitResultDTO topicVisit(TopicVisitFormDTO formDTO,TokenDto tokenDto); + + /** + * @Description 根据链接信息查询被邀请人在组/网格内的状态 + * @param param + * @return com.epmet.resi.group.dto.topic.result.MemberRelationBetweenGroupAndGridResultDTO + * @author wangc + * @date 2020.12.29 15:01 + */ + MemberRelationBetweenGroupAndGridResultDTO getStatusByLinkAndInvitee(ShareLinkTypeFormDTO param); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicShareLinkVisitRecordService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicShareLinkVisitRecordService.java new file mode 100644 index 0000000000..d8f2192c41 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicShareLinkVisitRecordService.java @@ -0,0 +1,100 @@ +package com.epmet.modules.topic.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.topic.entity.TopicShareLinkVisitRecordEntity; +import com.epmet.resi.group.dto.topic.TopicShareLinkVisitRecordDTO; +import com.epmet.resi.group.dto.topic.form.SharableTopicAndInviteeFormDTO; +import com.epmet.resi.group.dto.topic.form.ShareLinkTypeFormDTO; +import com.epmet.resi.group.dto.topic.result.MemberRelationBetweenGroupAndGridResultDTO; + +import java.util.List; +import java.util.Map; + +/** + * 话题分享链接访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +public interface TopicShareLinkVisitRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TopicShareLinkVisitRecordDTO + * @author generator + * @date 2020-12-18 + */ + TopicShareLinkVisitRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-18 + */ + void save(TopicShareLinkVisitRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-18 + */ + void update(TopicShareLinkVisitRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-18 + */ + void delete(String[] ids); + + /** + * @Description 校验邀请人与被邀请人是否存在邀请关系,如果存在则返回邀请人Id,否则返回空 + * @param param + * @return java.lang.String + * @author wangc + * @date 2020.12.18 13:56 + */ + String checkInviteRelationship(SharableTopicAndInviteeFormDTO param); + + /** + * @Description 通过邀请链接Id和被邀请人Id查询出访问记录 + * @param linkId + * @param invitee + * @return com.epmet.modules.topic.entity.TopicShareLinkVisitRecordEntity + * @author wangc + * @date 2020.12.22 09:20 + */ + TopicShareLinkVisitRecordEntity getByLinkIdAndInvitee(String linkId,String invitee); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/.gitkeep b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java index a4e0365d2a..ed76255ad1 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicCommentServiceImpl.java @@ -17,28 +17,34 @@ package com.epmet.modules.topic.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.MqConstant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; +import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; +import com.epmet.commons.tools.enums.EventEnum; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; -import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; - import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; +import com.epmet.commons.tools.utils.SendMqMsgUtils; import com.epmet.dto.form.UserResiInfoListFormDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.modules.comment.entity.ResiTopicCommentEntity; import com.epmet.modules.constant.ResiGroupRedisKeys; +import com.epmet.modules.constant.WxmpSubscribeConstant; import com.epmet.modules.feign.EpmetUserFeignClient; +import com.epmet.modules.group.redis.ResiGroupRedis; import com.epmet.modules.member.dao.ResiGroupMemberDao; import com.epmet.modules.member.redis.ResiGroupMemberRedis; import com.epmet.modules.member.service.ResiGroupMemberService; @@ -58,8 +64,8 @@ import com.epmet.resi.group.dto.topic.ResiTopicCommentDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.ResiPublishCommentFormDTO; import com.epmet.resi.group.dto.topic.result.IssueGridResultDTO; -import com.epmet.resi.group.dto.topic.result.ResiTopicInfoResultDTO; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; +import com.google.common.base.CharMatcher; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; @@ -94,6 +100,9 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl NumConstant.FIFTEEN){ + //mq的事件类型 + MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); + mqBaseMsgDTO.setEventClass(EventEnum.PARTICIPATE_ONE_TOPIC.getEventClass()); + //事件code + mqBaseMsgDTO.setEventTag(EventEnum.PARTICIPATE_ONE_TOPIC.getEventTag()); + List pointEventMsgList = new ArrayList<>(); + BasePointEventMsg pointEventMsg = new BasePointEventMsg(); + String customerId = resiTopicdDao.selectCustomerIdByTopicId(resiCommentFormDTO.getTopicId()); + if (StringUtils.isBlank(customerId)){ + throw new RenException(TopicConstant.GET_CUSTOMER_ID_FAILURE); + } + pointEventMsg.setCustomerId(customerId); + pointEventMsg.setUserId(tokenDto.getUserId()); + // 加分 + pointEventMsg.setActionFlag(MqConstant.PLUS); + pointEventMsg.setIsCommon(false); + pointEventMsg.setEventTag(mqBaseMsgDTO.getEventTag()); + //某某小组中评论话题“某某某…” + StringBuilder builder = new StringBuilder(groupRedis.get(topic.getGroupId()).getGroupName()).append("小组中评论"); + String content = CharMatcher.WHITESPACE.trimFrom(topic.getTopicContent()); + if(StringUtils.isNotBlank(content)){ + builder.append("话题"); + builder.append("\""); + builder.append( + content.length() > NumConstant.TEN ? + (content.substring(NumConstant.ZERO,NumConstant.TEN) + "…") : + content); + builder.append("\""); + }else builder.append("语音话题"); + + pointEventMsg.setRemark(builder.toString()); + pointEventMsgList.add(pointEventMsg); + + mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); + Result msgResult= SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + if(!msgResult.success()){ + logger.error(TopicConstant.COMMENT_TOPIC_FAILURE); + } + } + } + //对所有关注这个话题的人发送微信订阅 + resiTopicService.sendWxmpUpdateSubscribe(tokenDto,topic.getId(), WxmpSubscribeConstant.TYPE_COMMENT); return new Result(); } @@ -369,4 +424,4 @@ public class ResiTopicCommentServiceImpl extends BaseServiceImpl pointEventMsgList = new ArrayList<>(); + BasePointEventMsg pointEventMsg = new BasePointEventMsg(); + ResiGroupInfoRedisDTO resiGroupInfoRedisDTO = resiGroupRedis.get(resiTopicPublishFormDTO.getGroupId()); + if (null == resiGroupInfoRedisDTO){ + ResiGroupEntity resiGroupEntity = resiGroupDao.selectById(resiTopicPublishFormDTO.getGroupId()); + if (null == resiGroupEntity){ + throw new RenException(TopicConstant.GROUP_INFO_FAILURE); + } + pointEventMsg.setCustomerId(resiGroupInfoRedisDTO.getCustomerId()); + } + pointEventMsg.setUserId(tokenDto.getUserId()); + // 加分 + pointEventMsg.setActionFlag(MqConstant.PLUS); + pointEventMsg.setIsCommon(false); + pointEventMsg.setEventTag(mqBaseMsgDTO.getEventTag()); + pointEventMsgList.add(pointEventMsg); + + mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); + Result msgResult= SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + if(!msgResult.success()){ + logger.error(TopicConstant.CREATE_TOPIC_FAILURE); + } + } return new Result(); } @@ -664,6 +711,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); wrapper.eq(TopicConstant.TOPIC_ID,topicId); + wrapper.eq(TopicConstant.FIELD_TOPIC_ATTACHMENT_TYPE,"image"); wrapper.orderByAsc(TopicConstant.SORT); List attachments = resiTopicAttachmentDao.selectList(wrapper); List attachmentUrls = new ArrayList<>(); @@ -1214,6 +1262,7 @@ public class ResiTopicServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); wrapper.eq(FieldConstant.DEL_FLAG,NumConstant.ZERO_STR); wrapper.eq(TopicConstant.TOPIC_ID,formDTO.getTopicId()); + wrapper.eq(TopicConstant.FIELD_TOPIC_ATTACHMENT_TYPE,"image"); wrapper.orderByAsc(TopicConstant.SORT); List attachments = resiTopicAttachmentDao.selectList(wrapper); if (attachments.size() != NumConstant.ZERO){ @@ -1230,9 +1279,11 @@ public class ResiTopicServiceImpl extends BaseServiceImpl pointEventMsgList = new ArrayList<>(); + //1.话题被转为议题 组内成员 + + BasePointEventMsg pointEventMsg = new BasePointEventMsg(); + pointEventMsg.setCustomerId(groupCache.getCustomerId()); + pointEventMsg.setUserId(group.getTopicAuthorId()); + pointEventMsg.setActionFlag(MqConstant.PLUS); + pointEventMsg.setIsCommon(false); + pointEventMsg.setEventTag(EventEnum.TOPIC_SHIFTED_TO_ISSUE.getEventTag()); + //某某小组中发布的话题“某某某…” (前十个字后面省略号) 被转为议题 + String content = CharMatcher.WHITESPACE.trimFrom(topic.getTopicContent()); + pointEventMsg.setRemark(new StringBuilder(groupCache.getGroupName()).append("小组中发布的") + .append( + StringUtils.isBlank(content) + || StringUtils.equals("语音话题",content)? "语音话题" : + "话题\"" + + content + .substring(NumConstant.ZERO,content.length() < NumConstant.TEN ? content.length() : NumConstant.TEN) + + (NumConstant.TEN > content.length() ? "\"" : "…\"") + ).append("被转为议题").toString()); + pointEventMsgList.add(pointEventMsg); + + //2.转话题为议题 组长 + BasePointEventMsg pointEventMsg2 = new BasePointEventMsg(); + pointEventMsg2.setCustomerId(groupCache.getCustomerId()); + pointEventMsg2.setUserId(topicTurnIssueFromDTO.getUserId()); + pointEventMsg2.setActionFlag(MqConstant.PLUS); + pointEventMsg2.setIsCommon(false); + pointEventMsg2.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag()); + //将话题“某某某…” (前十个字后面省略号) 转为议题 + pointEventMsg2.setRemark(new StringBuilder("将") + .append( + new StringBuilder(new StringBuilder(pointEventMsg.getRemark().replaceFirst(new StringBuilder(groupCache.getGroupName()).append("小组中发布的").toString(),"")) + .reverse().toString() + .replaceFirst("题议为转被","")).reverse() + ).append("转为议题").toString()); + pointEventMsgList.add(pointEventMsg2); + + mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); + if(!SendMqMsgUtils.sendMsg(mqBaseMsgDTO).success()){ + log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(topicTurnIssueFromDTO)); + } } else { ValidatorUtils.validateEntity(result, FirstTopicShiftedToIssueApplicationResultDTO.AllowAuditionGroup.class); @@ -1625,10 +1728,61 @@ public class ResiTopicServiceImpl extends BaseServiceImpl pointEventMsgList = new ArrayList<>(); + //1.话题被转为议题 组内成员 + + BasePointEventMsg pointEventMsg = new BasePointEventMsg(); + pointEventMsg.setCustomerId(groupCache.getCustomerId()); + pointEventMsg.setUserId(group.getTopicAuthorId()); + pointEventMsg.setActionFlag(MqConstant.PLUS); + pointEventMsg.setIsCommon(false); + pointEventMsg.setEventTag(EventEnum.TOPIC_SHIFTED_TO_ISSUE.getEventTag()); + //某某小组中发布的话题“某某某…” (前十个字后面省略号) 被转为议题 + String content = CharMatcher.WHITESPACE.trimFrom(topic.getTopicContent()); + pointEventMsg.setRemark(new StringBuilder(groupCache.getGroupName()).append("小组中发布的") + .append( + StringUtils.isBlank(content) + || StringUtils.equals("语音话题",content)? "语音话题" : + "话题\"" + + content + .substring(NumConstant.ZERO,content.length() < NumConstant.TEN ? content.length() : NumConstant.TEN) + + (NumConstant.TEN > content.length() ? "\"" : "…\"") + ).append("被转为议题").toString()); + pointEventMsgList.add(pointEventMsg); + + //2.转话题为议题 组长 + BasePointEventMsg pointEventMsg2 = new BasePointEventMsg(); + pointEventMsg2.setCustomerId(groupCache.getCustomerId()); + pointEventMsg2.setUserId(param.getUserId()); + pointEventMsg2.setActionFlag(MqConstant.PLUS); + pointEventMsg2.setIsCommon(false); + pointEventMsg2.setEventTag(EventEnum.SHIFT_TOPIC_TO_ISSUE.getEventTag()); + //将话题“某某某…” (前十个字后面省略号) 转为议题 + pointEventMsg2.setRemark(new StringBuilder("将") + .append( + new StringBuilder(new StringBuilder(pointEventMsg.getRemark().replaceFirst(new StringBuilder(groupCache.getGroupName()).append("小组中发布的").toString(),"")).reverse() + .toString().replaceFirst("题议为转被","")).reverse() + ).append("转为议题").toString()); + pointEventMsgList.add(pointEventMsg2); + + mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); + if(!SendMqMsgUtils.sendMsg(mqBaseMsgDTO).success()){ + log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(param)); + } } return issueInfo; } - /** * @Description 政府端查看议题详情时的话题相关信息 * @param govTopicIssueInfoFormDTO @@ -1819,6 +1973,183 @@ public class ResiTopicServiceImpl extends BaseServiceImpl() + .eq("del_flag",0) + .eq("issue_id",sourceId)); + } + if (resiTopicEntity == null){ + log.warn("sendWxmpUpdateSubscribe根据topicid获取议题详情为空"); + return; + } + String groupId = resiTopicEntity.getGroupId(); + String createdBy = resiTopicEntity.getCreatedBy(); + //获取对应的customerId,gridId + ResiGroupEntity resiGroupEntity = resiGroupDao.selectById(groupId); + String customerId = resiGroupEntity.getCustomerId(); + String gridId = resiGroupEntity.getGridId(); + //获取所有关心这个话题的userId列表(发布者+评论者) + ResiQueryCommentFormDTO resiQueryCommentFormDTO = new ResiQueryCommentFormDTO(); + resiQueryCommentFormDTO.setTopicId(resiTopicEntity.getId()); + resiQueryCommentFormDTO.setPageNo(1); + resiQueryCommentFormDTO.setPageSize(10000); + List commentList = resiTopicCommentService.getCommentList(tokenDto, resiQueryCommentFormDTO).getData(); + Set toUsers = commentList.stream().map(item -> item.getUserId()).collect(Collectors.toSet()); + toUsers.add(createdBy); + //不给发起操作的人推送 + toUsers.remove(tokenDto.getUserId()); + logger.info("推送的userid列表:"+JSON.toJSONString(toUsers)); + List msgList = new ArrayList<>(); + Date now = new Date(); + for (String toUser : toUsers) { + WxSubscribeUpdateFormDTO subscribeUpdateFormDTO = new WxSubscribeUpdateFormDTO(); + if (WxmpSubscribeConstant.TYPE_COMMENT.equals(type)){ + subscribeUpdateFormDTO.setSourceType(WxmpMessageConstant.SOURCE_TYPE_TOPIC); + subscribeUpdateFormDTO.setBehaviorType(WxmpMessageConstant.CONTENT_UPDATE_TEMPLATE_TYPE); + subscribeUpdateFormDTO.setMessageTitle(WxmpMessageConstant.CONTENT_UPDATE_TITLE_TEXT); + subscribeUpdateFormDTO.setMessageContent(WxmpMessageConstant.CONTENT_UPDATE_CONTENT_TEXT); + } + if (WxmpSubscribeConstant.TYPE_SHIFT_ISSUE.equals(type)){ + subscribeUpdateFormDTO.setSourceType(WxmpMessageConstant.SOURCE_TYPE_ISSUE); + subscribeUpdateFormDTO.setBehaviorType(WxmpMessageConstant.CONCERN_UPDATE_TEMPLATE_TYPE); + subscribeUpdateFormDTO.setMessageTitle(WxmpMessageConstant.CONCERN_UPDATE_TITLE_TEXT); + subscribeUpdateFormDTO.setMessageContent(WxmpMessageConstant.CONCERN_UPDATE_CONTENT_TEXT); + } + subscribeUpdateFormDTO.setGroupId(groupId); + subscribeUpdateFormDTO.setClientType(WxmpMessageConstant.RESI); + subscribeUpdateFormDTO.setCustomerId(customerId); + subscribeUpdateFormDTO.setGridId(gridId); + subscribeUpdateFormDTO.setSourceId(sourceId); + subscribeUpdateFormDTO.setMessageTime(now); + subscribeUpdateFormDTO.setUserId(toUser); + msgList.add(subscribeUpdateFormDTO); + } + if(msgList.size()>0){ + epmetMessageOpenFeignClient.sendWxSubscribeUpdate(msgList); + } + }catch (Exception e){ + logger.warn("话题相关 发送微信订阅失败,"+e.getMessage()+",sourceId="+sourceId+" 类型="+type); + } + } + /** + * @param formDTO + * @return + * @Author sun + * @Description 获取话题附件信息 + **/ + @Override + public TopicAttachmentResultDTO topicAttachmentList(TopicAttachmentFormDTO formDTO) { + TopicAttachmentResultDTO resultDTO = new TopicAttachmentResultDTO(); + //1.根据话题id查询所有的附件数据 + List list = resiTopicAttachmentDao.selectTopicAttachmentList(formDTO.getTopicId()); + if(list.size() docList = new LinkedList<>(); + LinkedList voiceList = new LinkedList<>(); + LinkedList videoList = new LinkedList<>(); + list.forEach(l->{ + TopicFileResultDTO dto = new TopicFileResultDTO(); + dto.setUrl(l.getAttachmentUrl()); + dto.setDuration(l.getDuration()); + if(TopicConstant.FILE_DOC.equals(l.getAttachmentType())){ + docList.add(dto); + } + if(TopicConstant.FILE_VOICE.equals(l.getAttachmentType())){ + voiceList.add(dto); + } + if(TopicConstant.FILE_VIDEO.equals(l.getAttachmentType())){ + videoList.add(dto); + } + }); + resultDTO.setDocList(docList); + resultDTO.setVoiceList(voiceList); + resultDTO.setVideoList(videoList); + return resultDTO; + } + + /** + * @Description 根据事件枚举发送积分事件 + * @param param + * @return void + * @author wangc + * @date 2021.01.04 16:41 + */ + @Override + public void sendTopicPointEventByEventType(TopicEventFormDTO param) { + ResiTopicEntity topic = baseDao.selectById(param.getTopicId()); + if(null == topic){ + log.error("com.epmet.modules.topic.service.impl.ResiTopicServiceImpl.sendTopicPointEventByEventType,根据话题Id没有找到对应的话题信息,参数:{}",JSON.toJSONString(param + )); + return; + } + ResiGroupInfoRedisDTO group = resiGroupRedis.get(topic.getGroupId()); + if(null == group){ + log.error("com.epmet.modules.topic.service.impl.ResiTopicServiceImpl.sendTopicPointEventByEventType,根据组Id没有找到对应的小组信息,组Id:{}",topic.getGroupId()); + return; + } + //某某小组中发布的话题“某某某…” (前十个字后面省略号) 被转为项目 + if(EventEnum.TOPIC_SHIFTED_TO_PROJECT == param.getEvent()){ + + MqBaseMsgDTO mqBaseMsgDTO = new MqBaseMsgDTO(); + mqBaseMsgDTO.setEventClass("resi_group"); + + mqBaseMsgDTO.setEventTag(EventEnum.TOPIC_SHIFTED_TO_PROJECT.getEventTag()); + List pointEventMsgList = new ArrayList<>(); + //话题被转为项目 话题作者 + + BasePointEventMsg pointEventMsg = new BasePointEventMsg(); + pointEventMsg.setCustomerId(group.getCustomerId()); + pointEventMsg.setUserId(topic.getCreatedBy()); + pointEventMsg.setActionFlag(MqConstant.PLUS); + pointEventMsg.setIsCommon(false); + pointEventMsg.setEventTag(EventEnum.TOPIC_SHIFTED_TO_PROJECT.getEventTag()); + //某某小组中发布的话题“某某某…” (前十个字后面省略号) 被转为议题 + String content = CharMatcher.WHITESPACE.trimFrom(topic.getTopicContent()); + pointEventMsg.setRemark(new StringBuilder(group.getGroupName()).append("小组中发布的") + .append( + StringUtils.isBlank(content) || + StringUtils.equals("语音话题",content) ? "语音话题" : + "话题\"" + + content + .substring(NumConstant.ZERO,content.length() < NumConstant.TEN ? content.length() : NumConstant.TEN) + + (NumConstant.TEN > content.length() ? "\"" : "…\"") + ).append("被转为项目").toString()); + pointEventMsgList.add(pointEventMsg); + mqBaseMsgDTO.setMsg(JSON.toJSONString(pointEventMsgList)); + if(!SendMqMsgUtils.sendMsg(mqBaseMsgDTO).success()){ + log.error("话题转议题事件发送失败,参数:{}",JSON.toJSONString(param)); + } + } + } + + @Override + public ResiTopicDTO queryTopicInfoByIssueId(String issueId) { + return baseDao.selectByIssueId(issueId); + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftAttachmentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftAttachmentServiceImpl.java new file mode 100644 index 0000000000..a614e3db2b --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftAttachmentServiceImpl.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.topic.dao.TopicDraftAttachmentDao; +import com.epmet.modules.topic.entity.TopicDraftAttachmentEntity; +import com.epmet.modules.topic.service.TopicDraftAttachmentService; +import com.epmet.resi.group.dto.topic.TopicDraftAttachmentDTO; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 话题草稿附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Service +public class TopicDraftAttachmentServiceImpl extends BaseServiceImpl implements TopicDraftAttachmentService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TopicDraftAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TopicDraftAttachmentDTO.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 TopicDraftAttachmentDTO get(String id) { + TopicDraftAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TopicDraftAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TopicDraftAttachmentDTO dto) { + TopicDraftAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, TopicDraftAttachmentEntity.class); + insert(entity); + dto.setId(entity.getId()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TopicDraftAttachmentDTO dto) { + TopicDraftAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, TopicDraftAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 获取附件列表 + * + * @param topicDraftId + * @param type + * @return java.util.List + * @author zhaoqifeng + * @date 2020/12/18 16:42 + */ + @Override + public List getFileList(String topicDraftId, String type) { + List list = baseDao.selectFileList(topicDraftId, type); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + return list; + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftOperationServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftOperationServiceImpl.java new file mode 100644 index 0000000000..1fcf022738 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftOperationServiceImpl.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.modules.topic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.topic.dao.TopicDraftOperationDao; +import com.epmet.modules.topic.entity.TopicDraftOperationEntity; +import com.epmet.modules.topic.service.TopicDraftOperationService; +import com.epmet.resi.group.dto.topic.TopicDraftOperationDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 话题草稿操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Service +public class TopicDraftOperationServiceImpl extends BaseServiceImpl implements TopicDraftOperationService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TopicDraftOperationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TopicDraftOperationDTO.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 TopicDraftOperationDTO get(String id) { + TopicDraftOperationEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TopicDraftOperationDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TopicDraftOperationDTO dto) { + TopicDraftOperationEntity entity = ConvertUtils.sourceToTarget(dto, TopicDraftOperationEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TopicDraftOperationDTO dto) { + TopicDraftOperationEntity entity = ConvertUtils.sourceToTarget(dto, TopicDraftOperationEntity.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/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftScanTaskServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftScanTaskServiceImpl.java new file mode 100644 index 0000000000..9890bf5c79 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftScanTaskServiceImpl.java @@ -0,0 +1,128 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.modules.topic.dao.TopicDraftScanTaskDao; +import com.epmet.modules.topic.entity.TopicDraftScanTaskEntity; +import com.epmet.modules.topic.service.TopicDraftScanTaskService; +import com.epmet.resi.group.constant.TopicConstant; +import com.epmet.resi.group.dto.topic.TopicDraftScanTaskDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 话题附件检测任务表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +@Service +public class TopicDraftScanTaskServiceImpl extends BaseServiceImpl implements TopicDraftScanTaskService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TopicDraftScanTaskDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TopicDraftScanTaskDTO.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 TopicDraftScanTaskDTO get(String id) { + TopicDraftScanTaskEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TopicDraftScanTaskDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TopicDraftScanTaskDTO dto) { + TopicDraftScanTaskEntity entity = ConvertUtils.sourceToTarget(dto, TopicDraftScanTaskEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TopicDraftScanTaskDTO dto) { + TopicDraftScanTaskEntity entity = ConvertUtils.sourceToTarget(dto, TopicDraftScanTaskEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void updateByTask(TopicDraftScanTaskDTO dto) { + TopicDraftScanTaskEntity entity = ConvertUtils.sourceToTarget(dto, TopicDraftScanTaskEntity.class); + baseDao.updateByTask(entity); + } + + @Override + public TopicDraftScanTaskDTO getScanByTask(String taskId) { + return baseDao.selectScanByTask(taskId); + } + + /** + * 获取审核中的数据 + * + * @return java.util.List + * @author zhaoqifeng + * @date 2020/12/29 17:57 + */ + @Override + public List getScanTaskList(String draftId, String status) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(draftId), "TOPIC_DRAFT_ID", draftId); + wrapper.eq(StringUtils.isNotBlank(status),"STATUS", status); + List entityList = baseDao.selectList(wrapper); + return ConvertUtils.sourceToTarget(entityList, TopicDraftScanTaskDTO.class); + + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java new file mode 100644 index 0000000000..4ee3f577b9 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java @@ -0,0 +1,1008 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.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.MqConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.form.mq.MqBaseMsgDTO; +import com.epmet.commons.tools.dto.form.mq.eventmsg.BasePointEventMsg; +import com.epmet.commons.tools.enums.EventEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.scan.param.*; +import com.epmet.commons.tools.scan.result.AsyncScanResult; +import com.epmet.commons.tools.scan.result.AsyncScanTaskDTO; +import com.epmet.commons.tools.scan.result.SyncScanResult; +import com.epmet.commons.tools.scan.result.VoiceResultDTO; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.*; +import com.epmet.dto.result.AllGridsByUserIdResultDTO; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.modules.feign.EpmetUserFeignClient; +import com.epmet.modules.group.dao.ResiGroupDao; +import com.epmet.modules.group.dao.ResiGroupStatisticalDao; +import com.epmet.modules.group.entity.ResiGroupEntity; +import com.epmet.modules.group.entity.ResiGroupStatisticalEntity; +import com.epmet.modules.group.redis.ResiGroupRedis; +import com.epmet.modules.member.dao.ResiGroupMemberDao; +import com.epmet.modules.member.redis.ResiGroupMemberRedis; +import com.epmet.modules.member.service.ResiGroupMemberService; +import com.epmet.modules.topic.dao.ResiTopicAttachmentDao; +import com.epmet.modules.topic.dao.ResiTopicDao; +import com.epmet.modules.topic.dao.ResiTopicOperationDao; +import com.epmet.modules.topic.dao.TopicDraftDao; +import com.epmet.modules.topic.entity.*; +import com.epmet.modules.topic.service.TopicDraftAttachmentService; +import com.epmet.modules.topic.service.TopicDraftOperationService; +import com.epmet.modules.topic.service.TopicDraftScanTaskService; +import com.epmet.modules.topic.service.TopicDraftService; +import com.epmet.modules.utils.ModuleConstant; +import com.epmet.resi.group.constant.MemberStateConstant; +import com.epmet.resi.group.constant.TopicConstant; +import com.epmet.resi.group.dto.group.ResiGroupInfoRedisDTO; +import com.epmet.resi.group.dto.group.ResiGroupStatisticalInfoRedisDTO; +import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; +import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; +import com.epmet.resi.group.dto.topic.TopicDraftAttachmentDTO; +import com.epmet.resi.group.dto.topic.TopicDraftDTO; +import com.epmet.resi.group.dto.topic.TopicDraftOperationDTO; +import com.epmet.resi.group.dto.topic.TopicDraftScanTaskDTO; +import com.epmet.resi.group.dto.topic.form.*; +import com.epmet.resi.group.dto.topic.result.DraftDetailResultDTO; +import com.epmet.resi.group.dto.topic.result.MyAuditingListResultDTO; +import com.epmet.resi.group.dto.topic.result.TopicAuditResultDTO; +import com.google.common.base.CharMatcher; +import com.google.common.util.concurrent.ThreadFactoryBuilder; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.concurrent.*; +import java.util.stream.Collectors; + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Service +@Slf4j +public class TopicDraftServiceImpl extends BaseServiceImpl implements TopicDraftService { + private static Logger logger = LoggerFactory.getLogger(TopicDraftServiceImpl.class); + + private ThreadFactory namedThreadFactory = new ThreadFactoryBuilder() + .setNameFormat("TopicDraftService-pool-%d").build(); + private ExecutorService threadPool = new ThreadPoolExecutor(1, 1, + 1L, TimeUnit.MINUTES, + new LinkedBlockingQueue<>(500), namedThreadFactory, new ThreadPoolExecutor.CallerRunsPolicy()); + + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + @Autowired + private ResiGroupMemberService resiGroupMemberService; + + @Autowired + private ResiTopicAttachmentDao resiTopicAttachmentDao; + + @Autowired + private ResiTopicOperationDao resiTopicOperationDao; + + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + + @Autowired + private ResiGroupDao resiGroupDao; + + @Autowired + private ResiGroupMemberDao resiGroupMemberDao; + + @Autowired + private ResiGroupStatisticalDao resiGroupStatisticalDao; + + @Autowired + private ResiTopicDao resiTopicDao; + + @Autowired + private ResiGroupRedis resiGroupRedis; + + @Autowired + private TopicDraftAttachmentService topicDraftAttachmentService; + @Autowired + private TopicDraftOperationService topicDraftOperationService; + @Autowired + private ResiGroupMemberRedis resiGroupMemberRedis; + @Autowired + private TopicDraftScanTaskService topicDraftScanTaskService; + + @Value("${openapi.scan.server.url}") + private String scanApiUrl; + @Value("${openapi.scan.method.textSyncScan}") + private String textSyncScanMethod; + @Value("${openapi.scan.method.imgSyncScan}") + private String imgSyncScanMethod; + @Value("${openapi.scan.method.voiceAsyncScan}") + private String voiceAsyncScanMethod; + @Value("${openapi.scan.method.voiceResults}") + private String voiceResultsMethod; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TopicDraftDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TopicDraftDTO.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 TopicDraftDTO get(String id) { + TopicDraftEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TopicDraftDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TopicDraftDTO dto) { + TopicDraftEntity entity = ConvertUtils.sourceToTarget(dto, TopicDraftEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TopicDraftDTO dto) { + TopicDraftEntity entity = ConvertUtils.sourceToTarget(dto, TopicDraftEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 个人中心-我发表的话题-审核中列表 + **/ + @Override + public List myAuditingList(MyAuditingListFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + //1.获取当前用户创建的还未成为话题的话题草稿数据 + List list = baseDao.selectAuditingList(formDTO); + if(list.size()(); + } + + //2.获取网格名称,封装数据并返回 【组织-网格】 + List gridIds = list.stream().map(l -> l.getGridId()).collect(Collectors.toList()); + Result> rst = govOrgOpenFeignClient.getGridListByGridIds(gridIds); + if (!rst.success()) { + logger.error("查询【个人中心-我发表的话题-审核中列表】,根据网格id查询网格名称失败, InternalMsg:{},Msg:{}", rst.getInternalMsg(), rst.getMsg()); + } else { + List gridList = rst.getData(); + if (CollectionUtils.isNotEmpty(gridList)) { + HashMap gridIdAndNames = new HashMap<>(); + gridList.stream().forEach(g -> gridIdAndNames.put(g.getGridId(), g.getGridName())); + list.stream().forEach(pt -> pt.setReleaseGridName(gridIdAndNames.get(pt.getGridId()))); + } + } + return list; + } + + /** + * 自动审核 + * + * @return void + * @author zhaoqifeng + * @date 2020/12/29 17:51 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void autoAudit() { + List taskList = topicDraftScanTaskService.getScanTaskList(null, TopicConstant.AUDITING); + if (CollectionUtils.isNotEmpty(taskList)) { + List taskIds = taskList.stream().map(TopicDraftScanTaskDTO :: getTaskId).collect(Collectors.toList()); + List draftIds = taskList.stream().map(TopicDraftScanTaskDTO :: getTopicDraftId).collect(Collectors.toList()); + Result> voiceResults = ScanContentUtils.voiceResults(scanApiUrl.concat(voiceResultsMethod), taskIds); + if (voiceResults.success()) { + List list = voiceResults.getData(); + for (VoiceResultDTO item : list) { + TopicDraftScanTaskDTO taskDTO = topicDraftScanTaskService.getScanByTask(item.getTaskId()); + if (TopicConstant.REVIEW.equals(item.getSuggestion())) { + //结果不确定 + TopicDraftAttachmentDTO dto = new TopicDraftAttachmentDTO(); + dto.setId(taskDTO.getTopicDraftAttachmentId()); + dto.setStatus(TopicConstant.REVIEW); + dto.setReason(item.getLabelDesc()); + topicDraftAttachmentService.update(dto); + + taskDTO.setStatus(TopicConstant.REVIEW); + topicDraftScanTaskService.update(taskDTO); + + } else if (TopicConstant.BLOCK.equals(item.getSuggestion())) { + //结果违规 + TopicDraftAttachmentDTO dto = new TopicDraftAttachmentDTO(); + dto.setId(taskDTO.getTopicDraftAttachmentId()); + dto.setStatus(TopicConstant.BLOCK); + dto.setReason(item.getLabelDesc()); + topicDraftAttachmentService.update(dto); + + taskDTO.setStatus(TopicConstant.BLOCK); + topicDraftScanTaskService.update(taskDTO); + } else { + //审核通过 + TopicDraftAttachmentDTO dto = new TopicDraftAttachmentDTO(); + dto.setId(taskDTO.getTopicDraftAttachmentId()); + dto.setStatus(TopicConstant.AUTO_PASSED); + dto.setReason(item.getLabelDesc()); + topicDraftAttachmentService.update(dto); + + taskDTO.setStatus(TopicConstant.AUTO_PASSED); + topicDraftScanTaskService.update(taskDTO); + } + } + + //判断草稿是否审核完成 + draftIds.forEach(draftId -> { + List tasks = topicDraftScanTaskService.getScanTaskList(draftId, null); + String status = TopicConstant.AUTO_PASSED; + for (TopicDraftScanTaskDTO task : tasks) { + if (TopicConstant.AUDITING.equals(task.getStatus())) { + status = TopicConstant.AUDITING; + break; + } else if(TopicConstant.BLOCK.equals(task.getStatus())) { + status = TopicConstant.BLOCK; + } else if(TopicConstant.REVIEW.equals(task.getStatus())) { + if (!TopicConstant.BLOCK.equals(status)) { + status = TopicConstant.REVIEW; + } + } else { + if (!TopicConstant.BLOCK.equals(status) && !TopicConstant.REVIEW.equals(status)) { + status = TopicConstant.AUTO_PASSED; + } + } + } + + if (TopicConstant.BLOCK.equals(status)) { + //草稿状态更新为block + TopicDraftEntity draftEntity = new TopicDraftEntity(); + draftEntity.setId(draftId); + draftEntity.setDraftStatus(TopicConstant.BLOCK); + draftEntity.setDraftReason("语音存在违规内容"); + baseDao.updateById(draftEntity); + + } else if(TopicConstant.REVIEW.equals(status)) { + //草稿状态更新为review + TopicDraftEntity draftEntity = new TopicDraftEntity(); + draftEntity.setId(draftId); + draftEntity.setDraftStatus(TopicConstant.REVIEW); + draftEntity.setDraftReason("需要人工审核"); + baseDao.updateById(draftEntity); + + } else if(TopicConstant.AUTO_PASSED.equals(status)) { + //草稿状态更新为auto_passed + AuditDraftTopicFormDTO formDTO = new AuditDraftTopicFormDTO(); + formDTO.setTopicDraftId(draftId); + formDTO.setAuditType(TopicConstant.AUTO_PASSED); + audit(null, formDTO); + } + }); + + + } + } + } + + /** + * 发布话题 + * + * @param tokenDto + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2020/12/17 15:49 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void createTopic(TokenDto tokenDto, CreateTopicFormDTO formDTO) { + if(StringUtils.isBlank(formDTO.getTopicContent()) && CollectionUtils.isEmpty(formDTO.getVoiceList())) { + //话题内容和语音不能同时为空 + log.error(ModuleConstant.TOPIC_CONTENT_AND_VOICE_IS_NULL); + throw new RenException(ModuleConstant.TOPIC_CONTENT_AND_VOICE_IS_NULL); + } + + //1.保存话题草稿 + if(formDTO.getTopicContent().length() > TopicConstant.MAX_NUMBER_OF_CONTENT){ + //内容超过最大限制 + log.error(ModuleConstant.TOPIC_CONTENT_NUMBER_OF_WORDS_EXCEEDED); + throw new RenException(ModuleConstant.TOPIC_CONTENT_NUMBER_OF_WORDS_EXCEEDED); + } + + TopicDraftEntity topic = ConvertUtils.sourceToTarget(formDTO,TopicDraftEntity.class); + if (CollectionUtils.isNotEmpty(formDTO.getVoiceList()) && StringUtils.isBlank(formDTO.getTopicContent())) { + topic.setTopicContent("语音话题"); + } + topic.setCreatedBy(tokenDto.getUserId()); + topic.setDraftStatus(TopicConstant.AUDITING); + topic.setIsSee(NumConstant.ZERO_STR); + baseDao.insert(topic); + if (StringUtils.isNotEmpty(formDTO.getTopicDraftId())) { + //隐藏旧话题草稿 + TopicDraftEntity old = new TopicDraftEntity(); + old.setId(formDTO.getTopicDraftId()); + old.setIsSee(NumConstant.ONE_STR); + baseDao.updateById(old); + } + List imageDTOList = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(formDTO.getImageList())){ + int sort = 0; + for(String url : formDTO.getImageList()){ + TopicDraftAttachmentDTO attachment = new TopicDraftAttachmentDTO(); + attachment.setCustomerId(formDTO.getCustomerId()); + attachment.setAttachmentUrl(url); + attachment.setTopicDraftId(topic.getId()); + attachment.setCreatedBy(tokenDto.getUserId()); + attachment.setAttachmentFormat(url.substring(url.lastIndexOf(".") + NumConstant.ONE).toLowerCase()); + attachment.setSort(sort++); + attachment.setAttachmentType("image"); + attachment.setStatus(TopicConstant.AUDITING); + topicDraftAttachmentService.save(attachment); + + ImgTaskDTO task = new ImgTaskDTO(); + task.setDataId(attachment.getId()); + task.setUrl(url); + imageDTOList.add(task); + } + } + List voiceDTOList = new ArrayList<>(); + if(CollectionUtils.isNotEmpty(formDTO.getVoiceList())){ + int sort = 0; + for(FileDTO file : formDTO.getVoiceList()){ + TopicDraftAttachmentDTO attachment = new TopicDraftAttachmentDTO(); + attachment.setCustomerId(formDTO.getCustomerId()); + attachment.setAttachmentUrl(file.getUrl()); + attachment.setTopicDraftId(topic.getId()); + attachment.setCreatedBy(tokenDto.getUserId()); + attachment.setAttachmentFormat(file.getUrl().substring(file.getUrl().lastIndexOf(".") + NumConstant.ONE).toLowerCase()); + attachment.setSort(sort++); + attachment.setAttachmentType("voice"); + attachment.setDuration(file.getDuration()); + attachment.setStatus(TopicConstant.AUDITING); + topicDraftAttachmentService.save(attachment); + + VoiceTaskDTO task = new VoiceTaskDTO(); + task.setDataId(attachment.getId()); + task.setUrl(file.getUrl()); + voiceDTOList.add(task); + } + } + + //话题操作记录 + TopicDraftOperationDTO operation = new TopicDraftOperationDTO(); + operation.setCustomerId(formDTO.getCustomerId()); + operation.setTopicDraftId(topic.getId()); + operation.setOperateType(TopicConstant.SUBMIT); + operation.setCreatedBy(tokenDto.getUserId()); + topicDraftOperationService.save(operation); + + //2.话题内容审核 + String topicContent = formDTO.getTopicContent(); + if (StringUtils.isNotBlank(topicContent)) { + //创建话题内容审核 + TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); + TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setContent(topicContent); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); + textScanParamDTO.getTasks().add(taskDTO); + Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); + if (!textSyncScanResult.success()) { + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!textSyncScanResult.getData().isAllPass()) { + //更新话题状态block + TopicDraftEntity draftEntity = new TopicDraftEntity(); + draftEntity.setId(topic.getId()); + draftEntity.setDraftStatus(TopicConstant.BLOCK); + draftEntity.setDraftReason("话题存在违规内容"); + baseDao.updateById(draftEntity); + //话题操作记录 + TopicDraftOperationDTO operationDTO = new TopicDraftOperationDTO(); + operationDTO.setCustomerId(formDTO.getCustomerId()); + operationDTO.setTopicDraftId(topic.getId()); + operationDTO.setOperateType(TopicConstant.BLOCK); + operationDTO.setCreatedBy(tokenDto.getUserId()); + topicDraftOperationService.save(operationDTO); + + log.error(String.format(TopicConstant.CREATE_TOPIC, topicContent)); + throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); + } + } + } + //创建话题图片审核 + if (CollectionUtils.isNotEmpty(imageDTOList)){ + ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); + imgScanParamDTO.setTasks(imageDTOList); + Result imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); + if (!imgScanResult.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + if (!imgScanResult.getData().isAllPass()) { + //更新话题状态block + TopicDraftEntity draftEntity = new TopicDraftEntity(); + draftEntity.setId(topic.getId()); + draftEntity.setDraftStatus(TopicConstant.BLOCK); + draftEntity.setDraftReason("图片存在违规内容"); + baseDao.updateById(draftEntity); + //话题操作记录 + TopicDraftOperationDTO operationDTO = new TopicDraftOperationDTO(); + operationDTO.setCustomerId(formDTO.getCustomerId()); + operationDTO.setTopicDraftId(topic.getId()); + operationDTO.setOperateType(TopicConstant.BLOCK); + operationDTO.setCreatedBy(tokenDto.getUserId()); + topicDraftOperationService.save(operationDTO); + throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode()); + } + if(CollectionUtils.isNotEmpty(imgScanResult.getData().getSuccessDataIds())) { + imgScanResult.getData().getSuccessDataIds().forEach(item -> { + TopicDraftAttachmentDTO dto = new TopicDraftAttachmentDTO(); + dto.setId(item); + dto.setStatus(TopicConstant.AUTO_PASSED); + topicDraftAttachmentService.update(dto); + }); + } + if(CollectionUtils.isNotEmpty(imgScanResult.getData().getFailDataIds())) { + imgScanResult.getData().getFailDataIds().forEach(item -> { + TopicDraftAttachmentDTO dto = new TopicDraftAttachmentDTO(); + dto.setId(item); + dto.setStatus(TopicConstant.BLOCK); + dto.setReason("图片存在违规内容"); + topicDraftAttachmentService.update(dto); + }); + } + } + } + + //创建话题语音审核 + if (CollectionUtils.isNotEmpty(voiceDTOList)){ + VoiceScanParamDTO voiceScanParamDTO = new VoiceScanParamDTO(); + voiceScanParamDTO.setTasks(voiceDTOList); + voiceScanParamDTO.setOpenCallBack(false); + Result voiceScanResult = ScanContentUtils.voiceAsyncScan(scanApiUrl.concat(voiceAsyncScanMethod), voiceScanParamDTO); + if (!voiceScanResult.success() || !voiceScanResult.getData().isAllSuccess()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } else { + List taskList = voiceScanResult.getData().getSuccessTasks(); + List taskIds = taskList.stream().map(AsyncScanTaskDTO :: getTaskId).collect(Collectors.toList()); + //提交记录存入task表 + + List scanTaskEntityList = taskList.stream().map(item -> { + TopicDraftScanTaskEntity taskEntity = new TopicDraftScanTaskEntity(); + taskEntity.setCustomerId(formDTO.getCustomerId()); + taskEntity.setTopicDraftId(topic.getId()); + taskEntity.setTopicDraftAttachmentId(item.getDataId()); + taskEntity.setTaskId(item.getTaskId()); + taskEntity.setStatus(TopicConstant.AUDITING); + taskEntity.setAttachmentType(TopicConstant.VOICE); + return taskEntity; + }).collect(Collectors.toList()); + topicDraftScanTaskService.insertBatch(scanTaskEntityList); + //轮询 +// Result> voiceResults = ScanContentUtils.voiceResults(scanApiUrl.concat(voiceResultsMethod), taskIds); +// if (voiceResults.success()) { +// boolean isAllPass = true; +// List list = voiceResults.getData(); +// for (VoiceResultDTO item : list) { +// TopicDraftScanTaskDTO taskDTO = topicDraftScanTaskService.getScanByTask(item.getTaskId()); +// if (TopicConstant.REVIEW.equals(item.getSuggestion())) { +// //结果不确定 +// TopicDraftAttachmentDTO dto = new TopicDraftAttachmentDTO(); +// dto.setId(taskDTO.getTopicDraftAttachmentId()); +// dto.setStatus(TopicConstant.REVIEW); +// dto.setReason(item.getLabelDesc()); +// topicDraftAttachmentService.update(dto); +// +// taskDTO.setStatus(TopicConstant.REVIEW); +// topicDraftScanTaskService.update(taskDTO); +// +// TopicDraftEntity draftEntity = new TopicDraftEntity(); +// draftEntity.setId(topic.getId()); +// draftEntity.setDraftStatus(TopicConstant.REVIEW); +// draftEntity.setDraftReason("需要人工审核"); +// baseDao.updateById(draftEntity); +// +// isAllPass = false; +// } else if (TopicConstant.BLOCK.equals(item.getSuggestion())) { +// //结果违规 +// TopicDraftAttachmentDTO dto = new TopicDraftAttachmentDTO(); +// dto.setId(taskDTO.getTopicDraftAttachmentId()); +// dto.setStatus(TopicConstant.BLOCK); +// dto.setReason(item.getLabelDesc()); +// topicDraftAttachmentService.update(dto); +// +// taskDTO.setStatus(TopicConstant.BLOCK); +// topicDraftScanTaskService.update(taskDTO); +// +// TopicDraftEntity draftEntity = new TopicDraftEntity(); +// draftEntity.setId(topic.getId()); +// draftEntity.setDraftStatus(TopicConstant.BLOCK); +// draftEntity.setDraftReason(item.getLabelDesc()); +// baseDao.updateById(draftEntity); +// +// isAllPass = false; +// } else { +// //审核通过 +// TopicDraftAttachmentDTO dto = new TopicDraftAttachmentDTO(); +// dto.setId(taskDTO.getTopicDraftAttachmentId()); +// dto.setStatus(TopicConstant.AUTO_PASSED); +// dto.setReason(item.getLabelDesc()); +// topicDraftAttachmentService.update(dto); +// +// taskDTO.setStatus(TopicConstant.AUTO_PASSED); +// topicDraftScanTaskService.update(taskDTO); +// } +// //审核通过,发布话题 +// if (isAllPass) { +// saveTopic(tokenDto, formDTO, topic.getId()); +// } +// } +// +// } + + } + } else { + //话题草稿状态为 auto_passed: 自动通过 + //更新话题状态block + TopicDraftEntity draftEntity = new TopicDraftEntity(); + draftEntity.setId(topic.getId()); + draftEntity.setDraftStatus(TopicConstant.AUTO_PASSED); + baseDao.updateById(draftEntity); + //话题操作记录 + TopicDraftOperationDTO operationDTO = new TopicDraftOperationDTO(); + operationDTO.setCustomerId(formDTO.getCustomerId()); + operationDTO.setTopicDraftId(topic.getId()); + operationDTO.setOperateType(TopicConstant.AUTO_PASSED); + operationDTO.setCreatedBy(tokenDto.getUserId()); + topicDraftOperationService.save(operationDTO); + //3.保存话题 + saveTopic(tokenDto, formDTO, topic.getId()); + } + + } + + /** + * 组管理界面-待审核/已驳回列表 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/12/18 14:34 + */ + @Override + public List auditList(TopicAuditFormDTO formDTO) { + List result; + + if (TopicConstant.REVIEW.equals(formDTO.getStatus())) { + result = baseDao.selectTopicDraftByGroup(formDTO.getGroupId(), formDTO.getStatus()); + } else { + result = baseDao.selectTopicDraftByGroup(formDTO.getGroupId(), formDTO.getStatus()); + } + result.forEach(item -> { + ResiGroupMemberInfoRedisDTO memberRedis = + resiGroupMemberRedis.get(formDTO.getGroupId(),item.getUserName()); + if(null != memberRedis && StringUtils.isNotBlank(memberRedis.getUserId())){ + item.setUserName(StringUtils.isBlank(memberRedis.getUserShowName()) ? "" : memberRedis.getUserShowName()); + } + }); + return result; + } + + /** + * 话题草稿详情 + * + * @param formDTO + * @return com.epmet.resi.group.dto.topic.result.DraftDetailResultDTO + * @author zhaoqifeng + * @date 2020/12/18 14:55 + */ + @Override + public DraftDetailResultDTO detail(DraftDetailFormDTO formDTO) { + TopicDraftEntity entity = baseDao.selectById(formDTO.getTopicDraftId()); + + if(null == entity){ + log.error(ModuleConstant.NO_SUCH_TOPIC); + throw new RenException(ModuleConstant.NO_SUCH_TOPIC); + } + DraftDetailResultDTO result = ConvertUtils.sourceToTarget(entity,DraftDetailResultDTO.class); + result.setTopicDraftId(formDTO.getTopicDraftId()); + result.setReleaseTime(new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE).format(entity.getCreatedTime())); + result.setTopicContent(entity.getTopicContent()); + result.setReleaseAddress(entity.getAddress()); + result.setReason(entity.getDraftReason()); + if (TopicConstant.AUDITING.equals(entity.getDraftStatus()) || TopicConstant.REVIEW.equals(entity.getDraftStatus())) { + result.setStatus(TopicConstant.AUDITING); + } else if (TopicConstant.BLOCK.equals(entity.getDraftStatus()) || TopicConstant.REJECTED.equals(entity.getDraftStatus())) { + result.setStatus(TopicConstant.REJECTED); + } + //2.查询话题图片附件 + List imageUrls = + topicDraftAttachmentService.getFileList(formDTO.getTopicDraftId(), TopicConstant.IMAGE).stream().map(TopicDraftAttachmentDTO::getAttachmentUrl).collect(Collectors.toList()); + result.setImageList(imageUrls); + + //3.查询话题音频附件 + List voiceUrls = + topicDraftAttachmentService.getFileList(formDTO.getTopicDraftId(), TopicConstant.VOICE).stream().map(item ->{ + FileDTO fileDTO = new FileDTO(); + fileDTO.setUrl(item.getAttachmentUrl()); + fileDTO.setDuration(item.getDuration()); + return fileDTO; + }).collect(Collectors.toList()); + result.setVoiceList(voiceUrls); + + //3.拿取用户信息 + ResiGroupMemberInfoRedisDTO memberRedis = + resiGroupMemberRedis.get(entity.getGroupId(),entity.getCreatedBy()); + if(null != memberRedis && StringUtils.isNotBlank(memberRedis.getUserId())){ + result.setReleaseUserName(StringUtils.isBlank(memberRedis.getUserShowName()) ? "" : memberRedis.getUserShowName()); + result.setReleaseUserHeadPhoto(StringUtils.isBlank(memberRedis.getUserHeadPhoto()) ? "" : memberRedis.getUserHeadPhoto()); + } + + return result; + } + + /** + * 删除已驳回话题 + * + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2020/12/18 14:58 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteDraft(DraftDetailFormDTO formDTO) { + TopicDraftEntity entity = new TopicDraftEntity(); + entity.setId(formDTO.getTopicDraftId()); + entity.setIsSee(NumConstant.ONE_STR); + baseDao.updateById(entity); + } + + /** + * 组长审核 + * + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2020/12/18 15:06 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void audit(TokenDto tokenDto, AuditDraftTopicFormDTO formDTO) { + TopicDraftEntity entity = new TopicDraftEntity(); + entity.setId(formDTO.getTopicDraftId()); + entity.setDraftReason(formDTO.getReason()); + entity.setDraftStatus(formDTO.getAuditType()); + baseDao.updateById(entity); + if (TopicConstant.APPROVED.equals(formDTO.getAuditType()) || TopicConstant.AUTO_PASSED.equals(formDTO.getAuditType())) { + TopicDraftEntity draft = baseDao.selectById(formDTO.getTopicDraftId()); + //将草稿存入话题表 + ResiTopicEntity resiTopic = ConvertUtils.sourceToTarget(draft, ResiTopicEntity.class); + resiTopic.setId(null); + resiTopic.setStatus(TopicConstant.PUBLISHMENT); + resiTopic.setCreatedTime(null); + resiTopic.setUpdatedBy(draft.getCreatedBy()); + resiTopic.setUpdatedTime(null); + resiTopicDao.insert(resiTopic); + entity = new TopicDraftEntity(); + entity.setId(formDTO.getTopicDraftId()); + entity.setTopicId(resiTopic.getId()); + baseDao.updateById(entity); + //将草稿附件存入附件表 + List attachmentList = topicDraftAttachmentService.getFileList(formDTO.getTopicDraftId(), null); + List topicAttachments = ConvertUtils.sourceToTarget(attachmentList, ResiTopicAttachmentEntity.class); + topicAttachments.forEach(item -> { + item.setId(null); + item.setTopicId(resiTopic.getId()); + item.setCreatedBy(draft.getCreatedBy()); + item.setUpdatedBy(draft.getCreatedBy()); + }); + resiTopicAttachmentDao.insertBatch(topicAttachments); + //将音频状态改为approved + if (TopicConstant.APPROVED.equals(formDTO.getAuditType())) { + List voiceList = + attachmentList.stream().filter(item -> TopicConstant.VOICE.equals(item.getAttachmentType()) && TopicConstant.REVIEW.equals(item.getStatus())).collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(voiceList)) { + voiceList.forEach(item -> item.setStatus(TopicConstant.APPROVED)); + topicDraftAttachmentService.updateBatchById(ConvertUtils.sourceToTarget(voiceList, TopicDraftAttachmentEntity.class)); + } + } + + //发送积分 + StringBuilder breviary = new StringBuilder(); + String content = CharMatcher.WHITESPACE.trimFrom(draft.getTopicContent()); + if(!StringUtils.isBlank(content)){ + breviary.append("\""); + breviary.append(content.length() > NumConstant.TEN ? (content.substring(NumConstant.TEN) + "…") : content); + breviary.append("\""); + }else { + breviary.append("话题"); + } + sendMqMsg(draft.getCreatedBy(), draft.getCustomerId(),draft.getCreatedTime(),resiGroupRedis.get(draft.getGroupId()).getGroupName(),breviary.toString()); + } + //记录操作记录 + entity = baseDao.selectById(formDTO.getTopicDraftId()); + TopicDraftOperationDTO operationDTO = new TopicDraftOperationDTO(); + operationDTO.setCustomerId(entity.getCustomerId()); + operationDTO.setTopicDraftId(formDTO.getTopicDraftId()); + operationDTO.setOperateType(formDTO.getAuditType()); + operationDTO.setCreatedBy(null != tokenDto ? tokenDto.getUserId() : "APP_USER"); + topicDraftOperationService.save(operationDTO); + } + + /** + * 保存话题 + * @author zhaoqifeng + * @date 2020/12/18 10:38 + * @param tokenDto + * @param formDTO + * @return void + */ + private void saveTopic(TokenDto tokenDto, CreateTopicFormDTO formDTO, String draftId) { + //1.身份校验,查看当前用户是否是组内成员,当前用户是否被禁言 + ResiGroupMemberDTO resiGroupMemberDTO = + resiGroupMemberService.getResiGroupMember(formDTO.getGroupId(),tokenDto.getUserId() ); + + Result result = verifySilentOrRemoved(resiGroupMemberDTO); + if(!result.success()){ + throw new RenException(result.getCode(), result.getMsg()); + } + + Date currentTime = new Date(); + //2.创建话题 + ResiTopicEntity topic = ConvertUtils.sourceToTarget(formDTO,ResiTopicEntity.class); + if (CollectionUtils.isNotEmpty(formDTO.getVoiceList()) && StringUtils.isBlank(formDTO.getTopicContent())) { + topic.setTopicContent("语音话题"); + } + topic.setCreatedBy(tokenDto.getUserId()); + topic.setStatus(TopicConstant.PUBLISHMENT); + resiTopicDao.insertOne(topic); + if(StringUtils.isBlank(topic.getId())){ + //没有返回主键 + log.error(ModuleConstant.NO_PRIMARY_KEY_RETURNED); + throw new RenException(ModuleConstant.NO_PRIMARY_KEY_RETURNED); + } + if(CollectionUtils.isNotEmpty(formDTO.getImageList())){ + int sort = 0; + for(String url : formDTO.getImageList()){ + ResiTopicAttachmentEntity attachment = new ResiTopicAttachmentEntity(); + attachment.setAttachmentUrl(url); + attachment.setTopicId(topic.getId()); + attachment.setCreatedBy(tokenDto.getUserId()); + attachment.setAttachmentFormat(url.substring(url.lastIndexOf(".") + NumConstant.ONE).toLowerCase()); + attachment.setSort(sort++); + attachment.setAttachmentType("image"); + resiTopicAttachmentDao.insertOne(attachment); + } + } + + if(CollectionUtils.isNotEmpty(formDTO.getVoiceList())){ + int sort = 0; + for(FileDTO file : formDTO.getVoiceList()){ + ResiTopicAttachmentEntity attachment = new ResiTopicAttachmentEntity(); + attachment.setAttachmentUrl(file.getUrl()); + attachment.setTopicId(topic.getId()); + attachment.setCreatedBy(tokenDto.getUserId()); + attachment.setAttachmentFormat(file.getUrl().substring(file.getUrl().lastIndexOf(".") + NumConstant.ONE).toLowerCase()); + attachment.setSort(sort++); + attachment.setDuration(file.getDuration()); + attachment.setAttachmentType("voice"); + resiTopicAttachmentDao.insertOne(attachment); + } + } + + //3.话题操作记录 + ResiTopicOperationEntity operation = new ResiTopicOperationEntity(); + operation.setTopicId(topic.getId()); + operation.setOperationType(TopicConstant.PUBLISHMENT); + operation.setCreatedBy(tokenDto.getUserId()); + resiTopicOperationDao.insertOne(operation); + + //4.小组统计信息,话题数+1 + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(FieldConstant.DEL_FLAG, NumConstant.ZERO_STR); + wrapper.eq(TopicConstant.RESI_GROUP_ID,formDTO.getGroupId()); + List statistical = resiGroupStatisticalDao.selectList(wrapper); + if(null != statistical && statistical.size() >= NumConstant.ONE){ + if(statistical.size() != NumConstant.ONE){ + log.error(ModuleConstant.GROUP_STASTICAL_NOT_SINGLE); + throw new RenException(ModuleConstant.GROUP_STASTICAL_NOT_SINGLE); + }else{ + ResiGroupStatisticalEntity statistical2Update = new ResiGroupStatisticalEntity(); + statistical2Update.setId(statistical.get(NumConstant.ZERO).getId()); + statistical2Update.setTotalTopics(null == statistical.get(NumConstant.ZERO).getTotalTopics() ? NumConstant.ONE : statistical.get(NumConstant.ZERO).getTotalTopics() + NumConstant.ONE); + statistical2Update.setUpdatedBy(tokenDto.getUserId()); + statistical2Update.setUpdatedTime(currentTime); + resiGroupStatisticalDao.updateById(statistical2Update); + } + }else{ + log.error(ModuleConstant.NO_SUCH_GROUP_STASTICAL_INFO); + throw new RenException(ModuleConstant.NO_SUCH_GROUP_STASTICAL_INFO); + } + //5.更新群缓存信息,话题数量+1 + updCacheGroupStatisticalInfo(formDTO.getGroupId(),ModuleConstant.PLUS_OPERATION,NumConstant.ONE); + + //6.群组信息,更新latestTopicPublishDate字段 + ResiGroupEntity group2Update = new ResiGroupEntity(); + group2Update.setId(formDTO.getGroupId()); + group2Update.setLatestTopicPublishDate(currentTime); + resiGroupDao.updateById(group2Update); + + TopicDraftEntity draftEntity = new TopicDraftEntity(); + draftEntity.setId(draftId); + draftEntity.setTopicId(topic.getId()); + draftEntity.setDraftStatus(TopicConstant.AUTO_PASSED); + baseDao.updateById(draftEntity); + + TopicDraftEntity draft = baseDao.selectById(draftId); + StringBuilder breviary = new StringBuilder(); + String content = CharMatcher.WHITESPACE.trimFrom(draft.getTopicContent()); + if(!StringUtils.isBlank(content) && !StringUtils.equals("语音话题",content)){ + breviary.append("话题\""); + breviary.append(content.length() > NumConstant.TEN ? (content.substring(NumConstant.ZERO,NumConstant.TEN) + "…") : content); + breviary.append("\""); + }else breviary.append("语音话题"); + sendMqMsg(tokenDto.getUserId(), formDTO.getCustomerId(),draft.getCreatedTime(),resiGroupRedis.get(draft.getGroupId()).getGroupName(),breviary.toString()); + + } + + /** + * @Description 发送积分事件 + * @param userId + * @param customerId + * @param targetDate 可为空 + * @param groupName + * @param topicBreviary 话题内容摘要"内容…" 如果没有文字则是"语音话题" + * @return void + * @author wangc + * @date 2020.12.25 15:45 + */ + private void sendMqMsg(String userId, String customerId, Date targetDate, String groupName, String topicBreviary) { + //6.发送积分 + MqBaseMsgDTO mqBaseMsgDTO=new MqBaseMsgDTO(); + //mq的事件类型 + mqBaseMsgDTO.setEventClass(EventEnum.PUBLISH_ONE_TOPIC.getEventClass()); + //事件code + mqBaseMsgDTO.setEventTag(EventEnum.PUBLISH_ONE_TOPIC.getEventTag()); + List actPointEventMsgList=new ArrayList<>(); + BasePointEventMsg actPointEventMsg=new BasePointEventMsg(); + actPointEventMsg.setCustomerId(customerId); + actPointEventMsg.setUserId(userId); + actPointEventMsg.setActionFlag(MqConstant.PLUS); + actPointEventMsg.setIsCommon(false); + actPointEventMsg.setRemark(new StringBuilder(groupName).append("小组中发布").append(topicBreviary).toString()); + actPointEventMsg.setTargetDate(targetDate); + actPointEventMsg.setEventTag(EventEnum.PUBLISH_ONE_TOPIC.getEventTag()); + actPointEventMsgList.add(actPointEventMsg); + + mqBaseMsgDTO.setMsg(JSON.toJSONString(actPointEventMsgList)); + Result mqResult = SendMqMsgUtils.sendMsg(mqBaseMsgDTO); + if(!mqResult.success()){ + logger.error("发表话题积分添加失败"); + } + } + + + /** + * 查询当前组员在组内是否被禁言或已被移除 + * @Param resiGroupMemberDTO + * @return Result.class + * @Author zhaoqf + * @Date 2020.04.01 15:00 + **/ + private Result verifySilentOrRemoved(ResiGroupMemberDTO resiGroupMemberDTO){ + if(null != resiGroupMemberDTO){ + if(MemberStateConstant.SILENT.equals(resiGroupMemberDTO.getStatus())){ + //当前用户被禁言 + log.error(ModuleConstant.SLIENT_MEMBER); + throw new RenException(ModuleConstant.SLIENT_MEMBER); + }else if(MemberStateConstant.REMOVED.equals(resiGroupMemberDTO.getStatus())){ + //当前用户已被移出群 + log.error(ModuleConstant.REMOVED_MEMBER); + throw new RenException(ModuleConstant.REMOVED_MEMBER); + }else{ + return new Result(); + } + }else{ + //当前用户非组内成员 + log.error(ModuleConstant.NOT_BELONG_TO_CURRENT_GROUP); + throw new RenException(ModuleConstant.NOT_BELONG_TO_CURRENT_GROUP); + } + } + + /** + * 更新组统计缓存信息 + * @Param groupId + * @Param operation "+":plus "-":minus + * @return + * @Author zhaoqf + * @Date 2020.04.14 23:31 + **/ + private void updCacheGroupStatisticalInfo(String groupId,String operation,Integer quantity){ + + //ResiGroupRedis在get()时已经校验缓存中是否有数据,如果没有数据则从数据库中拉取并重新放入缓存 + ResiGroupInfoRedisDTO groupCache = + resiGroupRedis.get(groupId); + if(groupCache != null && StringUtils.isNotBlank(groupCache.getGroupId())){ + ResiGroupStatisticalInfoRedisDTO statisticalCache = groupCache.getGroupStatisticalInfo(); + if(null != statisticalCache){ + if(StringUtils.equals(ModuleConstant.PLUS_OPERATION,operation)){ + statisticalCache.setTotalTopics( + null == statisticalCache.getTotalTopics() ? quantity : statisticalCache.getTotalTopics() + quantity + ); + }else if(StringUtils.equals(ModuleConstant.MINUS_OPERATION,operation)){ + statisticalCache.setTotalTopics( + null == statisticalCache.getTotalTopics() ? quantity : statisticalCache.getTotalTopics() - quantity + ); + } + + groupCache.setGroupStatisticalInfo(statisticalCache); + }else{ + //没有相应的群组统计缓存信息 + } + resiGroupRedis.set(groupCache); + }else{ + //没有相应的群组缓存信息 + } + + } +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicShareLinkRecordServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicShareLinkRecordServiceImpl.java new file mode 100644 index 0000000000..d686cfc825 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicShareLinkRecordServiceImpl.java @@ -0,0 +1,267 @@ +package com.epmet.modules.topic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.IssueShareLinkRecordDTO; +import com.epmet.feign.GovIssueOpenFeignClient; +import com.epmet.modules.group.dao.ResiGroupDao; +import com.epmet.modules.group.entity.ResiGroupEntity; +import com.epmet.modules.member.dao.GroupMemeberOperationDao; +import com.epmet.modules.member.dao.ResiGroupMemberDao; +import com.epmet.modules.topic.dao.ResiTopicDao; +import com.epmet.modules.topic.dao.TopicShareLinkRecordDao; +import com.epmet.modules.topic.dao.TopicShareLinkVisitRecordDao; +import com.epmet.modules.topic.entity.TopicShareLinkRecordEntity; +import com.epmet.modules.topic.entity.TopicShareLinkVisitRecordEntity; +import com.epmet.modules.topic.service.TopicShareLinkRecordService; +import com.epmet.modules.utils.ModuleConstant; +import com.epmet.resi.group.constant.TopicShareConstant; +import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO; +import com.epmet.resi.group.dto.topic.TopicShareLinkRecordDTO; +import com.epmet.resi.group.dto.topic.form.CreateUrlFormDTO; +import com.epmet.resi.group.dto.topic.form.ShareLinkTypeFormDTO; +import com.epmet.resi.group.dto.topic.form.TopicBelongGroupFormDTO; +import com.epmet.resi.group.dto.topic.form.TopicVisitFormDTO; +import com.epmet.resi.group.dto.topic.result.CreateUrlResultDTO; +import com.epmet.resi.group.dto.topic.result.MemberRelationBetweenGroupAndGridResultDTO; +import com.epmet.resi.group.dto.topic.result.TopicBelongGroupResultDTO; +import com.epmet.resi.group.dto.topic.result.TopicVisitResultDTO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 话题分享链接表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +@Service +@Slf4j +public class TopicShareLinkRecordServiceImpl extends BaseServiceImpl implements TopicShareLinkRecordService { + + @Autowired + private TopicShareLinkVisitRecordDao visitRecordDao; + @Autowired + private ResiGroupMemberDao resiGroupMemberDao; + @Autowired + private GroupMemeberOperationDao groupMemeberOperationDao; + @Autowired + private GovIssueOpenFeignClient issueClient; + @Autowired + private ResiTopicDao topicDao; + @Autowired + private ResiGroupDao groupDao; + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TopicShareLinkRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TopicShareLinkRecordDTO.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 TopicShareLinkRecordDTO get(String id) { + TopicShareLinkRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TopicShareLinkRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TopicShareLinkRecordDTO dto) { + TopicShareLinkRecordEntity entity = ConvertUtils.sourceToTarget(dto, TopicShareLinkRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TopicShareLinkRecordDTO dto) { + TopicShareLinkRecordEntity entity = ConvertUtils.sourceToTarget(dto, TopicShareLinkRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 分享话题邀请ID + * @Param createUrlFormDTO + * @author zxc + * @date 2020/12/18 上午10:14 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public CreateUrlResultDTO getCreateUrlId(CreateUrlFormDTO form, TokenDto tokenDto) { + // 校验此人此话题是否存在邀请记录 存在直接返回 + String shareLinkId = baseDao.checkRecord(form.getTopicId(), tokenDto.getUserId()); + if (StringUtils.isNotBlank(shareLinkId)){ + return new CreateUrlResultDTO(shareLinkId); + } + // 查询话题信息 + TopicVisitResultDTO topicInfo = baseDao.selectTopicInfoById(form.getTopicId()); + if (null == topicInfo){ + throw new RenException(TopicShareConstant.NOT_EXIST_TOPIC_INFO); + } + TopicShareLinkRecordEntity entity = new TopicShareLinkRecordEntity(); + entity.setCustomerId(topicInfo.getCustomerId()); + entity.setGridId(topicInfo.getGridId()); + entity.setGroupId(topicInfo.getGroupId()); + entity.setTopicId(form.getTopicId()); + entity.setShareUserId(tokenDto.getUserId()); + entity.setInviteContent(null); + // 插入链接记录 + baseDao.insert(entity); + return new CreateUrlResultDTO(entity.getId()); + } + + /** + * @Description 查询话题所属小组 + * @Param formDTO + * @author zxc + * @date 2020/12/18 下午2:08 + */ + @Override + public TopicBelongGroupResultDTO selectTopicBelongGroup(TopicBelongGroupFormDTO formDTO) { + TopicVisitResultDTO topicInfo = baseDao.selectTopicInfoById(formDTO.getTopicId()); + if (null == topicInfo){ + throw new RenException(TopicShareConstant.NOT_EXIST_TOPIC_BELONG_GROUP); + } + TopicBelongGroupResultDTO resultDTO = new TopicBelongGroupResultDTO(); + resultDTO.setGroupId(topicInfo.getGroupId()); + resultDTO.setGridId(topicInfo.getGridId()); + return resultDTO; + } + + /** + * @Description 分享话题id获取信息 + * @Param formDTO + * @Param tokenDto + * @author zxc + * @date 2020/12/18 下午3:34 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public TopicVisitResultDTO topicVisit(TopicVisitFormDTO formDTO, TokenDto tokenDto) { + // 根据分享ID查询分享信息 + TopicShareLinkRecordEntity linkRecord = baseDao.selectById(formDTO.getShareLinkId()); + if (null == linkRecord){ + throw new RenException(TopicShareConstant.NOT_EXIST_INVITE_RECORD); + } + TopicShareLinkVisitRecordEntity entity = new TopicShareLinkVisitRecordEntity(); + entity.setCustomerId(linkRecord.getCustomerId()); + entity.setShareUserId(linkRecord.getShareUserId()); + entity.setInviteeUserId(tokenDto.getUserId()); + entity.setShareLinkRecId(formDTO.getShareLinkId()); + entity.setIsInviteRegister(NumConstant.ONE); + // 插入访问记录 + visitRecordDao.insert(entity); + // 查询记录对应的话题信息 + TopicVisitResultDTO result = baseDao.selectTopicInfoById(linkRecord.getTopicId()); + if (null == result){ + throw new RenException(TopicShareConstant.NOT_EXIST_TOPIC_INFO); + } + // 查询是否在组内,在组内的话,是否存在入组审核的状态为false + Integer userInGroup = resiGroupMemberDao.checkUserInGroup(tokenDto.getUserId(), result.getGroupId()); + if (userInGroup > NumConstant.ZERO){ + result.setAwaitAudit(false); + result.setInGroup(true); + }else { + result.setInGroup(false); + // 查询是否存在入组审核记录 + Integer awaitAudit = groupMemeberOperationDao.checkAwaitAudit(tokenDto.getUserId(), result.getGroupId()); + result.setAwaitAudit(awaitAudit > NumConstant.ZERO ? true : false); + } + return result; + } + + /** + * @Description 根据链接信息查询被邀请人在组/网格内的状态 + * @param param + * @return com.epmet.resi.group.dto.topic.result.MemberRelationBetweenGroupAndGridResultDTO + * @author wangc + * @date 2020.12.29 15:01 + */ + @Override + public MemberRelationBetweenGroupAndGridResultDTO getStatusByLinkAndInvitee(ShareLinkTypeFormDTO param) { + MemberRelationBetweenGroupAndGridResultDTO relation = new MemberRelationBetweenGroupAndGridResultDTO(); + String group = null; + if(StringUtils.equals("topic",param.getType())){ + TopicShareLinkRecordEntity shareLinkInfo = baseDao.selectById(param.getId()); + if(null != shareLinkInfo && StringUtils.isNotBlank(shareLinkInfo.getGroupId())) group = shareLinkInfo.getGroupId(); + } + if(StringUtils.isBlank(group)){ + Result issueShareLinkInfo = issueClient.shareLinkInfo(param.getId()); + if(issueShareLinkInfo.success() && null != issueShareLinkInfo.getData()){ + String issueId = issueShareLinkInfo.getData().getIssueId(); + if(StringUtils.isNotBlank(issueId)){ + group = topicDao.selectGroupIdByIssueId(issueId); + } + } + } + if(StringUtils.isBlank(group)) throw new RenException("根据分享链接Id没有找到对应的组Id"); + String userId = param.getUserId(); + + GroupMemeberOperationDTO applyRecord = groupMemeberOperationDao.selectLatestRecord(group, userId); + if(null != applyRecord && StringUtils.equals(ModuleConstant.GROUP_STATUS_UNDER_AUDITTING,applyRecord.getOperateStatus())){ + //under_auditing + relation.setAwaitAudit(true); + } + if(null != applyRecord && StringUtils.equals(ModuleConstant.AUDITING_OPERATION_APPROVAL,applyRecord.getOperateStatus())){ + //approved + relation.setInGroup(true); + relation.setInAnyGroup(true); + } + if(!relation.getInAnyGroup()) { + ResiGroupEntity groupEntity = groupDao.selectById(group); + if(null == groupEntity || StringUtils.isBlank(groupEntity.getGridId())) + throw new RenException("没有找到相应的组记录"); + List groups = resiGroupMemberDao.getGroupIdByUserIdAndGridId(groupEntity.getGridId(), userId, NumConstant.ONE_STR); + if(!CollectionUtils.isEmpty(groups)){ + relation.setInAnyGroup(true); + if(groups.contains(group)){ + relation.setInGroup(true); + log.error("查出用户{}是组{}中成员,但是没有对应的入群记录",param.getUserId(),group); + } + } + } + + return relation; + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicShareLinkVisitRecordServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicShareLinkVisitRecordServiceImpl.java new file mode 100644 index 0000000000..949cfd6bab --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicShareLinkVisitRecordServiceImpl.java @@ -0,0 +1,116 @@ +package com.epmet.modules.topic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.feign.GovIssueOpenFeignClient; +import com.epmet.modules.member.dao.GroupMemeberOperationDao; +import com.epmet.modules.member.dao.ResiGroupMemberDao; +import com.epmet.modules.topic.dao.TopicShareLinkVisitRecordDao; +import com.epmet.modules.topic.entity.TopicShareLinkVisitRecordEntity; +import com.epmet.modules.topic.service.TopicShareLinkVisitRecordService; +import com.epmet.resi.group.dto.topic.TopicShareLinkVisitRecordDTO; +import com.epmet.resi.group.dto.topic.form.SharableTopicAndInviteeFormDTO; +import com.epmet.resi.group.dto.topic.form.ShareLinkTypeFormDTO; +import com.epmet.resi.group.dto.topic.result.MemberRelationBetweenGroupAndGridResultDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 话题分享链接访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-18 + */ +@Service +public class TopicShareLinkVisitRecordServiceImpl extends BaseServiceImpl implements TopicShareLinkVisitRecordService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TopicShareLinkVisitRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TopicShareLinkVisitRecordDTO.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 TopicShareLinkVisitRecordDTO get(String id) { + TopicShareLinkVisitRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TopicShareLinkVisitRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TopicShareLinkVisitRecordDTO dto) { + TopicShareLinkVisitRecordEntity entity = ConvertUtils.sourceToTarget(dto, TopicShareLinkVisitRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TopicShareLinkVisitRecordDTO dto) { + TopicShareLinkVisitRecordEntity entity = ConvertUtils.sourceToTarget(dto, TopicShareLinkVisitRecordEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 校验邀请人与被邀请人是否存在邀请关系,如果存在则返回邀请人Id,否则返回空 + * @param param + * @return java.lang.String + * @author wangc + * @date 2020.12.18 13:56 + */ + @Override + public String checkInviteRelationship(SharableTopicAndInviteeFormDTO param) { + String inviterId = baseDao.selectByLinkIdAndInvitee(param.getShareLinkId(),param.getInviteeId()); + if(StringUtils.isNotBlank(inviterId)) baseDao.updateInviteRegister(param.getShareLinkId(),param.getInviteeId()); + return inviterId; + } + + /** + * @Description 通过邀请链接Id和被邀请人Id查询出访问记录 + * @param linkId + * @param invitee + * @return com.epmet.modules.topic.entity.TopicShareLinkVisitRecordEntity + * @author wangc + * @date 2020.12.22 09:20 + */ + @Override + public TopicShareLinkVisitRecordEntity getByLinkIdAndInvitee(String linkId, String invitee) { + return baseDao.selectRecordByLinkIdAndInvitee(linkId,invitee); + } +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java index 118ed1f5a7..37f1a3b290 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/utils/ModuleConstant.java @@ -368,4 +368,16 @@ public interface ModuleConstant extends Constant { * 群邀请二维码跳转页面 */ String CODE_INVITE_PAGE = "pages/group/group/invitation/invitation"; + + String TOPIC_CONTENT_AND_VOICE_IS_NULL = "请输入话题内容或语音"; + + /** + * 通过话题分享链接进组 + */ + String ENTER_GROUP_TYPE_TOPIC_LINK = "topic_share_link"; + + /** + * 通过议题分享链接进组 + */ + String ENTER_GROUP_TYPE_ISSUE_LINK = "issue_share_link"; } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml index 717cff838d..6823a772e7 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /resi/group @@ -126,6 +127,8 @@ openapi: method: imgSyncScan: /imgSyncScan textSyncScan: /textSyncScan + voiceAsyncScan: /voiceAsyncScan + voiceResults: /voiceResults thread: # 线程池配置 @@ -139,4 +142,18 @@ thread: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ + +#亿联云消息网关 +elink: + mq: + appId: @elink.mq.appId@ #项目接入亿联云的应用Id + token: @elink.mq.token@ #项目接入亿联云的应用token 相当于secret + host: @elink.mq.host@ #亿联云消息网关服务地址 + sendMsgPath: @elink.mq.sendMsgPath@ #发送消息路径 + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,每超过30秒,打印一次错误日志 diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.10__createDraft.sql b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.10__createDraft.sql new file mode 100644 index 0000000000..fb1b48fa46 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.10__createDraft.sql @@ -0,0 +1,76 @@ +CREATE TABLE `topic_draft` ( + `ID` varchar(64) NOT NULL COMMENT '话题草稿id', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', + `GROUP_ID` varchar(64) NOT NULL COMMENT '小组Id', + `TOPIC_CONTENT` varchar(3000) DEFAULT NULL COMMENT '话题内容', + `DRAFT_STATUS` varchar(32) NOT NULL COMMENT '话题草稿状态(审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)', + `DRAFT_REASON` varchar(128) DEFAULT NULL COMMENT '草稿审核理由', + `PROVINCE` varchar(32) DEFAULT NULL COMMENT '省', + `CITY` varchar(32) DEFAULT NULL COMMENT '市', + `AREA` varchar(32) DEFAULT NULL COMMENT '区 ', + `ADDRESS` varchar(255) NOT NULL COMMENT '地址', + `LONGITUDE` varchar(32) DEFAULT NULL COMMENT '经度', + `DIMENSION` varchar(32) DEFAULT NULL COMMENT '维度', + `TOPIC_ID` varchar(64) DEFAULT NULL COMMENT '发布成功后的话题id', + `IS_SEE` varchar(1) NOT NULL COMMENT '创建者是否可见(0是 1否)', + `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`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='话题草稿内容表'; + +CREATE TABLE `topic_draft_attachment` ( + `ID` varchar(64) NOT NULL COMMENT '附件id', + `TOPIC_DRAFT_ID` varchar(64) NOT NULL COMMENT '话题草稿id', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `ATTACHMENT_NAME` varchar(64) DEFAULT NULL COMMENT '附件名(uuid随机生成)', + `ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', + `ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型((图片 - image、视频 - video、 语音 - voice、 文档 - doc))', + `ATTACHMENT_URL` varchar(255) NOT NULL COMMENT '附件地址url', + `SORT` int(1) NOT NULL COMMENT '排序字段(按附件类型分组排序)', + `STATUS` varchar(32) NOT NULL COMMENT '附件状态(审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)\r\n现在图片是同步审核的,所以图片只有auto_passed一种状态', + `DURATION` int(11) DEFAULT NULL COMMENT '语音或视频时长,秒', + `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`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='话题草稿附件表'; + +CREATE TABLE `topic_draft_operation` ( + `ID` varchar(64) NOT NULL COMMENT '话题草稿操作日志id', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `TOPIC_DRAFT_ID` varchar(64) NOT NULL COMMENT '话题草稿id', + `OPERATE_TYPE` varchar(64) NOT NULL COMMENT '操作类型:submit:提交发布;\r\nauto_passed: 自动审核-通过;\r\nreview:自动审核-结果不确定,需要人工审核;\r\nblock: 自动审核-结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过', + `REMARK` varchar(255) DEFAULT NULL COMMENT '操作时的备注,比如驳回理由', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '操作人,API审核结果,存储为SCAN_USER或者APP_USER', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='话题草稿操作日志表'; + +CREATE TABLE `topic_draft_scan_task` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `TOPIC_DRAFT_ID` varchar(64) NOT NULL COMMENT '话题草稿Id', + `TOPIC_DRAFT_ATTACHMENT_ID` varchar(64) NOT NULL COMMENT '话题草稿附件表Id,对应dataId', + `TASK_ID` varchar(64) NOT NULL COMMENT '阿里云审核任务Id', + `STATUS` varchar(32) NOT NULL COMMENT '审核状态【auditing: 审核中;\r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;】', + `ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型(视频 - video、 语音 - voice)', + `DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '操作人,API审核结果,存储为SCAN_USER或者APP_USER', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='话题附件检测任务表'; \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.11__topicShare.sql b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.11__topicShare.sql new file mode 100644 index 0000000000..6e69f29d81 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.11__topicShare.sql @@ -0,0 +1,44 @@ +DROP TABLE IF EXISTS `topic_share_link_record`; +CREATE TABLE `topic_share_link_record` +( + `ID` varchar(64) NOT NULL COMMENT '邀请ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '话题所属网格ID', + `GROUP_ID` varchar(64) NOT NULL COMMENT '小组ID', + `TOPIC_ID` varchar(64) NOT NULL COMMENT '话题ID', + `SHARE_USER_ID` varchar(64) NOT NULL COMMENT '分享人ID(当前登录用户)', + `INVITE_CONTENT` varchar(255) DEFAULT NULL COMMENT '邀请内容', + `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 '更新时间', + PRIMARY KEY (`ID`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='话题分享链接表'; + +#================================================================================= + +DROP TABLE IF EXISTS `topic_share_link_visit_record`; +CREATE TABLE `topic_share_link_visit_record` +( + `ID` varchar(64) NOT NULL, + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `SHARE_USER_ID` varchar(64) NOT NULL COMMENT '分享人【邀请人】ID', + `INVITEE_USER_ID` varchar(64) NOT NULL COMMENT '被邀请人ID', + `SHARE_LINK_REC_ID` varchar(64) NOT NULL COMMENT '话题分享链接表id', + `IS_INVITE_REGISTER` int(11) NOT NULL COMMENT '是否邀请注册:0:是,1:不是;\n默认为1,完成注册后,回填此字段', + `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 '更新时间', + PRIMARY KEY (`ID`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='话题分享链接访问记录表'; + + +ALTER TABLE `topic_draft_attachment` + ADD COLUMN `REASON` varchar(255) NULL COMMENT '失败原因' AFTER `STATUS`; \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.8__alter_resi_topic_attachment.sql b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.8__alter_resi_topic_attachment.sql new file mode 100644 index 0000000000..b632949988 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.8__alter_resi_topic_attachment.sql @@ -0,0 +1,4 @@ +ALTER TABLE `resi_topic_attachment` +MODIFY COLUMN `ATTACHMENT_TYPE` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))' AFTER `ATTACHMENT_FORMAT`; + +UPDATE resi_topic_attachment SET ATTACHMENT_TYPE = 'image'; \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.9__alter_resi_topic_attachment.sql b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.9__alter_resi_topic_attachment.sql new file mode 100644 index 0000000000..938161ca0e --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.9__alter_resi_topic_attachment.sql @@ -0,0 +1,3 @@ +ALTER TABLE `resi_topic_attachment` +MODIFY COLUMN `SORT` int(1) NOT NULL COMMENT '排序字段' AFTER `ATTACHMENT_URL`, +ADD COLUMN `DURATION` int(11) UNSIGNED ZEROFILL NULL DEFAULT 0 COMMENT '语音或视频时长,秒' AFTER `SORT`; diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml index ccc4d1b945..d21ed5ccdd 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/group/ResiGroupDao.xml @@ -470,4 +470,48 @@ + + + diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/GroupMemeberOperationDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/GroupMemeberOperationDao.xml index 0205d7e5c5..c47f80f4d3 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/GroupMemeberOperationDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/GroupMemeberOperationDao.xml @@ -28,4 +28,15 @@ gmo.CREATED_TIME DESC LIMIT 1 + + + diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml index f125ebb551..92408b540b 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml @@ -154,4 +154,15 @@ + + + diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/.gitkeep b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicAttachmentDao.xml index 56744b02de..4df90acb9e 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicAttachmentDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicAttachmentDao.xml @@ -84,6 +84,7 @@ del_flag, revision, sort, + duration, created_by, created_time, updated_by, @@ -100,6 +101,7 @@ #{item.delFlag}, #{item.revision}, #{item.sort}, + #{item.duration}, #{item.createdBy}, now(), #{item.updatedBy}, @@ -108,5 +110,23 @@ + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentDao.xml index d154e20d6e..87f46e1efc 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicCommentDao.xml @@ -88,4 +88,13 @@ ) + + + diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml index f51b0f7216..e1e57899c9 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/ResiTopicDao.xml @@ -137,6 +137,7 @@ RESI_TOPIC_ATTACHMENT attachment WHERE attachment.DEL_FLAG = '0' + AND attachment.ATTACHMENT_TYPE = 'image' GROUP BY attachment.TOPIC_ID ) attachement2 ON @@ -176,6 +177,7 @@ RESI_TOPIC_ATTACHMENT attachment WHERE attachment.DEL_FLAG = '0' + AND attachment.ATTACHMENT_TYPE = 'image' GROUP BY attachment.TOPIC_ID ) attachement2 ON @@ -225,6 +227,7 @@ RESI_TOPIC_ATTACHMENT attachment WHERE attachment.DEL_FLAG = '0' + AND attachment.ATTACHMENT_TYPE = 'image' GROUP BY attachment.TOPIC_ID ) attachement2 ON @@ -427,6 +430,8 @@ topic.ID = attachment.TOPIC_ID AND attachment.DEL_FLAG = '0' + AND + attachment.ATTACHMENT_TYPE = 'image' WHERE topic.DEL_FLAG = '0' AND @@ -527,5 +532,43 @@ AND GROUP_ID = #{groupId} AND STATUS != 'hidden' + + + + + + + + + + diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftAttachmentDao.xml new file mode 100644 index 0000000000..cf72d88a8d --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftAttachmentDao.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftDao.xml new file mode 100644 index 0000000000..e7bbab6d1e --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftDao.xml @@ -0,0 +1,60 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftOperationDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftOperationDao.xml new file mode 100644 index 0000000000..c25307d1c7 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftOperationDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftScanTaskDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftScanTaskDao.xml new file mode 100644 index 0000000000..33a9869a66 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftScanTaskDao.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + update topic_draft_scan_task set + `STATUS` = #{status} + WHERE TASK_ID = #{taskId} + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicShareLinkRecordDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicShareLinkRecordDao.xml new file mode 100644 index 0000000000..cd75277141 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicShareLinkRecordDao.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicShareLinkVisitRecordDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicShareLinkVisitRecordDao.xml new file mode 100644 index 0000000000..01343324ee --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicShareLinkVisitRecordDao.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + UPDATE + topic_share_link_visit_record + SET + is_invite_register = 0 + WHERE + del_flag = '0' + AND + share_link_rec_id = #{linkId} + AND + invitee_user_id = #{invitee} + + \ No newline at end of file diff --git a/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/form/PublicCustomerGridListFormDTO.java b/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/form/PublicCustomerGridListFormDTO.java index 6e26721f28..6bdf608ae0 100644 --- a/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/form/PublicCustomerGridListFormDTO.java +++ b/epmet-module/resi-guide/resi-guide-client/src/main/java/com/epmet/dto/form/PublicCustomerGridListFormDTO.java @@ -15,11 +15,18 @@ import java.io.Serializable; public class PublicCustomerGridListFormDTO implements Serializable { private static final long serialVersionUID = 1L; - public interface AddUserInternalGroup { - } - - public interface AddUserShowGroup extends CustomerClientShowGroup { - } + /** + * 地区码 + * */ + @NotBlank(message = "自动定位地区码不能为空", groups = {AreaCode.class}) + private String areaCode; + /** + * 选定地区编码 + * */ + @NotBlank(message = "手动定位地区码不能为空", groups = {SelectedAreaCode.class}) + private String selectedAreaCode; + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup {} /** * 小程序appId @@ -37,15 +44,9 @@ public class PublicCustomerGridListFormDTO implements Serializable { * */ private Integer pageSize = 20; - /** - * 地区码 - * */ - private String areaCode; + public interface AreaCode extends CustomerClientShowGroup {} - /** - * 选定地区编码 - * */ - private String selectedAreaCode; + public interface SelectedAreaCode extends CustomerClientShowGroup {} /** * 是否首次位置授权(0:是 1:否) diff --git a/epmet-module/resi-guide/resi-guide-server/Dockerfile b/epmet-module/resi-guide/resi-guide-server/Dockerfile index b305936b9e..106fedc419 100644 --- a/epmet-module/resi-guide/resi-guide-server/Dockerfile +++ b/epmet-module/resi-guide/resi-guide-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./resi-guide.jar EXPOSE 8091 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file 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 dac2615943..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 @@ -117,7 +133,7 @@ public class StrangerResiGuideController { **/ @PostMapping("publiclocationgridlist") Result> publicLocationGridList(@RequestBody PublicCustomerGridListFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO); + ValidatorUtils.validateEntity(formDTO, PublicCustomerGridListFormDTO.AddUserShowGroup.class, PublicCustomerGridListFormDTO.AreaCode.class); return strangerAccessRecordService.thirdCustomerGridList(formDTO); } @@ -128,7 +144,7 @@ public class StrangerResiGuideController { **/ @PostMapping("publiclelectcdgridlist") Result> publicLelectcdGridList(@RequestBody PublicCustomerGridListFormDTO formDTO){ - ValidatorUtils.validateEntity(formDTO); + ValidatorUtils.validateEntity(formDTO, PublicCustomerGridListFormDTO.AddUserShowGroup.class, PublicCustomerGridListFormDTO.SelectedAreaCode.class); return strangerAccessRecordService.thirdCustomerGridList(formDTO); } 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-guide/resi-guide-server/src/main/resources/bootstrap.yml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml index 836ea9f4ca..9be4ac049f 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /resi/guide @@ -123,4 +124,10 @@ pagehelper: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/resi-hall/resi-hall-server/Dockerfile b/epmet-module/resi-hall/resi-hall-server/Dockerfile index c1ec1e0ba0..8e4e6cb82e 100644 --- a/epmet-module/resi-hall/resi-hall-server/Dockerfile +++ b/epmet-module/resi-hall/resi-hall-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./resi-hall.jar EXPOSE 8100 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-prod.yml b/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-prod.yml index 21b8308936..c631c116b4 100644 --- a/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-hall/resi-hall-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-hall-server: container_name: resi-hall-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-hall-server:0.3.22 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-hall-server:0.3.24 ports: - "8100:8100" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-hall/resi-hall-server/pom.xml b/epmet-module/resi-hall/resi-hall-server/pom.xml index 61c2a76ffe..a78f2f33f8 100644 --- a/epmet-module/resi-hall/resi-hall-server/pom.xml +++ b/epmet-module/resi-hall/resi-hall-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.3.22 + 0.3.24 resi-hall com.epmet diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml b/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml index 479945892d..09b4ba2437 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /resi/hall @@ -75,3 +76,9 @@ dingTalk: robot: webHook: @dingTalk.robot.webHook@ secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/resi-home/resi-home-server/Dockerfile b/epmet-module/resi-home/resi-home-server/Dockerfile index 2917a9be89..2cf4822bf1 100644 --- a/epmet-module/resi-home/resi-home-server/Dockerfile +++ b/epmet-module/resi-home/resi-home-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./resi-home.jar EXPOSE 8104 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml b/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml index 3c5dee1515..76f5542795 100644 --- a/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /resi/home @@ -74,3 +75,9 @@ dingTalk: robot: webHook: @dingTalk.robot.webHook@ secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/resi-mine/resi-mine-server/Dockerfile b/epmet-module/resi-mine/resi-mine-server/Dockerfile index 5237c843ec..4251aeceb6 100644 --- a/epmet-module/resi-mine/resi-mine-server/Dockerfile +++ b/epmet-module/resi-mine/resi-mine-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./resi-mine.jar EXPOSE 8094 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml index da86ddbb5c..def0b79e33 100644 --- a/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-mine/resi-mine-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-mine-server: container_name: resi-mine-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-mine-server:0.3.42 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-mine-server:0.3.45 ports: - "8094:8094" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-mine/resi-mine-server/pom.xml b/epmet-module/resi-mine/resi-mine-server/pom.xml index 9c58ab4a92..00ef48bf8b 100644 --- a/epmet-module/resi-mine/resi-mine-server/pom.xml +++ b/epmet-module/resi-mine/resi-mine-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.42 + 0.3.45 com.epmet resi-mine diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java index b9af883a21..45e2274be3 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/advice/controller/AdviceController.java @@ -1,6 +1,5 @@ package com.epmet.modules.advice.controller; -import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.MyAdviceListFormDTO; @@ -14,7 +13,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; -import java.util.Map; /** * @description: 用户建议controller @@ -27,9 +25,6 @@ public class AdviceController { @Autowired private AdviceService adviceService; - @Autowired - private LoginUserUtil loginUserUtil; - /** * @Description 提交建议 * @param dto 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-mine/resi-mine-server/src/main/resources/bootstrap.yml b/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml index eff0b2bbb3..48dc370737 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /resi/mine @@ -102,3 +103,9 @@ dingTalk: robot: webHook: @dingTalk.robot.webHook@ secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java index bd54ec1604..f823096f15 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/ResiPartyMemberOpenFeignClient.java @@ -84,4 +84,14 @@ public interface ResiPartyMemberOpenFeignClient { **/ @PostMapping(value = "/resi/partymember/partymemberinfo/queryPartymemberInfoByUserId", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result> queryPartymemberInfoByUserId(@RequestBody List userIdList); + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param gridIdList + * @author zy + * @description 根据网格id查询认证通过的党员信息 + * @Date 2020/7/22 12:14 + **/ + @PostMapping(value = "/resi/partymember/partymemberinfo/getPartymemberInfoByGridId", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> getPartymemberInfoByGridId(@RequestBody List gridIdList); } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java index df60a30abc..3f3ebb8c97 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/feign/fallback/ResiPartyMemberOpenFeignClientFallback.java @@ -60,5 +60,8 @@ public class ResiPartyMemberOpenFeignClientFallback implements ResiPartyMemberOp return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "queryPartymemberInfoByUserId", userIdList); } - + @Override + public Result> getPartymemberInfoByGridId(List gridIdList) { + return ModuleUtils.feignConError(ServiceConstant.RESI_PARTYMEMBER_SERVER, "getPartymemberInfoByGridId", gridIdList); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/Dockerfile b/epmet-module/resi-partymember/resi-partymember-server/Dockerfile index 11a783524f..6cd220670a 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/Dockerfile +++ b/epmet-module/resi-partymember/resi-partymember-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./resi-partymember.jar EXPOSE 8096 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-prod.yml b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-prod.yml index a6731f937b..ce9ba1ebaa 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-partymember-server: container_name: resi-partymember-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-partymember-server:0.3.58 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-partymember-server:0.3.62 ports: - "8096:8096" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-partymember/resi-partymember-server/pom.xml b/epmet-module/resi-partymember/resi-partymember-server/pom.xml index 63d0d5e4bf..9e7c958a90 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/pom.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.58 + 0.3.62 com.epmet resi-partymember diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java index 89b9d7c135..5d7d081e13 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/PartymemberInfoController.java @@ -42,7 +42,7 @@ import java.util.Map; /** - * 党员认证信息表 + * 党员认证信息表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-30 @@ -50,7 +50,7 @@ import java.util.Map; @RestController @RequestMapping("partymemberinfo") public class PartymemberInfoController { - + @Autowired private PartymemberInfoService partymemberInfoService; @@ -144,4 +144,17 @@ public class PartymemberInfoController { List list = partymemberInfoService.queryPartymemberInfoByUserId(userIdList); return new Result>().ok(list); } -} \ No newline at end of file + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param gridIdList + * @author zy + * @description 根据网格id查询认证通过的党员信息 + * @Date 2020/7/22 12:14 + **/ + @PostMapping(value = "getPartymemberInfoByGridId") + Result> getPartymemberInfoByGridId(@RequestBody List gridIdList) { + List list = partymemberInfoService.listPartymemberInfoByGridId(gridIdList); + return new Result>().ok(list); + } +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java index 53854d8253..f395beac8b 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/dao/PartymemberInfoDao.java @@ -24,7 +24,9 @@ import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.dto.partymember.form.CertifiedDetailFormDTO; import com.epmet.resi.partymember.dto.partymember.form.CertifiedFormDTO; import com.epmet.resi.partymember.dto.partymember.result.CertifiedDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyAuthProcessingCountResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -75,4 +77,22 @@ public interface PartymemberInfoDao extends BaseDao { * @Date 2020/7/22 12:19 **/ PartymemberInfoDTO queryPartymemberInfoByUserId(String userId); -} \ No newline at end of file + + /** + * @return java.util.List + * @param gridIdList + * @author yinzuomei + * @description 返回各个网格内待审核的党员数 + * @Date 2020/12/25 14:02 + **/ + List selectCountAuditting(@Param("gridIdList") List gridIdList); + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param gridIdList + * @author zy + * @description 根据网格id查询认证通过的党员信息 + * @Date 2020/7/22 12:14 + **/ + List selectListPartymemberInfoByGridId(@Param("gridIdList") List gridIdList); +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java index b8b0b39694..3290cb084f 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberInfoService.java @@ -31,7 +31,7 @@ import java.util.List; import java.util.Map; /** - * 党员认证信息表 + * 党员认证信息表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-30 @@ -153,4 +153,13 @@ public interface PartymemberInfoService extends BaseService queryPartymemberInfoByUserId(List userIdList); -} \ No newline at end of file + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param gridIdList + * @author zy + * @description 根据网格id查询认证通过的党员信息 + * @Date 2020/7/22 12:14 + **/ + List listPartymemberInfoByGridId(List gridIdList); +} 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 aa77bd8eae..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 @@ -25,7 +25,6 @@ import com.epmet.modules.partymember.redis.PartymemberInfoRedis; import com.epmet.modules.partymember.service.*; import com.epmet.modules.warmhearted.constant.ResiWarmheartedConstant; import com.epmet.modules.warmhearted.constant.ResiWarmheartedVisitConstant; -import com.epmet.redis.ResiPartyMemberRedis; import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO; import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO; import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO; @@ -81,8 +80,6 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService @Autowired private GovOrgFeignClient govOrgFeignClient; @Autowired - private ResiPartyMemberRedis resiPartyMemberRedis; - @Autowired private ResiGroupFeignClient resiGroupFeignClient; @Autowired private PartymemberAuthRecordService partymemberAuthRecordService; @@ -188,6 +185,9 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService PartymemberConfirmAutoDTO confirmAutoDTO = partymemberBaseInfoService.getPartyMemberBaseInfo(partyMemberInfoDTO); + //判断是否已注册居民,如果没有则注册居民 + isResiRegister(partyMemberInfoDTO); + //党员信息存入党员认证信息表 PartymemberInfoEntity partyMemberInfoEntity = ConvertUtils.sourceToTarget(partyMemberInfoDTO, PartymemberInfoEntity.class); @@ -267,9 +267,6 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService PartymemberConfirmAutoEntity.class)); } } - // - //判断是否已注册居民,如果没有则注册居民 - isResiRegister(partyMemberInfoDTO); //将身份证号更新到用户基础信息表中 UserBaseInfoDTO baseInfo = new UserBaseInfoDTO(); @@ -311,8 +308,6 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService } auditMessageToGov(ConvertUtils.sourceToTarget(partyMemberInfo, PartymemberInfoEntity.class), PartyMemberMessageConstant.MEMBER_APPLY_MSG); - //更新政府端:工作-基层治理-党员认证reddot - resiPartyMemberRedis.addWorkGrassrootsPartyAuthRedDotValue(infoDTO.getGridId()); return new Result(); } @@ -358,8 +353,6 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService } else { auditMessageToResi(partyMemberInfoEntity, PartyMemberMessageConstant.AUDIT_REJECT_MSG); } - //更新政府端:工作-基层治理-党员认证reddot - resiPartyMemberRedis.subtractWorkGrassrootsPartyAuthRedDotValue(manualEntity.getGridId()); return new Result(); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java index 0aea73c30b..c6ce32113b 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberInfoServiceImpl.java @@ -45,11 +45,9 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 党员认证信息表 @@ -204,19 +202,10 @@ public class PartymemberInfoServiceImpl extends BaseServiceImpl queryPartyMemberProcessingCount(List gridIdList) { - List list = new ArrayList<>(); - for (String gridId : gridIdList) { - PartyAuthProcessingCountResultDTO partyAuthProcessingCountResultDTO = new PartyAuthProcessingCountResultDTO(); - partyAuthProcessingCountResultDTO.setGridId(gridId); - Integer auditingPartyMember = resiPartyMemberRedis.queryPartyAuthProcessingCount(gridId); - if (null == auditingPartyMember) { - partyAuthProcessingCountResultDTO.setCount(0); - } else { - partyAuthProcessingCountResultDTO.setCount(auditingPartyMember); - } - list.add(partyAuthProcessingCountResultDTO); + if(CollectionUtils.isEmpty(gridIdList)){ + return Collections.EMPTY_LIST; } - return list; + return baseDao.selectCountAuditting(gridIdList); } /** @@ -241,5 +230,9 @@ public class PartymemberInfoServiceImpl extends BaseServiceImpl listPartymemberInfoByGridId(List gridIdList) { + List list = baseDao.selectListPartymemberInfoByGridId(gridIdList); + return list; + } +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedApplyController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedApplyController.java index e2da03019c..67d5b26038 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedApplyController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/controller/ResiWarmheartedApplyController.java @@ -138,7 +138,7 @@ public class ResiWarmheartedApplyController { @PostMapping("approve") public Result approve(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmAuditApproveFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - return resiWarmheartedApplyService.approve(formDTO); + return resiWarmheartedApplyService.approve(tokenDTO, formDTO); } /** @@ -160,7 +160,7 @@ public class ResiWarmheartedApplyController { @PostMapping("getdetail") public Result getDetail(@LoginUser TokenDto tokenDTO, @RequestBody ResiWarmGetDetailFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - return resiWarmheartedApplyService.getDetail(formDTO); + return resiWarmheartedApplyService.getDetail(tokenDTO, formDTO); } /** diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/dao/ResiWarmheartedApplyDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/dao/ResiWarmheartedApplyDao.java index 5467173db1..5c3a08df25 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/dao/ResiWarmheartedApplyDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/dao/ResiWarmheartedApplyDao.java @@ -23,8 +23,10 @@ import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO; import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmAuditFormDTO; import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedAuditedFromDTO; import com.epmet.resi.partymember.dto.warmhearted.form.ResiWarmheartedFormDTO; +import com.epmet.resi.partymember.dto.warmhearted.result.ResiProcessingCountResultDTO; import com.epmet.resi.partymember.dto.warmhearted.result.ResiWarmAuditResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -52,4 +54,13 @@ public interface ResiWarmheartedApplyDao extends BaseDao selectResiWarmAuditList(ResiWarmAuditFormDTO formDTO); + + /** + * @return java.util.List + * @param gridIdList + * @author yinzuomei + * @description 根据网格id,返回各个网格内待审核的热心居民申请总数 + * @Date 2020/12/25 13:54 + **/ + List selectCountAuditting(@Param("gridIdList") List gridIdList); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java index 7bd90437b1..b3c9498380 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/ResiWarmheartedApplyService.java @@ -19,6 +19,7 @@ package com.epmet.modules.warmhearted.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity; import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO; @@ -140,7 +141,7 @@ public interface ResiWarmheartedApplyService extends BaseService getDetail(ResiWarmGetDetailFormDTO formDTO); + Result getDetail(TokenDto tokenDTO, ResiWarmGetDetailFormDTO formDTO); /** * @param gridIdList diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java index cc6d73e9f0..cc9dfa5198 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/warmhearted/service/impl/ResiWarmheartedApplyServiceImpl.java @@ -20,10 +20,7 @@ package com.epmet.modules.warmhearted.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.commons.tools.constant.AppClientConstant; -import com.epmet.commons.tools.constant.EpmetRoleKeyConstant; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.*; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; @@ -51,7 +48,6 @@ import com.epmet.modules.warmhearted.dao.ResiWarmheartedApplyDao; import com.epmet.modules.warmhearted.entity.ResiWarmheartedApplyEntity; import com.epmet.modules.warmhearted.service.ResiWarmheartedApplyService; import com.epmet.modules.warmhearted.service.ResiWarmheartedVisitService; -import com.epmet.redis.ResiPartyMemberRedis; import com.epmet.resi.partymember.dto.ResiIdentityFormDTO; import com.epmet.resi.partymember.dto.warmhearted.ResiWarmheartedApplyDTO; import com.epmet.resi.partymember.dto.warmhearted.form.*; @@ -65,6 +61,7 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.*; import java.util.stream.Collectors; @@ -92,8 +89,6 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl result1 = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO); if (!result1.success() || null == result1.getData()) { - result.setCode(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode()); - result.setMsg(EpmetErrorCode.CANNOT_AUDIT_WARM.getMsg()); + if (StrConstant.SPECIAL_CUSTOMER.equals(formDTO.getCustomerId())) { + result.setCode(8201); + result.setMsg("请完善学员信息"); + } else { + result.setCode(EpmetErrorCode.CANNOT_AUDIT_WARM.getCode()); + result.setMsg(EpmetErrorCode.CANNOT_AUDIT_WARM.getMsg()); + } return result; } //1:热心居民申请行为记录表新增数据 @@ -203,7 +203,12 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl msgList = new ArrayList<>(); @@ -494,9 +523,11 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl getDetail(ResiWarmGetDetailFormDTO formDTO) { + public Result getDetail(TokenDto tokenDTO, ResiWarmGetDetailFormDTO formDTO) { Result result = new Result<>(); //1:根据申请Id查询热心居民申请审核详情 ResiWarmheartedApplyEntity entity = baseDao.selectById(formDTO.getApplyId()); if (null == entity) { - result.error(ResiWarmheartedVisitConstant.SELECT_EXCEPTION); + if (StrConstant.SPECIAL_CUSTOMER.equals(tokenDTO.getCustomerId())) { + result.error("根据申请Id未查询到组长申请详情信息"); + } else { + result.error(ResiWarmheartedVisitConstant.SELECT_EXCEPTION); + } return result; } //2:修改申请数据状态为已读 @@ -527,7 +562,11 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl resultUserInfo = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO); if (!resultUserInfo.success() || null == resultUserInfo.getData()) { - result.error(ResiWarmheartedVisitConstant.SELECT_EXCEPTION); + if (StrConstant.SPECIAL_CUSTOMER.equals(tokenDTO.getCustomerId())) { + result.error("根据申请Id未查询到组长申请详情信息"); + } else { + result.error(ResiWarmheartedVisitConstant.SELECT_EXCEPTION); + } return result; } UserResiInfoResultDTO userInfo = resultUserInfo.getData(); @@ -541,7 +580,8 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl queryResiProcessingCount(List gridIdList) { - List list = new ArrayList<>(); + //代码废弃 + /*List list = new ArrayList<>(); for (String gridId : gridIdList) { ResiProcessingCountResultDTO resiProcessingCountResultDTO = new ResiProcessingCountResultDTO(); resiProcessingCountResultDTO.setGridId(gridId); @@ -552,7 +592,10 @@ public class ResiWarmheartedApplyServiceImpl extends BaseServiceImpl - \ No newline at end of file + + + + + + + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/warmhearted/ResiWarmheartedApplyDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/warmhearted/ResiWarmheartedApplyDao.xml index 7056d086e8..c80ef467cc 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/warmhearted/ResiWarmheartedApplyDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/warmhearted/ResiWarmheartedApplyDao.xml @@ -100,4 +100,22 @@ LIMIT #{pageNo}, #{pageSize} + + \ No newline at end of file diff --git a/epmet-module/resi-voice/resi-voice-server/Dockerfile b/epmet-module/resi-voice/resi-voice-server/Dockerfile index abb56beb1c..d00b5083c5 100644 --- a/epmet-module/resi-voice/resi-voice-server/Dockerfile +++ b/epmet-module/resi-voice/resi-voice-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./resi-voice.jar EXPOSE 8106 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml b/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml index 589e4fb19e..b1bca8e761 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /resi/voice @@ -70,3 +71,9 @@ dingTalk: robot: webHook: @dingTalk.robot.webHook@ secret: @dingTalk.robot.secret@ + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-client/pom.xml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-client/pom.xml new file mode 100644 index 0000000000..5c57808384 --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-client/pom.xml @@ -0,0 +1,16 @@ + + + + epmet-openapi-adv + com.epmet + 2.0.0 + ../pom.xml + + 4.0.0 + + epmet-openapi-adv-client + + + \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/Dockerfile b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/Dockerfile new file mode 100644 index 0000000000..d15b865820 --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/Dockerfile @@ -0,0 +1,11 @@ +FROM java:8 + +RUN export LANG="zh_CN.UTF-8" +RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime +RUN echo 'Asia/Shanghai' > /etc/timezone + +COPY ./target/*.jar ./epmet-openapi-adv.jar + +EXPOSE 8115 + +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-dev.yml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-dev.yml new file mode 100644 index 0000000000..55c505363d --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-dev.yml @@ -0,0 +1,18 @@ +version: "3.7" +services: + epmet-openapi-adv-server: + container_name: epmet-openapi-adv-server-dev + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-openapi-adv-server:version_placeholder + ports: + - "8015:8015" + network_mode: host # 不会创建新的网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-openapi-adv.jar" + restart: "unless-stopped" + deploy: + resources: + limits: + cpus: '0.1' + memory: 300M \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-prod.yml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-prod.yml new file mode 100644 index 0000000000..b5a13e04e3 --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-prod.yml @@ -0,0 +1,18 @@ +version: "3.7" +services: + epmet-openapi-adv-server: + container_name: epmet-openapi-adv-server-prod + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-openapi-adv-server:0.3.3 + ports: + - "8015:8015" + network_mode: host # 不会创建新的网络 + volumes: + - "/opt/epmet-cloud-logs/prod:/logs" + environment: + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./epmet-openapi-adv.jar" + restart: "unless-stopped" + deploy: + resources: + limits: + cpus: '0.1' + memory: 600M \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-test.yml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..45d536cb2f --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/deploy/docker-compose-test.yml @@ -0,0 +1,18 @@ +version: "3.7" +services: + epmet-openapi-adv-server: + container_name: epmet-openapi-adv-server-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-openapi-adv-server:version_placeholder + ports: + - "8015:8015" + network_mode: host # 不会创建新的网络 + volumes: + - "/opt/epmet-cloud-logs/test:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./epmet-openapi-adv.jar" + restart: "unless-stopped" + deploy: + resources: + limits: + cpus: '0.1' + memory: 300M \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/pom.xml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/pom.xml new file mode 100644 index 0000000000..8dd1602e70 --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/pom.xml @@ -0,0 +1,227 @@ + + + + 0.3.3 + + epmet-openapi-adv + com.epmet + 2.0.0 + ../pom.xml + + 4.0.0 + + epmet-openapi-adv-server + + + + com.epmet + epmet-commons-mybatis + 2.0.0 + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework + spring-context-support + + + org.springframework.boot + spring-boot-starter-actuator + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-discovery + + + com.alibaba.cloud + spring-cloud-starter-alibaba-nacos-config + + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + + + + + + dev + + 8115 + dev + + + + + + epmet_adv_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + + local + + true + + + 8115 + local + + + + + + epmet_adv_user + EpmEt-db-UsEr + + 0 + 118.190.150.119 + 47379 + 123456 + + false + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + https://epmet-dev.elinkservice.cn/api/epmetscan/api + + + + test + + + 8115 + test + + + + + + epmet + elink@833066 + + 0 + r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com + 6379 + EpmEtrEdIs!q@w + + true + 192.168.10.150:8848 + 67e3c350-533e-4d7c-9f8f-faf1b4aa82ae + + + false + + + true + + + https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c + + SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19 + + + + + prod + + 8115 + prod + + + + + + epmet_adv_user + EpmEt-db-UsEr + + 0 + r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com + 6379 + EpmEtclOUdrEdIs!Q2w + + true + 192.168.11.180:8848 + bd205d23-e696-47be-b995-916313f86e99 + + + false + + + true + + + + https://oapi.dingtalk.com/robot/send?access_token=a5f66c3374b1642fe2142dbf56d5997e280172d4e8f2b546c9423a68c82ece6c + + SEC95f4f40b533ad379ea6a6d1af6dd37029383cfe1b7cd96dfac2678be2c1c3ed1 + + + + + + \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/AdvApplication.java b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/AdvApplication.java new file mode 100644 index 0000000000..61c5d3b4b8 --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/AdvApplication.java @@ -0,0 +1,15 @@ +package com.epmet; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; + +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +public class AdvApplication { + public static void main(String[] args) { + SpringApplication.run(AdvApplication.class, args); + } +} diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/aspect/RequestLogAspect.java b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..e06fdc2c95 --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.adv.aspect; + +import com.epmet.commons.tools.aspect.BaseRequestLogAspect; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 + */ +@Aspect +@Component +@Order(0) +public class RequestLogAspect extends BaseRequestLogAspect { + + @Override + @Around(value = "execution(* com.epmet.adv.controller.*Controller*.*(..)) ") + public Object proceed(ProceedingJoinPoint point) throws Throwable { + return super.proceed(point, getRequest()); + } + + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + return sra.getRequest(); + } + +} diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/config/ModuleConfigImpl.java b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..8d88549b66 --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/config/ModuleConfigImpl.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.adv.config; + +import com.epmet.commons.tools.config.ModuleConfig; +import org.springframework.stereotype.Service; + +/** + * 模块配置信息 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Service +public class ModuleConfigImpl implements ModuleConfig { + @Override + public String getName() { + return "adv"; + } +} diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/controller/AdvVideoController.java b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/controller/AdvVideoController.java new file mode 100644 index 0000000000..5c032ad562 --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/controller/AdvVideoController.java @@ -0,0 +1,28 @@ +package com.epmet.adv.controller; + +import com.epmet.adv.entity.AdvVedioEntity; +import com.epmet.adv.service.AdvVedioService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.io.IOException; + +@Controller +@RequestMapping("video") +public class AdvVideoController { + + @Autowired + private AdvVedioService advVedioService; + + @GetMapping("company-adv") + public String toVedio() throws IOException { + AdvVedioEntity enableAdvVedioEntity = advVedioService.getEnableAdvVedioEntity(); + String redirectUrl = enableAdvVedioEntity != null ? enableAdvVedioEntity.getPath() : "404"; + return String.format("redirect:%s", redirectUrl); + //response.sendRedirect("www.baidu.com"); + } + +} diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/dao/AdvVedioDao.java b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/dao/AdvVedioDao.java new file mode 100644 index 0000000000..c14da09d52 --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/dao/AdvVedioDao.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.adv.dao; + +import com.epmet.adv.entity.AdvVedioEntity; +import com.epmet.commons.mybatis.dao.BaseDao; +import org.apache.ibatis.annotations.Mapper; + +/** + * 宣传视频 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-30 + */ +@Mapper +public interface AdvVedioDao extends BaseDao { + AdvVedioEntity getEnableAdvVedioEntity(); +} \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/entity/AdvVedioEntity.java b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/entity/AdvVedioEntity.java new file mode 100644 index 0000000000..a25c6ea77e --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/entity/AdvVedioEntity.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.adv.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 宣传视频 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-30 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("adv_vedio") +public class AdvVedioEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 存储路径 + */ + private String path; + + /** + * 存储类型。aliyun_oss,local + */ + private String storeType; + + /** + * 是否启用 + */ + private Integer enable; + +} diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/service/AdvVedioService.java b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/service/AdvVedioService.java new file mode 100644 index 0000000000..38091ee496 --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/service/AdvVedioService.java @@ -0,0 +1,7 @@ +package com.epmet.adv.service; + +import com.epmet.adv.entity.AdvVedioEntity; + +public interface AdvVedioService { + AdvVedioEntity getEnableAdvVedioEntity(); +} diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/service/impl/AdvVedioServiceImpl.java b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/service/impl/AdvVedioServiceImpl.java new file mode 100644 index 0000000000..cecc710c39 --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/java/com/epmet/adv/service/impl/AdvVedioServiceImpl.java @@ -0,0 +1,18 @@ +package com.epmet.adv.service.impl; + +import com.epmet.adv.dao.AdvVedioDao; +import com.epmet.adv.entity.AdvVedioEntity; +import com.epmet.adv.service.AdvVedioService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +@Service +public class AdvVedioServiceImpl implements AdvVedioService { + @Autowired + private AdvVedioDao advVedioDao; + + public AdvVedioEntity getEnableAdvVedioEntity() { + return advVedioDao.getEnableAdvVedioEntity(); + } + +} diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/bootstrap.yml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/bootstrap.yml new file mode 100644 index 0000000000..3a3726f148 --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/bootstrap.yml @@ -0,0 +1,140 @@ +server: + port: @server.port@ + version: @version@ + servlet: + context-path: /adv + +spring: + main: + allow-bean-definition-overriding: true + application: + name: epmet-openapi-adv-server + #环境 dev|test|prod + profiles: + active: @spring.profiles.active@ + messages: + encoding: UTF-8 + basename: i18n/messages_common + jackson: + time-zone: GMT+8 + date-format: yyyy-MM-dd HH:mm:ss + redis: + database: @spring.redis.index@ + host: @spring.redis.host@ + port: @spring.redis.port@ + password: @spring.redis.password@ + timeout: 30s + datasource: + druid: + #MySQL + driver-class-name: com.mysql.cj.jdbc.Driver + url: @spring.datasource.druid.url@ + username: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + initial-size: 10 + max-active: 100 + min-idle: 10 + max-wait: 60000 + pool-prepared-statements: true + max-pool-prepared-statement-per-connection-size: 20 + time-between-eviction-runs-millis: 60000 + min-evictable-idle-time-millis: 300000 + #Oracle需要打开注释 + #validation-query: SELECT 1 FROM DUAL + test-while-idle: true + test-on-borrow: false + test-on-return: false + filter: + stat: + log-slow-sql: true + slow-sql-millis: 1000 + merge-sql: false + wall: + config: + multi-statement-allow: true + # 数据迁移工具flyway + flyway: + enabled: @spring.flyway.enabled@ + locations: classpath:db/migration + url: @spring.datasource.druid.url@ + user: @spring.datasource.druid.username@ + password: @spring.datasource.druid.password@ + baseline-on-migrate: true + baseline-version: 0 + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + #nacos的命名空间ID,默认是public + namespace: @nacos.discovery.namespace@ + #不把自己注册到注册中心的地址 + register-enabled: @nacos.register-enabled@ + ip: @nacos.ip@ + config: + enabled: @nacos.config-enabled@ + server-addr: @nacos.server-addr@ + namespace: @nacos.config.namespace@ + group: @nacos.config.group@ + file-extension: yaml +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + #实体扫描,多个package用逗号或者分号分隔 + typeAliasesPackage: com.epmet.entity + global-config: + #数据库相关配置 + db-config: + #主键类型 AUTO:"数据库ID自增", INPUT:"用户输入ID", ID_WORKER:"全局唯一ID (数字类型唯一ID)", UUID:"全局唯一ID UUID"; + id-type: ID_WORKER + #字段策略 IGNORED:"忽略判断",NOT_NULL:"非 NULL 判断"),NOT_EMPTY:"非空判断" + field-strategy: NOT_NULL + #驼峰下划线转换 + column-underline: true + banner: false + #原生配置 + configuration: + map-underscore-to-camel-case: true + cache-enabled: false + call-setters-on-nulls: true + jdbc-type-for-null: 'null' + +feign: + hystrix: + enabled: true + client: + config: + default: + loggerLevel: BASIC + httpclient: + enabled: true + + +hystrix: + command: + default: + execution: + isolation: + thread: + timeoutInMilliseconds: 60000 #缺省为1000 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 + +#pageHelper分页插件 +pagehelper: + helper-dialect: mysql + reasonable: false #分页合理化配置,例如输入页码为-1,则自动转化为最小页码1 + +dingTalk: + robot: + webHook: @dingTalk.robot.webHook@ + secret: @dingTalk.robot.secret@ diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/db/migration/V0.0.1__createAdvVedio.sql b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/db/migration/V0.0.1__createAdvVedio.sql new file mode 100644 index 0000000000..007c12b55f --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/db/migration/V0.0.1__createAdvVedio.sql @@ -0,0 +1,18 @@ +-- create database epmet_adv default character set utf8mb4; + +-- CREATE USER epmet_adv_user@'%' IDENTIFIED BY 'EpmEt-db-UsEr'; +-- GRANT ALL ON `epmet_adv%`.* TO 'epmet_adv_user'@'%'; +-- flush privileges; + +CREATE TABLE `adv_vedio` ( + `ID` varchar(64) NOT NULL COMMENT 'id' primary key , + `PATH` varchar(255) NOT NULL COMMENT '存储路径', + `STORE_TYPE` varchar(30) NOT NULL COMMENT '存储类型。aliyun_oss,local', + `ENABLE` tinyint(1) NOT NULL COMMENT '是否启用', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `DEL_FLAG` int(11) unsigned DEFAULT NULL COMMENT '删除标识 0:未删除 1:删除', + `CREATED_BY` varchar(32) DEFAULT NULL COMMENT '创建者', + `CREATED_TIME` datetime DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) DEFAULT NULL COMMENT '更新者', + `UPDATED_TIME` datetime DEFAULT NULL COMMENT '更新时间' +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='宣传视频' \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/logback-spring.xml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..06a21d317c --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/logback-spring.xml @@ -0,0 +1,169 @@ + + + + + + + + + + + + ${appname} + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + ${webHook} + ${secret} + ${appname} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/mapper/AdvVedioDao.xml b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/mapper/AdvVedioDao.xml new file mode 100644 index 0000000000..92a4993b9f --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/epmet-openapi-adv-server/src/main/resources/mapper/AdvVedioDao.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-adv/pom.xml b/epmet-openapi/epmet-openapi-adv/pom.xml new file mode 100644 index 0000000000..13490687d1 --- /dev/null +++ b/epmet-openapi/epmet-openapi-adv/pom.xml @@ -0,0 +1,21 @@ + + + + epmet-openapi + com.epmet + 2.0.0 + + pom + 4.0.0 + + epmet-openapi-adv + + + epmet-openapi-adv-client + epmet-openapi-adv-server + + + + \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-scan/Dockerfile b/epmet-openapi/epmet-openapi-scan/Dockerfile index 972fb78535..868fc70ac1 100644 --- a/epmet-openapi/epmet-openapi-scan/Dockerfile +++ b/epmet-openapi/epmet-openapi-scan/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./epmet-openapi-scan.jar EXPOSE 8107 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/constant/SysConstant.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/constant/SysConstant.java index 8d7aa5d4d0..387294c23b 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/constant/SysConstant.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/constant/SysConstant.java @@ -21,4 +21,10 @@ public class SysConstant { public static final String CODE = "code"; public static final String DATA = "data"; + + + /** + * 任务正在执行中,建议您等待一段时间(例如5s)后再查询结果。 + */ + public static final int PROCESSING=280; } 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/LabelEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/LabelEnum.java new file mode 100644 index 0000000000..7ad96f3171 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/LabelEnum.java @@ -0,0 +1,66 @@ +package com.epmet.openapi.scan.common.enu; + +import java.util.ArrayList; +import java.util.List; + +/** + * 阿里检测结果的分类字典 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/18 14:04 + */ +public enum LabelEnum { + NORMAL("normal", "正常文本"), + SPAM("spam", "含垃圾信息"), + AD("ad", "广告"), + POLITICS("politics","涉政"), + TERRORISM("terrorism","暴恐"), + ABUSE("abuse","辱骂"), + PORN("porn","色情"), + FLOOD("flood","灌水"), + CONTRABAND("contraband","违禁"), + MEANINGLESS("meaningless","无意义"), + CUSTOMIZED("customized","自定义"); + + private String code; + private String desc; + + LabelEnum(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public static List getLabelEnumList() { + List result = new ArrayList<>(); + LabelEnum[] values = LabelEnum.values(); + for (LabelEnum v : values) { + result.add(v.getCode()); + } + return result; + } + + public static String getDesc(String code) { + LabelEnum[] businessModeEnums = values(); + for (LabelEnum labelEnum : businessModeEnums) { + if (labelEnum.getCode().equals(code)) { + return labelEnum.getDesc(); + } + } + return ""; + } + 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/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/common/enu/VoiceSceneEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/VoiceSceneEnum.java new file mode 100644 index 0000000000..777b92f0d7 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/VoiceSceneEnum.java @@ -0,0 +1,47 @@ +package com.epmet.openapi.scan.common.enu; + +import java.util.ArrayList; +import java.util.List; + +/** + * 语音异步检测场景 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/9 10:12 + */ +public enum VoiceSceneEnum { + ANTISPAM("antispam", "检测场景,取值:antispam"); + + private String code; + private String desc; + + VoiceSceneEnum(String code, String desc) { + this.code = code; + this.desc = desc; + } + + public static List getVoiceSceneList() { + List result = new ArrayList<>(); + VoiceSceneEnum[] values = VoiceSceneEnum.values(); + for (VoiceSceneEnum 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/common/redis/RedisKeys.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/redis/RedisKeys.java index 3904011b00..2939bd62eb 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/redis/RedisKeys.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/redis/RedisKeys.java @@ -26,4 +26,13 @@ public class RedisKeys { public static String getWhiteList () { return rootPrefix.concat("openapi:scan:whitelist"); } + + /** + * desc: 语音检测任务,异步回调,需要根据taskId获取存储seed的Key + * @param taskId 提交检测任务API接口返回的taskId eg:1001 + * @return epmet:openapi:scan:voice:seed:1001 + */ + public static String getVoiceScanSeedKey(String taskId){ + return rootPrefix.concat("openapi:scan:voice:seed:").concat(taskId); + } } diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/RSASignature.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/RSASignature.java deleted file mode 100644 index c79906908d..0000000000 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/util/RSASignature.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.epmet.openapi.scan.common.util; - -import org.apache.commons.codec.binary.Base64; -import org.bouncycastle.util.encoders.UrlBase64; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.crypto.Cipher; -import java.io.ByteArrayInputStream; -import java.io.InputStream; -import java.security.KeyFactory; -import java.security.PrivateKey; -import java.security.PublicKey; -import java.security.Signature; -import java.security.cert.Certificate; -import java.security.cert.CertificateFactory; -import java.security.spec.PKCS8EncodedKeySpec; -import java.security.spec.X509EncodedKeySpec; - -/** - * @author jianjun liu - * @date 2020-06-05 16:48 - **/ - -public class RSASignature { - private static final Logger LOGGER = LoggerFactory.getLogger(RSASignature.class); - public static final String KEY_ALGORITHM = "RSA"; - public static final String SIGNATURE_ALGORITHM = "SHA1WithRSA"; - public static final String ENCODING = "utf-8"; - public static final String X509 = "X.509"; - - /** - * 获取私钥 - * - * @param key - * @return - * @throws Exception - */ - public static PrivateKey getPrivateKey(String key) throws Exception { - byte[] keyBytes = Base64.decodeBase64(key.getBytes(ENCODING)); - PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(keyBytes); - KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); - PrivateKey privateKey = keyFactory.generatePrivate(keySpec); - return privateKey; - } - - /** - * 获取公钥 - * - * @param key - * @return - * @throws Exception - */ - public static PublicKey getPublicKey(String key) throws Exception { - byte[] keyBytes = Base64.decodeBase64(key.getBytes(ENCODING)); - CertificateFactory certificateFactory = CertificateFactory.getInstance(X509); - InputStream in = new ByteArrayInputStream(keyBytes); - Certificate certificate = certificateFactory.generateCertificate(in); - PublicKey publicKey = certificate.getPublicKey(); - return publicKey; - } - - /** - * 使用公钥对明文进行加密,返回BASE64编码的字符串 - * - * @param publicKey - * @param plainText - * @return - */ - public static String encrypt(String publicKey, String plainText) { - try { - KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); - byte[] encodedKey = Base64.decodeBase64(publicKey.getBytes(ENCODING)); - PublicKey pubKey = keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey)); - Cipher cipher = Cipher.getInstance(KEY_ALGORITHM); - cipher.init(Cipher.ENCRYPT_MODE, pubKey); - byte[] enBytes = cipher.doFinal(plainText.getBytes()); - return new String(Base64.encodeBase64(enBytes)); - } catch (Exception e) { - LOGGER.error("rsa encrypt exception: {}", e.getMessage(), e); - } - return null; - } - - /** - * 使用私钥对明文密文进行解密 - * - * @param privateKey - * @param enStr - * @return - */ - public static String decrypt(String privateKey, String enStr) { - try { - PrivateKey priKey = getPrivateKey(privateKey); - Cipher cipher = Cipher.getInstance(KEY_ALGORITHM); - cipher.init(Cipher.DECRYPT_MODE, priKey); - byte[] deBytes = cipher.doFinal(Base64.decodeBase64(enStr)); - return new String(deBytes); - } catch (Exception e) { - LOGGER.error("rsa decrypt exception: {}", e.getMessage(), e); - } - return null; - } - - /** - * RSA私钥签名 - * - * @param content 待签名数据 - * @param privateKey 私钥 - * @return 签名值 - */ - public static String signByPrivateKey(String content, String privateKey) { - try { - PrivateKey priKey = getPrivateKey(privateKey); - Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); - signature.initSign(priKey); - signature.update(content.getBytes(ENCODING)); - byte[] signed = signature.sign(); - return new String(UrlBase64.encode(signed), ENCODING); - } catch (Exception e) { - LOGGER.error("sign error, content: {}", content, e); - } - return null; - } - - /** - * 公钥验签 - * - * @param content - * @param sign - * @param publicKey - * @return - */ - public static boolean verifySignByPublicKey(String content, String sign, String publicKey) { - try { - KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM); - byte[] encodedKey = Base64.decodeBase64(publicKey.getBytes(ENCODING)); - PublicKey pubKey = keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey)); - - Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); - signature.initVerify(pubKey); - signature.update(content.getBytes(ENCODING)); - - return signature.verify(UrlBase64.decode(sign.getBytes(ENCODING))); - - } catch (Exception e) { - LOGGER.error("verify sign error, content: {}, sign: {}", content, sign, e); - } - return false; - } - -} 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 8a0b268e50..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,16 +2,28 @@ 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; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * @author jianjun liu * @email liujianjun@yunzongnet.com @@ -52,4 +64,53 @@ public class ScanController { public Result ImgAsyncScan(@RequestBody ImgScanParam param) { return null;//scanService.sendASyncImgScan(param); } + + + /** + * @description 语音异步检测 + * @Date 2020/12/9 9:14 + **/ + @PostMapping("voiceAsyncScan") + public Result voiceAsyncScan(@RequestBody VoiceAsyncScanParam param){ + ValidatorUtils.validateEntity(param); + return scanService.sendVoiceAsyncScan(param); + } + + /** + * @param taskIds 要查询的异步检测任务的taskId列表。数组中的元素个数不超过100个 + * @author yinzuomei + * @description 语音异步检测结果查询 + * @Date 2020/12/9 11:16 + **/ + @PostMapping("voiceResults") + public Result> voiceResults(@RequestBody List taskIds){ + 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 f48937bc42..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 @@ -3,7 +3,15 @@ package com.epmet.openapi.scan.service.impl; 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; /** * desc:内容扫描接口 @@ -27,4 +35,35 @@ public interface ScanService { * @return */ public Result sendSyncImgScan(ImgScanParam imgScanParam); + + /** + * 语音异步检测 + * + * @param param + * @return com.epmet.openapi.scan.support.result.VoiceAsyncScanTaskResult + */ + Result sendVoiceAsyncScan(VoiceAsyncScanParam param); + + /** + * 语音异步检测结果查询 + * + * @param taskIds 要查询的异步检测任务的taskId列表。数组中的元素个数不超过100个 + * @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 2a5db725e2..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,34 +4,38 @@ 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.*; import com.aliyuncs.http.FormatType; import com.aliyuncs.http.HttpResponse; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.aliyuncs.http.MethodType; import com.epmet.commons.tools.utils.Result; import com.epmet.openapi.scan.common.constant.SysConstant; -import com.epmet.openapi.scan.common.enu.ImgSceneEnum; -import com.epmet.openapi.scan.common.enu.SuggestionEnum; -import com.epmet.openapi.scan.common.enu.SysResponseEnum; -import com.epmet.openapi.scan.common.enu.TextSceneEnum; +import com.epmet.openapi.scan.common.enu.*; 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.ImgScanParam; -import com.epmet.openapi.scan.support.param.ImgTask; -import com.epmet.openapi.scan.support.param.TextScanParam; -import com.epmet.openapi.scan.support.param.TextTask; -import com.epmet.openapi.scan.support.result.ScanTaskResult; -import com.epmet.openapi.scan.support.result.SceneDetailResult; -import com.epmet.openapi.scan.support.result.SyncScanResult; +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; import org.apache.http.HttpStatus; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.data.redis.core.ValueOperations; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.io.UnsupportedEncodingException; +import java.util.ArrayList; import java.util.List; +import java.util.UUID; /** * @author jianjun liu @@ -45,7 +49,8 @@ public class ScanServiceImpl implements ScanService { private String regionId; @Value("${aliyun.green.bizType}") private String bizType; - + @Autowired + private RedisTemplate redisTemplate; @Override public Result sendTextScan(TextScanParam textScanParam) { //默认参数 @@ -263,4 +268,467 @@ public class ScanServiceImpl implements ScanService { throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getMsg()); } } + + /** + * @author yinzuomei + * @description 语音异步检测 + * @Date 2020/12/9 10:02 + */ + @Override + public Result sendVoiceAsyncScan(VoiceAsyncScanParam voiceAsyncScanParam) { + //检测对象不能为空,且最多支持100个元素 + List voiceTasks = voiceAsyncScanParam.getTasks(); + if (CollectionUtils.isEmpty(voiceTasks) || voiceTasks.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())); + } + + //默认参数 + voiceAsyncScanParam.setScenes(VoiceSceneEnum.getVoiceSceneList()); + voiceAsyncScanParam.setBizType(bizType); + // 如果是语音流检测,则修改为true。现在默认为音频文件检测false + voiceAsyncScanParam.setLive(false); + voiceAsyncScanParam.setSeed(UUID.randomUUID().toString().replace("-", "")); + + VoiceAsyncScanRequest voiceAsyncScanRequest=getVoiceAsyncScanRequest(); + + try { + voiceAsyncScanRequest.setHttpContent(JSON.toJSONString(voiceAsyncScanParam).getBytes(SysConstant.UTF8), SysConstant.UTF8, FormatType.JSON); + } catch (UnsupportedEncodingException e) { + log.error("sendVoiceAsyncScan parse param exception", e); + return new Result().error(SysResponseEnum.SCAN_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_PARAM_ERROR.getMsg()); + } + log.info("语音异步检测入参:"+JSON.toJSONString(voiceAsyncScanParam,true)); + List taskList; + try { + taskList = executeSyncVoice(voiceAsyncScanRequest); + log.info("语音异步检测返参taskList:"+JSON.toJSONString(taskList,true)); + } catch (ExecuteHttpException e) { + log.error("sendVoiceAsyncScan execute Exception", e); + return new Result().error(e.getCode(), e.getMsg()); + } + //成功返回 + VoiceAsyncScanTaskResult resultDto=new VoiceAsyncScanTaskResult(); + resultDto.setSeed(voiceAsyncScanParam.getSeed()); + List successList = new ArrayList<>(); + List failedList = new ArrayList<>(); + taskList.forEach(taskDetail -> { + if (HttpStatus.SC_OK == taskDetail.getCode()) { + successList.add(taskDetail); + } else { + failedList.add(taskDetail); + } + }); + resultDto.setSuccessTasks(successList); + resultDto.setFailTasks(failedList); + resultDto.setAllSuccess(resultDto.isAllSuccess()); + if (StringUtils.isNotBlank(voiceAsyncScanParam.getCallback())) { + // 存储seed和 任务id、dataId的关系 用于回调鉴权 + log.info("need to save seed and taskId、dataId的关系"); + ValueOperations valueOperations=redisTemplate.opsForValue(); + taskList.forEach(task -> { + String seedKey = RedisKeys.getVoiceScanSeedKey(task.getTaskId()); + valueOperations.set(seedKey,voiceAsyncScanParam.getSeed()); + }); + } + return new Result().ok(resultDto); + } + + /** + * @param + * @author yinzuomei + * @description 构造语音异步检测请求对象 + * @Date 2020/12/9 10:44 + **/ + private VoiceAsyncScanRequest getVoiceAsyncScanRequest() { + VoiceAsyncScanRequest voiceAsyncScanRequest = new VoiceAsyncScanRequest(); + // 指定api返回格式 + voiceAsyncScanRequest.setAcceptFormat(FormatType.JSON); + // 指定请求方法 + voiceAsyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); + voiceAsyncScanRequest.setEncoding(SysConstant.UTF8); + voiceAsyncScanRequest.setRegionId(regionId); + voiceAsyncScanRequest.setConnectTimeout(3000); + voiceAsyncScanRequest.setReadTimeout(6000); + return voiceAsyncScanRequest; + } + + /** + * @param voiceAsyncScanRequest + * @author yinzuomei + * @description 解析返参 + * @Date 2020/12/9 10:44 + **/ + private List executeSyncVoice(AcsRequest voiceAsyncScanRequest) { + try { + HttpResponse httpResponse = IAcsClientUtil.getIAcsClient().doAction(voiceAsyncScanRequest); + + if (httpResponse.isSuccess()) { + + JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8")); + //后面注释掉此日志 + log.info("VoiceAsyncScanRequest原生接口返参:" + JSON.toJSONString(scrResponse, true)); + + if (HttpStatus.SC_OK == scrResponse.getInteger(SysConstant.CODE)) { + + //获取data列表 + JSONArray dataResults = scrResponse.getJSONArray(SysConstant.DATA); + List resultList = dataResults.toJavaList(VoiceAsyncScanTaskDataDTO.class); + //成功返回 + return resultList; + + } else { + + log.warn("executeSyncVoice 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("executeSyncVoice 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("executeSyncVoice exception IAcsClientUtil do action exception", e); + throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getMsg()); + } + } + + + /** + * @param taskIds 要查询的异步检测任务的taskId列表。数组中的元素个数不超过100个 + * @author yinzuomei + * @description 语音异步检测结果查询 + * @Date 2020/12/9 11:17 + **/ + @Override + public Result> voiceResults(List taskIds) { + //检测对象不能为空,且最多支持100个元素 + if (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())); + } + + VoiceAsyncScanResultsRequest request=getVoiceAsyncScanResultsRequest(); + try { + request.setHttpContent(JSON.toJSONString(taskIds).getBytes(SysConstant.UTF8), SysConstant.UTF8, FormatType.JSON); + } catch (UnsupportedEncodingException e) { + log.error("voiceResults parse param exception", e); + return new Result>().error(SysResponseEnum.SCAN_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_PARAM_ERROR.getMsg()); + } + + // log.info("语音异步检测结果查询入参:"+JSON.toJSONString(taskIds,true)); + + try { + HttpResponse httpResponse = IAcsClientUtil.getIAcsClient().doAction(request); + if (httpResponse.isSuccess()) { + + JSONObject scrResponse=JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8")); + //后面注释掉此返参 + log.info("VoiceAsyncScanResultsRequest原生接口返参:"+JSON.toJSONString(scrResponse, true)); + if (HttpStatus.SC_OK == scrResponse.getInteger(SysConstant.CODE)) { + //获取data列表 + JSONArray dataResults = scrResponse.getJSONArray(SysConstant.DATA); + List resultList = dataResults.toJavaList(VoiceAsyncScanResult.class); + List resultData=processVoiceAsyncScanResult(resultList); + //成功返回 + return new Result>().ok(resultData); + + }else{ + + log.warn("voiceResults 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("语音异步检测结果查询预警 getVoiceAsyncScanResult 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("voiceResults exception IAcsClientUtil do action exception", e); + throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getMsg()); + } + + } + + private List processVoiceAsyncScanResult(List resultList) { + List list = new ArrayList<>(); + for (VoiceAsyncScanResult voiceAsyncScanResult : resultList) { + if (SysConstant.PROCESSING == voiceAsyncScanResult.getCode()) { + //280:表示处理中,需要继续轮询 + continue; + } + VoiceAsyncScanResult dto = ConvertUtils.sourceToTarget(voiceAsyncScanResult, VoiceAsyncScanResult.class); + if (HttpStatus.SC_OK == voiceAsyncScanResult.getCode()) { + if (!CollectionUtils.isEmpty(voiceAsyncScanResult.getResults()) && voiceAsyncScanResult.getResults().size() > NumConstant.ZERO) { + //目前只有一个检测场景,所以只判断返回来的第一个场景 + VoiceAsyncScanResultDTO voiceAsyncScanResultDTO = voiceAsyncScanResult.getResults().get(NumConstant.ZERO); + if (null != voiceAsyncScanResultDTO) { + dto.setLabel(voiceAsyncScanResultDTO.getLabel()); + dto.setLabelDesc(LabelEnum.getDesc(voiceAsyncScanResultDTO.getLabel())); + dto.setSuggestion(voiceAsyncScanResultDTO.getSuggestion()); + } + } + } else if(HttpStatus.SC_NOT_FOUND == voiceAsyncScanResult.getCode()) { + dto.setSuggestion(SuggestionEnum.REVIEW.getCode()); + dto.setLabel(NumConstant.EMPTY_STR); + dto.setLabelDesc("智能检测任务失败,结果已失效," + SuggestionEnum.REVIEW.getDesc()); + }else{ + //其他:表示任务失败 + dto.setSuggestion(SuggestionEnum.REVIEW.getCode()); + dto.setLabel(NumConstant.EMPTY_STR); + dto.setLabelDesc("智能检测任务失败," + SuggestionEnum.REVIEW.getDesc()); + } + list.add(dto); + } + return list; + } + + private VoiceAsyncScanResultsRequest getVoiceAsyncScanResultsRequest(){ + VoiceAsyncScanResultsRequest getResultsRequest = new VoiceAsyncScanResultsRequest(); + // 指定API返回格式。 + getResultsRequest.setAcceptFormat(FormatType.JSON); + // 指定请求方法。 + getResultsRequest.setMethod(com.aliyuncs.http.MethodType.POST); + getResultsRequest.setEncoding(SysConstant.UTF8); + getResultsRequest.setRegionId(regionId); + /** + * 请务必设置超时时间。 + */ + getResultsRequest.setConnectTimeout(3000); + getResultsRequest.setReadTimeout(6000); + 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/VoiceAsyncScanParam.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/VoiceAsyncScanParam.java new file mode 100644 index 0000000000..baa8e51be0 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/VoiceAsyncScanParam.java @@ -0,0 +1,68 @@ +package com.epmet.openapi.scan.support.param; + +import lombok.Data; + +import javax.validation.Valid; +import javax.validation.constraints.NotEmpty; +import java.io.Serializable; +import java.util.List; + +/** + * 音频审查 入参 + * 参考文档:https://help.aliyun.com/document_detail/89630.html?spm=a2c4g.11186623.2.12.51a32dbfW6AdqV#reference-bcf-3nk-z2b + * @author yinzuomei@elink-cn.com + * @date 2020/12/9 9:07 + */ +@Data +public class VoiceAsyncScanParam implements Serializable { + private static final long serialVersionUID = 3408043673247901184L; + + /** + * 是否开启回调 + */ + private Boolean openCallBack; + + /** + * 不必填 + * 该字段用于标识您的业务场景。您可以通过内容安全控制台创建业务场景(具体操作,请参见自定义机审标准),或者提交工单联系我们帮助您创建业务场景。 + */ + private String bizType; + + /** + * 必填 + * 检测场景,取值:antispam。 + */ + private List scenes; + + /** + * 不必填 + * 是否为语音流(例如直播流)检测。取值: + * true:表示语音流检测。 + * false(默认):表示音频文件检测。 + */ + private Boolean live; + + /** + * 不必填 + * 是否为近线检测模式。 取值: + * true:表示近线检测模式。近线检测模式下,您提交的任务不保证能够实时处理,但是可以排队并在24小时内开始检测。 + * false(默认):表示实时检测模式。对于超过了并发路数限制的检测请求会直接拒绝。 + * 说明 该参数仅适用于音频文件检测,不适用于语音流检测。 + */ + private Boolean offline; + + /** + * 异步检测结果回调地址,执行异步审查内容时 必填 + */ + private String callback; + + /** + * 随机字符串,该值用于回调通知请求中的签名,使用callback时 必填 + */ + private String seed; + + @Valid + @NotEmpty(message = "任务列表不能为空") + private List tasks; + +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/VoiceTask.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/VoiceTask.java new file mode 100644 index 0000000000..89f4333bba --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/VoiceTask.java @@ -0,0 +1,31 @@ +package com.epmet.openapi.scan.support.param; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 语音异步检测 对象 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/9 10:16 + */ +@Data +public class VoiceTask implements Serializable { + /** + * 不必填 + * 要检测的数据id 非必填 + * 检测对象对应的数据ID。 + * 由大小写英文字母、数字、下划线(_)、短划线(-)、英文句号(.)组成,不超过128个字符,可以用于唯一标识您的业务数据。 + * */ + @NotBlank(message = "dataId不能为空") + private String dataId; + + /** + * 必填 + * 需要检测的音频文件或语音流的下载地址。 + */ + @NotBlank(message = "音频URL不能为空") + private String url; +} 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/VoiceAsyncScanDetailDTO.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanDetailDTO.java new file mode 100644 index 0000000000..7e74caf5a6 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanDetailDTO.java @@ -0,0 +1,47 @@ +package com.epmet.openapi.scan.support.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 语音异步检测结果查询结果返参 -data-result-detail详情 + * 语音对应的文本详情。每一句文本对应一个元素,包含一个或者多个元素。关于每个元素的结构描述 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/9 11:11 + */ +@Data +public class VoiceAsyncScanDetailDTO implements Serializable { + private static final long serialVersionUID = -2664219492371705160L; + /** + * 句子开始的时间,单位:秒。 + */ + private Integer startTime; + + /** + * 句子结束的时间,单位:秒。 + */ + private Integer endTime; + + /** + * 语音转换成文本的结果。 + */ + private String text; + + /** + * 检测结果的分类。取值: + * normal:正常文本 + * spam:含垃圾信息 + * ad:广告 + * politics:涉政 + * terrorism:暴恐 + * abuse:辱骂 + * porn:色情 + * flood:灌水 + * contraband:违禁 + * meaningless:无意义 + * customized:自定义(例如命中自定义关键词) + */ + private String label; +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanResult.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanResult.java new file mode 100644 index 0000000000..1cbf3dab4a --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanResult.java @@ -0,0 +1,89 @@ +package com.epmet.openapi.scan.support.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 语音异步检测结果查询结果返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/9 10:56 + */ +@Data +public class VoiceAsyncScanResult implements Serializable { + private static final long serialVersionUID = 8702129292884498023L; + + /** + * 检测对象对应的数据ID。 + */ + private String dataId; + + /** + * 检测任务的ID + */ + private String taskId; + + /** + * 检测结果的分类。取值: + * normal:正常文本 + * spam:含垃圾信息 + * ad:广告 + * politics:涉政 + * terrorism:暴恐 + * abuse:辱骂 + * porn:色情 + * flood:灌水 + * contraband:违禁 + * meaningless:无意义 + * customized:自定义(例如命中自定义关键词) + */ + private String label; + + /** + * labelDesc是对label的说明,包含两种特殊说明: + * (1)如果检测任务失败labelDesc:智能检测任务失败,结果已失效,需要人工审核 + * (2)如果检测结果失效labelDesc:智能检测任务失败,需要人工审核 + */ + private String labelDesc; + + /** + * 建议您执行的后续操作。取值: + * pass:结果正常,无需进行其余操作。 + * review:结果不确定,需要进行人工审核。 + * block:结果违规,建议直接删除或者限制公开。 + */ + private String suggestion; + + + /** + * 错误码,和HTTP状态码一致。 + * 200:表示检测成功。 + * 280:表示处理中,需要继续轮询。 + * 其他:表示任务失败。 + * 更多信息,请参见公共错误码。 + */ + @JsonIgnore + private Integer code; + /** + * 错误描述信息。 + */ + @JsonIgnore + private String msg; + + /** + * 暂时没用,所以返回忽略 + */ + @JsonIgnore + private String url; + + /** + * 检测成功(code=200)时,返回的检测结果。该结果包含一个或多个元素,每个元素是个结构体,对应一个场景。关于每个元素的结构描述,请参见result。 + * 暂时不展示审核结果明细 + */ + @JsonIgnore + private List results; + +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanResultDTO.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanResultDTO.java new file mode 100644 index 0000000000..34f3280a6f --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanResultDTO.java @@ -0,0 +1,57 @@ +package com.epmet.openapi.scan.support.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 语音异步检测结果查询结果返参 -data-result详情 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/9 11:07 + */ +@Data +public class VoiceAsyncScanResultDTO implements Serializable { + private static final long serialVersionUID = 4602226363259983753L; + /** + * 检测场景,和调用请求中的场景对应。取值:antispam。 + */ + private String scene; + + /** + * 检测结果的分类。取值: + * normal:正常文本 + * spam:含垃圾信息 + * ad:广告 + * politics:涉政 + * terrorism:暴恐 + * abuse:辱骂 + * porn:色情 + * flood:灌水 + * contraband:违禁 + * meaningless:无意义 + * customized:自定义(例如命中自定义关键词) + */ + private String label; + + /** + * 建议您执行的后续操作。取值: + * pass:结果正常,无需进行其余操作。 + * review:结果不确定,需要进行人工审核。 + * block:结果违规,建议直接删除或者限制公开。 + */ + private String suggestion; + + /** + * 置信度分数,取值范围:0(表示置信度最低)~100(表示置信度最高)。 + * 如果suggestion为pass,则置信度越高,表示内容正常的可能性越高;如果suggestion为review或block,则置信度越高,表示内容违规的可能性越高。 + * 注意 该值仅作为参考,强烈建议您不要在业务中使用。建议您参考suggestion和label(或者部分接口返回的sublabel)结果用于内容违规判定。 + */ + private Float rate; + + /** + * 语音对应的文本详情。每一句文本对应一个元素,包含一个或者多个元素。关于每个元素的结构描述, + */ + private List details; +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanTaskDataDTO.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanTaskDataDTO.java new file mode 100644 index 0000000000..ce43fec932 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanTaskDataDTO.java @@ -0,0 +1,40 @@ +package com.epmet.openapi.scan.support.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * 语音异步检测,返回检测对象列表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/9 16:38 + */ +@Data +public class VoiceAsyncScanTaskDataDTO implements Serializable { + /** + * 错误码,和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/VoiceAsyncScanTaskResult.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanTaskResult.java new file mode 100644 index 0000000000..2dcbecc398 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/result/VoiceAsyncScanTaskResult.java @@ -0,0 +1,46 @@ +package com.epmet.openapi.scan.support.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 语音异步检测,返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/9 9:23 + */ +@Data +public class VoiceAsyncScanTaskResult implements Serializable { + private static final long serialVersionUID = 8702129292884498023L; + /** + * 随机字符串,该值用于回调通知请求中的签名。 + */ + 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/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-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml index 2c2a29d61a..0c5c04d86e 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /epmetscan @@ -82,3 +83,9 @@ dingTalk: webHook: @dingTalk.robot.webHook@ secret: @dingTalk.robot.secret@ +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 + diff --git a/epmet-openapi/epmet-openapi-scan/src/test/java/VoiceAsyncScanRequestSample.java b/epmet-openapi/epmet-openapi-scan/src/test/java/VoiceAsyncScanRequestSample.java new file mode 100644 index 0000000000..617e6246d1 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/test/java/VoiceAsyncScanRequestSample.java @@ -0,0 +1,90 @@ +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.green.model.v20180509.VoiceAsyncScanRequest; +import com.aliyuncs.http.FormatType; +import com.aliyuncs.http.HttpResponse; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.profile.IClientProfile; + +import java.util.*; + +/** + * 提交语音异步检测任务 demo + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/8 21:51 + */ +public class VoiceAsyncScanRequestSample extends BaseSample { + + + + public static void main(String[] args) throws Exception { + + //请替换成您自己的AccessKey ID、AccessKey Secret。 + IClientProfile profile = DefaultProfile.getProfile("cn-shanghai", + "LTAI4G6Fv6uTzQbpsayATHq4", //您自己的AccessKey ID + "QevMw1RYCwQUG3RSMPq1J6EAfmSblo");//您自己的AccessKey Secret + final IAcsClient client = new DefaultAcsClient(profile); + + VoiceAsyncScanRequest asyncScanRequest = new VoiceAsyncScanRequest(); //class different vs common + asyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定API返回格式。 + asyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法。 + asyncScanRequest.setRegionId("cn-shanghai"); + asyncScanRequest.setConnectTimeout(3000); + asyncScanRequest.setReadTimeout(6000); + + List> tasks = new ArrayList>(); + Map task1 = new LinkedHashMap(); + // 请将下面的地址修改为要检测的语音文件的地址。 + task1.put("dataId","voice1"); + task1.put("url", "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20201208/6480bd6be9f14a458162218cea84dfa5.aac"); + + Map task2 = new LinkedHashMap(); + task2.put("dataId","voice2"); + task2.put("url", "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet/test/20201208/b566d94fd7114ffb9a203e80c22ebb96.aac"); + + tasks.add(task1); + tasks.add(task2); + + JSONObject data = new JSONObject(); + + System.out.println("==========Task count:" + tasks.size()); + data.put("scenes", Arrays.asList("antispam")); + data.put("tasks", tasks); + // 如果是语音流检测,则修改为true。 + data.put("live", false); + asyncScanRequest.setHttpContent(data.toJSONString().getBytes("UTF-8"), "UTF-8", FormatType.JSON); + System.out.println("接口入参:"+JSON.toJSONString(data, true)); + + try { + HttpResponse httpResponse = client.doAction(asyncScanRequest); + + if (httpResponse.isSuccess()) { + JSONObject scrResponse = JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8")); + System.out.println("接口返参:"+JSON.toJSONString(scrResponse, true)); + if (200 == scrResponse.getInteger("code")) { + JSONArray taskResults = scrResponse.getJSONArray("data"); + for (Object taskResult : taskResults) { + Integer code = ((JSONObject) taskResult).getInteger("code"); + if (200 == code) { + final String taskId = ((JSONObject) taskResult).getString("taskId"); + System.out.println("submit async task success, taskId = [" + taskId + "]"); + } else { + System.out.println("task process fail: " + code); + } + } + } else { + System.out.println("detect not success. code: " + scrResponse.getInteger("code")); + } + } else { + System.out.println("response not success. status: " + httpResponse.getStatus()); + } + } catch (Exception e) { + e.printStackTrace(); + } + + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/test/java/VoiceAsyncScanResultsRequestSample.java b/epmet-openapi/epmet-openapi-scan/src/test/java/VoiceAsyncScanResultsRequestSample.java new file mode 100644 index 0000000000..85d268f175 --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/test/java/VoiceAsyncScanResultsRequestSample.java @@ -0,0 +1,113 @@ +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.aliyuncs.DefaultAcsClient; +import com.aliyuncs.IAcsClient; +import com.aliyuncs.green.model.v20180509.VoiceAsyncScanResultsRequest; +import com.aliyuncs.http.FormatType; +import com.aliyuncs.http.HttpResponse; +import com.aliyuncs.profile.DefaultProfile; +import com.aliyuncs.profile.IClientProfile; + +import java.util.*; + +/** + * 查询异步语音检测结果。 + * + * @author yinzuomei@elink-cn.com + * @date 2020/12/8 22:08 + */ +public class VoiceAsyncScanResultsRequestSample extends BaseSample { + + + public static void main(String[] args) throws Exception { + // 请替换成您自己的AccessKey ID、AccessKey Secret。 + IClientProfile profile = DefaultProfile + .getProfile("cn-shanghai", + "LTAI4G6Fv6uTzQbpsayATHq4", + "QevMw1RYCwQUG3RSMPq1J6EAfmSblo"); + final IAcsClient client = new DefaultAcsClient(profile); + //提交语音异步检测任务后返回的taskId + pollingScanResult(client, Arrays.asList("vc_f_7WZZ01BCH0q6ZnM3g1OKGG-1tAaZ7", "vc_f_6AKaBxy4HdG5bruQ0JwweV-1tAaJi")); + // pollingScanResult(client, "vc_f_6AKaBxy4HdG5bruQ0JwweV-1tAaJi"); + } + + public static void pollingScanResult(IAcsClient client, List taskIdList) throws InterruptedException { + int failCount = 0; + boolean stop = false; + do { + // 设置每10秒查询一次。 + Thread.sleep(10 * 1000); + JSONObject scanResult = getScanResult(client, taskIdList); + System.out.println("接口完整返参:"+JSON.toJSONString(scanResult, true)); + if (scanResult == null || 200 != scanResult.getInteger("code")) { + failCount++; + System.out.println("请求失败,get result fail, failCount=" + failCount); + if (scanResult != null) { + System.out.println("请求失败,错误信息errorMsg:" + scanResult.getString("msg")); + } + if (failCount > 20) { + break; + } + continue; + } + + JSONArray taskResults = scanResult.getJSONArray("data"); + if (taskResults.isEmpty()) { + System.out.println("请求成功,but data is empty"); + break; + } + System.out.println("data.size=" + taskResults.size()); + for (Object taskResult : taskResults) { + JSONObject result = (JSONObject) taskResult; + Integer code = result.getInteger("code"); + String taskId = result.getString("taskId"); + if (280 == code) { + System.out.println("taskId=" + taskId + ": processing status: " + result.getString("msg")); + } else if (200 == code) { + System.out.println("taskId=" + taskId + "请求成功,返参:" + JSON.toJSONString(taskResult, true)); + stop = true; + } else { + System.out.println("taskId=" + taskId + "请求失败,返参:" + JSON.toJSONString(taskResult, true)); + stop = true; + } + } + } while (!stop); + } + + private static JSONObject getScanResult(IAcsClient client, List taskIdList) { + VoiceAsyncScanResultsRequest getResultsRequest = new VoiceAsyncScanResultsRequest(); + getResultsRequest.setAcceptFormat(FormatType.JSON); // 指定API返回格式。 + getResultsRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法。 + getResultsRequest.setEncoding("utf-8"); + getResultsRequest.setRegionId("cn-shanghai"); + + + List> tasks = new ArrayList>(); + for (String taskId : taskIdList) { + Map task1 = new LinkedHashMap(); + task1.put("taskId", taskId); + tasks.add(task1); + } + + /** + * 请务必设置超时时间。 + */ + getResultsRequest.setConnectTimeout(3000); + getResultsRequest.setReadTimeout(6000); + + try { + getResultsRequest.setHttpContent(JSON.toJSONString(tasks).getBytes("UTF-8"), "UTF-8", FormatType.JSON); + + HttpResponse httpResponse = client.doAction(getResultsRequest); + if (httpResponse.isSuccess()) { + return JSON.parseObject(new String(httpResponse.getHttpContent(), "UTF-8")); + } else { + System.out.println("response not success. status: " + httpResponse.getStatus()); + } + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } +} diff --git a/epmet-openapi/pom.xml b/epmet-openapi/pom.xml index 9db62073f3..fd15705343 100644 --- a/epmet-openapi/pom.xml +++ b/epmet-openapi/pom.xml @@ -13,6 +13,7 @@ epmet-openapi epmet-openapi-scan + epmet-openapi-adv \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserWechatDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserWechatDTO.java index 0f307c3d47..1d794e0c30 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserWechatDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/UserWechatDTO.java @@ -110,4 +110,9 @@ public class UserWechatDTO implements Serializable{ //@JsonIgnore private String sessionKey; + + /** + * 客户ID + */ + private String customerId; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AfterRegisterResidentInSharableLinkFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AfterRegisterResidentInSharableLinkFormDTO.java new file mode 100644 index 0000000000..24c5735440 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/AfterRegisterResidentInSharableLinkFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 在链接中完成了注册居民之后的入参DTO 主要是为了给邀请人发送积分事件,并更改邀请关系中的"是否通过邀请注册的居民"标识 + * @ClassName AfterRegisterResidentInSharableLinkFormDTO + * @Auth wangc + * @Date 2020-12-18 16:25 + */ +@Data +public class AfterRegisterResidentInSharableLinkFormDTO implements Serializable { + private static final long serialVersionUID = 6921156923900693361L; + + /** + * 分享链接 + */ + @NotBlank(message = "链接Id不能为空") + private String shareLinkId; + + /** + * 链接类型 issue议题 topic话题 + */ + @NotBlank(message = "链接类型不能为空") + private String linkType; + + /** + * 受邀人Id + */ + @NotBlank(message = "用户Id不能为空") + private String inviteeId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SubmitAdviceFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SubmitAdviceFormDTO.java index b4dae41cbd..ef4b246fc4 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SubmitAdviceFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/SubmitAdviceFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.form; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.Pattern; import java.io.Serializable; import java.util.List; @@ -36,6 +37,7 @@ public class SubmitAdviceFormDTO implements Serializable { /** * 电话号码可为空 存*,不为空需校验 */ + @Pattern(regexp = "^1[3456789]\\d{9}$", message = "请输入正确的手机号") private String phone; /** 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/dto/form/WxUserInfoFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/WxUserInfoFormDTO.java index 2e1fee31da..832f3c127c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/WxUserInfoFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/WxUserInfoFormDTO.java @@ -24,10 +24,10 @@ public class WxUserInfoFormDTO implements Serializable { /** * 性别0未知1男性2女性 */ - @NotBlank(message = "性别不能为空") + //@NotBlank(message = "性别不能为空") private String gender; - @NotBlank(message = "头像不能为空") + //@NotBlank(message = "头像不能为空") private String avatarUrl; //@NotBlank(message = "所在省份不能为空") 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 b31f94ddff..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 @@ -469,4 +469,21 @@ public interface EpmetUserOpenFeignClient { @PostMapping(value = "epmetuser/staffrole/specificrolesstaffs", consumes = MediaType.APPLICATION_JSON_VALUE) Result> specificRolesStaffs(RolesUsersListFormDTO rolesUsersListFormDTO); + + /** + * 为客户初始化政府端工作人员角色 + * @param customerId + * @return + */ + @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 69371a19cd..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 @@ -331,4 +331,14 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result> specificRolesStaffs(RolesUsersListFormDTO rolesUsersListFormDTO) { 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/Dockerfile b/epmet-user/epmet-user-server/Dockerfile index a105a5bb0e..0d13a2021f 100644 --- a/epmet-user/epmet-user-server/Dockerfile +++ b/epmet-user/epmet-user-server/Dockerfile @@ -8,4 +8,4 @@ COPY ./target/*.jar ./epmet-user.jar EXPOSE 8087 -ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file +ENTRYPOINT ["sh", "-c", "exec $RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml index 6e1396c219..6cbbbfe1c4 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.129 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.138 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index 853b49f1e4..847367216c 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.129 + 0.3.138 com.epmet epmet-user @@ -100,6 +100,24 @@ 2.0.0 compile + + com.epmet + resi-group-client + 2.0.0 + compile + + + com.epmet + gov-issue-client + 2.0.0 + compile + + + + com.epmet + epmet-commons-rocketmq + 2.0.0 + 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/UserAdviceController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java index e33e672739..8ad9e5da00 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserAdviceController.java @@ -25,8 +25,8 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.group.AddGroup; -import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.UserAdviceDTO; import com.epmet.dto.form.AdviceListFormDTO; import com.epmet.dto.form.MyAdviceListFormDTO; @@ -47,7 +47,6 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Map; -import java.util.regex.Pattern; /** @@ -181,11 +180,7 @@ public class UserAdviceController { @PostMapping("submitadvice") public Result submitAdvice(@RequestBody SubmitAdviceFormDTO dto){ ValidatorUtils.validateEntity(dto); - if (StringUtils.isNotBlank(dto.getPhone())){ - if (!Pattern.matches("^1[3456789]\\d{9}$",dto.getPhone())){ - throw new RenException("手机号格式错误"); - } - }else { + if (StringUtils.isBlank(dto.getPhone())) { dto.setPhone("*"); } userAdviceService.submitAdvice(dto,loginUserUtil.getLoginUserId()); 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/controller/UserResiInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java index 604c8ac22b..e4f54f6aa7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserResiInfoController.java @@ -17,7 +17,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.AssertUtils; @@ -31,6 +33,7 @@ import com.epmet.dto.result.IssueInitiatorResultDTO; import com.epmet.dto.result.UserResiInfoResultDTO; import com.epmet.excel.UserResiInfoExcel; import com.epmet.service.UserResiInfoService; +import jdk.nashorn.internal.parser.Token; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -198,4 +201,12 @@ public class UserResiInfoController { userResiInfoService.editMobile(formDTO); return new Result(); } + + @PostMapping("submitinlink") + public Result submitInLink(@RequestBody AfterRegisterResidentInSharableLinkFormDTO param, @LoginUser TokenDto token){ + param.setInviteeId(token.getUserId()); + ValidatorUtils.validateEntity(param); + userResiInfoService.submitInLink(param); + return new Result(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java index f7875d63d5..5992dfb720 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java @@ -77,4 +77,6 @@ public interface GovStaffRoleDao extends BaseDao { int updateSortById(@Param("roleId") String roleId, @Param("sort") int sort); List listRolesByRoleKey(@Param("roleKey") String roleKey); + + Integer countRolesByCustomerId(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java index 4570711923..160e1a4afc 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java @@ -18,11 +18,11 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.RegisterRelationDTO; import com.epmet.entity.RegisterRelationEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; + import java.util.List; /** @@ -44,4 +44,15 @@ public interface RegisterRelationDao extends BaseDao { * @date 2020.07.23 15:31 **/ RegisterRelationEntity selectRegisteredGridIdByUserId(@Param("userId") String userId); + + + RegisterRelationEntity selectRegisteredGridIdByUserIdAndCustomerId(@Param("userId") String userId, @Param("customerId")String customerId); + + /** + * @Description 根据userId查询注册网格ID + * @Param userId + * @author zxc + * @date 2021/3/16 下午3:05 + */ + String selectRegisterGridIdByUserId(@Param("userId")String userId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserCustomerDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserCustomerDao.java index 04473a7b88..5eed213440 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserCustomerDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/UserCustomerDao.java @@ -22,4 +22,13 @@ public interface UserCustomerDao extends BaseDao { * @return */ int updateRegistered(@Param("customerId") String customerId, @Param("userId") String userId); + + /** + * @Description 根据用户Id查询用户-客户关系 + * @param userId + * @return com.epmet.entity.UserCustomerEntity + * @author wangc + * @date 2020.12.18 18:05 + */ + UserCustomerEntity selectByUserId(@Param("userId") String userId); } 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/mq/listener/InitCustomerRolesListener.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/InitCustomerRolesListener.java new file mode 100644 index 0000000000..a50da7561e --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/mq/listener/InitCustomerRolesListener.java @@ -0,0 +1,39 @@ +//package com.epmet.mq.listener; +// +//import com.alibaba.fastjson.JSON; +//import com.epmet.commons.rocketmq.constants.ConsomerGroupConstants; +//import com.epmet.commons.rocketmq.constants.TopicConstants; +//import com.epmet.commons.rocketmq.messages.InitCustomerMQMsg; +//import com.epmet.service.GovStaffRoleService; +//import org.apache.rocketmq.common.message.MessageExt; +//import org.apache.rocketmq.spring.annotation.MessageModel; +//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener; +//import org.apache.rocketmq.spring.core.RocketMQListener; +//import org.slf4j.Logger; +//import org.slf4j.LoggerFactory; +//import org.springframework.beans.factory.annotation.Autowired; +//import org.springframework.stereotype.Component; +// +///** +// * 监听初始化客户动作,为客户初始化角色列表 +// */ +//@RocketMQMessageListener(topic = TopicConstants.INIT_CUSTOMER, +// consumerGroup = ConsomerGroupConstants.INIT_CUSTOMER_ROLES_GROUP, +// messageModel = MessageModel.CLUSTERING, +// selectorExpression = "*") +//@Component +//public class InitCustomerRolesListener implements RocketMQListener { +// +// private Logger logger = LoggerFactory.getLogger(getClass()); +// +// @Autowired +// private GovStaffRoleService govStaffRoleService; +// +// @Override +// public void onMessage(MessageExt messageExt) { +// String msg = new String(messageExt.getBody()); +// logger.info("初始化客户-初始化角色列表-收到消息内容:{}", msg); +// InitCustomerMQMsg msgObj = JSON.parseObject(msg, InitCustomerMQMsg.class); +// govStaffRoleService.initGovStaffRolesForCustomer(msgObj.getCustomerId()); +// } +//} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java index ec6d1eb485..315341ae84 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserBaseInfoRedis.java @@ -190,6 +190,97 @@ public class UserBaseInfoRedis { return null; } + + /** + * @Description 缓存中获取用户基本信息 + * @param userId + * @return + * @author wangc + * @date 2020.07.23 14:58 + **/ + public UserBaseInfoResultDTO getUserInfo(String userId,String customerId){ + if(StringUtils.isNotBlank(userId)){ + //获取居民缓存key + Map map = redisUtils.hGetAll(UserRedisKeys.getResiUserKey(userId)); + if(null != map && !map.isEmpty()) { + //缓存中有数据,直接返回 + return BeanUtil.mapToBean(map, UserBaseInfoResultDTO.class, true); + } + //缓存中没有数据,先查数据库,放入缓存后再返回 + UserBaseInfoResultDTO baseInfo = userBaseInfoDao.selectListByUserIdList(userId); + + if(null != baseInfo && StringUtils.isNotBlank(baseInfo.getId())){ + + //如果没有首次注册网格,则没有网格名称(xx机关-xx网格)、显示昵称(xx网格-x先生/女士) + RegisterRelationEntity relation = registerRelationDao.selectRegisteredGridIdByUserIdAndCustomerId(userId,customerId); + if(null != relation && StringUtils.isNotBlank(relation.getGridId())){ + baseInfo.setCustomerId(relation.getCustomerId()); + BelongGridNameFormDTO gridParam = new BelongGridNameFormDTO(); + gridParam.setGridId(relation.getGridId()); + baseInfo.setRegisteredGridId(relation.getGridId()); + Result gridResult = + govOrgOpenFeignClient.getGridNameByGridId(gridParam); + if(gridResult.success() && null != gridResult.getData() + && StringUtils.isNotBlank(gridResult.getData().getBelongsGridName())){ + String gridFullName = gridResult.getData().getBelongsGridName(); + baseInfo.setRegisteredGridName(gridFullName); + StringBuffer buffer = new StringBuffer(gridFullName.split(ModuleConstant.DASH)[NumConstant.ONE]).append(ModuleConstant.DASH).append(baseInfo.getSurname()); + switch (baseInfo.getGender()) { + case NumConstant.ONE_STR: + buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_MALE); + break; + case NumConstant.TWO_STR: + buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_FEMALE); + break; + default: + buffer.append(ModuleConstant.RESI_USER_NICKNAME_SUFFIX_GENDER_UNKNOWN); + } + baseInfo.setShowName(buffer.toString()); + } + } + else{ + //如果没有居民注册记录,说明当前用户是陌生人,需要从陌生人网格访问列表中查询所属的客户Id + LatestGridInfoResultDTO gridLatest = + gridLatestDao.selectLatestGridInfoByUserId(userId); + if(null != gridLatest){ + baseInfo.setCustomerId(gridLatest.getCustomerId()); + } + } + set(baseInfo); + return baseInfo; + }else{ + //如果没有,说明这里是陌生人 + //陌生人不放入缓存,也不更新用户基础信息表 + baseInfo = new UserBaseInfoResultDTO(); + baseInfo.setUserId(userId); + List wechatInfo = userWechatDao.selectByUserId(userId); + if(null != wechatInfo && !wechatInfo.isEmpty()){ + baseInfo.setNickname(wechatInfo.get(NumConstant.ZERO).getNickname()); + if(StringUtils.isBlank(baseInfo.getNickname())){ + baseInfo.setNickname(ModuleConstant.EMPTY_STR); + } + }else{ + return null; + } + RegisterRelationEntity relation = registerRelationDao.selectRegisteredGridIdByUserId(userId); + if(null != relation && StringUtils.isNotBlank(relation.getGridId())){ + baseInfo.setCustomerId(relation.getCustomerId()); + }else{ + LatestGridInfoResultDTO gridLatest = + gridLatestDao.selectLatestGridInfoByUserId(userId); + if(null != gridLatest){ + baseInfo.setCustomerId(gridLatest.getCustomerId()); + } + } + } + + return baseInfo; + + } + + return null; + } + /** * @Description 更新缓存 * @param entity diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java index e40e9ea607..96814c5fce 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java @@ -112,4 +112,6 @@ public interface RegisterRelationService extends BaseService { **/ List queryUserBaseInfo(List userIdList); + /** + * @Description 查询用户信息 + * @Param userIdList + * @author zxc + * @date 2021/3/16 下午2:52 + */ + List queryUserBaseInfoPlus(List userIdList); + /** * @return void * @param diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java index f0281dae5c..30b73bd794 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserResiInfoService.java @@ -175,4 +175,16 @@ public interface UserResiInfoService extends BaseService { * @return void */ void editMobile(EditMobileFormDTO formDTO); + + /** + * @Description 在分享链接之后完成注册居民之后调用的接口 + * 作用 + * + * 更改邀请浏览记录里"是否通过邀请链接注册居民" + * @param param + * @return void + * @author wangc + * @date 2020.12.18 16:34 + */ + void submitInLink(AfterRegisterResidentInSharableLinkFormDTO param); } 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 cc2b99e8ae..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); @@ -192,6 +192,9 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl> selectStaffGridListByUserId(List customerStaffGridDTOS) { + if (CollectionUtils.isEmpty(customerStaffGridDTOS)){ + return new Result>().ok(new ArrayList<>()); + } List gridManager = staffRoleService.listStaffsInRole(UserRoleConstant.GRID_MANAGER, customerStaffGridDTOS.get(0).getPid(), DataScope.getDefault()); List staffGridListDTOS = baseDao.selectStaffGridListByUserId(customerStaffGridDTOS); for (GovStaffRoleResultDTO govStaffRoleResultDTO : gridManager) { @@ -251,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()); @@ -652,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/GovStaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java index 726be2370d..16c6a375e2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java @@ -39,6 +39,8 @@ import com.epmet.feign.GovAccessFeignClient; import com.epmet.redis.GovStaffRoleRedis; import com.epmet.service.GovStaffRoleService; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -57,6 +59,8 @@ import java.util.Map; @Service public class GovStaffRoleServiceImpl extends BaseServiceImpl implements GovStaffRoleService { + private Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired private GovStaffRoleRedis govStaffRoleRedis; @@ -140,8 +144,13 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl 0) { + logger.info("为客户初始化角色列表-该客户【客户ID:%s】已存在角色信息,无需再次初始化。", customerId); + return; + } // 增加角色列表 List validRoles = govStaffRoleTemplateDao.listValidateRoles(); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java index 46bd30dfff..c18e91c05d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GridLatestServiceImpl.java @@ -210,7 +210,7 @@ public class GridLatestServiceImpl extends BaseServiceImpl { if(StringUtils.isNotBlank(info.getUserId())){ - UserBaseInfoResultDTO cache = userBaseInfoRedis.getUserInfo(info.getUserId()); + UserBaseInfoResultDTO cache = userBaseInfoRedis.getUserInfo(info.getUserId(),customerUserFormDTO.getCustomerId()); if(null != cache) { info.setRegisteredGrid(StringUtils.isBlank(cache.getRegisteredGridName()) ? ModuleConstant.EMPTY_STR : cache.getRegisteredGridName()); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java index f8a78f8c14..ca7b3db589 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java @@ -339,4 +339,9 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfo(reUserIds); + log.info("user基本信息:"+userBaseInfoResultDTOS.toString()); if (CollectionUtils.isEmpty(userBaseInfoResultDTOS)) { log.error("未查询到党员基本信息......"); throw new RenException("未查询到党员基本信息......"); @@ -193,11 +194,12 @@ public class UserBadgeServiceImpl implements UserBadgeService { }else { List oneUserIds = new ArrayList<>(); oneUserIds.add(userId); - List userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfo(oneUserIds); + List userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfoPlus(oneUserIds); + log.info("user【"+userId+"】基本信息:"+userBaseInfoResultDTOS.toString()); if (!CollectionUtils.isEmpty(userIds)) { AtomicReference status = new AtomicReference<>(true); userIds.forEach(u -> { - if(u.equals(userId)){ + if(u.getUserId().equals(userId)){ status.set(false); } }); @@ -231,6 +233,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { badges.add(dto); }); } + log.info("即将插入的徽章信息:"+badges); resiUserBadgeDao.insertResiUserBadge(badges); } } @@ -341,7 +344,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { //居民端 CertificationDetailResultDTO resiResult = userBadgeDao.selectBadgeAuthRecord(tokenDto.getUserId(), certificationDetailFormDTO.getBadgeId(),certificationDetailFormDTO.getRecordId()); if(null == resiResult){ - UserBaseInfoResultDTO userInfo = userBaseInfoRedis.getUserInfo(tokenDto.getUserId()); + UserBaseInfoResultDTO userInfo = userBaseInfoRedis.getUserInfo(tokenDto.getUserId(),certificationDetailFormDTO.getCustomerId()); resiResult = ConvertUtils.sourceToTarget(userInfo,CertificationDetailResultDTO.class); if(null != resiResult) resiResult.setIdcard(userInfo.getIdNum()); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index 2072097574..852ca55843 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -40,6 +40,7 @@ import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.redis.UserBaseInfoRedis; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; +import com.epmet.service.RegisterRelationService; import com.epmet.service.UserBaseInfoService; import com.epmet.util.ModuleConstant; import org.apache.commons.lang3.StringUtils; @@ -77,6 +78,8 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -181,6 +184,27 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl queryUserBaseInfoPlus(List userIdList) { + if (CollectionUtils.isEmpty(userIdList)){ + return new ArrayList<>(); + } + List result = new ArrayList<>(); + userIdList.forEach(id -> { + UserBaseInfoResultDTO baseInfo = userBaseInfoRedis.getUserInfo(id); + if (null != baseInfo && StringUtils.isEmpty(baseInfo.getRegisteredGridId())){ + String gridId = registerRelationService.selectRegisterGridIdByUserId(id); + if (StringUtils.isNotEmpty(gridId)){ + baseInfo.setRegisteredGridId(gridId); + }else { + throw new RenException("查询用户【"+id+"】所属网格失败"); + } + } + result.add(baseInfo); + }); + return result; + } + /** * @return void * @author yinzuomei @@ -366,6 +390,7 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -258,10 +271,10 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl implem //前台和后台已有实体字段不对于 需要挨个赋值 userWechatDTO.setUserId(wxUserInfoFormDTO.getUserId()); userWechatDTO.setNickname(wxUserInfoFormDTO.getNickName() == null ? null : wxUserInfoFormDTO.getNickName()); - userWechatDTO.setSex(Integer.parseInt(wxUserInfoFormDTO.getGender())); - userWechatDTO.setHeadImgUrl(wxUserInfoFormDTO.getAvatarUrl()); + userWechatDTO.setSex(Integer.parseInt(wxUserInfoFormDTO.getGender() == null ? "0" : wxUserInfoFormDTO.getGender())); + userWechatDTO.setHeadImgUrl(wxUserInfoFormDTO.getAvatarUrl() == null ? null : wxUserInfoFormDTO.getAvatarUrl()); userWechatDTO.setCountry(wxUserInfoFormDTO.getCountry() == null ? null : wxUserInfoFormDTO.getCountry()); userWechatDTO.setProvince(wxUserInfoFormDTO.getProvince() == null ? null : wxUserInfoFormDTO.getProvince()); userWechatDTO.setCity(wxUserInfoFormDTO.getCity() == null ? null : wxUserInfoFormDTO.getCity()); @@ -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/java/com/epmet/util/ModuleConstant.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/util/ModuleConstant.java index 706716aff6..f9890ec52b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/util/ModuleConstant.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/util/ModuleConstant.java @@ -46,4 +46,12 @@ public interface ModuleConstant { String BADGE_AUDIT_MESSAGE = "徽章审核消息"; + /** + * 链接类型- 话题 + */ + String SHARABLE_LINK_FROM_TOPIC = "topic"; + /** + * 链接类型- 议题 + */ + String SHARABLE_LINK_FROM_ISSUE = "issue"; } diff --git a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml index 380e974475..0ff8f5dcc1 100644 --- a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml +++ b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml @@ -1,5 +1,6 @@ server: port: @server.port@ + version: @version@ servlet: context-path: /epmetuser @@ -144,4 +145,13 @@ openapi: dingTalk: robot: webHook: @dingTalk.robot.webHook@ - secret: @dingTalk.robot.secret@ \ No newline at end of file + secret: @dingTalk.robot.secret@ + +rocketmq: + name-server: 192.168.1.130:9876;192.168.1.132:9876 + +# 停机选项 +shutdown: + graceful: + enable: true #是否开启优雅停机 + waitTimeSecs: 30 # 优雅停机等待时间,超过30秒,发出告警 diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml index 40539c565f..87a5fc01e7 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml @@ -111,4 +111,10 @@ where gsr.ROLE_KEY = #{roleKey} and gsr.DEL_FLAG=0 + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml index 44dbb58269..c3f7bf7682 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/RegisterRelationDao.xml @@ -33,6 +33,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/UserCustomerDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/UserCustomerDao.xml index 60348584a3..930f14ca25 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/UserCustomerDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/UserCustomerDao.xml @@ -7,4 +7,8 @@ update user_customer set IS_REGISTER = 1 where CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and USER_ID = #{userId,jdbcType=VARCHAR} + + \ No newline at end of file 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} + + + + + diff --git a/pom.xml b/pom.xml index dcbdbc44dc..b0d6621300 100644 --- a/pom.xml +++ b/pom.xml @@ -76,17 +76,23 @@ springfox-swagger-ui ${swagger.version} - - mysql - mysql-connector-java - ${mysql.version} - - - + + mysql + mysql-connector-java + ${mysql.version} + + + + + com.aliyun + alibaba-dingtalk-service-sdk + 1.0.1 + +