diff --git a/epmet-admin/epmet-admin-server/pom.xml b/epmet-admin/epmet-admin-server/pom.xml index 0155abe772..9058e3065d 100644 --- a/epmet-admin/epmet-admin-server/pom.xml +++ b/epmet-admin/epmet-admin-server/pom.xml @@ -104,8 +104,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-auth/deploy/docker-compose-prod.yml b/epmet-auth/deploy/docker-compose-prod.yml index 8c5773f2d5..afffcf2474 100644 --- a/epmet-auth/deploy/docker-compose-prod.yml +++ b/epmet-auth/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-auth:0.3.68 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-auth:0.3.69 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index dc628f27e9..aaff93a013 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.68 + 0.3.69 com.epmet epmet-cloud @@ -170,8 +170,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java b/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java new file mode 100644 index 0000000000..e096c6a65a --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/controller/GovWebController.java @@ -0,0 +1,39 @@ +package com.epmet.controller; + +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.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 + */ +@RestController +@RequestMapping("govweb") +public class GovWebController { + + @Autowired + private GovWebService govWebService; + + + /** + * @param formDTO + * @return + * @Author sun + * @Description PC工作端-工作人员登录 + **/ + @PostMapping("login") + public Result workLogin(@RequestBody GovWebLoginFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(govWebService.login(formDTO)); + } + + +} diff --git a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java index 924c1a4070..00770d82bb 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -2,13 +2,11 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.dto.form.LoginFormDTO; -import com.epmet.dto.form.StaffOrgsFormDTO; -import com.epmet.dto.form.ThirdStaffOrgsFormDTO; -import com.epmet.dto.form.ThirdWxmpEnteOrgFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.dto.result.UserTokenResultDTO; import com.epmet.service.ThirdLoginService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -91,4 +89,19 @@ public class ThirdLoginController { return new Result>().ok(staffOrgs); } + /** + * @param formDTO + * @return + * @author sun + * @description 单客户-获取微信用户手机号 + **/ + @PostMapping("getresiwxphone") + public Result getResiWxPhone(@RequestBody GetResiWxPhoneFormDTO formDTO) { + String phone = thirdLoginService.getResiWxPhone(formDTO); + if (StringUtils.isNotBlank(phone) && !"null".equals(phone)) { + return new Result().ok(phone); + } + return new Result().ok(""); + } + } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/GetResiWxPhoneFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/GetResiWxPhoneFormDTO.java new file mode 100644 index 0000000000..30e7d947d6 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/GetResiWxPhoneFormDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 单客户-获取微信用户手机号 + * + * @author sun + */ +@Data +public class GetResiWxPhoneFormDTO implements Serializable { + private static final long serialVersionUID = 4381236451736209332L; + /** + * 小程序appId + */ + @NotBlank(message = "appId不能为空",groups = {AddUserInternalGroup.class}) + private String appId; + /** + * 微信code + */ + @NotBlank(message = "wxCode不能为空",groups = {AddUserInternalGroup.class}) + private String wxCode; + /** + * 用户信息 + */ + @NotBlank(message = "encryptedData不能为空",groups = {AddUserInternalGroup.class}) + private String encryptedData; + /** + * 加密算法的初始向量 + */ + @NotBlank(message = "iv不能为空",groups = {AddUserInternalGroup.class}) + private String iv; + + public interface AddUserInternalGroup {} + +} diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/GovWebLoginFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/GovWebLoginFormDTO.java new file mode 100644 index 0000000000..22c87a0aed --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/GovWebLoginFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description PC工作端 手机号+密码登陆-接口入参 + * @Author sun + */ +@Data +public class GovWebLoginFormDTO extends LoginCommonFormDTO implements Serializable { + private static final long serialVersionUID = 7950477424010655108L; + + /** + * 客户Id + */ + @NotBlank(message = "客户Id不能为空",groups = {AddUserShowGroup.class}) + private String customerId; + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空",groups = {AddUserShowGroup.class}) + private String phone; + + /** + * 密码 + */ + @NotBlank(message = "密码不能为空",groups = {AddUserShowGroup.class}) + private String password; + + /** + * 验证码 + */ + @NotBlank(message="验证码不能为空",groups = {AddUserShowGroup.class}) + private String captcha; + + /** + * 唯一标识 + */ + @NotBlank(message="唯一标识不能为空",groups = {AddUserInternalGroup.class}) + private String uuid; + +} diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/LoginCommonFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/LoginCommonFormDTO.java index 7339592d7a..aae374df94 100644 --- a/epmet-auth/src/main/java/com/epmet/dto/form/LoginCommonFormDTO.java +++ b/epmet-auth/src/main/java/com/epmet/dto/form/LoginCommonFormDTO.java @@ -19,7 +19,7 @@ public class LoginCommonFormDTO implements Serializable { /** * 政府端:gov、居民端:resi、运营端:oper */ - @NotBlank(message = "app不能为空(政府端:gov、居民端:resi、运营端:oper)",groups ={AddUserInternalGroup.class} ) + @NotBlank(message = "app不能为空(工作端:gov、居民端:resi、运营端:oper)",groups ={AddUserInternalGroup.class} ) private String app; /** diff --git a/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index 37312c17f6..44c7d9d3ab 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-auth/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -7,6 +7,7 @@ import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.UserDTO; import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.*; +import com.epmet.dto.result.GovWebOperLoginResultDTO; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.feign.fallback.EpmetUserFeignClientFallback; @@ -115,4 +116,14 @@ public interface EpmetUserFeignClient { */ @PostMapping("/epmetuser/staffrole/staffroles") Result> getRolesOfStaff(StaffRoleFormDTO staffRoleFormDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description PC工作端登陆-根据客户Id和手机号查询登陆用户信息 + **/ + @PostMapping(value = "epmetuser/customerstaff/getstaffidandpwd", consumes = MediaType.APPLICATION_JSON_VALUE) + Result getStaffIdAndPwd(@RequestBody GovWebOperLoginFormDTO formDTO); + } diff --git a/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java b/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java index 88ed4e42de..59623a7dc7 100644 --- a/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java +++ b/epmet-auth/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -8,6 +8,7 @@ import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.UserDTO; import com.epmet.dto.UserWechatDTO; import com.epmet.dto.form.*; +import com.epmet.dto.result.GovWebOperLoginResultDTO; import com.epmet.dto.result.PasswordLoginUserInfoResultDTO; import com.epmet.dto.result.StaffLatestAgencyResultDTO; import com.epmet.feign.EpmetUserFeignClient; @@ -68,4 +69,9 @@ public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getRolesOfStaff", staffRoleFormDTO); } + @Override + public Result getStaffIdAndPwd(GovWebOperLoginFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffIdAndPwd", formDTO); + } + } diff --git a/epmet-auth/src/main/java/com/epmet/service/GovWebService.java b/epmet-auth/src/main/java/com/epmet/service/GovWebService.java new file mode 100644 index 0000000000..30f8d8ae4c --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/GovWebService.java @@ -0,0 +1,19 @@ +package com.epmet.service; + +import com.epmet.dto.form.GovWebLoginFormDTO; +import com.epmet.dto.result.UserTokenResultDTO; + +/** + * @Description 第三方-居民端、政府端登陆服务 + * @author sun + */ +public interface GovWebService { + + /** + * @param formDTO + * @return + * @Author sun + * @Description PC工作端-工作人员登录 + **/ + UserTokenResultDTO login(GovWebLoginFormDTO formDTO); +} diff --git a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java index b343bf5a22..3d9c60cc64 100644 --- a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java @@ -1,5 +1,6 @@ package com.epmet.service; +import com.epmet.dto.form.GetResiWxPhoneFormDTO; import com.epmet.dto.form.LoginFormDTO; import com.epmet.dto.form.ThirdStaffOrgsFormDTO; import com.epmet.dto.form.ThirdWxmpEnteOrgFormDTO; @@ -53,4 +54,12 @@ public interface ThirdLoginService { * @description 单客户-手机号密码获取组织 **/ List getMyOrgByPassword(ThirdStaffOrgsFormDTO formDTO); + + /** + * @param formDTO + * @return + * @author sun + * @description 单客户-获取微信用户手机号 + **/ + String getResiWxPhone(GetResiWxPhoneFormDTO 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 new file mode 100644 index 0000000000..12162bfbd3 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -0,0 +1,124 @@ +package com.epmet.service.impl; + +import com.epmet.common.token.constant.LoginConstant; +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.password.PasswordUtils; +import com.epmet.commons.tools.utils.CpUserDetailRedis; +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; +import com.epmet.jwt.JwtTokenUtils; +import com.epmet.service.CaptchaService; +import com.epmet.service.GovWebService; +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.HashMap; +import java.util.Map; + +/** + * @author sun + * @Description 第三方-居民端、政府端登陆服务 + */ +@Slf4j +@Service +public class GovWebServiceImpl implements GovWebService { + + private static final Logger logger = LoggerFactory.getLogger(GovWebServiceImpl.class); + @Autowired + private CaptchaService captchaService; + @Autowired + private JwtTokenUtils jwtTokenUtils; + @Autowired + private JwtTokenProperties jwtTokenProperties; + @Autowired + private CpUserDetailRedis cpUserDetailRedis; + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + + /** + * @param formDTO + * @return + * @Author sun + * @Description PC工作端-工作人员登录 + **/ + @Override + public UserTokenResultDTO login(GovWebLoginFormDTO formDTO) { + //1.参数校验 + if (!(LoginConstant.APP_GOV.equals(formDTO.getApp()) && LoginConstant.CLIENT_WEB.equals(formDTO.getClient()))) { + logger.error("当前接口只适用于PC工作端运营管理后台"); + throw new RenException("当前接口只适用于PC工作端运营管理后台"); + } + //2.验证码校验 + boolean flag = captchaService.validate(formDTO.getUuid(), formDTO.getCaptcha()); + if (!flag) { + logger.error(String.format("用户%s登录,验证码输入错误,暂时放行", formDTO.getPhone())); + //暂时关闭验证码校验 TODO + //throw new RenException(EpmetErrorCode.ERR10019.getCode()); + } + //3.校验登陆账号是否存在 + //根据客户Id和手机号查询登陆用户信息(此处不需要判断登陆人是否是有效客户以及是否是客户的根管理员,前一接口获取登陆手机号对应客户列表已经判断了) + GovWebOperLoginFormDTO form = new GovWebOperLoginFormDTO(); + form.setCustomerId(formDTO.getCustomerId()); + form.setMobile(formDTO.getPhone()); + Result result = epmetUserFeignClient.getStaffIdAndPwd(form); + if (!result.success() || null == result.getData() || null == result.getData().getUserId()) { + logger.error("根据手机号查询PC工作端登陆人员信息失败,返回10003账号不存在"); + throw new RenException(EpmetErrorCode.ERR10003.getCode()); + } + GovWebOperLoginResultDTO resultDTO = result.getData(); + + //4.密码是否正确 + //密码错误 + if (!PasswordUtils.matches(formDTO.getPassword(), resultDTO.getPassWord())) { + logger.error("登陆密码错误"); + throw new RenException(EpmetErrorCode.ERR10004.getCode()); + } + + //5.生成token存到redis并返回 + UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setToken(this.packagingUserToken(formDTO, resultDTO.getUserId())); + return userTokenResultDTO; + + } + + /** + * 生成PC工作端token + * @author sun + */ + private String packagingUserToken(GovWebLoginFormDTO formDTO, String userId) { + // 生成token + Map map = new HashMap<>(); + map.put("app", formDTO.getApp()); + map.put("client", formDTO.getClient()); + map.put("userId", userId); + String token = jwtTokenUtils.createToken(map); + logger.info("app:" + formDTO.getApp() + ";client:" + formDTO.getClient() + ";userId:" + userId + ";生成token[" + token + "]"); + int expire = jwtTokenProperties.getExpire(); + TokenDto tokenDto = new TokenDto(); + tokenDto.setApp(formDTO.getApp()); + tokenDto.setClient(formDTO.getClient()); + tokenDto.setUserId(userId); + tokenDto.setToken(token); + tokenDto.setUpdateTime(System.currentTimeMillis()); + tokenDto.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); + cpUserDetailRedis.set(tokenDto, expire); + logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); + return token; + } + + +} 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 a7980eebe1..9e50e6b796 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 @@ -1,6 +1,8 @@ package com.epmet.service.impl; import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; +import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; +import cn.binarywang.wx.miniapp.util.crypt.WxMaCryptUtils; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.epmet.common.token.constant.LoginConstant; @@ -549,4 +551,40 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { return userWechatDTO; } + /** + * @param formDTO + * @return + * @author sun + * @description 单客户-获取微信用户手机号 + * 【此接口只适配第三方客户,对于党群e事通客户还是走原接口】 + **/ + @Override + public String getResiWxPhone(GetResiWxPhoneFormDTO formDTO) { + String phone = ""; + try { + //1.根据wxcode获取sessionKey + WxLoginFormDTO resiLoginFormDTO = new WxLoginFormDTO(); + resiLoginFormDTO.setAppId(formDTO.getAppId()); + resiLoginFormDTO.setWxCode(formDTO.getWxCode()); + //此方法会校验appId是否授权,然后在判断客户是否存在,之后才是获取sessionKey,如果只想获取sessionKey需要写新接口 + UserWechatDTO userWechatDTO = this.getUserWeChat(resiLoginFormDTO); + if (null == userWechatDTO || null == userWechatDTO.getSessionKey()) { + logger.error(String.format("调用生成third服务wxcode获取sessionKey失败,对应appId->" + formDTO.getAppId())); + throw new RenException("获取本机号码失败"); + } + + //2.使用sessionKey解密获取手机号 + WxMaPhoneNumberInfo phoneNoInfo = WxMaPhoneNumberInfo.fromJson(WxMaCryptUtils.decrypt(userWechatDTO.getSessionKey(), + formDTO.getEncryptedData(), + formDTO.getIv())); + if (null != phoneNoInfo) { + phone = phoneNoInfo.getPurePhoneNumber(); + } + } catch (Exception e) { + e.printStackTrace(); + log.error(String.format("获取用户微信绑定的手机号接口异常%s", e.getMessage())); + } + return phone; + } + } 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 92af86d3a9..0ac7dbf706 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 @@ -35,6 +35,10 @@ public interface NumConstant { int ONE_HUNDRED = 100; int ONE_THOUSAND = 1000; int MAX = 99999999; + int EIGHTY_EIGHT = 88; + + double ZERO_DOT_ZERO = 0.0; + long ZERO_L = 0L; long ONE_L = 1L; 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 db6dea1b61..b66c3c33d2 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 @@ -133,4 +133,9 @@ public interface ServiceConstant { * 积分银行 * */ String EPMET_POINT_SERVER = "epmet-point-server"; + + /** + * 开放接口服务 + */ + String EPMET_EXT_SERVER = "epmet-ext-server"; } 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 bc4358bd93..284ef67e74 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 @@ -51,6 +51,7 @@ public enum RequirePermissionEnum { ORG_STAFF_CREATE("org_staff_create", "组织:工作人员:新增", "组织:工作人员:新增"), ORG_STAFF_UPDATE("org_staff_update", "组织:工作人员:编辑", "组织:工作人员:编辑"), ORG_STAFF_FORBIDDEN("org_staff_forbidden", "组织:工作人员:禁用", "组织:工作人员:禁用"), + ORG_STAFF_TRANSFER("org_staff_transfer", "组织:工作人员:调动", "组织:工作人员:调动"), /** * 组织-部门 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 b16ad96bc0..939378fc26 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 @@ -75,6 +75,10 @@ public enum EpmetErrorCode { STAFF_ADD_FAILED(8403,"人员添加失败"), STAFF_EDIT_FAILED(8404,"人员编辑失败"), CANNOT_DISABLE_YOURSELF(8405,"您不能禁用自己"), + NO_SET_GRID_COUNT(8406,"您还未设置创建网格数量上限,请联系管理员设置"), + GRID_COUNT_UP(8407,"您的创建网格数量已到达上限,请联系管理员设置"), + EXIT_PEND_PROJECT(8408,"该工作人员有项目尚在处理,处理完毕方可操作"), + EXIT_PUBLISHED_ACTIVITY(8409,"该工作人员有活动尚在进行,等活动完成方可操作"), ALREADY_EVALUATE(8501,"您已评价"), ALREADY_VOTE(8502,"您已表态"), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpContextUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpContextUtils.java index 6a01fa6c0f..d27da23ab7 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpContextUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpContextUtils.java @@ -61,8 +61,9 @@ public class HttpContextUtils { } //请求语言 - defaultLanguage = request.getHeader(HttpHeaders.ACCEPT_LANGUAGE); - + if(StringUtils.isNotBlank(request.getHeader(HttpHeaders.ACCEPT_LANGUAGE))){ + defaultLanguage = request.getHeader(HttpHeaders.ACCEPT_LANGUAGE); + } return defaultLanguage; } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/UniqueIdGenerator.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/UniqueIdGenerator.java new file mode 100644 index 0000000000..fcefbdf2ca --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/UniqueIdGenerator.java @@ -0,0 +1,81 @@ +package com.epmet.commons.tools.utils; + + +import org.apache.commons.lang3.StringUtils; + +import java.util.Date; +import java.util.Random; +import java.util.concurrent.atomic.AtomicLong; + +/** + * 唯一ID生成器 + */ +public class UniqueIdGenerator { + + private static UniqueValue uniqueValue = new UniqueValue(); + private static String middle; + static { + String threadCode = StringUtils.right(String.valueOf(Math.abs(System.nanoTime()+"".hashCode())), 2); + middle = StringUtils.leftPad(threadCode, 2, "0"); + } + + /** + * 唯一时间值 + */ + private static class UniqueValue { + + private AtomicLong uniqueValue = new AtomicLong(0L); + private volatile String currentTime = DateUtils.format(new Date(), DateUtils.DATE_TIME_NO_SPLIT); + private volatile String lastTime = currentTime; + + /** + * 获取当前时间:yyyyMMddHHmmSS + * 如果到了下一秒,则唯一值从0开始 + * + * @return + */ + public String getCurrentTime() { + currentTime = DateUtils.format(new Date(), DateUtils.DATE_TIME_NO_SPLIT); + if (!currentTime.equals(lastTime)) { + lastTime = currentTime; + Random random = new Random(); + uniqueValue.set(Long.valueOf(random.nextInt(10))); + } + return currentTime; + } + + public String getCurrentValue() { + return StringUtils.leftPad(String.valueOf(uniqueValue.incrementAndGet()), 5, "0"); + } + } + + /** + * 生成一个24位唯一ID + * 15位时间+2位中间值(防止多服务冲突)+2个线程code+5位秒级递增值 + * + * @return + */ + public static String generate() { + StringBuilder builder = new StringBuilder(32); + builder.append(uniqueValue.getCurrentTime()) + .append(middle) + .append(getUniqueThreadCode()) + .append(uniqueValue.getCurrentValue()); + + return builder.toString(); + } + + public static String getUniqueThreadCode() { + String threadCode = StringUtils.left(String.valueOf(Thread.currentThread().hashCode()), 2); + return StringUtils.leftPad(threadCode, 2, "0"); + } + + public static void main(String[] args) throws InterruptedException { + + System.out.println(UniqueIdGenerator.uniqueValue.currentTime); + System.out.println(UniqueIdGenerator.middle); + System.out.println(UniqueIdGenerator.getUniqueThreadCode()); + System.out.println(uniqueValue.getCurrentValue()); + + } +} diff --git a/epmet-gateway/deploy/docker-compose-dev.yml b/epmet-gateway/deploy/docker-compose-dev.yml index de78c36557..82a1bb2c15 100644 --- a/epmet-gateway/deploy/docker-compose-dev.yml +++ b/epmet-gateway/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.31 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.32 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/deploy/docker-compose-prod.yml b/epmet-gateway/deploy/docker-compose-prod.yml index 6b8419721d..c5c27e870b 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.30 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-gateway:0.3.33 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index b8996a9f75..43269581b5 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.31 + 0.3.33 com.epmet epmet-cloud @@ -100,8 +100,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false @@ -190,12 +190,15 @@ lb://epmet-third-server - + lb://epmet-heart-server - + lb://epmet-point-server + + lb://epmet-ext-server + @@ -284,6 +287,8 @@ lb://epmet-heart-server lb://epmet-point-server + + lb://epmet-ext-server @@ -369,6 +374,8 @@ lb://epmet-heart-server lb://epmet-point-server + + lb://epmet-ext-server diff --git a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java index 43fbf6d0cb..7c74fa6763 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -135,7 +135,9 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory organizeData; + + /** + * 组织名称数组 + * */ + private List xAxis; + + /** + * 参与人数 + * */ + private List joinData; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildTrendResultDTO.java new file mode 100644 index 0000000000..58a277322f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchBuildTrendResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 3、支部建设情况|联建共建情况-折线图 返参DTO + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321981 + * @ClassName BranchBuildTrendResultDTO + * @Auth wangc + * @Date 2020-08-19 10:06 + */ +@Data +public class BranchBuildTrendResultDTO implements Serializable { + private static final long serialVersionUID = 2453727230656371207L; + + /** + * 分类数组 ["三会党课","主体党日","三述专题","志愿服务","党内关怀"] + * */ + private List legend; + + /** + * 横坐标,近12个月的结合 ["8月","9月"] + * */ + private List xAxis; + + private List seriesData; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchIssueDataResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchIssueDataResultDTO.java new file mode 100644 index 0000000000..65a6888047 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchIssueDataResultDTO.java @@ -0,0 +1,22 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName BranchIssueDataResultDTO + * @Auth wangc + * @Date 2020-08-19 10:50 + */ +@Data +public class BranchIssueDataResultDTO implements Serializable { + private static final long serialVersionUID = 2417543749267496482L; + + private String issue; + + private String monthId; + + private Integer data; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchResultDTO.java new file mode 100644 index 0000000000..f4a611cc10 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/18 10:52 上午 + */ +@Data +public class BranchResultDTO implements Serializable { + + private static final long serialVersionUID = -8001714892170166320L; + + /** + * 网格ID + */ + private String gridId = ""; + + /** + * 网格名称 + */ + private String gridName = ""; + + /** + * 党支部(网格)位置 + */ + private String partyMark = ""; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchTrendSeriesDataResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchTrendSeriesDataResultDTO.java new file mode 100644 index 0000000000..7d5f415547 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/BranchTrendSeriesDataResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 3、支部建设情况|联建共建情况-折线图 返参中的系列数组 + * @ClassName BranchTrendSeriesDataResultDTO + * @Auth wangc + * @Date 2020-08-19 10:22 + */ +@Data +public class BranchTrendSeriesDataResultDTO implements Serializable { + private static final long serialVersionUID = -2288264050517402039L; + + /** + * 和legend集合值一致 + * */ + private String name; + + /** + * 对应每个月的数值 + * */ + private List data; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/CompartmentResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/CompartmentResultDTO.java new file mode 100644 index 0000000000..2bf8ffd3d6 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/CompartmentResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.screen.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 2020/8/18 14:18 + */ +@Data +public class CompartmentResultDTO implements Serializable { + + private static final long serialVersionUID = 7963177476365327829L; + + /** + * 当前所选组织 + */ + private String agencyId = ""; + + /** + * 当前所选组织名称 + */ + private String name = ""; + + /** + * 当前所选组织的坐标区域 + */ + private String areaMarks = ""; + + /** + * 机关级别 + * 社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province + */ + @JsonIgnore + private String level; + + /** + * 子级用户分布 + */ + private List agencyDistribution = new ArrayList<>(); +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResult.java new file mode 100644 index 0000000000..e77c336fbe --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResult.java @@ -0,0 +1,30 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 2:45 下午 + */ +@Data +public class ContactMassLineChartResult implements Serializable { + + private static final long serialVersionUID = 5668549816473850787L; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 党员建群数 + */ + private Integer groupTotal; + + /** + * 群成员数 + */ + private Integer userTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java new file mode 100644 index 0000000000..e57b0cc54f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ContactMassLineChartResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/20 2:31 下午 + */ +@Data +public class ContactMassLineChartResultDTO implements Serializable { + + private static final long serialVersionUID = 192666933158635787L; + + /** + * 横坐标集合 + */ + private List xAxis; + + /** + * 党员建群数 + */ + private List groupData; + + /** + * 群成员数 + */ + private List groupMemberData; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/DifficultProjectResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/DifficultProjectResultDTO.java new file mode 100644 index 0000000000..e89155d00c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/DifficultProjectResultDTO.java @@ -0,0 +1,44 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 2、难点赌点-耗时最长|涉及部门最多|处理次数 返参DTO + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614 + * @ClassName DifficultProjectResultDTO + * @Auth wangc + * @Date 2020-08-20 13:43 + */ +@Data +public class DifficultProjectResultDTO implements Serializable { + private static final long serialVersionUID = -7338625142484943434L; + + private String projectId; + + private String title; + + /** + * 状态: 待处理: pending; 结案closed + * */ + private String status; + + private Integer totalHours; + + /** + * yyyy-MM-dd HH:mm + * */ + private String createDateTime; + + private String gridName; + + private String imgUrl; + + private String categoryName; + + private Integer handleDepts; + + private Integer handleCount; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/FineExampleResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/FineExampleResultDTO.java new file mode 100644 index 0000000000..a81f45fc05 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/FineExampleResultDTO.java @@ -0,0 +1,81 @@ +package com.epmet.screen.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 1:48 下午 + */ +@Data +public class FineExampleResultDTO implements Serializable { + + private static final long serialVersionUID = -2754696449087950719L; + + /** + * 党员参与议事 + */ + private Integer issueTotal = 0; + + @JsonIgnore + private Double issueRatioA; + + /** + * 党员参与议事占比 + */ + private String issueRatio = "0.00%"; + + /** + * 党员发布话题总数 + */ + private Integer topicTotal = 0; + + @JsonIgnore + private Double topicRatioA; + + /** + * 党员发布话题占比 + */ + private String topicRatio = "0.00%"; + + /** + * 议题转项目 + */ + private Integer shiftProjectTotal = 0; + + @JsonIgnore + private Double shiftProjectRatioA; + + /** + * 议题转项目占比 + */ + private String shiftProjectRatio = "0.00%"; + + /** + * 解决项目 + */ + private Integer resolvedProjectTotal = 0; + + @JsonIgnore + private Double resolvedProjectRatioA; + + /** + * 解决项目占比 + */ + private String resolvedProjectRatio = "0.00%"; + + /** + * 党员发布议题数 + */ + private Integer publishIssueTotal = 0; + + @JsonIgnore + private Double publishIssueRatioA; + + /** + * 党员发布议题数占比 + */ + private String publishIssueRatio = "0.00%"; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityRankResultDTO.java new file mode 100644 index 0000000000..318b290840 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityRankResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 治理能力榜单返参dto + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321627 + * @ClassName GovernCapacityRankResultDTO + * @Auth wangc + * @Date 2020-08-20 17:30 + */ +@Data +public class GovernCapacityRankResultDTO implements Serializable { + private static final long serialVersionUID = -3891870459284304022L; + + /** + * 名称 + * */ + private String agencyName; + + /** + * 响应率 + * */ + private String responseRatio; + + /** + * 解决率 + * */ + private String resolvedRatio; + + /** + * 自治率 + * */ + private String governRatio; + + /** + * 满意率 + * */ + private String satisfactionRatio; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityResultDTO.java new file mode 100644 index 0000000000..dd2c09cd94 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/GovernCapacityResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 治理能力查询结果dto + * @ClassName GovernCapacityResultDTO + * @Auth wangc + * @Date 2020-08-20 17:24 + */ +@Data +public class GovernCapacityResultDTO implements Serializable { + private static final long serialVersionUID = -2834039644611050304L; + + /** + * 名称 + * */ + private String agencyName; + + /** + * 响应率 + * */ + private BigDecimal responseRatio; + + /** + * 解决率 + * */ + private BigDecimal resolvedRatio; + + /** + * 自治率 + * */ + private BigDecimal governRatio; + + /** + * 满意率 + * */ + private BigDecimal satisfactionRatio; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResult.java new file mode 100644 index 0000000000..ebf0d9d276 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResult.java @@ -0,0 +1,25 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 9:12 上午 + */ +@Data +public class MonthBarchartResult implements Serializable { + + private static final long serialVersionUID = 3777652772902180088L; + + private String monthId; + + private Double serviceAbility; + + private Double partyDevAbility; + + private Double governAbility; + + private Double indexTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResultDTO.java new file mode 100644 index 0000000000..479547a883 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthBarchartResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.screen.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/19 5:23 下午 + */ +@Data +public class MonthBarchartResultDTO implements Serializable { + + private static final long serialVersionUID = 561457498288576566L; + + /** + * 服务能力 + */ + private List serviceAbilityData; + + /** + * 党建能力 + */ + private List partyDevAbilityData; + + /** + * 治理能力 + */ + private List governAbilityData; + + /** + * 横坐标月份集合 + */ + private List xAxis; + + /** + * 总指数集合 + */ + private List totalIndexData; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthPieChartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthPieChartResultDTO.java new file mode 100644 index 0000000000..248f69d5ce --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthPieChartResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/19 3:12 下午 + */ +@Data +public class MonthPieChartResultDTO implements Serializable { + + private static final long serialVersionUID = 8399158251970739021L; + + /** + * 服务能力 + */ + private Double serviceAbility = 0.0; + + /** + * 党建能力 + */ + private Double partyDevAbility = 0.0; + + /** + * 治理能力 + */ + private Double governAbility = 0.0; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/OrgRankDataResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/OrgRankDataResultDTO.java new file mode 100644 index 0000000000..87a8d482c9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/OrgRankDataResultDTO.java @@ -0,0 +1,54 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 党建引领-组织先进排行榜 查询结果dto + * @ClassName OrgRankDataResultDTO + * @Auth wangc + * @Date 2020-08-21 11:16 + */ +@Data +public class OrgRankDataResultDTO implements Serializable { + + private static final long serialVersionUID = -2980098512184391207L; + + /** + * 名称 XXXX社区党委 + * */ + private String name; + + /** + * 满意度 90.64% 返回字符串,前端直接显示 + * */ + private BigDecimal satisfactionRatio; + + /** + * 结案率 94.3% 返回字符串,前端直接显示 + * */ + private BigDecimal closedProjectRatio; + + /** + * 党员数 + * */ + private Integer partyMemberNum; + + /** + * 支部建设 GROUP_TOTAL + * */ + private Integer branchNum; + + /** + * 议题数 + * */ + private Integer issueNum; + + /** + * 项目数 + * */ + private Integer projectNum; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartyUserPointResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartyUserPointResultDTO.java new file mode 100644 index 0000000000..5ae10cb73e --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartyUserPointResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 党员积分查询结果 dto 作为接口【5、先进排行榜单-先进党员排行】的返参对象 NEI地址: https://nei.netease.com/interface/detail/res/?pid=57068&id=321624 + * @ClassName PartyUserPointResultDTO + * @Auth wangc + * @Date 2020-08-21 14:18 + */ +@Data +public class PartyUserPointResultDTO implements Serializable { + private static final long serialVersionUID = -288523161283142460L; + + /** + * 用户Id + * */ + private String userId; + + /** + * 用户姓名 + * */ + private String name; + + /** + * 用户积分 + * */ + private Integer point; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgeDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgeDistributionResultDTO.java new file mode 100644 index 0000000000..6ae70d9a67 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgeDistributionResultDTO.java @@ -0,0 +1,44 @@ +package com.epmet.screen.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName PartymemberAgeDistributionResultDTO + * @Auth wangc + * @Date 2020-08-18 17:04 + */ +@Data +public class PartymemberAgeDistributionResultDTO implements Serializable { + private static final long serialVersionUID = -3477512511475784330L; + + /** + * 30岁以下 的党员 + * */ + private Integer under30Count = NumConstant.ZERO; + + /** + * 31-50岁 的党员 + * */ + private Integer between31And50Count = NumConstant.ZERO; + + /** + * 51-60岁 的党员 + * */ + private Integer between51And60Count = NumConstant.ZERO; + + /** + * 61岁以上 的党员 + * */ + private Integer above61Count = NumConstant.ZERO; + + /** + * 党员总数 + * */ + private Integer partyTotal = NumConstant.ZERO; + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgePercentResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgePercentResultDTO.java new file mode 100644 index 0000000000..c5eec4d539 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberAgePercentResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description + * @ClassName PartymemberAgePercentResultDTO + * @Auth wangc + * @Date 2020-08-19 09:13 + */ +@Data +public class PartymemberAgePercentResultDTO implements Serializable { + private static final long serialVersionUID = 2228109850328978771L; + + /** + * 30岁以下 的党员占 注册党员总数的百分比 (返回数字,小数点后保留两位) + * */ + private BigDecimal under30Ratio; + + /** + * 31-50岁 的党员占 注册党员总数的百分比(返回数字,小数点后保留两位) + * */ + private BigDecimal between31And50Ratio; + + /** + * 51-60岁 的党员占 注册党员总数的百分比(返回数字,小数点后保留两位) + * */ + private BigDecimal between51And60Ratio; + + /** + * 61岁以上 的党员占 注册党员总数的百分比(返回数字,小数点后保留两位) + * */ + private BigDecimal above61; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberPercentResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberPercentResultDTO.java new file mode 100644 index 0000000000..eb8bc35184 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PartymemberPercentResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.screen.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 1、党员基本情况-饼状图概况 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321324 + * @ClassName PartymemberPercentResultDTO + * @Auth wangc + * @Date 2020-08-18 14:54 + */ +@Data +public class PartymemberPercentResultDTO implements Serializable { + private static final long serialVersionUID = -2864099044581782674L; + + /** + * 注册党员总数 + * */ + private Integer partyMemberTotal = NumConstant.ZERO; + + /** + * 注册党员占比 + * */ + private String percentInPlatForm; + + /** + * 注册用户总数 + * */ + private Integer platFormTotal = NumConstant.ZERO; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberDistributionResultDTO.java new file mode 100644 index 0000000000..397b53287b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberDistributionResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/18 11:06 上午 + */ +@Data +public class ParymemberDistributionResultDTO implements Serializable { + + private static final long serialVersionUID = 9180892033529262049L; + + /** + * 可能是gridId,可能是agencyId + */ + private String subId = ""; + + /** + * 中心点位 + */ + private String centerMark = ""; + + /** + * 党员总人数 + */ + private Integer totalNum = 0; + + /** + * 坐标区域 + */ + private String areaMarks = ""; + + /** + * 可以是网格的名称,可以是组织的名称 + */ + private String subName= ""; + + /** + * 组织:agency, 网格 : grid; + */ + private String type = ""; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberResultDTO.java new file mode 100644 index 0000000000..18bc33df48 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ParymemberResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.screen.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 2020/8/18 11:03 上午 + */ +@Data +public class ParymemberResultDTO implements Serializable { + + private static final long serialVersionUID = -7230556020628357047L; + + /** + * 当前所选组织 + */ + private String agencyId = ""; + + /** + * 当前所选组织名称 + */ + private String name = ""; + + /** + * 当前所选组织的坐标区域 + */ + private String areaMarks = ""; + + /** + * 机关级别 + * 社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province + */ + @JsonIgnore + private String level; + + /** + * 子级用户分布 + */ + private List userDistribution = new ArrayList<>(); +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectDetailResultDTO.java new file mode 100644 index 0000000000..234fe38034 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectDetailResultDTO.java @@ -0,0 +1,47 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/19 4:37 下午 + */ +@Data +public class ProjectDetailResultDTO implements Serializable { + + private static final long serialVersionUID = 2884179183725459493L; + + /** + * 项目内容 + */ + private String projectContent = ""; + + /** + * 当前状态 + */ + private String status = ""; + + /** + * 最后一次处理的部门 + */ + private String latestHandleDept = ""; + + /** + * 最后一次处理的时间yyyy-MM-dd HH:mm + */ + private String latestHandleTime = ""; + + /** + * 操作描述 + */ + private String operDesc = ""; + + /** + * 图片列表 + */ + private List imgList = new ArrayList<>(); +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectResultDTO.java new file mode 100644 index 0000000000..7a0a016b25 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/ProjectResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/19 1:27 下午 + */ +@Data +public class ProjectResultDTO implements Serializable { + + private static final long serialVersionUID = 7130615407473171093L; + + /** + * 项目标题 + */ + private String projectTitle = ""; + + /** + * red, green,yellow + */ + private String color = ""; + + /** + * 项目id + */ + private String projectId = ""; + + /** + * 网格名称 + */ + private String orgName = ""; + + /** + * 经度 + */ + private Double longitude = 0.0; + + /** + * 纬度 + */ + private Double latitude = 0.0; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiChartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiChartResultDTO.java new file mode 100644 index 0000000000..45f4f801ce --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiChartResultDTO.java @@ -0,0 +1,38 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @ClassName PublicPartiChartResultDTO + * @Auth wangc + * @Date 2020-08-21 09:16 + */ +@Data +public class PublicPartiChartResultDTO implements Serializable { + private static final long serialVersionUID = 8366701017042226713L; + + /** + * 横坐标:近一年(不包含当前月) + * */ + private List xAxis; + + /** + * 组织次数 + * */ + private List organizeNumList; + + /** + * 参与人数 + * */ + private List joinUserNumList; + + /** + * 平均参与人次 + * */ + private List averageJoinNumList; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiProfileResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiProfileResultDTO.java new file mode 100644 index 0000000000..52a127fd77 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiProfileResultDTO.java @@ -0,0 +1,48 @@ +package com.epmet.screen.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 3、公众参与概况返参DTO + * @ClassName PublicPartiProfileResultDTO + * @Auth wangc + * @Date 2020-08-20 14:33 + */ +@Data +public class PublicPartiProfileResultDTO implements Serializable { + private static final long serialVersionUID = 2520835419152912027L; + + private Integer total = NumConstant.ZERO; + + private String monthIncr = ""; + + /** + * incr上升, decr下降 + * */ + private String monthTrend = ""; + + private Integer averageIssue = NumConstant.ZERO; + + /** + * 较上月百分比 + * */ + private String issueCompareLatestMonth = ""; + + /** + * 较上月趋势:incr上升,decr下降 + * */ + private String issueCompareLatestTrend = ""; + + /** + * 平均参与度 + * */ + private Integer averageJoin = NumConstant.ZERO; + + private String joinCompareLatestMonth = ""; + + private String joinCompareLatestTrend = ""; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiRankResultDTO.java new file mode 100644 index 0000000000..b151901bdf --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/PublicPartiRankResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 公众参与-排行榜 传参dto + * @ClassName PublicPartiRankResultDTO + * @Auth wangc + * @Date 2020-08-20 15:29 + */ +@Data +public class PublicPartiRankResultDTO implements Serializable { + private static final long serialVersionUID = -2958188980327497507L; + + private String name; + + private Integer regNum; + + private Integer joinNum; + + private Integer topicNum; + + private Integer issueNum; + + private Integer projectNum; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/SubAgencyIndexRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/SubAgencyIndexRankResultDTO.java new file mode 100644 index 0000000000..5b0d89f39f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/SubAgencyIndexRankResultDTO.java @@ -0,0 +1,40 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 9:58 上午 + */ +@Data +public class SubAgencyIndexRankResultDTO implements Serializable { + + private static final long serialVersionUID = -2767000156092731932L; + + /** + * 名称(组织或者网格名称,部门名称) + */ + private String name = ""; + + /** + * 总指数 + */ + private Double totalIndex = 0.0; + + /** + * 党建能力 + */ + private Double governAbility = 0.0; + + /** + * 治理能力 + */ + private Double partyDevAbility = 0.0; + + /** + * 服务能力 + */ + private Double serviceAbility = 0.0; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TopProfileResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TopProfileResultDTO.java new file mode 100644 index 0000000000..607891f5bf --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TopProfileResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/19 1:46 下午 + */ +@Data +public class TopProfileResultDTO implements Serializable { + + private static final long serialVersionUID = -5081563117620857359L; + + /** + * 用户总数 + */ + private Integer userNum = 0; + + /** + * 党员总数 + */ + private Integer partyMemberNum = 0; + + /** + * 党群总数 + */ + private Integer groupNum = 0; + + /** + * 话题总数 + */ + private Integer topicNum = 0; + + /** + * 议题总数 + */ + private Integer issueNum = 0; + + /** + * 项目总数 + */ + private Integer projectNum = 0; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TreeResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TreeResultDTO.java new file mode 100644 index 0000000000..b12a8f46f5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/TreeResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.screen.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 2020/8/18 2:00 下午 + */ +@Data +public class TreeResultDTO implements Serializable { + + private static final long serialVersionUID = 3860268744336541373L; + + /** + * 显示名称 + */ + private String label = ""; + + /** + * agencyId下拉框value + */ + private String value = ""; + + @JsonIgnore + private String pids; + + /** + * 子目录 + */ + private List children = new ArrayList<>(); + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserDistributionResultDTO.java new file mode 100644 index 0000000000..15787f28ed --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserDistributionResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/18 11:06 上午 + */ +@Data +public class UserDistributionResultDTO implements Serializable { + + private static final long serialVersionUID = -7679590088019724244L; + + /** + * 可能是gridId,可能是agencyId + */ + private String subId; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 用户总人数 + */ + private Integer totalNum; + + /** + * 坐标区域 + */ + private String areaMarks; + + /** + * 可以是网格的名称,可以是组织的名称 + */ + private String subName; + + /** + * 组织:agency, 网格 : grid; + */ + private String type; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java new file mode 100644 index 0000000000..cf870c9b18 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java @@ -0,0 +1,47 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 用户参与各项指标以及增长查询结果dto + * @ClassName UserJoinIndicatorGrowthRateResultDTO + * @Auth wangc + * @Date 2020-08-21 16:07 + */ +@Data +public class UserJoinIndicatorGrowthRateResultDTO implements Serializable { + private static final long serialVersionUID = -8830240350298414599L; + + private Integer total; + + private BigDecimal monthIncr; + + /** + * incr上升, decr下降 + * */ + private String monthTrend; + + private Integer averageIssue; + + /** + * 较上月百分比 + * */ + private BigDecimal issueCompareLatestMonth; + + /** + * 较上月趋势:incr上升,decr下降 + * */ + private String issueCompareLatestTrend; + + /** + * 平均参与度 + * */ + private Integer averageJoin; + + private BigDecimal joinCompareLatestMonth; + + private String joinCompareLatestTrend; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinMonthlyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinMonthlyResultDTO.java new file mode 100644 index 0000000000..b35ce13c58 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserJoinMonthlyResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.screen.dto.result; + + +import lombok.Data; +import java.io.Serializable; + + +/** + * @Description 阅读用户参与查询返参dto screen_user_join + * @ClassName UserJoinMonthlyResultDTO + * @Auth wangc + * @Date 2020-08-21 09:20 + */ +@Data +public class UserJoinMonthlyResultDTO implements Serializable { + private static final long serialVersionUID = 4078219053108425375L; + + private String monthId; + + private Integer organizeNum; + + private Integer joinUserNum; + + private Integer averageJoinNum; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointRankResultDTO.java new file mode 100644 index 0000000000..43cc73e066 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointRankResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.LinkedList; +import java.util.List; + +/** + * @Description + * @ClassName UserPointRankResultDTO + * @Auth wangc + * @Date 2020-08-20 10:46 + */ +@Data +public class UserPointRankResultDTO implements Serializable { + private static final long serialVersionUID = 2829557017489626022L; + + /** + * 横坐标:姓名 + * */ + private List nameData = new LinkedList<>(); + + /** + * 纵坐标:积分 + * */ + private List pointsData = new LinkedList<>(); +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointResultDTO.java new file mode 100644 index 0000000000..1f38d6886e --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserPointResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 用户积分DTO - 查询结果 + * @ClassName UserPointResultDTO + * @Auth wangc + * @Date 2020-08-20 10:50 + */ +@Data +public class UserPointResultDTO implements Serializable { + private static final long serialVersionUID = -5174248184514429116L; + + private String name; + + private Integer point; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java new file mode 100644 index 0000000000..179aa5bec2 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/UserResultDTO.java @@ -0,0 +1,49 @@ +package com.epmet.screen.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 2020/8/18 11:03 上午 + */ +@Data +public class UserResultDTO implements Serializable { + + private static final long serialVersionUID = -6633682494274511121L; + + /** + * 当前所选组织 + */ + private String agencyId = ""; + + /** + * 当前所选组织名称 + */ + private String name = ""; + + /** + * 当前所选组织的坐标区域 + */ + private String areaMarks = ""; + + /** + * 机关级别 + * 社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province + */ + @JsonIgnore + private String level; + + /** + * 子级用户分布 + */ + private List userDistribution = new ArrayList<>(); +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResult.java new file mode 100644 index 0000000000..bc2d53edff --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResult.java @@ -0,0 +1,35 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/20 3:16 下午 + */ +@Data +public class VolunteerServiceResult implements Serializable { + + private static final long serialVersionUID = 959536759114517195L; + + /** + * 月份ID + */ + private String monthId; + + /** + * 组织次数 + */ + private Integer organizeData; + + /** + * 参与次数 + */ + private Integer joinData; + + /** + * 平均参与人次 + */ + private Integer averageJoinUserData; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java new file mode 100644 index 0000000000..18331f9ca7 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/VolunteerServiceResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/20 3:14 下午 + */ +@Data +public class VolunteerServiceResultDTO implements Serializable { + + private static final long serialVersionUID = -6227889392267793005L; + + /** + * x轴,返回近12个月,不包含当前月 + */ + private List xAxis; + + /** + * 组织次数 + */ + private List organizeData; + + /** + * 参与次数 + */ + private List joinData; + + /** + * 平均参与人次 + */ + private List averageJoinUserData; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/YearAverageIndexResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/YearAverageIndexResultDTO.java new file mode 100644 index 0000000000..d05479d5d2 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/YearAverageIndexResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/19 2:45 下午 + */ +@Data +public class YearAverageIndexResultDTO implements Serializable { + + private static final long serialVersionUID = 6453379153616899440L; + + /** + * 年度平均指数 + */ + private Double yearAverageIndex = 0.0; + + /** + * 服务能力 + */ + private Double serviceAbility = 0.0; + + /** + * 党建能力 + */ + private Double partyDevAbility = 0.0; + + /** + * 治理能力 + */ + private Double governAbility = 0.0; +} diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index 116fd812c5..92658e8199 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-report-server: container_name: data-report-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.27 + image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.28 ports: - "8109:8109" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index a859f98664..2da81cdd0e 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.27 + 0.3.28 data-report-server @@ -67,6 +67,12 @@ epmet-commons-extapp-auth 2.0.0 + + + com.epmet + epmet-commons-dynamic-datasource + 2.0.0 + @@ -104,11 +110,18 @@ dev - + - - epmet_data_statistical_user - EpmEt-db-UsEr + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + + epmet_data_stats_display_user + EpmEt-db-UsEr 0 @@ -118,8 +131,8 @@ true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false @@ -139,11 +152,11 @@ test - + - - epmet - elink@833066 + + epmet + elink@833066 0 @@ -174,11 +187,11 @@ prod - + - - epmet_data_statistical - EpmEt-db-UsEr + + epmet_data_statistical + EpmEt-db-UsEr 0 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/aspect/RequestLogAspect.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..d57b2833e5 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.datareport.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.datareport.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-report/data-report-server/src/main/java/com/epmet/config/ModuleConfigImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/config/ModuleConfigImpl.java similarity index 92% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/config/ModuleConfigImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/config/ModuleConfigImpl.java index c52ec15b50..10a4cdd6d7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/config/ModuleConfigImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/config/ModuleConfigImpl.java @@ -6,7 +6,7 @@ * 版权所有,侵权必究! */ -package com.epmet.config; +package com.epmet.datareport.config; import com.epmet.commons.tools.config.ModuleConfig; import org.springframework.stereotype.Service; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/.gitignore similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/.gitignore rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/.gitignore diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/group/GroupController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/group/GroupController.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/group/GroupController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/group/GroupController.java index 88dd3bb376..1d269eddbd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/group/GroupController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/group/GroupController.java @@ -9,7 +9,7 @@ import com.epmet.group.dto.result.GroupIncrTrendResultDTO; import com.epmet.group.dto.result.GroupSubAgencyResultDTO; import com.epmet.group.dto.result.GroupSubGridResultDTO; import com.epmet.group.dto.result.GroupSummaryInfoResultDTO; -import com.epmet.service.group.GroupService; +import com.epmet.datareport.service.group.GroupService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/issue/IssueController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/issue/IssueController.java similarity index 96% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/issue/IssueController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/issue/IssueController.java index c9fad20ce2..afc732802d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/issue/IssueController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/issue/IssueController.java @@ -1,11 +1,11 @@ -package com.epmet.controller.issue; +package com.epmet.datareport.controller.issue; 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.issue.dto.form.IssueIncrtrendFormDTO; import com.epmet.issue.dto.result.*; -import com.epmet.service.issue.IssueService; +import com.epmet.datareport.service.issue.IssueService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/project/ProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/project/ProjectController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/publicity/PublicityController.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/publicity/PublicityController.java index 8612d82002..f01540758c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/publicity/PublicityController.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.controller.publicity; +package com.epmet.datareport.controller.publicity; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.NumConstant; @@ -24,7 +24,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.publicity.dto.form.TagFormDTO; import com.epmet.publicity.dto.result.*; -import com.epmet.service.publicity.PublicityService; +import com.epmet.datareport.service.publicity.PublicityService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; 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 new file mode 100644 index 0000000000..d671c4cd05 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java @@ -0,0 +1,59 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +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.screen.dto.form.CompartmentFormDTO; +import com.epmet.screen.dto.result.CompartmentResultDTO; +import com.epmet.screen.dto.result.TreeResultDTO; +import com.epmet.datareport.service.screen.AgencyService; +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; + +/** + * 组织相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:15 + */ +@RestController +@RequestMapping("/screen/agency") +public class AgencyController { + + @Autowired + private AgencyService agencyService; + + /** + * @Description 1、组织机构树 + * @param + * @author zxc + * @date 2020/8/18 2:04 下午 + */ + @ExternalAppRequestAuth + @PostMapping("tree") + public Result tree(ExternalAppRequestParam externalAppRequestParam){ + return new Result().ok(agencyService.tree(externalAppRequestParam)); + } + + /** + * @Description 2、组织区域查询 + * @param compartmentFormDTO + * @author zxc + * @date 2020/8/18 2:33 下午 + */ + @ExternalAppRequestAuth + @PostMapping("compartment") + public Result compartment(@RequestBody CompartmentFormDTO compartmentFormDTO){ + ValidatorUtils.validateEntity(compartmentFormDTO, CompartmentFormDTO.Compartment.class); + return new Result().ok(agencyService.compartment(compartmentFormDTO)); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java new file mode 100644 index 0000000000..b0b7c1f7a8 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java @@ -0,0 +1,95 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.screen.dto.form.*; +import com.epmet.screen.dto.result.*; +import com.epmet.datareport.service.screen.DistributionService; +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 yinzuomei@elink-cn.com + * @date 2020/8/18 10:14 + */ +@RestController +@RequestMapping("/screen/distribution") +public class DistributionController { + + @Autowired + private DistributionService distributionService; + + /** + * @Description 1、党支部 + * @param formDTO + * @author zxc + * @date 2020/8/18 10:59 上午 + */ + @ExternalAppRequestAuth + @PostMapping("branch") + public Result> branch(@RequestBody BranchFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, BranchFormDTO.Branch.class); + return new Result>().ok(distributionService.branch(formDTO)); + } + + /** + * @Description 2、用户分布 + * @param userFormDTO + * @author zxc + * @date 2020/8/18 11:10 上午 + */ + @ExternalAppRequestAuth + @PostMapping("user") + public Result user(@RequestBody UserFormDTO userFormDTO){ + ValidatorUtils.validateEntity(userFormDTO, UserFormDTO.User.class); + return new Result().ok(distributionService.user(userFormDTO)); + } + + /** + * @Description 3、党员分布 + * @param parymemberFormDTO + * @author zxc + * @date 2020/8/18 11:20 上午 + */ + @ExternalAppRequestAuth + @PostMapping("parymember") + public Result parymember(@RequestBody ParymemberFormDTO parymemberFormDTO){ + ValidatorUtils.validateEntity(parymemberFormDTO, ParymemberFormDTO.Parymember.class); + return new Result().ok(distributionService.parymember(parymemberFormDTO)); + } + + /** + * @Description 4、事件 + * @param projectFormDTO + * @author zxc + * @date 2020/8/19 1:29 下午 + */ + @ExternalAppRequestAuth + @PostMapping("project") + public Result> project(@RequestBody ProjectFormDTO projectFormDTO){ + ValidatorUtils.validateEntity(projectFormDTO, ProjectFormDTO.Project.class); + return new Result>().ok(distributionService.project(projectFormDTO)); + } + + /** + * @Description 5、top区概况 + * @param topProfileFormDTO + * @author zxc + * @date 2020/8/19 1:52 下午 + */ + @ExternalAppRequestAuth + @PostMapping("topprofile") + public Result topProfile(@RequestBody TopProfileFormDTO topProfileFormDTO){ + ValidatorUtils.validateEntity(topProfileFormDTO, TopProfileFormDTO.TopProfile.class); + return new Result().ok(distributionService.topProfile(topProfileFormDTO)); + } + +} 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 new file mode 100644 index 0000000000..325c4606c8 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java @@ -0,0 +1,109 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.screen.GrassRootsGovernService; +import com.epmet.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.screen.dto.form.AgencyFormDTO; +import com.epmet.screen.dto.form.AgencyNumTypeParamFormDTO; +import com.epmet.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 java.util.List; + +/** + * 基层治理相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:12 + */ +@RestController +@RequestMapping("/screen/grassrootsgovern") +public class GrassRootsGovernController { + + @Autowired + private GrassRootsGovernService grassRootsGovernService; + + + + /** + * @Description 1、热心市民积分排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321544 + * @param param + * @return + * @author wangc + * @date 2020.08.20 11:16 + **/ + @ExternalAppRequestAuth + @PostMapping("userpointrank") + public Result userPointRank(@RequestBody AgencyAndNumFormDTO param){ + ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); + return new Result().ok(grassRootsGovernService.userPointRank(param)); + } + + /** + * @Description 2、难点赌点-耗时最长|涉及部门最多|处理次数 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614 + * @param param + * @return + * @author wangc + * @date 2020.08.20 13:55 + **/ + @ExternalAppRequestAuth + @PostMapping("difficultprojects") + public Result> difficultProject(@RequestBody AgencyNumTypeParamFormDTO param){ + ValidatorUtils.validateEntity(param, AgencyNumTypeParamFormDTO.AgencyNumTypeParamGroup.class); + return new Result>().ok(grassRootsGovernService.difficultProject(param)); + } + + /** + * @Description 3、公众参与概况 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321975 + * @param param + * @return + * @author wangc + * @date 2020.08.20 14:37 + **/ + @ExternalAppRequestAuth + @PostMapping("publicpartiprofile") + public Result publicPartiProfile(@RequestBody AgencyFormDTO param){ + ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); + return new Result().ok(grassRootsGovernService.publicPartiProfile(param)); + } + + /** + * @Description 4、公众参与-排行榜 + * @NEI https://nei.netease.com/interface/detail/?pid=57068&id=321978 + * @param param + * @return + * @author wangc + * @date 2020.08.20 15:32 + **/ + @ExternalAppRequestAuth + @PostMapping("publicpartirank") + public Result> publicPartiRank(@RequestBody AgencyAndNumFormDTO param){ + ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); + return new Result>().ok(grassRootsGovernService.publicPartiRank(param)); + } + + /** + * @Description 5、治理能力榜单 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321627 + * @param param + * @return + * @author wangc + * @date 2020.08.20 17:46 + **/ + @ExternalAppRequestAuth + @PostMapping("governcapacityrank") + public Result> governCapacityRank(@RequestBody AgencyAndNumFormDTO param){ + ValidatorUtils.validateEntity(param,AgencyFormDTO.CommonAgencyIdGroup.class); + return new Result>().ok(grassRootsGovernService.governCapacityRank(param)); + } + +} 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 new file mode 100644 index 0000000000..7c536869e9 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java @@ -0,0 +1,93 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.screen.GrassrootsPartyDevService; +import com.epmet.screen.dto.form.BranchBuildRankFormDTO; +import com.epmet.screen.dto.form.BranchBuildTrendFormDTO; +import com.epmet.screen.dto.form.ParymemberFormDTO; +import com.epmet.screen.dto.result.BranchBuildRankResultDTO; +import com.epmet.screen.dto.result.BranchBuildTrendResultDTO; +import com.epmet.screen.dto.result.PartymemberAgeDistributionResultDTO; +import com.epmet.screen.dto.result.PartymemberPercentResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 基层党建相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:11 + */ +@RestController +@RequestMapping("/screen/grassrootspartydev") +public class GrassrootsPartyDevController { + + @Autowired + private GrassrootsPartyDevService grassrootsPartyDevService; + + /** + * @Description 党员基本情况-饼状图概况 + * @NEI https://nei.netease.com/interface/detail/?pid=57068&id=321324 + * @param param + * @return + * @author wangc + * @date 2020.08.18 16:59 + **/ + @ExternalAppRequestAuth + @PostMapping("basicinfo") + public Result baseInfo(@RequestBody ParymemberFormDTO param){ + ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class); + return new Result().ok(grassrootsPartyDevService.partymemberBaseInfo(param)); + } + + /** + * @Description 2、党员基本情况-年龄分布 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321980 + * @param param + * @return + * @author wangc + * @date 2020.08.18 17:54 + **/ + @ExternalAppRequestAuth + @PostMapping("ageinfo") + public Result ageInfo(@RequestBody ParymemberFormDTO param){ + ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class); + return new Result().ok(grassrootsPartyDevService.partymemberAgeDistribution(param)); + } + + /** + * @Description 3、支部建设情况|联建共建情况-折线图 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321981 + * @param param + * @return BranchBuildTrendResultDTO + * @author wangc + * @date 2020.08.19 11:02 + **/ + @ExternalAppRequestAuth + @PostMapping("branchbuildtrend") + public Result branchBuildTrend(@RequestBody BranchBuildTrendFormDTO param){ + ValidatorUtils.validateEntity(param, BranchBuildTrendFormDTO.branchBuildTrendGroup.class); + return new Result().ok(grassrootsPartyDevService.branchBuildTrend(param)); + } + + /** + * @Description 4、支部建设情况|联建共建情况-排行 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321982 + * @param param + * @return + * @author wangc + * @date 2020.08.19 15:25 + **/ + @ExternalAppRequestAuth + @PostMapping("branchbuildrank") + public Result branchBuildRank(@RequestBody BranchBuildRankFormDTO param){ + ValidatorUtils.validateEntity(param, BranchBuildRankFormDTO.BranchBuildRankGroup.class); + return new Result().ok(grassrootsPartyDevService.branchBuildRank(param)); + } + +} 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 new file mode 100644 index 0000000000..53b69591b4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -0,0 +1,89 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.screen.IndexService; +import com.epmet.screen.dto.form.MonthBarchartFormDTO; +import com.epmet.screen.dto.form.MonthPieChartFormDTO; +import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.screen.dto.result.MonthBarchartResultDTO; +import com.epmet.screen.dto.result.MonthPieChartResultDTO; +import com.epmet.screen.dto.result.SubAgencyIndexRankResultDTO; +import com.epmet.screen.dto.result.YearAverageIndexResultDTO; +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 yinzuomei@elink-cn.com + * @date 2020/8/18 10:13 + */ +@RestController +@RequestMapping("/screen/index") +public class IndexController { + + @Autowired + private IndexService indexService; + + /** + * @Description 1、年度平均指数 + * @param yearAverageIndexFormDTO + * @author zxc + * @date 2020/8/19 2:53 下午 + */ + @ExternalAppRequestAuth + @PostMapping("yearaverageindex") + public Result yearAverageIndex(@RequestBody YearAverageIndexFormDTO yearAverageIndexFormDTO){ + ValidatorUtils.validateEntity(yearAverageIndexFormDTO, YearAverageIndexFormDTO.YearAverageIndex.class); + return new Result().ok(indexService.yearAverageIndex(yearAverageIndexFormDTO)); + } + + /** + * @Description 2、月度指数分析-饼状图 + * @param monthPieChartFormDTO + * @author zxc + * @date 2020/8/19 3:17 下午 + */ + @ExternalAppRequestAuth + @PostMapping("monthindexanalysis/piechart") + public Result monthPieChart(@RequestBody MonthPieChartFormDTO monthPieChartFormDTO){ + ValidatorUtils.validateEntity(monthPieChartFormDTO, MonthPieChartFormDTO.MonthPieChart.class); + return new Result().ok(indexService.monthPieChart(monthPieChartFormDTO)); + } + + /** + * @Description 3、月度指数分析-柱状图 + * @param monthBarchartFormDTO + * @author zxc + * @date 2020/8/19 5:27 下午 + */ + @ExternalAppRequestAuth + @PostMapping("monthindexanalysis/barchart") + public Result monthBarchart(@RequestBody MonthBarchartFormDTO monthBarchartFormDTO, ExternalAppRequestParam externalAppRequestParam){ + ValidatorUtils.validateEntity(monthBarchartFormDTO, MonthBarchartFormDTO.MonthBarchart.class); + return new Result().ok(indexService.monthBarchart(monthBarchartFormDTO,externalAppRequestParam)); + } + + /** + * @Description 4、下级部门指数排行 + * @param subAgencyIndexRankFormDTO + * @author zxc + * @date 2020/8/20 10:02 上午 + */ + @ExternalAppRequestAuth + @PostMapping("subagencyindexrank") + public Result> subAgencyIndexRank(@RequestBody SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO){ + ValidatorUtils.validateEntity(subAgencyIndexRankFormDTO, SubAgencyIndexRankFormDTO.SubAgencyIndexRank.class); + return new Result>().ok(indexService.subAgencyIndexRank(subAgencyIndexRankFormDTO)); + } + +} 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 new file mode 100644 index 0000000000..5478956a32 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java @@ -0,0 +1,99 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.screen.PartyMemberLeadService; +import com.epmet.screen.dto.form.*; +import com.epmet.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 java.util.List; + +/** + * 党建引领相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:10 + */ +@RestController +@RequestMapping("/screen/partymemberlead") +public class PartyMemberLeadController { + + @Autowired + private PartyMemberLeadService partyMemberLeadService; + + /** + * @Description 1、先锋模范 + * @param fineExampleFormDTO + * @author zxc + * @date 2020/8/20 1:56 下午 + */ + @ExternalAppRequestAuth + @PostMapping("fineexample") + public Result fineExample(@RequestBody FineExampleFormDTO fineExampleFormDTO){ + ValidatorUtils.validateEntity(fineExampleFormDTO, FineExampleFormDTO.FineExample.class); + return new Result().ok(partyMemberLeadService.fineExample(fineExampleFormDTO)); + } + + /** + * @Description 2、党员联系群众 + * @param contactMassLineChartFormDTO + * @author zxc + * @date 2020/8/20 2:35 下午 + */ + @ExternalAppRequestAuth + @PostMapping("contactmasslinechart") + public Result contactMassLineChart(@RequestBody ContactMassLineChartFormDTO contactMassLineChartFormDTO){ + ValidatorUtils.validateEntity(contactMassLineChartFormDTO, ContactMassLineChartFormDTO.ContactMassLineChart.class); + return new Result().ok(partyMemberLeadService.contactMassLineChart(contactMassLineChartFormDTO)); + } + + /** + * @Description 3、党员志愿服务 + * @param volunteerServiceFormDTO + * @author zxc + * @date 2020/8/20 3:19 下午 + */ + @ExternalAppRequestAuth + @PostMapping("volunteerservice") + public Result volunteerService(@RequestBody VolunteerServiceFormDTO volunteerServiceFormDTO){ + ValidatorUtils.validateEntity(volunteerServiceFormDTO, VolunteerServiceFormDTO.VolunteerService.class); + return new Result().ok(partyMemberLeadService.volunteerService(volunteerServiceFormDTO)); + } + + /** + * @Description 4、先进排行榜单-先进支部排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321539 + * @param param + * @return + * @author wangc + * @date 2020.08.21 11:05 + **/ + @ExternalAppRequestAuth + @PostMapping("advancedbranchrank") + Result> advancedBranchRank(@RequestBody AgencyAndNumFormDTO param){ + ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); + return new Result>().ok(partyMemberLeadService.advancedBranchRank(param)); + } + + /** + * @Description 5、先进排行榜单-先进党员排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321624 + * @param param + * @return List + * @author wangc + * @date 2020.08.21 14:22 + **/ + @ExternalAppRequestAuth + @PostMapping("advancedpartymemberrank") + Result> advancedPartymemberRank(@RequestBody AgencyAndNumFormDTO param){ + ValidatorUtils.validateEntity(param, AgencyFormDTO.CommonAgencyIdGroup.class); + return new Result>().ok(partyMemberLeadService.advancedPartymemberRank(param)); + } + +} 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 new file mode 100644 index 0000000000..8c508e5eda --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java @@ -0,0 +1,41 @@ +package com.epmet.datareport.controller.screen; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.screen.ScreenProjectService; +import com.epmet.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.screen.dto.result.ProjectDetailResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 项目 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:16 + */ +@RestController +@RequestMapping("/screen/project") +public class ScreenProjectController { + + @Autowired + private ScreenProjectService screenProjectService; + + /** + * @Description 3、项目详情 + * @param projectDetailFormDTO + * @author zxc + * @date 2020/8/19 4:36 下午 + */ + @ExternalAppRequestAuth + @PostMapping("detail") + public Result projectDetail(@RequestBody ProjectDetailFormDTO projectDetailFormDTO){ + ValidatorUtils.validateEntity(projectDetailFormDTO, ProjectDetailFormDTO.ProjectDetail.class); + return new Result().ok(screenProjectService.projectDetail(projectDetailFormDTO)); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/topic/TopicController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/topic/TopicController.java similarity index 96% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/topic/TopicController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/topic/TopicController.java index 233f31dc27..91edf636dd 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/topic/TopicController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/topic/TopicController.java @@ -1,10 +1,10 @@ -package com.epmet.controller.topic; +package com.epmet.datareport.controller.topic; 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.service.topic.TopicService; +import com.epmet.datareport.service.topic.TopicService; import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; import com.epmet.topic.dto.result.*; import org.springframework.beans.factory.annotation.Autowired; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/UserAnalysisController.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/UserAnalysisController.java index cceebbef37..dda6b177cf 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/user/UserAnalysisController.java @@ -1,4 +1,4 @@ -package com.epmet.controller.user; +package com.epmet.datareport.controller.user; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; @@ -7,7 +7,7 @@ import com.epmet.dto.form.user.UserSubAgencyFormDTO; import com.epmet.dto.form.user.UserSubGridFormDTO; import com.epmet.dto.form.user.UserSummaryInfoFormDTO; import com.epmet.dto.result.user.*; -import com.epmet.service.user.UserAnalysisService; +import com.epmet.datareport.service.user.UserAnalysisService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/.gitignore similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/.gitignore rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/.gitignore diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/group/GroupDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/group/GroupDao.java index e2a8410272..975b49ba5a 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/group/GroupDao.java @@ -1,4 +1,4 @@ -package com.epmet.dao.group; +package com.epmet.datareport.dao.group; import com.epmet.group.dto.result.*; import org.apache.ibatis.annotations.Mapper; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/issue/IssueDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/IssueDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/issue/IssueDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/IssueDao.java index abf2c4d350..53cab40c92 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/issue/IssueDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/issue/IssueDao.java @@ -1,4 +1,4 @@ -package com.epmet.dao.issue; +package com.epmet.datareport.dao.issue; import com.epmet.issue.dto.result.IssueDataDTO; import org.apache.ibatis.annotations.Mapper; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/project/ProjectDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java index 3ae53720f7..b8920580bf 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java @@ -1,4 +1,4 @@ -package com.epmet.dao.project; +package com.epmet.datareport.dao.project; import com.epmet.project.dto.FactAgencyProjectDailyDTO; import com.epmet.project.dto.result.*; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/publicity/PublicityDao.java similarity index 99% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/publicity/PublicityDao.java index a4babe6039..b65c16b9a1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/publicity/PublicityDao.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.dao.publicity; +package com.epmet.datareport.dao.publicity; import com.epmet.publicity.dto.result.*; import org.apache.ibatis.annotations.Mapper; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCpcBaseDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCpcBaseDataDao.java new file mode 100644 index 0000000000..87f26f3b01 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCpcBaseDataDao.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.screen; + +import com.epmet.screen.dto.result.PartymemberAgeDistributionResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + + +/** + * 基层党建-党员基本情况 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +@Mapper +public interface ScreenCpcBaseDataDao{ + + /** + * @Description 查询党员年龄分布情况 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.18 17:47 + **/ + PartymemberAgeDistributionResultDTO selectPartymemberAgeDistribution(@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/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerAgencyDao.java new file mode 100644 index 0000000000..c97ac8b8e0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerAgencyDao.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.dao.screen; + +import com.epmet.screen.dto.result.*; +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-08-18 + */ +@Mapper +public interface ScreenCustomerAgencyDao { + + /** + * @Description 查询客户根组织ID + * @param customerId + * @author zxc + * @date 2020/8/18 2:44 下午 + */ + TreeResultDTO selectRootAgencyId(@Param("customerId")String customerId); + + /** + * @Description 查询下级机关的 名称和id + * @param subAgencyPids + * @author zxc + * @date 2020/8/18 4:48 下午 + */ + List selectSubAgencyList(@Param("subAgencyPids") String subAgencyPids); + + /** + * @Description 查询当前机关的区域信息 + * @param agencyId + * @author zxc + * @date 2020/8/18 4:51 下午 + */ + CompartmentResultDTO getAgencyAreaInfo(@Param("agencyId")String agencyId); + + /** + * @Description 查询子级区域分布信息【机关级别】 + * @param agencyId + * @author zxc + * @date 2020/8/18 5:12 下午 + */ + List selectSubDistribution(@Param("agencyId")String agencyId); + + /** + * @Description 查询子级用户分布【机关级别】 + * @param parentId + * @author zxc + * @date 2020/8/19 9:33 上午 + */ + List selectUserDistributionAgency(@Param("parentId")String parentId); + + /** + * @Description 查询子级党员分布【机关级别】 + * @param parentId + * @author zxc + * @date 2020/8/19 10:30 上午 + */ + List selectParymemberDistribution(@Param("parentId")String parentId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerDeptDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerDeptDao.java new file mode 100644 index 0000000000..e6ae450514 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerDeptDao.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.screen; + +import org.apache.ibatis.annotations.Mapper; + +/** + * 部门信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +@Mapper +public interface ScreenCustomerDeptDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerGridDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerGridDao.java new file mode 100644 index 0000000000..4e57c2f71d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenCustomerGridDao.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.screen; + +import com.epmet.screen.dto.result.AgencyDistributionResultDTO; +import com.epmet.screen.dto.result.BranchResultDTO; +import com.epmet.screen.dto.result.ParymemberDistributionResultDTO; +import com.epmet.screen.dto.result.UserDistributionResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenCustomerGridDao { + + /** + * @Description 查询子级区域分布信息【网格级别】 + * @param agencyId + * @author zxc + * @date 2020/8/18 5:12 下午 + */ + List selectSubDistribution(@Param("agencyId")String agencyId); + + /** + * @Description 查询党支部信息 + * @param agencyId + * @author zxc + * @date 2020/8/19 9:13 上午 + */ + List selectBranch(@Param("agencyId")String agencyId); + + /** + * @Description 查询子级用户分布【网格级别】 + * @param parentId + * @author zxc + * @date 2020/8/19 9:33 上午 + */ + List selectUserDistribution(@Param("parentId")String parentId); + + /** + * @Description 查询子级党员分布【网格级别】 + * @param parentId + * @author zxc + * @date 2020/8/19 10:30 上午 + */ + List selectParymemberDistribution(@Param("parentId")String parentId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenDifficultyDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenDifficultyDataDao.java new file mode 100644 index 0000000000..17d2e7a420 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenDifficultyDataDao.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.screen; + +import com.epmet.screen.dto.result.DifficultProjectResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenDifficultyDataDao { + + /** + * @Description 查询难点赌点-耗时最长|涉及部门最多|处理次数 + * @param + * @return + * @author wangc + * @date 2020.08.20 14:26 + **/ + List selectDifficulty(@Param("agencyId")String agencyId,@Param("type")String type); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.java new file mode 100644 index 0000000000..92f1641cce --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventDataDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.ProjectDetailResultDTO; +import com.epmet.screen.dto.result.ProjectResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenEventDataDao{ + + /** + * @Description 查询事件 + * @param parentId + * @author zxc + * @date 2020/8/19 2:09 下午 + */ + List selectEvent(@Param("parentId")String parentId); + + /** + * @Description 3、项目详情 + * @param projectId + * @author zxc + * @date 2020/8/19 4:36 下午 + */ + ProjectDetailResultDTO selectEventDetail(@Param("projectId")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/screen/ScreenEventImgDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventImgDataDao.java new file mode 100644 index 0000000000..8090ce00c7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenEventImgDataDao.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.screen; + +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-08-18 + */ +@Mapper +public interface ScreenEventImgDataDao { + + /** + * @Description 查询事件imgUrl集合 + * @param projectId + * @author zxc + * @date 2020/8/19 5:11 下午 + */ + List selectEventImgList(@Param("projectId")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/screen/ScreenGovernRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenGovernRankDataDao.java new file mode 100644 index 0000000000..3cf167fc5e --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenGovernRankDataDao.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.screen; + +import com.epmet.screen.dto.result.GovernCapacityResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenGovernRankDataDao{ + + /** + * @Description 查询政府治理能力各项指标 + * @param monthId + * @param agencyId + * @return + * @author wangc + * @date 2020.08.20 17:34 + **/ + List selectGovernCapacityRatio(@Param("monthId") String monthId,@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/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java new file mode 100644 index 0000000000..2e18647c39 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java @@ -0,0 +1,64 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.screen; + +import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.screen.dto.result.MonthBarchartResult; +import com.epmet.screen.dto.result.MonthBarchartResultDTO; +import com.epmet.screen.dto.result.MonthPieChartResultDTO; +import com.epmet.screen.dto.result.SubAgencyIndexRankResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenIndexDataMonthlyDao{ + + /** + * @Description 2、月度指数分析-饼状图 + * @param agencyId + * @author zxc + * @date 2020/8/19 3:43 下午 + */ + MonthPieChartResultDTO selectMonthPieChart(@Param("agencyId")String agencyId); + + /** + * @Description 查询近一年的指数值【不包括本月】 + * @param customerId + * @param agencyId + * @author zxc + * @date 2020/8/20 9:02 上午 + */ + List selectMonthBarchart(@Param("customerId")String customerId, @Param("agencyId")String agencyId); + + /** + * @Description 4、下级部门指数排行 + * @param subAgencyIndexRankFormDTO + * @author zxc + * @date 2020/8/20 10:04 上午 + */ + List selectSubAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.java new file mode 100644 index 0000000000..304351b3b7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.YearAverageIndexResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 指数-指数数据(按年统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface ScreenIndexDataYearlyDao{ + + /** + * @Description 1、年度平均指数 + * @param agencyId + * @author zxc + * @date 2020/8/19 3:43 下午 + */ + YearAverageIndexResultDTO selectYearAverageIndex(@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/screen/ScreenOrgRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenOrgRankDataDao.java new file mode 100644 index 0000000000..fbee5cd15c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenOrgRankDataDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.OrgRankDataResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenOrgRankDataDao{ + + /** + * @Description 查询指定机关的直属网格月度数据 + * @param agencyId + * @param monthId + * @return + * @author wangc + * @date 2020.08.21 13:58 + **/ + List selectGridDataMonthly(@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/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.java new file mode 100644 index 0000000000..0117eec4a7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyBranchDataDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.BranchBuildOrderByCountResultDTO; +import com.epmet.screen.dto.result.BranchIssueDataResultDTO; +import com.epmet.screen.dto.result.VolunteerServiceResult; +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-08-18 + */ +@Mapper +public interface ScreenPartyBranchDataDao { + + /** + * @Description 根据agencyTd、type(数据类别 party:支部建设;union:联合建设)查出共有多少议题主题 + * @param agencyId + * @param type + * @return List + * @author wangc + * @date 2020.08.19 10:44 + **/ + List selectIssueGroup(@Param("agencyId") String agencyId , @Param("type") String type); + + /** + * @Description 根据议题名称查找近12个月的数据 + * @param agencyId .. + * @return List + * @author wangc + * @date 2020.08.19 10:59 + **/ + List selectBranchDataByTypeAndTimeZone(@Param("agencyId") String agencyId , @Param("type") String type, @Param("category") String category, @Param("bottomMonthId") String bottomMonthId); + + /** + * @Description 查询党员志愿服务 + * @param agencyId + * @author zxc + * @date 2020/8/20 3:30 下午 + */ + List selectVolunteerServiceResult(@Param("agencyId")String agencyId); + /** + * @Description 查找指定组织的下一级组织的数据排行 + * @param agencyId .. + * @return List + * @author wangc + * @date 2020.08.20 09:46 + **/ + List selectBranchDataByTypeOrder(@Param("agencyId")String agencyId,@Param("category")String category,@Param("monthId")String monthId,@Param("bottomMonthId")String bottomMonthId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyLinkMassesDataDao.java new file mode 100644 index 0000000000..dfa5c1f6d2 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyLinkMassesDataDao.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.screen; + +import com.epmet.screen.dto.result.ContactMassLineChartResult; +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-08-18 + */ +@Mapper +public interface ScreenPartyLinkMassesDataDao { + + /** + * @Description 查询党员联系群众 + * @param agencyId + * @author zxc + * @date 2020/8/20 2:48 下午 + */ + List selectContactMassLineChart(@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/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyUserRankDataDao.java new file mode 100644 index 0000000000..946ac2a096 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPartyUserRankDataDao.java @@ -0,0 +1,54 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.screen; + +import com.epmet.screen.dto.result.PartyUserPointResultDTO; +import com.epmet.screen.dto.result.UserPointResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenPartyUserRankDataDao{ + + /** + * @Description 查询指定机关下的用户积分排名 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.20 11:11 + **/ + List selectUserPointOrder(@Param("agencyId")String agencyId); + + /** + * @Description 查询指定机关所属网格的党员积分排名 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.21 14:32 + **/ + List selectPartymemberPointOrder(@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/screen/ScreenPioneerDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPioneerDataDao.java new file mode 100644 index 0000000000..4b477689c3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenPioneerDataDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.FineExampleResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 党建引领-先锋模范数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +@Mapper +public interface ScreenPioneerDataDao{ + + /** + * @Description 查询先锋模范 + * @param agencyId + * @author zxc + * @date 2020/8/20 5:22 下午 + */ + FineExampleResultDTO selectFineExample(@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/screen/ScreenUserJoinDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserJoinDao.java new file mode 100644 index 0000000000..0edee635d4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserJoinDao.java @@ -0,0 +1,54 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.screen; + +import com.epmet.screen.dto.result.UserJoinIndicatorGrowthRateResultDTO; +import com.epmet.screen.dto.result.UserJoinMonthlyResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenUserJoinDao { + + /** + * @Description 查询用户参与数据 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.20 15:07 + **/ + UserJoinIndicatorGrowthRateResultDTO selectUserJoinData(@Param("agencyId") String agencyId, @Param("monthId")String monthId); + + /** + * @Description 查询月度用户参与数据 + * @param agencyId + * @param monthId + * @return + * @author wangc + * @date 2020.08.21 09:54 + **/ + List selectUserJoinDataMonthly(@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/screen/ScreenUserTotalDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.java new file mode 100644 index 0000000000..a03353e825 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenUserTotalDataDao.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.datareport.dao.screen; + +import com.epmet.screen.dto.result.PartymemberPercentResultDTO; +import com.epmet.screen.dto.result.PublicPartiRankResultDTO; +import com.epmet.screen.dto.result.TopProfileResultDTO; +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-08-18 + */ +@Mapper +public interface ScreenUserTotalDataDao { + + /** + * @Description 党员基本情况-饼状图概况 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.18 15:17 + **/ + PartymemberPercentResultDTO selectAgencyPartymemberPercent(@Param("agencyId")String agencyId); + + /** + * @Description 查询top区概况 + * @param agencyId + * @author zxc + * @date 2020/8/19 2:13 下午 + */ + TopProfileResultDTO selectTopProfile(@Param("agencyId")String agencyId); + + /** + * @Description 求出人均议题 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.20 14:54 + **/ + int selectAvgIssue(@Param("agencyId")String agencyId); + + /** + * @Description 查询用户数据 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.20 16:00 + **/ + List selectUserTotalData(@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/dao/topic/TopicDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/topic/TopicDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/topic/TopicDao.java index 2ab863ab78..4c0fb9d377 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/topic/TopicDao.java @@ -1,6 +1,5 @@ -package com.epmet.dao.topic; +package com.epmet.datareport.dao.topic; -import com.epmet.group.dto.result.GroupIncrTrendResultDTO; import com.epmet.topic.dto.result.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/UserAnalysisDao.java similarity index 99% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/UserAnalysisDao.java index 2df268feb2..c0a69f82fc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/user/UserAnalysisDao.java @@ -1,4 +1,4 @@ -package com.epmet.dao.user; +package com.epmet.datareport.dao.user; import com.epmet.dto.DimAgencyDTO; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/.gitignore similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/.gitignore rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/.gitignore diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/GroupService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/group/GroupService.java similarity index 96% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/GroupService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/group/GroupService.java index d644029bcf..66d57fc92c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/GroupService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/group/GroupService.java @@ -1,4 +1,4 @@ -package com.epmet.service.group; +package com.epmet.datareport.service.group; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.group.dto.form.GroupIncrTrendFormDTO; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/group/impl/GroupServiceImpl.java similarity index 96% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/group/impl/GroupServiceImpl.java index d1be53ee85..be4faf115d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/group/impl/GroupServiceImpl.java @@ -1,15 +1,15 @@ -package com.epmet.service.group.impl; +package com.epmet.datareport.service.group.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.dao.group.GroupDao; +import com.epmet.datareport.dao.group.GroupDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.group.constant.GroupConstant; import com.epmet.group.dto.form.GroupIncrTrendFormDTO; import com.epmet.group.dto.result.*; -import com.epmet.service.group.GroupService; +import com.epmet.datareport.service.group.GroupService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/IssueService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/issue/IssueService.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/IssueService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/issue/IssueService.java index c0d33b2a3b..d0b3b6156d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/IssueService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/issue/IssueService.java @@ -1,4 +1,4 @@ -package com.epmet.service.issue; +package com.epmet.datareport.service.issue; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/issue/impl/IssueServiceImpl.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/issue/impl/IssueServiceImpl.java index d44576202e..86953616b1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/issue/impl/IssueServiceImpl.java @@ -1,22 +1,20 @@ -package com.epmet.service.issue.impl; +package com.epmet.datareport.service.issue.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.dao.issue.IssueDao; +import com.epmet.datareport.dao.issue.IssueDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.issue.constant.IssueConstant; import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; import com.epmet.issue.dto.result.*; -import com.epmet.service.issue.IssueService; +import com.epmet.datareport.service.issue.IssueService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; -import java.math.RoundingMode; -import java.text.DecimalFormat; import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/ProjectService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java index 6e5366827f..41af9351ac 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/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,10 +1,10 @@ -package com.epmet.service.project.impl; +package com.epmet.datareport.service.project.impl; 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.DateUtils; -import com.epmet.dao.project.ProjectDao; +import com.epmet.datareport.dao.project.ProjectDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/publicity/PublicityService.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/publicity/PublicityService.java index bec823066c..35b6fff93b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/publicity/PublicityService.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.service.publicity; +package com.epmet.datareport.service.publicity; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.publicity.dto.result.*; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/publicity/impl/PublicityServiceImpl.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/publicity/impl/PublicityServiceImpl.java index b01f9339bc..9a8ceaca2f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/publicity/impl/PublicityServiceImpl.java @@ -15,16 +15,16 @@ * along with this program. If not, see . */ -package com.epmet.service.publicity.impl; +package com.epmet.datareport.service.publicity.impl; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.dao.publicity.PublicityDao; +import com.epmet.datareport.dao.publicity.PublicityDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.publicity.dto.result.*; -import com.epmet.service.publicity.PublicityService; +import com.epmet.datareport.service.publicity.PublicityService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/AgencyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/AgencyService.java new file mode 100644 index 0000000000..d3eee4f133 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/AgencyService.java @@ -0,0 +1,35 @@ +package com.epmet.datareport.service.screen; + +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.screen.dto.form.CompartmentFormDTO; +import com.epmet.screen.dto.result.CompartmentResultDTO; +import com.epmet.screen.dto.result.TreeResultDTO; + +import java.util.List; + +/** + * 组织相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:18 + */ +public interface AgencyService { + + /** + * @Description 1、组织机构树 + * @param + * @author zxc + * @date 2020/8/18 2:04 下午 + */ + TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam); + + /** + * @Description 2、组织区域查询 + * @param compartmentFormDTO + * @author zxc + * @date 2020/8/18 2:33 下午 + */ + CompartmentResultDTO compartment(CompartmentFormDTO compartmentFormDTO); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java new file mode 100644 index 0000000000..62a0d0d7bf --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/DistributionService.java @@ -0,0 +1,56 @@ +package com.epmet.datareport.service.screen; + +import com.epmet.screen.dto.form.*; +import com.epmet.screen.dto.result.*; + +import java.util.List; + +/** + * 中央区相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:19 + */ +public interface DistributionService { + + /** + * @Description 1、党支部 + * @param formDTO + * @author zxc + * @date 2020/8/18 10:59 上午 + */ + List branch(BranchFormDTO formDTO); + + /** + * @Description 2、用户分布 + * @param userFormDTO + * @author zxc + * @date 2020/8/18 11:10 上午 + */ + UserResultDTO user(UserFormDTO userFormDTO); + + /** + * @Description 3、党员分布 + * @param parymemberFormDTO + * @author zxc + * @date 2020/8/18 11:20 上午 + */ + ParymemberResultDTO parymember(ParymemberFormDTO parymemberFormDTO); + + /** + * @Description 4、事件 + * @param projectFormDTO + * @author zxc + * @date 2020/8/19 1:29 下午 + */ + List project(ProjectFormDTO projectFormDTO); + + /** + * @Description 5、top区概况 + * @param topProfileFormDTO + * @author zxc + * @date 2020/8/19 1:52 下午 + */ + TopProfileResultDTO topProfile(TopProfileFormDTO topProfileFormDTO); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassRootsGovernService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassRootsGovernService.java new file mode 100644 index 0000000000..12315295b5 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassRootsGovernService.java @@ -0,0 +1,77 @@ +package com.epmet.datareport.service.screen; + +import com.epmet.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.screen.dto.form.AgencyFormDTO; +import com.epmet.screen.dto.form.AgencyNumTypeParamFormDTO; +import com.epmet.screen.dto.result.*; + +import java.util.List; + +/** + * 基层治理相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:20 + */ +public interface GrassRootsGovernService { + + /** + * @Description 1、热心市民积分排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321544 + * @param param + * @return + * @author wangc + * @date 2020.08.20 11:16 + **/ + UserPointRankResultDTO userPointRank(AgencyAndNumFormDTO param); + + /** + * @Description 2、难点赌点-耗时最长|涉及部门最多|处理次数 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614 + * @param param + * @return + * @author wangc + * @date 2020.08.20 13:55 + **/ + List difficultProject(AgencyNumTypeParamFormDTO param); + + /** + * @Description 3、公众参与概况 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321975 + * @param param + * @return + * @author wangc + * @date 2020.08.20 14:37 + **/ + PublicPartiProfileResultDTO publicPartiProfile(AgencyFormDTO param); + + /** + * @Description 4、公众参与-排行榜 + * @NEI https://nei.netease.com/interface/detail/?pid=57068&id=321978 + * @param param + * @return + * @author wangc + * @date 2020.08.20 15:32 + **/ + List publicPartiRank(AgencyAndNumFormDTO param); + + /** + * @Description 5、治理能力榜单 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321627 + * @param param + * @return + * @author wangc + * @date 2020.08.20 17:46 + **/ + List governCapacityRank(AgencyAndNumFormDTO param); + + /** + * @Description 6、公众参与-柱状折线图 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=322434 + * @param param + * @return + * @author wangc + * @date 2020.08.21 09:58 + **/ + PublicPartiChartResultDTO publicPartiChart(AgencyFormDTO param); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassrootsPartyDevService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassrootsPartyDevService.java new file mode 100644 index 0000000000..a870d21585 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/GrassrootsPartyDevService.java @@ -0,0 +1,58 @@ +package com.epmet.datareport.service.screen; + +import com.epmet.screen.dto.form.BranchBuildRankFormDTO; +import com.epmet.screen.dto.form.BranchBuildTrendFormDTO; +import com.epmet.screen.dto.form.ParymemberFormDTO; +import com.epmet.screen.dto.result.BranchBuildRankResultDTO; +import com.epmet.screen.dto.result.BranchBuildTrendResultDTO; +import com.epmet.screen.dto.result.PartymemberAgeDistributionResultDTO; +import com.epmet.screen.dto.result.PartymemberPercentResultDTO; + +/** + * 基层党建相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:21 + */ +public interface GrassrootsPartyDevService { + + /** + * @Description 1、党员基本情况-饼状图概况 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321324 + * @param param + * @return + * @author wangc + * @date 2020.08.18 14:58 + **/ + PartymemberPercentResultDTO partymemberBaseInfo(ParymemberFormDTO param); + + /** + * @Description 2、党员基本情况-年龄分布 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321980 + * @param param + * @return + * @author wangc + * @date 2020.08.18 17:54 + **/ + PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param); + + /** + * @Description 3、支部建设情况|联建共建情况-折线图 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321981 + * @param param + * @return BranchBuildTrendResultDTO + * @author wangc + * @date 2020.08.19 11:02 + **/ + BranchBuildTrendResultDTO branchBuildTrend(BranchBuildTrendFormDTO param); + + /** + * @Description 4、支部建设情况|联建共建情况-排行 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321982 + * @param param + * @return + * @author wangc + * @date 2020.08.19 15:25 + **/ + BranchBuildRankResultDTO branchBuildRank(BranchBuildRankFormDTO param); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java new file mode 100644 index 0000000000..5c0b5e4ade --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java @@ -0,0 +1,55 @@ +package com.epmet.datareport.service.screen; + +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.screen.dto.form.MonthBarchartFormDTO; +import com.epmet.screen.dto.form.MonthPieChartFormDTO; +import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.screen.dto.result.MonthBarchartResultDTO; +import com.epmet.screen.dto.result.MonthPieChartResultDTO; +import com.epmet.screen.dto.result.SubAgencyIndexRankResultDTO; +import com.epmet.screen.dto.result.YearAverageIndexResultDTO; + +import java.util.List; + +/** + * 指数相关相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:21 + */ +public interface IndexService { + + /** + * @Description 1、年度平均指数 + * @param yearAverageIndexFormDTO + * @author zxc + * @date 2020/8/19 2:53 下午 + */ + YearAverageIndexResultDTO yearAverageIndex(YearAverageIndexFormDTO yearAverageIndexFormDTO); + + /** + * @Description 2、月度指数分析-饼状图 + * @param monthPieChartFormDTO + * @author zxc + * @date 2020/8/19 3:17 下午 + */ + MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO); + + /** + * @Description 3、月度指数分析-柱状图 + * @param monthBarchartFormDTO + * @author zxc + * @date 2020/8/19 5:27 下午 + */ + MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO, ExternalAppRequestParam externalAppRequestParam); + + /** + * @Description 4、下级部门指数排行 + * @param subAgencyIndexRankFormDTO + * @author zxc + * @date 2020/8/20 10:04 上午 + */ + List subAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java new file mode 100644 index 0000000000..5f781b2622 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/PartyMemberLeadService.java @@ -0,0 +1,63 @@ +package com.epmet.datareport.service.screen; + +import com.epmet.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.screen.dto.form.ContactMassLineChartFormDTO; +import com.epmet.screen.dto.form.FineExampleFormDTO; +import com.epmet.screen.dto.form.VolunteerServiceFormDTO; +import com.epmet.screen.dto.result.*; + +import java.util.List; + +/** + * 党建引领相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:22 + */ +public interface PartyMemberLeadService { + + /** + * @Description 1、先锋模范 + * @param fineExampleFormDTO + * @author zxc + * @date 2020/8/20 1:56 下午 + */ + FineExampleResultDTO fineExample(FineExampleFormDTO fineExampleFormDTO); + + /** + * @Description 2、党员联系群众 + * @param contactMassLineChartFormDTO + * @author zxc + * @date 2020/8/20 2:35 下午 + */ + ContactMassLineChartResultDTO contactMassLineChart(ContactMassLineChartFormDTO contactMassLineChartFormDTO); + + /** + * @Description 3、党员志愿服务 + * @param volunteerServiceFormDTO + * @author zxc + * @date 2020/8/20 3:19 下午 + */ + VolunteerServiceResultDTO volunteerService(VolunteerServiceFormDTO volunteerServiceFormDTO); + + /** + * @Description 4、先进排行榜单-先进支部排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321539 + * @param param + * @return + * @author wangc + * @date 2020.08.21 11:05 + **/ + List advancedBranchRank(AgencyAndNumFormDTO param); + + /** + * @Description 5、先进排行榜单-先进党员排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321624 + * @param param + * @return List + * @author wangc + * @date 2020.08.21 14:22 + **/ + List advancedPartymemberRank(AgencyAndNumFormDTO param); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/ScreenProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/ScreenProjectService.java new file mode 100644 index 0000000000..78543bc52f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/ScreenProjectService.java @@ -0,0 +1,22 @@ +package com.epmet.datareport.service.screen; + +import com.epmet.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.screen.dto.result.ProjectDetailResultDTO; + +/** + * 项目 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:22 + */ +public interface ScreenProjectService { + + /** + * @Description 3、项目详情 + * @param projectDetailFormDTO + * @author zxc + * @date 2020/8/19 4:36 下午 + */ + ProjectDetailResultDTO projectDetail(ProjectDetailFormDTO projectDetailFormDTO); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java new file mode 100644 index 0000000000..9ca543828c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/AgencyServiceImpl.java @@ -0,0 +1,94 @@ +package com.epmet.datareport.service.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.screen.ScreenCustomerAgencyDao; +import com.epmet.datareport.dao.screen.ScreenCustomerGridDao; +import com.epmet.screen.dto.form.CompartmentFormDTO; +import com.epmet.screen.dto.result.AgencyDistributionResultDTO; +import com.epmet.screen.constant.*; +import com.epmet.screen.dto.result.CompartmentResultDTO; +import com.epmet.screen.dto.result.TreeResultDTO; +import com.epmet.datareport.service.screen.AgencyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 组织相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:18 + */ +@Service +public class AgencyServiceImpl implements AgencyService { + + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + + /** + * @Description 1、组织机构树 + * @param + * @author zxc + * @date 2020/8/18 2:04 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) { + // 1. 查询客户根组织ID + String customerId = externalAppRequestParam.getCustomerId(); + TreeResultDTO rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId); + if (null == rootAgency){ + return new TreeResultDTO(); + } + List departmentList = this.getDepartmentList(("".equals(rootAgency.getPids()) ? "" : rootAgency.getPids() + ",") + rootAgency.getValue()); + rootAgency.setChildren(departmentList); + return rootAgency; + } + + /** + * @Description 递归查询填充下级 + * @param subAgencyPids + * @author zxc + * @date 2020/8/18 4:42 下午 + */ + private List getDepartmentList(String subAgencyPids) { + List subAgencyList = screenCustomerAgencyDao.selectSubAgencyList(subAgencyPids); + if (subAgencyList.size() > NumConstant.ZERO) { + for (TreeResultDTO sub : subAgencyList) { + List subAgency = getDepartmentList(sub.getPids() + "," + sub.getValue()); + sub.setChildren(subAgency); + } + } + return subAgencyList; + } + + /** + * @Description 2、组织区域查询 + * @param compartmentFormDTO + * @author zxc + * @date 2020/8/18 2:33 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public CompartmentResultDTO compartment(CompartmentFormDTO compartmentFormDTO) { + CompartmentResultDTO agencyAreaInfo = screenCustomerAgencyDao.getAgencyAreaInfo(compartmentFormDTO.getAgencyId()); + if (null == agencyAreaInfo){ + return new CompartmentResultDTO(); + } + if (agencyAreaInfo.getLevel().equals(ScreenConstant.COMMUNITY)){ + // 当level为"community"时,查询screen_customer_grid表 + List agencyDistributionResultDTOS = screenCustomerGridDao.selectSubDistribution(compartmentFormDTO.getAgencyId()); + agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS); + }else { + List agencyDistributionResultDTOS = screenCustomerAgencyDao.selectSubDistribution(compartmentFormDTO.getAgencyId()); + agencyAreaInfo.setAgencyDistribution(agencyDistributionResultDTOS); + } + return agencyAreaInfo; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java new file mode 100644 index 0000000000..97a627fb23 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/DistributionServiceImpl.java @@ -0,0 +1,133 @@ +package com.epmet.datareport.service.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.screen.ScreenCustomerAgencyDao; +import com.epmet.datareport.dao.screen.ScreenCustomerGridDao; +import com.epmet.datareport.dao.screen.ScreenEventDataDao; +import com.epmet.datareport.dao.screen.ScreenUserTotalDataDao; +import com.epmet.screen.dto.form.*; +import com.epmet.screen.dto.result.*; +import com.epmet.screen.constant.*; +import com.epmet.datareport.service.screen.DistributionService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 中央区相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:19 + */ +@Service +public class DistributionServiceImpl implements DistributionService { + + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + @Autowired + private ScreenEventDataDao screenEventDataDao; + @Autowired + private ScreenUserTotalDataDao screenUserTotalDataDao; + + /** + * @Description 1、党支部 + * @param formDTO + * @author zxc + * @date 2020/8/18 10:59 上午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public List branch(BranchFormDTO formDTO) { + List branchResultDTOS = screenCustomerGridDao.selectBranch(formDTO.getAgencyId()); + return branchResultDTOS; + } + + /** + * @Description 2、用户分布 + * @param userFormDTO + * @author zxc + * @date 2020/8/18 11:10 上午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public UserResultDTO user(UserFormDTO userFormDTO) { + UserResultDTO userResult = new UserResultDTO(); + CompartmentResultDTO agencyAreaInfo = screenCustomerAgencyDao.getAgencyAreaInfo(userFormDTO.getAgencyId()); + if (null == agencyAreaInfo){ + return userResult; + } + BeanUtils.copyProperties(agencyAreaInfo,userResult); + if (userResult.getLevel().equals(ScreenConstant.COMMUNITY)){ + List userDistributionResultDTOS = screenCustomerGridDao.selectUserDistribution(userFormDTO.getAgencyId()); + userResult.setUserDistribution(userDistributionResultDTOS); + }else { + List userDistributionResultDTOS = screenCustomerAgencyDao.selectUserDistributionAgency(userFormDTO.getAgencyId()); + userResult.setUserDistribution(userDistributionResultDTOS); + } + return userResult; + } + + /** + * @Description 3、党员分布 + * @param parymemberFormDTO + * @author zxc + * @date 2020/8/18 11:20 上午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public ParymemberResultDTO parymember(ParymemberFormDTO parymemberFormDTO) { + ParymemberResultDTO parymemberResult = new ParymemberResultDTO(); + CompartmentResultDTO agencyAreaInfo = screenCustomerAgencyDao.getAgencyAreaInfo(parymemberFormDTO.getAgencyId()); + if (null == agencyAreaInfo){ + return parymemberResult; + } + BeanUtils.copyProperties(agencyAreaInfo,parymemberResult); + if (parymemberResult.getLevel().equals(ScreenConstant.COMMUNITY)){ + List parymemberDistributionResultDTOS = screenCustomerGridDao.selectParymemberDistribution(parymemberFormDTO.getAgencyId()); + parymemberResult.setUserDistribution(parymemberDistributionResultDTOS); + }else { + List parymemberDistributionResultDTOS = screenCustomerAgencyDao.selectParymemberDistribution(parymemberFormDTO.getAgencyId()); + parymemberResult.setUserDistribution(parymemberDistributionResultDTOS); + } + return parymemberResult; + } + + /** + * @Description 4、事件 + * @param projectFormDTO + * @author zxc + * @date 2020/8/19 1:29 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public List project(ProjectFormDTO projectFormDTO) { + List projectResultDTOS = screenEventDataDao.selectEvent(projectFormDTO.getAgencyId()); + if (projectResultDTOS.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return projectResultDTOS; + } + + /** + * @Description 5、top区概况 + * @param topProfileFormDTO + * @author zxc + * @date 2020/8/19 1:52 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public TopProfileResultDTO topProfile(TopProfileFormDTO topProfileFormDTO) { + TopProfileResultDTO topProfileResultDTO = screenUserTotalDataDao.selectTopProfile(topProfileFormDTO.getAgencyId()); + if (null == topProfileResultDTO){ + return new TopProfileResultDTO(); + } + return topProfileResultDTO; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java new file mode 100644 index 0000000000..8b0db2c65a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassRootsGovernServiceImpl.java @@ -0,0 +1,229 @@ +package com.epmet.datareport.service.screen.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.datareport.dao.screen.*; +import com.epmet.datareport.service.screen.GrassRootsGovernService; +import com.epmet.datareport.utils.DateUtils; +import com.epmet.datareport.utils.ModuleConstant; +import com.epmet.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.screen.dto.form.AgencyFormDTO; +import com.epmet.screen.dto.form.AgencyNumTypeParamFormDTO; +import com.epmet.screen.dto.result.*; +import com.github.pagehelper.PageHelper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 基层治理相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:20 + */ +@Service +public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { + + @Autowired + private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + @Autowired + private ScreenDifficultyDataDao screenDifficultyDataDao; + @Autowired + private ScreenUserJoinDao screenUserJoinDao; + @Autowired + private DateUtils dateUtils; + @Autowired + private ScreenUserTotalDataDao screenUserTotalDataDao; + @Autowired + private ScreenGovernRankDataDao screenGovernRankDataDao; + /** + * @Description 1、热心市民积分排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321544 + * @param param + * @return + * @author wangc + * @date 2020.08.20 11:16 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public UserPointRankResultDTO userPointRank(AgencyAndNumFormDTO param) { + //默认5 + if(null == param.getTopNum()){ + param.setTopNum(NumConstant.FIVE); + } + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + List 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())); + return result; + } + + + /** + * @Description 2、难点赌点-耗时最长|涉及部门最多|处理次数 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614 + * @param param + * @return + * @author wangc + * @date 2020.08.20 13:55 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public List difficultProject(AgencyNumTypeParamFormDTO param) { + if(null == param.getTopNum()){ + param.setTopNum(NumConstant.TWO); + } + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + List result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType()); + if(null == result) return new ArrayList<>(); + return result; + } + + + /** + * @Description 3、公众参与概况 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321975 + * @param param + * @return + * @author wangc + * @date 2020.08.20 14:37 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public PublicPartiProfileResultDTO publicPartiProfile(AgencyFormDTO param) { + + String monthId = dateUtils.getPreviousMonthId(); + UserJoinIndicatorGrowthRateResultDTO latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId); + if(null == latest) return new PublicPartiProfileResultDTO(); + PublicPartiProfileResultDTO result = ConvertUtils.sourceToTarget(latest,PublicPartiProfileResultDTO.class); + result.setMonthIncr(convertPercentStr(latest.getMonthIncr(),NumConstant.ZERO)); + result.setJoinCompareLatestMonth(convertPercentStr(latest.getJoinCompareLatestMonth(),NumConstant.ZERO)); + result.setIssueCompareLatestMonth(convertPercentStr(latest.getIssueCompareLatestMonth(),NumConstant.ZERO)); + return result; + } + + /** + * @Description 4、公众参与-排行榜 + * @NEI https://nei.netease.com/interface/detail/?pid=57068&id=321978 + * @param param + * @return + * @author wangc + * @date 2020.08.20 15:32 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public List publicPartiRank(AgencyAndNumFormDTO param) { + if(null == param.getTopNum()) param.setTopNum(NumConstant.TWO); + if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + List result = screenUserTotalDataDao.selectUserTotalData(param.getAgencyId()); + if(null == result) return new ArrayList<>(); + return result; + } + + /** + * @Description 5、治理能力榜单 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321627 + * @param param + * @return + * @author wangc + * @date 2020.08.20 17:46 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public List governCapacityRank(AgencyAndNumFormDTO param) { + if(null == param.getTopNum()) param.setTopNum(NumConstant.FIVE); + if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + List orderList = + screenGovernRankDataDao.selectGovernCapacityRatio(dateUtils.getPreviousMonthId(),param.getAgencyId()); + if(null == orderList || orderList.isEmpty()) return new ArrayList<>(); + List result = new LinkedList<>(); + orderList.forEach(o -> { + GovernCapacityRankResultDTO rank = new GovernCapacityRankResultDTO(); + rank.setAgencyName(o.getAgencyName()); + rank.setGovernRatio(convertPercentStr(o.getGovernRatio(),NumConstant.ONE)); + rank.setResolvedRatio(convertPercentStr(o.getResolvedRatio(),NumConstant.ONE)); + rank.setResponseRatio(convertPercentStr(o.getResponseRatio(),NumConstant.ONE)); + rank.setSatisfactionRatio(convertPercentStr(o.getSatisfactionRatio(),NumConstant.ONE)); + result.add(rank); + }); + return result; + } + + /** + * @Description 6、公众参与-柱状折线图 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=322434 + * @param param + * @return + * @author wangc + * @date 2020.08.21 09:58 + **/ + @Override + public PublicPartiChartResultDTO publicPartiChart(AgencyFormDTO param) { + 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())); + List defaultData = new LinkedList<>(); + for(int i = NumConstant.ZERO ; i < NumConstant.TWELVE ; i++){ + defaultData.add(NumConstant.ZERO); + } + if(null == monthlyData || monthlyData.isEmpty()){ + result.setAverageJoinNumList(defaultData); + result.setJoinUserNumList(defaultData); + result.setOrganizeNumList(defaultData); + return result; + } + result.setOrganizeNumList(new ArrayList<>()); + result.setJoinUserNumList(new ArrayList<>()); + result.setAverageJoinNumList(new ArrayList<>()); + Map> dataMap = monthlyData.stream().collect(Collectors.groupingBy(UserJoinMonthlyResultDTO :: getMonthId)); + Xaxis.keySet().stream().forEach(monthId -> { + List data = dataMap.get(monthId); + if(null == data || data.isEmpty()){ + result.getOrganizeNumList().add(NumConstant.ZERO); + result.getJoinUserNumList().add(NumConstant.ZERO); + result.getAverageJoinNumList().add(NumConstant.ZERO); + }else{ + Integer o = NumConstant.ZERO; + Integer j = NumConstant.ZERO; + Integer a = NumConstant.ZERO; + 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(); + } + result.getOrganizeNumList().add(o); + result.getJoinUserNumList().add(j); + result.getAverageJoinNumList().add(a); + } + }); + + return result; + } + + private String convertPercentStr(BigDecimal percent){ + if(null == percent || BigDecimal.ZERO == percent) return "0.00%"; + String percentStr = percent.setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); + return percentStr.concat(ModuleConstant.SYMBOL_PERCENT); + } + + private String convertPercentStr(BigDecimal percent,Integer digits){ + if(null == percent) percent = BigDecimal.ZERO; + String percentStr = percent.setScale(digits, 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/screen/impl/GrassrootsPartyDevServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java new file mode 100644 index 0000000000..51a7a49ff6 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/GrassrootsPartyDevServiceImpl.java @@ -0,0 +1,261 @@ +package com.epmet.datareport.service.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.screen.ScreenCpcBaseDataDao; +import com.epmet.datareport.dao.screen.ScreenPartyBranchDataDao; +import com.epmet.datareport.dao.screen.ScreenUserTotalDataDao; +import com.epmet.datareport.utils.ModuleConstant; +import com.epmet.screen.dto.form.BranchBuildRankFormDTO; +import com.epmet.screen.dto.form.BranchBuildTrendFormDTO; +import com.epmet.screen.dto.form.ParymemberFormDTO; +import com.epmet.screen.dto.result.*; +import com.epmet.datareport.service.screen.GrassrootsPartyDevService; +import com.github.pagehelper.PageHelper; +import com.google.common.collect.Maps; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 基层党建相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:21 + */ +@Service +public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService { + + private static final Logger logger = LoggerFactory.getLogger(GrassrootsPartyDevServiceImpl.class); + + @Autowired + private ScreenUserTotalDataDao screenUserTotalDataDao; + @Autowired + private ScreenCpcBaseDataDao screenCpcBaseDataDao; + @Autowired + private ScreenPartyBranchDataDao screenPartyBranchDataDao; + private List issueGroup; + + /** + * @Description 1、党员基本情况-饼状图概况 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321324 + * @param param + * @return + * @author wangc + * @date 2020.08.18 14:58 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public PartymemberPercentResultDTO partymemberBaseInfo(ParymemberFormDTO param) { + + PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercent(param.getAgencyId()); + if(null == result){ + logger.warn("com.epmet.datareport.service.screen.impl.GrassrootsPartyDevServiceImpl.partymemberBaseInfo:未查询出指定agencyId下的党员基础信息数据,agencyId :: {}",param.getAgencyId()); + result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); + return result; + } + //partymember / platform + if(null == result.getPlatFormTotal() || NumConstant.ZERO == result.getPlatFormTotal()){ + result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO)); + }else{ + result.setPercentInPlatForm(convertPercentStr(new BigDecimal((result.getPartyMemberTotal().doubleValue()/result.getPlatFormTotal().doubleValue())))); + } + return result; + } + + /** + * @Description 2、党员基本情况-年龄分布 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321980 + * @param param + * @return + * @author wangc + * @date 2020.08.18 17:54 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param) { + return screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId()); + } + + /** + * @Description 3、支部建设情况|联建共建情况-折线图 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321981 + * @param param + * @return BranchBuildTrendResultDTO + * @author wangc + * @date 2020.08.19 11:02 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public BranchBuildTrendResultDTO branchBuildTrend(BranchBuildTrendFormDTO param) { + if(StringUtils.equals(ModuleConstant.PARAM_BRANCH_CATEGORY_UNION,param.getCategory())){ + //联建共建情况 + param.setCategory(ModuleConstant.KEY_BRANCH_CATEGORY_UNION); + }else if(StringUtils.equals(ModuleConstant.PARAM_BRANCH_CATEGORY_VOLUNTARY_SERVICE,param.getCategory())){ + //联建党员志愿服务情况 + param.setCategory(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE); + }else{ + //默认支部建设 + param.setCategory(ModuleConstant.KEY_BRANCH_CATEGORY_PARTY); + } + BranchBuildTrendResultDTO result = new BranchBuildTrendResultDTO(); + //生成近十二个月的横坐标数组 + Map monthMap = getX(); + result.setXAxis(monthMap.values().stream().collect(Collectors.toList())); + + List dataArray = new LinkedList<>(); + List yearlyDataList = + screenPartyBranchDataDao.selectBranchDataByTypeAndTimeZone(param.getAgencyId(),param.getType(),param.getCategory(),monthMap.keySet().iterator().next()); + + + if(null != yearlyDataList && !yearlyDataList.isEmpty()){ + + Map> dataMapByIssue = + yearlyDataList.stream().collect(Collectors.groupingBy(BranchIssueDataResultDTO::getIssue)); + + + result.setLegend(new LinkedList<>(dataMapByIssue.keySet())); + + dataMapByIssue.forEach((issue,val) ->{ + List issueYearlyDataList = val; + List numArray = new LinkedList<>(); + BranchTrendSeriesDataResultDTO data = new BranchTrendSeriesDataResultDTO(); + data.setName(issue); + if(null != issueYearlyDataList && !issueYearlyDataList.isEmpty()){ + monthMap.keySet().forEach( monthId ->{ + Optional optional + = issueYearlyDataList.stream().filter(yearly -> StringUtils.equals(monthId,yearly.getMonthId())).findAny(); + if(optional.isPresent()){ + numArray.add(optional.get().getData()); + }else{ + numArray.add(NumConstant.ZERO); + } + }); + }else{ + for(int i = NumConstant.ZERO ; i < NumConstant.TWELVE ; i++){ + numArray.add(NumConstant.ZERO); + } + } + data.setData(numArray); + dataArray.add(data); + }); + } + + result.setSeriesData(dataArray); + result.setLegend(null == result.getLegend() ? new ArrayList<>() : result.getLegend()); + + return result; + } + + /** + * @Description 4、支部建设情况|联建共建情况-排行 + * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321982 + * @param param + * @return BranchBuildRankResultDTO + * @author wangc + * @date 2020.08.19 15:25 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public BranchBuildRankResultDTO branchBuildRank(BranchBuildRankFormDTO param) { + if(StringUtils.equals(ModuleConstant.PARAM_BRANCH_CATEGORY_UNION,param.getCategory())){ + //联建共建情况 + param.setCategory(ModuleConstant.KEY_BRANCH_CATEGORY_UNION); + }else if(StringUtils.equals(ModuleConstant.PARAM_BRANCH_CATEGORY_VOLUNTARY_SERVICE,param.getCategory())){ + //联建党员志愿服务情况 + param.setCategory(ModuleConstant.KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE); + }else{ + //默认支部建设 + param.setCategory(ModuleConstant.KEY_BRANCH_CATEGORY_PARTY); + } + if(StringUtils.isBlank(param.getMonthId())){ + param.setMonthId(getPreviousMonthId()); + } + if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX); + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + List orderList = + screenPartyBranchDataDao.selectBranchDataByTypeOrder(param.getAgencyId(),param.getCategory(),param.getMonthId(),param.getBottomMonthId()); + + BranchBuildRankResultDTO result = new BranchBuildRankResultDTO(); + result.setJoinData(new LinkedList<>()); + result.setOrganizeData(new LinkedList<>()); + result.setXAxis(new LinkedList<>()); + for(BranchBuildOrderByCountResultDTO data : orderList){ + result.getXAxis().add(data.getOrgName()); + result.getOrganizeData().add(data.getOrganizeData()); + result.getJoinData().add(data.getJoinData()); + } + return result; + } + + + private String convertPercentStr(BigDecimal percent){ + if(null == percent || BigDecimal.ZERO == percent) return "0.00%"; + String percentStr = percent.setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString(); + return percentStr.concat(ModuleConstant.SYMBOL_PERCENT); + } + + /** + * @Description 返回当前月以及前十一个月,升序 + * @param + * @return Map key:202001 value:1月 + * @author wangc + * @date 2020.08.19 12:46 + **/ + public Map getX(){ + SimpleDateFormat format = new SimpleDateFormat("yyyyMM"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); // 设置为当前时间 + calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月 + String currentMonth = format.format(calendar.getTime()); + Integer monthCounter = Integer.parseInt(currentMonth); + Map monthMap = new HashMap<>(); + int i = NumConstant.ONE; + while(i <= NumConstant.TWELVE){ + + if(monthCounter.toString().endsWith("00")){ + monthCounter -= NumConstant.EIGHTY_EIGHT; + } + + String abscissa = monthCounter.toString().substring(monthCounter.toString().length() - NumConstant.TWO); + if(abscissa.startsWith("0")) { + abscissa = abscissa.replace("0","").concat("月"); + }else{ + abscissa = abscissa.concat("月"); + } + monthMap.put(monthCounter.toString(),abscissa); + monthCounter-- ; + i++; + } + + Map result = Maps.newLinkedHashMap(); + monthMap.entrySet().stream().sorted(Map.Entry.comparingByKey()) + .forEachOrdered((e -> result.put(e.getKey(),e.getValue()))); + + return result; + } + + + /** + * @Description 得到上个月的monthId + * @param + * @return + * @author wangc + * @date 2020.08.20 10:19 + **/ + private String getPreviousMonthId(){ + SimpleDateFormat format = new SimpleDateFormat("yyyyMM"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); // 设置为当前时间 + calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月 + return format.format(calendar.getTime()); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java new file mode 100644 index 0000000000..e106a07d45 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java @@ -0,0 +1,136 @@ +package com.epmet.datareport.service.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.screen.ScreenIndexDataMonthlyDao; +import com.epmet.datareport.dao.screen.ScreenIndexDataYearlyDao; +import com.epmet.datareport.service.screen.IndexService; +import com.epmet.screen.dto.form.MonthBarchartFormDTO; +import com.epmet.screen.dto.form.MonthPieChartFormDTO; +import com.epmet.screen.dto.form.SubAgencyIndexRankFormDTO; +import com.epmet.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.screen.dto.result.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 指数相关相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:21 + */ +@Service +public class IndexServiceImpl implements IndexService { + + @Autowired + private ScreenIndexDataYearlyDao screenIndexDataYearlyDao; + @Autowired + private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; + @Autowired + private PartyMemberLeadServiceImpl partyMemberLeadServiceImpl; + + /** + * @Description 1、年度平均指数 + * @param yearAverageIndexFormDTO + * @author zxc + * @date 2020/8/19 2:53 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public YearAverageIndexResultDTO yearAverageIndex(YearAverageIndexFormDTO yearAverageIndexFormDTO) { + YearAverageIndexResultDTO yearAverageIndexResultDTO = screenIndexDataYearlyDao.selectYearAverageIndex(yearAverageIndexFormDTO.getAgencyId()); + if (null == yearAverageIndexResultDTO){ + return new YearAverageIndexResultDTO(); + } + return yearAverageIndexResultDTO; + } + + /** + * @Description 2、月度指数分析-饼状图 + * @param monthPieChartFormDTO + * @author zxc + * @date 2020/8/19 3:17 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO) { + MonthPieChartResultDTO monthPieChartResultDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId()); + if (null == monthPieChartResultDTO){ + return new MonthPieChartResultDTO(); + } + return monthPieChartResultDTO; + } + + /** + * @Description 3、月度指数分析-柱状图 + * @param monthBarchartFormDTO + * @author zxc + * @date 2020/8/19 5:27 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public MonthBarchartResultDTO monthBarchart(MonthBarchartFormDTO monthBarchartFormDTO, ExternalAppRequestParam externalAppRequestParam) { + String customerId = externalAppRequestParam.getCustomerId(); + MonthBarchartResultDTO result = new MonthBarchartResultDTO(); + List serviceAbilityData = new ArrayList<>(); + List partyDevAbilityData = new ArrayList<>(); + List governAbilityData = new ArrayList<>(); + List totalIndexData = new ArrayList<>(); + // 1. x轴 + result.setXAxis(partyMemberLeadServiceImpl.getXPro()); + // 2. 查询近一年的指数值【不包括本月】 + List monthBarchartResults = screenIndexDataMonthlyDao.selectMonthBarchart(customerId, monthBarchartFormDTO.getAgencyId()); + if (monthBarchartResults.size() == NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) { + serviceAbilityData.add(NumConstant.ZERO_DOT_ZERO); + partyDevAbilityData.add(NumConstant.ZERO_DOT_ZERO); + governAbilityData.add(NumConstant.ZERO_DOT_ZERO); + totalIndexData.add(NumConstant.ZERO_DOT_ZERO); + } + result.setServiceAbilityData(serviceAbilityData); + result.setPartyDevAbilityData(partyDevAbilityData); + result.setGovernAbilityData(governAbilityData); + result.setTotalIndexData(totalIndexData); + return result; + } + List collect = monthBarchartResults.stream().sorted(Comparator.comparing(MonthBarchartResult::getMonthId)).collect(Collectors.toList()); + collect.forEach(month -> { + serviceAbilityData.add(null == month.getServiceAbility() ? NumConstant.ZERO_DOT_ZERO : month.getServiceAbility()); + partyDevAbilityData.add(null == month.getPartyDevAbility() ? NumConstant.ZERO_DOT_ZERO : month.getPartyDevAbility()); + governAbilityData.add(null == month.getGovernAbility() ? NumConstant.ZERO_DOT_ZERO : month.getGovernAbility()); + totalIndexData.add(null == month.getIndexTotal() ? NumConstant.ZERO_DOT_ZERO : month.getIndexTotal()); + }); + result.setServiceAbilityData(serviceAbilityData); + result.setPartyDevAbilityData(partyDevAbilityData); + result.setGovernAbilityData(governAbilityData); + result.setTotalIndexData(totalIndexData); + return result; + } + + /** + * @Description 4、下级部门指数排行 + * @param subAgencyIndexRankFormDTO + * @author zxc + * @date 2020/8/20 10:04 上午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public List subAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO) { + LocalDate now = LocalDate.now().minusMonths(NumConstant.ONE); + int yearId = now.getYear(); + subAgencyIndexRankFormDTO.setYearId(String.valueOf(yearId)); + List subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyIndexRank(subAgencyIndexRankFormDTO); + if (subAgencyIndexRankResultDTOS.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return subAgencyIndexRankResultDTOS; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java new file mode 100644 index 0000000000..b1cecb92bb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/PartyMemberLeadServiceImpl.java @@ -0,0 +1,224 @@ +package com.epmet.datareport.service.screen.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.datareport.dao.screen.ScreenOrgRankDataDao; +import com.epmet.datareport.dao.screen.ScreenPartyBranchDataDao; +import com.epmet.datareport.dao.screen.ScreenPartyLinkMassesDataDao; +import com.epmet.datareport.dao.screen.ScreenPioneerDataDao; +import com.epmet.datareport.dao.screen.ScreenPartyUserRankDataDao; +import com.epmet.datareport.service.screen.PartyMemberLeadService; +import com.epmet.datareport.utils.DateUtils; +import com.epmet.datareport.utils.ModuleConstant; +import com.epmet.screen.dto.form.AgencyAndNumFormDTO; +import com.epmet.screen.dto.form.ContactMassLineChartFormDTO; +import com.epmet.screen.dto.form.FineExampleFormDTO; +import com.epmet.screen.dto.form.VolunteerServiceFormDTO; +import com.epmet.screen.dto.result.*; +import com.epmet.screen.constant.*; +import com.github.pagehelper.PageHelper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.time.LocalDate; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 党建引领相关各指标查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:22 + */ +@Service +public class PartyMemberLeadServiceImpl implements PartyMemberLeadService { + + @Autowired + private ScreenPartyLinkMassesDataDao screenPartyLinkMassesDataDao; + @Autowired + private ScreenPartyBranchDataDao screenPartyBranchDataDao; + @Autowired + private ScreenPioneerDataDao screenPioneerDataDao; + @Autowired + private ScreenOrgRankDataDao screenOrgRankDataDao; + @Autowired + private DateUtils dateUtils; + @Autowired + private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + + /** + * @Description 1、先锋模范 + * @param fineExampleFormDTO + * @author zxc + * @date 2020/8/20 1:56 下午 + */ + @DataSource(value = DataSourceConstant.STATS,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; + } + + /** + * @Description 小数转换百分比 + * @param d + * @author zxc + * @date 2020/8/20 6:06 下午 + */ + public String getRatio(Double d){ + BigDecimal bigDecimal = new BigDecimal(d * NumConstant.ONE_HUNDRED); + return bigDecimal.setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).toPlainString().concat(ScreenConstant.RATIO); + } + + /** + * @Description 2、党员联系群众 + * @param contactMassLineChartFormDTO + * @author zxc + * @date 2020/8/20 2:35 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public ContactMassLineChartResultDTO contactMassLineChart(ContactMassLineChartFormDTO contactMassLineChartFormDTO) { + ContactMassLineChartResultDTO result = new ContactMassLineChartResultDTO(); + List contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChart(contactMassLineChartFormDTO.getAgencyId()); + if (contactMassLineChartResults.size() == NumConstant.ZERO){ + result.setXAxis(new ArrayList<>()); + result.setGroupMemberData(new ArrayList<>()); + result.setGroupData(new ArrayList<>()); + return result; + } + List xAxis = new ArrayList<>(); + List groupData = new ArrayList<>(); + List groupMemberData = new ArrayList<>(); + contactMassLineChartResults.forEach(contact -> { + xAxis.add(contact.getOrgName()); + groupData.add(contact.getGroupTotal()); + groupMemberData.add(contact.getUserTotal()); + }); + result.setXAxis(xAxis); + result.setGroupData(groupData); + result.setGroupMemberData(groupMemberData); + return result; + } + + /** + * @Description 3、党员志愿服务 + * @param volunteerServiceFormDTO + * @author zxc + * @date 2020/8/20 3:19 下午 + */ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public VolunteerServiceResultDTO volunteerService(VolunteerServiceFormDTO volunteerServiceFormDTO) { + VolunteerServiceResultDTO result = new VolunteerServiceResultDTO(); + List organizeData = new ArrayList<>(); + List joinData = new ArrayList<>(); + List averageJoinUserData = new ArrayList<>(); + result.setXAxis(this.getXPro()); + List volunteerServiceResults = screenPartyBranchDataDao.selectVolunteerServiceResult(volunteerServiceFormDTO.getAgencyId()); + if (volunteerServiceResults.size() == NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i <= NumConstant.TWELVE; i++) { + organizeData.add(NumConstant.ZERO); + joinData.add(NumConstant.ZERO); + averageJoinUserData.add(NumConstant.ZERO); + } + result.setOrganizeData(organizeData); + result.setJoinData(joinData); + result.setAverageJoinUserData(averageJoinUserData); + return result; + } + List collect = volunteerServiceResults.stream().sorted(Comparator.comparing(VolunteerServiceResult::getMonthId)).collect(Collectors.toList()); + collect.forEach(volunteer -> { + organizeData.add(volunteer.getOrganizeData()); + joinData.add(volunteer.getJoinData()); + averageJoinUserData.add(volunteer.getAverageJoinUserData()); + }); + result.setOrganizeData(organizeData); + result.setJoinData(joinData); + result.setAverageJoinUserData(averageJoinUserData); + return result; + } + + /** + * @Description 获取之前的12个月份【不包括当前月】 + * @author zxc + * @date 2020/8/21 10:19 上午 + */ + public List getXPro(){ + List xAxis = new ArrayList<>(); + LocalDate today = LocalDate.now(); + for(int i = NumConstant.TWELVE;i >= NumConstant.ONE; i--){ + LocalDate localDate = today.minusMonths(i); + String s = localDate.getMonth().getValue() + ScreenConstant.MONTH; + xAxis.add(s); + } + return xAxis; + } + + /** + * @Description 4、先进排行榜单-先进支部排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321539 + * @param param + * @return + * @author wangc + * @date 2020.08.21 11:05 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + public List advancedBranchRank(AgencyAndNumFormDTO param) { + if(null == param.getTopNum()){ + param.setTopNum(NumConstant.FIVE); + }else if(NumConstant.ZERO == param.getTopNum()){ + param.setTopNum(NumConstant.MAX); + } + PageHelper.startPage(NumConstant.ONE,param.getTopNum()); + List gridData = + screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),dateUtils.getPreviousMonthId()); + 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; + } + + /** + * @Description 5、先进排行榜单-先进党员排行 + * @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321624 + * @param param + * @return List + * @author wangc + * @date 2020.08.21 14:22 + **/ + @DataSource(value = DataSourceConstant.STATS,datasourceNameFromArg = true) + @Override + 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()); + if(null == result) return new ArrayList<>(); + return result; + } + + + private String convertPercentStr(BigDecimal percent){ + if(null == percent || BigDecimal.ZERO == 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/screen/impl/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/ScreenProjectServiceImpl.java new file mode 100644 index 0000000000..dce609636d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/ScreenProjectServiceImpl.java @@ -0,0 +1,46 @@ +package com.epmet.datareport.service.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.screen.ScreenEventDataDao; +import com.epmet.datareport.dao.screen.ScreenEventImgDataDao; +import com.epmet.datareport.service.screen.ScreenProjectService; +import com.epmet.screen.dto.form.ProjectDetailFormDTO; +import com.epmet.screen.dto.result.ProjectDetailResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 项目 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:23 + */ +@Service +public class ScreenProjectServiceImpl implements ScreenProjectService { + + @Autowired + private ScreenEventDataDao screenEventDataDao; + @Autowired + private ScreenEventImgDataDao screenEventImgDataDao; + + /** + * @Description 3、项目详情 + * @param projectDetailFormDTO + * @author zxc + * @date 2020/8/19 4:36 下午 + */ + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + public ProjectDetailResultDTO projectDetail(ProjectDetailFormDTO projectDetailFormDTO) { + ProjectDetailResultDTO projectDetailResultDTO = screenEventDataDao.selectEventDetail(projectDetailFormDTO.getProjectId()); + if (null == projectDetailResultDTO){ + return new ProjectDetailResultDTO(); + } + List imgList = screenEventImgDataDao.selectEventImgList(projectDetailFormDTO.getProjectId()); + projectDetailResultDTO.setImgList(imgList); + return projectDetailResultDTO; + } +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/TopicService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/topic/TopicService.java similarity index 96% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/TopicService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/topic/TopicService.java index 584ac1b1dc..f0dd505cb4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/TopicService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/topic/TopicService.java @@ -1,4 +1,4 @@ -package com.epmet.service.topic; +package com.epmet.datareport.service.topic; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/topic/impl/TopicServiceImpl.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/topic/impl/TopicServiceImpl.java index 298dcae7a3..12889caaae 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/topic/impl/TopicServiceImpl.java @@ -1,13 +1,12 @@ -package com.epmet.service.topic.impl; +package com.epmet.datareport.service.topic.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.dao.topic.TopicDao; +import com.epmet.datareport.dao.topic.TopicDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.group.constant.GroupConstant; -import com.epmet.service.topic.TopicService; +import com.epmet.datareport.service.topic.TopicService; import com.epmet.topic.constant.TopicConstant; import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; import com.epmet.topic.dto.result.*; @@ -16,8 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; -import java.text.DecimalFormat; -import java.text.NumberFormat; import java.time.LocalDate; import java.util.*; import java.util.stream.Collectors; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/UserAnalysisService.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/UserAnalysisService.java index 2c658fc1da..47c304f1b2 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/UserAnalysisService.java @@ -1,4 +1,4 @@ -package com.epmet.service.user; +package com.epmet.datareport.service.user; import com.epmet.dto.form.user.UserIncrTrendFormDTO; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java similarity index 99% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java index 3244076896..88e39067b4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/user/impl/UserAnalysisServiceImpl.java @@ -1,4 +1,4 @@ -package com.epmet.service.user.impl; +package com.epmet.datareport.service.user.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; @@ -7,7 +7,7 @@ import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.UserAnalysisConstant; -import com.epmet.dao.user.UserAnalysisDao; +import com.epmet.datareport.dao.user.UserAnalysisDao; import com.epmet.dto.DimAgencyDTO; import com.epmet.dto.DimDepartmentDTO; import com.epmet.dto.DimGridDTO; @@ -19,7 +19,7 @@ import com.epmet.dto.form.user.UserSummaryInfoFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.dto.result.user.*; import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.service.user.UserAnalysisService; +import com.epmet.datareport.service.user.UserAnalysisService; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; 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 new file mode 100644 index 0000000000..6db1756fdb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/DateUtils.java @@ -0,0 +1,128 @@ +package com.epmet.datareport.utils; + +import com.epmet.commons.tools.constant.NumConstant; +import com.google.common.collect.Maps; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import java.text.SimpleDateFormat; +import java.time.LocalDate; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Description + * @ClassName DateUtils + * @Auth wangc + * @Date 2020-08-20 10:56 + */ +@Component +public class DateUtils { + private static SimpleDateFormat defaultFormat = new SimpleDateFormat("yyyyMM"); + private static DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyyMM"); + /** + * @Description 返回当前月以及前十一个月,升序 + * @param + * @return Map key:202001 value:1月 + * @author wangc + * @date 2020.08.19 12:46 + **/ + public Map getX(){ + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); // 设置为当前时间 + calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月 + String currentMonth = defaultFormat.format(calendar.getTime()); + Integer monthCounter = Integer.parseInt(currentMonth); + Map monthMap = new HashMap<>(); + int i = NumConstant.ONE; + while(i <= NumConstant.TWELVE){ + + if(monthCounter.toString().endsWith("00")){ + monthCounter -= NumConstant.EIGHTY_EIGHT; + } + + String abscissa = monthCounter.toString().substring(monthCounter.toString().length() - NumConstant.TWO); + if(abscissa.startsWith("0")) { + abscissa = abscissa.replace("0","").concat("月"); + }else{ + abscissa = abscissa.concat("月"); + } + monthMap.put(monthCounter.toString(),abscissa); + monthCounter-- ; + i++; + } + + Map result = Maps.newLinkedHashMap(); + monthMap.entrySet().stream().sorted(Map.Entry.comparingByKey()) + .forEachOrdered((e -> result.put(e.getKey(),e.getValue()))); + + return result; + } + + public Map getXpro(){ + Map xAxis = new HashMap<>(); + LocalDate today = LocalDate.now(); + + for(int i = NumConstant.TWELVE;i >= NumConstant.ONE; i--){ + LocalDate localDate = today.minusMonths(i); + String s = localDate.getMonth().getValue() + "月"; + xAxis.put(localDate.format(fmt),s); + } + Map result = Maps.newLinkedHashMap(); + xAxis.entrySet().stream().sorted(Map.Entry.comparingByKey()) + .forEachOrdered((e -> result.put(e.getKey(),e.getValue()))); + return result; + } + + /** + * @Description 得到上个月的monthId + * @param + * @return + * @author wangc + * @date 2020.08.20 10:19 + **/ + public String getPreviousMonthId(){ + SimpleDateFormat format = new SimpleDateFormat("yyyyMM"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); // 设置为当前时间 + calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); // 设置为上一个月 + return format.format(calendar.getTime()); + } + + public String getPreviousMonthIdByDest(Date date,String dateStr){ + SimpleDateFormat format = new SimpleDateFormat("yyyyMM"); + Calendar c = Calendar.getInstance(); + if(null == date && StringUtils.isNotBlank(dateStr)){ + try{ + date = format.parse(dateStr); + + }catch(Exception e){ + e.printStackTrace(); + } + }else{ + return null; + } + c.setTime(date); + c.add(Calendar.MONTH, NumConstant.ONE_NEG); + return format.format(c.getTime()); + } + + public static void main(String[] args) { + DateUtils util = new DateUtils(); + Map result = util.getXpro(); + result.forEach((k,v) -> { + System.out.print(k); + System.out.print(" -> "); + System.out.print(v); + System.out.println(); + }); + + List xLine = result.values().stream().collect(Collectors.toList()); + xLine.forEach(x -> { + System.out.println(x); + }); + + result.keySet().forEach(key -> System.out.println(key)); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/ModuleConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/ModuleConstant.java new file mode 100644 index 0000000000..9314d3ba3b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/utils/ModuleConstant.java @@ -0,0 +1,24 @@ +package com.epmet.datareport.utils; + +public interface ModuleConstant { + + String PARAM_BRANCH_CATEGORY_UNION = "ljgj"; + + String PARAM_BRANCH_CATEGORY_VOLUNTARY_SERVICE = "ljdyzy"; + + String PARAM_BRANCH_CATEGORY_PARTY = "zbjs"; + + String KEY_BRANCH_CATEGORY_UNION = "union"; + + String KEY_BRANCH_CATEGORY_VOLUNTARY_SERVICE = "voluntaryservice"; + + String KEY_BRANCH_CATEGORY_PARTY = "party"; + + String SYMBOL_PERCENT = "%"; + + String PARAM_DIFFICULTY_TYPE_TIME_LONGEST = "timelongest"; + + String PARAM_DIFFICULTY_TYPE_MOST_DEPTS = "mostdepts"; + + String PARAM_DIFFICULTY_TYPE_MOST_HANDLED = "mosthandled"; +} 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 19e6e4b584..d4db395aa8 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 @@ -24,9 +24,9 @@ spring: druid: #MySQL driver-class-name: com.mysql.cj.jdbc.Driver - url: @datasource.druid.url@ - username: @datasource.druid.username@ - password: @datasource.druid.password@ + url: @datasource.druid.stats.url@ + username: @datasource.druid.stats.username@ + password: @datasource.druid.stats.password@ cloud: nacos: discovery: @@ -53,11 +53,11 @@ spring: # 数据迁移工具flyway flyway: - enabled: false + enabled: @spring.flyway.enabled@ locations: classpath:db/migration - url: @datasource.druid.url@ - user: @datasource.druid.username@ - password: @datasource.druid.password@ + url: @datasource.druid.stats.url@ + user: @datasource.druid.stats.username@ + password: @datasource.druid.stats.password@ baseline-on-migrate: true baseline-version: 0 @@ -91,6 +91,20 @@ mybatis-plus: call-setters-on-nulls: true jdbc-type-for-null: 'null' +#动态数据源 +dynamic: + datasource: + stats: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.stats.url@ + username: @datasource.druid.stats.username@ + password: @datasource.druid.stats.password@ + statsDisplay: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.statsdisplay.url@ + username: @datasource.druid.statsdisplay.username@ + password: @datasource.druid.statsdisplay.password@ + feign: hystrix: enabled: true 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 ad10364cb5..08a6a198d1 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 @@ -137,13 +137,14 @@ - - - - - - - + + + + + + + + @@ -156,13 +157,13 @@ - - - - - - - + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml index b3b1faecd7..159a814a61 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml @@ -1,7 +1,7 @@ - + SELECT AGENCY_ID, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml index 9ea5c548d6..21b472e4de 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml @@ -1,7 +1,7 @@ - + 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 new file mode 100644 index 0000000000..3fc9c990b3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ 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 new file mode 100644 index 0000000000..cfdb8da6de --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml new file mode 100644 index 0000000000..58e2171c3d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.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/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml new file mode 100644 index 0000000000..988e0b17cd --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + \ 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 new file mode 100644 index 0000000000..ab381cebba --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml new file mode 100644 index 0000000000..63cadbbd5e --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml new file mode 100644 index 0000000000..e5e3e636af --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml @@ -0,0 +1,16 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml new file mode 100644 index 0000000000..3fb4174055 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.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/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml new file mode 100644 index 0000000000..21293ad4c6 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + \ No newline at end of file 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 new file mode 100644 index 0000000000..3d9329846d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.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/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml new file mode 100644 index 0000000000..f83ec244d7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + \ 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 new file mode 100644 index 0000000000..8fbf102170 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml new file mode 100644 index 0000000000..5643b1e31b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.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/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml new file mode 100644 index 0000000000..66fb4d6a80 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml new file mode 100644 index 0000000000..5e509c8329 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml @@ -0,0 +1,27 @@ + + + + + + + + \ 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 new file mode 100644 index 0000000000..8f17dc796a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml new file mode 100644 index 0000000000..a1700b05a4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml index 01d4a5d335..3b96ffc150 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml @@ -1,7 +1,7 @@ - + SELECT diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/CompareConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/CompareConstant.java new file mode 100644 index 0000000000..119cd1ca31 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/CompareConstant.java @@ -0,0 +1,26 @@ +package com.epmet.constant; + +/** + * 比较结果常量 + * + * @author yujintao + * @email yujintao@elink-cn.com + * @date 2019/8/19 10:28 + */ +public interface CompareConstant { + + /** + * 增加 + */ + String INCR_STR = "incr"; + + /** + * 下降 + */ + String DECR_STR = "decr"; + + /** + * 相等 + */ + String EQ_STR = "eq"; +} 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 new file mode 100644 index 0000000000..50cc040c44 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityFormDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 8、治理能力-部门相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class DeptGovrnAbilityFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 上级组织id + */ + private String deptId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * allRegion:全区;community:社区;street:街道 + */ + private String dataType; + + /** + * 区直部门被吹哨次数 + */ + private Integer transferedCount; + + /** + * 区直部门办结项目数 + */ + private Integer closedProjectCount; + + /** + * 区直部门项目响应度 所有被吹哨后的滞留时间除以项目数 + */ + private BigDecimal respProjectRatio; + + /** + * 区直部门办结项目的处理效率 + */ + private BigDecimal handleProjectRatio; + + /** + * 区直部门项目办结率 + */ + private BigDecimal closedProjectRatio; + + /** + * 办结项目满意度 + */ + private BigDecimal satisfactionRatio; +} 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 new file mode 100644 index 0000000000..ef4efd6a24 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityFormDTO.java @@ -0,0 +1,82 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 6、治理能力-网格相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridGovrnAbilityFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 网格id + */ + private String gridId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * 网格总议题数 + */ + private Integer issueTotal; + + /** + * 网格人均议题数目 + */ + private Integer avgIssueCount; + + /** + * 网格总项目数 + */ + private Integer projectTotal; + + /** + * 网格办结项目数 + */ + private Integer resolveProjectCount; + + /** + * 网格吹哨部门准确率 + */ + private BigDecimal transferRightRatio; + + /** + * 网格内解决的项目的满意度 + */ + private BigDecimal satisfactionRatio; + + /** + * 网格议题转项目率 + */ + private BigDecimal avgShiftProjectRatio; + + /** + * 网格自治项目数 统计期网格自身内办结的项目数目 + */ + private Integer selfSolveProjectCount; +} 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 new file mode 100644 index 0000000000..8738c5c3f2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java @@ -0,0 +1,107 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 2、党建能力-网格相关指标上报(按照月份) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridPartyAbilityFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 网格id + */ + private String gridId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * 网格党员用户数 + */ + private Integer partyCount; + + /** + * 网格党员人均提出的议题转项目数 + */ + private Integer partyAvgShiftProjectCount; + + /** + * 网格活跃群众用户数 + */ + private Integer activeUserCount; + + /** + * 网格活跃党员用户数 + */ + private Integer activePartyCount; + + /** + * 网格党员人均提出话题数 + */ + private Integer partyAvgTopicCount; + + /** + * 网格群众人均提出话题数 + */ + private Integer userAvgTopicCount; + + /** + * 网格群众用户数 + */ + private Integer userCount; + + /** + * 网格群众人均提出的议题转项目数 + */ + private Integer userAvgShiftProjectCount; + + /** + * 建群党员数(累计值) + */ + private Integer createGroupPartyCount; + + /** + * 网格发文数 + */ + private Integer publishArticleCount; + + /** + * 网格议题转项目率 + */ + private BigDecimal issueToProjectRatio; + + /** + * 组织三会一课次数 + */ + private Integer createThreeMeetsCount; + + /** + * 党员参加三会一课人次 + */ + private Integer joinThreeMeetsCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java new file mode 100644 index 0000000000..7993cb2355 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java @@ -0,0 +1,98 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; +import org.apache.poi.hpsf.Decimal; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 1、党建能力-党员相关指标上报(按照月份) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridPartyMemberDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 网格id + */ + private String gridId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * 党员提出的话题数 + */ + private Integer createTopicCount; + + /** + * 党员参与话题数(支持,反对,评论,浏览) + */ + private Integer joinTopicCount; + + /** + * 话题转议题数 + */ + private Integer shiftIssueCount; + + /** + * 议题转项目数 + */ + private Integer shiftProjectCount; + + /** + * 参加三会一课次数 + */ + private Integer joinThreeMeetsCount; + + /** + * 自建群群众人数 + */ + private Integer groupUserCount; + + /** + * 自建群活跃度-话题数 + */ + private Integer groupTopicCount; + + /** + * 议题转项目率 + */ + private BigDecimal topicToIssueRatio; + + /** + * 提出的议题转项目数 + */ + private Integer issueToProjectCount; + + /** + * 用户id + */ + private String userId; + + /** + * 上级组织Id + */ + private String parentId; +} 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 new file mode 100644 index 0000000000..02b7906a36 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityFormDTO.java @@ -0,0 +1,58 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 4、服务能力-网格相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridServiceAbilityFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 网格id + */ + private String gridId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * 网格活动组织次数 爱心活动 + */ + private Integer activityCount; + + /** + * 网格志愿者占比 + */ + private Integer volunteerRatio; + + /** + * 网格党员志愿者率 + */ + private BigDecimal partyVolunteerRatio; + +} 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 new file mode 100644 index 0000000000..7ddb9e785a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityFormDTO.java @@ -0,0 +1,77 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 7、治理能力-街道及社区相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgGovrnAbilityFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 上级组织id + */ + private String parentId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * allRegion:全区;community:社区;street:街道 + */ + private String dataType; + + /** + * 被吹哨次数 + */ + private Integer transferedCount; + + /** + * 办结项目数 + */ + private Integer closedProjectCount; + + /** + * 项目响应度 所有被吹哨后的滞留时间除以项目数 + */ + private BigDecimal respProjectRatio; + + /** + * 办结项目率 + */ + private BigDecimal closedProjectRatio; + + /** + * 办结项目满意度 + */ + private BigDecimal satisfactionRatio; + + /** + * 超期项目率 + */ + private BigDecimal overdueProjectRatio; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityFormDTO.java new file mode 100644 index 0000000000..e5ad40ef3f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityFormDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 3、党建能力-街道及社区相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgPartyAbilityFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 上级组织id + */ + private String parentId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * allRegion:全区;community:社区;street:街道 + */ + private String dataType; + + /** + * 发文数 + */ + private Integer publishArticleCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java new file mode 100644 index 0000000000..6ef48c6fa4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityFormDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 5、服务能力-组织(街道|社区|全区)相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgServiceAbilityFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关id:网格所属的组织id + */ + private String agencyId; + + /** + * 上级组织id + */ + private String parentId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyyQ1, yyyyQ2, yyyyQ3, yyyyQ4 + */ + private String quarterId; + + /** + * yyyy + */ + private String yearId; + + /** + * allRegion:全区;community:社区;street:街道 + */ + private String dataType; + + /** + * 社区/街道活动组织次数 爱心活动 + */ + private Integer activityCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/IndexCalculateForm.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/IndexCalculateForm.java new file mode 100644 index 0000000000..49e30cdb21 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/IndexCalculateForm.java @@ -0,0 +1,23 @@ +package com.epmet.dto.screen.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:初始化客户指标权重参数实体类 + * @author liujianjun + */ +@Data +public class IndexCalculateForm implements Serializable { + private static final long serialVersionUID = 3280392511156378209L; + /** + * desc:客户id + */ + private String customerId; + + /** + * desc:月份id + */ + private String monthId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/InitCustomerIndexForm.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/InitCustomerIndexForm.java new file mode 100644 index 0000000000..4016a9656e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/InitCustomerIndexForm.java @@ -0,0 +1,18 @@ +package com.epmet.dto.screen.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:初始化客户指标权重参数实体类 + * @author liujianjun + */ +@Data +public class InitCustomerIndexForm implements Serializable { + private static final long serialVersionUID = 3280392511156378209L; + /** + * desc:客户id + */ + private String customerId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ImgDataListDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ImgDataListDTO.java new file mode 100644 index 0000000000..fb63116850 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ImgDataListDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.screencoll; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 图片列表 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class ImgDataListDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 原始事件id + */ + private String eventId; + + /** + * 图片地址 + */ + private String imgUrl; + + /** + * 排序 + */ + private Integer sort; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataFormDTO.java new file mode 100644 index 0000000000..ee1674ce96 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataFormDTO.java @@ -0,0 +1,86 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 2、党员基本情况 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CpcBaseDataFormDTO 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; + + /** + * 注册用户数 + */ + private Integer registerUserCount; + + /** + * 群众用户数 + */ + private Integer resiTotal; + + /** + * 注册党员数 + */ + private Integer partyMemberCount; + + /** + * 小于20岁 + */ + private Integer ageLevel1; + + /** + * 20-30岁 + */ + private Integer ageLevel2; + + /** + * 31-40岁 + */ + private Integer ageLevel3; + + /** + * 41-50岁 + */ + private Integer ageLevel4; + + /** + * 51-60岁 + */ + private Integer ageLevel5; + + /** + * 60+岁 + */ + private Integer ageLevel6; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; +} 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 new file mode 100644 index 0000000000..cebf258d31 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java @@ -0,0 +1,71 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 14、组织层级 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CustomerAgencyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织id + */ + private String agencyId; + + /** + * 组织名称 + */ + private String agencyName; + + /** + * 父级id ,顶级,此列为0 + */ + private String pid; + + /** + * 所有上级ID,用逗号分开 + */ + private String pids; + + /** + * 所有组织名称以-链接 + */ + private String allParentNames; + + /** + * 坐标区域 + */ + private String areaMarks; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 党工委|街道党委的位置,预留字段 + */ + private String partyMark; + + /** + * 机关级别(社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province) + */ + private String level; + + /** + * 行政地区编码 + */ + private String areaCode; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; +} 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 new file mode 100644 index 0000000000..a99713701a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 16、部门信息上传 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CustomerDeptFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 部门id + */ + private String deptId; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 部门所属组织id + */ + private String parentAgencyId; + + /** + * 坐标区域可空 + */ + private String areaMarks; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 部门所在位置 + */ + private String deptMark; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; +} 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 new file mode 100644 index 0000000000..38094a105a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 15、网格信息上传 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CustomerGridFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属组织id + */ + private String parentAgencyId; + + /** + * 坐标区域可空 + */ + private String areaMarks; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 党支部的位置!!! + */ + private String partyMark; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java new file mode 100644 index 0000000000..7d136c4b27 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java @@ -0,0 +1,102 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 3、难点赌点 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class DifficultyDataFormDTO 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 eventId; + + /** + * 事件图片 URL + */ + private String eventImgUrl; + + /** + * 事件来源 eg: XXX街道-xx社区-网格 + */ + private String eventSource; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 事件耗时单位:分钟 + */ + private Integer eventCostTime; + + /** + * 事件设计部门数 + */ + private Integer eventReOrg; + + /** + * 事件类别编码 + */ + private String eventCategoryCode; + + /** + * 事件状态编码 + */ + private String eventStatusCode; + + /** + * 事件类别名称 + */ + private String eventCategoryName; + + /** + * 事件状态描述 + */ + private String eventStatusDesc; + + /** + * 最近一次操作说明 eg: 转项目,结案,流转 + */ + private String latestOperateDesc; + + /** + * 事件被处理次数(08-21新增) + */ + private Integer eventHandledCount; + + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java new file mode 100644 index 0000000000..21e8ee718e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java @@ -0,0 +1,124 @@ +package com.epmet.dto.screencoll.form; + +import com.epmet.dto.screencoll.ImgDataListDTO; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 4、事件数据(中央区-事件数据) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class EventDataFormDTO 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 eventId; + + /** + * 事件名称 + */ + private String eventTitle; + + /** + * yyyy-MM-dd HH:mm:ss事件时间 + */ + private String eventCreateTime; + + /** + * 联系人 + */ + private String linkMobile; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 事件图片(如果有图片,此列为第一张图片) + */ + private String eventImgUrl; + + /** + * 事件待处理级别 red:红;yellow:黄 , green绿色 + */ + private String eventLevel; + + /** + * 事件发生的地址 + */ + private String eventAddress; + + /** + * 经度 + */ + private BigDecimal longitude; + + /** + * 维度 + */ + private BigDecimal latitude; + + /** + * 最后处理的组织名称 + */ + private String lastProcessDept; + + /** + * 最后处理的时间 + */ + private String lastProcessDate; + + /** + * 图片列表 + */ + private List imgDataList; + + /** + * 事件状态描述 + */ + private String eventStatusDesc; + + /** + * 事件状态key + */ + private String eventStatusCode; + + /** + * 最近一次操作说明 eg: 转项目,结案,流转 + */ + private String latestOperateDesc; + + /** + * 数据更新至: yyyy|yyyMM|yyyyMMdd 8.21增加字段 + */ + private String dataEndTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataFormDTO.java new file mode 100644 index 0000000000..f12e196ab7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataFormDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 5、基层治理-治理能力数据 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GovernRankDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 年Id :yyyy + */ + private String yearId; + + /** + * 月份Id :yyyyMM + */ + private String monthId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 响应率,最大值100,保留小数点后4位 + */ + private BigDecimal responseRatio; + + /** + * 解决率 最大值100,保留小数点后4位 + */ + private BigDecimal resolvedRatio; + + /** + * 自治率 最大值100,保留小数点后4位 + */ + private BigDecimal governRatio; + + /** + * 满意率,最大值100,保留小数点后四位 + */ + private BigDecimal satisfactionRatio; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java new file mode 100644 index 0000000000..c27f75db87 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 1、指数_按月统计 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class IndexDataMonthlyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * yyyy + */ + private String yearId; + + /** + * yyyyMM eg :202007 + */ + private String monthId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 总指数 + */ + private BigDecimal indexTotal; + + /** + * 党建能力指数 + */ + private BigDecimal partyDevAblity; + + /** + * 服务能力指数 + */ + private BigDecimal serviceAblity; + + /** + * 治理能力指数 + */ + private BigDecimal governAblity; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataYearlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataYearlyFormDTO.java new file mode 100644 index 0000000000..4eafd27be7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataYearlyFormDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 17、指数_按年统计 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class IndexDataYearlyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * yyyy + */ + private String yearId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 总指数 + */ + private BigDecimal indexTotal; + + /** + * 党建能力指数 + */ + private BigDecimal partyDevAblity; + + /** + * 服务能力指数 + */ + private BigDecimal serviceAblity; + + /** + * 治理能力指数 + */ + private BigDecimal governAblity; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java new file mode 100644 index 0000000000..8b0a753839 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java @@ -0,0 +1,82 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 6、党建引领-组织排行 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgRankDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 年Id :yyyy + */ + private String yearId; + + /** + * 月份Id :yyyyMM + */ + private String monthId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 党员总数 + */ + private Integer partyTotal; + + /** + * 小组(支部建设总数) + */ + private Integer groupTotal; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 结案率,最大值100,保留小数点后四位 + */ + private BigDecimal closeProjectRatio; + + /** + * 满意率,最大值100,保留小数点后四位 + */ + private BigDecimal satisfactionRatio; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataFormDTO.java new file mode 100644 index 0000000000..21144c89ab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataFormDTO.java @@ -0,0 +1,76 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 7、基层党建-建设情况数据(支部、联建、志愿) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PartyBranchDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 年Id :yyyy + */ + private String yearId; + + /** + * 月份Id :yyyyMM + */ + private String monthId; + + /** + * 数据类别 party:支部建设;union:联合建设党员志愿服务:voluntaryservice + */ + private String type; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 会议分类名称 + */ + private String meetCategoryName; + + /** + * 会议分类id + */ + private String meetCategoryId; + + /** + * 组织次数 + */ + private Integer organizeCount; + + /** + * 参加人数 + */ + private Integer joinUserCount; + + /** + * 平均参加人数 + */ + private Integer averageJoinUserCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataFormDTO.java new file mode 100644 index 0000000000..c57728d3fc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataFormDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 8、党建引领-党员联系群众数据 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PartyLinkMassesDataFormDTO 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; + + /** + * 建群总数 + */ + private Integer createGroupTotal; + + /** + * 群成员总数 + */ + private Integer groupUserTotal; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java new file mode 100644 index 0000000000..29b35aa147 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataFormDTO.java @@ -0,0 +1,76 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 9、党建引领|基层治理-居民(党员)积分排行榜 入参 + * @Auther: zhangyong + * @Date: 2020-08-21 09:59 + */ +@Data +public class PartyUserRankDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd + */ + private String dataEndTime; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 用户所属网格id + */ + private String gridId; + + /** + * 用户所属网格名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String orgId; + + /** + * 网格所属的组织名称 + */ + private String orgName; + + /** + * 是否是党员标志:1是。0不是党员 + */ + private String partyFlag; + + /** + * 用户Id + */ + private String userId; + + /** + * 用户名称 + */ + private String userName; + + /** + * 用户积分 + */ + private Integer pointTotal; + + /** + * 姓 + */ + private String surname; + + /** + * 名 + */ + private String name; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java new file mode 100644 index 0000000000..7e79fce0b8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java @@ -0,0 +1,93 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 10、党建引领-先锋模范数据 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PioneerDataFormDTO 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; + + /** + * 党员发布议题 + */ + private Integer publishIssueTotal; + + /** + * 议事数 + */ + private Integer issueTotal; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 议题转项目数 + */ + private Integer shiftProjectTotal; + + /** + * 解决项目总数 + */ + private Integer resolvedProjectTotal; + + + /** + * 议事占比 + */ + private BigDecimal issueRatio; + + /** + * 话题占比 + */ + private BigDecimal topicRatio; + + /** + * 议题转项目占比 + */ + private BigDecimal shiftProjectRatio; + + /** + * 解决项目占比 + */ + private BigDecimal resolvedProjectRatio; + + /** + * 党员发布议题占比 + */ + private BigDecimal publishIssueRatio; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java new file mode 100644 index 0000000000..9abd6012d6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java @@ -0,0 +1,61 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 11、基层治理-公众参与 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class UserJoinFormDTO 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 :yyyy + */ + private String yearId; + + /** + * 月份Id :yyyyMM + */ + private String monthId; + + /** + * 人均议题 + */ + private Integer avgIssue; + + /** + * 总的参与次数 + */ + private Integer joinTotal; + + /** + * 平均参与度 + */ + private Integer avgJoin; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java new file mode 100644 index 0000000000..14f4df673d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java @@ -0,0 +1,81 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 12、中央区各类总数 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class UserTotalDataFormDTO 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; + + /** + * 用户总数 + */ + private Integer userTotal; + + /** + * 注册党员数 + */ + private Integer partyTotal; + + /** + * 小组(党群)总数 + */ + private Integer groupTotal; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + /** + * 注册人数(08-21新增) + */ + private Integer regUserTotal; + + /** + * 参与人数(08-21新增) + */ + private Integer joinUserTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index 0d7479b1ec..a34bca869d 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: data-statistical-server: container_name: data-statistical-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.42 + image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.45 ports: - "8108:8108" network_mode: host # 使用现有网络 diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 0dfdd97d91..70a64c3864 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.42 + 0.3.45 data-statistical com.epmet @@ -68,6 +68,31 @@ 2.0.0 compile + + com.epmet + epmet-commons-extapp-auth + 2.0.0 + compile + + + + + + org.apache.poi + poi + 3.17 + + + + org.apache.poi + poi-ooxml + 3.17 + + + com.alibaba + easyexcel + 2.2.6 + @@ -153,6 +178,12 @@ epmet_user_user EpmEt-db-UsEr + + + + epmet_data_stats_display_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -160,8 +191,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java index ad4e2110fa..21b5ea51b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java @@ -3,13 +3,18 @@ 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; import org.springframework.scheduling.annotation.EnableAsync; +@EnableDiscoveryClient +@EnableFeignClients @SpringBootApplication (exclude = {DataSourceAutoConfiguration.class}) @EnableAsync public class DataStatsApplication { public static void main(String[] args) { SpringApplication.run(DataStatsApplication.class ,args); + //HttpClientManager.getInstance().sendAlarmMsg("DataStatsApplication started!"); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java new file mode 100644 index 0000000000..7c12fec411 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java @@ -0,0 +1,156 @@ +package com.epmet.controller; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.indexcollect.form.*; +import com.epmet.service.indexcollect.FactIndexCollectService; +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; + +/** + * 指标采集相关api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/20 9:38 + */ +@RestController +@RequestMapping("indexcollect") +public class FactIndexCollectController { + + @Autowired + private FactIndexCollectService factIndexCollectService; + + /** + * 1、党建能力-党员相关指标上报(按照月份) + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("gridpartymemberdata") + public Result gridPartyMemberData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridPartyMemberData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 2、党建能力-网格相关指标上报(按照月份) + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("gridpartyability") + public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 3、党建能力-街道及社区相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("orgpartyability") + public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertOrgPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 4、服务能力-网格相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("gridserviceability") + public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 5、服务能力-组织(街道|社区|全区)相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("orgserviceability") + public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertOrgServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 6、治理能力-网格相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("gridgovrnability") + public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 7、治理能力-街道及社区相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("orggovrnability") + public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertOrgGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 8、治理能力-部门相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("deptgovrnability") + public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + 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 new file mode 100644 index 0000000000..cba12740c5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -0,0 +1,154 @@ +package com.epmet.controller; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.screen.form.IndexCalculateForm; +import com.epmet.service.screen.IndexCalculateService; +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; + +/** + * 指标计算controller + * + * @author liujianjun@elink-cn.com + * @date 2020/8/24 14:38 + */ +@RestController +@RequestMapping("indexcalculate") +public class IndexCalculateController { + + @Autowired + private IndexCalculateService indexCalculateService; + + /** + * 1、党建能力-党员相关指标计算(按照月份) + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + @ExternalAppRequestAuth + @PostMapping("cpc") + public Result cpcIndexCalculate(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexCalculateForm formDTO) { + indexCalculateService.cpcIndexCalculate(formDTO); + return new Result(); + } + + /* *//** + * 2、党建能力-网格相关指标上报(按照月份) + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **//* + @ExternalAppRequestAuth + @PostMapping("gridpartyability") + public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + *//** + * 3、党建能力-街道及社区相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **//* + @ExternalAppRequestAuth + @PostMapping("orgpartyability") + public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertOrgPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + *//** + * 4、服务能力-网格相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **//* + @ExternalAppRequestAuth + @PostMapping("gridserviceability") + public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + *//** + * 5、服务能力-组织(街道|社区|全区)相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **//* + @ExternalAppRequestAuth + @PostMapping("orgserviceability") + public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertOrgServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + *//** + * 6、治理能力-网格相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **//* + @ExternalAppRequestAuth + @PostMapping("gridgovrnability") + public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertGridGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + *//** + * 7、治理能力-街道及社区相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **//* + @ExternalAppRequestAuth + @PostMapping("orggovrnability") + public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertOrgGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + *//** + * 8、治理能力-部门相关指标 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **//* + @ExternalAppRequestAuth + @PostMapping("deptgovrnability") + public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + }*/ +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java new file mode 100644 index 0000000000..c26189717e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexDictController.java @@ -0,0 +1,86 @@ +package com.epmet.controller; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.read.metadata.ReadSheet; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.screen.form.InitCustomerIndexForm; +import com.epmet.model.IndexExcelDataListener; +import com.epmet.model.IndexModel; +import com.epmet.service.screen.IndexDictService; +import com.epmet.service.screen.IndexGroupDetailTemplateService; +import com.epmet.service.screen.IndexGroupService; +import com.epmet.service.screen.IndexGroupTemplateService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.io.InputStream; + +/** + * @author liujianjun + */ +@RequestMapping("indexdict") +@RestController +@Slf4j +public class IndexDictController { + + @Autowired + private IndexDictService indexDictService; + @Autowired + private IndexGroupTemplateService indexGroupTemplateService; + @Autowired + private IndexGroupService indexGroupService; + @Autowired + private IndexGroupDetailTemplateService indexGroupDetailTemplateService; + + /** + * url:http://localhost:8108/data/stats/indexdict/initFromExcel + * desc:从excel初始化指标,分组,权重 + * + * @param file + * @return + */ + @PostMapping("initFromExcel") + public Result testTx(@RequestPart("file") MultipartFile file) { + ExcelReader excelReader = null; + try { + InputStream inputStream = null; + try { + inputStream = file.getInputStream(); + } catch (IOException e) { + return new Result().error("读取文件失败"); + } + excelReader = EasyExcel.read(inputStream).build(); + // 这里为了简单 所以注册了 同样的head 和Listener 自己使用功能必须不同的Listener + ReadSheet readSheet = EasyExcel.readSheet(1).head(IndexModel.class) + .registerReadListener(new IndexExcelDataListener(indexDictService, indexGroupTemplateService, indexGroupDetailTemplateService)) + .build(); + excelReader.read(readSheet); + } finally { + if (excelReader != null) { + excelReader.finish(); + } + } + return new Result<>(); + } + + /** + * url:http://localhost:8108/data/stats/indexdict/initCustomerIndex + * desc: 初始化客户的评价指标数据 + * @param formDTO customerId + * @return + */ + @PostMapping("initCustomerIndex") + public Result initCustomerIndex(@RequestBody InitCustomerIndexForm formDTO){ + if (StringUtils.isBlank(formDTO.getCustomerId())){ + throw new RenException("参数错误"); + } + Boolean aBoolean = indexGroupService.initCustomerIndexGroup(formDTO.getCustomerId()); + return new Result().ok(aBoolean); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java new file mode 100644 index 0000000000..080ba5384b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java @@ -0,0 +1,286 @@ +package com.epmet.controller; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.screencoll.form.*; +import com.epmet.service.screen.ScreenCollService; +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; + +/** + * 大屏数据采集api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:25 + */ +@RestController +@RequestMapping("screencoll") +public class ScreenCollController { + + @Autowired + private ScreenCollService screenCollService; + + /** + * 9、党建引领|基层治理-居民(党员)积分排行榜 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("partyuserrankdata") + public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 8、党建引领-党员联系群众数据 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("partylinkmassesdata") + public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 7、基层党建-建设情况数据(支部、联建、志愿) + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("meetdata") + public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 6、党建引领-组织排行 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("orgrankdata") + public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 5、基层治理-治理能力数据 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("governrankdata") + public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 4、事件数据 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("eventdata") + public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 3、难点赌点 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("difficultydata") + public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 2、党员基本情况 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("cpcbasedata") + public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 1、指数_按月统计 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("indexdatamonthly") + public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + // -- + + /** + * 17、指数_按年统计 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("indexdatayearly") + public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 16、部门信息上传 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("customerdept") + public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 15、网格信息上传 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("customergrid") + public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 14、组织层级 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("customeragency") + public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 12、中央区各类总数 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("usertotaldata") + public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 11、基层治理-公众参与 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("userjoin") + public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + + /** + * 10、党建引领-先锋模范数据 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("pioneerdata") + public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java new file mode 100644 index 0000000000..f56638a3f6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java @@ -0,0 +1,66 @@ +package com.epmet.dao.indexcoll; /** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.DeptGovrnAbilityFormDTO; +import com.epmet.entity.indexcoll.FactIndexGovrnAblityDeptMonthlyEntity; +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-08-20 + */ +@Mapper +public interface FactIndexGovrnAblityDeptMonthlyDao extends BaseDao { + /** + * 8、治理能力-部门相关指标 + * 据CUSTOMER_ID、AGENCY_ID、DEPT_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyId + * @param deptId + * @param yearId + * @param monthId + * @param quarterId + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexGovrnAblityDeptMonthly(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("deptId") String deptId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId); + + /** + * 8、治理能力-部门相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexGovrnAblityDeptMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java new file mode 100644 index 0000000000..e591ba928d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityGridMonthlyDao.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.dao.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.GridGovrnAbilityFormDTO; +import com.epmet.entity.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +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-08-20 + */ +@Mapper +public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao { + + /** + * 6、治理能力-网格相关指标 + * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyId + * @param gridId + * @param yearId + * @param monthId + * @param quarterId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexGovrnAblityGridMonthly(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("gridId") String gridId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId); + + /** + * 6、治理能力-网格相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexGovrnAblityGridMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java new file mode 100644 index 0000000000..9013d4f9cf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.java @@ -0,0 +1,64 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.OrgGovrnAbilityFormDTO; +import com.epmet.entity.indexcoll.FactIndexGovrnAblityOrgMonthlyEntity; +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-08-20 + */ +@Mapper +public interface FactIndexGovrnAblityOrgMonthlyDao extends BaseDao { + /** + * 7、治理能力-街道及社区相关指标 + * 据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param quarterId + * @param agencyIds + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexGovrnAblityOrgMonthly(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId, + @Param("agencyIds") String[] agencyIds); + + /** + * 7、治理能力-街道及社区相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexGovrnAblityOrgMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.java new file mode 100644 index 0000000000..387a369af1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityCpcMonthlyDao.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.dao.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.GridPartyMemberDataFormDTO; +import com.epmet.entity.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; +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-08-20 + */ +@Mapper +public interface FactIndexPartyAblityCpcMonthlyDao extends BaseDao { + + /** + * 1、党建能力-党员相关指标上报(按照月份) + * 1) 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、USER_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyId + * @param gridId + * @param userId + * @param yearId + * @param monthId + * @param quarterId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexPartyAblityCpcMonthly(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("gridId") String gridId, + @Param("userId") String userId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId); + + /** + * 1、党建能力-党员相关指标上报(按照月份) + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexPartyAblityCpcMonthly(@Param("list") List list, + @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.java new file mode 100644 index 0000000000..b5cb8d2c5e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityGridMonthlyDao.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.dao.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.GridPartyAbilityFormDTO; +import com.epmet.entity.indexcoll.FactIndexPartyAblityGridMonthlyEntity; +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-08-20 + */ +@Mapper +public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao { + + /** + * 2、党建能力-网格相关指标上报(按照月份) + * 1) 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyId + * @param gridId + * @param yearId + * @param monthId + * @param quarterId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexPartyAblityGridMonthly(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("gridId") String gridId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId); + + /** + * 2、党建能力-网格相关指标上报(按照月份) + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexPartyAblityGridMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.java new file mode 100644 index 0000000000..73a73a1c50 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexPartyAblityOrgMonthlyDao.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.dao.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.OrgPartyAbilityFormDTO; +import com.epmet.entity.indexcoll.FactIndexPartyAblityOrgMonthlyEntity; +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-08-20 + */ +@Mapper +public interface FactIndexPartyAblityOrgMonthlyDao extends BaseDao { + + /** + * 3、党建能力-街道及社区相关指标 + * 根据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param quarterId + * @param agencyIds + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexPartyAblityOrgMonthly(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId, + @Param("agencyIds") String[] agencyIds); + + /** + * 3、党建能力-街道及社区相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexPartyAblityOrgMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.java new file mode 100644 index 0000000000..9eb7051762 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityGridMonthlyDao.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.dao.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.GridServiceAbilityFormDTO; +import com.epmet.entity.indexcoll.FactIndexServiceAblityGridMonthlyEntity; +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-08-20 + */ +@Mapper +public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao { + /** + * 4、服务能力-网格相关指标 + * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyId + * @param gridId + * @param yearId + * @param monthId + * @param quarterId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexServiceAblityGridMonthly(@Param("customerId") String customerId, + @Param("agencyId") String agencyId, + @Param("gridId") String gridId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId); + + /** + * 4、服务能力-网格相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexServiceAblityGridMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.java new file mode 100644 index 0000000000..31c268cd75 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexcoll/FactIndexServiceAblityOrgMonthlyDao.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.dao.indexcoll; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcollect.form.OrgServiceAbilityFormDTO; +import com.epmet.entity.indexcoll.FactIndexServiceAblityOrgMonthlyEntity; +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-08-20 + */ +@Mapper +public interface FactIndexServiceAblityOrgMonthlyDao extends BaseDao { + + /** + * 5、服务能力-组织(街道|社区|全区)相关指标 + * 根据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param quarterId + * @param agencyIds + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void deleteFactIndexServiceAblityOrgMonthly(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("quarterId") String quarterId, + @Param("agencyIds") String[] agencyIds); + + /** + * 5、服务能力-组织(街道|社区|全区)相关指标 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void batchInsertFactIndexServiceAblityOrgMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexDictDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexDictDao.java new file mode 100644 index 0000000000..7aa2ab9733 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexDictDao.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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.IndexDictEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 评价指标字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface IndexDictDao extends BaseDao { + + int deleteAll(); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.java new file mode 100644 index 0000000000..5458720940 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDao.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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.IndexGroupEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface IndexGroupDao extends BaseDao { + + int inertGroupFromTable(String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.java new file mode 100644 index 0000000000..1a7dd4a0a8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailDao.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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.IndexGroupDetailEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface IndexGroupDetailDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailTemplateDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailTemplateDao.java new file mode 100644 index 0000000000..29f074c13f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupDetailTemplateDao.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.screen; + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface IndexGroupDetailTemplateDao extends BaseDao { + + int deleteAll(); + + List selectAll(); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupTemplateDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupTemplateDao.java new file mode 100644 index 0000000000..c1e14b531c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/IndexGroupTemplateDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.IndexGroupTemplateEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 默认指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface IndexGroupTemplateDao extends BaseDao { + + int deleteAll(); + + List selectAll(); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCpcBaseDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCpcBaseDataDao.java new file mode 100644 index 0000000000..12271b8e3c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCpcBaseDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.CpcBaseDataFormDTO; +import com.epmet.entity.screen.ScreenCpcBaseDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenCpcBaseDataDao extends BaseDao { + + /** + * 2、党员基本情况 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteCpcBaseData(@Param("customerId") String customerId, + @Param("orgIds") String[] orgIds); + + /** + * 2、党员基本情况 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertCpcBaseData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerAgencyDao.java new file mode 100644 index 0000000000..d7851cd754 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerAgencyDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.CustomerAgencyFormDTO; +import com.epmet.dto.screencoll.form.CustomerGridFormDTO; +import com.epmet.entity.screen.ScreenCustomerAgencyEntity; +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-08-18 + */ +@Mapper +public interface ScreenCustomerAgencyDao extends BaseDao { + /** + *14、组织层级 + * 1) 根据CUSTOMER_ID、AGENCY_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param agencyIds 组织id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteCustomerAgency(@Param("customerId") String customerId, + @Param("agencyIds") String[] agencyIds); + + /** + * 14、组织层级 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertCustomerAgency(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerDeptDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerDeptDao.java new file mode 100644 index 0000000000..53f37049a3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerDeptDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.CustomerDeptFormDTO; +import com.epmet.entity.screen.ScreenCustomerDeptEntity; +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-08-18 + */ +@Mapper +public interface ScreenCustomerDeptDao extends BaseDao { + + /** + *16、部门信息上传 + * 1) 根据CUSTOMER_ID、DEPT_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param deptIds 部门Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteCustomerDept(@Param("customerId") String customerId, + @Param("deptIds") String[] deptIds); + + /** + * 16、部门信息上传 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertCustomerDept(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java new file mode 100644 index 0000000000..c9fa856582 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.CustomerGridFormDTO; +import com.epmet.entity.screen.ScreenCustomerGridEntity; +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-08-18 + */ +@Mapper +public interface ScreenCustomerGridDao extends BaseDao { + /** + *15、网格信息上传 + * 1) 根据CUSTOMER_ID、GRID_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param gridIds 网格Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteCustomerGrid(@Param("customerId") String customerId, + @Param("gridIds") String[] gridIds); + + /** + * 15、网格信息上传 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertCustomerGrid(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenDifficultyDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenDifficultyDataDao.java new file mode 100644 index 0000000000..1a9b991bac --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenDifficultyDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.DifficultyDataFormDTO; +import com.epmet.entity.screen.ScreenDifficultyDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenDifficultyDataDao extends BaseDao { + /** + * 3、难点赌点 + * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + + * @param customerId 一 + * @param eventId 多 + * @param orgId 多 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteDifficultyData(@Param("customerId")String customerId, + @Param("eventId")String eventId, + @Param("orgId")String orgId); + + /** + * 3、难点赌点 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertDifficultyData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventDataDao.java new file mode 100644 index 0000000000..ec80809c55 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.EventDataFormDTO; +import com.epmet.entity.screen.ScreenEventDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenEventDataDao extends BaseDao { + /** + * 4、事件数据 + * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId 一 + * @param eventId 多 + * @param orgId 多 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteEventData(@Param("customerId")String customerId, + @Param("eventId")String eventId, + @Param("orgId")String orgId); + + /** + * 4、事件数据 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertEventData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventImgDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventImgDataDao.java new file mode 100644 index 0000000000..42ca86859e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventImgDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.ScreenEventImgDataEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 中央区-事件数据图片数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-18 + */ +@Mapper +public interface ScreenEventImgDataDao extends BaseDao { + + /** + * 根据原始事件Id,进行物理删除 + * + * @param eventId + * @return void + * @Author zhangyong + * @Date 16:47 2020-08-18 + **/ + void delEventImgDataByEventId(@Param("eventId") String eventId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenGovernRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenGovernRankDataDao.java new file mode 100644 index 0000000000..ea3d67aa68 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenGovernRankDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.GovernRankDataFormDTO; +import com.epmet.entity.screen.ScreenGovernRankDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenGovernRankDataDao extends BaseDao { + /** + * 5、基层治理-治理能力数据 + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteGovernRankData(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("orgIds") String[] orgIds); + + /** + * 5、基层治理-治理能力数据 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertGovernRankData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataMonthlyDao.java new file mode 100644 index 0000000000..e97406febf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataMonthlyDao.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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO; +import com.epmet.entity.screen.ScreenIndexDataMonthlyEntity; +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-08-18 + */ +@Mapper +public interface ScreenIndexDataMonthlyDao extends BaseDao { + + /** + *1、指数相关 + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteIndexDataMonthly(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("orgIds") String[] orgIds); + + /** + * 1、指数相关 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertIndexDataMonthly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataYearlyDao.java new file mode 100644 index 0000000000..4ca64f6944 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataYearlyDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.IndexDataYearlyFormDTO; +import com.epmet.entity.screen.ScreenIndexDataYearlyEntity; +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-08-19 + */ +@Mapper +public interface ScreenIndexDataYearlyDao extends BaseDao { + + /** + * 17、指数_按年统计 + * 1) 根据CUSTOMER_ID、YEAR_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteIndexDataYearly(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("orgIds") String[] orgIds); + + /** + * 17、指数_按年统计 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertIndexDataYearly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenOrgRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenOrgRankDataDao.java new file mode 100644 index 0000000000..4eabfd508a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenOrgRankDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.OrgRankDataFormDTO; +import com.epmet.entity.screen.ScreenOrgRankDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenOrgRankDataDao extends BaseDao { + /** + * 6、党建引领-组织排行 + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteOrgRankData(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("orgIds") String[] orgIds); + + /** + * 6、党建引领-组织排行 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertOrgRankData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyBranchDataDao.java new file mode 100644 index 0000000000..3cae4a160d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyBranchDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.PartyBranchDataFormDTO; +import com.epmet.entity.screen.ScreenPartyBranchDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenPartyBranchDataDao extends BaseDao { + /** + * 7、基层党建-建设情况数据(支部、联建、志愿) + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deletePartyBranchData(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("orgIds") String[] orgIds); + + /** + * 7、基层党建-建设情况数据(支部、联建、志愿) + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertPartyBranchData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyLinkMassesDataDao.java new file mode 100644 index 0000000000..276b08e356 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyLinkMassesDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.PartyLinkMassesDataFormDTO; +import com.epmet.entity.screen.ScreenPartyLinkMassesDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenPartyLinkMassesDataDao extends BaseDao { + + /** + * 8、党建引领-党员联系群众数据 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deletePartyLinkMassesData(@Param("customerId") String customerId, + @Param("orgIds") String[] orgIds); + + /** + * 8、党建引领-党员联系群众数据 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertPartyLinkMassesData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyUserRankDataDao.java new file mode 100644 index 0000000000..9e43669618 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyUserRankDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.PartyUserRankDataFormDTO; +import com.epmet.entity.screen.ScreenPartyUserRankDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenPartyUserRankDataDao extends BaseDao { + + /** + * 9、党建引领|基层治理-居民(党员)积分排行榜 + * 1) 根据CUSTOMER_ID、GRID_ID、USER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param gridId + * @param userId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deletePartyUserRankData(@Param("customerId") String customerId, + @Param("gridId") String gridId, + @Param("userId") String userId); + + /** + * 9、党建引领|基层治理-居民(党员)积分排行榜 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertPartyUserRankData(@Param("list") List list,@Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPioneerDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPioneerDataDao.java new file mode 100644 index 0000000000..202fc4aa59 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPioneerDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.PioneerDataFormDTO; +import com.epmet.entity.screen.ScreenPioneerDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenPioneerDataDao extends BaseDao { + + /** + * 10、党建引领-先锋模范数据 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deletePioneerData(@Param("customerId") String customerId, + @Param("orgIds") String[] orgIds); + + /** + * 10、党建引领-先锋模范数据 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertPioneerData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserJoinDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserJoinDao.java new file mode 100644 index 0000000000..69422c07c4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserJoinDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.screen.ScreenUserJoinEntity; +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-08-18 + */ +@Mapper +public interface ScreenUserJoinDao extends BaseDao { + + /** + * 11、基层治理-公众参与 + * 0) 查询上月的基础数据,可用来计算本月的增长率 + * @param customerId + * @param yearId + * @param monthId + * @param orgIds 组织Id集合 + * @return java.util.List + * @Author zhangyong + * @Date 14:46 2020-08-21 + **/ + List selectLastMonthScreenUserJoinList(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("orgIds") String[] orgIds); + + /** + * 11、基层治理-公众参与 + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param monthId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteUserJoin(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("monthId") String monthId, + @Param("orgIds") String[] orgIds); + + /** + * 11、基层治理-公众参与 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertUserJoin(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserTotalDataDao.java new file mode 100644 index 0000000000..e0712dee50 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserTotalDataDao.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.dao.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.UserTotalDataFormDTO; +import com.epmet.entity.screen.ScreenUserTotalDataEntity; +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-08-18 + */ +@Mapper +public interface ScreenUserTotalDataDao extends BaseDao { + + /** + * 12、中央区各类总数 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteUserTotalData(@Param("customerId") String customerId, + @Param("orgIds") String[] orgIds); + + /** + * 12、中央区各类总数 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertUserTotalData(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.java new file mode 100644 index 0000000000..24827756fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityDeptMonthlyEntity.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.entity.indexcoll; + +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 2020-08-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_govrn_ablity_dept_monthly") +public class FactIndexGovrnAblityDeptMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 部门所属机关Id + */ + private String agencyId; + + /** + * 部门id + */ + private String deptId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 区直部门被吹哨次数 + */ + private Integer transferedCount; + + /** + * 区直部门办结项目数 + */ + private Integer closedProjectCount; + + /** + * 区直部门项目响应度 所有被吹哨后的滞留时间除以项目数 + */ + private BigDecimal respProjectRatio; + + /** + * 区直部门办结项目的处理效率 + */ + private BigDecimal handleProjectRatio; + + /** + * 区直部门项目办结率 + */ + private BigDecimal closedProjectRatio; + + /** + * 办结项目满意度 + */ + private BigDecimal satisfactionRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.java new file mode 100644 index 0000000000..c1c6553ef5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityGridMonthlyEntity.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.entity.indexcoll; + +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 2020-08-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_govrn_ablity_grid_monthly") +public class FactIndexGovrnAblityGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 网格总议题数 + */ + private Integer issueTotal; + + /** + * 网格人均议题数目 + */ + private Integer avgIssueCount; + + /** + * 网格议题转项目率 + */ + private BigDecimal avgShiftProjectRatio; + + /** + * 网格总项目数 + */ + private Integer projectTotal; + + /** + * 网格自治项目数 统计期网格自身内办结的项目数目 + */ + private Integer selfSolveProjectCount; + + /** + * 网格办结项目数 统计期内办结的项目数目 + */ + private Integer resolveProjectCount; + + /** + * 网格吹哨部门准确率 + */ + private BigDecimal transferRightRatio; + + /** + * 网格内解决的项目的满意度 + */ + private BigDecimal satisfactionRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java new file mode 100644 index 0000000000..94eec97d6f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexGovrnAblityOrgMonthlyEntity.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.indexcoll; + +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 2020-08-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_govrn_ablity_org_monthly") +public class FactIndexGovrnAblityOrgMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 上级组织Id,如果是根级组织,此列为0 + */ + private String parentId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 数据类型 allRegion:全区;street:街道;community:社区;grid:网格 + */ + private String dataType; + + /** + * 被吹哨次数 + */ + private Integer transferedCount; + + /** + * 办结项目数 + */ + private Integer closedProjectCount; + + /** + * 项目响应度 所有被吹哨后的滞留时间除以项目数 + */ + private BigDecimal respProjectRatio; + + /** + * 办结项目率 + */ + private BigDecimal closedProjectRatio; + + /** + * 办结项目满意度 + */ + private BigDecimal satisfactionRatio; + + /** + * 超期项目率 + */ + private BigDecimal overdueProjectRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.java new file mode 100644 index 0000000000..e6ec77f0fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityCpcMonthlyEntity.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.entity.indexcoll; + +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 2020-08-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_party_ablity_cpc_monthly") +public class FactIndexPartyAblityCpcMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 用户Id: + */ + private String userId; + + /** + * 月维度Id: yyyMM + */ + private String monthId; + + /** + * 季度Id: yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id : yyyy + */ + private String yearId; + + /** + * 党员提出的话题数 + */ + private Integer createTopicCount; + + /** + * 党员参与话题数(支持,反对,评论,浏览) + */ + private Integer joinTopicCount; + + /** + * 话题转议题数 + */ + private Integer shiftIssueCount; + + /** + * 议题转项目数 + */ + private Integer shiftProjectCount; + + /** + * 参加三会一课次数 + */ + private Integer joinThreeMeetsCount; + + /** + * 自建群群众人数 + */ + private Integer groupUserCount; + + /** + * 自建群活跃度-话题数 + */ + private Integer groupTopicCount; + + /** + * 议题转项目率 + */ + private BigDecimal topicToIssueRatio; + + /** + * 提出的议题转项目数 + */ + private Integer issueToProjectCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java new file mode 100644 index 0000000000..208106e87a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityGridMonthlyEntity.java @@ -0,0 +1,137 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.indexcoll; + +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 2020-08-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_party_ablity_grid_monthly") +public class FactIndexPartyAblityGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id + */ + private String monthId; + + /** + * 季度Id + */ + private String quarterId; + + /** + * 年Id + */ + private String yearId; + + /** + * 网格群众用户数 + */ + private Integer userCount; + + /** + * 网格党员用户数 + */ + private Integer partyCount; + + /** + * 网格活跃群众用户数 + */ + private Integer activeUserCount; + + /** + * 网格活跃党员用户数 + */ + private Integer activePartyCount; + + /** + * 网格党员人均提出话题数 + */ + private Integer partyAvgTopicCount; + + /** + * 网格群众人均提出话题数 + */ + private Integer userAvgTopicCount; + + /** + * 网格党员人均提出的议题转项目数 + */ + private Integer partyAvgShiftProjectCount; + + /** + * 网格群众人均提出的议题转项目数 + */ + private Integer userAvgShiftProjectCount; + + /** + * 建群党员数(累计值) 去重 + */ + private Integer createGroupPartyCount; + + /** + * 网格发文数 + */ + private Integer publishArticleCount; + + /** + * 网格议题转项目率 + */ + private BigDecimal issueToProjectRatio; + + /** + * 组织三会一课次数 + */ + private Integer createThreeMeetsCount; + + /** + * 党员参加三会一课人次 + */ + private Integer joinThreeMeetsCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.java new file mode 100644 index 0000000000..1bf023f055 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexPartyAblityOrgMonthlyEntity.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.indexcoll; + +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-08-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_party_ablity_org_monthly") +public class FactIndexPartyAblityOrgMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 月维度Id + */ + private String monthId; + + /** + * 季度Id + */ + private String quarterId; + + /** + * 年Id + */ + private String yearId; + + /** + * 发文数 + */ + private Integer publishArticleCount; + + /** + * 数据类型 allRegion:全区;community:社区;street:街道 + */ + private String dataType; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityGridMonthlyEntity.java new file mode 100644 index 0000000000..d4c6aa6ab6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityGridMonthlyEntity.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.entity.indexcoll; + +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 2020-08-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_service_ablity_grid_monthly") +public class FactIndexServiceAblityGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属组织Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id: yyyy + */ + private String yearId; + + /** + * 网格活动组织次数 爱心活动 + */ + private Integer activityCount; + + /** + * 网格志愿者占比 + */ + private BigDecimal volunteerRatio; + + /** + * 网格党员志愿者率 + */ + private BigDecimal partyVolunteerRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.java new file mode 100644 index 0000000000..8abeb1c172 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexcoll/FactIndexServiceAblityOrgMonthlyEntity.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.indexcoll; + +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-08-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_service_ablity_org_monthly") +public class FactIndexServiceAblityOrgMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织Id + */ + private String agencyId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 月维度Id:yyyyMM + */ + private String monthId; + + /** + * 季度Id:yyyyQ1,yyyyQ2,yyyyQ3,yyyyQ4 + */ + private String quarterId; + + /** + * 年Id:yyyy + */ + private String yearId; + + /** + * 社区/街道活动组织次数 爱心活动 + */ + private Integer activityCount; + + /** + * 数据类型 allRegion:全区;street:街道;community:社区;grid:网格 + */ + private String dataType; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexDictEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexDictEntity.java new file mode 100644 index 0000000000..2ea5745dba --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexDictEntity.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.entity.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 2020-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_dict") +public class IndexDictEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 指标名 + */ + private String indexName; + + /** + * 指标描述 + */ + private String indexDesc; + + /** + * 指标级别(1,2,3,4,5) + */ + private String level; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.java new file mode 100644 index 0000000000..c0088d5383 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailEntity.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.entity.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 2020-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_group_detail") +public class IndexGroupDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * index_group.id + */ + private String indexGroupId; + + /** + * 指标id + */ + private String indexId; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.java new file mode 100644 index 0000000000..569cda48d9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupDetailTemplateEntity.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.entity.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 2020-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_group_detail_template") +public class IndexGroupDetailTemplateEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * index_group.id + */ + private String indexGroupId; + + /** + * 指标id + */ + private String indexId; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 阈值 如果是百分比 则为除以100以后的值 + */ + private BigDecimal threshold; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupEntity.java new file mode 100644 index 0000000000..24df1ef18a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupEntity.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.entity.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 2020-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_group") +public class IndexGroupEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 指标id + */ + private String indexId; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 当前指标关联的上一级指标分组,如果没有上一级,则为0 + */ + private String parentIndexGroupId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupTemplateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupTemplateEntity.java new file mode 100644 index 0000000000..3348ebdeda --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/IndexGroupTemplateEntity.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.entity.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 2020-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_group_template") +public class IndexGroupTemplateEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 指标id + */ + private String indexId; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 当前指标关联的上一级指标分组,如果没有上一级,则为0 + */ + private String parentIndexGroupId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCpcBaseDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCpcBaseDataEntity.java new file mode 100644 index 0000000000..e649e5e89f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCpcBaseDataEntity.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.entity.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 generator generator@elink-cn.com + * @since v1.0.0 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_cpc_base_data") +public class ScreenCpcBaseDataEntity 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; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + /** + * 注册用户数 + */ + private Integer registerUserCount; + + /** + * 群众用户数 + */ + private Integer resiTotal; + + /** + * 注册党员数 + */ + private Integer partyMemberCount; + + /** + * 小于20岁的党员总人数 + */ + private Integer ageLevel1; + + /** + * 20-30岁的党员总人数 + */ + private Integer ageLevel2; + + /** + * 31-40岁的党员总人数 + */ + private Integer ageLevel3; + + /** + * 41-50岁的党员总人数 + */ + private Integer ageLevel4; + + /** + * 51-60岁的党员总人数 + */ + private Integer ageLevel5; + + /** + * 60+岁的党员总人数 + */ + private Integer ageLevel6; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerAgencyEntity.java new file mode 100644 index 0000000000..96b2e23dfe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerAgencyEntity.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.entity.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 generator generator@elink-cn.com + * @since v1.0.0 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_customer_agency") +public class ScreenCustomerAgencyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 组织id + */ + private String agencyId; + + /** + * 组织名称 + */ + private String agencyName; + + /** + * 父级id ,顶级,此列为0 + */ + private String pid; + + /** + * 所有上级ID,用逗号(英文)分开 + */ + private String pids; + + /** + * 所有组织名称以-链接 + */ + private String allParentNames; + + /** + * 坐标区域 + */ + private String areaMarks; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 党工委或者党委的位置,目前此阶段为预留字段 + */ + private String partyMark; + + /** + * 机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + + /** + * 行政地区编码 + */ + private String areaCode; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerDeptEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerDeptEntity.java new file mode 100644 index 0000000000..f020e44cd8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerDeptEntity.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.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 generator generator@elink-cn.com + * @since v1.0.0 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_customer_dept") +public class ScreenCustomerDeptEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 部门id + */ + private String deptId; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 部门所属组织id + */ + private String parentAgencyId; + + /** + * 坐标区域 + */ + private String areaMarks; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 部门所在位置(目前预留此字段) + */ + private String deptMark; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerGridEntity.java new file mode 100644 index 0000000000..99b6c99553 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenCustomerGridEntity.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.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 generator generator@elink-cn.com + * @since v1.0.0 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_customer_grid") +public class ScreenCustomerGridEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织名称 + */ + private String gridName; + + /** + * 网格所属组织id + */ + private String parentAgencyId; + + /** + * 坐标区域 + */ + private String areaMarks; + + /** + * 中心点位 + */ + private String centerMark; + + /** + * 党支部(=网格)的位置 + */ + private String partyMark; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java new file mode 100644 index 0000000000..845bbb7db0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java @@ -0,0 +1,130 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.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 generator generator@elink-cn.com + * @since v1.0.0 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_difficulty_data") +public class ScreenDifficultyDataEntity 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 eventId; + + /** + * 事件图片 + */ + private String eventImgUrl; + + /** + * 事件来源 XX街道-社区-网格 + */ + private String eventSource; + + /** + * 事件内容 + */ + private String eventContent; + + /** + * 事件耗时 单位:分钟 + */ + private Integer eventCostTime; + + /** + * 事件涉及部门数 + */ + private Integer eventReOrg; + + /** + * 事件被处理次数(08-21新增) + */ + private Integer eventHandledCount; + /** + * 事件类别编码 + */ + private String eventCategoryCode; + + /** + * 事件类别名称 + */ + private String eventCategoryName; + + /** + * 事件状态key + */ + private String eventStatusCode; + + /** + * 事件状态描述 + */ + private String eventStatusDesc; + + /** + * 最近一次操作说明 + */ + private String latestOperateDesc; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.java new file mode 100644 index 0000000000..e666f852b0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.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.entity.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 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_event_data") +public class ScreenEventDataEntity 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 eventId; + + /** + * 事件名称 + */ + private String eventTitle; + + /** + * 事件时间 + */ + private Date eventCreateTime; + + /** + * 联系人 联系人 + */ + private String linkMobile; + + /** + * 事件描述 + */ + private String eventContent; + + /** + * 事件图片 + */ + private String eventImgUrl; + + /** + * 事件待处理级别 red:红;yellow:黄;绿色:green + */ + private String eventLevel; + + /** + * 事件地址 + */ + private String eventAddress; + + /** + * 事件所在经度 + */ + private BigDecimal longitude; + + /** + * 事件所在维度 + */ + private BigDecimal latitude; + + /** + * 最后处理组织 + */ + private String lastProcessDept; + + /** + * 最后处理时间 + */ + private Date lastProcessDate; + + /** + * 事件状态key + */ + private String eventStatusCode; + + /** + * 事件状态描述 + */ + private String eventStatusDesc; + + /** + * 最近一次操作说明 + */ + private String latestOperateDesc; + + /** + * 数据更新至: yyyy|yyyMM|yyyyMMdd + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventImgDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventImgDataEntity.java new file mode 100644 index 0000000000..fb0e81290b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventImgDataEntity.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.entity.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 generator generator@elink-cn.com + * @since v1.0.0 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_event_img_data") +public class ScreenEventImgDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 原始事件Id + */ + private String eventId; + + /** + * 图片图片地址 + */ + private String eventImgUrl; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenGovernRankDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenGovernRankDataEntity.java new file mode 100644 index 0000000000..d280785a6c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenGovernRankDataEntity.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.entity.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 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_govern_rank_data") +public class ScreenGovernRankDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 月份Id + */ + private String monthId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 响应率 + */ + private BigDecimal responseRatio; + + /** + * 解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 自治率 + */ + private BigDecimal governRatio; + + /** + * 满意率 + */ + private BigDecimal satisfactionRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataMonthlyEntity.java new file mode 100644 index 0000000000..fbeb83ba9a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataMonthlyEntity.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.entity.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 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_index_data_monthly") +public class ScreenIndexDataMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id: yyyy + */ + private String yearId; + + /** + * 月份Id yyyyMM + */ + private String monthId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 总指数 + */ + private BigDecimal indexTotal; + + /** + * 党建能力指数 + */ + private BigDecimal partyDevAblity; + + /** + * 服务能力指数 + */ + private BigDecimal serviceAblity; + + /** + * 治理能力指数 + */ + private BigDecimal governAblity; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataYearlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataYearlyEntity.java new file mode 100644 index 0000000000..259947010d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataYearlyEntity.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.entity.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 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_index_data_yearly") +public class ScreenIndexDataYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id: yyyy + */ + private String yearId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 总指数 + */ + private BigDecimal indexTotal; + + /** + * 党建能力指数 + */ + private BigDecimal partyDevAblity; + + /** + * 服务能力指数 + */ + private BigDecimal serviceAblity; + + /** + * 治理能力指数 + */ + private BigDecimal governAblity; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenOrgRankDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenOrgRankDataEntity.java new file mode 100644 index 0000000000..a732eda4b9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenOrgRankDataEntity.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.entity.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 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_org_rank_data") +public class ScreenOrgRankDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 月份Id + */ + private String monthId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 党员总数 + */ + private Integer partyTotal; + + /** + * 小组(支部建设)总数 + */ + private Integer groupTotal; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 结案率 + */ + private BigDecimal closeProjectRatio; + + /** + * 满意率 + */ + private BigDecimal satisfactionRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyBranchDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyBranchDataEntity.java new file mode 100644 index 0000000000..cb870d2de7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyBranchDataEntity.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.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 generator generator@elink-cn.com + * @since v1.0.0 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_party_branch_data") +public class ScreenPartyBranchDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 月份Id + */ + private String monthId; + + /** + * 数据类别 :party:支部建设; union:联合建设;党员志愿服务:voluntaryservice + */ + private String type; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 会议分类Id + */ + private String meetCategoryId; + + /** + * 会议分类名称(三会党课、主题党日.....等等) + */ + private String meetCategoryName; + + /** + * 组织次数 + */ + private Integer organizeCount; + + /** + * 参加人数 + */ + private Integer joinUserCount; + + /** + * 平均参加人数 + */ + private Integer averageJoinUserCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyLinkMassesDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyLinkMassesDataEntity.java new file mode 100644 index 0000000000..c663fc770b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyLinkMassesDataEntity.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.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 generator generator@elink-cn.com + * @since v1.0.0 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_party_link_masses_data") +public class ScreenPartyLinkMassesDataEntity 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; + + /** + * 党员建群总数 + */ + private Integer createGroupTotal; + + /** + * 群成员总数 + */ + private Integer groupUserTotal; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyUserRankDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyUserRankDataEntity.java new file mode 100644 index 0000000000..702e184439 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPartyUserRankDataEntity.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.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 generator generator@elink-cn.com + * @since v1.0.0 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_party_user_rank_data") +public class ScreenPartyUserRankDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 组织名称 + */ + private String gridName; + + /** + * 网格所属的组织id + */ + private String orgId; + + /** + * 网格所属的组织名称 + */ + private String orgName; + + /** + * 是否是党员标志:1是。0不是党员 + */ + private Integer partyFlag; + + /** + * 用户Id + */ + private String userId; + + /** + * 姓 + */ + private String surname; + + /** + * 名 + */ + private String name; + + /** + * 姓名 + */ + private String userName; + + /** + * 用户积分 + */ + private Integer pointTotal; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPioneerDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPioneerDataEntity.java new file mode 100644 index 0000000000..b53561b229 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenPioneerDataEntity.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.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 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_pioneer_data") +public class ScreenPioneerDataEntity 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; + + /** + * 党员参与议事 + */ + private Integer issueTotal; + + /** + * 党员参与议事占比 + */ + private BigDecimal issueRatio; + + /** + * 党员发布话题 + */ + private Integer topicTotal; + + /** + * 党员发布话题占比 + */ + private BigDecimal topicRatio; + + /** + * 党员发布议题 + */ + private Integer publishIssueTotal; + + /** + * 党员发布议题占比 + */ + private BigDecimal publishIssueRatio; + + /** + * 议题转项目数 + */ + private Integer shiftProjectTotal; + + /** + * 议题转项目占比 + */ + private BigDecimal shiftProjectRatio; + + /** + * 解决项目总数 + */ + private Integer resolvedProjectTotal; + + /** + * 解决项目总数占比 + */ + private BigDecimal resolvedProjectRatio; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserJoinEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserJoinEntity.java new file mode 100644 index 0000000000..8a2009d9ca --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserJoinEntity.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.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 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_user_join") +public class ScreenUserJoinEntity 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: yyyy + */ + private String yearId; + + /** + * 数据更新至 :月份Id :yyyyMM + */ + private String monthId; + + /** + * 总的参与次数 + */ + private Integer joinTotal; + + /** + * 总的参与次数较上月增长率(采集的时候后台自己计算) + */ + private BigDecimal joinTotalUpRate; + + /** + * 增长:incr;下降:decr; 相等 :eq + */ + private String joinTotalUpFlag; + + /** + * 人均议题 + */ + private Integer avgIssue; + + /** + * 人均议题较上月增长率(采集的时候后台自己计算) + */ + private BigDecimal avgIssueUpRate; + + /** + * 增长:incr;下降:decr; 相等 :eq + */ + private String avgIssueUpFlag; + + /** + * 平均参与度 + */ + private Integer avgJoin; + + /** + * 平均参与度较上月增长率(采集的时候后台自己计算) + */ + private BigDecimal agvgJoinUpRate; + + /** + * 增长:incr;下降:decr; 相等 :eq + */ + private String agvgJoinUpFlag; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserTotalDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserTotalDataEntity.java new file mode 100644 index 0000000000..a58f257cc6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenUserTotalDataEntity.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.entity.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 generator generator@elink-cn.com + * @since v1.0.0 2020-08-21 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_user_total_data") +public class ScreenUserTotalDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;网格:grid;部门:department; + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称,也可能是网格名称 + */ + private String orgName; + + /** + * 数据更新至: yyyy|yyyyMM|yyyyMMdd(08-21新增) + */ + private String dataEndTime; + + /** + * 用户总数 + */ + private Integer userTotal; + + /** + * 注册党总数 + */ + private Integer partyTotal; + + /** + * 小组(党群)总数 + */ + private Integer groupTotal; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 注册人数(08-21新增) + */ + private Integer regUserTotal; + + /** + * 参与人数(08-21新增) + */ + private Integer joinUserTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java new file mode 100644 index 0000000000..76f0897890 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java @@ -0,0 +1,272 @@ +package com.epmet.model; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.UniqueIdGenerator; +import com.epmet.entity.screen.IndexDictEntity; +import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; +import com.epmet.entity.screen.IndexGroupTemplateEntity; +import com.epmet.service.screen.IndexDictService; +import com.epmet.service.screen.IndexGroupDetailTemplateService; +import com.epmet.service.screen.IndexGroupTemplateService; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Collectors; + +/** + * 读取转换异常 + * + * @author Jiaju Zhuang + */ +public class IndexExcelDataListener extends AnalysisEventListener { + private static final Logger LOGGER = LoggerFactory.getLogger(IndexExcelDataListener.class); + /** + * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 + */ + private static volatile boolean isGroup = false; + ; + AtomicInteger total = new AtomicInteger(0); + Map indexDicMap = new HashMap<>(); + Map indexGroupMap = new HashMap<>(); + Map indexGroupDetailMap = new HashMap<>(); + List indexModelList = new ArrayList<>(); + private String preWheight; + + private Integer wheightSum = 0; + /** + * 假设这个是一个DAO,当然有业务逻辑这个也可以是一个service。当然如果不用存储这个对象没用。 + */ + private IndexDictService indexDictService; + + private IndexGroupTemplateService indexGroupTemplateService; + + private IndexGroupDetailTemplateService indexGroupDetailTemplateService; + + + /** + * 如果使用了spring,请使用这个构造方法。每次创建Listener的时候需要把spring管理的类传进来 + * + * @param indexDictService + */ + public IndexExcelDataListener(IndexDictService indexDictService, IndexGroupTemplateService indexGroupTemplateService, IndexGroupDetailTemplateService indexGroupDetailTemplateService) { + this.indexDictService = indexDictService; + this.indexGroupTemplateService = indexGroupTemplateService; + this.indexGroupDetailTemplateService = indexGroupDetailTemplateService; + } + + /** + * 这个每一条数据解析都会来调用 + * + * @param data one row value. Is is same as {@link AnalysisContext#readRowHolder()} + * @param context + */ + @Override + public void invoke(IndexModel data, AnalysisContext context) { + if (data == null || data.getIsUsed() == null || data.getIsUsed() != 1) { + return; + } + + //合并单元格的 权重 处理 + String weight = data.getWeight(); + if (StringUtils.isNotBlank(weight)) { + weight = weight.replace("%", ""); + data.setWeight(weight); + preWheight = data.getWeight(); + } else { + data.setWeight(preWheight); + } + LOGGER.info("解析到一条数据:{}", JSON.toJSONString(data)); + + IndexDictEntity entity = new IndexDictEntity(); + IndexDictEntity entity2 = new IndexDictEntity(); + IndexDictEntity entity3 = new IndexDictEntity(); + IndexDictEntity entity4 = new IndexDictEntity(); + IndexDictEntity entity5 = new IndexDictEntity(); + + indexModelList.add(data); + buildIndexDicEntity(data, entity, entity2, entity3, entity4, entity5); + + buildIndexGroupEntity(); + + total.addAndGet(1); + + + // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM + /*if (isGroup) { + saveData(); + // 存储完成清理 list + list.clear(); + }*/ + } + + private void buildIndexGroupEntity() { + List collect = indexModelList.stream().sorted(Comparator.comparing(IndexModel::getLevel1Index)).collect(Collectors.toList()); + collect.forEach(index -> { + if (index.getLevel1Index().equals("党员相关")) { + IndexDictEntity indexDictEntity = indexDicMap.get(index.getLevel1Index()); + String level1GroupId = UniqueIdGenerator.generate(); + IndexGroupTemplateEntity group1 = indexGroupMap.get(index.getLevel1Index()); + if (group1 == null) { + group1 = new IndexGroupTemplateEntity(); + group1.setIndexId(indexDictEntity.getId()); + group1.setParentIndexGroupId("0"); + group1.setId(level1GroupId); + indexGroupMap.put(index.getLevel1Index(), group1); + } + + String level4Index = index.getLevel4Index(); + indexDictEntity = indexDicMap.get(level4Index); + String level2GroupId = UniqueIdGenerator.generate(); + + IndexGroupTemplateEntity group2 = indexGroupMap.get(level4Index); + IndexGroupDetailTemplateEntity templateEntity = null; + if (group2 == null) { + group2 = new IndexGroupTemplateEntity(); + group2.setIndexId(indexDictEntity.getId()); + group2.setParentIndexGroupId(level1GroupId); + group2.setId(level2GroupId); + indexGroupMap.put(level4Index, group2); + //构建 分组明细 + templateEntity = indexGroupDetailMap.get(level4Index); + if (templateEntity == null) { + buildIndexGroupDetail(indexDictEntity, index, group1.getId(), 2); + } + } + indexDictEntity = indexDicMap.get(index.getLevel5Index()); + + templateEntity = indexGroupDetailMap.get(index.getLevel5Index()); + if (templateEntity == null) { + buildIndexGroupDetail(indexDictEntity, index, group2.getId(), 5); + } + } else { + //todo 测试完去掉 + //if ("街道相关".equals(index.getLevel1Index())) { + IndexDictEntity indexDictEntity = indexDicMap.get(index.getLevel1Index()); + String level1GroupId = UniqueIdGenerator.generate(); + IndexGroupTemplateEntity group1 = indexGroupMap.get(index.getLevel1Index()); + if (group1 == null) { + group1 = new IndexGroupTemplateEntity(); + group1.setIndexId(indexDictEntity.getId()); + group1.setParentIndexGroupId("0"); + group1.setId(level1GroupId); + indexGroupMap.put(index.getLevel1Index(), group1); + } + + String level2Index = index.getLevel2Index(); + indexDictEntity = indexDicMap.get(level2Index); + String level2GroupId = UniqueIdGenerator.generate(); + + IndexGroupTemplateEntity group2 = indexGroupMap.get(level2Index); + IndexGroupDetailTemplateEntity templateEntity = null; + if (group2 == null) { + group2 = new IndexGroupTemplateEntity(); + group2.setIndexId(indexDictEntity.getId()); + group2.setParentIndexGroupId(level1GroupId); + group2.setId(level2GroupId); + indexGroupMap.put(level2Index, group2); + //构建 分组明细 + templateEntity = indexGroupDetailMap.get(level2Index); + if (templateEntity == null) { + buildIndexGroupDetail(indexDictEntity, index, group1.getId(), 2); + } + } + indexDictEntity = indexDicMap.get(index.getLevel5Index()); + + templateEntity = indexGroupDetailMap.get(index.getLevel5Index()); + if (templateEntity == null) { + buildIndexGroupDetail(indexDictEntity, index, group2.getId(), 5); + } + } + //} + }); + LOGGER.info("所有指标分组数据解析完成:{}", JSON.toJSONString(indexGroupMap.values())); + LOGGER.info("所有指标分组明细数据解析完成:{}", JSON.toJSONString(indexGroupDetailMap.values())); + } + + private void buildIndexGroupDetail(IndexDictEntity indexDictEntity, IndexModel index, String groupId, Integer level) { + IndexGroupDetailTemplateEntity templateEntity; + templateEntity = new IndexGroupDetailTemplateEntity(); + templateEntity.setIndexGroupId(groupId); + templateEntity.setIndexId(indexDictEntity.getId()); + + if (level == 5) { + String level5WeightStr = index.getLevel5Weight().replace("%", ""); + templateEntity.setWeight(new BigDecimal(level5WeightStr).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); + indexGroupDetailMap.put(index.getLevel5Index(), templateEntity); + } else { + indexGroupDetailMap.put(indexDictEntity.getIndexName(), templateEntity); + templateEntity.setWeight(new BigDecimal(index.getWeight()).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); + } + templateEntity.setId(UniqueIdGenerator.generate()); + if (StringUtils.isNotBlank(index.getThreshold())) { + String thresholdStr = index.getThreshold().replace("%", ""); + templateEntity.setThreshold(new BigDecimal(thresholdStr).divide(new BigDecimal(100), 4, RoundingMode.HALF_UP)); + } + } + + private void buildIndexDicEntity(IndexModel data, IndexDictEntity entity, IndexDictEntity entity2, IndexDictEntity entity3, IndexDictEntity entity4, IndexDictEntity entity5) { + if (!indexDicMap.containsKey(data.getLevel1Index())) { + entity.setId(UniqueIdGenerator.generate()); + entity.setIndexName(data.getLevel1Index()); + entity.setLevel("1"); + indexDicMap.put(data.getLevel1Index(), entity); + } + if (!indexDicMap.containsKey(data.getLevel2Index())) { + entity2.setId(UniqueIdGenerator.generate()); + entity2.setIndexName(data.getLevel2Index()); + entity2.setLevel("2"); + indexDicMap.put(data.getLevel2Index(), entity2); + } + if (!indexDicMap.containsKey(data.getLevel3Index())) { + entity3.setId(UniqueIdGenerator.generate()); + entity3.setIndexName(data.getLevel3Index()); + entity3.setLevel("3"); + indexDicMap.put(data.getLevel3Index(), entity3); + } + if (!indexDicMap.containsKey(data.getLevel4Index())) { + entity4.setId(UniqueIdGenerator.generate()); + entity4.setIndexName(data.getLevel4Index()); + entity4.setLevel("4"); + indexDicMap.put(data.getLevel4Index(), entity4); + } + if (!indexDicMap.containsKey(data.getLevel5Index())) { + entity5.setId(UniqueIdGenerator.generate()); + entity5.setIndexName(data.getLevel5Index()); + entity5.setLevel("5"); + indexDicMap.put(data.getLevel5Index(), entity5); + } + } + + /** + * 所有数据解析完成了 都会来调用 + * + * @param context + */ + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + // 这里也要保存数据,确保最后遗留的数据也存储到数据库 + saveData(); + LOGGER.info("所有数据解析完成!total:{}", total.intValue()); + } + + /** + * 加上存储数据库 + */ + private void saveData() { + LOGGER.info("{}条数据,开始存储数据库!", indexDicMap.size()); + indexDictService.deleteAndInsertBatch(indexDicMap.values()); + + buildIndexGroupEntity(); + + indexGroupTemplateService.deleteAndInsertBatch(indexGroupMap.values()); + indexGroupDetailTemplateService.deleteAndInsertBatch(indexGroupDetailMap.values()); + LOGGER.info("存储数据库成功!指标:{}个,分组:{}个,详情:{}个", indexDicMap.values().size(), indexGroupMap.values().size(), indexGroupDetailMap.values().size()); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java new file mode 100644 index 0000000000..f264a2c39e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexModel.java @@ -0,0 +1,26 @@ +package com.epmet.model; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Data; + +@Data +public class IndexModel { + @ExcelProperty(value = "一级指标") + private String level1Index; + @ExcelProperty(value = "二级指标") + private String level2Index; + @ExcelProperty(value = "三级指标") + private String level3Index; + @ExcelProperty(value = "四级指标") + private String level4Index; + @ExcelProperty(value = "五级指标") + private String level5Index; + @ExcelProperty(value = "是否采用") + private Integer isUsed; + @ExcelProperty(value = "权重") + private String weight; + @ExcelProperty(value = "五级权重") + private String level5Weight; + @ExcelProperty(value = "阈值") + private String threshold; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/ParseIndexExcelResult.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/ParseIndexExcelResult.java new file mode 100644 index 0000000000..17b4fa0634 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/ParseIndexExcelResult.java @@ -0,0 +1,54 @@ +package com.epmet.model; + +import lombok.Data; + +import java.io.Serializable; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; + +@Data +public class ParseIndexExcelResult implements Serializable { + private String id; + private String groupId; + /** + * 当前指标关联的上一级指标分组,如果没有上一级,则为0 + */ + private String parentIndexGroupId; + /** + * 指标编码(唯一) + */ + private String indexCode; + + /** + * 指标名 + */ + private String indexName; + + /** + * 指标描述 + */ + private String indexDesc; + + /** + * 指标级别(1,2,3,4,5) + */ + private String level; + + private Set children = new HashSet<>(); + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ParseIndexExcelResult that = (ParseIndexExcelResult) o; + return indexCode.equals(that.indexCode) && + indexName.equals(that.indexName) && + level.equals(that.level); + } + + @Override + public int hashCode() { + return Objects.hash(indexCode, indexName, indexDesc, level); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/FactIndexCollectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/FactIndexCollectService.java new file mode 100644 index 0000000000..c9d876996b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/FactIndexCollectService.java @@ -0,0 +1,110 @@ +package com.epmet.service.indexcollect; + +import com.epmet.dto.indexcollect.form.*; + +import java.util.List; + +/** + * 大屏数据采集api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:25 + */ +public interface FactIndexCollectService { + + /** + * 1、党建能力-党员相关指标上报(按照月份) + * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、USER_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertGridPartyMemberData(List formDTO, String customerId); + + /** + * 2、党建能力-网格相关指标上报(按照月份) + * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertGridPartyAbility(List formDTO, String customerId); + + /** + * 3、党建能力-街道及社区相关指标 + * 根据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertOrgPartyAbility(List formDTO, String customerId); + + /** + * 4、服务能力-网格相关指标 + * 据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertGridServiceAbility(List formDTO, String customerId); + + /** + * 5、服务能力-组织(街道|社区|全区)相关指标 + * 据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertOrgServiceAbility(List formDTO, String customerId); + + /** + * 6、治理能力-网格相关指标 + * 据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertGridGovrnAbility(List formDTO, String customerId); + + /** + * 7、治理能力-街道及社区相关指标 + * 据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertOrgGovrnAbility(List formDTO, String customerId); + + /** + * 8、治理能力-部门相关指标 + * 据CUSTOMER_ID、AGENCY_ID、DEPT_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-20 + **/ + void insertDeptGovrnAbility(List formDTO, String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/impl/FactIndexCollectServiceImpl.java new file mode 100644 index 0000000000..cd767ff580 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcollect/impl/FactIndexCollectServiceImpl.java @@ -0,0 +1,162 @@ +package com.epmet.service.indexcollect.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.indexcoll.*; +import com.epmet.dto.indexcollect.form.*; +import com.epmet.service.indexcollect.FactIndexCollectService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * @Auther: zhangyong + * @Date: 2020-08-20 10:05 + */ +@Service +public class FactIndexCollectServiceImpl implements FactIndexCollectService { + + @Autowired + private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; + @Autowired + private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao; + @Autowired + private FactIndexPartyAblityOrgMonthlyDao factIndexPartyAblityOrgMonthlyDao; + @Autowired + private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; + @Autowired + private FactIndexServiceAblityOrgMonthlyDao factIndexServiceAblityOrgMonthlyDao; + @Autowired + private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao; + @Autowired + private FactIndexGovrnAblityOrgMonthlyDao factIndexGovrnAblityOrgMonthlyDao; + @Autowired + private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGridPartyMemberData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, + formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getUserId(), + formDTO.get(i).getYearId(), formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); + } + factIndexPartyAblityCpcMonthlyDao.batchInsertFactIndexPartyAblityCpcMonthly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGridPartyAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + factIndexPartyAblityGridMonthlyDao.deleteFactIndexPartyAblityGridMonthly(customerId, + formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), + formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); + } + factIndexPartyAblityGridMonthlyDao.batchInsertFactIndexPartyAblityGridMonthly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertOrgPartyAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] agencyIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + agencyIds[i] = formDTO.get(i).getAgencyId(); + } + factIndexPartyAblityOrgMonthlyDao.deleteFactIndexPartyAblityOrgMonthly(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + formDTO.get(NumConstant.ZERO).getQuarterId(), + agencyIds); + factIndexPartyAblityOrgMonthlyDao.batchInsertFactIndexPartyAblityOrgMonthly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGridServiceAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + factIndexServiceAblityGridMonthlyDao.deleteFactIndexServiceAblityGridMonthly(customerId, + formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), + formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); + } + factIndexServiceAblityGridMonthlyDao.batchInsertFactIndexServiceAblityGridMonthly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertOrgServiceAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] agencyIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + agencyIds[i] = formDTO.get(i).getAgencyId(); + } + factIndexServiceAblityOrgMonthlyDao.deleteFactIndexServiceAblityOrgMonthly(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + formDTO.get(NumConstant.ZERO).getQuarterId(), + agencyIds); + factIndexServiceAblityOrgMonthlyDao.batchInsertFactIndexServiceAblityOrgMonthly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGridGovrnAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + factIndexGovrnAblityGridMonthlyDao.deleteFactIndexGovrnAblityGridMonthly(customerId, + formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), + formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); + } + factIndexGovrnAblityGridMonthlyDao.batchInsertFactIndexGovrnAblityGridMonthly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertOrgGovrnAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] agencyIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + agencyIds[i] = formDTO.get(i).getAgencyId(); + } + factIndexGovrnAblityOrgMonthlyDao.deleteFactIndexGovrnAblityOrgMonthly(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + formDTO.get(NumConstant.ZERO).getQuarterId(), + agencyIds); + factIndexGovrnAblityOrgMonthlyDao.batchInsertFactIndexGovrnAblityOrgMonthly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertDeptGovrnAbility(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + factIndexGovrnAblityDeptMonthlyDao.deleteFactIndexGovrnAblityDeptMonthly(customerId, + formDTO.get(i).getAgencyId(), formDTO.get(i).getDeptId(), formDTO.get(i).getYearId(), + formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); + } + factIndexGovrnAblityDeptMonthlyDao.batchInsertFactIndexGovrnAblityDeptMonthly(formDTO, customerId); + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateService.java new file mode 100644 index 0000000000..a43dcc2907 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexCalculateService.java @@ -0,0 +1,17 @@ +package com.epmet.service.screen; + +import com.epmet.dto.screen.form.IndexCalculateForm; + +/** + * 指标计算service + * + * @author liujianjun@elink-cn.com + * @date 2020/8/18 10:25 + */ +public interface IndexCalculateService { + /** + * desc:计算党员相关指标 + * @param formDTO + */ + void cpcIndexCalculate(IndexCalculateForm formDTO); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexDictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexDictService.java new file mode 100644 index 0000000000..9e3b4f83ed --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexDictService.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.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.screen.IndexDictEntity; + +import java.util.Collection; + +/** + * 评价指标字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +public interface IndexDictService extends BaseService { + + Boolean deleteAndInsertBatch(Collection values); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java new file mode 100644 index 0000000000..ea03e298a1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.screen.IndexGroupDetailEntity; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +public interface IndexGroupDetailService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailTemplateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailTemplateService.java new file mode 100644 index 0000000000..3b0c48f7f9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupDetailTemplateService.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.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; + +import java.util.Collection; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +public interface IndexGroupDetailTemplateService extends BaseService { + + Boolean deleteAndInsertBatch(Collection values); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupService.java new file mode 100644 index 0000000000..88c66b3da6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupService.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.service.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.screen.IndexGroupEntity; + +/** + * 客户指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +public interface IndexGroupService extends BaseService { + + Boolean initCustomerIndexGroup(String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupTemplateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupTemplateService.java new file mode 100644 index 0000000000..1f23716176 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/IndexGroupTemplateService.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.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.screen.IndexGroupTemplateEntity; + +import java.util.Collection; + +/** + * 默认指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +public interface IndexGroupTemplateService extends BaseService { + + Boolean deleteAndInsertBatch(Collection values); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java new file mode 100644 index 0000000000..e81e4497c3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java @@ -0,0 +1,221 @@ +package com.epmet.service.screen; + +import com.epmet.dto.screencoll.form.*; + +import java.util.List; +/** + * 大屏数据采集api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:25 + */ +public interface ScreenCollService { + + /** + * 9、党建引领|基层治理-居民(党员)积分排行榜 + * 1) 根据CUSTOMER_ID、GRID_ID、USER_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertPartyUserRankData(List formDTO, String customerId); + + /** + * 8、党建引领-党员联系群众数据 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertPartyLinkMassesData(List formDTO, String customerId); + + /** + * 7、基层党建-建设情况数据(支部、联建、志愿) + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertPartyBranchData(List formDTO, String customerId); + + /** + * 6、党建引领-组织排行 + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertOrgRankData(List formDTO, String customerId); + + /** + * 5、基层治理-治理能力数据 + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertGovernRankData(List formDTO, String customerId); + + /** + * 4、事件数据 + * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertEventData(List formDTO, String customerId); + + /** + * 3、难点赌点 + * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertDifficultyData(List formDTO, String customerId); + + /** + * 2、党员基本情况 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertCpcbaseData(List formDTO, String customerId); + + /** + * 1、指数_按月统计 + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertIndexDataMonthly(List formDTO, String customerId); + + /** + * 17、指数_按年统计 + * 1) 根据CUSTOMER_ID、YEAR_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertIndexDataYearly(List formDTO, String customerId); + + /** + * 16、部门信息上传 + * 1) 根据CUSTOMER_ID、DEPT_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertCustomerDept(List formDTO, String customerId); + + /** + * 15、网格信息上传 + * 1) 根据CUSTOMER_ID、GRID_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertCustomerGrid(List formDTO, String customerId); + + /** + * 14、组织层级 + * 1) 根据CUSTOMER_ID、AGENCY_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertCustomerAgency(List formDTO, String customerId); + + /** + * 12、中央区各类总数 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertUserTotalData(List formDTO, String customerId); + + /** + * 11、基层治理-公众参与 + * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertUserJoin(List formDTO, String customerId); + + /** + * 10、党建引领-先锋模范数据 + * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertPioneerData(List formDTO, String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java new file mode 100644 index 0000000000..7aff662edf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexCalculateServiceImpl.java @@ -0,0 +1,16 @@ +package com.epmet.service.screen.impl; + +import com.epmet.dto.screen.form.IndexCalculateForm; +import com.epmet.service.screen.IndexCalculateService; +import org.springframework.stereotype.Service; + +/** + * @author liujianjun + */ +@Service +public class IndexCalculateServiceImpl implements IndexCalculateService { + @Override + public void cpcIndexCalculate(IndexCalculateForm formDTO) { + + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexDictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexDictServiceImpl.java new file mode 100644 index 0000000000..16e4815226 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexDictServiceImpl.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.screen.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.screen.IndexDictDao; +import com.epmet.entity.screen.IndexDictEntity; +import com.epmet.service.screen.IndexDictService; +import org.springframework.stereotype.Service; + +import java.util.Collection; + +/** + * 评价指标字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Service +public class IndexDictServiceImpl extends BaseServiceImpl implements IndexDictService { + + + @Override + public Boolean deleteAndInsertBatch(Collection values) { + int n = baseDao.deleteAll(); + return this.insertBatch(values,10); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.java new file mode 100644 index 0000000000..db9fe1f411 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailServiceImpl.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.service.screen.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.screen.IndexGroupDetailDao; +import com.epmet.entity.screen.IndexGroupDetailEntity; +import com.epmet.service.screen.IndexGroupDetailService; +import org.springframework.stereotype.Service; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Service +public class IndexGroupDetailServiceImpl extends BaseServiceImpl implements IndexGroupDetailService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailTemplateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailTemplateServiceImpl.java new file mode 100644 index 0000000000..081f94ef3c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupDetailTemplateServiceImpl.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.screen.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.screen.IndexGroupDetailTemplateDao; +import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; +import com.epmet.service.screen.IndexGroupDetailTemplateService; +import org.springframework.stereotype.Service; + +import java.util.Collection; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Service +public class IndexGroupDetailTemplateServiceImpl extends BaseServiceImpl implements IndexGroupDetailTemplateService { + + @Override + public Boolean deleteAndInsertBatch(Collection values) { + baseDao.deleteAll(); + return this.insertBatch(values, 10); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.java new file mode 100644 index 0000000000..65fc39f131 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupServiceImpl.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.service.screen.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.UniqueIdGenerator; +import com.epmet.dao.screen.IndexGroupDao; +import com.epmet.dao.screen.IndexGroupDetailDao; +import com.epmet.dao.screen.IndexGroupDetailTemplateDao; +import com.epmet.dao.screen.IndexGroupTemplateDao; +import com.epmet.entity.screen.IndexGroupDetailEntity; +import com.epmet.entity.screen.IndexGroupDetailTemplateEntity; +import com.epmet.entity.screen.IndexGroupEntity; +import com.epmet.entity.screen.IndexGroupTemplateEntity; +import com.epmet.service.screen.IndexGroupService; +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; +import java.util.stream.Collectors; + +/** + * 客户指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Service +public class IndexGroupServiceImpl extends BaseServiceImpl implements IndexGroupService { +@Autowired +private IndexGroupTemplateDao indexGroupTemplateDao; + @Autowired + private IndexGroupDetailTemplateDao indexGroupDetailTemplateDao; + + @Autowired + private IndexGroupDetailDao indexGroupDetailDao; + + @Transactional(rollbackFor = Exception.class) + @Override + public Boolean initCustomerIndexGroup(String customerId) { + List groupTempList = indexGroupTemplateDao.selectAll(); + List groupDetailTempList = indexGroupDetailTemplateDao.selectAll(); + if (CollectionUtils.isEmpty(groupTempList) || CollectionUtils.isEmpty(groupDetailTempList)){ + throw new RenException("没有需要初始化的数据"); + } + List groupEntityList = groupTempList.stream().map(groupTemp -> { + IndexGroupEntity entity = ConvertUtils.sourceToTarget(groupTemp, IndexGroupEntity.class); + entity.setId(UniqueIdGenerator.generate()); + entity.setCustomerId(customerId); + return entity; + }).collect(Collectors.toList()); + this.insertBatch(groupEntityList,10); + + List groupTempEntityList = groupDetailTempList.stream().map(groupTemp -> { + IndexGroupDetailEntity entity = ConvertUtils.sourceToTarget(groupTemp, IndexGroupDetailEntity.class); + entity.setId(UniqueIdGenerator.generate()); + entity.setCustomerId(customerId); + return entity; + }).collect(Collectors.toList()); + groupTempEntityList.forEach(o->{ + indexGroupDetailDao.insert(o); + }); + return true; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupTemplateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupTemplateServiceImpl.java new file mode 100644 index 0000000000..058cf911eb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/IndexGroupTemplateServiceImpl.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.screen.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.screen.IndexGroupTemplateDao; +import com.epmet.entity.screen.IndexGroupTemplateEntity; +import com.epmet.service.screen.IndexGroupTemplateService; +import org.springframework.stereotype.Service; + +import java.util.Collection; + +/** + * 客户指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Service +public class IndexGroupTemplateServiceImpl extends BaseServiceImpl implements IndexGroupTemplateService { + + @Override + public Boolean deleteAndInsertBatch(Collection values) { + + baseDao.deleteAll(); + return this.insertBatch(values, 10); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java new file mode 100644 index 0000000000..b5e65fd193 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java @@ -0,0 +1,448 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.screen.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.commons.tools.utils.Result; +import com.epmet.constant.CompareConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.screen.*; +import com.epmet.dto.screencoll.form.*; +import com.epmet.entity.screen.ScreenEventImgDataEntity; +import com.epmet.entity.screen.ScreenUserJoinEntity; +import com.epmet.service.screen.ScreenCollService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +/** + * 大屏数据采集 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Service +public class ScreenCollServiceImpl implements ScreenCollService { + + @Autowired + private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + @Autowired + private ScreenPartyLinkMassesDataDao screenPartyLinkMassesDataDao; + @Autowired + private ScreenPartyBranchDataDao screenPartyBranchDataDao; + @Autowired + private ScreenOrgRankDataDao screenOrgRankDataDao; + @Autowired + private ScreenGovernRankDataDao screenGovernRankDataDao; + @Autowired + private ScreenEventDataDao screenEventDataDao; + @Autowired + private ScreenEventImgDataDao screenEventImgDataDao; + @Autowired + private ScreenDifficultyDataDao screenDifficultyDataDao; + @Autowired + private ScreenCpcBaseDataDao screenCpcBaseDataDao; + @Autowired + private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; + @Autowired + private ScreenCustomerDeptDao screenCustomerDeptDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + @Autowired + private ScreenUserTotalDataDao screenUserTotalDataDao; + @Autowired + private ScreenUserJoinDao screenUserJoinDao; + @Autowired + private ScreenPioneerDataDao screenPioneerDataDao; + @Autowired + private ScreenIndexDataYearlyDao screenIndexDataYearlyDao; + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPartyUserRankData(List formDTO,String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + screenPartyUserRankDataDao.deletePartyUserRankData(customerId, + formDTO.get(NumConstant.ZERO).getGridId(), + formDTO.get(NumConstant.ZERO).getUserId()); + } + + screenPartyUserRankDataDao.batchInsertPartyUserRankData(formDTO,customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPartyLinkMassesData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenPartyLinkMassesDataDao.deletePartyLinkMassesData(customerId, orgIds); + + screenPartyLinkMassesDataDao.batchInsertPartyLinkMassesData(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPartyBranchData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenPartyBranchDataDao.deletePartyBranchData(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + orgIds); + + screenPartyBranchDataDao.batchInsertPartyBranchData(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertOrgRankData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenOrgRankDataDao.deleteOrgRankData(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + orgIds); + + screenOrgRankDataDao.batchInsertOrgRankData(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGovernRankData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenGovernRankDataDao.deleteGovernRankData(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + orgIds); + + screenGovernRankDataDao.batchInsertGovernRankData(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertEventData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + screenEventDataDao.deleteEventData(customerId, formDTO.get(i).getEventId(), formDTO.get(i).getOrgId()); + } + + screenEventDataDao.batchInsertEventData(formDTO, customerId); + + for (int i = NumConstant.ZERO; i < formDTO.size(); i++) { + if (null != formDTO.get(i).getImgDataList() && formDTO.get(i).getImgDataList().size() > NumConstant.ZERO) { + // 根据原始事件ID,物理删除 - 事件数据图片数据 + screenEventImgDataDao.delEventImgDataByEventId(formDTO.get(i).getEventId()); + for (int j = NumConstant.ZERO; j < formDTO.get(i).getImgDataList().size(); j++){ + // 新增 中央区-事件数据图片数据 表 + ScreenEventImgDataEntity imgDataEntity = new ScreenEventImgDataEntity(); + imgDataEntity.setEventId(formDTO.get(i).getImgDataList().get(j).getEventId()); + imgDataEntity.setEventImgUrl(formDTO.get(i).getImgDataList().get(j).getImgUrl()); + imgDataEntity.setSort(formDTO.get(i).getImgDataList().get(j).getSort()); + screenEventImgDataDao.insert(imgDataEntity); + } + } + } + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertDifficultyData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + screenDifficultyDataDao.deleteDifficultyData(customerId, formDTO.get(i).getEventId(), formDTO.get(i).getOrgId()); + } + + screenDifficultyDataDao.batchInsertDifficultyData(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCpcbaseData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenCpcBaseDataDao.deleteCpcBaseData(customerId, orgIds); + + screenCpcBaseDataDao.batchInsertCpcBaseData(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertIndexDataMonthly(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + orgIds); + + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertIndexDataYearly(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + orgIds); + + screenIndexDataYearlyDao.batchInsertIndexDataYearly(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCustomerDept(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] deptIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + deptIds[i] = formDTO.get(i).getDeptId(); + } + screenCustomerDeptDao.deleteCustomerDept(customerId, deptIds); + + screenCustomerDeptDao.batchInsertCustomerDept(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCustomerGrid(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] gridIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + gridIds[i] = formDTO.get(i).getGridId(); + } + screenCustomerGridDao.deleteCustomerGrid(customerId, gridIds); + + screenCustomerGridDao.batchInsertCustomerGrid(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCustomerAgency(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] agencyIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + agencyIds[i] = formDTO.get(i).getAgencyId(); + } + screenCustomerAgencyDao.deleteCustomerAgency(customerId, agencyIds); + + screenCustomerAgencyDao.batchInsertCustomerAgency(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertUserTotalData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenUserTotalDataDao.deleteUserTotalData(customerId, orgIds); + + screenUserTotalDataDao.batchInsertUserTotalData(formDTO, customerId); + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertUserJoin(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenUserJoinDao.deleteUserJoin(customerId, + formDTO.get(NumConstant.ZERO).getYearId(), + formDTO.get(NumConstant.ZERO).getMonthId(), + orgIds); + + String[] lastMonth = this.lastMonthDate(); + // 获取上个月的基本数据 + List lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, + lastMonth[NumConstant.ZERO], + lastMonth[NumConstant.ONE], + orgIds); + + // 定义本月待添加数据的集合 + List curMonthJoinEntityList = new ArrayList<>(); + // 增加率计算 + if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO){ + // 存在上个月的数据 (本月-上月)/上月 *100 + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++){ + if (formDTO.get(i).getOrgId().equals(lastMonthJoinList.get(j).getOrgId())){ + ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.get(i), ScreenUserJoinEntity.class); + entity.setJoinTotalUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getJoinTotal(), formDTO.get(j).getJoinTotal())); + entity.setJoinTotalUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getJoinTotal(), formDTO.get(j).getJoinTotal())); + entity.setAvgIssueUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgIssue(), formDTO.get(j).getAvgIssue())); + entity.setAvgIssueUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgIssue(), formDTO.get(j).getAvgIssue())); + entity.setAgvgJoinUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgJoin(), formDTO.get(j).getAvgJoin())); + entity.setAgvgJoinUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgJoin(), formDTO.get(j).getAvgJoin())); + curMonthJoinEntityList.add(entity); + } + } + } + } else { + // 计算增长率后的 待新增数据 + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + // 不存在上个月的数据 + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.get(i), ScreenUserJoinEntity.class); + entity.setJoinTotalUpRate(zero); + entity.setJoinTotalUpFlag(""); + entity.setAvgIssueUpRate(zero); + entity.setAvgIssueUpFlag(""); + entity.setAgvgJoinUpRate(zero); + entity.setAgvgJoinUpFlag(""); + curMonthJoinEntityList.add(entity); + } + } + screenUserJoinDao.batchInsertUserJoin(curMonthJoinEntityList, customerId); + } + } + + /** + * 获取当前日期的前一个月的日期 + * @param + * @return java.lang.String[] + * @Author zhangyong + * @Date 15:33 2020-08-21 + **/ + private String[] lastMonthDate(){ + String[] date = new String[NumConstant.TWO]; + //Java获取当前日期的前一个月的日期 + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.MONTH, NumConstant.ONE_NEG); + int year = calendar.get(Calendar.YEAR); + int month = calendar.get(Calendar.MONTH) + NumConstant.ONE; + date[NumConstant.ZERO] = String.valueOf(year); + date[NumConstant.ONE] = String.valueOf(month);; + if (NumConstant.TEN >= month){ + date[NumConstant.ONE] = NumConstant.ZERO_STR + month; + } + return date; + } + + /** + * 计算 本月数值 相较于 上月数值,的增长率 + * + * @param old 上月数值 + * @param now 本月数值 + * @return java.math.BigDecimal + * @Author zhangyong + * @Date 15:38 2020-08-21 + **/ + private BigDecimal calculateGrowthRateNumber(Integer old, Integer now){ + BigDecimal bignum1 = new BigDecimal((now - old) * NumConstant.ONE_HUNDRED); + BigDecimal bignum2 = bignum1.divide(new BigDecimal(old),2,BigDecimal.ROUND_HALF_UP); + return bignum2; + } + + /** + * 计算 本月数值 相较于 上月数值,的增长率, 得出标识 + * + * @param old 上月数值 + * @param now 本月数值 + * @return java.util.String + * @Author zhangyong + * @Date 15:38 2020-08-21 + **/ + private String calculateGrowthRateFlag(Integer old, Integer now){ + if (old > now){ + return CompareConstant.DECR_STR; + } else if (old < now){ + return CompareConstant.INCR_STR; + } else { + return CompareConstant.EQ_STR; + } + } + + @DataSource(value = DataSourceConstant.STATS, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPioneerData(List formDTO, String customerId) { + if (null != formDTO && formDTO.size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.size()]; + for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ + orgIds[i] = formDTO.get(i).getOrgId(); + } + screenPioneerDataDao.deletePioneerData(customerId, orgIds); + + screenPioneerDataDao.batchInsertPioneerData(formDTO, customerId); + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/Correlation.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/Correlation.java new file mode 100644 index 0000000000..f7a31b1436 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/Correlation.java @@ -0,0 +1,17 @@ +package com.epmet.support.normalizing; + +/** + * 指标正负相关枚举 + */ +public enum Correlation { + POSITIVE("positive","正相关"), + NEGATIVE("negative","负相关"), + ; + + private String code; + private String desc; + Correlation(String code,String desc){ + this.code = code; + this.desc = desc; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java new file mode 100644 index 0000000000..87f34db1f9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/DoubleScoreCalculator.java @@ -0,0 +1,43 @@ +package com.epmet.support.normalizing; + +import java.math.BigDecimal; + +/** + * Double的分值计算 + * 每一种数据类型的计算都要继承ScoreCalculator并且实现其抽象方法,实现数据类型的转换 + */ +public class DoubleScoreCalculator extends ScoreCalculator { + + /** + * 初始化double类型分值计算 + * ☆☆☆ 务必在该构造方法最后调用父类的prepare()方法 ☆☆☆ + * @param sourceArray 数据所在的数组 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public DoubleScoreCalculator(Double[] sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + this.sourceArrary = sourceArray; + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + this.prepare(); + } + + @Override + public BigDecimal getMaxFromSourceArray() { + Double[] doubleSourceArrary = (Double[]) this.sourceArrary; + return new BigDecimal(doubleSourceArrary[doubleSourceArrary.length - 1]); + } + + @Override + public BigDecimal getMinFromSourceArray() { + Double[] intSourceArrary = (Double[]) this.sourceArrary; + return new BigDecimal(intSourceArrary[0]); + } + + @Override + public BigDecimal convertValue2BigDecimal(Object sourceValue) { + return new BigDecimal((Double) sourceValue); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java new file mode 100644 index 0000000000..333cd0a4a2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/IntegerScoreCalculator.java @@ -0,0 +1,45 @@ +package com.epmet.support.normalizing; + +import java.math.BigDecimal; + +/** + * Integer的分值计算 + * 每一种数据类型的计算都要继承ScoreCalculator并且实现其抽象方法,实现数据类型的转换 + */ +public class IntegerScoreCalculator extends ScoreCalculator { + + /** + * 初始化整数分值计算 + * ☆☆☆ 务必在该构造方法最后调用父类的prepare()方法 ☆☆☆ + * @param sourceArray 数据所在的数组 + * @param minScore 分值区间的左边界 + * @param maxScore 分值区间的右边界 + * @param correlation 相关性 + */ + public IntegerScoreCalculator(Integer[] sourceArray, BigDecimal minScore, BigDecimal maxScore, Correlation correlation) { + this.sourceArrary = sourceArray; + this.minScore = minScore; + this.maxScore = maxScore; + this.correlation = correlation; + this.prepare(); + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + + } + + @Override + public BigDecimal getMaxFromSourceArray() { + Integer[] intSourceArrary = (Integer[]) this.sourceArrary; + return new BigDecimal(intSourceArrary[intSourceArrary.length - 1]); + } + + @Override + public BigDecimal getMinFromSourceArray() { + Integer[] intSourceArrary = (Integer[]) this.sourceArrary; + return new BigDecimal(intSourceArrary[0]); + } + + @Override + public BigDecimal convertValue2BigDecimal(Object sourceValue) { + return new BigDecimal((Integer) sourceValue); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java new file mode 100644 index 0000000000..2fb3fab926 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/ScoreCalculator.java @@ -0,0 +1,114 @@ +package com.epmet.support.normalizing; + +import java.math.BigDecimal; +import java.math.MathContext; +import java.util.Arrays; + +/** + * 所有数据类型计算器的父类,实现算法骨架,数据类型转换方法则由子类实现 + * @param 数据类型泛型 + */ +public abstract class ScoreCalculator { + + protected T[] sourceArrary; + + protected BigDecimal minScore; + protected BigDecimal maxScore; + + protected Correlation correlation; + + private BigDecimal maxValue; + private BigDecimal minValue; + private BigDecimal coefficient; + + /** + * 计算准备 + */ + protected void prepare() { + // 校验数组 + if (!validSourceArray(sourceArrary)) { + throw new RuntimeException("入参数组错误:请设置非空数组"); + } + Arrays.sort(sourceArrary); + maxValue = getMaxFromSourceArray(); + minValue = getMinFromSourceArray(); + //计算系数 + System.out.println("最小值:"+minScore+";最大值:"+maxScore); + coefficient = getCoefficient(minValue, maxValue); + } + + /** + * 归一算法 + * @return + */ + public BigDecimal normalize(T sourceValue) { + + if (sourceValue == null) { + throw new RuntimeException("入参数组错误:请设置sourceValue"); + } + + if (!Arrays.asList(sourceArrary).contains(sourceValue)) { + throw new RuntimeException("请确认要计算的数组在数组中存在"); + } + + if (correlation == Correlation.POSITIVE) { + // 正相关 + BigDecimal x = coefficient.multiply(convertValue2BigDecimal(sourceValue).subtract(minValue)); + BigDecimal score = minScore.add(x, MathContext.DECIMAL32); + return score; + } else if (correlation == Correlation.NEGATIVE) { + // 负相关 + BigDecimal x = coefficient.multiply(convertValue2BigDecimal(sourceValue).subtract(minValue)); + BigDecimal score = minScore.add(x); + return maxScore.subtract(score, MathContext.DECIMAL32); + } else { + throw new RuntimeException("错误的相关性"); + } + } + + /** + * 校验数组 + * @param sourceArray + * @param + * @return + */ + protected boolean validSourceArray(T[] sourceArray) { + if (sourceArray == null || sourceArray.length == 0) { + return false; + } + return true; + } + + /** + * 计算系数 + * @return + */ + protected BigDecimal getCoefficient(BigDecimal min, BigDecimal max) { + BigDecimal fenmu = max.subtract(min); + if (fenmu.toString().equals("0"))return new BigDecimal(0); + BigDecimal fenzi = maxScore.subtract(minScore); + BigDecimal divide = fenzi.divide(fenmu, MathContext.DECIMAL32); + System.out.println("分子:"+fenzi+"分母:"+fenmu+"系数:"+divide.toString()); + return divide; + } + + /** + * 从源数组中获取最大值 + * @return + */ + protected abstract BigDecimal getMaxFromSourceArray(); + + /** + * 从源数组中获取最小值 + * @return + */ + protected abstract BigDecimal getMinFromSourceArray(); + + /** + * 将值转化为BigDecimal + * @param sourceValue + * @return + */ + protected abstract BigDecimal convertValue2BigDecimal(T sourceValue); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ExcelListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ExcelListener.java new file mode 100644 index 0000000000..e8ad7cbe66 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ExcelListener.java @@ -0,0 +1,17 @@ +package com.epmet.util; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import org.apache.poi.ss.formula.functions.T; + +public class ExcelListener extends AnalysisEventListener { + @Override + public void invoke(T t, AnalysisContext analysisContext) { + + } + + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + System.out.println(analysisContext); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/TestFileUtil.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/TestFileUtil.java new file mode 100644 index 0000000000..865e691e80 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/TestFileUtil.java @@ -0,0 +1,35 @@ +package com.epmet.util; + +import java.io.File; +import java.io.InputStream; + +public class TestFileUtil { + + public static InputStream getResourcesFileInputStream(String fileName) { + return Thread.currentThread().getContextClassLoader().getResourceAsStream("" + fileName); + } + + public static String getPath() { + return TestFileUtil.class.getResource("/").getPath(); + } + + public static File createNewFile(String pathName) { + File file = new File(getPath() + pathName); + if (file.exists()) { + file.delete(); + } else { + if (!file.getParentFile().exists()) { + file.getParentFile().mkdirs(); + } + } + return file; + } + + public static File readFile(String pathName) { + return new File(getPath() + pathName); + } + + public static File readUserHomeFile(String pathName) { + return new File(System.getProperty("user.home") + File.separator + pathName); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml new file mode 100644 index 0000000000..107b94abc1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_govrn_ablity_dept_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND DEPT_ID = #{deptId} + AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} + + + + insert into fact_index_govrn_ablity_dept_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + DEPT_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + TRANSFERED_COUNT, + CLOSED_PROJECT_COUNT, + RESP_PROJECT_RATIO, + HANDLE_PROJECT_RATIO, + CLOSED_PROJECT_RATIO, + SATISFACTION_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.deptId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.transferedCount}, + #{item.closedProjectCount}, + #{item.respProjectRatio}, + #{item.handleProjectRatio}, + #{item.closedProjectRatio}, + #{item.satisfactionRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml new file mode 100644 index 0000000000..ed0f65cc79 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_govrn_ablity_grid_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} + AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} + + + + insert into fact_index_govrn_ablity_grid_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ISSUE_TOTAL, + AVG_ISSUE_COUNT, + AVG_SHIFT_PROJECT_RATIO, + PROJECT_TOTAL, + SELF_SOLVE_PROJECT_COUNT, + RESOLVE_PROJECT_COUNT, + TRANSFER_RIGHT_RATIO, + SATISFACTION_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.issueTotal}, + #{item.avgIssueCount}, + #{item.avgShiftProjectRatio}, + #{item.projectTotal}, + #{item.selfSolveProjectCount}, + #{item.resolveProjectCount}, + #{item.transferRightRatio}, + #{item.satisfactionRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml new file mode 100644 index 0000000000..36e4d07b3a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_govrn_ablity_org_monthly + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + AND AGENCY_ID IN + + #{item} + + + + + insert into fact_index_govrn_ablity_org_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + DATA_TYPE, + TRANSFERED_COUNT, + CLOSED_PROJECT_COUNT, + RESP_PROJECT_RATIO, + CLOSED_PROJECT_RATIO, + SATISFACTION_RATIO, + OVERDUE_PROJECT_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.dataType}, + #{item.transferedCount}, + #{item.closedProjectCount}, + #{item.respProjectRatio}, + #{item.closedProjectRatio}, + #{item.satisfactionRatio}, + #{item.overdueProjectRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml new file mode 100644 index 0000000000..836adcdb03 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityCpcMonthlyDao.xml @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_party_ablity_cpc_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} AND USER_ID = #{userId} + AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} + + + + insert into fact_index_party_ablity_cpc_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + GRID_ID, + USER_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + CREATE_TOPIC_COUNT, + JOIN__TOPIC_COUNT, + SHIFT_ISSUE_COUNT, + SHIFT_PROJECT_COUNT, + JOIN_THREE_MEETS_COUNT, + GROUP_USER_COUNT, + GROUP_TOPIC_COUNT, + TOPIC_TO_ISSUE_RATIO, + ISSUE_TO_PROJECT_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentId}, + #{item.gridId}, + #{item.userId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.createTopicCount}, + #{item.joinTopicCount}, + #{item.shiftIssueCount}, + #{item.shiftProjectCount}, + #{item.joinThreeMeetsCount}, + #{item.groupUserCount}, + #{item.groupTopicCount}, + #{item.topicToIssueRatio}, + #{item.issueToProjectCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml new file mode 100644 index 0000000000..e51a7d4f7f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -0,0 +1,102 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_party_ablity_grid_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + + + + insert into fact_index_party_ablity_grid_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + USER_COUNT, + PARTY_COUNT, + ACTIVE_USER_COUNT, + ACTIVE_PARTY_COUNT, + PARTY_AVG_TOPIC_COUNT, + USER_AVG_TOPIC_COUNT, + PARTY_AVG_SHIFT_PROJECT_COUNT, + USER_AVG_SHIFT_PROJECT_COUNT, + CREATE_GROUP_PARTY_COUNT, + PUBLISH_ARTICLE_COUNT, + ISSUE_TO_PROJECT_RATIO, + CREATE_THREE_MEETS_COUNT, + JOIN_THREE_MEETS_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.userCount}, + #{item.partyCount}, + #{item.activeUserCount}, + #{item.activePartyCount}, + #{item.partyAvgTopicCount}, + #{item.userAvgTopicCount}, + #{item.partyAvgShiftProjectCount}, + #{item.userAvgShiftProjectCount}, + #{item.createGroupPartyCount}, + #{item.publishArticleCount}, + #{item.issueToProjectRatio}, + #{item.createThreeMeetsCount}, + #{item.joinThreeMeetsCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml new file mode 100644 index 0000000000..758a686052 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_party_ablity_org_monthly + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + AND AGENCY_ID IN + + #{item} + + + + + insert into fact_index_party_ablity_org_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + PUBLISH_ARTICLE_COUNT, + DATA_TYPE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.publishArticleCount}, + #{item.dataType}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml new file mode 100644 index 0000000000..bc4348ea56 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_service_ablity_grid_monthly + where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + + + + insert into fact_index_service_ablity_grid_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ACTIVITY_COUNT, + VOLUNTEER_RATIO, + PARTY_VOLUNTEER_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.activityCount}, + #{item.volunteerRatio}, + #{item.partyVolunteerRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml new file mode 100644 index 0000000000..c475e2aca1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_index_service_ablity_org_monthly + where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + AND AGENCY_ID IN + + #{item} + + + + + insert into fact_index_service_ablity_org_monthly + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ACTIVITY_COUNT, + DATA_TYPE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.activityCount}, + #{item.dataType}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexDictDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexDictDao.xml new file mode 100644 index 0000000000..a91513e1d5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexDictDao.xml @@ -0,0 +1,8 @@ + + + + + + delete from index_dict + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDao.xml new file mode 100644 index 0000000000..4597456ae7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDao.xml @@ -0,0 +1,9 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml new file mode 100644 index 0000000000..b7854f3338 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailDao.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml new file mode 100644 index 0000000000..c044654dd8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupDetailTemplateDao.xml @@ -0,0 +1,14 @@ + + + + + + + delete from index_group_detail_template + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupTemplateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupTemplateDao.xml new file mode 100644 index 0000000000..6adfa4474b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/IndexGroupTemplateDao.xml @@ -0,0 +1,13 @@ + + + + + + delete from index_group_template + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml new file mode 100644 index 0000000000..7f8ddaf4f0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml @@ -0,0 +1,71 @@ + + + + + + + delete from screen_cpc_base_data + where CUSTOMER_ID = #{customerId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_cpc_base_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + DATA_END_TIME, + REGISTER_USER_COUNT, + RESI_TOTAL, + PARTY_MEMBER_COUNT, + AGE_LEVEL_1, + AGE_LEVEL_2, + AGE_LEVEL_3, + AGE_LEVEL_4, + AGE_LEVEL_5, + AGE_LEVEL_6, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.dataEndTime}, + #{item.registerUserCount}, + #{item.resiTotal}, + + #{item.partyMemberCount}, + #{item.ageLevel1}, + #{item.ageLevel2}, + #{item.ageLevel3}, + #{item.ageLevel4}, + #{item.ageLevel5}, + #{item.ageLevel6}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml new file mode 100644 index 0000000000..a9c6911a70 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -0,0 +1,63 @@ + + + + + + + delete from screen_customer_agency + where CUSTOMER_ID = #{customerId} + AND AGENCY_ID IN + + #{item} + + + + + insert into screen_customer_agency + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + AGENCY_NAME, + PID, + PIDS, + ALL_PARENT_NAMES, + AREA_MARKS, + CENTER_MARK, + PARTY_MARK, + `LEVEL`, + AREA_CODE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.agencyName}, + #{item.pid}, + #{item.pids}, + #{item.allParentNames}, + #{item.areaMarks}, + #{item.centerMark}, + #{item.partyMark}, + #{item.level}, + #{item.areaCode}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.dataEndTime} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml new file mode 100644 index 0000000000..a3fedbf4d5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml @@ -0,0 +1,55 @@ + + + + + + + delete from screen_customer_dept + where CUSTOMER_ID = #{customerId} + AND DEPT_ID IN + + #{item} + + + + + insert into screen_customer_dept + ( + ID, + CUSTOMER_ID, + DEPT_ID, + DEPT_NAME, + PARENT_AGENCY_ID, + AREA_MARKS, + CENTER_MARK, + DEPT_MARK, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.deptId}, + #{item.deptName}, + #{item.parentAgencyId}, + #{item.areaMarks}, + #{item.centerMark}, + #{item.deptMark}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.dataEndTime} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml new file mode 100644 index 0000000000..5381e9ddd2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -0,0 +1,55 @@ + + + + + + + delete from screen_customer_grid + where CUSTOMER_ID = #{customerId} + AND GRID_ID IN + + #{item} + + + + + insert into screen_customer_grid + ( + ID, + CUSTOMER_ID, + GRID_ID, + GRID_NAME, + PARENT_AGENCY_ID, + AREA_MARKS, + CENTER_MARK, + PARTY_MARK, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.gridId}, + #{item.gridName}, + #{item.parentAgencyId}, + #{item.areaMarks}, + #{item.centerMark}, + #{item.partyMark}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.dataEndTime} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml new file mode 100644 index 0000000000..e26c43115c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -0,0 +1,71 @@ + + + + + + + delete from screen_difficulty_data + where CUSTOMER_ID = #{customerId} AND EVENT_ID = #{eventId} AND ORG_ID = #{orgId} + + + + insert into screen_difficulty_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + EVENT_ID, + EVENT_IMG_URL, + EVENT_SOURCE, + EVENT_CONTENT, + EVENT_COST_TIME, + EVENT_RE_ORG, + EVENT_HANDLED_COUNT, + EVENT_CATEGORY_CODE, + EVENT_CATEGORY_NAME, + EVENT_STATUS_CODE, + EVENT_STATUS_DESC, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + LATEST_OPERATE_DESC, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.eventId}, + #{item.eventImgUrl}, + #{item.eventSource}, + #{item.eventContent}, + #{item.eventCostTime}, + #{item.eventReOrg}, + #{item.eventHandledCount}, + #{item.eventCategoryCode}, + #{item.eventCategoryName}, + #{item.eventStatusCode}, + #{item.eventStatusDesc}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.latestOperateDesc}, + #{item.dataEndTime} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml new file mode 100644 index 0000000000..be95b118df --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml @@ -0,0 +1,77 @@ + + + + + + + delete from screen_event_data + where CUSTOMER_ID = #{customerId} AND EVENT_ID = #{eventId} AND ORG_ID = #{orgId} + + + + insert into screen_event_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + EVENT_ID, + EVENT_TITLE, + EVENT_CREATE_TIME, + LINK_MOBILE, + EVENT_CONTENT, + EVENT_IMG_URL, + EVENT_LEVEL, + EVENT_ADDRESS, + LONGITUDE, + LATITUDE, + LAST_PROCESS_DEPT, + LAST_PROCESS_DATE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + EVENT_STATUS_CODE, + EVENT_STATUS_DESC, + LATEST_OPERATE_DESC, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.eventId}, + #{item.eventTitle}, + #{item.eventCreateTime}, + #{item.linkMobile}, + #{item.eventContent}, + #{item.eventImgUrl}, + #{item.eventLevel}, + #{item.eventAddress}, + #{item.longitude}, + #{item.latitude}, + #{item.lastProcessDept}, + #{item.lastProcessDate}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.eventStatusCode}, + #{item.eventStatusDesc}, + #{item.latestOperateDesc}, + #{item.dataEndTime} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml new file mode 100644 index 0000000000..eaef413fd8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventImgDataDao.xml @@ -0,0 +1,11 @@ + + + + + + + delete from screen_event_img_data + where DEL_FLAG = '0' AND EVENT_ID = #{eventId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml new file mode 100644 index 0000000000..9a6e6c3c44 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml @@ -0,0 +1,65 @@ + + + + + + + delete from screen_govern_rank_data + where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_govern_rank_data + ( + ID, + CUSTOMER_ID, + YEAR_ID, + MONTH_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + + RESPONSE_RATIO, + RESOLVED_RATIO, + GOVERN_RATIO, + SATISFACTION_RATIO, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.yearId}, + #{item.monthId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + + #{item.responseRatio}, + #{item.resolvedRatio}, + #{item.governRatio}, + #{item.satisfactionRatio}, + + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml new file mode 100644 index 0000000000..721c4e0af3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -0,0 +1,62 @@ + + + + + + + delete from screen_index_data_monthly + where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_index_data_monthly + ( + ID, + CUSTOMER_ID, + YEAR_ID, + MONTH_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + INDEX_TOTAL, + PARTY_DEV_ABLITY, + SERVICE_ABLITY, + GOVERN_ABLITY, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.yearId}, + #{item.monthId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + + #{item.indexTotal}, + #{item.partyDevAblity}, + #{item.serviceAblity}, + #{item.governAblity}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml new file mode 100644 index 0000000000..8747e1219a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml @@ -0,0 +1,60 @@ + + + + + + + delete from screen_index_data_yearly + where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_index_data_yearly + ( + ID, + CUSTOMER_ID, + YEAR_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + INDEX_TOTAL, + PARTY_DEV_ABLITY, + SERVICE_ABLITY, + GOVERN_ABLITY, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.yearId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + + #{item.indexTotal}, + #{item.partyDevAblity}, + #{item.serviceAblity}, + #{item.governAblity}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml new file mode 100644 index 0000000000..4ebe5e2c28 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml @@ -0,0 +1,67 @@ + + + + + + + delete from screen_org_rank_data + where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_org_rank_data + ( + ID, + CUSTOMER_ID, + YEAR_ID, + MONTH_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + PARTY_TOTAL, + GROUP_TOTAL, + TOPIC_TOTAL, + ISSUE_TOTAL, + PROJECT_TOTAL, + CLOSE_PROJECT_RATIO, + SATISFACTION_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.yearId}, + #{item.monthId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.partyTotal}, + #{item.groupTotal}, + #{item.topicTotal}, + #{item.issueTotal}, + #{item.projectTotal}, + #{item.closeProjectRatio}, + #{item.satisfactionRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml new file mode 100644 index 0000000000..afeaca9651 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml @@ -0,0 +1,64 @@ + + + + + + + delete from screen_party_branch_data + where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_party_branch_data + ( + ID, + CUSTOMER_ID, + YEAR_ID, + MONTH_ID, + `TYPE`, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + MEET_CATEGORY_ID, + MEET_CATEGORY_NAME, + ORGANIZE_COUNT, + JOIN_USER_COUNT, + AVERAGE_JOIN_USER_COUNT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.yearId}, + #{item.monthId}, + #{item.type}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.meetCategoryId}, + #{item.meetCategoryName}, + #{item.organizeCount}, + #{item.joinUserCount}, + #{item.averageJoinUserCount}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml new file mode 100644 index 0000000000..d317d97ee9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml @@ -0,0 +1,55 @@ + + + + + + + delete from screen_party_link_masses_data + where CUSTOMER_ID = #{customerId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_party_link_masses_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + CREATE_GROUP_TOTAL, + GROUP_USER_TOTAL, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.createGroupTotal}, + #{item.groupUserTotal}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.dataEndTime} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml new file mode 100644 index 0000000000..070e952878 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -0,0 +1,59 @@ + + + + + + + delete from screen_party_user_rank_data + where CUSTOMER_ID = #{customerId} AND GRID_ID = #{gridId} AND USER_ID = #{userId} + + + + insert into screen_party_user_rank_data + ( + ID, + CUSTOMER_ID, + GRID_ID, + GRID_NAME, + ORG_ID, + ORG_NAME, + PARTY_FLAG, + USER_ID, + SURNAME, + `NAME`, + USER_NAME, + POINT_TOTAL, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.gridId}, + #{item.gridName}, + #{item.orgId}, + #{item.orgName}, + #{item.partyFlag}, + #{item.userId}, + #{item.surname}, + #{item.name}, + #{item.userName}, + #{item.pointTotal}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.dataEndTime} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml new file mode 100644 index 0000000000..8142176bee --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml @@ -0,0 +1,72 @@ + + + + + + + delete from screen_pioneer_data + where CUSTOMER_ID = #{customerId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_pioneer_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + PUBLISH_ISSUE_TOTAL, + ISSUE_TOTAL, + TOPIC_TOTAL, + SHIFT_PROJECT_TOTAL, + RESOLVED_PROJECT_TOTAL, + PUBLISH_ISSUE_RATIO, + ISSUE_RATIO, + TOPIC_RATIO, + SHIFT_PROJECT_RATIO, + RESOLVED_PROJECT_RATIO, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME, + DATA_END_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.publishIssueTotal}, + #{item.issueTotal}, + #{item.topicTotal}, + #{item.shiftProjectTotal}, + #{item.resolvedProjectTotal}, + + #{item.publishIssueRatio}, + #{item.issueRatio}, + #{item.topicRatio}, + #{item.shiftProjectRatio}, + #{item.resolvedProjectRatio}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now(), + #{item.dataEndTime} + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml new file mode 100644 index 0000000000..9751293f5f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml @@ -0,0 +1,91 @@ + + + + + + + + + delete from screen_user_join + where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_user_join + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + YEAR_ID, + MONTH_ID, + JOIN_TOTAL, + JOIN_TOTAL_UP_RATE, + JOIN_TOTAL_UP_FLAG, + AVG_ISSUE, + AVG_ISSUE_UP_RATE, + AVG_ISSUE_UP_FLAG, + AVG_JOIN, + AGVG_JOIN_UP_RATE, + AGVG_JOIN_UP_FLAG, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.yearId}, + #{item.monthId}, + + #{item.joinTotal}, + #{item.joinTotalUpRate}, + #{item.joinTotalUpFlag}, + + #{item.avgIssue}, + #{item.avgIssueUpRate}, + #{item.avgIssueUpFlag}, + + #{item.avgJoin}, + #{item.agvgJoinUpRate}, + #{item.agvgJoinUpFlag}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml new file mode 100644 index 0000000000..a3f29dd5a6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -0,0 +1,67 @@ + + + + + + + delete from screen_user_total_data + where CUSTOMER_ID = #{customerId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_user_total_data + ( + ID, + CUSTOMER_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + DATA_END_TIME, + USER_TOTAL, + PARTY_TOTAL, + GROUP_TOTAL, + TOPIC_TOTAL, + ISSUE_TOTAL, + PROJECT_TOTAL, + REG_USER_TOTAL, + JOIN_USER_TOTAL, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.dataEndTime}, + #{item.userTotal}, + #{item.partyTotal}, + #{item.groupTotal}, + #{item.topicTotal}, + #{item.issueTotal}, + #{item.projectTotal}, + #{item.regUserTotal}, + #{item.joinUserTotal}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/model/DemoData.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/model/DemoData.java new file mode 100644 index 0000000000..234e66cb58 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/model/DemoData.java @@ -0,0 +1,17 @@ +package com.epmet.stats.test.model; + +import lombok.Data; + +import java.util.Date; + +/** + * 基础数据类.这里的排序和excel里面的排序一致 + * + * @author Jiaju Zhuang + **/ +@Data +public class DemoData { + private String string; + private Date date; + private Double doubleData; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/model/DemoDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/model/DemoDataListener.java new file mode 100644 index 0000000000..d218327ad1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/model/DemoDataListener.java @@ -0,0 +1,84 @@ +package com.epmet.stats.test.model; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.fastjson.JSON; +import com.epmet.dao.screen.ScreenCustomerAgencyDao; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; + +/** + * 模板的读取类 + * + * @author Jiaju Zhuang + */ +// 有个很重要的点 DemoDataListener 不能被spring管理,要每次读取excel都要new,然后里面用到spring可以构造方法传进去 +public class DemoDataListener extends AnalysisEventListener { + private static final Logger LOGGER = LoggerFactory.getLogger(DemoDataListener.class); + /** + * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 + */ + private static final int BATCH_COUNT = 5; + List list = new ArrayList(); + /** + * 假设这个是一个DAO,当然有业务逻辑这个也可以是一个service。当然如果不用存储这个对象没用。 + */ + private ScreenCustomerAgencyDao demoDAO; + + public DemoDataListener() { + // 这里是demo,所以随便new一个。实际使用如果到了spring,请使用下面的有参构造函数 + demoDAO = null; + } + + /** + * 如果使用了spring,请使用这个构造方法。每次创建Listener的时候需要把spring管理的类传进来 + * + * @param demoDAO + */ + public DemoDataListener(ScreenCustomerAgencyDao demoDAO) { + this.demoDAO = demoDAO; + } + + /** + * 这个每一条数据解析都会来调用 + * + * @param data + * one row value. Is is same as {@link AnalysisContext#readRowHolder()} + * @param context + */ + @Override + public void invoke(DemoData data, AnalysisContext context) { + LOGGER.info("解析到一条数据:{}", JSON.toJSONString(data)); + list.add(data); + // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM + if (list.size() >= BATCH_COUNT) { + saveData(); + // 存储完成清理 list + list.clear(); + } + } + + /** + * 所有数据解析完成了 都会来调用 + * + * @param context + */ + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + // 这里也要保存数据,确保最后遗留的数据也存储到数据库 + saveData(); + LOGGER.info("所有数据解析完成!"); + } + + /** + * 加上存储数据库 + */ + private void saveData() { + LOGGER.info("{}条数据,开始存储数据库!", list.size()); + //demoDAO.save(list); + LOGGER.info("存储数据库成功!"); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ConverterData.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ConverterData.java new file mode 100644 index 0000000000..9a9be1642d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ConverterData.java @@ -0,0 +1,30 @@ +package com.epmet.stats.test.read; + +import com.alibaba.excel.annotation.ExcelProperty; +import com.alibaba.excel.annotation.format.DateTimeFormat; +import com.alibaba.excel.annotation.format.NumberFormat; +import lombok.Data; + +/** + * 基础数据类.这里的排序和excel里面的排序一致 + * + * @author Jiaju Zhuang + **/ +@Data +public class ConverterData { + /** + * 我自定义 转换器,不管数据库传过来什么 。我给他加上“自定义:” + */ + @ExcelProperty(converter = CustomStringStringConverter.class) + private String string; + /** + * 这里用string 去接日期才能格式化。我想接收年月日格式 + */ + @DateTimeFormat("yyyy年MM月dd日HH时mm分ss秒") + private String date; + /** + * 我想接收百分比的数字 + */ + @NumberFormat("#.##%") + private String doubleData; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ConverterDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ConverterDataListener.java new file mode 100644 index 0000000000..7c28d41fe8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ConverterDataListener.java @@ -0,0 +1,48 @@ +package com.epmet.stats.test.read; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.fastjson.JSON; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; + +/** + * 模板的读取类 + * + * @author Jiaju Zhuang + */ +public class ConverterDataListener extends AnalysisEventListener { + private static final Logger LOGGER = LoggerFactory.getLogger(ConverterDataListener.class); + /** + * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 + */ + private static final int BATCH_COUNT = 5; + List list = new ArrayList(); + + @Override + public void invoke(ConverterData data, AnalysisContext context) { + LOGGER.info("解析到一条数据:{}", JSON.toJSONString(data)); + list.add(data); + if (list.size() >= BATCH_COUNT) { + saveData(); + list.clear(); + } + } + + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + saveData(); + LOGGER.info("所有数据解析完成!"); + } + + /** + * 加上存储数据库 + */ + private void saveData() { + LOGGER.info("{}条数据,开始存储数据库!", list.size()); + LOGGER.info("存储数据库成功!"); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java new file mode 100644 index 0000000000..584e563a77 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/CustomStringStringConverter.java @@ -0,0 +1,59 @@ +package com.epmet.stats.test.read; + +import com.alibaba.excel.converters.Converter; +import com.alibaba.excel.enums.CellDataTypeEnum; +import com.alibaba.excel.metadata.CellData; +import com.alibaba.excel.metadata.GlobalConfiguration; +import com.alibaba.excel.metadata.property.ExcelContentProperty; + +/** + * String and string converter + * + * @author Jiaju Zhuang + */ +public class CustomStringStringConverter implements Converter { + @Override + public Class supportJavaTypeKey() { + return String.class; + } + + @Override + public CellDataTypeEnum supportExcelTypeKey() { + return CellDataTypeEnum.STRING; + } + + /** + * 这里读的时候会调用 + * + * @param cellData + * NotNull + * @param contentProperty + * Nullable + * @param globalConfiguration + * NotNull + * @return + */ + @Override + public String convertToJavaData(CellData cellData, ExcelContentProperty contentProperty, + GlobalConfiguration globalConfiguration) { + return "自定义:" + cellData.getStringValue(); + } + + /** + * 这里是写的时候会调用 不用管 + * + * @param value + * NotNull + * @param contentProperty + * Nullable + * @param globalConfiguration + * NotNull + * @return + */ + @Override + public CellData convertToExcelData(String value, ExcelContentProperty contentProperty, + GlobalConfiguration globalConfiguration) { + return new CellData(value); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoDAO.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoDAO.java new file mode 100644 index 0000000000..bf09288f59 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoDAO.java @@ -0,0 +1,15 @@ +package com.epmet.stats.test.read; + +import java.util.List; + +/** + * 假设这个是你的DAO存储。当然还要这个类让spring管理,当然你不用需要存储,也不需要这个类。 + * + * @author Jiaju Zhuang + **/ +public class DemoDAO { + + public void save(List list) { + // 如果是mybatis,尽量别直接调用多次insert,自己写一个mapper里面新增一个方法batchInsert,所有数据一次性插入 + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoData.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoData.java new file mode 100644 index 0000000000..ceb3dd37ca --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoData.java @@ -0,0 +1,17 @@ +package com.epmet.stats.test.read; + +import lombok.Data; + +import java.util.Date; + +/** + * 基础数据类.这里的排序和excel里面的排序一致 + * + * @author Jiaju Zhuang + **/ +@Data +public class DemoData { + private String string; + private Date date; + private Double doubleData; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoDataListener.java new file mode 100644 index 0000000000..539f1903b0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/DemoDataListener.java @@ -0,0 +1,97 @@ +package com.epmet.stats.test.read; + +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.event.AnalysisEventListener; +import com.alibaba.fastjson.JSON; +import com.epmet.model.IndexModel; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * 模板的读取类 + * + * @author Jiaju Zhuang + */ +// 有个很重要的点 DemoDataListener 不能被spring管理,要每次读取excel都要new,然后里面用到spring可以构造方法传进去 +public class DemoDataListener extends AnalysisEventListener { + private static final Logger LOGGER = LoggerFactory.getLogger(DemoDataListener.class); + /** + * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 + */ + private static final int BATCH_COUNT = 5; + List list = new ArrayList(); + AtomicInteger total = new AtomicInteger(0); + + private String preWheight; + /** + * 假设这个是一个DAO,当然有业务逻辑这个也可以是一个service。当然如果不用存储这个对象没用。 + */ + private DemoDAO demoDAO; + + public DemoDataListener() { + // 这里是demo,所以随便new一个。实际使用如果到了spring,请使用下面的有参构造函数 + demoDAO = new DemoDAO(); + } + + /** + * 如果使用了spring,请使用这个构造方法。每次创建Listener的时候需要把spring管理的类传进来 + * + * @param demoDAO + */ + public DemoDataListener(DemoDAO demoDAO) { + this.demoDAO = demoDAO; + } + + /** + * 这个每一条数据解析都会来调用 + * + * @param data + * one row value. Is is same as {@link AnalysisContext#readRowHolder()} + * @param context + */ + @Override + public void invoke(IndexModel data, AnalysisContext context) { + if (data == null || data.getIsUsed() == null || data.getIsUsed() != 1){ + return; + } + if ( data.getWeight() != null){ + preWheight = data.getWeight(); + }else{ + data.setWeight(preWheight); + } + LOGGER.info("解析到一条数据:{}", JSON.toJSONString(data)); + list.add(data); + total.addAndGet(1); + // 达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM + if (list.size() >= BATCH_COUNT) { + saveData(); + // 存储完成清理 list + list.clear(); + } + } + + /** + * 所有数据解析完成了 都会来调用 + * + * @param context + */ + @Override + public void doAfterAllAnalysed(AnalysisContext context) { + // 这里也要保存数据,确保最后遗留的数据也存储到数据库 + saveData(); + LOGGER.info("所有数据解析完成!total:{}",total.intValue()); + } + + /** + * 加上存储数据库 + */ + private void saveData() { + LOGGER.info("{}条数据,开始存储数据库!", list.size()); + //demoDAO.save(list); + LOGGER.info("存储数据库成功!"); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ReadTest.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ReadTest.java new file mode 100644 index 0000000000..85ee1e7806 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/read/ReadTest.java @@ -0,0 +1,70 @@ +package com.epmet.stats.test.read; + +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.read.metadata.ReadSheet; +import com.epmet.model.IndexModel; +import com.epmet.util.TestFileUtil; +import org.junit.Ignore; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.FileNotFoundException; + + +/** + * 读的常见写法 + * + * @author Jiaju Zhuang + */ +@Ignore +public class ReadTest { + + private static final Logger LOGGER = LoggerFactory.getLogger(ReadTest.class); + + + + /** + * 读多个或者全部sheet,这里注意一个sheet不能读取多次,多次读取需要重新读取文件 + *

+ * 1. 创建excel对应的实体对象 参照{@link DemoData} + *

+ * 2. 由于默认一行行的读取excel,所以需要创建excel一行一行的回调监听器,参照{@link DemoDataListener} + *

+ * 3. 直接读即可 + */ + @Test + public void repeatedRead() throws FileNotFoundException { + String fileName = ""; + /* String fileName = TestFileUtil.getPath() + File.separator + "评价指标体系算法需求-备注.xlsx"; + // 读取全部sheet + // 这里需要注意 DemoDataListener的doAfterAllAnalysed 会在每个sheet读取完毕后调用一次。然后所有sheet都会往同一个DemoDataListener里面写 + EasyExcel.read(fileName, IndexModel.class, new DemoDataListener()).doReadAll(); +*/ + // 读取部分sheet + String excelName = "评价指标体系算法需求-备注.xlsx"; + fileName = TestFileUtil.getPath() + File.separator + excelName; + //fileName = this.getClass().getResource(File.separator).getPath().concat(excelName); + ExcelReader excelReader = null; + try { + //ExcelImportUtil.importExcel(null); + + //EasyExcel.read(new FileInputStream(new File(fileName)),IndexModel.class); + excelReader = EasyExcel.read(fileName).build(); + // 这里为了简单 所以注册了 同样的head 和Listener 自己使用功能必须不同的Listener + ReadSheet readSheet1 = + EasyExcel.readSheet(0).head(IndexModel.class).registerReadListener(new DemoDataListener()).build(); + ReadSheet readSheet2 = + EasyExcel.readSheet(1).head(IndexModel.class).registerReadListener(new DemoDataListener()).build(); + // 这里注意 一定要把sheet1 sheet2 一起传进去,不然有个问题就是03版的excel 会读取多次,浪费性能 + excelReader.read(readSheet2); + } finally { + if (excelReader != null) { + // 这里千万别忘记关闭,读的时候会创建临时文件,到时磁盘会崩的 + excelReader.finish(); + } + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/util/TestFileUtil.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/util/TestFileUtil.java new file mode 100644 index 0000000000..5035e52046 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/util/TestFileUtil.java @@ -0,0 +1,35 @@ +package com.epmet.stats.test.util; + +import java.io.File; +import java.io.InputStream; + +public class TestFileUtil { + + public static InputStream getResourcesFileInputStream(String fileName) { + return Thread.currentThread().getContextClassLoader().getResourceAsStream("" + fileName); + } + + public static String getPath() { + return TestFileUtil.class.getResource("/").getPath(); + } + + public static File createNewFile(String pathName) { + File file = new File(getPath() + pathName); + if (file.exists()) { + file.delete(); + } else { + if (!file.getParentFile().exists()) { + file.getParentFile().mkdirs(); + } + } + return file; + } + + public static File readFile(String pathName) { + return new File(getPath() + pathName); + } + + public static File readUserHomeFile(String pathName) { + return new File(System.getProperty("user.home") + File.separator + pathName); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx new file mode 100644 index 0000000000..592e740466 Binary files /dev/null and b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注.xlsx differ diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml b/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml index 94b2810ebe..5a4cf59cab 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/pom.xml @@ -178,8 +178,8 @@ 123456 false - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml index d1b7844a39..047408c5df 100644 --- a/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: common-service-server: container_name: common-service-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/common-service-server:0.3.11 + image: 192.168.1.130:10080/epmet-cloud-dev/common-service-server:0.3.16 ports: - "8103:8103" network_mode: host # 使用现有网络 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 5f9878a727..1a43e02ffb 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.9 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/common-service-server:0.3.17 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 7e176a8857..e7736f4f6b 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.11 + 0.3.17 com.epmet epmet-common-service @@ -120,8 +120,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/epmet-demo/epmet-demo-server/pom.xml b/epmet-module/epmet-demo/epmet-demo-server/pom.xml index fc69633e51..26c8afd2fc 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/pom.xml +++ b/epmet-module/epmet-demo/epmet-demo-server/pom.xml @@ -121,8 +121,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/epmet-ext/epmet-ext-client/pom.xml b/epmet-module/epmet-ext/epmet-ext-client/pom.xml new file mode 100644 index 0000000000..925703ab91 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/pom.xml @@ -0,0 +1,41 @@ + + + 4.0.0 + + + epmet-ext + com.epmet + 2.0.0 + + + + epmet-ext-client + jar + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + com.github.binarywang + weixin-java-mp + 3.6.0 + compile + + + com.epmet + epmet-user-client + 2.0.0 + compile + + + + + ${project.artifactId} + + + \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinAgencyFormDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinAgencyFormDTO.java new file mode 100644 index 0000000000..0403bf52b1 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinAgencyFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:33 上午 + */ +@Data +public class StaffSinAgencyFormDTO implements Serializable { + + private static final long serialVersionUID = 1827402498483127629L; + + //后端自己看 + public interface StaffSinAgency{} + + /** + * 机关Id + */ + @NotBlank(message = "机关Id不能为空",groups = {StaffSinAgency.class}) + private String agencyId; +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinDeptFormDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinDeptFormDTO.java new file mode 100644 index 0000000000..3e69297c27 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinDeptFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:33 上午 + */ +@Data +public class StaffSinDeptFormDTO implements Serializable { + + private static final long serialVersionUID = 1827404498483127629L; + + //后端自己看 + public interface StaffSinDept{} + + /** + * 部门Id + */ + @NotBlank(message = "部门Id不能为空",groups = {StaffSinDept.class}) + private String departmentId; +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinGridFormDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinGridFormDTO.java new file mode 100644 index 0000000000..8b93d60979 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/form/StaffSinGridFormDTO.java @@ -0,0 +1,26 @@ +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 zxc + * @DateTime 2020/8/13 9:33 上午 + */ +@Data +public class StaffSinGridFormDTO implements Serializable { + + private static final long serialVersionUID = 1827404498483127629L; + + //后端自己看 + public interface StaffSinGrid{} + + /** + * 网格Id + */ + @NotBlank(message = "网格Id不能为空",groups = {StaffSinGrid.class}) + private String gridId; +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java new file mode 100644 index 0000000000..a15e6b5827 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:30 上午 + */ +@Data +public class RoleResultDTO implements Serializable { + + private static final long serialVersionUID = -4321366067217459L; + + /** + * 角色key + */ + private String roleKey; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 用户id + */ + @JsonIgnore + private String userId; +} diff --git a/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/StaffSinDeptResultDTO.java b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/StaffSinDeptResultDTO.java new file mode 100644 index 0000000000..dca9c292a3 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-client/src/main/java/com/epmet/dto/result/StaffSinDeptResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:25 上午 + */ +@Data +public class StaffSinDeptResultDTO implements Serializable { + + private static final long serialVersionUID = -3440415466710443002L; + + /** + * 工作人员Id + */ + private String staffId; + + /** + * 工作人员名称 + */ + private String staffName; + + /** + * 头像 + */ + private String headPhoto; + + /** + * 性别,1男2女0未知 + */ + private Integer gender; + + /** + * 角色列表 + */ + private List roleList; + +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/Dockerfile b/epmet-module/epmet-ext/epmet-ext-server/Dockerfile new file mode 100644 index 0000000000..2a18b4bf3a --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-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 ./app.jar + +EXPOSE 8113 + +ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml new file mode 100644 index 0000000000..fff5c3ac11 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml @@ -0,0 +1,18 @@ +version: "3.7" +services: + epmet-ext-server: + container_name: epmet-ext-server-dev + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-ext-server:0.0.5 + ports: + - "8113:8113" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + restart: "unless-stopped" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ 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 new file mode 100644 index 0000000000..5a11859c4a --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-prod.yml @@ -0,0 +1,18 @@ +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.6 + ports: + - "8113:8113" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/prod:/logs" + environment: + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + restart: "unless-stopped" + deploy: + resources: + limits: + cpus: '0.1' + memory: 600M \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..36c753627a --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml @@ -0,0 +1,18 @@ +version: "3.7" +services: + epmet-ext-server: + container_name: epmet-ext-server-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-ext-server:0.0.1 + ports: + - "8113:8113" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/test:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + restart: "unless-stopped" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/pom.xml b/epmet-module/epmet-ext/epmet-ext-server/pom.xml new file mode 100644 index 0000000000..771990a0f1 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/pom.xml @@ -0,0 +1,272 @@ + + + 4.0.0 + 0.0.6 + + + com.epmet + epmet-ext + 2.0.0 + + + epmet-ext-server + jar + + + 3.2.2 + 1.1.0 + 1.0.5 + 2.3.28 + + + + + com.epmet + epmet-ext-client + 2.0.0 + + + com.epmet + epmet-commons-extapp-auth + 2.0.0 + + + com.epmet + epmet-commons-tools + 2.0.0 + + + com.epmet + epmet-user-client + 2.0.0 + + + com.epmet + gov-org-client + 2.0.0 + + + 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 + + + com.aliyun + aliyun-java-sdk-core + ${aliyun.core.version} + + + com.aliyun + aliyun-java-sdk-dysmsapi + ${aliyun.dysmsapi.version} + + + com.github.qcloudsms + qcloudsms + ${qcloud.qcloudsms.version} + + + com.sun.mail + javax.mail + + + org.freemarker + freemarker + ${freemarker.version} + + + + io.github.openfeign + feign-httpclient + 10.3.0 + + + + org.flywaydb + flyway-core + + + + + + com.squareup.okhttp3 + okhttp + 4.0.0 + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.vintage + junit-vintage-engine + + + + + org.dom4j + dom4j + 2.1.3 + compile + + + com.github.binarywang + weixin-java-common + 3.6.0 + compile + + + org.springframework + spring-test + 5.1.12.RELEASE + 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 + + true + + + 8113 + dev + + + + + + epmet_third_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 + + + false + + + false + + + + test + + + 8113 + 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 + + + + + prod + + + 8113 + prod + + + + + + epmet_third_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 + + + + + diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java new file mode 100644 index 0000000000..89508e7873 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/EpmetExtApplication.java @@ -0,0 +1,17 @@ +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 EpmetExtApplication { + + public static void main(String[] args) { + SpringApplication.run(EpmetExtApplication.class, args); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/aspect/RequestLogAspect.java similarity index 93% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java rename to epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/aspect/RequestLogAspect.java index 7d4ff2d7d4..49581cf63c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/aspect/RequestLogAspect.java @@ -21,7 +21,7 @@ import javax.servlet.http.HttpServletRequest; public class RequestLogAspect extends BaseRequestLogAspect { @Override - @Around(value = "execution(* com.epmet.controller.*.*Controller*.*(..)) ") + @Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ") public Object proceed(ProceedingJoinPoint point) throws Throwable { return super.proceed(point, getRequest()); } diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/config/ModuleConfigImpl.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..5cc47783e6 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/config/ModuleConfigImpl.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.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 "epmetext"; + } +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java new file mode 100644 index 0000000000..d8b34dc284 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java @@ -0,0 +1,17 @@ +package com.epmet.constant; + +/** + * @Description + * @author zxc + */ +public interface ModuleConstant { + + String ERROR_GOV_ORG_GRID = "调用gov_org服务查询【网格】下的所有工作人员失败"; + + String ERROR_GOV_ORG_DEPARTMENT = "调用gov_org服务查询【部门】下的所有工作人员失败"; + + String ERROR_GOV_ORG_AGENCY = "调用gov_org服务查询【机关】下的所有工作人员失败"; + + String ERROR_EPMET_USER = "调用epmet_user服务查询网格下的所有工作人员失败"; + +} 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 new file mode 100644 index 0000000000..147308f38e --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java @@ -0,0 +1,105 @@ +package com.epmet.controller; + + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +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.*; +import com.epmet.dto.result.*; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.OpenUpService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:16 上午 + */ +@RestController +@RequestMapping("staff") +public class OpenUpController { + + @Autowired + private OpenUpService openUpService; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + /** + * @Description 网格工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/13 9:42 上午 + */ + @ExternalAppRequestAuth + @PostMapping("staffsingrid") + public Result> staffSinGrid(@RequestBody StaffSinGridFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, StaffSinGridFormDTO.StaffSinGrid.class); + return new Result>().ok(openUpService.staffSinGrid(formDTO)); + } + + /** + * @Description 部门工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/13 9:51 上午 + */ + @ExternalAppRequestAuth + @PostMapping("staffsindept") + public Result> staffSinDept(@RequestBody StaffSinDeptFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, StaffSinDeptFormDTO.StaffSinDept.class); + return new Result>().ok(openUpService.staffSinDept(formDTO)); + } + + /** + * @Description 机关工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/17 9:59 上午 + */ + @ExternalAppRequestAuth + @PostMapping("staffsinagency") + public Result> staffSinAgency(@RequestBody StaffSinAgencyFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, StaffSinAgencyFormDTO.StaffSinAgency.class); + return new Result>().ok(openUpService.staffSinAgency(formDTO)); + } + + /** + * @Description 查找工作人员的信息 + * @param + * @return + * @author wangc + * @date 2020.08.17 10:30 + **/ + @ExternalAppRequestAuth + @PostMapping("staffinfo") + public Result staffInfo(@LoginUser TokenDto token){ + CommonStaffIdFormDTO commonStaffIdFormDTO = new CommonStaffIdFormDTO(); + commonStaffIdFormDTO.setStaffId(token.getUserId()); + ValidatorUtils.validateEntity(commonStaffIdFormDTO, CommonStaffIdFormDTO.StaffIdGroup.class); + return epmetUserOpenFeignClient.extStaffInfo(commonStaffIdFormDTO); + } + + /** + * @Description 根据staffId,查询当前这个用户的数据权限 + * @param + * @return + * @author wangc + * @date 2020.08.17 17:30 + **/ + @ExternalAppRequestAuth + @PostMapping("permission") + Result staffPermissionExt(@RequestBody CommonStaffIdFormDTO commonStaffIdFormDTO){ + ValidatorUtils.validateEntity(commonStaffIdFormDTO, CommonStaffIdFormDTO.StaffIdGroup.class); + return govOrgOpenFeignClient.staffPermissionExt(commonStaffIdFormDTO.getStaffId()); + } + +} + diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpUserController.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpUserController.java new file mode 100644 index 0000000000..341715b6ae --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpUserController.java @@ -0,0 +1,44 @@ +package com.epmet.controller; + +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +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.CommonUserIdFormDTO; +import com.epmet.dto.result.ExtUserInfoResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +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; + +/** + * @Description + * @ClassName OpenUpUserController + * @Auth wangc + * @Date 2020-08-21 17:56 + */ +@RestController +@RequestMapping("user") +public class OpenUpUserController { + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * @Description 查找当前用户的信息 + * @param + * @return + * @author wangc + * @date 2020.08.17 10:30 + **/ + @ExternalAppRequestAuth + @PostMapping("userinfo") + Result userInfo(@LoginUser TokenDto token){ + CommonUserIdFormDTO userParam = new CommonUserIdFormDTO(); + userParam.setUserId(token.getUserId()); + ValidatorUtils.validateEntity(userParam, CommonUserIdFormDTO.CommonUserIdGroup.class); + return epmetUserOpenFeignClient.extUserInfo(userParam); + } +} 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 new file mode 100644 index 0000000000..5ecbf7aedb --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java @@ -0,0 +1,41 @@ +package com.epmet.service; + +import com.epmet.dto.form.StaffSinAgencyFormDTO; +import com.epmet.dto.form.StaffSinDeptFormDTO; +import com.epmet.dto.form.StaffSinGridFormDTO; +import com.epmet.dto.result.StaffSinAgencyResultDTO; +import com.epmet.dto.result.StaffSinDeptResultDTO; +import com.epmet.dto.result.StaffSinGridResultDTO; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:17 上午 + */ +public interface OpenUpService { + + /** + * @Description 网格工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/13 9:42 上午 + */ + List staffSinGrid(StaffSinGridFormDTO formDTO); + + /** + * @Description 部门工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/13 9:51 上午 + */ + List staffSinDept(StaffSinDeptFormDTO formDTO); + + /** + * @Description 机关工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/17 9:59 上午 + */ + List staffSinAgency(StaffSinAgencyFormDTO 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 new file mode 100644 index 0000000000..38120535b9 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java @@ -0,0 +1,126 @@ +package com.epmet.service.impl; + +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.Result; +import com.epmet.constant.ModuleConstant; +import com.epmet.dto.form.*; +import com.epmet.dto.result.StaffSinAgencyResultDTO; +import com.epmet.dto.result.StaffSinDeptResultDTO; +import com.epmet.dto.result.StaffSinGridResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.service.OpenUpService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:18 上午 + */ +@Service +public class OpenUpServiceImpl implements OpenUpService { + + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + + /** + * @Description 网格工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/13 9:42 上午 + */ + @Override + public List staffSinGrid(StaffSinGridFormDTO formDTO) { + CommonGridIdFormDTO commonGridId = new CommonGridIdFormDTO(); + commonGridId.setGridId(formDTO.getGridId()); + commonGridId.setUserId(UUID.randomUUID().toString().replace(StrConstant.HYPHEN, "")); + Result> gridStaffs = govOrgOpenFeignClient.getGridStaffs(commonGridId); + if (!gridStaffs.success()){ + throw new RenException(ModuleConstant.ERROR_GOV_ORG_GRID); + } + if (gridStaffs.getData().size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return this.getStaffList(gridStaffs.getData()); + } + + /** + * @Description 部门工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/13 9:51 上午 + */ + @Override + public List staffSinDept(StaffSinDeptFormDTO formDTO) { + DepartmentIdFormDTO departmentId = new DepartmentIdFormDTO(); + departmentId.setDepartmentId(formDTO.getDepartmentId()); + Result> departmentStaffs = govOrgOpenFeignClient.getDepartmentStaffs(departmentId); + if (!departmentStaffs.success()){ + throw new RenException(ModuleConstant.ERROR_GOV_ORG_DEPARTMENT); + } + if (departmentStaffs.getData().size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + List data = this.getStaffList(departmentStaffs.getData()); + List result = new ArrayList<>(); + data.forEach(staff -> { + StaffSinDeptResultDTO dept = new StaffSinDeptResultDTO(); + BeanUtils.copyProperties(staff,dept); + result.add(dept); + }); + return result; + } + + /** + * @Description 机关工作人员 被禁用的、未激活的不显示 + * @param formDTO + * @author zxc + * @date 2020/8/17 9:59 上午 + */ + @Override + public List staffSinAgency(StaffSinAgencyFormDTO formDTO) { + AgencyIdFormDTO agencyId = new AgencyIdFormDTO(); + agencyId.setAgencyId(formDTO.getAgencyId()); + Result> agencyStaffs = govOrgOpenFeignClient.getAgencyStaffs(agencyId); + if (!agencyStaffs.success()){ + throw new RenException(ModuleConstant.ERROR_GOV_ORG_AGENCY); + } + if (agencyStaffs.getData().size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + List staffList = this.getStaffList(agencyStaffs.getData()); + List result = new ArrayList<>(); + staffList.forEach(staff -> { + StaffSinAgencyResultDTO agency = new StaffSinAgencyResultDTO(); + BeanUtils.copyProperties(staff,agency); + result.add(agency); + }); + return result; + } + + /** + * @Description 获取工作人员信息 + * @param userIds + * @author zxc + * @date 2020/8/17 1:30 下午 + */ + public List getStaffList(List userIds){ + UserIdsFormDTO userIdsForm = new UserIdsFormDTO(); + userIdsForm.setUserIds(userIds); + Result> staffInfoList = epmetUserOpenFeignClient.getStaffInfoList(userIdsForm); + if (!staffInfoList.success()){ + throw new RenException(ModuleConstant.ERROR_EPMET_USER); + } + return staffInfoList.getData(); + } + +} 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 new file mode 100644 index 0000000000..8f43acbf19 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml @@ -0,0 +1,100 @@ +server: + port: @server.port@ + servlet: + context-path: /epmet/ext + +spring: + main: + allow-bean-definition-overriding: true + application: + name: epmet-ext-server + # dev|test|prod + profiles: + active: dev + 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@ + cloud: + nacos: + discovery: + server-addr: @nacos.server-addr@ + 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 + 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 +management: + endpoints: + web: + exposure: + include: "*" + endpoint: + health: + show-details: ALWAYS + +mybatis-plus: + mapper-locations: classpath:/mapper/**/*.xml + typeAliasesPackage: com.epmet.entity + global-config: + db-config: + id-type: ID_WORKER + 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 + +ribbon: + ReadTimeout: 300000 + ConnectTimeout: 300000 + +pagehelper: + helper-dialect: mysql + reasonable: false \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/db/migration/V0.0.1__demo.sql @@ -0,0 +1 @@ +select 0; \ No newline at end of file diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..ec4a9fc8e0 --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/logback-spring.xml @@ -0,0 +1,164 @@ + + + + + + + + + + ${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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/epmet-ext/pom.xml b/epmet-module/epmet-ext/pom.xml new file mode 100644 index 0000000000..795eb9a45f --- /dev/null +++ b/epmet-module/epmet-ext/pom.xml @@ -0,0 +1,21 @@ + + + + epmet-module + com.epmet + 2.0.0 + + 4.0.0 + + epmet-ext + pom + + + epmet-ext-client + epmet-ext-server + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java index 267de1b18d..8043413311 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/EpmetHeartOpenFeignClient.java @@ -2,9 +2,11 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.ActInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; import com.epmet.feign.fallback.EpmetHeartOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -28,4 +30,15 @@ public interface EpmetHeartOpenFeignClient { **/ @PostMapping("/heart/resi/volunteer/volunteeruserids") Result> volunteerUserIds(@RequestBody CommonCustomerFormDTO customerFormDTO); + + /** + * 查询用户创建的未结束的活动 + * + * @author zhaoqifeng + * @date 2020/8/28 14:38 + * @param staffId + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("/heart/resi/act/published/{staffId}") + Result> getPublishedAct(@PathVariable String staffId); } diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java index 7208b30d92..8c4f0be34a 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.java +++ b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/feign/fallback/EpmetHeartOpenFeignClientFallback.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.ActInfoDTO; import com.epmet.dto.form.CommonCustomerFormDTO; import com.epmet.feign.EpmetHeartOpenFeignClient; import org.springframework.stereotype.Component; @@ -29,4 +30,9 @@ public class EpmetHeartOpenFeignClientFallback implements EpmetHeartOpenFeignCli public Result> volunteerUserIds(CommonCustomerFormDTO customerFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "volunteerUserIds", customerFormDTO); } + + @Override + public Result> getPublishedAct(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_HEART_SERVER, "getPublishedAct", staffId); + } } 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 044248ebe9..297fb4a40f 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.52 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-heart-server:0.0.53 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 a9c0439d2b..5b963aa293 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.52 + 0.0.53 com.epmet epmet-heart @@ -130,8 +130,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java index e0f41b198d..73fe6adeb8 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/ResiActListController.java @@ -3,6 +3,7 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.ActInfoDTO; import com.epmet.dto.form.resi.*; import com.epmet.dto.result.resi.*; import com.epmet.service.*; @@ -331,4 +332,16 @@ public class ResiActListController { ValidatorUtils.validateEntity(formDTO, ResiActContentFormDTO.AddUserInternalGroup.class); return actInfoService.checkSignInTime(formDTO); } + + /** + * 查询用户创建的未结束的活动 + * @author zhaoqifeng + * @date 2020/8/28 14:37 + * @param staffId + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("published/{staffId}") + public Result> getPublishedAct(@PathVariable String staffId) { + return new Result>().ok(actInfoService.getPublishedAct(staffId)); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java index b4fea5476a..2a1522348e 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/ActInfoDao.java @@ -310,4 +310,13 @@ public interface ActInfoDao extends BaseDao { * @Date 11:00 2020-07-20 **/ List selectListLookBackActAssembly(ResiLatestActFormDTO formDTO); + + /** + * 查询用户创建的未结束的活动 + * @author zhaoqifeng + * @date 2020/8/28 14:27 + * @param staffId + * @return java.util.List + */ + List selectPublishedAct(@Param("staffId") String staffId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java index d1f698480d..dc36ccda4f 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/ActInfoService.java @@ -245,4 +245,13 @@ public interface ActInfoService extends BaseService { * @Date 15:03 2020-08-05 **/ Result checkSignInTime(ResiActContentFormDTO formDTO); + + /** + * 查询用户创建的未结束的活动 + * @author zhaoqifeng + * @date 2020/8/28 14:32 + * @param staffId + * @return java.util.List + */ + List getPublishedAct(String staffId); } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java index 0691836f68..9f3649d421 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/ActInfoServiceImpl.java @@ -416,4 +416,9 @@ public class ActInfoServiceImpl extends BaseServiceImpl().ok(resultDTO); } + + @Override + public List getPublishedAct(String staffId) { + return baseDao.selectPublishedAct(staffId); + } } diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml index 20bc885ec1..4ce15b04c7 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/ActInfoDao.xml @@ -758,4 +758,12 @@ ORDER BY a.CREATED_TIME DESC LIMIT 0, #{num} + diff --git a/epmet-module/epmet-job/epmet-job-server/pom.xml b/epmet-module/epmet-job/epmet-job-server/pom.xml index c6d3a7a333..3b0c5fcbf5 100644 --- a/epmet-module/epmet-job/epmet-job-server/pom.xml +++ b/epmet-module/epmet-job/epmet-job-server/pom.xml @@ -127,8 +127,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/epmet-message/epmet-message-server/pom.xml b/epmet-module/epmet-message/epmet-message-server/pom.xml index 9240c470c1..deea95460a 100644 --- a/epmet-module/epmet-message/epmet-message-server/pom.xml +++ b/epmet-module/epmet-message/epmet-message-server/pom.xml @@ -144,8 +144,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/epmet-oss/epmet-oss-server/pom.xml b/epmet-module/epmet-oss/epmet-oss-server/pom.xml index 482d0a206c..8fc5bc1d67 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/pom.xml +++ b/epmet-module/epmet-oss/epmet-oss-server/pom.xml @@ -140,8 +140,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml index 08c9720eee..c67cf5c997 100644 --- a/epmet-module/epmet-point/epmet-point-server/pom.xml +++ b/epmet-module/epmet-point/epmet-point-server/pom.xml @@ -135,8 +135,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CommonCustomerIdAndSrcFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CommonCustomerIdAndSrcFormDTO.java new file mode 100644 index 0000000000..56b920d911 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CommonCustomerIdAndSrcFormDTO.java @@ -0,0 +1,36 @@ +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 公众号客户删除入参DTO + * @NEI https://nei.netease.com/interface/detail/?pid=52285&id=323482 + * @ClassName CommonCustomerIdAndSrcFormDTO + * @Auth wangc + * @Date 2020-08-25 11:02 + */ +@Data +public class CommonCustomerIdAndSrcFormDTO implements Serializable { + private static final long serialVersionUID = -2945388338786885295L; + + public interface CustomerAndSrcGroup extends CustomerClientShowGroup{} + + /** + * 客户Id + * */ + @NotBlank(message = "客户Id不能为空",groups = CustomerAndSrcGroup.class) + private String customerId; + + /** + * 数据来源(dev:开发 test:体验 prod:生产) + * */ + @NotBlank(message = "数据来源不能为空",groups = CustomerAndSrcGroup.class) + private String source; + + @NotBlank(message = "用户Id不能为空",groups = CustomerAndSrcGroup.class) + private String userId; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CommonCustomerIdFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CommonCustomerIdFormDTO.java new file mode 100644 index 0000000000..43860b8d8c --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CommonCustomerIdFormDTO.java @@ -0,0 +1,27 @@ +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 获取客户第三方token 入参DTO + * @NEI https://nei.netease.com/interface/detail/?pid=52285&id=323480 + * @ClassName CommonCustomerIdFormDTO + * @Auth wangc + * @Date 2020-08-25 10:57 + */ +@Data +public class CommonCustomerIdFormDTO implements Serializable { + private static final long serialVersionUID = 3160741101286756024L; + + public interface PaCustomerIdGroup extends CustomerClientShowGroup{} + + /** + * 客户Id + * */ + @NotBlank(message = "客户Id不能为空" , groups = PaCustomerIdGroup.class) + private String customerId; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CustomerAccessTokenInfoFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CustomerAccessTokenInfoFormDTO.java new file mode 100644 index 0000000000..6f544e6f11 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CustomerAccessTokenInfoFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/24 10:03 上午 + */ +@Data +public class CustomerAccessTokenInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 6514918025012507710L; + + public interface CustomerAccessTokenInfo{} + + /** + * 客户ID + */ + @NotBlank(message = "客户ID不能为空",groups = {CustomerAccessTokenInfo.class}) + private String customerId; + + /** + * 客户端类型 + */ + private String clientType; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ModifyDomainFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ModifyDomainFormDTO.java new file mode 100644 index 0000000000..600b4d6b83 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ModifyDomainFormDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.form; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/20 13:44 + */ +@Data +public class ModifyDomainFormDTO implements Serializable { + private static final long serialVersionUID = -1995778975498383130L; + /** + * 客户ID + */ + private String customerId; + /** + * 客户端类型 + */ + private String clientType; + /** + * 操作类型:add 添加,delete 删除,set 覆盖 + */ + private String action; + /** + * request 合法域名 + */ + private List requestDomain; + /** + * socket 合法域名 + */ + private List wsRequestDomain; + /** + * uploadFile 合法域名 + */ + private List uploadDomain; + /** + * downloadFile 合法域名 + */ + private List downloadDomain; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java new file mode 100644 index 0000000000..2518bb28b4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/19 17:46 + */ +@Data +public class WebviewDomainFormDTO implements Serializable { + private static final long serialVersionUID = 8022056850984848597L; + /** + * 客户ID + */ + private String customerId; + /** + * 客户端类型 + */ + private String clientType; + /** + * 操作类型:add 添加,delete 删除,set 覆盖 + */ + private String action; + /** + * 业务域名 + */ + private List webViewDomain; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthAccessTokenClientResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthAccessTokenClientResultDTO.java new file mode 100644 index 0000000000..69b1c4abb1 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthAccessTokenClientResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 授权accessToken和app端的查询返参 + * @ClassName AuthAccessTokenClientResultDTO + * @Auth wangc + * @Date 2020-08-25 13:41 + */ +@Data +public class AuthAccessTokenClientResultDTO implements Serializable { + private static final long serialVersionUID = -642465145534993509L; + + /** + * 客户端类型 + * */ + private String clientType; + + /** + * 调用令牌 + * */ + private String accessToken; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerAccessTokenInfoResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerAccessTokenInfoResultDTO.java new file mode 100644 index 0000000000..33e8129004 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerAccessTokenInfoResultDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/24 10:08 上午 + */ +@Data +public class CustomerAccessTokenInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 7008455455787166150L; + + /** + * 客户名称 + */ + private String customerName; + + /** + * 环境类型 + */ + private String source; + + /** + * 客户ID + */ + private String customerId; + + /** + * 授权方AppId + */ + private String authAppId; + + /** + * 授权方的 accessToken + */ + private String authorizerAccessToken; + + /** + * 授权方的 refreshToken + */ + private String authorizerRefreshToken; + + /** + * accessToken过期事件 + */ + private String expiresInTime; + + /** + * 客户端类型 + */ + private String clientType; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerTokensResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerTokensResultDTO.java new file mode 100644 index 0000000000..212114a4cc --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerTokensResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName CustomerTokensResultDTO + * @Auth wangc + * @Date 2020-08-25 11:16 + */ +@Data +public class CustomerTokensResultDTO implements Serializable { + private static final long serialVersionUID = -6811282503588315365L; + + /** + * 客户Id + * */ + private String customerId = ""; + + /** + * 客户名称 + * */ + private String customerName = ""; + + /** + * 第三方token + * */ + private String componentAccessToken = ""; + + /** + * 授权方居民端token + * */ + private String resiAuthorizerToken = ""; + + /** + * 授权方工作端token + * */ + private String workAuthorizerToken = ""; +} diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml index f745b5cfd0..d4706c5733 100644 --- a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-third-server: container_name: epmet-third-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.131 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-third-server:0.0.134 ports: - "8110:8110" network_mode: host # 使用现有网络 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 d10eea3729..1028ad0be9 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.131 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-third-server:0.0.138 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 c0586fac7e..6eadb9e5f2 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.131 + 0.0.138 com.epmet diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ModuleConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ModuleConstant.java index 544e4da23e..4c1cec0015 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ModuleConstant.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ModuleConstant.java @@ -116,5 +116,9 @@ public interface ModuleConstant { int EIGHTY_NINE_THOUSAND_AND_THREE = 89003; int EIGHTY_NINE_THOUSAND_AND_FOUR = 89004; + /** + * 数据来源 : 生产环境 + * */ + String SRC_PROD = "prod"; } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java index 64a4bb3376..ec2f5e13a6 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java @@ -4,14 +4,18 @@ 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.CustomerAccessTokenInfoFormDTO; import com.epmet.dto.form.GoToAuthFormDTO; import com.epmet.dto.form.OpenAppIdFormDTO; import com.epmet.dto.form.RemoveBindFormDTO; +import com.epmet.dto.result.CustomerAccessTokenInfoResultDTO; import com.epmet.dto.result.GoToAuthResultDTO; import com.epmet.service.AppLetAuthorizationService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @Author zxc * @CreateTime 2020/7/10 15:48 @@ -31,6 +35,7 @@ public class AppLetAuthorizationController { @PostMapping("gotoauth") public Result goToAuth(@LoginUser TokenDto tokenDto, @RequestBody GoToAuthFormDTO formDTO, @RequestHeader("source")String source){ ValidatorUtils.validateEntity(formDTO); + GoToAuthResultDTO goToAuthResultDTO = appLetAuthorizationService.goToAuth(tokenDto,formDTO,source); return new Result().ok(goToAuthResultDTO); } @@ -59,4 +64,16 @@ public class AppLetAuthorizationController { return new Result().ok(openAppId); } + /** + * @Description 查询客户下的小程序基本信息 + * @param customerAccessTokenInfoFormDTO + * @author zxc + * @date 2020/8/24 10:26 上午 + */ + @PostMapping("getcustomeraccesstokeninfo") + public Result> getCustomerAccessTokenInfo(@RequestBody CustomerAccessTokenInfoFormDTO customerAccessTokenInfoFormDTO){ + ValidatorUtils.validateEntity(customerAccessTokenInfoFormDTO, CustomerAccessTokenInfoFormDTO.CustomerAccessTokenInfo.class); + return new Result>().ok(appLetAuthorizationService.getCustomerAccessTokenInfo(customerAccessTokenInfoFormDTO)); + } + } 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 13ad00fc9d..de5cc61d7a 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 @@ -192,5 +192,35 @@ public class PaCustomerController { return new Result().ok(pageData); } + /** + * @Description 获取客户第三方token + * @NEI https://nei.netease.com/interface/detail/req/?pid=52285&id=323480 + * @param param CommonCustomerIdFormDTO.class + * @return Result + * @author wangc + * @date 2020.08.25 15:39 + **/ + @PostMapping("tokenlist") + public Result tokenList(@RequestBody CommonCustomerIdFormDTO param){ + ValidatorUtils.validateEntity(param, CustomerUserFormDTO.CustomerIdGroup.class); + return new Result().ok(paCustomerService.tokenList(param)); + } + + /** + * @Description 公众号客户删除 + * @NEI https://nei.netease.com/interface/detail/?pid=52285&id=323482 + * @param token + * @param param + * @return + * @author wangc + * @date 2020.08.25 15:46 + **/ + @PostMapping("deletepubliccustomer") + public Result deletePublicCustomer(@LoginUser TokenDto token , @RequestBody CommonCustomerIdAndSrcFormDTO param){ + param.setUserId(token.getUserId()); + ValidatorUtils.validateEntity(param, CommonCustomerIdAndSrcFormDTO.CustomerAndSrcGroup.class); + paCustomerService.clearPublicCustomer(param); + return new Result(); + } } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/SettingController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/SettingController.java new file mode 100644 index 0000000000..c7457466e2 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/SettingController.java @@ -0,0 +1,51 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.ModifyDomainFormDTO; +import com.epmet.dto.form.WebviewDomainFormDTO; +import com.epmet.service.SettingService; +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 zhaoqifeng + * @dscription + * @date 2020/8/20 13:50 + */ +@RestController +@RequestMapping("setting") +public class SettingController { + @Autowired + private SettingService settingService; + + /** + * 设置服务器域名 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/8/20 13:51 + */ + @PostMapping("modifydomain") + public Result modifyDomain(@RequestBody ModifyDomainFormDTO formDTO) { + settingService.modifyDomain(formDTO); + return new Result<>(); + } + + /** + * 设置业务域名 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/8/20 13:51 + */ + @PostMapping("setwebviewdomain") + public Result setWebviewDomain(@RequestBody WebviewDomainFormDTO formDTO) { + settingService.setWebviewDomain(formDTO); + return new Result<>(); + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizationInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizationInfoDao.java index 88ba820fba..882a091b1b 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizationInfoDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizationInfoDao.java @@ -21,7 +21,10 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.AuthorizationInfoDTO; import com.epmet.dto.form.AuthorizationInfoFormDTO; import com.epmet.dto.form.AuthorizerAccessTokenFormDTO; +import com.epmet.dto.form.CustomerAccessTokenInfoFormDTO; +import com.epmet.dto.result.AuthAccessTokenClientResultDTO; import com.epmet.dto.result.AuthCodeResultDTO; +import com.epmet.dto.result.CustomerAccessTokenInfoResultDTO; import com.epmet.dto.result.WillOverDueResultDTO; import com.epmet.entity.AuthorizationInfoEntity; import org.apache.ibatis.annotations.Mapper; @@ -99,4 +102,20 @@ public interface AuthorizationInfoDao extends BaseDao { */ List getAuthInfoByCustomerId(@Param("customerId") String customerId); + /** + * @Description 查询客户下的小程序基本信息 + * @param customerAccessTokenInfoFormDTO + * @author zxc + * @date 2020/8/24 10:26 上午 + */ + List getCustomerAccessTokenInfo(CustomerAccessTokenInfoFormDTO customerAccessTokenInfoFormDTO); + + /** + * @Description 查询来源端对应的accessToken + * @param customerId + * @return List + * @author wangc + * @date 2020.08.25 15:24 + **/ + List selectClientToken(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ComponentAccessTokenDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ComponentAccessTokenDao.java index 10a5710c6e..85a5bac687 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ComponentAccessTokenDao.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ComponentAccessTokenDao.java @@ -69,4 +69,13 @@ public interface ComponentAccessTokenDao extends BaseDao { * @Description 查询客户及管理员信息 */ CustomerAndUserResultDTO selectCustomerAndUser(@Param("customerId") String customerId); + + /** + * @Description 清除第三方库中客户的信息 + * @param customerId + * @return + * @author wangc + * @date 2020.08.26 10:44 + **/ + void clearCustomerInfo(@Param("customerId") String customerId); + + /** + * @Description 根据客户Id查询当前客户的来源 + * @param customerId + * @return + * @author wangc + * @date 2020.08.26 10:59 + **/ + String selectSourceById(@Param("customerId") String customerId,@Param("source") String source); } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java index 0d00e16505..3a4167ea99 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java @@ -1,11 +1,15 @@ package com.epmet.service; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.CustomerAccessTokenInfoFormDTO; import com.epmet.dto.form.GoToAuthFormDTO; import com.epmet.dto.form.OpenAppIdFormDTO; import com.epmet.dto.form.RemoveBindFormDTO; +import com.epmet.dto.result.CustomerAccessTokenInfoResultDTO; import com.epmet.dto.result.GoToAuthResultDTO; +import java.util.List; + /** * @Author zxc * @CreateTime 2020/7/10 15:52 @@ -34,4 +38,12 @@ public interface AppLetAuthorizationService { */ String getOpenAppId(OpenAppIdFormDTO formDTO); + /** + * @Description 查询客户下的小程序基本信息 + * @param customerAccessTokenInfoFormDTO + * @author zxc + * @date 2020/8/24 10:26 上午 + */ + List getCustomerAccessTokenInfo(CustomerAccessTokenInfoFormDTO customerAccessTokenInfoFormDTO); + } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaCustomerService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaCustomerService.java index b9c77f90f3..a1b30bd255 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaCustomerService.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaCustomerService.java @@ -213,4 +213,24 @@ public interface PaCustomerService extends BaseService { * @return com.epmet.commons.tools.page.PageData */ PageData getCustomerList(UploadListFormDTO formDTO); + + /** + * @Description 获取客户第三方token + * @NEI https://nei.netease.com/interface/detail/res/?pid=52285&id=323480 + * @param param + * @return + * @author wangc + * @date 2020.08.25 14:51 + **/ + CustomerTokensResultDTO tokenList(CommonCustomerIdFormDTO param); + + /** + * @Description 公众号客户删除 + * @NEI https://nei.netease.com/interface/detail/?pid=52285&id=323482 + * @param param + * @return + * @author wangc + * @date 2020.08.25 15:46 + **/ + void clearPublicCustomer(CommonCustomerIdAndSrcFormDTO param); } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/SettingService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/SettingService.java new file mode 100644 index 0000000000..011b82fa1e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/SettingService.java @@ -0,0 +1,31 @@ +package com.epmet.service; + +import com.epmet.dto.form.ModifyDomainFormDTO; +import com.epmet.dto.form.WebviewDomainFormDTO; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/20 11:11 + */ +public interface SettingService { + /** + * 设置服务器域名 + * + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2020/8/20 13:46 + */ + void modifyDomain(ModifyDomainFormDTO formDTO); + + /** + * 设置业务域名 + * + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2020/8/19 17:49 + */ + void setWebviewDomain(WebviewDomainFormDTO formDTO); +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java index 069b6d0f40..823697b5bb 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java @@ -8,13 +8,16 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.HttpClientManager; import com.epmet.constant.ModuleConstant; +import com.epmet.dao.AuthorizationInfoDao; import com.epmet.dao.BindingAccountDao; import com.epmet.dao.CustomerMpDao; import com.epmet.dao.OpenPlatformAccountDao; +import com.epmet.dto.form.CustomerAccessTokenInfoFormDTO; import com.epmet.dto.form.GoToAuthFormDTO; import com.epmet.dto.form.OpenAppIdFormDTO; import com.epmet.dto.form.RemoveBindFormDTO; import com.epmet.dto.result.AuthorizationInfoResultDTO; +import com.epmet.dto.result.CustomerAccessTokenInfoResultDTO; import com.epmet.dto.result.GoToAuthResultDTO; import com.epmet.redis.RedisThird; import com.epmet.service.AppLetAuthorizationService; @@ -25,6 +28,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import java.util.List; import java.util.Map; /** @@ -45,6 +49,8 @@ public class AppLetAuthorizationServiceImpl implements AppLetAuthorizationServic private RedisThird redisThird; @Autowired private BindingAccountDao bindingAccountDao; + @Autowired + private AuthorizationInfoDao authorizationInfoDao; @Value("${third.platform.appId}") private String componentAppId; @@ -117,4 +123,15 @@ public class AppLetAuthorizationServiceImpl implements AppLetAuthorizationServic } return map.get(ModuleConstant.ERR_MSG).toString(); } + + /** + * @Description 查询客户下的小程序基本信息 + * @param customerAccessTokenInfoFormDTO + * @author zxc + * @date 2020/8/24 10:26 上午 + */ + @Override + public List getCustomerAccessTokenInfo(CustomerAccessTokenInfoFormDTO customerAccessTokenInfoFormDTO) { + return authorizationInfoDao.getCustomerAccessTokenInfo(customerAccessTokenInfoFormDTO); + } } 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 ce3a43181d..611c1a05b4 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 @@ -408,20 +408,23 @@ public class CodeServiceImpl implements CodeService { @Override public List reason(CodeCommonFormDTO formDTO) { List resultList = new ArrayList<>(); - - //获取上传代码信息 - CodeCustomerDTO codeCustomerDTO = codeCustomerService.get(formDTO.getCodeId()); + if (StringUtils.isNotBlank(formDTO.getCodeId())) { + //获取上传代码信息 + CodeCustomerDTO codeCustomerDTO = codeCustomerService.get(formDTO.getCodeId()); + formDTO.setCustomerId(codeCustomerDTO.getCustomerId()); + formDTO.setClientType(codeCustomerDTO.getClientType()); + } //是否授权 - if (!customerMpService.getAuthFlag(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType())) { + if (!customerMpService.getAuthFlag(formDTO.getCustomerId(), formDTO.getClientType())) { throw new RenException("未授权"); } - AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType()); + AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); if (null == authInfo) { throw new RenException("未授权"); } //获取审核结果信息 - List codeAuditResultList = codeAuditResultService.getAuditFailedList(codeCustomerDTO.getCustomerId(), - codeCustomerDTO.getClientType()); + List codeAuditResultList = codeAuditResultService.getAuditFailedList(formDTO.getCustomerId(), + formDTO.getClientType()); codeAuditResultList.forEach(dto -> { ReasonResultDTO result = new ReasonResultDTO(); result.setReason(dto.getReason()); @@ -500,9 +503,9 @@ public class CodeServiceImpl implements CodeService { public PageData history(CodeCommonFormDTO formDTO) { PageHelper.startPage(formDTO.getPage(), formDTO.getLimit()); //获取上传代码信息 - CodeCustomerDTO code = codeCustomerService.get(formDTO.getCodeId()); +// CodeCustomerDTO code = codeCustomerService.get(formDTO.getCodeId()); //获取上传代码信息 - List list = codeOperationHistoryService.getHistoryList(code.getCustomerId(), code.getClientType()); + List list = codeOperationHistoryService.getHistoryList(formDTO.getCustomerId(), formDTO.getClientType()); PageInfo pageInfo = new PageInfo<>(list); return new PageData<>(list, pageInfo.getTotal()); } @@ -572,12 +575,12 @@ public class CodeServiceImpl implements CodeService { //设置服务器域名 WxResult modifyDomain = wxMaCodeService.modifyDomain(authInfo.getAuthorizerAccessToken(), "set"); if (!modifyDomain.success()) { - throw new RenException(modifyDomain.getErrorCode(), modifyDomain.getErrorMsg()); + log.error(modifyDomain.getErrorMsg()); } //设置业务域名 WxResult setWebviewDomain = wxMaCodeService.setWebviewDomain(authInfo.getAuthorizerAccessToken(), "set"); if (!setWebviewDomain.success()) { - throw new RenException(setWebviewDomain.getErrorCode(), setWebviewDomain.getErrorMsg()); + log.error(modifyDomain.getErrorMsg()); } }); } diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java index c77f86e336..5b683027b5 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java @@ -31,6 +31,8 @@ import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; +import com.epmet.constant.CodeConstant; +import com.epmet.constant.ModuleConstant; import com.epmet.constant.PaConstant; import com.epmet.dao.*; import com.epmet.dto.*; @@ -102,6 +104,8 @@ public class PaCustomerServiceImpl extends BaseServiceImpl page(Map params) { @@ -641,4 +645,56 @@ public class PaCustomerServiceImpl extends BaseServiceImpl(list, pageInfo.getTotal()); } + /** + * @Description 获取客户第三方token + * @NEI https://nei.netease.com/interface/detail/res/?pid=52285&id=323480 + * @param param + * @return + * @author wangc + * @date 2020.08.25 14:51 + **/ + @Override + public CustomerTokensResultDTO tokenList(CommonCustomerIdFormDTO param) { + CustomerTokensResultDTO result = new CustomerTokensResultDTO(); + String customerName = baseDao.selectCustomerName(param.getCustomerId()); + String componentAccessToken = componentAccessTokenDao.selectComponentAccessToken(); + List clientList = authorizationInfoDao.selectClientToken(param.getCustomerId()); + result.setCustomerId(param.getCustomerId()); + result.setComponentAccessToken(StringUtils.isBlank(componentAccessToken) ? "" : componentAccessToken); + result.setCustomerName(StringUtils.isBlank(customerName) ? "" : customerName); + if(null != clientList || !clientList.isEmpty()){ + clientList.forEach(client -> { + if(StringUtils.equals(CodeConstant.WORK,client.getClientType())){ + result.setWorkAuthorizerToken(client.getAccessToken()); + }else if(StringUtils.equals(CodeConstant.RESI,client.getClientType())){ + result.setResiAuthorizerToken(client.getAccessToken()); + } + }); + } + return result; + } + + /** + * @Description 公众号客户删除 + * @NEI https://nei.netease.com/interface/detail/?pid=52285&id=323482 + * @param param + * @return + * @author wangc + * @date 2020.08.25 15:46 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void clearPublicCustomer(CommonCustomerIdAndSrcFormDTO param) { + if(StringUtils.equals(ModuleConstant.SRC_PROD,param.getSource())){ + logger.warn("有人试图删除用户的生产数据,试图删除的客户Id:{},操作者Id:{}",param.getCustomerId(),param.getUserId()); + throw new RenException("禁止对生产环境数据进行删除操作!"); + } + String check = baseDao.selectSourceById(param.getCustomerId(),param.getSource()); + if (!StringUtils.equals(check,param.getCustomerId())) { + logger.warn("com.epmet.service.impl.PaCustomerServiceImpl.clearPublicCustomer,客户来源信息不匹配,客户Id:{},来源:{}",param.getCustomerId(),param.getSource()); + return ; + } + baseDao.clearCustomerInfo(param.getCustomerId()); + } + } \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/SettingServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/SettingServiceImpl.java new file mode 100644 index 0000000000..e66d9b086f --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/SettingServiceImpl.java @@ -0,0 +1,64 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.AuthorizationInfoDao; +import com.epmet.dto.AuthorizationInfoDTO; +import com.epmet.dto.form.ModifyDomainFormDTO; +import com.epmet.dto.form.WebviewDomainFormDTO; +import com.epmet.service.SettingService; +import com.epmet.wxapi.param.WxMaModifyDomainReq; +import com.epmet.wxapi.param.WxMaSetWebviewDomainReq; +import com.epmet.wxapi.result.WxResult; +import com.epmet.wxapi.service.WxMaSettingService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/20 11:11 + */ +@Service +public class SettingServiceImpl implements SettingService { + @Autowired + private AuthorizationInfoDao authorizationInfoDao; + @Autowired + private WxMaSettingService wxMaSettingService; + + @Override + public void modifyDomain(ModifyDomainFormDTO formDTO) { + //获取小程序调用令牌 + AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); + if (null == authInfo) { + throw new RenException("未授权"); + } + WxMaModifyDomainReq request = new WxMaModifyDomainReq(); + request.setAction(formDTO.getAction()); + request.setDownloadDomain(formDTO.getDownloadDomain()); + request.setRequestDomain(formDTO.getRequestDomain()); + request.setWsRequestDomain(formDTO.getWsRequestDomain()); + request.setUploadDomain(formDTO.getUploadDomain()); + //设置业务域名 + WxResult setDomain = wxMaSettingService.modifyDomain(authInfo.getAuthorizerAccessToken(), request); + if (!setDomain.success()) { + throw new RenException(setDomain.getErrorCode(), setDomain.getErrorMsg()); + } + } + + @Override + public void setWebviewDomain(WebviewDomainFormDTO formDTO) { + //获取小程序调用令牌 + AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); + if (null == authInfo) { + throw new RenException("未授权"); + } + WxMaSetWebviewDomainReq request = new WxMaSetWebviewDomainReq(); + request.setAction(formDTO.getAction()); + request.setWebViewDomain(formDTO.getWebViewDomain()); + //设置业务域名 + WxResult setWebviewDomain = wxMaSettingService.setWebviewDomain(authInfo.getAuthorizerAccessToken(), request); + if (!setWebviewDomain.success()) { + throw new RenException(setWebviewDomain.getErrorCode(), setWebviewDomain.getErrorMsg()); + } + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaSettingConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaSettingConstant.java new file mode 100644 index 0000000000..488474387f --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaSettingConstant.java @@ -0,0 +1,63 @@ +package com.epmet.wxapi.constant; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/18 13:59 + */ +public interface WxMaSettingConstant { + /** + * 设置服务器域名 + */ + String MODIFY_DOMAIN_URL = "https://api.weixin.qq.com/wxa/modify_domain"; + + /** + * 设置业务域名 + */ + String SET_WEBVIEW_DOMAIN_URL = "https://api.weixin.qq.com/wxa/setwebviewdomain"; + + /** + * 设置名称 + */ + String SET_NICK_NAME_URL = "https://api.weixin.qq.com/wxa/setnickname"; + + /** + * 获取可以设置的所有类目 + */ + String GET_ALL_CATEGORIES_URL = "https://api.weixin.qq.com/cgi-bin/wxopen/getallcategories"; + + /** + * 获取已设置的所有类目 + */ + String GET_CATEGORY_URL = "https://api.weixin.qq.com/cgi-bin/wxopen/getcategory"; + + /** + * 添加类目 + */ + String ADD_CATEGORY_URL = "https://api.weixin.qq.com/cgi-bin/wxopen/addcategory"; + + /** + * 删除类目 + */ + String DELETE_CATEGORY_URL = "https://api.weixin.qq.com/cgi-bin/wxopen/deletecategory"; + + /** + * 修改类目资质信息 + */ + String MODIFY_CATEGORY_URL = "https://api.weixin.qq.com/cgi-bin/wxopen/modifycategory"; + + /** + * 绑定微信用户为体验者 + */ + String BIND_TESTER_URL = "https://api.weixin.qq.com/wxa/bind_tester"; + + /** + * 解除绑定体验者 + */ + String UNBIND_TESTER_URL = "https://api.weixin.qq.com/wxa/unbind_tester"; + + /** + * 获取体验者列表 + */ + String MEMBER_AUTH_URL = "https://api.weixin.qq.com/wxa/memberauth"; +} 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 0c12488f48..23e1077e7c 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 @@ -354,6 +354,8 @@ public enum WxMaErrorMsgEnum { CODE_85062(85062, "手机号黑名单"), + CODE_85015(85015, "该账号不是小程序账号"), + CODE_85016(85016, "域名数量超过限制"), CODE_85017(85017, "没有新增域名,请确认小程序已经添加了域名或该域名是否没有在第三方平台添加"), diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxAddCategoryReq.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxAddCategoryReq.java new file mode 100644 index 0000000000..b0c124ead7 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxAddCategoryReq.java @@ -0,0 +1,42 @@ +package com.epmet.wxapi.param; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/18 15:14 + */ +@NoArgsConstructor +@Data +public class WxAddCategoryReq implements Serializable { + + private static final long serialVersionUID = -3659216114599054052L; + + private List categories; + + @NoArgsConstructor + @Data + public static class CategoriesBean { + /** + * + */ + private int first; + private int second; + private List certicates; + + @NoArgsConstructor + @Data + public static class CerticatesBean { + /** + * + */ + private String key; + private String value; + } + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxBindTesterReq.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxBindTesterReq.java new file mode 100644 index 0000000000..19fffa0854 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxBindTesterReq.java @@ -0,0 +1,18 @@ +package com.epmet.wxapi.param; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/18 15:43 + */ +@Data +public class WxBindTesterReq implements Serializable { + private static final long serialVersionUID = -6509988898376682232L; + @SerializedName("wechatid") + private String weChatId; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxDelCategoryReq.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxDelCategoryReq.java new file mode 100644 index 0000000000..ed640b9405 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxDelCategoryReq.java @@ -0,0 +1,19 @@ +package com.epmet.wxapi.param; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/18 15:22 + */ +@NoArgsConstructor +@Data +public class WxDelCategoryReq implements Serializable { + private static final long serialVersionUID = 7179297618235954140L; + private Integer first; + private Integer second; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxModifyCategoryReq.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxModifyCategoryReq.java new file mode 100644 index 0000000000..02e395164b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxModifyCategoryReq.java @@ -0,0 +1,41 @@ +package com.epmet.wxapi.param; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/18 15:26 + */ +@NoArgsConstructor +@Data +public class WxModifyCategoryReq implements Serializable { + + private static final long serialVersionUID = -428387175986769380L; + /** + * 一级类目 ID + */ + private int first; + /** + * 二级类目 ID + */ + private int second; + /** + * [资质信息]列表 + */ + private List certicates; + + @NoArgsConstructor + @Data + public static class CerticatesBean { + /** + * 资质图片 + */ + private String key; + private String value; + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxGetAllCategoriesResult.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxGetAllCategoriesResult.java new file mode 100644 index 0000000000..455ea42f91 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxGetAllCategoriesResult.java @@ -0,0 +1,61 @@ +package com.epmet.wxapi.result; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/18 14:53 + */ +@NoArgsConstructor +@Data +public class WxGetAllCategoriesResult implements Serializable { + + private static final long serialVersionUID = 4419968653961864521L; + /** + * errcode : 0 + */ + @SerializedName("errcode") + private Integer errCode; + @SerializedName("errmsg") + private String errMsg; + @SerializedName("categories_list") + private CategoriesListBean categoriesList; + @NoArgsConstructor + @Data + public static class CategoriesListBean { + private List categories; + + @NoArgsConstructor + @Data + public static class CategoriesBean { + /** + * id : 0 + */ + private int id; + private QualifyBean qualify; + private String name; + private int level; + private int father; + @SerializedName("sensitive_type") + private int sensitiveType; + private List children; + + @NoArgsConstructor + @Data + public static class QualifyBean { + /** + * exter_list : [] + */ + private String remark; + @SerializedName("exter_list") + private List exterList; + } + } + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaSettingService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaSettingService.java new file mode 100644 index 0000000000..f0088e5136 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaSettingService.java @@ -0,0 +1,134 @@ +package com.epmet.wxapi.service; + +import com.epmet.wxapi.param.*; +import com.epmet.wxapi.result.*; + +import java.util.List; + +/** + * 小程序修改服务器地址、类目管理、成员管理 API(大部分只能是第三方平台调用) + * + * @author zhaoqifeng + * @date 2020/8/18 13:50 + */ +public interface WxMaSettingService { + /** + * 设置服务器域名 + * + * @param accessToken + * @param action + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/7/16 17:21 + */ + WxResult modifyDomain(String accessToken, String action); + + /** + * 设置服务器域名 + * + * @param accessToken + * @param request + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/7/16 17:21 + */ + WxResult modifyDomain(String accessToken, WxMaModifyDomainReq request); + + /** + * 设置业务域名 + * + * @param accessToken + * @param action + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/7/16 17:22 + */ + WxResult setWebviewDomain(String accessToken, String action); + + /** + * 设置业务域名 + * + * @param accessToken + * @param request + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/8/19 17:52 + */ + WxResult setWebviewDomain(String accessToken, WxMaSetWebviewDomainReq request); + + /** + * 获取可以设置的所有类目 + * + * @param accessToken + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/8/18 15:06 + */ + WxResult getAllCategories(String accessToken); + + /** + * 获取已设置的所有类目 + * + * @param accessToken + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/8/6 10:47 + */ + WxResult getCategory(String accessToken); + + /** + * 添加类目 + * + * @param accessToken + * @param request + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/8/18 15:20 + */ + WxResult addCategory(String accessToken, WxAddCategoryReq request); + + /** + * 删除类目 + * + * @param accessToken + * @param request + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/8/18 15:20 + */ + WxResult delCategory(String accessToken, WxDelCategoryReq request); + + /** + * 修改类目资质信息 + * + * @param accessToken + * @param request + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/8/18 15:20 + */ + WxResult modifyCategory(String accessToken, WxModifyCategoryReq request); + + /** + * 绑定微信用户为体验者 + * + * @param accessToken + * @param request + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/8/18 15:45 + */ + WxResult bindTester(String accessToken, WxBindTesterReq request); + + /** + * 解除绑定体验者 + * + * @param accessToken + * @param request + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/8/18 15:45 + */ + WxResult unBindTester(String accessToken, WxBindTesterReq request); + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaSettingServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaSettingServiceImpl.java new file mode 100644 index 0000000000..fc3719ac1e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaSettingServiceImpl.java @@ -0,0 +1,244 @@ +package com.epmet.wxapi.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.wxapi.constant.WxMaCodeConstant; +import com.epmet.wxapi.constant.WxMaSettingConstant; +import com.epmet.wxapi.enums.WxMaErrorMsgEnum; +import com.epmet.wxapi.param.*; +import com.epmet.wxapi.result.*; +import com.epmet.wxapi.service.WxMaSettingService; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/18 13:57 + */ +@Service +public class WxMaSettingServiceImpl implements WxMaSettingService { + private static final String ERR_CODE = "errcode"; + private static final String ERR_MSG = "errmsg"; + + @Autowired + private WxMaDomainDTO wxMaDomainDTO; + + @Override + public WxResult modifyDomain(String accessToken, String action) { + WxResult result = new WxResult<>(); + String url = WxMaSettingConstant.MODIFY_DOMAIN_URL + "?" + "access_token=" + accessToken; + WxMaModifyDomainReq request = new WxMaModifyDomainReq(); + request.setAction(action); + request.setRequestDomain(wxMaDomainDTO.getRequestDomain()); + request.setUploadDomain(wxMaDomainDTO.getUploadDomain()); + request.setWsRequestDomain(wxMaDomainDTO.getWsRequestDomain()); + request.setDownloadDomain(wxMaDomainDTO.getDownloadDomain()); + Result modifyResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request)); + if (!modifyResult.success()) { + result.setErrorCode(modifyResult.getCode()); + result.setErrorMsg(modifyResult.getMsg()); + return result; + } + Gson gson = new Gson(); + WxMaModifyDomainResult domainResult = gson.fromJson(modifyResult.getData(), WxMaModifyDomainResult.class); + result.setErrorCode(domainResult.getErrcode()); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(domainResult.getErrcode())); + result.setData(domainResult); + return result; + } + + @Override + public WxResult modifyDomain(String accessToken, WxMaModifyDomainReq request) { + WxResult result = new WxResult<>(); + String url = WxMaCodeConstant.MODIFY_DOMAIN_URL + "?" + "access_token=" + accessToken; + Result modifyResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request)); + if (!modifyResult.success()) { + result.setErrorCode(modifyResult.getCode()); + result.setErrorMsg(modifyResult.getMsg()); + return result; + } + Gson gson = new Gson(); + WxMaModifyDomainResult domainResult = gson.fromJson(modifyResult.getData(), WxMaModifyDomainResult.class); + result.setErrorCode(domainResult.getErrcode()); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(domainResult.getErrcode())); + return result; + } + + @Override + public WxResult setWebviewDomain(String accessToken, String action) { + WxResult result = new WxResult<>(); + String url = WxMaSettingConstant.SET_WEBVIEW_DOMAIN_URL + "?" + "access_token=" + accessToken; + WxMaSetWebviewDomainReq request = new WxMaSetWebviewDomainReq(); + request.setAction(action); + request.setWebViewDomain(wxMaDomainDTO.getWebviewDomain()); + Result modifyResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request)); + if (!modifyResult.success()) { + result.setErrorCode(modifyResult.getCode()); + result.setErrorMsg(modifyResult.getMsg()); + return result; + } + Gson gson = new Gson(); + WxMaSetWebviewDomainResult domainResult = gson.fromJson(modifyResult.getData(), WxMaSetWebviewDomainResult.class); + result.setErrorCode(domainResult.getErrcode()); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(domainResult.getErrcode())); + result.setData(domainResult); + return result; + } + + @Override + public WxResult setWebviewDomain(String accessToken, WxMaSetWebviewDomainReq request) { + WxResult result = new WxResult<>(); + String url = WxMaCodeConstant.SET_WEBVIEW_DOMAIN_URL + "?" + "access_token=" + accessToken; + Result modifyResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request)); + if (!modifyResult.success()) { + result.setErrorCode(modifyResult.getCode()); + result.setErrorMsg(modifyResult.getMsg()); + return result; + } + Gson gson = new Gson(); + WxMaSetWebviewDomainResult domainResult = gson.fromJson(modifyResult.getData(), WxMaSetWebviewDomainResult.class); + result.setErrorCode(domainResult.getErrcode()); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(domainResult.getErrcode())); + return result; + } + + @Override + public WxResult getAllCategories(String accessToken) { + WxResult result = new WxResult<>(); + String url = WxMaSettingConstant.GET_ALL_CATEGORIES_URL + "?" + "access_token=" + accessToken; + Result modifyResult = HttpClientManager.getInstance().sendGet(url, null); + if (!modifyResult.success()) { + result.setErrorCode(modifyResult.getCode()); + result.setErrorMsg(modifyResult.getMsg()); + return result; + } + Gson gson = new Gson(); + WxGetAllCategoriesResult categoryResult = gson.fromJson(modifyResult.getData(), WxGetAllCategoriesResult.class); + if (categoryResult.getErrCode() != NumConstant.ZERO) { + result.setErrorCode(categoryResult.getErrCode()); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(categoryResult.getErrCode())); + return result; + } + result.setErrorCode(categoryResult.getErrCode()); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(categoryResult.getErrCode())); + result.setData(categoryResult); + return result; + } + + @Override + public WxResult getCategory(String accessToken) { + WxResult result = new WxResult<>(); + String url = WxMaSettingConstant.GET_CATEGORY_URL + "?" + "access_token=" + accessToken; + Result statusResult = HttpClientManager.getInstance().sendGet(url, null); + if (!statusResult.success()) { + result.setErrorCode(statusResult.getCode()); + result.setErrorMsg(statusResult.getMsg()); + return result; + } + Gson gson = new Gson(); + WxOpenGetCategoryResult categoryResult = gson.fromJson(statusResult.getData(), WxOpenGetCategoryResult.class); + if (categoryResult.getErrcode() != NumConstant.ZERO) { + result.setErrorCode(categoryResult.getErrcode()); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(categoryResult.getErrcode())); + return result; + } + result.ok(categoryResult); + return result; + } + + @Override + public WxResult addCategory(String accessToken, WxAddCategoryReq request) { + WxResult result = new WxResult(); + String url = WxMaSettingConstant.ADD_CATEGORY_URL + "?" + "access_token=" + accessToken; + Result categoryResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request)); + if (!categoryResult.success()) { + result.setErrorCode(categoryResult.getCode()); + result.setErrorMsg(categoryResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(categoryResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(jsonObject.getInteger(ERR_CODE))); + return result; + } + + @Override + public WxResult delCategory(String accessToken, WxDelCategoryReq request) { + WxResult result = new WxResult(); + String url = WxMaSettingConstant.DELETE_CATEGORY_URL + "?" + "access_token=" + accessToken; + Result categoryResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request)); + if (!categoryResult.success()) { + result.setErrorCode(categoryResult.getCode()); + result.setErrorMsg(categoryResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(categoryResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(jsonObject.getInteger(ERR_CODE))); + return result; + } + + @Override + public WxResult modifyCategory(String accessToken, WxModifyCategoryReq request) { + WxResult result = new WxResult(); + String url = WxMaSettingConstant.MODIFY_CATEGORY_URL + "?" + "access_token=" + accessToken; + Result categoryResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request)); + if (!categoryResult.success()) { + result.setErrorCode(categoryResult.getCode()); + result.setErrorMsg(categoryResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(categoryResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(jsonObject.getInteger(ERR_CODE))); + return result; + } + + @Override + public WxResult bindTester(String accessToken, WxBindTesterReq request) { + WxResult result = new WxResult<>(); + String url = WxMaSettingConstant.BIND_TESTER_URL + "?" + "access_token=" + accessToken; + Result testerResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request)); + if (!testerResult.success()) { + result.setErrorCode(testerResult.getCode()); + result.setErrorMsg(testerResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(testerResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(jsonObject.getInteger(ERR_CODE))); + result.setData(jsonObject.getString("userstr")); + return result; + } + + @Override + public WxResult unBindTester(String accessToken, WxBindTesterReq request) { + WxResult result = new WxResult(); + String url = WxMaSettingConstant.UNBIND_TESTER_URL + "?" + "access_token=" + accessToken; + Result testerResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request)); + if (!testerResult.success()) { + result.setErrorCode(testerResult.getCode()); + result.setErrorMsg(testerResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(testerResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(WxMaErrorMsgEnum.findMsgByCode(jsonObject.getInteger(ERR_CODE))); + return result; + } + + private String toJson(Object object) { + GsonBuilder gsonBuilder = new GsonBuilder(); + gsonBuilder.setPrettyPrinting(); + Gson gson = gsonBuilder.create(); + return gson.toJson(object); + } + +} 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 d52b94a564..4a3e82e619 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 @@ -123,6 +123,14 @@ third: - https://epmet-dev.elinkservice.cn - https://epmet-test.elinkservice.cn webviewDomain: - - udp://epmet-cloud.elinkservice.cn - - udp://epmet-dev.elinkservice.cn - - udp://epmet-test.elinkservice.cn \ No newline at end of file + - https://epmet-ext.elinkservice.cn + - https://epmet-ext1.elinkservice.cn + - https://epmet-ext2.elinkservice.cn + - https://epmet-ext3.elinkservice.cn + - https://epmet-ext4.elinkservice.cn + - https://epmet-ext5.elinkservice.cn + - https://epmet-ext6.elinkservice.cn + - https://epmet-ext7.elinkservice.cn + - https://epmet-ext8.elinkservice.cn + - https://epmet-ext9.elinkservice.cn + - https://epmet-ext10.elinkservice.cn \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizationInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizationInfoDao.xml index b06647013c..77e38472e8 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizationInfoDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizationInfoDao.xml @@ -99,4 +99,38 @@ AND EXPIRES_IN_TIME > NOW() + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentAccessTokenDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentAccessTokenDao.xml index 3642c1d768..98d52d60b8 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentAccessTokenDao.xml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentAccessTokenDao.xml @@ -48,4 +48,15 @@ AND (UNIX_TIMESTAMP(expires_in_time) - UNIX_TIMESTAMP(NOW())) 900 + + \ 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 40d5efbc3a..11d1b50262 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 @@ -146,4 +146,54 @@ AND id = #{oldCustomerId} + + + DELETE FROM auth_code WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM auth_result_record WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM authorization_info WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM binding_account WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM business_info WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM code_audit_record WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM code_audit_result WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM code_customer WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM code_operation_history WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM customer_mp WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM func_info WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM mini_category_info WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM mini_info WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM mini_network_info WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM open_platform_account WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM pa_customer_agency WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM pa_customer_user_agency WHERE CUSTOMER_ID = #{customerId}; + + DELETE FROM pa_customer WHERE ID = #{customerId}; + + + + \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/pom.xml b/epmet-module/gov-access/gov-access-client/pom.xml index b20a28582a..a0cf511f5f 100644 --- a/epmet-module/gov-access/gov-access-client/pom.xml +++ b/epmet-module/gov-access/gov-access-client/pom.xml @@ -17,5 +17,11 @@ epmet-commons-tools 2.0.0 + + io.swagger + swagger-annotations + 1.5.20 + compile + \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovLanguageDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovLanguageDTO.java new file mode 100644 index 0000000000..ed7f5924db --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovLanguageDTO.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.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 国际化 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Data +public class GovLanguageDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 表名 + */ + private String tableName; + + /** + * 表主键 + */ + private String tableId; + + /** + * 字段名 + */ + private String fieldName; + + /** + * 字段值 + */ + private String fieldValue; + + /** + * 语言 + */ + private String language; + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.java new file mode 100644 index 0000000000..fb130e9c65 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovMenuDTO.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.dto; + +import com.epmet.commons.tools.utils.TreeStringNode; +import com.epmet.dto.result.MenuResourceDTO; +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-03-18 + */ +@Data +public class GovMenuDTO extends TreeStringNode implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 上级ID,一级菜单为0 + */ + private String pid; + + /** + * 菜单名称 + */ + private String name; + + /** + * 菜单URL + */ + private String url; + + /** + * 类型 0:菜单 1:按钮 + */ + private Integer type; + + /** + * 菜单图标 + */ + private String icon; + + /** + * 权限标识,如:sys:menu:save + */ + private String permissions; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 菜单资源 + */ + private List resourceList; + + /** + * 上级菜单名称 + */ + private String parentName; + + /** + * 是否显示,1:显示 0不显示 + */ + private Integer showFlag; +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovResourceDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovResourceDTO.java new file mode 100644 index 0000000000..59a9576598 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovResourceDTO.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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 资源管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Data +public class GovResourceDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 资源编码,如菜单ID + */ + private String resourceCode; + + /** + * 资源名称 + */ + private String resourceName; + + /** + * 资源URL + */ + private String resourceUrl; + + /** + * 请求方式(如:GET、POST、PUT、DELETE) + */ + private String resourceMethod; + + /** + * 菜单标识 0:非菜单资源 1:菜单资源 + */ + private Integer menuFlag; + + /** + * 认证等级 0:权限认证 1:登录认证 2:无需认证 + */ + private Integer authLevel; + + /** + * 删除标识: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/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleDTO.java new file mode 100644 index 0000000000..efe6643df6 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleDTO.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; + +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-03-18 + */ +@Data +public class GovRoleDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 角色名称 + */ + private String name; + + /** + * 备注 + */ + private String remark; + + /** + * 部门ID + */ + private Long deptId; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 菜单ID列表 + */ + private List menuIdList; + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleMenuDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleMenuDTO.java new file mode 100644 index 0000000000..eacde30cf3 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleMenuDTO.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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 角色菜单关系 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Data +public class GovRoleMenuDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 角色ID + */ + private String roleId; + + /** + * 菜单ID + */ + private String menuId; + + /** + * 删除标识: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/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleUserDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleUserDTO.java new file mode 100644 index 0000000000..d3881edeb2 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/GovRoleUserDTO.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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 角色用户关系 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Data +public class GovRoleUserDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 角色ID + */ + private String roleId; + + /** + * 用户ID + */ + private String userId; + + /** + * 删除标识: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/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/MenuResourceDTO.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/MenuResourceDTO.java new file mode 100644 index 0000000000..86df7d55ca --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/dto/result/MenuResourceDTO.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.dto.result; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 菜单资源 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@ApiModel(value = "菜单资源") +public class MenuResourceDTO { + @ApiModelProperty(value = "资源URL") + private String resourceUrl; + @ApiModelProperty(value = "请求方式(如:GET、POST、PUT、DELETE)") + private String resourceMethod; + +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/MenuFlagEnum.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/MenuFlagEnum.java new file mode 100644 index 0000000000..2a880a728a --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/MenuFlagEnum.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.enums; + +/** + * 菜单资源标识 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum MenuFlagEnum { + /** + * 菜单资源 + */ + YES(1), + /** + * 非菜单资源 + */ + NO(0); + + private int value; + + MenuFlagEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/MenuTypeEnum.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/MenuTypeEnum.java new file mode 100644 index 0000000000..7132fa2ce3 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/MenuTypeEnum.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.enums; + +/** + * 菜单类型枚举 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum MenuTypeEnum { + /** + * 菜单 + */ + MENU(0), + /** + * 按钮 + */ + BUTTON(1); + + private int value; + + MenuTypeEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/RegionLeafEnum.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/RegionLeafEnum.java new file mode 100644 index 0000000000..36300e201f --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/RegionLeafEnum.java @@ -0,0 +1,29 @@ +/** + * Copyright (c) 2019 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.enums; + +/** + * 叶子节点枚举 + * + * @author Mark sunlightcs@gmail.com + */ +public enum RegionLeafEnum { + YES(1), + NO(0); + + private int value; + + RegionLeafEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/RegionLevelEnum.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/RegionLevelEnum.java new file mode 100644 index 0000000000..b29c456897 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/RegionLevelEnum.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2019 人人开源 All rights reserved. + *

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

+ * 版权所有,侵权必究! + */ + +package com.epmet.enums; + +/** + * 行政区域 级别枚举 + * + * @author Mark sunlightcs@gmail.com + */ +public enum RegionLevelEnum { + ONE(1), + TWO(2), + THREE(3); + + private int value; + + RegionLevelEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} diff --git a/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/UserStatusEnum.java b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/UserStatusEnum.java new file mode 100644 index 0000000000..dbc043f529 --- /dev/null +++ b/epmet-module/gov-access/gov-access-client/src/main/java/com/epmet/enums/UserStatusEnum.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.enums; + +/** + * 用户状态 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +public enum UserStatusEnum { + DISABLE(0), + ENABLED(1); + + private int value; + + UserStatusEnum(int value) { + this.value = value; + } + + public int value() { + return this.value; + } +} 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 7a5133aacd..72ebb1216f 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.38 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-access-server:0.3.39 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 f8d9426042..948dca9446 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.38 + 0.3.39 gov-access com.epmet @@ -121,8 +121,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovLanguageController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovLanguageController.java new file mode 100644 index 0000000000..85e8bce73d --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovLanguageController.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.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.GovLanguageDTO; +import com.epmet.service.GovLanguageService; +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-03-18 + */ +@RestController +@RequestMapping("operlanguage") +public class GovLanguageController { + + @Autowired + private GovLanguageService govLanguageService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = govLanguageService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GovLanguageDTO data = govLanguageService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GovLanguageDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + govLanguageService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GovLanguageDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + govLanguageService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + govLanguageService.delete(ids); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovMenuController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovMenuController.java new file mode 100644 index 0000000000..d3a67c889f --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovMenuController.java @@ -0,0 +1,156 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.exception.ErrorCode; +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.dto.GovMenuDTO; +import com.epmet.dto.result.MenuResourceDTO; +import com.epmet.service.GovMenuService; +import com.epmet.service.GovResourceService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * + * 菜单管理 + * + * @author zhaoqifeng + * @date 2020/3/17 16:35 + */ +@RestController +@RequestMapping("menu") +public class GovMenuController { + + @Autowired + private GovMenuService govMenuService; + + @Autowired + private GovResourceService govResourceService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = govMenuService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GovMenuDTO data = govMenuService.get(id); + + //菜单资源列表 + List resourceList = govResourceService.getMenuResourceList(id); + + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GovMenuDTO dto, @LoginUser TokenDto tokenDto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + govMenuService.save(dto,tokenDto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GovMenuDTO dto, @LoginUser TokenDto tokenDto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + govMenuService.update(dto,tokenDto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + govMenuService.delete(ids); + return new Result(); + } + + @DeleteMapping("{id}") + public Result delete(@PathVariable("id") String id, @LoginUser TokenDto tokenDto){ + //效验数据 + AssertUtils.isNull(id, "id"); + + //判断是否有子菜单或按钮 + List list = govMenuService.getListPid(id); + if(list.size() > 0){ + return new Result().error(ErrorCode.SUB_MENU_EXIST); + } + + govMenuService.delete(id, tokenDto); + + return new Result(); + } + + + /** + * 获取菜单列表 + * @param type 类型 + * @return Result> + */ + @GetMapping("list") + public Result> list(Integer type){ + List list = govMenuService.getMenuList(type); + + return new Result>().ok(list); + } + + /** + * 导航 + * @param tokenDto token + * @return List + */ + @GetMapping("nav") + public Result> nav(@LoginUser TokenDto tokenDto){ + List list = govMenuService.getUserMenuNavList(tokenDto); + return new Result>().ok(list); + } + + /** + * 权限标识 + * @param tokenDto token + * @return Set + */ + @GetMapping("permissions") + public Result> permissions(@LoginUser TokenDto tokenDto){ + Set set = govMenuService.getUserPermissions(tokenDto); + return new Result>().ok(set); + } + + /** + * 角色菜单权限 + * @param tokenDto token + * @return + */ + @GetMapping("select") + public Result> select(@LoginUser TokenDto tokenDto){ + List list = govMenuService.getUserMenuList(tokenDto, null); + + return new Result>().ok(list); + } + + /** + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 运营端用户退出系统,清空菜单和操作权限 + * @Date 2020/5/21 18:07 + **/ + @GetMapping("cleargovuseraccess") + public Result clearGovUserAccess(@LoginUser TokenDto tokenDto) { + govMenuService.clearOperUserAccess(tokenDto.getApp(), tokenDto.getClient(), tokenDto.getUserId()); + return new Result(); + } +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovResourceController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovResourceController.java new file mode 100644 index 0000000000..72193db454 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovResourceController.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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.GovResourceDTO; +import com.epmet.service.GovResourceService; +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-03-18 + */ +@RestController +@RequestMapping("govresource") +public class GovResourceController { + + @Autowired + private GovResourceService govResourceService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = govResourceService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GovResourceDTO data = govResourceService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GovResourceDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + govResourceService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GovResourceDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + govResourceService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + govResourceService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.java new file mode 100644 index 0000000000..7a1ded893c --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleController.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.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.GovRoleDTO; +import com.epmet.service.GovRoleMenuService; +import com.epmet.service.GovRoleService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +/** + * 角色管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@RestController +@RequestMapping("govrole") +public class GovRoleController { + + @Autowired + private GovRoleService govRoleService; + @Autowired + private GovRoleMenuService govRoleMenuService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = govRoleService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GovRoleDTO data = govRoleService.get(id); + + //查询角色对应的菜单 + List menuIdList = govRoleMenuService.getMenuIdList(id); + data.setMenuIdList(menuIdList); + + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GovRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + govRoleService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GovRoleDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + govRoleService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + govRoleService.delete(ids); + return new Result(); + } + + + @GetMapping("list") + @ApiOperation("列表") + public Result> list(){ + List data = govRoleService.list(new HashMap<>(1)); + + return new Result>().ok(data); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleMenuController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleMenuController.java new file mode 100644 index 0000000000..8b8a7d8aed --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleMenuController.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.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.GovRoleMenuDTO; +import com.epmet.service.GovRoleMenuService; +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-03-18 + */ +@RestController +@RequestMapping("govrolemenu") +public class GovRoleMenuController { + + @Autowired + private GovRoleMenuService govRoleMenuService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = govRoleMenuService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GovRoleMenuDTO data = govRoleMenuService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GovRoleMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + govRoleMenuService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GovRoleMenuDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + govRoleMenuService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + govRoleMenuService.delete(ids); + return new Result(); + } + + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleUserController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleUserController.java new file mode 100644 index 0000000000..fcd5733a4d --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/controller/GovRoleUserController.java @@ -0,0 +1,132 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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.GovRoleUserDTO; +import com.epmet.service.GovRoleUserService; +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 2020-03-18 + */ +@RestController +@RequestMapping("govroleuser") +public class GovRoleUserController { + + @Autowired + private GovRoleUserService govRoleUserService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = govRoleUserService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + GovRoleUserDTO data = govRoleUserService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody GovRoleUserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + govRoleUserService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody GovRoleUserDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + govRoleUserService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + govRoleUserService.delete(ids); + return new Result(); + } + + + /** + * 获取权限id列表 + * @param id 用户id + * @return List + * @author zhaoqifeng + */ + @GetMapping("getRoleIdList/{id}") + public Result>getRoleIdList(@PathVariable("id") String id) { + List list = govRoleUserService.getRoleIdList(id); + return new Result>().ok(list); + } + + /** + * 保存更新权限 + * @param userId 用户id + * @param roleIdList 权限列表 + * @author zhaoqifeng + */ + @PostMapping("saveOrUpdateRole") + public Result saveOrUpdate(@RequestParam("userId") String userId, @RequestBody List roleIdList) { + govRoleUserService.saveOrUpdate(userId, roleIdList); + return new Result(); + } + + /** + * 根据用户id,删除角色用户关系 + * @param id 用户id + * @return Result + */ + @PostMapping("deleteByUserId") + public Result deleteByUserId(String id) { + govRoleUserService.deleteByUserId(id); + return new Result(); + } + + /** + * 根据用户ids,删除角色用户关系 + * @param ids 用户ids + * @return Result + */ + @PostMapping("deleteByUserIds") + public Result deleteByUserIds(@RequestBody String[] ids) { + govRoleUserService.deleteByUserIds(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovLanguageDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovLanguageDao.java new file mode 100644 index 0000000000..acd505c019 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovLanguageDao.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GovLanguageEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 国际化 + * + * @author Mark sunlightcs@gmail.com + */ +@Mapper +public interface GovLanguageDao extends BaseDao { + + GovLanguageEntity getLanguage(GovLanguageEntity entity); + + void updateLanguage(GovLanguageEntity entity); + + void insertOperLanguageEntity(GovLanguageEntity entity); +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java new file mode 100644 index 0000000000..1e36bff758 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovMenuDao.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GovMenuEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface GovMenuDao extends BaseDao { + + GovMenuEntity getById(@Param("id") String id, @Param("language") String language); + + /** + * 查询所有菜单列表 + * + * @param type 菜单类型 + * @param language 语言 + */ + List getMenuList(@Param("type") Integer type, @Param("language") String language); + + /** + * 查询用户菜单列表 + * + * @param userId 用户ID + * @param type 菜单类型 + * @param language 语言 + */ + List getUserMenuList(@Param("userId") String userId, @Param("type") Integer type, @Param("language") String language); + + + /** + * 根据父菜单,查询子菜单 + * @param pid 父菜单ID + */ + List getListPid(String pid); +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovResourceDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovResourceDao.java new file mode 100644 index 0000000000..4970d56e9c --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovResourceDao.java @@ -0,0 +1,48 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GovResourceEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 资源管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface GovResourceDao extends BaseDao { + /** + * 根据资源编码,删除对应的资源 + * @param code 资源编码 + */ + void deleteByCode(String code); + + /** + * 获取资源列表 + * @param menuId 菜单ID + */ + List getMenuResourceList(String menuId); + + /** + * 获取所有资源列表 + */ + List getResourceList(); + + /** + * 获取用户资源列表 + * @param userId 用户ID + */ + List getUserResourceList(@Param("userId") String userId); +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleDao.java new file mode 100644 index 0000000000..768fc42792 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleDao.java @@ -0,0 +1,24 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GovRoleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface GovRoleDao extends BaseDao { + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleMenuDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleMenuDao.java new file mode 100644 index 0000000000..dc0559acb3 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleMenuDao.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GovRoleMenuEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色菜单关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface GovRoleMenuDao extends BaseDao { + + /** + * 根据角色ID,获取菜单ID列表 + */ + List getMenuIdList(String roleId); + + /** + * 根据角色id,删除角色菜单关系 + * @param roleId 角色id + */ + void deleteByRoleId(String roleId); + + /** + * 根据菜单id,删除角色菜单关系 + * @param menuId 菜单id + */ + void deleteByMenuId(String menuId); + + + /** + * 根据角色ids,删除角色菜单关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(String[] roleIds); +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleUserDao.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleUserDao.java new file mode 100644 index 0000000000..bf400e0584 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/dao/GovRoleUserDao.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.GovRoleUserEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 角色用户关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Mapper +public interface GovRoleUserDao extends BaseDao { + + /** + * 根据角色ids,删除角色用户关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(String[] roleIds); + + /** + * 根据用户ids,删除角色用户关系 + * @param userIds 用户ids + */ + void deleteByUserIds(String[] userIds); + + /** + * 根据角色id,删除角色用户关系 + * @param roleId 角色id + */ + void deleteByRoleId(String roleId); + + /** + * 根据用户id,删除角色用户关系 + * @param userId 用户id + */ + void deleteByUserId(String userId); + + /** + * 角色ID列表 + * @param userId 用户ID + * + * @return + */ + List getRoleIdList(String userId); +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovLanguageEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovLanguageEntity.java new file mode 100644 index 0000000000..ee84f846d9 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovLanguageEntity.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * 国际化 + * + * @author Mark sunlightcs@gmail.com + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_language") +public class GovLanguageEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 表名 + */ + private String tableName; + /** + * 表主键 + */ + private String tableId; + /** + * 字段名 + */ + private String fieldName; + /** + * 字段值 + */ + private String fieldValue; + /** + * 语言 + */ + private String language; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovMenuEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovMenuEntity.java new file mode 100644 index 0000000000..fcb8a5fa38 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovMenuEntity.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 菜单管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_menu") +public class GovMenuEntity extends BaseEpmetEntity { + private static final long serialVersionUID = 1L; + + /** + * 上级ID,一级菜单为0 + */ + private String pid; + /** + * 菜单名称 + */ + @TableField(exist = false) + private String name; + /** + * 菜单URL + */ + private String url; + /** + * 类型 0:菜单 1:按钮 + */ + private Integer type; + /** + * 菜单图标 + */ + private String icon; + /** + * 权限标识,如:sys:menu:save + */ + private String permissions; + /** + * 排序 + */ + private Integer sort; + /** + * 上级菜单名称 + */ + @TableField(exist = false) + private String parentName; + + /** + * 是否显示,1:显示 0不显示 + */ + private Integer showFlag; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovResourceEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovResourceEntity.java new file mode 100644 index 0000000000..1d5d716c22 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovResourceEntity.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 资源管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_resource") +public class GovResourceEntity extends BaseEpmetEntity { + private static final long serialVersionUID = 1L; + + /** + * 资源编码,如菜单ID + */ + private String resourceCode; + /** + * 资源名称 + */ + private String resourceName; + /** + * 资源URL + */ + private String resourceUrl; + /** + * 请求方式(如:GET、POST、PUT、DELETE) + */ + private String resourceMethod; + /** + * 菜单标识 0:非菜单资源 1:菜单资源 + */ + private Integer menuFlag; + /** + * 认证等级 0:权限认证 1:登录认证 2:无需认证 + */ + private Integer authLevel; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleEntity.java new file mode 100644 index 0000000000..4bc4575836 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleEntity.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.entity; + +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; +import lombok.EqualsAndHashCode; + +/** + * 角色管理 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_role") +public class GovRoleEntity extends BaseEpmetEntity { + private static final long serialVersionUID = 1L; + + /** + * 角色名称 + */ + private String name; + /** + * 备注 + */ + private String remark; + /** + * 部门ID + */ + @TableField(fill = FieldFill.INSERT) + private Long deptId; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleMenuEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleMenuEntity.java new file mode 100644 index 0000000000..6ea4d1f2a5 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleMenuEntity.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 角色菜单关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_role_menu") +public class GovRoleMenuEntity extends BaseEpmetEntity { + private static final long serialVersionUID = 1L; + /** + * 角色ID + */ + private String roleId; + /** + * 菜单ID + */ + private String menuId; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleUserEntity.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleUserEntity.java new file mode 100644 index 0000000000..599ca7f3e2 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/entity/GovRoleUserEntity.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 角色用户关系 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("gov_role_user") +public class GovRoleUserEntity extends BaseEpmetEntity { + private static final long serialVersionUID = 1L; + + /** + * 角色ID + */ + private String roleId; + /** + * 用户ID + */ + private String userId; + +} diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java index eaabe43f49..d88b8358a3 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/feign/EpmetUserFeignClient.java @@ -3,6 +3,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.GovStaffRoleDTO; +import com.epmet.dto.OperUserDTO; import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.form.StaffGridVisitedFormDTO; import com.epmet.dto.form.StaffRoleFormDTO; @@ -60,5 +61,17 @@ public interface EpmetUserFeignClient { */ @PostMapping("/epmetuser/staffrole/staffroles") Result> getRolesOfStaff(StaffRoleFormDTO staffRoleFormDTO); + + /** + * + * 根据id查询运营人员详情 + * + * @param operUserId oper_user表主键 + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/3/19 09:28 + **/ + @GetMapping("/operuser/queryOperUserDtoById/{operUserId}") + Result info(@PathVariable("operUserId") String operUserId); } diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java index 12a4b4e6c6..cd39c87452 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/feign/fallback/EpmetUserFeignClientFallback.java @@ -5,6 +5,7 @@ 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.GovStaffRoleDTO; +import com.epmet.dto.OperUserDTO; import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.dto.form.StaffGridVisitedFormDTO; import com.epmet.dto.form.StaffRoleFormDTO; @@ -31,6 +32,12 @@ public class EpmetUserFeignClientFallback implements EpmetUserFeignClient { public Result> getRolesOfStaff(StaffRoleFormDTO staffRoleFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getRolesOfStaff"); } + + @Override + public Result info(String operUserId) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "info", operUserId); + } + @Override public Result getStaffLatestGrid(LatestGridFormDTO latestGridFormDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffLatestGrid",latestGridFormDTO); diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovLanguageRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovLanguageRedis.java new file mode 100644 index 0000000000..8f9595582b --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovLanguageRedis.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-03-18 + */ +@Component +public class GovLanguageRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovMenuRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovMenuRedis.java new file mode 100644 index 0000000000..361d6c3014 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovMenuRedis.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.redis; + +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.utils.HttpContextUtils; +import com.epmet.dto.GovMenuDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.List; +import java.util.Set; + +/** + * 菜单管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Component +public class GovMenuRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(String userId, String app, String client) { + redisUtils.deleteByPattern(RedisKeys.getUserMenuNavKey(userId, app, client, HttpContextUtils.getLanguage())); + redisUtils.delete(RedisKeys.getUserPermissionsKey(userId, app, client)); + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + + public void setUserMenuNavList(String userId, String app, String client, List menuList){ + String key = RedisKeys.getUserMenuNavKey(userId, app, client, HttpContextUtils.getLanguage()); + redisUtils.set(key, menuList); + } + + public List getUserMenuNavList(String userId, String app, String client){ + String key = RedisKeys.getUserMenuNavKey(userId, app, client, HttpContextUtils.getLanguage()); + return (List)redisUtils.get(key); + } + + public void setUserPermissions(String userId, String app, String client, Set permsSet){ + String key = RedisKeys.getUserPermissionsKey(userId, app, client); + redisUtils.set(key, permsSet); + } + + public Set getUserPermissions(String userId, String app, String client){ + String key = RedisKeys.getUserPermissionsKey(userId, app, client); + return (Set)redisUtils.get(key); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovResourceRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovResourceRedis.java new file mode 100644 index 0000000000..e21bd5095c --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovResourceRedis.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.redis; + +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 资源管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Component +public class GovResourceRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete() { + String key = RedisKeys.getSysResourceKey(); + + redisUtils.delete(key); + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleMenuRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleMenuRedis.java new file mode 100644 index 0000000000..c778d22c7d --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleMenuRedis.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-03-18 + */ +@Component +public class GovRoleMenuRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleRedis.java new file mode 100644 index 0000000000..3e87e447dd --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleRedis.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-03-18 + */ +@Component +public class GovRoleRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleUserRedis.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleUserRedis.java new file mode 100644 index 0000000000..7a7aad6c8c --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovRoleUserRedis.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-03-18 + */ +@Component +public class GovRoleUserRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovLanguageService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovLanguageService.java new file mode 100644 index 0000000000..1f4a5e65e3 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovLanguageService.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; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GovLanguageDTO; +import com.epmet.entity.GovLanguageEntity; + +import java.util.List; +import java.util.Map; + +/** + * 国际化 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +public interface GovLanguageService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GovLanguageDTO + * @author generator + * @date 2020-03-18 + */ + GovLanguageDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void save(GovLanguageDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void update(GovLanguageDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-18 + */ + void delete(String[] ids); + + /** + * 保存或更新 + * @param tableName 表名 + * @param tableId 表主键 + * @param fieldName 字段名 + * @param fieldValue 字段值 + * @param language 语言 + */ + void saveOrUpdate(String tableName, String tableId, String fieldName, String fieldValue, String language); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovMenuService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovMenuService.java new file mode 100644 index 0000000000..b5c0cf12a3 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovMenuService.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.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.dto.GovMenuDTO; +import com.epmet.entity.GovMenuEntity; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * 菜单管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +public interface GovMenuService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GovMenuDTO + * @author generator + * @date 2020-03-18 + */ + GovMenuDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void save(GovMenuDTO dto, TokenDto tokenDto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void update(GovMenuDTO dto, TokenDto tokenDto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-18 + */ + void delete(String[] ids); + + /** + * 删除 + * + * @param id id + * @author generator + * @date 2020-03-18 + */ + void delete(String id, TokenDto tokenDto); + + /** + * 用户菜单列表 + * + * @param tokenDto 用户信息 + * @param type 菜单类型 + * @return java.util.List + */ + List getUserMenuList(TokenDto tokenDto, Integer type); + + /** + * 菜单列表 + * + * @param type 菜单类型 + */ + List getMenuList(Integer type); + + /** + * 用户菜单导航 + * @param tokenDto 用户信息 + * @return java.util.List + */ + List getUserMenuNavList(TokenDto tokenDto); + + /** + * 获取用户权限标识 + * @param tokenDto 用户信息 + * @return java.util.Set + */ + Set getUserPermissions(TokenDto tokenDto); + + /** + * 根据父菜单,查询子菜单 + * @param pid 父菜单ID + */ + List getListPid(String pid); + + void clearOperUserAccess(String app, String client, String userId); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovResourceService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovResourceService.java new file mode 100644 index 0000000000..8b6b8f5e6d --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovResourceService.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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GovResourceDTO; +import com.epmet.dto.result.MenuResourceDTO; +import com.epmet.entity.GovResourceEntity; + +import java.util.List; +import java.util.Map; + +/** + * 资源管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +public interface GovResourceService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GovResourceDTO + * @author generator + * @date 2020-03-18 + */ + GovResourceDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void save(GovResourceDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void update(GovResourceDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-18 + */ + void delete(String[] ids); + + /** + * 保存菜单资源 + * @param menuId 菜单ID + * @param menuName 菜单名称 + * @param resourceList 资源列表 + */ + void saveMenuResource(String menuId, String menuName, List resourceList); + + /** + * 获取菜单资源列表 + * @param menuId 菜单ID + */ + List getMenuResourceList(String menuId); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleMenuService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleMenuService.java new file mode 100644 index 0000000000..7b0d2af34a --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleMenuService.java @@ -0,0 +1,125 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.GovRoleMenuDTO; +import com.epmet.entity.GovRoleMenuEntity; + +import java.util.List; +import java.util.Map; + +/** + * 角色菜单关系 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +public interface GovRoleMenuService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GovRoleMenuDTO + * @author generator + * @date 2020-03-18 + */ + GovRoleMenuDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void save(GovRoleMenuDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void update(GovRoleMenuDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-18 + */ + void delete(String[] ids); + + /** + * 根据角色ID,获取菜单ID列表 + */ + List getMenuIdList(String roleId); + + /** + * 保存或修改 + * @param roleId 角色ID + * @param menuIdList 菜单ID列表 + */ + void saveOrUpdate(String roleId, List menuIdList); + + /** + * 根据角色id,删除角色菜单关系 + * @param roleId 角色id + */ + void deleteByRoleId(String roleId); + + /** + * 根据角色ids,删除角色菜单关系 + * @param roleIds + */ + void deleteByRoleIds(String[] roleIds); + + /** + * 根据菜单id,删除角色菜单关系 + * @param menuId 菜单id + */ + void deleteByMenuId(String menuId); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.java new file mode 100644 index 0000000000..4fbf7e0f58 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleService.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.GovRoleDTO; +import com.epmet.entity.GovRoleEntity; + +import java.util.List; +import java.util.Map; + +/** + * 角色管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +public interface GovRoleService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GovRoleDTO + * @author generator + * @date 2020-03-18 + */ + GovRoleDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void save(GovRoleDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void update(GovRoleDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-18 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleUserService.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleUserService.java new file mode 100644 index 0000000000..ff67c7d239 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/GovRoleUserService.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.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.GovRoleUserDTO; +import com.epmet.entity.GovRoleUserEntity; + +import java.util.List; +import java.util.Map; + +/** + * 角色用户关系 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +public interface GovRoleUserService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-18 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-18 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return GovRoleUserDTO + * @author generator + * @date 2020-03-18 + */ + GovRoleUserDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void save(GovRoleUserDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-18 + */ + void update(GovRoleUserDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-18 + */ + void delete(String[] ids); + + /** + * 保存或修改 + * @param userId 用户ID + * @param roleIdList 角色ID列表 + */ + void saveOrUpdate(String userId, List roleIdList); + + /** + * 根据角色id,删除角色用户关系 + * @param roleId 角色id + */ + void deleteByRoleId(String roleId); + + /** + * 根据用户id,删除角色用户关系 + * @param userId 用户id + */ + void deleteByUserId(String userId); + + /** + * 角色ID列表 + * @param userId 用户ID + * @return List + */ + List getRoleIdList(String userId); + + /** + * 根据角色ids,删除角色用户关系 + * @param roleIds 角色ids + */ + void deleteByRoleIds(String[] roleIds); + + /** + * 根据用户ids,删除角色用户关系 + * @param userIds 用户ids + */ + void deleteByUserIds(String[] userIds); +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovLanguageServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovLanguageServiceImpl.java new file mode 100644 index 0000000000..43e21684ef --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovLanguageServiceImpl.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.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.dao.GovLanguageDao; +import com.epmet.dto.GovLanguageDTO; +import com.epmet.entity.GovLanguageEntity; +import com.epmet.redis.GovLanguageRedis; +import com.epmet.service.GovLanguageService; +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-03-18 + */ +@Service +public class GovLanguageServiceImpl extends BaseServiceImpl implements GovLanguageService { + + @Autowired + private GovLanguageRedis govLanguageRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GovLanguageDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GovLanguageDTO.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 GovLanguageDTO get(String id) { + GovLanguageEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GovLanguageDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GovLanguageDTO dto) { + GovLanguageEntity entity = ConvertUtils.sourceToTarget(dto, GovLanguageEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GovLanguageDTO dto) { + GovLanguageEntity entity = ConvertUtils.sourceToTarget(dto, GovLanguageEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void saveOrUpdate(String tableName, String tableId, String fieldName, String fieldValue, String language) { + GovLanguageEntity entity = new GovLanguageEntity(); + entity.setTableName(tableName); + entity.setTableId(tableId); + entity.setFieldName(fieldName); + entity.setFieldValue(fieldValue); + entity.setLanguage(language); + + //判断是否有数据 + if(baseDao.getLanguage(entity) == null){ + baseDao.insertOperLanguageEntity(entity); + }else { + baseDao.updateLanguage(entity); + } + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java new file mode 100644 index 0000000000..5a6efd43f2 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovMenuServiceImpl.java @@ -0,0 +1,247 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.FieldConstant; +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.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.HttpContextUtils; +import com.epmet.commons.tools.utils.TreeUtils; +import com.epmet.dao.GovMenuDao; +import com.epmet.dto.GovMenuDTO; +import com.epmet.entity.GovMenuEntity; +import com.epmet.enums.MenuTypeEnum; +import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.redis.GovMenuRedis; +import com.epmet.service.GovLanguageService; +import com.epmet.service.GovMenuService; +import com.epmet.service.GovResourceService; +import com.epmet.service.GovRoleMenuService; +import 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; + +import java.util.*; + +/** + * 菜单管理 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-18 + */ +@Service +public class GovMenuServiceImpl extends BaseServiceImpl implements GovMenuService { + protected Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired + private GovMenuRedis govMenuRedis; + @Autowired + private EpmetUserFeignClient epmetUserFeignClient; + @Autowired + private GovRoleMenuService govRoleMenuService; + @Autowired + private GovResourceService govResourceService; + @Autowired + private GovLanguageService govLanguageService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GovMenuDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GovMenuDTO.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 GovMenuDTO get(String id) { + GovMenuEntity entity = baseDao.getById(id, HttpContextUtils.getLanguage()); + + return ConvertUtils.sourceToTarget(entity, GovMenuDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GovMenuDTO dto, TokenDto tokenDto) { + GovMenuEntity entity = ConvertUtils.sourceToTarget(dto, GovMenuEntity.class); + + //保存菜单 + insert(entity); + saveLanguage(entity.getId(), "name", entity.getName()); + + //保存菜单资源 + govResourceService.saveMenuResource(entity.getId(), entity.getName(), dto.getResourceList()); + + //清空当前用户,菜单导航、权限标识 + govMenuRedis.delete(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GovMenuDTO dto, TokenDto tokenDto) { + GovMenuEntity entity = ConvertUtils.sourceToTarget(dto, GovMenuEntity.class); + + //上级菜单不能为自身 + if(entity.getId().equals(entity.getPid())){ + throw new RenException(ErrorCode.SUPERIOR_MENU_ERROR); + } + + //更新菜单 + updateById(entity); + saveLanguage(entity.getId(), "name", entity.getName()); + + //更新菜单资源 + govResourceService.saveMenuResource(entity.getId(), entity.getName(), dto.getResourceList()); + + //清空当前用户,菜单导航、权限标识 + govMenuRedis.delete(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String id, TokenDto tokenDto) { + //逻辑删除 + baseDao.deleteBatchIds(Collections.singletonList(id)); + //删除角色菜单关系 + govRoleMenuService.deleteByMenuId(id); + + //清空当前用户,菜单导航、权限标识 + govMenuRedis.delete(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient()); + } + + @Override + public List getUserMenuList(TokenDto tokenDto, Integer type) { + List menuList; + +// Result govUserDTOResult = epmetUserFeignClient.info(tokenDto.getUserId()); + +// //系统管理员,拥有最高权限 +// if(govUserDTOResult.getData().getSuperAdmin() == SuperAdminEnum.YES.value()){ + menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); +// }else { +// menuList = baseDao.getUserMenuList(tokenDto.getUserId(), type, HttpContextUtils.getLanguage()); +// } + + List dtoList = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class); + + return TreeUtils.buildTree(dtoList); + } + + @Override + public List getMenuList(Integer type) { + List menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); + + List dtoList = ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class); + + return TreeUtils.buildTree(dtoList, Constant.OPER_MENU_ROOT); + } + + @Override + public List getUserMenuNavList(TokenDto tokenDto) { + List menuList = govMenuRedis.getUserMenuNavList(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient()); + if(menuList == null){ + menuList = getUserMenuList(tokenDto, MenuTypeEnum.MENU.value()); + + govMenuRedis.setUserMenuNavList(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient(), menuList); + } + + return menuList; + } + + @Override + public Set getUserPermissions(TokenDto tokenDto) { + //用户权限列表 + Set permsSet = govMenuRedis.getUserPermissions(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient()); + if(permsSet != null){ + return permsSet; + } + +// Result govUserDTOResult = epmetUserFeignClient.info(tokenDto.getUserId()); + + //超级管理员,拥有最高权限 + List menuList; +// if(govUserDTOResult.getData().getSuperAdmin() == SuperAdminEnum.YES.value()){ + menuList = baseDao.getMenuList(MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage()); +// }else{ +// menuList = baseDao.getUserMenuList(tokenDto.getUserId(), MenuTypeEnum.BUTTON.value(), HttpContextUtils.getLanguage()); +// } + + permsSet = new HashSet<>(); + for(GovMenuEntity menu : menuList){ + if(StringUtils.isNotBlank(menu.getPermissions())){ + permsSet.add(menu.getPermissions()); + } + } + + //保存到缓存 + govMenuRedis.setUserPermissions(tokenDto.getUserId(), tokenDto.getApp(), tokenDto.getClient(), permsSet); + + return permsSet; + } + + @Override + public List getListPid(String pid) { + List menuList = baseDao.getListPid(pid); + + return ConvertUtils.sourceToTarget(menuList, GovMenuDTO.class); + } + + @Override + public void clearOperUserAccess(String app, String client, String userId) { + //清空当前用户,菜单导航、权限标识 + govMenuRedis.delete(userId, app, client); + logger.info(String.format("运营端用户退出系统%s,清空菜单、权限成功",userId)); + } + + private void saveLanguage(String tableId, String fieldName, String fieldValue){ + govLanguageService.saveOrUpdate("gov_menu", tableId, fieldName, fieldValue, HttpContextUtils.getLanguage()); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovResourceServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovResourceServiceImpl.java new file mode 100644 index 0000000000..2cb1da7087 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovResourceServiceImpl.java @@ -0,0 +1,143 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.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.security.enums.ResourceAuthEnum; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.GovResourceDao; +import com.epmet.dto.GovResourceDTO; +import com.epmet.dto.result.MenuResourceDTO; +import com.epmet.entity.GovResourceEntity; +import com.epmet.enums.MenuFlagEnum; +import com.epmet.redis.GovResourceRedis; +import com.epmet.service.GovResourceService; +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-03-18 + */ +@Service +public class GovResourceServiceImpl extends BaseServiceImpl implements GovResourceService { + + @Autowired + private GovResourceRedis govResourceRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GovResourceDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GovResourceDTO.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 GovResourceDTO get(String id) { + GovResourceEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GovResourceDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GovResourceDTO dto) { + GovResourceEntity entity = ConvertUtils.sourceToTarget(dto, GovResourceEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GovResourceDTO dto) { + GovResourceEntity entity = ConvertUtils.sourceToTarget(dto, GovResourceEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public void saveMenuResource(String menuId, String menuName, List resourceList) { + //先删除菜单资源关系 + baseDao.deleteByCode(menuId+""); + + //删除缓存 + govResourceRedis.delete(); + + //菜单没有一个资源的情况 + if(CollUtil.isEmpty(resourceList)){ + return ; + } + + //保存菜单资源关系 + for(MenuResourceDTO dto : resourceList){ + GovResourceEntity entity = new GovResourceEntity(); + entity.setResourceCode(menuId+""); + entity.setResourceName(menuName); + entity.setResourceUrl(dto.getResourceUrl()); + entity.setResourceMethod(dto.getResourceMethod()); + entity.setAuthLevel(ResourceAuthEnum.PERMISSIONS_AUTH.value()); + entity.setMenuFlag(MenuFlagEnum.YES.value()); + + //保存 + insert(entity); + } + } + + @Override + public List getMenuResourceList(String menuId) { + List entityList = baseDao.getMenuResourceList(menuId+""); + + return ConvertUtils.sourceToTarget(entityList, MenuResourceDTO.class); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleMenuServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleMenuServiceImpl.java new file mode 100644 index 0000000000..ec31c69146 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleMenuServiceImpl.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.service.impl; + +import cn.hutool.core.collection.CollUtil; +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.dao.GovRoleMenuDao; +import com.epmet.dto.GovRoleMenuDTO; +import com.epmet.entity.GovRoleMenuEntity; +import com.epmet.redis.GovRoleMenuRedis; +import com.epmet.service.GovRoleMenuService; +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-03-18 + */ +@Service +public class GovRoleMenuServiceImpl extends BaseServiceImpl implements GovRoleMenuService { + + @Autowired + private GovRoleMenuRedis govRoleMenuRedis; + @Autowired + private GovRoleMenuDao govRoleMenuDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GovRoleMenuDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GovRoleMenuDTO.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 GovRoleMenuDTO get(String id) { + GovRoleMenuEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GovRoleMenuDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GovRoleMenuDTO dto) { + GovRoleMenuEntity entity = ConvertUtils.sourceToTarget(dto, GovRoleMenuEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GovRoleMenuDTO dto) { + GovRoleMenuEntity entity = ConvertUtils.sourceToTarget(dto, GovRoleMenuEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List getMenuIdList(String roleId){ + return baseDao.getMenuIdList(roleId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveOrUpdate(String roleId, List menuIdList) { + //先删除角色菜单关系 + deleteByRoleId(roleId); + + //角色没有一个菜单权限的情况 + if(CollUtil.isEmpty(menuIdList)){ + return ; + } + + //保存角色菜单关系 + for(String menuId : menuIdList){ + GovRoleMenuEntity govRoleMenuEntity = new GovRoleMenuEntity(); + govRoleMenuEntity.setMenuId(menuId); + govRoleMenuEntity.setRoleId(roleId); + + //保存 + insert(govRoleMenuEntity); + } + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByRoleId(String roleId) { + baseDao.deleteByRoleId(roleId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByRoleIds(String[] roleIds) { + govRoleMenuDao.deleteByRoleIds(roleIds); + } + + @Override + public void deleteByMenuId(String menuId) { + baseDao.deleteByMenuId(menuId); + } +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.java new file mode 100644 index 0000000000..5810b420e5 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleServiceImpl.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.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.dao.GovRoleDao; +import com.epmet.dto.GovRoleDTO; +import com.epmet.entity.GovRoleEntity; +import com.epmet.redis.GovRoleRedis; +import com.epmet.service.GovRoleMenuService; +import com.epmet.service.GovRoleService; +import com.epmet.service.GovRoleUserService; +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-03-18 + */ +@Service +public class GovRoleServiceImpl extends BaseServiceImpl implements GovRoleService { + + @Autowired + private GovRoleRedis govRoleRedis; + @Autowired + private GovRoleMenuService govRoleMenuService; + @Autowired + private GovRoleUserService govRoleUserService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GovRoleDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GovRoleDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + String name = (String)params.get(FieldConstant.NAME_HUMP); + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id).like(StringUtils.isNotBlank(name), FieldConstant.NAME, name); + + return wrapper; + } + + @Override + public GovRoleDTO get(String id) { + GovRoleEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GovRoleDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GovRoleDTO dto) { + GovRoleEntity entity = ConvertUtils.sourceToTarget(dto, GovRoleEntity.class); + insert(entity); + //保存角色菜单关系 + govRoleMenuService.saveOrUpdate(entity.getId(), dto.getMenuIdList()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GovRoleDTO dto) { + GovRoleEntity entity = ConvertUtils.sourceToTarget(dto, GovRoleEntity.class); + updateById(entity); + //保存角色菜单关系 + govRoleMenuService.saveOrUpdate(entity.getId(), dto.getMenuIdList()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + + govRoleMenuService.deleteByRoleIds(ids); + + govRoleUserService.deleteByRoleIds(ids); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleUserServiceImpl.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleUserServiceImpl.java new file mode 100644 index 0000000000..21b796cc3b --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovRoleUserServiceImpl.java @@ -0,0 +1,156 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import cn.hutool.core.collection.CollUtil; +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.dao.GovRoleUserDao; +import com.epmet.dto.GovRoleUserDTO; +import com.epmet.entity.GovRoleUserEntity; +import com.epmet.redis.GovRoleUserRedis; +import com.epmet.service.GovRoleUserService; +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-03-18 + */ +@Service +public class GovRoleUserServiceImpl extends BaseServiceImpl implements GovRoleUserService { + + @Autowired + private GovRoleUserRedis govRoleUserRedis; + @Autowired + private GovRoleUserDao govRoleUserDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, GovRoleUserDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, GovRoleUserDTO.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 GovRoleUserDTO get(String id) { + GovRoleUserEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, GovRoleUserDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(GovRoleUserDTO dto) { + GovRoleUserEntity entity = ConvertUtils.sourceToTarget(dto, GovRoleUserEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(GovRoleUserDTO dto) { + GovRoleUserEntity entity = ConvertUtils.sourceToTarget(dto, GovRoleUserEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveOrUpdate(String userId, List roleIdList) { + //先删除角色用户关系 + deleteByUserId(userId); + + //用户没有一个角色权限的情况 + if(CollUtil.isEmpty(roleIdList)){ + return ; + } + + //保存角色用户关系 + for(String roleId : roleIdList){ + GovRoleUserEntity govRoleUserEntity = new GovRoleUserEntity(); + govRoleUserEntity.setUserId(userId); + govRoleUserEntity.setRoleId(roleId); + + //保存 + insert(govRoleUserEntity); + } + } + + @Override + public void deleteByRoleId(String roleId) { + govRoleUserDao.deleteByRoleId(roleId); + } + + @Override + public void deleteByUserId(String userId) { + govRoleUserDao.deleteByUserId(userId); + } + + @Override + public List getRoleIdList(String userId) { + + return baseDao.getRoleIdList(userId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteByRoleIds(String[] roleIds) { + govRoleUserDao.deleteByRoleIds(roleIds); + } + + @Override + public void deleteByUserIds(String[] userIds) { + govRoleUserDao.deleteByUserIds(userIds); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.2__add.sql b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.2__add.sql new file mode 100644 index 0000000000..7933982d49 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/db/migration/V0.0.2__add.sql @@ -0,0 +1,91 @@ +CREATE TABLE `gov_language` ( + `table_name` varchar(32) NOT NULL COMMENT '表名', + `table_id` varchar(64) NOT NULL COMMENT '表主键', + `field_name` varchar(32) NOT NULL COMMENT '字段名', + `field_value` varchar(200) NOT NULL COMMENT '字段值', + `language` varchar(10) NOT NULL COMMENT '语言', + PRIMARY KEY (`table_name`,`table_id`,`field_name`,`language`) USING BTREE, + KEY `idx_table_id` (`table_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='国际化'; +CREATE TABLE `gov_menu` ( + `id` varchar(64) NOT NULL COMMENT 'id', + `pid` varchar(64) DEFAULT NULL COMMENT '上级ID,一级菜单为0', + `url` varchar(200) DEFAULT NULL COMMENT '菜单URL', + `type` tinyint(3) unsigned DEFAULT NULL COMMENT '类型 0:菜单 1:按钮', + `icon` varchar(50) DEFAULT NULL COMMENT '菜单图标', + `permissions` varchar(32) DEFAULT NULL COMMENT '权限标识,如:sys:menu:save', + `sort` int(11) DEFAULT 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 '更新时间', + `SHOW_FLAG` int(11) NOT NULL DEFAULT '1' COMMENT '是否显示,1:显示 0不显示', + PRIMARY KEY (`id`) USING BTREE, + KEY `idx_pid` (`pid`) USING BTREE, + KEY `idx_del_flag` (`DEL_FLAG`) USING BTREE, + KEY `idx_create_date` (`CREATED_TIME`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='菜单管理'; +CREATE TABLE `gov_resource` ( + `id` varchar(64) NOT NULL COMMENT 'id', + `resource_code` varchar(32) DEFAULT NULL COMMENT '资源编码,如菜单ID', + `resource_name` varchar(32) DEFAULT NULL COMMENT '资源名称', + `resource_url` varchar(100) DEFAULT NULL COMMENT '资源URL', + `resource_method` varchar(8) DEFAULT NULL COMMENT '请求方式(如:GET、POST、PUT、DELETE)', + `menu_flag` tinyint(3) unsigned DEFAULT NULL COMMENT '菜单标识 0:非菜单资源 1:菜单资源', + `auth_level` tinyint(3) unsigned DEFAULT NULL COMMENT '认证等级 0:权限认证 1:登录认证 2:无需认证', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `DEL_FLAG` int(11) 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`) USING BTREE, + KEY `idx_resource_code` (`resource_code`) USING BTREE, + KEY `idx_create_date` (`CREATED_TIME`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='资源管理'; +CREATE TABLE `gov_role` ( + `id` varchar(64) NOT NULL COMMENT 'id', + `name` varchar(32) DEFAULT NULL COMMENT '角色名称', + `remark` varchar(100) DEFAULT NULL COMMENT '备注', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `DEL_FLAG` int(11) unsigned DEFAULT NULL COMMENT '删除标识 0:未删除 1:删除', + `dept_id` bigint(20) DEFAULT NULL COMMENT '部门ID', + `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, + KEY `idx_dept_id` (`dept_id`) USING BTREE, + KEY `idx_del_flag` (`DEL_FLAG`) USING BTREE, + KEY `idx_create_date` (`CREATED_TIME`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='角色管理'; +CREATE TABLE `gov_role_menu` ( + `id` varchar(64) NOT NULL COMMENT 'id', + `role_id` varchar(64) DEFAULT NULL COMMENT '角色ID', + `menu_id` varchar(64) DEFAULT NULL COMMENT '菜单ID', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `DEL_FLAG` int(11) 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`) USING BTREE, + KEY `idx_role_id` (`role_id`) USING BTREE, + KEY `idx_menu_id` (`menu_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='角色菜单关系'; +CREATE TABLE `gov_role_user` ( + `id` varchar(64) NOT NULL COMMENT 'id', + `role_id` varchar(64) DEFAULT NULL COMMENT '角色ID', + `user_id` varchar(64) DEFAULT NULL COMMENT '用户ID', + `REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', + `DEL_FLAG` int(11) 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`) USING BTREE, + KEY `idx_role_id` (`role_id`) USING BTREE, + KEY `idx_user_id` (`user_id`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='角色用户关系'; \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovLanguageDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovLanguageDao.xml new file mode 100644 index 0000000000..5b829dc734 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovLanguageDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + INSERT INTO `gov_language` ( `table_name`, `table_id`, `field_name`, `field_value`, `language` ) + VALUES + ( #{tableName}, #{tableId}, #{fieldName}, #{fieldValue}, #{language} ) + + diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovMenuDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovMenuDao.xml new file mode 100644 index 0000000000..90d0b8ee92 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovMenuDao.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovResourceDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovResourceDao.xml new file mode 100644 index 0000000000..8296d14065 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovResourceDao.xml @@ -0,0 +1,25 @@ + + + + + + + delete from gov_resource where resource_code = #{value} + + + + + + + + + diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleDao.xml new file mode 100644 index 0000000000..2de28e07bf --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleDao.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleMenuDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleMenuDao.xml new file mode 100644 index 0000000000..862679b5de --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleMenuDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + update gov_role_menu set del_flag = 1 where del_flag = 0 and role_id in + + #{roleId} + + + + + update gov_role_menu set del_flag = 1 where role_id = #{value} and del_flag = 0 + + + + update gov_role_menu set del_flag = 1 where menu_id = #{value} and del_flag = 0 + + + diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleUserDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleUserDao.xml new file mode 100644 index 0000000000..b5cb172451 --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/GovRoleUserDao.xml @@ -0,0 +1,32 @@ + + + + + + + update gov_role_user set del_flag = 1 where del_flag = 0 and role_id in + + #{roleId} + + + + + update gov_role_user set del_flag = 1 where del_flag = 0 and user_id in + + #{userId} + + + + + update gov_role_user set del_flag = 1 where role_id = #{value} and del_flag = 0 + + + + update gov_role_user set del_flag = 1 where user_id = #{value} and del_flag = 0 + + + + + diff --git a/epmet-module/gov-grid/gov-grid-server/pom.xml b/epmet-module/gov-grid/gov-grid-server/pom.xml index 51b3139806..c5bf66fd08 100644 --- a/epmet-module/gov-grid/gov-grid-server/pom.xml +++ b/epmet-module/gov-grid/gov-grid-server/pom.xml @@ -107,8 +107,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index 9ec2c6e91d..a90b43312d 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -139,8 +139,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false 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 70b7b9f4c1..7c1d15c36f 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.33 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-mine-server:0.3.34 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 7a38a7a7e5..073cf96190 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.33 + 0.3.34 com.epmet gov-mine @@ -133,8 +133,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false 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 de87b9eea4..6c42e6e7dc 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 @@ -220,6 +220,14 @@ public class StaffAgencyServiceImpl implements StaffAgencyService { Result staffGridResult = govOrgFeignClient.getStaffGrid(latestGridFormDTO); if (staffGridResult.success() && null != staffGridResult.getData() && StringUtils.isNotBlank(staffGridResult.getData().getGridId())) { + StaffGridVisitedFormDTO gridRecordParam = new StaffGridVisitedFormDTO(); + gridRecordParam.setGridId(staffGridResult.getData().getGridId()); + gridRecordParam.setCustomerId(latestGridFormDTO.getCustomerId()); + gridRecordParam.setStaffId(latestGridFormDTO.getStaffId()); + Result writeRecordResult = epmetUserFeignClient.saveStaffGridVisitedRecord(gridRecordParam); + if(writeRecordResult.success()){ + logger.warn("com.epmet.service.impl.StaffAgencyServiceImpl.getLatestGrid,工作人员网格访问网格写入失败,staffId:{},gridId:{}",latestGridFormDTO.getStaffId(),staffGridResult.getData().getGridId()); + } return staffGridResult; } } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffTransferRecordDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffTransferRecordDTO.java new file mode 100644 index 0000000000..79899e2e05 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/StaffTransferRecordDTO.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 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/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java new file mode 100644 index 0000000000..44777f5886 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AgencyIdFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/17 10:37 上午 + */ +@Data +public class AgencyIdFormDTO implements Serializable { + + private static final long serialVersionUID = -1719033407335647411L; + + /** + * 部门Id + */ + private String agencyId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerIdFormDTO.java new file mode 100644 index 0000000000..0e853c6275 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/CustomerIdFormDTO.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/8/13 5:56 下午 + */ +@Data +public class CustomerIdFormDTO implements Serializable { + + private static final long serialVersionUID = 4512080710854617599L; + + public interface Customer{} + + @NotBlank(message = "customerId不能为空",groups = {Customer.class}) + private String customerId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentIdFormDTO.java new file mode 100644 index 0000000000..326a86860b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/DepartmentIdFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/13 10:37 上午 + */ +@Data +public class DepartmentIdFormDTO implements Serializable { + + private static final long serialVersionUID = -1718433407335647411L; + + /** + * 部门Id + */ + private String departmentId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridIdFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridIdFormDTO.java new file mode 100644 index 0000000000..89f7e8489b --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GridIdFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/13 10:35 上午 + */ +@Data +public class GridIdFormDTO implements Serializable { + + private static final long serialVersionUID = -1062540828459359881L; + + /** + * 网格Id + */ + private String gridId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffTransferFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffTransferFormDTO.java new file mode 100644 index 0000000000..fad8bc2dd9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/StaffTransferFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/27 16:05 + */ +@NoArgsConstructor +@Data +public class StaffTransferFormDTO implements Serializable { + + private static final long serialVersionUID = -9011669876505775874L; + /** + * 被调动工作人员Id + */ + private String staffId; + /** + * 调动后组织Id + */ + private String agencyId; + /** + * 备注说明 + */ + private String remarks; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java index a02fdb01ee..e4592c5b0b 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencyResultDTO.java @@ -17,6 +17,7 @@ package com.epmet.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -40,4 +41,9 @@ public class AgencyResultDTO implements Serializable { * 机关组织名称 */ private String agencyName = ""; + /** + * 所有上级组织机构ID(以英文:隔开) + */ + @JsonIgnore + private String pids = ""; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridCountResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridCountResultDTO.java new file mode 100644 index 0000000000..1f583338a2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CustomerGridCountResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/14 9:27 上午 + */ +@Data +public class CustomerGridCountResultDTO implements Serializable { + + private static final long serialVersionUID = 386294009143897744L; + + /** + * 客户下的网格数量 + */ + private Integer gridCount; +} 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 new file mode 100644 index 0000000000..4b0d67ca35 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtDeptResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 部门信息 + * @ClassName ExtDeptResultDTO + * @Auth wangc + * @Date 2020-08-17 17:16 + */ +@Data +public class ExtDeptResultDTO implements Serializable { + private static final long serialVersionUID = 1792371558965832432L; + + /** + * 部门Id + * */ + private String deptId; + + /** + * 部门名称 + * */ + private String deptName; +} 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 new file mode 100644 index 0000000000..018c298c50 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtGridResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 网格信息 + * @ClassName ExtGridResultDTO + * @Auth wangc + * @Date 2020-08-17 15:28 + */ +@Data +public class ExtGridResultDTO implements Serializable { + private static final long serialVersionUID = -4531574240525562587L; + + /** + * 网格Id + * */ + private String gridId; + + /** + * 网格名称 + * */ + private String gridName; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtRoleMapResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtRoleMapResultDTO.java new file mode 100644 index 0000000000..fc2083b935 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtRoleMapResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName ExtRoleMapResultDTO + * @Auth wangc + * @Date 2020-08-17 09:19 + */ +@Data +public class ExtRoleMapResultDTO implements Serializable { + private static final long serialVersionUID = 4988555173286922503L; + + /** + * 角色key + * */ + private String roleKey; + + /** + * 角色名称 + * */ + private String roleName; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffInfoResultDTO.java new file mode 100644 index 0000000000..e8d385c116 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffInfoResultDTO.java @@ -0,0 +1,86 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @ClassName ExtStaffInfoResultDTO + * @Auth wangc + * @Date 2020-08-17 09:14 + */ +@Data +public class ExtStaffInfoResultDTO implements Serializable { + private static final long serialVersionUID = 3874334777882476292L; + + /** + * 当前用户id + * */ + private String userId; + /** + * 工作人员昵称 + * */ + private String nickname; + + /** + * 工作人员头像 + * */ + private String profile; + + /** + * + * */ + private String realName; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 客户名称 + * */ + private String customerName; + + /** + * 机关Id + * */ + private String agencyId; + + /** + * 机关名称 + * */ + private String agencyName; + + /** + * 机关路径Id + * */ + private String agencyIdPath; + + /** + * 机关路径名称 + * */ + private String agencyNamePath; + + /** + * 网格Id + * */ + private String gridId; + + /** + * 网格名称 + * */ + private String gridName; + + /** + * 是否管理员标识 1是0否 + * */ + private String adminFlag; + + /** + * 用户角色列表 + * */ + private List roleList; +} 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 new file mode 100644 index 0000000000..9aa4c9b982 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtStaffPermissionResultDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 工作人员数据权限 + * @ClassName ExtStaffPermissionResultDTO + * @Auth wangc + * @Date 2020-08-17 15:24 + */ +@Data +public class ExtStaffPermissionResultDTO implements Serializable { + private static final long serialVersionUID = 2513553862809278219L; + + /** + * 直属机关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<>(); +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtUserInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtUserInfoResultDTO.java new file mode 100644 index 0000000000..a7649e03a2 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ExtUserInfoResultDTO.java @@ -0,0 +1,82 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description + * @ClassName ExtUserInfoResultDTO + * @Auth wangc + * @Date 2020-08-21 17:09 + */ +@Data +public class ExtUserInfoResultDTO implements Serializable { + private static final long serialVersionUID = 5888986115026957874L; + + /** + * 当前用户id + * */ + private String userId = ""; + /** + * 工作人员昵称 + * */ + private String nickname = ""; + + /** + * 工作人员头像 + * */ + private String profile = ""; + + /** + * + * */ + private String realName = ""; + + /** + * 客户Id + * */ + private String customerId = ""; + + /** + * 客户名称 + * */ + private String customerName = ""; + + /** + * 机关Id + * */ + private String agencyId = ""; + + /** + * 机关名称 + * */ + private String agencyName = ""; + + /** + * 机关路径Id + * */ + private String agencyIdPath = ""; + + /** + * 机关路径名称 + * */ + private String agencyNamePath = ""; + + /** + * 网格Id + * */ + private String gridId = ""; + + /** + * 网格名称 + * */ + private String gridName = ""; + + /** + * 用户角色列表 + * */ + private List roleList = new ArrayList<>(); +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInAgencyListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInAgencyListResultDTO.java new file mode 100644 index 0000000000..52261bc95a --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffInAgencyListResultDTO.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.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 工作端-查询当前人员所属组织及所有下级组织--接口返参 + * + * @author sun + */ +@Data +public class StaffInAgencyListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当前组织信息 + */ + private AgencyResultDTO agencyList; + /** + * 下级组织信息(递归) + */ + private List subAgencyList; +} \ No newline at end of file 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 a6bcb7d128..2ebce80475 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 @@ -4,10 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerPartyBranchDTO; -import com.epmet.dto.form.AddAgencyAndStaffFormDTO; -import com.epmet.dto.form.BelongGridNameFormDTO; -import com.epmet.dto.form.ListPartyBranchFormDTO; -import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.fallback.GovOrgOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; @@ -22,7 +19,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:37 */ -// @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = "localhost:8092") +//@FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = "localhost:8092") @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class) public interface GovOrgOpenFeignClient { @@ -187,4 +184,70 @@ public interface GovOrgOpenFeignClient { **/ @PostMapping(value = "/gov/org/customeragency/getStaffOrgList",consumes = MediaType.APPLICATION_JSON_VALUE) Result> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO); + + /** + * @Description 查询一个网格下的所有工作人员 + * @param gridIdFormDTO + * @author zxc + * @date 2020/8/13 10:46 上午 + */ + @PostMapping(value = "/gov/org/customerstaffgrid/getgridstaffs") + Result> getGridStaffs(@RequestBody CommonGridIdFormDTO gridIdFormDTO); + + /** + * @Description 查询部门下工作人员 + * @param formDTO + * @author zxc + * @date 2020/8/13 2:46 下午 + */ + @PostMapping(value = "/gov/org/customerstaffdepartment/getdepartmentstaffs") + Result> getDepartmentStaffs(@RequestBody DepartmentIdFormDTO formDTO); + + /** + * @Description 查询客户下的网格数量 + * @param customerIdFormDTO + * @author zxc + * @date 2020/8/14 9:31 上午 + */ + @PostMapping(value = "/gov/org/customergrid/gridcount") + Result selectGridCount(@RequestBody CustomerIdFormDTO customerIdFormDTO); + + /** + * @Description 查询机关下工作人员 + * @param formDTO + * @author zxc + * @date 2020/8/17 + */ + @PostMapping(value = "/gov/org/customerstaffagency/getagencystaffs") + Result> getAgencyStaffs(@RequestBody AgencyIdFormDTO formDTO); + + /** + * @Description User模块调用gov-org查询工作人员所在机关的信息以及客户信息 + * @param result + * @return + * @author wangc + * @date 2020.08.17 14:11 + **/ + @PostMapping("/gov/org/customeragency/staffinfoext") + Result staffInfoExt(@RequestBody ExtStaffInfoResultDTO result); + + /** + * @Description 根据staffId,查询当前这个用户的数据权限,对外接口 + * @param staffId + * @return + * @author wangc + * @date 2020.08.17 17:30 + **/ + @PostMapping("/gov/org/customeragency/permissionext/{staffId}") + Result staffPermissionExt(@PathVariable(value = "staffId") String staffId); + + /** + * @Description User模块调用gov-org查询用户所在机关的信息以及客户信息 + * @param result ExtStaffInfoResultDTO.class + * @return Result + * @author wangc + * @date 2020.08.17 13:52 + **/ + @PostMapping("/gov/org/customeragency/userinfoext") + Result userInfoExt(@RequestBody ExtUserInfoResultDTO result); } 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 6824fa5e65..8f70da4530 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 @@ -5,10 +5,7 @@ import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerPartyBranchDTO; -import com.epmet.dto.form.AddAgencyAndStaffFormDTO; -import com.epmet.dto.form.BelongGridNameFormDTO; -import com.epmet.dto.form.ListPartyBranchFormDTO; -import com.epmet.dto.form.StaffOrgFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.GovOrgOpenFeignClient; import org.springframework.stereotype.Component; @@ -114,4 +111,39 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result> getStaffOrgList(StaffOrgFormDTO staffOrgFormDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getStaffOrgList", staffOrgFormDTO); } + + @Override + public Result> getGridStaffs(CommonGridIdFormDTO gridIdFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridStaffs", gridIdFormDTO); + } + + @Override + public Result> getDepartmentStaffs(DepartmentIdFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getDepartmentStaffs", formDTO); + } + + @Override + public Result selectGridCount(CustomerIdFormDTO customerIdFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectGridCount", customerIdFormDTO); + } + + @Override + public Result> getAgencyStaffs(AgencyIdFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAgencyStaffs", formDTO); + } + + @Override + public Result staffInfoExt(ExtStaffInfoResultDTO result) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "staffInfoExt", result); + } + + @Override + public Result staffPermissionExt(String staffId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "staffPermissionExt", staffId); + } + + @Override + public Result userInfoExt(ExtUserInfoResultDTO result) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "userInfoExt", result); + } } diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml index c682941726..952b5c665f 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.83 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.87 ports: - "8092:8092" network_mode: host # 使用现有网络 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 006b14bdff..9418cc9ef2 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.83 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-org-server:0.3.88 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 bff2680d39..f7e38a8870 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.83 + 0.3.88 com.epmet gov-org @@ -18,6 +18,11 @@ gov-org-client 2.0.0 + + com.epmet + oper-crm-client + 2.0.0 + com.epmet epmet-commons-mybatis @@ -84,6 +89,12 @@ 2.0.0 compile + + com.epmet + epmet-heart-client + 2.0.0 + compile + @@ -134,8 +145,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java index b1a42c4209..da89288f00 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/CustomerAgencyConstant.java @@ -67,4 +67,8 @@ public interface CustomerAgencyConstant { * 网格党建指导员角色 */ String GRID_PARTY_DIRECTOR = "grid_party_director"; + /** + * 获取工作人员组织信息失败 + */ + String SELECT_STAFF_AGENCY_EXCEPTION = "获取工作人员组织信息失败"; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index 83250c4c17..c8b2350e16 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.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; @@ -193,4 +195,51 @@ public class CustomerAgencyController { Result querySponsorList(@PathVariable("staffId") String staffId){ return new Result().ok(customerAgencyService.querySponsorList(staffId)); } + + /** + * @Description 对外接口 获取工作人员基本信息 + * @param result ExtStaffInfoResultDTO.class + * @return Result + * @author wangc + * @date 2020.08.17 13:52 + **/ + @PostMapping("staffinfoext") + Result staffInfoExt(@RequestBody ExtStaffInfoResultDTO result){ + return new Result().ok(customerAgencyService.staffInfoExt(result)); + } + + /** + * @Description 根据staffId,查询当前这个用户的数据权限,对外接口 + * @param staffId + * @return + * @author wangc + * @date 2020.08.17 17:30 + **/ + @PostMapping("permissionext/{staffId}") + Result staffPermissionExt(@PathVariable(value = "staffId") String staffId){ + return new Result().ok(customerAgencyService.staffPermissionExt(staffId)); + } + + /** + * @Description 对外接口 获用户员基本信息 + * @param result ExtUserInfoResultDTO.class + * @return Result + * @author wangc + * @date 2020.08.17 13:52 + **/ + @PostMapping("userinfoext") + Result userInfoExt(@RequestBody ExtUserInfoResultDTO result){ + return new Result().ok(customerAgencyService.extUserInfo(result)); + } + + /** + * @param tokenDTO + * @return + * @Author sun + * @Description 工作端-查询当前人员所属组织及所有下级组织 + **/ + @PostMapping("staffinagencylist") + public Result staffInAgencyList(@LoginUser TokenDto tokenDTO) { + return new Result().ok(customerAgencyService.staffInAgencyList(tokenDTO.getUserId())); + } } \ No newline at end of file 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 69eecc5d2c..b86bb7df20 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 @@ -216,4 +216,16 @@ public class CustomerGridController { return customerGridService.queryCustomerGridList(formDTO); } + /** + * @Description 查询客户下的网格数量 + * @param customerIdFormDTO + * @author zxc + * @date 2020/8/14 9:31 上午 + */ + @PostMapping("gridcount") + public Result selectGridCount(@RequestBody CustomerIdFormDTO customerIdFormDTO){ + ValidatorUtils.validateEntity(customerIdFormDTO, CustomerIdFormDTO.Customer.class); + return new Result().ok(customerGridService.selectGridCount(customerIdFormDTO)); + } + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java index a92d2d8826..ad965efef7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffAgencyController.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; @@ -28,12 +26,8 @@ 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.CustomerStaffAgencyDTO; -import com.epmet.dto.form.StaffsInAgencyFromDTO; -import com.epmet.dto.form.CommonGridIdFormDTO; -import com.epmet.dto.form.CustomerGridFormDTO; -import com.epmet.dto.result.CommonStaffInfoResultDTO; +import com.epmet.dto.form.AgencyIdFormDTO; import com.epmet.dto.result.LatestCustomerResultDTO; -import com.epmet.dto.result.StaffInfoResultDTO; import com.epmet.excel.CustomerStaffAgencyExcel; import com.epmet.service.CustomerStaffAgencyService; import org.springframework.beans.factory.annotation.Autowired; @@ -111,7 +105,15 @@ public class CustomerStaffAgencyController { return customerStaffAgencyService.getLatestCustomer(userId); } - - + /** + * @Description 查询机关下工作人员 + * @param agencyIdFormDTO + * @author zxc + * @date 2020/8/17 10:14 上午 + */ + @PostMapping("getagencystaffs") + public Result> getAgencyStaffs(@RequestBody AgencyIdFormDTO agencyIdFormDTO){ + return new Result>().ok(customerStaffAgencyService.getAgencyStaffs(agencyIdFormDTO)); + } } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java index ee22c850bb..e61828a3c4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerStaffDepartmentController.java @@ -26,6 +26,7 @@ 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.CustomerStaffDepartmentDTO; +import com.epmet.dto.form.DepartmentIdFormDTO; import com.epmet.excel.CustomerStaffDepartmentExcel; import com.epmet.service.CustomerStaffDepartmentService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +92,16 @@ public class CustomerStaffDepartmentController { ExcelUtils.exportExcelToTarget(response, null, list, CustomerStaffDepartmentExcel.class); } + /** + * @Description 查询部门下工作人员 + * @param formDTO + * @author zxc + * @date 2020/8/13 2:46 下午 + */ + @PostMapping("getdepartmentstaffs") + public Result> getDepartmentStaffs(@RequestBody DepartmentIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(customerStaffDepartmentService.getDepartmentStaffs(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java index 664f425aee..c3187e3e8e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java @@ -10,6 +10,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.StaffInfoFromDTO; import com.epmet.dto.form.StaffSubmitFromDTO; +import com.epmet.dto.form.StaffTransferFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; import com.epmet.dto.result.*; import com.epmet.service.StaffService; @@ -135,4 +136,19 @@ public class StaffController { public Result mine(@RequestBody StaffInfoFromDTO fromDTO){ return new Result().ok(staffService.mine(fromDTO)); } + + /** + * 工作人员调动 + * + * @author zhaoqifeng + * @date 2020/8/27 16:12 + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("stafftransfer") + public Result staffTransfer(@LoginUser TokenDto tokenDto, @RequestBody StaffTransferFormDTO formDTO){ + staffService.staffTransfer(tokenDto, formDTO); + return new Result(); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffTransferRecordController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffTransferRecordController.java new file mode 100644 index 0000000000..4cd9ea0e05 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffTransferRecordController.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.StaffTransferRecordDTO; +import com.epmet.excel.StaffTransferRecordExcel; +import com.epmet.service.StaffTransferRecordService; +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-08-27 + */ +@RestController +@RequestMapping("stafftransferrecord") +public class StaffTransferRecordController { + + @Autowired + private StaffTransferRecordService staffTransferRecordService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = staffTransferRecordService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + StaffTransferRecordDTO data = staffTransferRecordService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody StaffTransferRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + staffTransferRecordService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody StaffTransferRecordDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + staffTransferRecordService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + staffTransferRecordService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = staffTransferRecordService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, StaffTransferRecordExcel.class); + } + +} \ No newline at end of file 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 8a51d3ad19..eeeecf60db 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 @@ -124,4 +124,55 @@ public interface CustomerAgencyDao extends BaseDao { * @Description 递归查询当前机关的下一级机关列表 **/ List selectAllSubAgency(@Param("subAgencyPids") String subAgencyPids); + + /** + * @Description 查询一个工作人员最近登录的网格以及机关信息 + * @param gridId + * @return + * @author wangc + * @date 2020.08.17 09:50 + **/ + ExtStaffInfoResultDTO selectAgencyAndGridInfoExt(@Param("gridId") String gridId); + /** + * @Description 当没有工作人员最近访问的gridId时查询该用户所属的组织机关信息 + * @param staffId + * @return + * @author wangc + * @date 2020.08.17 09:50 + **/ + ExtStaffInfoResultDTO selectAgencyInfoWhenGridIdIsNull(@Param("staffId")String staffId); + /** + * @Description 根据agencyId查找指定机构的信息,直属网格、部门 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.18 13:41 + **/ + ExtStaffPermissionResultDTO selectAgencyById(@Param("agencyId")String agencyId); + + /** + * @Description 根绝agencyId查找其下属机构的信息 + * @param pid + * @return + * @author wangc + * @date 2020.08.18 13:42 + **/ + List selectSubAgencyByPid(@Param("pid") String pid); + + /** + * @Description 根据agencyId查找指定机构直属的部门,将grid与dept分开是因为grid与dept的数量可能不等,造成重复数据无法去重 + * @param agencyId + * @return + * @author wangc + * @date 2020.08.18 13:42 + **/ + List selectDeptList(@Param("agencyId") String agencyId); + + /** + * @param staffId + * @return + * @Author sun + * @Description 查询工作人员所属组织信息 + **/ + AgencyResultDTO selectAgencyByStaffId(@Param("staffId") String staffId); } \ 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 2debda4fce..12d2b81c7e 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 @@ -84,4 +84,13 @@ public interface CustomerDepartmentDao extends BaseDao * @Description 查询机关下部门列表信息 **/ List selectAgencyDeptMsgList(@Param("agencyId") String agencyId); + + /** + * 删除工作人员与部门关联 + * @author zhaoqifeng + * @date 2020/8/28 15:12 + * @param staffId + * @return void + */ + void deleteStaffDep(@Param("staffId") String staffId); } \ 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 09f71efd99..ec450bfa63 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 @@ -216,4 +216,30 @@ public interface CustomerGridDao extends BaseDao { * @Description 单客户-指定区时查询当前城市下除该区之外其余的网格 **/ List selectThirdRestGridWithoutGivenAreaCode(Map map); + + /** + * @Description 查询当前客户已有网格数量 + * @param customerId + * @author zxc + * @date 2020/8/12 5:10 下午 + */ + Integer selectGridCount(@Param("customerId")String customerId); + + /** + * 删除工作人员与网格关联 + * @author zhaoqifeng + * @date 2020/8/28 15:32 + * @param staffId + * @return void + */ + void deleteGridStaff(@Param("staffId") String staffId); + + /** + * 查询工作人员所在网格 + * @author zhaoqifeng + * @date 2020/8/28 15:41 + * @param staffId + * @return java.util.List + */ + List selectGridByStaff(@Param("staffId") String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java index 8cfef54079..ffc46fa725 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java @@ -100,4 +100,12 @@ public interface CustomerStaffAgencyDao extends BaseDao getAgencyStaffList(@Param("agencyId")String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java index 88fc246656..363e575499 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffDepartmentDao.java @@ -66,4 +66,12 @@ public interface CustomerStaffDepartmentDao extends BaseDao selectDeptStaffs(@Param("deptIdList") List deptIdList); + + /** + * @Description 查询部门下的工作人员userId + * @param departmentId + * @author zxc + * @date 2020/8/13 2:53 下午 + */ + List getDepartmentStaffList(@Param("departmentId")String departmentId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffTransferRecordDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffTransferRecordDao.java new file mode 100644 index 0000000000..73b5217498 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.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/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffTransferRecordEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffTransferRecordEntity.java new file mode 100644 index 0000000000..b52c91c45e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/StaffTransferRecordEntity.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 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/gov-org/gov-org-server/src/main/java/com/epmet/excel/StaffTransferRecordExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/StaffTransferRecordExcel.java new file mode 100644 index 0000000000..6729be83f9 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/StaffTransferRecordExcel.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.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-08-27 + */ +@Data +public class StaffTransferRecordExcel { + + @Excel(name = "ID") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "调动人员Id(操作人)") + private String operateStaffId; + + @Excel(name = "被调动人员Id") + private String operatedStaffId; + + @Excel(name = "调动前组织Id") + private String oldAgencyId; + + @Excel(name = "调动后组织Id") + private String agencyId; + + @Excel(name = "备注说明") + private String remarks; + + @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/gov-org/gov-org-server/src/main/java/com/epmet/redis/StaffTransferRecordRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/StaffTransferRecordRedis.java new file mode 100644 index 0000000000..deb0f9f76a --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/StaffTransferRecordRedis.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-08-27 + */ +@Component +public class StaffTransferRecordRedis { + @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-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index cacba8512e..b7a556c5b0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -178,4 +178,39 @@ public interface CustomerAgencyService extends BaseService * @Date 2020/7/23 20:50 **/ ActSponsorResultDTO querySponsorList(String staffId); + + /** + * @Description 查询工作人员的信息,多客户/单客户,epmet-plugin,对外开放调用 + * @param result + * @return + * @author wangc + * @date 2020.08.17 09:29 + **/ + ExtStaffInfoResultDTO staffInfoExt(ExtStaffInfoResultDTO result); + + /** + * @Description 根据staffId,查询当前这个用户的数据权限 + * @param staffId + * @return + * @author wangc + * @date 2020.08.17 17:30 + **/ + ExtStaffPermissionResultDTO staffPermissionExt(String staffId); + + /** + * @Description 查询当前用户的信息,多客户/单客户,epmet-plugin,对外开放调用 + * @param result + * @return + * @author wangc + * @date 2020.08.21 17:31 + **/ + ExtUserInfoResultDTO extUserInfo(ExtUserInfoResultDTO result); + + /** + * @param staffId + * @return + * @Author sun + * @Description 工作端-查询当前人员所属组织及所有下级组织 + **/ + StaffInAgencyListResultDTO staffInAgencyList(String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java index 9722ca82af..bcb0267e38 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerDepartmentService.java @@ -92,4 +92,14 @@ public interface CustomerDepartmentService extends BaseService { * @Description 单客户-陌生人导览模块调用-根据地区编码查询客户下的网格列表 **/ Result> queryCustomerGridList(ThirdCustomerGridListFormDTO formDTO); + + /** + * @Description 查询客户下的网格数量 + * @param customerIdFormDTO + * @author zxc + * @date 2020/8/14 9:31 上午 + */ + CustomerGridCountResultDTO selectGridCount( CustomerIdFormDTO customerIdFormDTO); + + /** + * 更新网格工作人员关系 + * @author zhaoqifeng + * @date 2020/8/28 15:36 + * @param staffId + * @return void + */ + void updateGrid(String staffId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java index 6691351505..8f6f47dfdb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffAgencyService.java @@ -21,6 +21,7 @@ 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.CustomerStaffAgencyDTO; +import com.epmet.dto.form.AgencyIdFormDTO; import com.epmet.dto.form.CommonDepartmentFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; import com.epmet.dto.form.CommonGridIdFormDTO; @@ -142,4 +143,12 @@ public interface CustomerStaffAgencyService extends BaseService getAgencyStaffs(AgencyIdFormDTO agencyIdFormDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffDepartmentService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffDepartmentService.java index f34735eeef..db5fa63d2e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffDepartmentService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerStaffDepartmentService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.CustomerStaffDepartmentDTO; +import com.epmet.dto.form.DepartmentIdFormDTO; import com.epmet.entity.CustomerStaffDepartmentEntity; import java.util.List; @@ -92,4 +93,12 @@ public interface CustomerStaffDepartmentService extends BaseService getDepartmentStaffs(DepartmentIdFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java index 22f423738a..dab238f3fb 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.StaffInfoFromDTO; import com.epmet.dto.form.StaffSubmitFromDTO; +import com.epmet.dto.form.StaffTransferFormDTO; import com.epmet.dto.form.StaffsInAgencyFromDTO; import com.epmet.dto.result.*; @@ -84,11 +85,22 @@ public interface StaffService { /** * 我的基本信息 + * * @author zhaoqifeng * @date 2020/5/22 16:57 * @param fromDTO * @return com.epmet.dto.result.MineResultDTO */ MineResultDTO mine(StaffInfoFromDTO fromDTO); + + /** + * 工作人员调动 + * @author zhaoqifeng + * @date 2020/8/27 16:13 + * @param tokenDto + * @param fromDTO + * @return void + */ + void staffTransfer(TokenDto tokenDto, StaffTransferFormDTO fromDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffTransferRecordService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffTransferRecordService.java new file mode 100644 index 0000000000..8f326cdb27 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffTransferRecordService.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.StaffTransferRecordDTO; +import com.epmet.entity.StaffTransferRecordEntity; + +import java.util.List; +import java.util.Map; + +/** + * 工作人员调动记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-27 + */ +public interface StaffTransferRecordService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-27 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-27 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return StaffTransferRecordDTO + * @author generator + * @date 2020-08-27 + */ + StaffTransferRecordDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-27 + */ + void save(StaffTransferRecordDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-27 + */ + void update(StaffTransferRecordDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-27 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index e399d29b85..db160cba61 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -39,6 +39,7 @@ import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.OperCrmFeignClient; import com.epmet.redis.CustomerAgencyRedis; import com.epmet.service.CustomerAgencyService; +import com.epmet.util.ModuleConstant; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -46,6 +47,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.lang.reflect.Field; import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; @@ -834,4 +836,162 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl customerResult = + operCrmFeignClient.getCustomerInfo(customerParam); + if(customerResult.success() && null != customerResult.getData()){ + result.setCustomerName(customerResult.getData().getCustomerName()); + } + checkFieldAndSetDefault(result); + result.setAdminFlag(NumConstant.ZERO_STR); + if(null != result.getRoleList() && !result.getRoleList().isEmpty()){ + result.getRoleList().forEach(o -> { + if(StringUtils.equals("root_manager",o.getRoleKey())){ + result.setAdminFlag(NumConstant.ONE_STR); + } + }); + } + return result; + } + + /** + * @Description 根据staffId,查询当前这个用户的数据权限 + * @param staffId + * @return + * @author wangc + * @date 2020.08.17 17:30 + **/ + @Override + public ExtStaffPermissionResultDTO staffPermissionExt(String staffId) { + + + CustomerStaffAgencyDTO agency = customerStaffAgencyDao.selectLatestCustomerByStaff(staffId); + if(null == agency || StringUtils.isBlank(agency.getAgencyId())){ + logger.error("com.epmet.service.impl.CustomerAgencyServiceImpl.staffPermissionExt,没有找到工作人员所属的机关信息,用户Id:{}",staffId); + ExtStaffPermissionResultDTO emptyResult = new ExtStaffPermissionResultDTO(); + checkFieldAndSetDefault(emptyResult); + return emptyResult; + } + + ExtStaffPermissionResultDTO res = baseDao.selectAgencyById(agency.getAgencyId()); + return res; + } + + /** + * @Description 查询当前用户的信息,多客户/单客户,epmet-plugin,对外开放调用 + * @param result + * @return + * @author wangc + * @date 2020.08.21 17:31 + **/ + @Override + public ExtUserInfoResultDTO extUserInfo(ExtUserInfoResultDTO result) { + //1.查找对应的所属关系,通过最近一次登陆的网格,通过网格查找对应的机关和客户 + ExtStaffInfoResultDTO orgInfo = + baseDao.selectAgencyAndGridInfoExt(result.getGridId()); + if(null != orgInfo){ + result.setAgencyId(orgInfo.getAgencyId()); + result.setAgencyIdPath(orgInfo.getAgencyIdPath()); + result.setAgencyName(orgInfo.getAgencyName()); + result.setAgencyNamePath(orgInfo.getAgencyNamePath()); + result.setGridName(orgInfo.getGridName()); + } + //2.查找客户名称 + CustomerDTO customerParam = new CustomerDTO(); + customerParam.setId(orgInfo.getCustomerId()); + Result customerResult = + operCrmFeignClient.getCustomerInfo(customerParam); + if(customerResult.success() && null != customerResult.getData()){ + result.setCustomerName(customerResult.getData().getCustomerName()); + } + return result; + } + + + public void mergeObject(T origin, T destination) { + if (origin == null || destination == null) + return; + if (!origin.getClass().equals(destination.getClass())) + return; + + Field[] fields = origin.getClass().getDeclaredFields(); + for (int i = 0; i < fields.length; i++) { + try { + fields[i].setAccessible(true); + Object value = fields[i].get(origin); + if (null != value) { + fields[i].set(destination, value); + } + fields[i].setAccessible(false); + } catch (Exception e) { + + } + } + } + + + + public void checkFieldAndSetDefault(T origin) { + if (origin == null) + return; + Field[] fields = origin.getClass().getDeclaredFields(); + for (int i = 0; i < fields.length; i++) { + try { + fields[i].setAccessible(true); + Object value = fields[i].get(origin); + if (null == value && value.getClass().getName().equals("java.lang.String")) { + fields[i].set(origin, ModuleConstant.EMPTY_STR); + } + fields[i].setAccessible(false); + } catch (Exception e) { + + } + } + } + + /** + * @param staffId + * @return + * @Author sun + * @Description 工作端-查询当前人员所属组织及所有下级组织 + **/ + @Override + public StaffInAgencyListResultDTO staffInAgencyList(String staffId) { + StaffInAgencyListResultDTO resultDTO = new StaffInAgencyListResultDTO(); + //1.查询工作人员所属组织信息 + AgencyResultDTO agencyList = baseDao.selectAgencyByStaffId(staffId); + if (null == agencyList) { + logger.error(String.format("查询工作人员所属组织信息失败,staffId->%s", staffId)); + throw new RenException(CustomerAgencyConstant.SELECT_STAFF_AGENCY_EXCEPTION); + } + resultDTO.setAgencyList(agencyList); + + //2.递归查询所有下级组织信息 + List subAgencyList = getDepartmentList(("".equals(agencyList.getPids()) ? "" : agencyList.getPids() + ":") + agencyList.getAgencyId()); + resultDTO.setSubAgencyList(subAgencyList); + + return resultDTO; + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java index e3b81d7432..a236f77464 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerDepartmentServiceImpl.java @@ -20,11 +20,13 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.CustomerDepartmentDao; import com.epmet.dto.CustomerDepartmentDTO; +import com.epmet.dto.result.DepartmentListResultDTO; import com.epmet.entity.CustomerDepartmentEntity; import com.epmet.redis.CustomerDepartmentRedis; import com.epmet.service.CustomerDepartmentService; @@ -33,6 +35,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -101,4 +104,25 @@ public class CustomerDepartmentServiceImpl extends BaseServiceImpl list = baseDao.listDepartmentListByStaffId(staffId); + if (null != list && list.size() > NumConstant.ZERO) { + List entityList = new ArrayList<>(); + for (DepartmentListResultDTO dto : list) { + CustomerDepartmentEntity entity = new CustomerDepartmentEntity(); + entity.setId(dto.getDepartmentId()); + entity.setTotalUser(dto.getTotalUser() - NumConstant.ONE); + entityList.add(entity); + } + //更新部门总人数 + updateBatchById(entityList); + //删除工作人员与部门关联 + baseDao.deleteStaffDep(staffId); + } + } + + } \ No newline at end of file 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 8f023276a3..215e32b471 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 @@ -29,7 +29,6 @@ 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.CustomerGridConstant; -import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.CustomerGridDao; import com.epmet.dao.CustomerStaffGridDao; import com.epmet.dto.*; @@ -37,9 +36,9 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetUserFeignClient; +import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.service.CustomerAgencyService; import com.epmet.service.CustomerGridService; -import com.epmet.service.CustomerStaffGridService; import com.epmet.util.ModuleConstant; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -69,11 +68,11 @@ public class CustomerGridServiceImpl extends BaseServiceImpl page(Map params) { @@ -206,15 +205,36 @@ public class CustomerGridServiceImpl extends BaseServiceImpl().ok(griddetail); } + /** + * @Desc 网格添加 + * @Author zxc + * @param tokenDto + * @param addGridFormDTO + * @return + */ @Override @Transactional(rollbackFor = Exception.class) public Result addGrid(TokenDto tokenDto, AddGridFormDTO addGridFormDTO) { - //查询是否重名 + CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(addGridFormDTO.getAgencyId()); + // 1. 查询该客户下可创建网格的最大数量 + GridCountFormDTO gridCount = new GridCountFormDTO(); + String customerId = customerAgencyDTO.getCustomerId(); + gridCount.setCustomerId(customerId); + GridCountResultDTO grid = operCrmOpenFeignClient.getGridCount(gridCount).getData(); + if (grid.getGridCount().equals(NumConstant.ZERO)){ + throw new RenException(EpmetErrorCode.GRID_COUNT_UP.getCode()); + } + // 2. 判断当前客户下存在的网格数量 + Integer gridCounts = customerGridDao.selectGridCount(customerId); + if (gridCounts >= grid.getGridCount()){ + throw new RenException(EpmetErrorCode.GRID_COUNT_UP.getCode()); + } + // 3. 查询网格名称是否重名 AddGridResultDTO gridResult = baseDao.selectGridIdByGridName(addGridFormDTO.getGridName(), addGridFormDTO.getAgencyId(), null); if (gridResult!=null){ return new Result().error(EpmetErrorCode.NOT_ADD_GRID.getCode()); } - CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(addGridFormDTO.getAgencyId()); + CustomerGridEntity customerGridEntity = new CustomerGridEntity(); BeanUtils.copyProperties(addGridFormDTO,customerGridEntity); customerGridEntity.setAreaCode(customerAgencyDTO.getAreaCode()); @@ -615,4 +635,31 @@ public class CustomerGridServiceImpl extends BaseServiceImpl gridList = baseDao.selectGridByStaff(staffId); + if(null != gridList && gridList.size() > NumConstant.ZERO) { + gridList.forEach(entity -> { + entity.setTotalUser(entity.getTotalUser() - 1); + }); + updateBatchById(gridList); + baseDao.deleteGridStaff(staffId); + } + } + } 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 ba90138f12..241f9d9a67 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 @@ -27,10 +27,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerStaffAgencyDao; import com.epmet.dto.*; -import com.epmet.dto.form.CommonDepartmentFormDTO; -import com.epmet.dto.form.CommonGridIdFormDTO; -import com.epmet.dto.form.CommonUserIdListFormDTO; -import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.CommonStaffInfoResultDTO; import com.epmet.dto.result.LatestCustomerResultDTO; import com.epmet.entity.CustomerStaffAgencyEntity; @@ -72,6 +69,8 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl page(Map params) { @@ -213,4 +212,15 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl getAgencyStaffs(AgencyIdFormDTO agencyIdFormDTO) { + return customerStaffAgencyDao.getAgencyStaffList(agencyIdFormDTO.getAgencyId()); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffDepartmentServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffDepartmentServiceImpl.java index 81cf6dafd9..4e6a504c2e 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffDepartmentServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffDepartmentServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.CustomerStaffDepartmentDao; import com.epmet.dto.CustomerStaffDepartmentDTO; +import com.epmet.dto.form.DepartmentIdFormDTO; import com.epmet.entity.CustomerStaffDepartmentEntity; import com.epmet.redis.CustomerStaffDepartmentRedis; import com.epmet.service.CustomerStaffDepartmentService; @@ -47,7 +48,7 @@ import java.util.Map; public class CustomerStaffDepartmentServiceImpl extends BaseServiceImpl implements CustomerStaffDepartmentService { @Autowired - private CustomerStaffDepartmentRedis customerStaffDepartmentRedis; + private CustomerStaffDepartmentDao customerStaffDepartmentDao; @Override public PageData page(Map params) { @@ -101,4 +102,16 @@ public class CustomerStaffDepartmentServiceImpl extends BaseServiceImpl getDepartmentStaffs(DepartmentIdFormDTO formDTO) { + String departmentId = formDTO.getDepartmentId(); + return customerStaffDepartmentDao.getDepartmentStaffList(departmentId); + } + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index eea0a80d21..9cae28ab76 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -1,22 +1,17 @@ package com.epmet.service.impl; +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.utils.Result; -import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.dto.CustomerStaffAgencyDTO; -import com.epmet.dto.CustomerStaffDTO; -import com.epmet.dto.form.StaffInfoFromDTO; -import com.epmet.dto.form.StaffSubmitFromDTO; -import com.epmet.dto.form.StaffsInAgencyFromDTO; +import com.epmet.dto.*; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerStaffAgencyEntity; -import com.epmet.feign.EpmetUserFeignClient; -import com.epmet.feign.OperCrmFeignClient; -import com.epmet.service.CustomerAgencyService; -import com.epmet.service.CustomerStaffAgencyService; -import com.epmet.service.StaffService; +import com.epmet.feign.*; +import com.epmet.service.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -40,6 +35,18 @@ public class StaffServiceImpl implements StaffService { private CustomerAgencyService customerAgencyService; @Autowired private CustomerStaffAgencyService customerStaffAgencyService; + @Autowired + private GovProjectOpenFeignClient govProjectOpenFeignClient; + @Autowired + private EpmetHeartOpenFeignClient epmetHeartOpenFeignClient; + @Autowired + private CustomerDepartmentService customerDepartmentService; + @Autowired + private CustomerGridService customerGridService; + @Autowired + private StaffTransferRecordService staffTransferRecordService; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @Override public Result getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { @@ -183,4 +190,66 @@ public class StaffServiceImpl implements StaffService { } return result; } + + @Override + @Transactional(rollbackFor = Exception.class) + public void staffTransfer(TokenDto tokenDto, StaffTransferFormDTO fromDTO) { + //1.获取工作人员与机关关系 + CustomerStaffAgencyDTO staffAgencyDTO = customerStaffAgencyService.getInfoByUserId(fromDTO.getStaffId()); + String oldAgency = staffAgencyDTO.getAgencyId(); + //2.查询是否有未处理项目 + ProjectListFromDTO projectFromDTO = new ProjectListFromDTO(); + projectFromDTO.setCustomerId(staffAgencyDTO.getCustomerId()); + projectFromDTO.setUserId(fromDTO.getStaffId()); + projectFromDTO.setPageNo(1); + projectFromDTO.setPageSize(10); + Result> pendResult = govProjectOpenFeignClient.getPendProjectList(projectFromDTO); + if (!pendResult.success()) { + throw new RenException(pendResult.getCode(), pendResult.getMsg()); + } + if (null != pendResult.getData() && pendResult.getData().size() > NumConstant.ZERO) { + throw new RenException(EpmetErrorCode.EXIT_PEND_PROJECT.getCode()); + } + //3.查询是否有活动未结束 + Result> actInfoResult = epmetHeartOpenFeignClient.getPublishedAct(fromDTO.getStaffId()); + if (!actInfoResult.success()) { + throw new RenException(actInfoResult.getCode(), actInfoResult.getMsg()); + } + if (null != actInfoResult.getData() && actInfoResult.getData().size() > NumConstant.ZERO) { + throw new RenException(EpmetErrorCode.EXIT_PUBLISHED_ACTIVITY.getCode()); + } + //4.修改人员所属组织 + CustomerStaffAgencyDTO staffAgency = new CustomerStaffAgencyDTO(); + staffAgency.setId(staffAgencyDTO.getId()); + staffAgency.setAgencyId(fromDTO.getAgencyId()); + customerStaffAgencyService.update(staffAgency); + //原来组织总人数减一 + CustomerAgencyDTO oldAgencyDTO = customerAgencyService.get(oldAgency); + oldAgencyDTO.setTotalUser(oldAgencyDTO.getTotalUser() - NumConstant.ONE); + customerAgencyService.update(oldAgencyDTO); + //新组织总人数加一 + CustomerAgencyDTO newAgencyDTO = customerAgencyService.get(fromDTO.getAgencyId()); + newAgencyDTO.setTotalUser(newAgencyDTO.getTotalUser() - NumConstant.ONE); + customerAgencyService.update(newAgencyDTO); + //5.逻辑删除工作人员原组织加入的部门、网格,部门、网格总人数减1 + customerDepartmentService.updateDepartment(fromDTO.getStaffId()); + customerGridService.updateGrid(fromDTO.getStaffId()); + //6.更改工作人员组织角色 + StaffRoleDTO staffRoleDTO = new StaffRoleDTO(); + staffRoleDTO.setOrgId(fromDTO.getAgencyId()); + staffRoleDTO.setStaffId(fromDTO.getStaffId()); + Result result = epmetUserOpenFeignClient.changeRoleOrg(staffRoleDTO); + if (!result.success()) { + throw new RenException(result.getCode(), result.getMsg()); + } + //7.操作记录表新增调动记录 + StaffTransferRecordDTO staffTransferRecordDTO = new StaffTransferRecordDTO(); + staffTransferRecordDTO.setCustomerId(tokenDto.getCustomerId()); + staffTransferRecordDTO.setOperateStaffId(tokenDto.getUserId()); + staffTransferRecordDTO.setOperatedStaffId(fromDTO.getStaffId()); + staffTransferRecordDTO.setOldAgencyId(oldAgency); + staffTransferRecordDTO.setAgencyId(fromDTO.getAgencyId()); + staffTransferRecordDTO.setRemarks(fromDTO.getRemarks()); + staffTransferRecordService.save(staffTransferRecordDTO); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffTransferRecordServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffTransferRecordServiceImpl.java new file mode 100644 index 0000000000..6ef500a018 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffTransferRecordServiceImpl.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.StaffTransferRecordDao; +import com.epmet.dto.StaffTransferRecordDTO; +import com.epmet.entity.StaffTransferRecordEntity; +import com.epmet.redis.StaffTransferRecordRedis; +import com.epmet.service.StaffTransferRecordService; +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-08-27 + */ +@Service +public class StaffTransferRecordServiceImpl extends BaseServiceImpl implements StaffTransferRecordService { + + @Autowired + private StaffTransferRecordRedis staffTransferRecordRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, StaffTransferRecordDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, StaffTransferRecordDTO.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 StaffTransferRecordDTO get(String id) { + StaffTransferRecordEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, StaffTransferRecordDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(StaffTransferRecordDTO dto) { + StaffTransferRecordEntity entity = ConvertUtils.sourceToTarget(dto, StaffTransferRecordEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(StaffTransferRecordDTO dto) { + StaffTransferRecordEntity entity = ConvertUtils.sourceToTarget(dto, StaffTransferRecordEntity.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-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java index a1539be232..143d496aec 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/util/ModuleConstant.java @@ -71,4 +71,6 @@ public interface ModuleConstant { * 组织类型:网格 * */ String ORG_TYPE_GRID = "grid"; + + String EMPTY_STR = ""; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.2__staff_transfer_record.sql b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.2__staff_transfer_record.sql new file mode 100644 index 0000000000..3b447e519e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/db/migration/V0.0.2__staff_transfer_record.sql @@ -0,0 +1,16 @@ +CREATE TABLE `staff_transfer_record` ( + `ID` varchar(64) NOT NULL COMMENT 'ID', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `OPERATE_STAFF_ID` varchar(64) NOT NULL COMMENT '调动人员Id(操作人)', + `OPERATED_STAFF_ID` varchar(64) NOT NULL COMMENT '被调动人员Id', + `OLD_AGENCY_ID` varchar(64) NOT NULL COMMENT '调动前组织Id', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '调动后组织Id', + `REMARKS` varchar(255) DEFAULT NULL 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='工作人员调动记录表'; \ 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 61b9011343..0721780e09 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 @@ -169,4 +169,126 @@ ORDER BY created_time DESC + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 a31747facc..bf175e9127 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 @@ -2,6 +2,10 @@ + + UPDATE customer_staff_department SET DEL_FLAG = '1' + WHERE USER_ID = #{staffId} AND DEL_FLAG = '0' + 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 802ec9f2f3..422984c415 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 @@ -2,6 +2,10 @@ + + UPDATE customer_staff_grid SET DEL_FLAG = '1' + WHERE USER_ID = #{staffId} AND DEL_FLAG = '0' + + + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml index 2d548065f3..3df433a5b6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml @@ -141,4 +141,15 @@ csa.DEL_FLAG = '0' AND csa.USER_ID = #{staffId} + + + \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml index 927d919372..7e04df040b 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffDepartmentDao.xml @@ -27,6 +27,17 @@ + + + UPDATE diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffTransferRecordDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffTransferRecordDao.xml new file mode 100644 index 0000000000..7a9e787e1c --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffTransferRecordDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file 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 new file mode 100644 index 0000000000..bd7a69b259 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.form; + +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/12 17:52 + */ +@Data +public class ProjectResponseFormDTO implements Serializable { + private static final long serialVersionUID = -4915724637094689896L; + /** + * 用户Id + */ + private String userId; + /** + * 项目Id + */ + private String projectId; + /** + * 流程节点Id + */ + private String projectProcessId; + /** + * 公开答复内容 + */ + @Length(max = 1000, message = "公开答复不能超过1000个字符") + private String publicReply; + /** + * 内部流转意见 + */ + @NotBlank(message = "内部备注不能为空") + @Length(max = 1000, message = "内部备注不能超过1000个字符") + private String internalRemark; + /** + * 项目人员关联表ID + */ + private String projectStaffId; + /** + * 部门名 + */ + private String departmentName; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDetailResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDetailResultDTO.java index f44973bcea..7f309667f0 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDetailResultDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectDetailResultDTO.java @@ -1,6 +1,7 @@ package com.epmet.dto.result; import lombok.Data; +import lombok.NoArgsConstructor; import java.io.Serializable; import java.util.List; @@ -10,6 +11,7 @@ import java.util.List; * @dscription * @date 2020/5/11 15:33 */ +@NoArgsConstructor @Data public class ProjectDetailResultDTO implements Serializable { @@ -46,9 +48,29 @@ public class ProjectDetailResultDTO implements Serializable { * 处理状态(是否由我处理) */ private Boolean processable; + /** + * 是否是转项目节点 + */ + private Boolean returnable; /** * 当前跟进部门 */ private List departmentNameList; + /** + * 当前跟进部门 + */ + private List departmentList; + @NoArgsConstructor + @Data + public static class DepartmentNameListBean { + /** + * 部门名 + */ + private String departmentName; + /** + * 工作人员 + */ + private List staffList; + } } 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 b2e6b7f32c..c16b8da399 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 @@ -1,9 +1,16 @@ package com.epmet.feign; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.ProjectListFromDTO; +import com.epmet.dto.result.PendProjectListResultDTO; import org.springframework.cloud.openfeign.FeignClient; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +import java.util.List; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -13,4 +20,13 @@ import com.epmet.feign.fallback.GovProjectOpenFeignClientFallback; */ @FeignClient(name = ServiceConstant.GOV_PROJECT_SERVER, fallback = GovProjectOpenFeignClientFallback.class) public interface GovProjectOpenFeignClient { + /** + * 待处理项目列表 + * @author zhaoqifeng + * @date 2020/8/27 16:56 + * @param fromDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("gov/project/project/pendprojectlist") + Result> getPendProjectList(@RequestBody ProjectListFromDTO fromDTO); } 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 4b8c2cd82b..aa84f509c5 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 @@ -1,8 +1,15 @@ 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.ProjectListFromDTO; +import com.epmet.dto.result.PendProjectListResultDTO; import com.epmet.feign.GovProjectOpenFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 * @@ -11,4 +18,8 @@ import org.springframework.stereotype.Component; */ @Component public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignClient { + @Override + public Result> getPendProjectList(ProjectListFromDTO fromDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "getPendProjectList", fromDTO); + } } diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml index 32758e7186..405b05715e 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-project-server: container_name: gov-project-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.40 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.43 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 79ff122454..163ea7921d 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.40 + 0.3.43 gov-project com.epmet @@ -139,8 +139,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false 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 ff9dfb0dc1..dd0f37c086 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 @@ -59,6 +59,14 @@ public interface ProjectConstant { * 处理名-转项目 */ String OPERATION_CREATED_NAME = "转项目"; + /** + * 处理-退回 + */ + String OPERATION_RESPONSES = "response"; + /** + * 处理名-退回 + */ + String OPERATION_RESPONSES_NAME = "处理/响应"; /** * 是否处理-未处理 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 ad3faa944b..5ccc25b279 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,7 +17,11 @@ package com.epmet.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.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; @@ -27,10 +31,12 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.ProjectDTO; import com.epmet.dto.form.LatestListFormDTO; +import com.epmet.dto.form.ProjectListFromDTO; import com.epmet.dto.form.ShiftProjectFormDTO; import com.epmet.dto.form.ShiftProjectsFromDTO; import com.epmet.dto.result.IssueProjectResultDTO; import com.epmet.dto.result.LatestListResultDTO; +import com.epmet.dto.result.PendProjectListResultDTO; import com.epmet.dto.result.ShiftProjectResultDTO; import com.epmet.excel.ProjectExcel; import com.epmet.service.ProjectService; @@ -132,4 +138,18 @@ public class ProjectController { return new Result>().ok(projectService.getClosedProjectList(formDTO)); } + + /** + * 获取待处理项目列表 + * @author zhaoqifeng + * @date 2020/8/27 16:55 + * @param fromDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("pendprojectlist") + public Result> getPendProjectList(@RequestBody ProjectListFromDTO fromDTO) { + List result = projectService.getPendProjectList(fromDTO); + return new Result>().ok(result); + } + } \ 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 7f90d5e362..d32f28f8de 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 @@ -232,5 +232,21 @@ public class ProjectTraceController { ValidatorUtils.validateEntity(formDTO); return new Result().ok(projectTraceService.processorList(formDTO)); } + + /** + * 处理响应 + * @author zhaoqifeng + * @date 2020/8/20 10:16 + * @param tokenDTO + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("response") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_TRANSFER) + public Result response(@LoginUser TokenDto tokenDTO, @RequestBody ProjectResponseFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + projectTraceService.response(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 a45b46bb0a..4d20d6327c 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 @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ProjectDTO; +import com.epmet.dto.ProjectStaffDTO; import com.epmet.dto.form.LatestListFormDTO; import com.epmet.dto.form.ProjectListFromDTO; import com.epmet.dto.form.ShiftProjectsFromDTO; @@ -78,6 +79,15 @@ public interface ProjectDao extends BaseDao { */ List selectDepartmentNameList(ProjectDTO dto); + /** + * 当前处理部门及工作人员 + * @author zhaoqifeng + * @date 2020/8/14 10:56 + * @param dto + * @return java.util.List + */ + List selectCurrentDepartmentList(ProjectDTO dto); + /** * 获取项目详情 * @author zhaoqifeng diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectStaffDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectStaffDao.java index 78a7927b43..88bc5dadf2 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectStaffDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectStaffDao.java @@ -70,4 +70,13 @@ public interface ProjectStaffDao extends BaseDao { * @Description 查询当前处于项目节点中的切工作未处理的工作人员 **/ List selectProjectTransferStaffList(ProjectStaffDTO dto); + + /** + * 获取未处理的转项目节点 + * @author zhaoqifeng + * @date 2020/8/27 14:26 + * @param dto + * @return java.util.List + */ + List selectCreatedProcess(ProjectStaffDTO dto); } \ 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 9dafa894ab..9f3bfa8bf1 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 @@ -106,6 +106,7 @@ public interface ProjectService extends BaseService { */ List getPendProjectList(ProjectListFromDTO fromDTO); + /** * 我发起的项目列表 * @@ -178,4 +179,13 @@ public interface ProjectService extends BaseService { * @Description 获取客户下已结案项目列表,按结案时间倒序 **/ List getClosedProjectList(LatestListFormDTO formDTO); + + /** + * 处理响应 + * @author zhaoqifeng + * @date 2020/8/14 9:42 + * @param formDTO + * @return void + */ + void response(ProjectResponseFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectStaffService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectStaffService.java index 349068ce2c..af0ee6061d 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectStaffService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectStaffService.java @@ -131,4 +131,13 @@ public interface ProjectStaffService extends BaseService { * @return java.util.List */ List getStaffsByProjectId(String projectId); + + /** + * 获取未处理的转项目节点 + * @author zhaoqifeng + * @date 2020/8/27 14:30 + * @param dto + * @return java.util.List + */ + List getCreatedProcess(ProjectStaffDTO dto); } \ 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 a3ebf9d74c..d41408524c 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 @@ -107,4 +107,14 @@ public interface ProjectTraceService { * @Description 项目跟踪-项目人员选择 **/ ProcessorListResultDTO processorList(ProcessorListFormDTO formDTO); + + /** + * 处理响应 + * @author zhaoqifeng + * @date 2020/8/12 17:54 + * @param tokenDto + * @param formDTO + * @return void + */ + void response(TokenDto tokenDto, ProjectResponseFormDTO formDTO); } 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 ea153d138d..0fc60dcbb5 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 @@ -44,10 +44,7 @@ import com.epmet.entity.ProjectEntity; import com.epmet.entity.ProjectProcessEntity; import com.epmet.entity.ProjectRelatedPersonnelEntity; import com.epmet.entity.ProjectStaffEntity; -import com.epmet.feign.EpmetCommonServiceOpenFeignClient; -import com.epmet.feign.EpmetUserFeignClient; -import com.epmet.feign.GovOrgFeignClient; -import com.epmet.feign.MessageFeignClient; +import com.epmet.feign.*; import com.epmet.redis.ProjectRedis; import com.epmet.service.*; import org.apache.commons.lang3.StringUtils; @@ -87,6 +84,8 @@ public class ProjectServiceImpl extends BaseServiceImpl returnableList = projectProcessService.getReturnableList(returnListFromDTO); + if (null != returnableList && returnableList.size() > NumConstant.ZERO) { + resultDTO.setReturnable(true); + } else { + resultDTO.setReturnable(false); + } } //获取当前跟进部门 - List departmentNameList = new ArrayList<>(); + List departments = new ArrayList<>(); + List departmentNameList = new ArrayList<>(); + List departmentList = new ArrayList<>(); if (ProjectConstant.CLOSED.equals(resultDTO.getProjectStatus())) { //项目已结案,跟进部门为空 - resultDTO.setDepartmentNameList(departmentNameList); + resultDTO.setDepartmentList(departmentList); + resultDTO.setDepartmentNameList(departments); } else { //项目未结案,找出所有跟进部门 ProjectDTO projectDTO = new ProjectDTO(); projectDTO.setId(fromDTO.getProjectId()); - departmentNameList = baseDao.selectDepartmentNameList(projectDTO); - resultDTO.setDepartmentNameList(departmentNameList); + departmentNameList = baseDao.selectCurrentDepartmentList(projectDTO); + //提取工作人员ID + List staffIdList = departmentNameList.stream().map(ProjectStaffDTO::getStaffId).collect(Collectors.toList()); + staffIdList = staffIdList.stream().distinct().collect(Collectors.toList()); + //根据部门分组 + Map> departmentMap = + departmentNameList.stream().collect(Collectors.groupingBy(ProjectStaffDTO::getDepartmentName)); + //获取工作人员信息(姓名) + UserIdsFormDTO userIdsFormDTO = new UserIdsFormDTO(); + userIdsFormDTO.setUserIds(staffIdList); + Result> staffListResult = epmetUserOpenFeignClient.getStaffInfoList(userIdsFormDTO); + if (!staffListResult.success()) { + throw new RenException(staffListResult.getCode(), staffListResult.getMsg()); + } + List staffList = staffListResult.getData(); + for (String departmentName : departmentMap.keySet()) { + ProjectDetailResultDTO.DepartmentNameListBean bean = new ProjectDetailResultDTO.DepartmentNameListBean(); + bean.setDepartmentName(departmentName); + List staffDTOList = departmentMap.get(departmentName); + List staffNameList = + staffDTOList.stream().flatMap(staffDto -> staffList.stream().filter(staffInfo -> + staffDto.getStaffId().equals(staffInfo.getStaffId())).map((StaffSinGridResultDTO::getStaffName))).collect(Collectors.toList()); + bean.setStaffList(staffNameList); + departmentList.add(bean); + departments.add(departmentName); + } + resultDTO.setDepartmentList(departmentList); + resultDTO.setDepartmentNameList(departments); } return resultDTO; @@ -635,4 +672,41 @@ public class ProjectServiceImpl 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()); + } + } + } + + //获取项目相关信息 + ProjectEntity projectEntity = baseDao.selectById(formDTO.getProjectId()); + if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) { + throw new RenException(EpmetErrorCode.PROJECT_IS_CLOSED.getCode()); + } + + //处理响应记录加入项目进展表 + ProjectProcessEntity projectProcessEntity = new ProjectProcessEntity(); + projectProcessEntity.setProjectId(formDTO.getProjectId()); + projectProcessEntity.setDepartmentName(formDTO.getDepartmentName()); + 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); + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectStaffServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectStaffServiceImpl.java index 9dfa87eed5..e33943f2e4 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectStaffServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectStaffServiceImpl.java @@ -150,4 +150,9 @@ public class ProjectStaffServiceImpl extends BaseServiceImpl getCreatedProcess(ProjectStaffDTO dto) { + return baseDao.selectCreatedProcess(dto); + } + } \ 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 fb608230b0..d8ddde09ba 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 @@ -95,4 +95,10 @@ public class ProjectTraceServiceImpl implements ProjectTraceService { Result resultDTOResult = govOrgFeignClient.getProcessorList(staffEntity.getOrgId()); return resultDTOResult.getData(); } + + @Override + public void response(TokenDto tokenDto, ProjectResponseFormDTO formDTO) { + formDTO.setUserId(tokenDto.getUserId()); + projectService.response(formDTO); + } } 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 db34280061..8979d90f57 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 @@ -183,5 +183,16 @@ AND origin = #{origin} AND origin_id = #{originId} - + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectStaffDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectStaffDao.xml index ebeb87a063..b2fc15543a 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectStaffDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectStaffDao.xml @@ -53,5 +53,17 @@ AND project_id = #{projectId} AND is_handle = #{isHandle} + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/pom.xml b/epmet-module/gov-voice/gov-voice-server/pom.xml index 921e42689a..17268c4fe4 100644 --- a/epmet-module/gov-voice/gov-voice-server/pom.xml +++ b/epmet-module/gov-voice/gov-voice-server/pom.xml @@ -126,8 +126,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/OperMenuDTO.java b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/OperMenuDTO.java index a98dcff26b..cdbc9567c2 100644 --- a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/OperMenuDTO.java +++ b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/OperMenuDTO.java @@ -117,4 +117,8 @@ public class OperMenuDTO extends TreeStringNode implements Serializ */ private String parentName; + /** + * 是否显示,1:显示 0不显示 + */ + private Integer showFlag; } \ No newline at end of file diff --git a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/result/OperMenuDTO.java b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/result/OperMenuDTO.java index 41f02723df..f71e1f5adc 100644 --- a/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/result/OperMenuDTO.java +++ b/epmet-module/oper-access/oper-access-client/src/main/java/com/epmet/dto/result/OperMenuDTO.java @@ -74,6 +74,10 @@ public class OperMenuDTO extends TreeNode implements Serializable { @ApiModelProperty(value = "上级菜单名称") private String parentName; + /** + * 是否显示,1:显示 0不显示 + */ + private Integer showFlag; public void setName(String name) { this.name = name; @@ -155,4 +159,12 @@ public class OperMenuDTO extends TreeNode implements Serializable { public void setParentName(String parentName) { this.parentName = parentName; } + + public Integer getShowFlag() { + return showFlag; + } + + public void setShowFlag(Integer showFlag) { + this.showFlag = showFlag; + } } diff --git a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml index d3dfe53760..ea567d95a0 100644 --- a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-access-server: container_name: oper-access-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-access-server:0.3.15 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-access-server:0.3.17 ports: - "8093:8093" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-prod.yml b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-prod.yml index 8552999645..6c6bd28509 100644 --- a/epmet-module/oper-access/oper-access-server/deploy/docker-compose-prod.yml +++ b/epmet-module/oper-access/oper-access-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-access-server: container_name: oper-access-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-access-server:0.3.15 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-access-server:0.3.18 ports: - "8093:8093" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-access/oper-access-server/pom.xml b/epmet-module/oper-access/oper-access-server/pom.xml index 5ef81d2ca5..e5c20ef1be 100644 --- a/epmet-module/oper-access/oper-access-server/pom.xml +++ b/epmet-module/oper-access/oper-access-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.15 + 0.3.18 oper-access com.epmet @@ -114,8 +114,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/entity/OperMenuEntity.java b/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/entity/OperMenuEntity.java index 549246c970..b1f69647c7 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/entity/OperMenuEntity.java +++ b/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/entity/OperMenuEntity.java @@ -64,4 +64,8 @@ public class OperMenuEntity extends BaseEpmetEntity { @TableField(exist = false) private String parentName; + /** + * 是否显示,1:显示 0不显示 + */ + private Integer showFlag; } diff --git a/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/service/impl/OperMenuServiceImpl.java b/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/service/impl/OperMenuServiceImpl.java index 8c7354a086..df8c7fc154 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/service/impl/OperMenuServiceImpl.java +++ b/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/service/impl/OperMenuServiceImpl.java @@ -166,7 +166,9 @@ public class OperMenuServiceImpl extends BaseServiceImpl menuList; Result operUserDTOResult = epmetUserFeignClient.info(tokenDto.getUserId()); - + if(!operUserDTOResult.success()||null==operUserDTOResult.getData()){ + return new ArrayList<>(); + } //系统管理员,拥有最高权限 if(operUserDTOResult.getData().getSuperAdmin() == SuperAdminEnum.YES.value()){ menuList = baseDao.getMenuList(type, HttpContextUtils.getLanguage()); diff --git a/epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.2__OperMenuAddShowFlag.sql b/epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.2__OperMenuAddShowFlag.sql new file mode 100644 index 0000000000..e7494131cc --- /dev/null +++ b/epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.2__OperMenuAddShowFlag.sql @@ -0,0 +1 @@ +alter table oper_menu add COLUMN `SHOW_FLAG` varchar(1) NOT NULL DEFAULT '1' COMMENT '是否显示,1:显示 0不显示'; diff --git a/epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.3__OperMenuAddShowFlagV1.sql b/epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.3__OperMenuAddShowFlagV1.sql new file mode 100644 index 0000000000..e9764bc121 --- /dev/null +++ b/epmet-module/oper-access/oper-access-server/src/main/resources/db/migration/V0.0.3__OperMenuAddShowFlagV1.sql @@ -0,0 +1 @@ +alter table oper_menu MODIFY COLUMN `SHOW_FLAG` int(11) NOT NULL DEFAULT 1 COMMENT '是否显示,1:显示 0不显示'; \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java index 7a78fbb209..8e752eb744 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java @@ -88,6 +88,11 @@ public class CustomerDTO implements Serializable { */ private String logo; + /** + * 客户允许创建的网格数 + */ + private Integer gridNumber; + /** * 删除标识:0.未删除 1.已删除 */ diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/GridCountFormDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/GridCountFormDTO.java new file mode 100644 index 0000000000..a4ebfedc5c --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/GridCountFormDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/12 4:34 下午 + */ +@Data +public class GridCountFormDTO implements Serializable { + + private static final long serialVersionUID = 3121175488079594627L; + + private String customerId; +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/UpdateCustomerFormDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/UpdateCustomerFormDTO.java new file mode 100644 index 0000000000..6186d67bfb --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/UpdateCustomerFormDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/19 10:53 + */ +@NoArgsConstructor +@Data +public class UpdateCustomerFormDTO implements Serializable { + + private static final long serialVersionUID = 1296290251616658023L; + /** + * 客户ID + */ + private String customerId; + /** + * 客户名 + */ + private String customerName; + /** + * logo + */ + private String logo; +// /** +// * 根管理员姓名 +// */ +// private String rootManageName; +// /** +// * 根管理员电话 +// */ +// private String rootManagePhone; +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/UpdateCustomerParameterFormDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/UpdateCustomerParameterFormDTO.java new file mode 100644 index 0000000000..ddf4551a57 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/UpdateCustomerParameterFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 修改客户网格数和有效期-接口入参 + * @Author sun + */ +@Data +public class UpdateCustomerParameterFormDTO implements Serializable { + + private static final long serialVersionUID = 4512080710854617599L; + /** + * 客户Id + */ + @NotBlank(message = "customerId不能为空",groups = {Customer.class}) + private String customerId; + /** + * 有效期 + */ + private String validityTime; + /** + * 最大允许创建网格数 + */ + private Integer maxGridNumber; + + public interface Customer{} +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoDTO.java index 6c2bd282bf..6ef2596917 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoDTO.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoDTO.java @@ -6,4 +6,5 @@ import lombok.Data; public class CustomerInfoDTO { private String customerName; private String organizationLevel; + private String logo; } diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoResultDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoResultDTO.java new file mode 100644 index 0000000000..95047cf9e9 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerInfoResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2020/8/14 9:01 上午 + */ +@Data +public class CustomerInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 7653925905635170972L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 客户名称 + */ + private String customerName; + + /** + * 有效期 + */ + private Date validityTime; + + /** + * 已创建网格数 + */ + private Integer createGridNumber; + + /** + * 最大允许创建数 + */ + private Integer maxGridNumber; + +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java new file mode 100644 index 0000000000..e55e97197a --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java @@ -0,0 +1,66 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/19 9:53 + */ +@NoArgsConstructor +@Data +public class CustomerListResultDTO implements Serializable { + + private static final long serialVersionUID = -2167406082548134982L; + /** + * 客户id + */ + private String customerId; + /** + * 客户名称 + */ + private String customerName; + /** + * 产品标题 显示在产品顶端的标题 + */ + private String title; + /** + * 有效期 + */ + private String validityTime; + /** + * 客户组织级别:0.省级,1市级,2.区县级,3.乡镇街道级 字典表key:organizationlevel + */ + private String organizationLevel; + /** + * 客户logo + */ + private String logo; + /** + * 客户允许创建的网格数 + */ + private Integer gridNumber; + /** + * 跟管理员姓名 + */ + private String rootManageName; + /** + * 跟管理员电话 + */ + private String rootManagePhone; + /** + * 省份 + */ + private String province; + /** + * 城市 + */ + private String city; + /** + * 区县 + */ + private String county; +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/GridCountResultDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/GridCountResultDTO.java new file mode 100644 index 0000000000..7264a71c72 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/GridCountResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/12 4:31 下午 + */ +@Data +public class GridCountResultDTO implements Serializable { + + private static final long serialVersionUID = -5523213918272649646L; + + private Integer gridCount; +} 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 b4ca88c64f..7be7cea353 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 @@ -6,6 +6,8 @@ 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.result.GridCountResultDTO; import com.epmet.feign.fallback.OperCrmOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; @@ -56,11 +58,20 @@ public interface OperCrmOpenFeignClient { Result addManager(@RequestBody CustomerManagerFormDTO form); /** - * 获取客户李彪 + * 获取客户列表 * @author zhaoqifeng * @date 2020/8/3 15:24 * @return com.epmet.commons.tools.utils.Result */ @PostMapping("/oper/crm/customer/getalllist") Result> getAllCustomerList(); + + /** + * @Description 查询客户下可以创建网格的最大数 + * @param formDTO + * @author zxc + * @date 2020/8/12 4:37 下午 + */ + @PostMapping("/oper/crm/customer/getgridcount") + Result getGridCount(@RequestBody GridCountFormDTO formDTO); } 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 b4f3947ed7..f4ad95f4ca 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 @@ -7,6 +7,8 @@ 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.result.GridCountResultDTO; import com.epmet.feign.OperCrmOpenFeignClient; import org.springframework.stereotype.Component; @@ -50,4 +52,9 @@ public class OperCrmOpenFeignClientFallback implements OperCrmOpenFeignClient { public Result> getAllCustomerList() { return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getAllCustomerList", null); } + + @Override + public Result getGridCount(GridCountFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getGridCount", formDTO); + } } diff --git a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml index 108c608acc..1bc90fa0c0 100644 --- a/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-crm/oper-crm-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-crm-server: container_name: oper-crm-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-crm-server:0.3.66 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-crm-server:0.3.70 ports: - "8090:8090" network_mode: host # 使用现有网络 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 9a7eb3e9b9..a75df6848f 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.66 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-crm-server:0.3.71 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 4ae4fb79aa..b675bc8c4a 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.66 + 0.3.71 com.epmet oper-crm @@ -135,8 +135,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/constant/ModuleConstant.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/constant/ModuleConstant.java new file mode 100644 index 0000000000..c78e0e799e --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/constant/ModuleConstant.java @@ -0,0 +1,19 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2020/8/14 9:46 上午 + */ +public interface ModuleConstant { + + String ERROR_GOV_ORG_COUNT = "调用gov_org服务【查询客户下网格数量】失败"; + + String SELECT_CUSTOMER_ERROR = "根据客户Id查询客户基本信息失败"; + + String GRID_NUMBER_ERROR = "最大网格数不能小于之前设定数"; + + String VALIDITY_TIME_ERROR = "客户有效期不能早于之前设定值"; + + String UPDATE_CUSTOMER_ERROR = "更新客户基本信息失败"; + +} 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 79c49245b6..e4ae80fc6e 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 @@ -32,6 +32,8 @@ 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.excel.CustomerExcel; import com.epmet.feign.GovOrgFeignClient; @@ -42,6 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; +import java.text.ParseException; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -256,4 +259,75 @@ public class CustomerController { return new Result>().ok(customerService.getAllList()); } + /** + * @Description 查询客户下可以创建网格的最大数 + * @author zxc + * @date 2020/8/12 4:30 下午 + */ + @PostMapping("getgridcount") + public Result getGridCount(@RequestBody GridCountFormDTO formDTO){ + return new Result().ok(customerService.getGridCount(formDTO)); + } + + /** + * @Description 查询客户基本信息 + * @param formDTO + * @author zxc + * @date 2020/8/14 9:08 上午 + */ + @PostMapping("getcustomer") + public Result getCustomer(@RequestBody CustomerIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, CustomerIdFormDTO.Customer.class); + return new Result().ok(customerService.getCustomer(formDTO)); + } + + /** + * 获取crm客户列表 + * @author zhaoqifeng + * @date 2020/8/19 10:46 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("customerlist") + public Result customerList(@RequestBody PageQueryFormDTO formDTO) { + PageData result = customerService.customerList(formDTO); + return new Result().ok(result); + } + + /** + * 修改客户信息 + * @author zhaoqifeng + * @date 2020/8/19 15:23 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("updatecustomer") + public Result updateCustomer(@RequestBody UpdateCustomerFormDTO formDTO) { + customerService.updateCustomer(formDTO); + return new Result(); + } + + /** + * @param formDTO + * @Description 获取客户最大网格数和有效期 + * @author sun + */ + @PostMapping("getcustomerparameter") + public Result getCustomerParameter(@RequestBody CustomerIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, CustomerIdFormDTO.Customer.class); + return new Result().ok(customerService.getCustomerParameter(formDTO)); + } + + /** + * @param formDTO + * @Description 修改客户网格数和有效期 + * @author sun + */ + @PostMapping("updatecustomerparameter") + public Result updateCustomerParameter(@RequestBody UpdateCustomerParameterFormDTO formDTO) throws ParseException { + ValidatorUtils.validateEntity(formDTO, UpdateCustomerParameterFormDTO.Customer.class); + customerService.updateCustomerParameter(formDTO); + return new Result(); + } + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java index dea5f2f40b..b7aed8f55a 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java @@ -19,8 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.CustomerDTO; -import com.epmet.dto.result.CustomerResultDTO; -import com.epmet.dto.result.ValidCustomerResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.CustomerEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -74,4 +73,29 @@ public interface CustomerDao extends BaseDao { */ List getAllList(); + /** + * @Description 查询客户下可以创建网格的最大数 + * @param customerId + * @author zxc + * @date 2020/8/12 4:46 下午 + */ + GridCountResultDTO getGridCount(@Param("customerId")String customerId); + + /** + * @Description 根据客户Id查询客户基本信息 + * @param customerId + * @author zxc + * @date 2020/8/14 9:12 上午 + */ + CustomerInfoResultDTO selectCustomerBasicInfo(@Param("customerId")String customerId); + + /** + * 获取crm客户列表 + * @author zhaoqifeng + * @date 2020/8/19 10:17 + * @param customerName + * @return java.util.List + */ + List selectAllCustomerList(@Param("customerName") String customerName); + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java index c5c511cbed..6e56fbee35 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/entity/CustomerEntity.java @@ -88,4 +88,9 @@ public class CustomerEntity extends BaseEpmetEntity { */ private String logo; + /** + * 客户允许创建的网格数 + */ + private Integer gridNumber; + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/excel/CustomerExcel.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/excel/CustomerExcel.java index 1708a19dbc..7bd1260e8d 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/excel/CustomerExcel.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/excel/CustomerExcel.java @@ -76,5 +76,8 @@ public class CustomerExcel { @Excel(name = "更新时间") private Date updatedTime; + @Excel(name = "客户允许创建的网格数") + private Integer gridNumber; + } \ 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 b815474688..c9745552ed 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 @@ -21,14 +21,14 @@ 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.CustomerDTO; -import com.epmet.dto.form.CustomerFormDTO; -import com.epmet.dto.form.CustomerInitFormDTO; -import com.epmet.dto.form.CustomerManagerFormDTO; -import com.epmet.dto.form.PageQueryFormDTO; +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.entity.CustomerEntity; +import java.text.ParseException; import java.util.List; import java.util.Map; @@ -174,4 +174,52 @@ public interface CustomerService extends BaseService { * @return */ List getAllList(); + + /** + * @Description 查询客户下可以创建网格的最大数 + * @author zxc + * @date 2020/8/12 4:30 下午 + */ + GridCountResultDTO getGridCount( GridCountFormDTO formDTO); + + /** + * @Description 查询客户基本信息 + * @param formDTO + * @author zxc + * @date 2020/8/14 9:08 上午 + */ + CustomerInfoResultDTO getCustomer( CustomerIdFormDTO formDTO); + + /** + * 获取crm客户列表 + * @author zhaoqifeng + * @date 2020/8/19 10:12 + * @param formDTO + * @return com.epmet.dto.result.CustomerListResultDTO + */ + PageData customerList(PageQueryFormDTO formDTO); + + /** + * 客户基本信息修改 + * @author zhaoqifeng + * @date 2020/8/19 10:58 + * @param formDTO + * @return void + */ + void updateCustomer(UpdateCustomerFormDTO formDTO); + + /** + * @param formDTO + * @Description 获取客户最大网格数和有效期 + * @author sun + */ + CustomerInfoResultDTO getCustomerParameter( CustomerIdFormDTO formDTO); + + /** + * @param formDTO + * @Description 修改客户网格数和有效期 + * @author sun + */ + void updateCustomerParameter(UpdateCustomerParameterFormDTO formDTO) throws ParseException; + } 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 219ad17f20..9857f910c5 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 @@ -30,6 +30,7 @@ import com.epmet.commons.tools.page.PageData; 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.ModuleConstant; import com.epmet.constant.RoleKeyConstants; import com.epmet.constant.UserWorkType; import com.epmet.dao.CustomerDao; @@ -37,10 +38,7 @@ import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.CustomerEntity; -import com.epmet.feign.EpmetUserFeignClient; -import com.epmet.feign.GovOrgFeignClient; -import com.epmet.feign.GovOrgOpenFeignClient; -import com.epmet.feign.OperCustomizeFeignClient; +import com.epmet.feign.*; import com.epmet.redis.CustomerRedis; import com.epmet.service.CustomerService; import com.github.pagehelper.PageHelper; @@ -53,6 +51,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -76,6 +76,10 @@ public class CustomerServiceImpl extends BaseServiceImpl page(Map params) { @@ -456,20 +460,10 @@ public class CustomerServiceImpl extends BaseServiceImpl result = govOrgOpenFeignClient.selectGridCount(formDTO); + if (!result.success()){ + throw new RenException(ModuleConstant.ERROR_GOV_ORG_COUNT); + } + customerInfoResultDTO.setCreateGridNumber(result.getData().getGridCount()); + return customerInfoResultDTO; + } + + @Override + public PageData customerList(PageQueryFormDTO formDTO) { + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()) + .doSelectPageInfo(() -> baseDao.selectAllCustomerList(formDTO.getCustomerName())); + List list = pageInfo.getList(); + if(null != list) { + list.forEach(dto -> { + // 根级组织 + Result customerRootAgencyRst = govOrgFeignClient.getCustomerRootAgency(dto.getCustomerId()); + if (!customerRootAgencyRst.success()) { + throw new RenException("查询客户详情:查询客户根级组织失败:".concat(customerRootAgencyRst.toString())); + } + CustomerAgencyDTO agency = customerRootAgencyRst.getData(); + + // 管理员 + if (agency != null) { + StaffRoleFormDTO staffsInRoleForm = new StaffRoleFormDTO(); + staffsInRoleForm.setOrgId(agency.getId()); + staffsInRoleForm.setRoleKey(RoleKeyConstants.ROLE_KEY_ROOT_MANAGER); + Result> managersResult = epmetUserFeignClient.getStaffsInRole(staffsInRoleForm); + if (!managersResult.success()) { + throw new RenException("查询客户详情:查询客户管理员失败:".concat(managersResult.toString())); + } + + dto.setProvince(agency.getProvince()); + dto.setCity(agency.getCity()); + dto.setCounty(agency.getDistrict()); + if (null != managersResult.getData() && managersResult.getData().size() > NumConstant.ZERO) { + GovStaffRoleResultDTO manager = managersResult.getData().get(NumConstant.ZERO); + dto.setRootManageName(manager.getRealName()); + dto.setRootManagePhone(manager.getMobile()); + } + + } + }); + } + pageInfo.setList(list); + return new PageData<>(pageInfo.getList(),pageInfo.getTotal()); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void updateCustomer(UpdateCustomerFormDTO formDTO) { + CustomerEntity entity = new CustomerEntity(); + entity.setId(formDTO.getCustomerId()); + if (StringUtils.isNotBlank(formDTO.getCustomerName())){ + entity.setCustomerName(formDTO.getCustomerName()); + } + if (StringUtils.isNotBlank(formDTO.getLogo())){ + entity.setLogo(formDTO.getLogo()); + } + entity.setLogo(formDTO.getLogo()); + baseDao.updateById(entity); +// if (StringUtils.isNotBlank(formDTO.getRootManageName()) || StringUtils.isNotBlank(formDTO.getRootManagePhone())) { +// // 根级组织 +// Result customerRootAgencyRst = govOrgFeignClient.getCustomerRootAgency(formDTO.getCustomerId()); +// if (!customerRootAgencyRst.success() || null == customerRootAgencyRst.getData()) { +// throw new RenException("客户基本信息修改:查询客户根级组织失败:".concat(customerRootAgencyRst.toString())); +// } +// CustomerAgencyDTO agency = customerRootAgencyRst.getData(); +// UpdateRootManageFormDTO updateRootManageFormDTO = new UpdateRootManageFormDTO(); +// updateRootManageFormDTO.setOrgId(agency.getId()); +// updateRootManageFormDTO.setRoleKey(RoleKeyConstants.ROLE_KEY_ROOT_MANAGER); +// if (StringUtils.isNotBlank(formDTO.getRootManageName())){ +// updateRootManageFormDTO.setRootManageName(formDTO.getRootManageName()); +// } +// if (StringUtils.isNotBlank(formDTO.getRootManageName())){ +// updateRootManageFormDTO.setRootManagePhone(formDTO.getRootManagePhone()); +// } +// Result rootManageResult = epmetUserOpenFeignClient.updateRootManage(updateRootManageFormDTO); +// if (!rootManageResult.success()) { +// throw new RenException("客户基本信息修改:修改根管理员信息失败:".concat(rootManageResult.toString())); +// } +// } + } + + /** + * @param formDTO + * @Description 获取客户最大网格数和有效期 + * @author sun + */ + @Override + public CustomerInfoResultDTO getCustomerParameter(CustomerIdFormDTO formDTO) { + //1.查询客户基本信息 + CustomerInfoResultDTO customerInfoResultDTO = customerDao.selectCustomerBasicInfo(formDTO.getCustomerId()); + if (null == customerInfoResultDTO) { + throw new RenException(ModuleConstant.SELECT_CUSTOMER_ERROR); + } + + //2.查询客户实际网格数 + Result result = govOrgOpenFeignClient.selectGridCount(formDTO); + if (!result.success()){ + throw new RenException(ModuleConstant.ERROR_GOV_ORG_COUNT); + } + CustomerGridCountResultDTO resultDTO = result.getData(); + customerInfoResultDTO.setCreateGridNumber(resultDTO.getGridCount()); + + return customerInfoResultDTO; + } + + + /** + * @param formDTO + * @Description 修改客户网格数和有效期 + * @author sun + */ + @Override + public void updateCustomerParameter(UpdateCustomerParameterFormDTO formDTO) throws ParseException { + //1.查询客户基本信息 + CustomerEntity entity = baseDao.selectById(formDTO.getCustomerId()); + if (null == entity) { + throw new RenException(ModuleConstant.SELECT_CUSTOMER_ERROR); + } + //2.校验数据合格性 + if (entity.getGridNumber() > formDTO.getMaxGridNumber()) { + throw new RenException(ModuleConstant.GRID_NUMBER_ERROR); + } + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); + Date dt1 = df.parse(formDTO.getValidityTime()); + Date dt2 = entity.getValidityTime(); + if (dt1.getTime() < dt2.getTime()) { + throw new RenException(ModuleConstant.VALIDITY_TIME_ERROR); + } + //3.更新数据 + CustomerEntity customerEntity = new CustomerEntity(); + customerEntity.setId(formDTO.getCustomerId()); + customerEntity.setGridNumber(formDTO.getMaxGridNumber()); + customerEntity.setValidityTime(dt1); + if (baseDao.updateById(customerEntity) < NumConstant.ONE) { + throw new RenException(ModuleConstant.UPDATE_CUSTOMER_ERROR); + } + } + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.2__update_customer.sql b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.2__update_customer.sql new file mode 100644 index 0000000000..27379d7feb --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.2__update_customer.sql @@ -0,0 +1,5 @@ + +ALTER TABLE `customer` +ADD COLUMN `GRID_NUMBER` int(11) NULL COMMENT '客户允许创建的网格数' AFTER `ORGANIZATION_LEVEL`; + +UPDATE customer SET GRID_NUMBER = 10; \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml index a0d49c5172..d50ab9ce85 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerDao.xml @@ -78,4 +78,46 @@ WHERE del_flag = '0' + + + + + + + + diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.java new file mode 100644 index 0000000000..8f2d7d09b7 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFunctionDetailDTO.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 java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户定制功能详情表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Data +public class CustomerFunctionDetailDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 功能Id + */ + private String functionId; + + /** + * 自定义功能名称 + */ + private String functionName; + + /** + * 自定义大图标 + */ + private String iconLargeImg; + + /** + * 自定义小图标 + */ + private String iconSmallImg; + + /** + * 自定义业务域名 + */ + private String domainName; + + /** + * 外链地址 + */ + private String targetLink; + + /** + * 上架状态:0:下架、1:上架 + */ + private Integer shoppingStatus; + + /** + * 自定义排序 + */ + private Integer displayOrder; + + /** + * 删除标识(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-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomizedDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomizedDTO.java new file mode 100644 index 0000000000..aa54ed57bf --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomizedDTO.java @@ -0,0 +1,67 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 定制功能修改 入参 + * + * @author zhangyong + * @since v1.0.0 2020-08-13 + */ +@Data +public class CustomizedDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 定制功能ID + */ + private String functionId; + + /** + * 上架状态:0:下架、1:上架 + */ + private String shoppingStatus; + + /** + * 功能说明 + */ + private String functionExplain; + + /** + * 定制功能详情ID + */ + private String customizedId; + + /** + * 默认名称 + */ + private String customizedName; + + /** + * 默认大图标 + */ + private String iconLargeImg; + + /** + * 默认小图标 + */ + private String iconSmallImg; + + + /** + * 外链地址 + */ + private String targetLink; + + /** + * 业务域名 + */ + private String domainName; + + /** + * 来源app(政府端:gov、居民端:resi) + */ + private String fromApp; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedDTO.java new file mode 100644 index 0000000000..9fb059d520 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedDTO.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; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 定制功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Data +public class FunctionCustomizedDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 功能ID(function.ID) + */ + private String functionId; + + /** + * 默认名称 + */ + private String customizedName; + + /** + * 默认大图标 + */ + private String iconLargeImg; + + /** + * 默认小图标 + */ + private String iconSmallImg; + + /** + * 外链地址(必须是https的请求) + */ + private String targetLink; + + /** + * 删除标识(0.未删除 1.已删除) + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 业务域名 + */ + private String domainName; + + /** + * 来源app(政府端:gov、居民端:resi) + */ + private String fromApp; + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedVisitedDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedVisitedDTO.java new file mode 100644 index 0000000000..84d2b50095 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionCustomizedVisitedDTO.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; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-13 + */ +@Data +public class FunctionCustomizedVisitedDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户Id + */ + private String userId; + + /** + * 所属端 居民端:resi工作端:work + */ + private String clientType; + + /** + * 功能Id + */ + private String functionId; + + /** + * 请求地址 访问的url地址 + */ + private String url; + + /** + * 结果 成功success失败error + */ + private String result; + + /** + * 原因 失败的原因(例:请求超时、404、500等) + */ + private String msg; + + /** + * 删除标识(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/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionShoppingHistoryDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionShoppingHistoryDTO.java new file mode 100644 index 0000000000..3426469343 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/FunctionShoppingHistoryDTO.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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-08-14 + */ +@Data +public class FunctionShoppingHistoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 功能Id + */ + private String functionId; + + /** + * 上下架状态 上架状态:0:下架、1:上架 + */ + private Integer shoppingStatus; + + /** + * 理由 + */ + private String reason; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识(0.未删除 1.已删除) + */ + private Integer delFlag; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CommonFunctionIdFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CommonFunctionIdFormDTO.java new file mode 100644 index 0000000000..a2200fdf5c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CommonFunctionIdFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 入参为:定制功能ID + * + * @author zhangyong + * @since v1.0.0 2020-08-13 + */ +@Data +public class CommonFunctionIdFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 定制功能ID + */ + @NotBlank(message = "定制功能ID不能为空") + private String functionId; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerDomainFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerDomainFormDTO.java new file mode 100644 index 0000000000..a7c053df2c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerDomainFormDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/19 16:13 + */ +@Data +public class CustomerDomainFormDTO implements Serializable { + private static final long serialVersionUID = 6766612197218605922L; + private String customerId; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFunctionCollectFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFunctionCollectFormDTO.java new file mode 100644 index 0000000000..b29c199c3a --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFunctionCollectFormDTO.java @@ -0,0 +1,36 @@ +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 运营端-定制功能采集-接口入参 + * @Author sun + */ +@Data +public class CustomerFunctionCollectFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 客户Id + */ + @NotBlank(message = "客户ID不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + /** + * 功能ID + */ + @NotBlank(message = "功能ID不能为空", groups = {AddUserInternalGroup.class}) + private String functionId; + /** + * 上架理由 + */ + @NotBlank(message = "上架理由不能为空", groups = {AddUserShowGroup.class}) + private String reason; + + public interface AddUserInternalGroup {} + + public interface AddUserShowGroup extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionCustomizedListFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionCustomizedListFormDTO.java new file mode 100644 index 0000000000..2c6e3c037a --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionCustomizedListFormDTO.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.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import java.io.Serializable; + +/** + * 定制功能列表 入参 + * + * @author zhangyong + * @since v1.0.0 2020-08-14 + */ +@Data +public class FunctionCustomizedListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 功能名称 + */ + private String customizedName; + + + /** + * 所属端 + */ + private String fromApp; + + /** + * 页码,从1开始 + */ + @Min(value = 1, message = "页码必须大于0") + private Integer pageNo; + + /** + * 页容量,默认20页 + */ + @Min(value = 1, message = "每页条数必须大于必须大于0") + private Integer pageSize; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java new file mode 100644 index 0000000000..ee133cd136 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionDetailFromDTO.java @@ -0,0 +1,35 @@ +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 FunctionDetailFromDTO implements Serializable { + + private static final long serialVersionUID = -6163303184086480522L; + + public interface AddUserInternalGroup { + } + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 客户ID + */ + @NotBlank(message = "客户Id不能为空", groups = {AddUserShowGroup.class}) + private String customerId; + + /** + * resi:居民端,work:工作端 + */ + @NotBlank(message = "所属端不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class}) + private String clientType; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionVisitedFromDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionVisitedFromDTO.java new file mode 100644 index 0000000000..829e019fac --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/FunctionVisitedFromDTO.java @@ -0,0 +1,56 @@ +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 FunctionVisitedFromDTO implements Serializable { + + private static final long serialVersionUID = -6163303184086480522L; + + public interface AddUserInternalGroup { + } + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 用户Id + */ + private String userId; + /** + * 客户Id + */ + private String customerId; + /** + * 所属端 + */ + @NotBlank(message = "所属端不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class}) + private String clientType; + /** + * 功能Id + */ + @NotBlank(message = "功能Id不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class}) + private String functionId; + /** + * 请求地址 + */ + @NotBlank(message = "请求地址不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class}) + private String url; + /** + * 结果 + */ + @NotBlank(message = "结果不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class}) + private String result; + /** + * 原因 + */ + private String msg; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeTemplateCommonFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeTemplateCommonFormDTO.java new file mode 100644 index 0000000000..d692367b38 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeTemplateCommonFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 获取可用组件、获取小程序首页配置,入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/25 10:28 + */ +@Data +public class HomeTemplateCommonFormDTO implements Serializable { + public interface AddUserInternalGroup {} + /** + * 所属端类型 0:居民端 1:政府端 + */ + @NotBlank(message = "所属端类型不能为空",groups = {AddUserInternalGroup.class}) + private String clientType; + + public String getClientType() { + return clientType; + } + + public void setClientType(String clientType) { + this.clientType = clientType; + } +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeTemplateFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeTemplateFormDTO.java new file mode 100644 index 0000000000..95bb7937ae --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/HomeTemplateFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/24 21:59 + */ +@Data +public class HomeTemplateFormDTO implements Serializable { + /** + * 0居民端1政府端 + */ + private String clientType; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/QueryFunctionListFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/QueryFunctionListFormDTO.java new file mode 100644 index 0000000000..9e30e726b1 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/QueryFunctionListFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 运营端-查询已上架功能列表-接口入参 + * @author sun + */ +@Data +public class QueryFunctionListFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 功能类型:0.默认功能,1.定制功能 + */ + private String functionGroup; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java new file mode 100644 index 0000000000..20d3fd5298 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SaveFunctionCustomizedFormDTO.java @@ -0,0 +1,72 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 定制功能新增 入参 + * + * @author zhangyong + * @since v1.0.0 2020-08-13 + */ +@Data +public class SaveFunctionCustomizedFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 功能名称 + */ + @NotBlank(message = "功能名称不能为空") + private String functionName; + + /** + * 功能类型:0.默认功能,1.定制功能 + */ + @NotBlank(message = "功能类型:0.默认功能,1.定制功能不能为空") + private String functionGroup; + + /** + * 功能说明 + */ + @NotBlank(message = "功能说明不能为空") + private String functionExplain; + + /** + * 默认大图标 + */ + @NotBlank(message = "默认大图标不能为空") + private String iconLargeImg; + + /** + * 默认小图标 + */ + @NotBlank(message = "默认小图标不能为空") + private String iconSmallImg; + + /** + * 外链地址 + */ + @NotBlank(message = "外链地址不能为空") + private String targetLink; + + /** + * 上架状态:0:下架、1:上架 + */ + @NotBlank(message = "上架状态:0:下架、1:上架不能为空") + private String shoppingStatus; + + /** + * 业务域名(https;//... 无端口号) + */ + @NotBlank(message = "业务域名(https;//... 无端口号)不能为空") + private String domainName; + + /** + * 来源app(工作端:gov、居民端:resi) + */ + @NotBlank(message = "来源app(工作端:gov、居民端:resi)不能为空") + private String fromApp; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.java new file mode 100644 index 0000000000..83800e2af5 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomerFunctionFormDTO.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; + +/** + * 客户定制功能修改 入参 + * 目前允许修改功能名称、大小图标 + * + * @author zhangyong + * @since v1.0.0 2020-08-13 + */ +@Data +public class UpdateCustomerFunctionFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup {} + + /** + * 客户Id + */ + @NotBlank(message = "客户ID不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + + /** + * 功能ID + */ + @NotBlank(message = "功能ID不能为空", groups = {AddUserInternalGroup.class}) + private String functionId; + + /** + * 自定义功能名称 + */ + @NotBlank(message = "自定义功能名称不能为空", groups = {AddUserShowGroup.class}) + private String functionName; + + /** + * 自定义大图标 + */ + @NotBlank(message = "自定义大图标不能为空", groups = {AddUserShowGroup.class}) + private String iconLargeImg; + + /** + * 自定义小图标 + */ + @NotBlank(message = "自定义小图标不能为空", groups = {AddUserShowGroup.class}) + private String iconSmallImg; + + private String userId; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java new file mode 100644 index 0000000000..ec690c3a49 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateCustomizedFormDTO.java @@ -0,0 +1,72 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 定制功能修改 入参 + * + * @author zhangyong + * @since v1.0.0 2020-08-13 + */ +@Data +public class UpdateCustomizedFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 定制功能ID + */ + @NotBlank(message = "定制功能ID不能为空") + private String functionId; + + /** + * 上架状态:0:下架、1:上架 + */ + @NotBlank(message = "上架状态:0:下架、1:上架不能为空") + private String shoppingStatus; + + /** + * 功能说明 + */ + @NotBlank(message = "功能说明不能为空") + private String functionExplain; + + /** + * 默认名称 + */ + @NotBlank(message = "功能名称不能为空") + private String functionName; + + /** + * 默认大图标 + */ + @NotBlank(message = "默认大图标不能为空") + private String iconLargeImg; + + /** + * 默认小图标 + */ + @NotBlank(message = "默认小图标不能为空") + private String iconSmallImg; + + + /** + * 外链地址 + */ + @NotBlank(message = "外链地址不能为空") + private String targetLink; + + /** + * 业务域名 + */ + @NotBlank(message = "业务域名不能为空") + private String domainName; + + /** + * 来源app(工作端:gov、居民端:resi) + */ + @NotBlank(message = "来源app(工作端:gov、居民端:resi)不能为空") + private String fromApp; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateShoppingStatusFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateShoppingStatusFormDTO.java new file mode 100644 index 0000000000..2a27cfbc18 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/UpdateShoppingStatusFormDTO.java @@ -0,0 +1,47 @@ +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 zhangyong + * @since v1.0.0 2020-08-13 + */ +@Data +public class UpdateShoppingStatusFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + public interface AddUserInternalGroup {} + public interface AddUserShowGroup extends CustomerClientShowGroup {} + + /** + * 客户Id + */ + @NotBlank(message = "客户Id不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + + /** + * 功能ID + */ + @NotBlank(message = "功能ID不能为空", groups = {AddUserInternalGroup.class}) + private String functionId; + + /** + * 上架状态:0:下架、1:上架 + */ + @NotBlank(message = "上架状态:0:下架、1:上架不能为空", groups = {AddUserShowGroup.class}) + private String shoppingStatus; + + /** + * 理由 + */ + @NotBlank(message = "上下架理由不能为空", groups = {AddUserShowGroup.class}) + private String reason; + + private String userId; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java new file mode 100644 index 0000000000..2518bb28b4 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/WebviewDomainFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/19 17:46 + */ +@Data +public class WebviewDomainFormDTO implements Serializable { + private static final long serialVersionUID = 8022056850984848597L; + /** + * 客户ID + */ + private String customerId; + /** + * 客户端类型 + */ + private String clientType; + /** + * 操作类型:add 添加,delete 删除,set 覆盖 + */ + private String action; + /** + * 业务域名 + */ + private List webViewDomain; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/updatedisplayorderListFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/updatedisplayorderListFormDTO.java new file mode 100644 index 0000000000..c36d1b609e --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/updatedisplayorderListFormDTO.java @@ -0,0 +1,36 @@ +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 运营端-客户定制功能顺序修改-接口入参 + * @Author sun + */ +@Data +public class updatedisplayorderListFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 客户Id + */ + @NotBlank(message = "客户ID不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + /** + * 功能ID + */ + @NotBlank(message = "功能ID不能为空", groups = {AddUserInternalGroup.class}) + private String functionId; + /** + * 排序号 + */ + @NotBlank(message = "排序号不能为空", groups = {AddUserShowGroup.class}) + private Integer displayOrder; + + public interface AddUserInternalGroup {} + + public interface AddUserShowGroup extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ComponentListByCustomerResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ComponentListByCustomerResultDTO.java index 9e1ccb1703..3765b404f8 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ComponentListByCustomerResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/ComponentListByCustomerResultDTO.java @@ -6,7 +6,7 @@ import java.io.Serializable; import java.util.List; /** - * @Description 运营端-客户定制化服务-获取客户可用组件列表-返参 + * @Description 运营端-客户定制化服务-获取客户可用组件列表-返参 小程序首页默认配置(/oper/customize/customerhometemplate/getcomponentlist)返参也用的这个DTO * @Author yinzuomei * @Date 2020/3/11 12:57 */ diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFunctionCollectResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFunctionCollectResultDTO.java new file mode 100644 index 0000000000..b1d9b1afe0 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFunctionCollectResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 运营端-定制功能采集-接口返参 + * @Author sun + */ +@Data +public class CustomerFunctionCollectResultDTO implements Serializable { + private static final long serialVersionUID = 2971689193155710437L; + + /** + * 客户某一端定制功能总数 + */ + private Integer num; + + /** + * 所属端中文名称 + */ + private String fromAppName; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFunctionCustomizedListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFunctionCustomizedListResultDTO.java new file mode 100644 index 0000000000..4c38302f8d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFunctionCustomizedListResultDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 运营端-客户定制功能列表-接口返参 + * @Author sun + */ +@Data +public class CustomerFunctionCustomizedListResultDTO implements Serializable { + private static final long serialVersionUID = 2971689193155710437L; + + + /** + * 默认功能列表 + */ + private List customerList = new ArrayList<>(); + + /** + * 定制功能列表 + */ + private List functionList = new ArrayList<>(); + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerResultDTO.java new file mode 100644 index 0000000000..3c993374b3 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerResultDTO.java @@ -0,0 +1,74 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 运营端-客户定制功能列表-接口返参 + * @Author sun + */ +@Data +public class CustomerResultDTO implements Serializable { + private static final long serialVersionUID = 2971689193155710437L; + + /** + * 客户Id + */ + private String customerId; + /** + * 定制功能Id + */ + private String functionId; + /** + * 默认功能名称 + */ + private String customizedName; + /** + * 自定义功能名称 + */ + private String functionName; + /** + * 功能所属端(居民端:resi 工作端:work) + */ + private String fromApp; + /** + * 默认大图标 + */ + private String defaultLargeImg; + /** + * 自定义大图标 + */ + private String iconLargeImg; + /** + * 默认小图标 + */ + private String defaultSmallImg; + /** + * 自定义小图标 + */ + private String iconSmallImg; + /** + * 上下架(0:下架、1:上架) + */ + private Integer shoppingStatus; + /** + * 业务域名 + */ + private String domainName; + /** + * 外链地址 + */ + private String targetLink; + /** + * 排序 + */ + private Integer displayOrder; + /** + * 功能说明 + */ + private String functionExplain; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java new file mode 100644 index 0000000000..e232ce5f2f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedDetailResultDTO.java @@ -0,0 +1,66 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 定制功能详情 返回值 + * + * @author zhangyong + * @since v1.0.0 2020-08-13 + */ +@Data +public class FunctionCustomizedDetailResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 功能ID(function.ID) + */ + private String functionId; + + /** + * 上架状态:0:下架、1:上架 + */ + private String shoppingStatus; + + /** + * 功能说明 + */ + private String functionExplain; + + /** + * 默认名称 + */ + private String functionName; + + /** + * 默认大图标 + */ + private String iconLargeImg; + + /** + * 默认小图标 + */ + private String iconSmallImg; + + /** + * 外链地址 + */ + private String targetLink; + + /** + * 业务域名 + */ + private String domainName; + + /** + * 来源app(工作端:gov、居民端:resi) + */ + private String fromApp; + + /** + * 是否有客户在使用(0:否 1:是) + */ + private Integer isApply; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListDTO.java new file mode 100644 index 0000000000..85faedd828 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListDTO.java @@ -0,0 +1,61 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 定制功能列表 返回值 + * + * @author zhangyong + * @since v1.0.0 2020-08-14 + */ +@Data +public class FunctionCustomizedListDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 功能ID(function.ID) + */ + private String functionId; + + /** + * 上架状态:0:下架、1:上架 + */ + private String shoppingStatus; + + /** + * 功能说明 + */ + private String functionExplain; + + /** + * 默认名称 + */ + private String customizedName; + + /** + * 默认大图标 + */ + private String iconLargeImg; + + /** + * 默认小图标 + */ + private String iconSmallImg; + + /** + * 外链地址 + */ + private String targetLink; + + /** + * 业务域名 + */ + private String domainName; + + /** + * 来源app(政府端:gov、居民端:resi) + */ + private String fromApp; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java new file mode 100644 index 0000000000..2428e4d441 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionCustomizedListResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 定制功能列表 返回值 + * + * @author zhangyong + * @since v1.0.0 2020-08-14 + */ +@Data +public class FunctionCustomizedListResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 列表总条数 + */ + private Integer total; + + /** + * 列表内容 + */ + private List list; + + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionDetailResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionDetailResultDTO.java new file mode 100644 index 0000000000..ebbcd3ea9b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionDetailResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; + +/** + * 查询客户定制功能列表-接口返参 + * @Author sun + */ +@Data +public class FunctionDetailResultDTO implements Serializable { + private static final long serialVersionUID = 2971689193155710437L; + + /** + * 功能Id + */ + private String functionId; + + /** + * 自定义功能名称 + */ + private String functionName; + + /** + * 自定义大图标 + */ + private String iconLargeImg; + + /** + * 自定义小图标 + */ + private String iconSmallImg; + + /** + * 请求地址(https://+业务域名+外链地址) + */ + private String url; + + /** + * 自定义排序 + */ + private String dispalyOrder; + + /** + * 自定义json(目前是空值)【集合对象经过urlencode转化】 + */ + private String customerParameter; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionResultDTO.java new file mode 100644 index 0000000000..7c211434c6 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/FunctionResultDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Description 运营端-客户定制功能列表-接口返参 + * @Author sun + */ +@Data +public class FunctionResultDTO implements Serializable { + private static final long serialVersionUID = 2971689193155710437L; + + /** + * 客户Id + */ + private String customerId; + /** + * 定制功能Id + */ + private String functionId; + /** + * 默认功能名称 + */ + private String customizedName; + /** + * 功能所属端(居民端:resi 工作端:work) + */ + private String fromApp; + /** + * 功能说明 + */ + private String functionExplain; + +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeDesignByCustomerResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeDesignByCustomerResultDTO.java index 64dbfdaa26..4c1ad37e76 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeDesignByCustomerResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/HomeDesignByCustomerResultDTO.java @@ -7,7 +7,7 @@ import java.util.List; import java.util.Set; /** - * @Description 运营端-客户定制化服务-获取客户首页配置的设计稿返参 + * @Description 运营端-客户定制化服务-获取客户首页配置的设计稿返参 (/oper/customize/customerhometemplate/gethometemplate接口也用的此DTO) * @Author yang * @Date 2020/3/16 12:57 */ diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml index 21d31ea187..fc836e6a15 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml +++ b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-customize-server: container_name: oper-customize-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.26 + image: 192.168.1.130:10080/epmet-cloud-dev/oper-customize-server:0.3.42 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-prod.yml b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-prod.yml index df76d59dbc..0b2cba4848 100644 --- a/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-prod.yml +++ b/epmet-module/oper-customize/oper-customize-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: oper-customize-server: container_name: oper-customize-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-customize-server:0.3.26 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/oper-customize-server:0.3.43 ports: - "8089:8089" network_mode: host # 使用现有网络 diff --git a/epmet-module/oper-customize/oper-customize-server/pom.xml b/epmet-module/oper-customize/oper-customize-server/pom.xml index d6ce7700ad..b42ea55d37 100644 --- a/epmet-module/oper-customize/oper-customize-server/pom.xml +++ b/epmet-module/oper-customize/oper-customize-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.26 + 0.3.43 com.epmet oper-customize @@ -112,8 +112,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.java new file mode 100644 index 0000000000..245d5018a2 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFunctionDetailController.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.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.dto.CustomerFunctionDetailDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.CustomerFunctionCustomizedListResultDTO; +import com.epmet.dto.result.FunctionDetailResultDTO; +import com.epmet.excel.CustomerFunctionDetailExcel; +import com.epmet.service.CustomerFunctionDetailService; +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-08-11 + */ +@RestController +@RequestMapping("customerfunctiondetail") +public class CustomerFunctionDetailController { + + @Autowired + private CustomerFunctionDetailService customerFunctionDetailService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerFunctionDetailService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerFunctionDetailDTO data = customerFunctionDetailService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerFunctionDetailDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerFunctionDetailService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerFunctionDetailDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerFunctionDetailService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerFunctionDetailService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerFunctionDetailService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerFunctionDetailExcel.class); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 居民端-获取客户定制功能列表 + **/ + @PostMapping("resifunctiondetaillist") + public Result> resiFunctionDetail(@LoginUser TokenDto tokenDto, @RequestBody FunctionDetailFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, FunctionDetailFromDTO.AddUserShowGroup.class); + return new Result>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO)); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 工作端-获取客户定制功能列表 + **/ + @PostMapping("workfunctiondetaillist") + public Result> workFunctionDetail(@LoginUser TokenDto tokenDto, @RequestBody FunctionDetailFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, FunctionDetailFromDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(customerFunctionDetailService.resiAndWorkFunctionDetail(formDTO)); + } + + /** + * 修改客户定制功能上下架 + * 修改上下架状态,保存上下架历史 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:17 2020-08-17 + **/ + @PostMapping("updateshoppingstatus") + public Result updateShoppingStatus(@LoginUser TokenDto tokenDto, @RequestBody UpdateShoppingStatusFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UpdateShoppingStatusFormDTO.AddUserInternalGroup.class, UpdateShoppingStatusFormDTO.AddUserShowGroup.class); + formDTO.setUserId(tokenDto.getUserId()); + return customerFunctionDetailService.updateShoppingStatus(formDTO); + } + + /** + * 客户定制功能修改 入参 + * 目前允许修改功能名称、大小图标 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:17 2020-08-17 + **/ + @PostMapping("updatecustomerfunction") + public Result updateCustomerFunction(@LoginUser TokenDto tokenDto, @RequestBody UpdateCustomerFunctionFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UpdateCustomerFunctionFormDTO.AddUserInternalGroup.class, UpdateCustomerFunctionFormDTO.AddUserShowGroup.class); + formDTO.setUserId(tokenDto.getUserId()); + return customerFunctionDetailService.updateCustomerFunction(formDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 客户定制功能列表 + **/ + @PostMapping("customerfunctionlist") + public Result customerFunctionList(@LoginUser TokenDto tokenDto, @RequestBody CustomerFunctionListFormDTO formDTO) { + return new Result().ok(customerFunctionDetailService.customerFunctionList(formDTO.getCustomerId())); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 客户定制功能顺序修改 + **/ + @PostMapping("updatedisplayorder") + //public Result updateDisplayOrder(@LoginUser TokenDto tokenDto, @RequestParam("formDTO") List formDTO) { + public Result updateDisplayOrder(@LoginUser TokenDto tokenDto, @RequestBody(required = true) List formDTO) { + customerFunctionDetailService.updateDisplayOrder(tokenDto, formDTO); + return new Result(); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 定制功能采集 + **/ + @PostMapping("customerfunctioncollect") + public Result customerFunctionCollect(@LoginUser TokenDto tokenDto, @RequestBody CustomerFunctionCollectFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, CustomerFunctionCollectFormDTO.AddUserInternalGroup.class, CustomerFunctionCollectFormDTO.AddUserShowGroup.class); + return customerFunctionDetailService.customerFunctionCollect(formDTO); + } + + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerHomeTemplateController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerHomeTemplateController.java index e842ec2794..99fd872b92 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerHomeTemplateController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerHomeTemplateController.java @@ -17,6 +17,8 @@ package com.epmet.controller; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; @@ -26,8 +28,12 @@ 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.CustomerHomeTemplateDTO; +import com.epmet.dto.form.HomeTemplateCommonFormDTO; +import com.epmet.dto.result.ComponentListByCustomerResultDTO; +import com.epmet.dto.result.HomeDesignByCustomerResultDTO; import com.epmet.excel.CustomerHomeTemplateExcel; import com.epmet.service.CustomerHomeTemplateService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -91,4 +97,42 @@ public class CustomerHomeTemplateController { ExcelUtils.exportExcelToTarget(response, null, list, CustomerHomeTemplateExcel.class); } + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO clientType 所属端:0.居民端,1.领导端 + * @author yinzuomei + * @description 获取可用组件列表 + * @Date 2020/8/24 21:15 + **/ + @PostMapping("getcomponentlist") + public Result getComponetList(@RequestBody HomeTemplateCommonFormDTO formDTO) { + return new Result().ok(customerHomeTemplateService.getComponentListByCustomer(formDTO.getClientType())); + } + + /** + * @param formDTO clientType 所属端:0.居民端,1.领导端 + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 获取小程序首页配置 + * @Date 2020/8/24 22:06 + **/ + @PostMapping("gethometemplate") + public Result getHomeTemplate(@RequestBody HomeTemplateCommonFormDTO formDTO) { + return new Result().ok(customerHomeTemplateService.getHomeTemplate(formDTO.getClientType())); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 保存小程序首页配置 + * @Date 2020/8/24 22:19 + **/ + @PostMapping("savecustomerhometemplate") + public Result saveCustomerHomeTemplate(@RequestBody CustomerHomeTemplateFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + customerHomeTemplateService.saveCustomerHomeTemplate(formDTO); + return new Result(); + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerHomeTemplateFormDTO.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerHomeTemplateFormDTO.java new file mode 100644 index 0000000000..9ee71fddd9 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerHomeTemplateFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.controller; + +import com.epmet.dto.form.HomeComponentFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 保存小程序首页配置 入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/24 22:18 + */ +@Data +public class CustomerHomeTemplateFormDTO implements Serializable { + /** + * 所属端类型 0:居民端 1:政府端 + */ + @NotBlank(message = "所属端类型不能为空") + private String clientType; + + /** + * 组件集合 + */ + private List componentList; +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionController.java index ef7eec6d02..2973fbf1cd 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionController.java @@ -17,15 +17,18 @@ 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; 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.FunctionDTO; +import com.epmet.dto.form.QueryFunctionListFormDTO; import com.epmet.excel.FunctionExcel; import com.epmet.service.FunctionService; import org.springframework.beans.factory.annotation.Autowired; @@ -99,7 +102,22 @@ public class FunctionController { * @Date 2020/3/23 22:11 **/ @GetMapping("queryFunctionList") - public Result> queryFunctionList() { - return functionService.queryFunctionList(); + public Result> queryFunctionList(QueryFunctionListFormDTO formDTO) { + return new Result>().ok(functionService.getFunctionList(formDTO)); + } + + /** + * @param dto + * @return + * @Author sun + * @Description 默认功能新增 + **/ + @PostMapping("savefunction") + public Result saveFunction(@LoginUser TokenDto tokenDto, @RequestBody FunctionDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + functionService.saveFunction(dto); + return new Result(); } + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java new file mode 100644 index 0000000000..8326a0a528 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedController.java @@ -0,0 +1,180 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.FunctionCustomizedDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; +import com.epmet.dto.result.FunctionCustomizedListResultDTO; +import com.epmet.excel.FunctionCustomizedExcel; +import com.epmet.service.FunctionCustomizedService; +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-08-11 + */ +@RestController +@RequestMapping("functioncustomized") +public class FunctionCustomizedController { + + @Autowired + private FunctionCustomizedService functionCustomizedService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = functionCustomizedService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + FunctionCustomizedDTO data = functionCustomizedService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody FunctionCustomizedDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + functionCustomizedService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody FunctionCustomizedDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + functionCustomizedService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + functionCustomizedService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = functionCustomizedService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, FunctionCustomizedExcel.class); + } + + /** + * 定制功能新增(功能表、定制功能表) + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:54 2020-08-13 + **/ + @PostMapping("savefunctioncustomized") + public Result saveFunctionCustomized(@RequestBody SaveFunctionCustomizedFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + functionCustomizedService.saveFunctionCustomized(formDTO); + return new Result(); + } + + /** + * 定制功能详情 + * 根据定制功能Id查询对应的详情数据 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:36 2020-08-13 + **/ + @PostMapping("getfunctioncustomized") + public Result getFunctionCustomized(@RequestBody CommonFunctionIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return functionCustomizedService.getFunctionCustomized(formDTO); + } + + /** + * 定制功能删除 + * 单条删除,在没有客户使用的前提下可以逻辑删除(客户定制功能详情表 ,没查到就是没人在使用) + * 当功能 有客户在使用时,返回code: 8000 + * msg: 功能正在使用中,不允许删除! + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 11:03 2020-08-13 + **/ + @PostMapping("deletefunctioncustomized") + public Result deleteFunctionCustomized(@RequestBody CommonFunctionIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return functionCustomizedService.deleteFunctionCustomized(formDTO); + } + + /** + * 定制功能修改 + * 有客户在使用该功能时则不允许修改上下架状态、业务域名和外链地址、所属端app, + * 只能修改功能名称和大小图标、功能说明 + * 修改的要判断是否有客户在使用,有用的要批量更新已使用客户数据 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 14:52 2020-08-13 + **/ + @PostMapping("updatecustomized") + public Result updateCustomized(@RequestBody UpdateCustomizedFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return functionCustomizedService.updateCustomized(formDTO); + } + + /** + * 定制功能列表 + * 按功能分组,先工作端在居民端,在按创建时间倒序 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:07 2020-08-14 + **/ + @PostMapping("functioncustomizedlist") + public Result functionCustomizedList(@RequestBody FunctionCustomizedListFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return functionCustomizedService.functionCustomizedList(formDTO); + } + + @PostMapping("customerdomainname") + public Result customerDomain(@RequestBody CustomerDomainFormDTO formDTO) { + functionCustomizedService.customerDomain(formDTO); + return new Result(); + } +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedVisitedController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedVisitedController.java new file mode 100644 index 0000000000..faea8de9e9 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionCustomizedVisitedController.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.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.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.FunctionCustomizedVisitedDTO; +import com.epmet.dto.form.FunctionDetailFromDTO; +import com.epmet.dto.form.FunctionVisitedFromDTO; +import com.epmet.dto.result.FunctionDetailResultDTO; +import com.epmet.excel.FunctionCustomizedVisitedExcel; +import com.epmet.service.FunctionCustomizedVisitedService; +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-08-13 + */ +@RestController +@RequestMapping("functioncustomizedvisited") +public class FunctionCustomizedVisitedController { + + @Autowired + private FunctionCustomizedVisitedService functionCustomizedVisitedService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = functionCustomizedVisitedService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + FunctionCustomizedVisitedDTO data = functionCustomizedVisitedService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody FunctionCustomizedVisitedDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + functionCustomizedVisitedService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody FunctionCustomizedVisitedDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + functionCustomizedVisitedService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + functionCustomizedVisitedService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = functionCustomizedVisitedService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, FunctionCustomizedVisitedExcel.class); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 居民端-保存定制功能访问记录 + **/ + @PostMapping("saveresifunctionvisited") + public Result saveResiFunctionVisited(@LoginUser TokenDto tokenDto, @RequestBody FunctionVisitedFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, FunctionVisitedFromDTO.AddUserInternalGroup.class, FunctionVisitedFromDTO.AddUserShowGroup.class); + formDTO.setUserId(tokenDto.getUserId()); + functionCustomizedVisitedService.saveFunctionVisited(formDTO); + return new Result(); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 工作端-保存定制功能访问记录 + **/ + @PostMapping("saveworkfunctionvisited") + public Result> saveWorkFunctionVisited(@LoginUser TokenDto tokenDto, @RequestBody FunctionVisitedFromDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, FunctionVisitedFromDTO.AddUserInternalGroup.class, FunctionVisitedFromDTO.AddUserShowGroup.class); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + functionCustomizedVisitedService.saveFunctionVisited(formDTO); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionShoppingHistoryController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionShoppingHistoryController.java new file mode 100644 index 0000000000..51e1c62815 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/FunctionShoppingHistoryController.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.FunctionShoppingHistoryDTO; +import com.epmet.excel.FunctionShoppingHistoryExcel; +import com.epmet.service.FunctionShoppingHistoryService; +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-08-14 + */ +@RestController +@RequestMapping("functionshoppinghistory") +public class FunctionShoppingHistoryController { + + @Autowired + private FunctionShoppingHistoryService functionShoppingHistoryService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = functionShoppingHistoryService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + FunctionShoppingHistoryDTO data = functionShoppingHistoryService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody FunctionShoppingHistoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + functionShoppingHistoryService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody FunctionShoppingHistoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + functionShoppingHistoryService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + functionShoppingHistoryService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = functionShoppingHistoryService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, FunctionShoppingHistoryExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.java new file mode 100644 index 0000000000..bfbefc518d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFunctionDetailDao.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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerFunctionDetailDTO; +import com.epmet.dto.form.CustomerFunctionCollectFormDTO; +import com.epmet.dto.form.FunctionDetailFromDTO; +import com.epmet.dto.form.UpdateCustomerFunctionFormDTO; +import com.epmet.dto.form.UpdateShoppingStatusFormDTO; +import com.epmet.dto.result.CustomerFunctionCollectResultDTO; +import com.epmet.dto.result.CustomerResultDTO; +import com.epmet.dto.result.FunctionDetailResultDTO; +import com.epmet.entity.CustomerFunctionDetailEntity; +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-08-11 + */ +@Mapper +public interface CustomerFunctionDetailDao extends BaseDao { + + /** + * 根据functionId查询使用该功能的,客户id: customizedId + * 可用来判断该功能,是否有客户在使用 + * + * @param functionId + * @return java.util.List + * @Author zhangyong + * @Date 11:14 2020-08-13 + **/ + List selectCustomerIdByFunctionId(@Param("functionId") String functionId); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 根据所属端和客户Id查询客户定制功能列表 + **/ + List selectFunctionDetailList(FunctionDetailFromDTO formDTO); + + /** + * 修改客户定制功能上下架 + * 修改上下架状态,保存上下架历史 + * + * @param formDTO + * @Author zhangyong + * @Date 09:17 2020-08-17 + **/ + void updateShoppingStatus(UpdateShoppingStatusFormDTO formDTO); + + /** + * 客户定制功能修改 入参 + * 目前允许修改功能名称、大小图标 + * + * @param formDTO + * @Author zhangyong + * @Date 10:00 2020-08-17 + **/ + void updateCustomerFunction(UpdateCustomerFunctionFormDTO formDTO); + + /** + * @param customerId + * @return + * @Author sun + * @Description 获取客户已有定制功能列表信息 + **/ + List selectCustomerFunction(@Param("customerId") String customerId); + + /** + * @param list + * @return + * @Author sun + * @Description 批量更新客户定制功能排序号信息 + **/ + void updateFunctionDetailList(@Param("list") List list); + + /** + * @param customerId + * @return + * @Author sun + * @Description .查询客户当前已有定制功能最大排序号 + **/ + CustomerFunctionDetailDTO selectOrderByCustomerId(@Param("customerId") String customerId); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 查询当前采集功能所属端,统计客户在当前所属端已上架功能总数 + **/ + CustomerFunctionCollectResultDTO sumCustomerFunctionNum(CustomerFunctionDetailDTO formDTO); +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeTemplateDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeTemplateDao.java index 5e60376eb5..f11dab0bc7 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeTemplateDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerHomeTemplateDao.java @@ -18,11 +18,18 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.ComponentListByCustomerFormDTO; +import com.epmet.dto.result.CommonComponentDesignResultDTO; +import com.epmet.dto.result.CommonComponentResultDTO; +import com.epmet.dto.result.FunctionComponentResultDTO; import com.epmet.entity.CustomerHomeTemplateEntity; 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-10 @@ -30,4 +37,50 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface CustomerHomeTemplateDao extends BaseDao { + /** + * @param clientType 所属端类型0.居民端,1.政府端 + * @return java.util.List + * @author yinzuomei + * @description 通用组件列表 + * @Date 2020/8/24 21:30 + **/ + List selectListCommonComponent(@Param("clientType") String clientType); + + /** + * @return java.util.List + * @author yinzuomei + * @description 功能组件列表(以功能分组) + * @Date 2020/8/24 21:30 + **/ + List selectListFunction(); + + /** + * @param functionId + * @param clientType + * @return java.util.List + * @author yinzuomei + * @description 根据功能,所属端,查询功能组件列表 + * @Date 2020/8/24 21:56 + **/ + List selectListFunctionComponent(@Param("functionId") String functionId, + @Param("clientType") String clientType); + + /** + * @return java.util.List + * @param clientType 所属端:0.居民端,1.领导端 + * @author yinzuomei + * @description 获取小程序首页配置 + * @Date 2020/8/24 22:12 + **/ + List selectCustomerTemplate(@Param("clientType") String clientType); + + /** + * @return int + * @param clientType + * @param userId + * @author yinzuomei + * @description 删除某一端的默认配置 + * @Date 2020/8/24 22:35 + **/ + int deleteByClientType(@Param("clientType") String clientType,@Param("userId") String userId); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.java new file mode 100644 index 0000000000..87a877214b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedDao.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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomizedDTO; +import com.epmet.dto.FunctionCustomizedDTO; +import com.epmet.dto.form.CommonFunctionIdFormDTO; +import com.epmet.dto.form.FunctionCustomizedListFormDTO; +import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; +import com.epmet.dto.result.FunctionCustomizedListDTO; +import com.epmet.dto.result.FunctionResultDTO; +import com.epmet.entity.FunctionCustomizedEntity; +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-08-11 + */ +@Mapper +public interface FunctionCustomizedDao extends BaseDao { + + /** + * 定制功能详情 + * 根据定制功能Id查询对应的详情数据 + * + * @param formDTO + * @return com.epmet.dto.result.FunctionCustomizedDetailResultDTO + * @Author zhangyong + * @Date 10:36 2020-08-13 + **/ + FunctionCustomizedDetailResultDTO getFunctionCustomizedByFunctionId(CommonFunctionIdFormDTO formDTO); + + /** + * 根据functionId, 对定制功能表,进行逻辑删除 + * + * @param functionId + * @return void + * @Author zhangyong + * @Date 13:31 2020-08-13 + **/ + void delByFunctionId(@Param("functionId") String functionId); + + /** + * 根据功能id,查询定制功能全部信息(定制功能表+功能表) + * @param functionId + * @return com.epmet.dto.CustomizedDTO + * @Author zhangyong + * @Date 16:21 2020-08-13 + **/ + CustomizedDTO selectCustomized(@Param("functionId") String functionId); + + /** + * 定制功能列表 + * 按功能分组,先工作端在居民端,在按创建时间倒序 + * + * @param formDTO + * @return java.lang.util + * @Author zhangyong + * @Date 10:07 2020-08-14 + **/ + List selectListFunctionCustomizedList(FunctionCustomizedListFormDTO formDTO); + + /** + * 定制功能列表 - 总数 + * + * @param formDTO + * @return java.lang.Integer + * @Author zhangyong + * @Date 10:10 2020-08-14 + **/ + Integer countTotalFunctionCustomizedList(FunctionCustomizedListFormDTO formDTO); + + /** + * 根据功能id,修改定制功能表 + * + * @param entity + * @return void + * @Author zhangyong + * @Date 13:26 2020-08-14 + **/ + void updateFunctionCustomized(FunctionCustomizedEntity entity); + + /** + * @param functionIds + * @return + * @Author sun + * @Description 获取不包含的定制功能列表 + **/ + List selectFunctionCustomizedList(@Param("functionIds") List functionIds); + + /** + * @param functionId + * @return + * @Author sun + * @Description 查询定制功能信息 + **/ + FunctionCustomizedDTO selectByFunctionId(@Param("functionId") String functionId); + + /** + * 获取业务域名 + * @author zhaoqifeng + * @date 2020/8/20 9:36 + * @param customerId + * @return java.util.List + */ + List selectDomains(@Param("customerId") String customerId); +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedVisitedDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedVisitedDao.java new file mode 100644 index 0000000000..471724a387 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionCustomizedVisitedDao.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.FunctionCustomizedVisitedEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-13 + */ +@Mapper +public interface FunctionCustomizedVisitedDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionDao.java index 0ad172a342..f39d3bff0c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.FunctionDTO; +import com.epmet.dto.form.QueryFunctionListFormDTO; import com.epmet.entity.FunctionEntity; import org.apache.ibatis.annotations.Mapper; @@ -48,4 +49,12 @@ public interface FunctionDao extends BaseDao { * @Description 查询所有已上架功能列表(默认、定制功能) **/ List selectShopFunctionList(int shoppingStatus); + + /** + * @param + * @return java.util.List + * @Author sun + * @Description 查询已上架的所有功能,供下拉框使用 + **/ + List selectQueryFunctionList(QueryFunctionListFormDTO formDTO); } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionShoppingHistoryDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionShoppingHistoryDao.java new file mode 100644 index 0000000000..674482045f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/FunctionShoppingHistoryDao.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.FunctionShoppingHistoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户定制功能上下架历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-14 + */ +@Mapper +public interface FunctionShoppingHistoryDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.java new file mode 100644 index 0000000000..53931cb040 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFunctionDetailEntity.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; + +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-08-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_function_detail") +public class CustomerFunctionDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 功能Id + */ + private String functionId; + + /** + * 自定义功能名称 + */ + private String functionName; + + /** + * 自定义大图标 + */ + private String iconLargeImg; + + /** + * 自定义小图标 + */ + private String iconSmallImg; + + /** + * 自定义业务域名 + */ + private String domainName; + + /** + * 外链地址 + */ + private String targetLink; + + /** + * 上架状态:0:下架、1:上架 + */ + private Integer shoppingStatus; + + /** + * 自定义排序 + */ + private Integer displayOrder; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedEntity.java new file mode 100644 index 0000000000..45983b12b0 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedEntity.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.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-08-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("function_customized") +public class FunctionCustomizedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 功能ID(function.ID) + */ + private String functionId; + + /** + * 默认名称 + */ + private String customizedName; + + /** + * 默认大图标 + */ + private String iconLargeImg; + + /** + * 默认小图标 + */ + private String iconSmallImg; + + /** + * 外链地址(必须是https的请求) + */ + private String targetLink; + + /** + * 业务域名 + */ + private String domainName; + + /** + * 来源app(政府端:gov、居民端:resi) + */ + private String fromApp; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedVisitedEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedVisitedEntity.java new file mode 100644 index 0000000000..6e9dfb53cd --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionCustomizedVisitedEntity.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.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-08-13 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("function_customized_visited") +public class FunctionCustomizedVisitedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户Id + */ + private String userId; + + /** + * 所属端 居民端:resi工作端:work + */ + private String clientType; + + /** + * 功能Id + */ + private String functionId; + + /** + * 请求地址 访问的url地址 + */ + private String url; + + /** + * 结果 成功success失败error + */ + private String result; + + /** + * 原因 失败的原因(例:请求超时、404、500等) + */ + private String msg; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionShoppingHistoryEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionShoppingHistoryEntity.java new file mode 100644 index 0000000000..6d8f479bac --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/FunctionShoppingHistoryEntity.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; + +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-08-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("function_shopping_history") +public class FunctionShoppingHistoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 功能Id + */ + private String functionId; + + /** + * 上下架状态 上架状态:0:下架、1:上架 + */ + private Integer shoppingStatus; + + /** + * 理由 + */ + private String reason; + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionDetailExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionDetailExcel.java new file mode 100644 index 0000000000..13c88668e8 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/CustomerFunctionDetailExcel.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.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-08-11 + */ +@Data +public class CustomerFunctionDetailExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "功能Id") + private String functionId; + + @Excel(name = "自定义功能名称") + private String functionName; + + @Excel(name = "自定义大图标") + private String iconLargeImg; + + @Excel(name = "自定义小图标") + private String iconSmallImg; + + @Excel(name = "自定义业务域名") + private String realmName; + + @Excel(name = "外链地址") + private String targetLink; + + @Excel(name = "自定义排序") + private Integer shoppingStatus; + + @Excel(name = "自定义排序") + private Integer displayOrder; + + @Excel(name = "删除标识(0.未删除 1.已删除)") + private Integer 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/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedExcel.java new file mode 100644 index 0000000000..42cc63eaa9 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedExcel.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.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-08-11 + */ +@Data +public class FunctionCustomizedExcel { + + @Excel(name = "唯一标识") + private String id; + + @Excel(name = "功能ID(function.ID)") + private String functionId; + + @Excel(name = "默认名称") + private String customizedName; + + @Excel(name = "默认大图标") + private String iconLargeImg; + + @Excel(name = "默认小图标") + private String iconSmallImg; + + @Excel(name = "外链地址(必须是https的请求)") + private String targetLink; + + @Excel(name = "删除标识(0.未删除 1.已删除)") + private Integer 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; + + @Excel(name = "业务域名") + private String domainName; + + @Excel(name = "来源app(政府端:gov、居民端:resi)") + private String fromApp; + + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedVisitedExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedVisitedExcel.java new file mode 100644 index 0000000000..6d631d8380 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionCustomizedVisitedExcel.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.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-08-13 + */ +@Data +public class FunctionCustomizedVisitedExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户ID") + private String customerId; + + @Excel(name = "用户Id") + private String userId; + + @Excel(name = "所属端 居民端:resi工作端:work") + private String clientType; + + @Excel(name = "功能Id") + private String functionId; + + @Excel(name = "请求地址 访问的url地址") + private String url; + + @Excel(name = "结果 成功success失败error") + private String result; + + @Excel(name = "原因 失败的原因(例:请求超时、404、500等)") + private String msg; + + @Excel(name = "删除标识(0.未删除 1.已删除)") + private Integer 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/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionShoppingHistoryExcel.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionShoppingHistoryExcel.java new file mode 100644 index 0000000000..a99dfed1f6 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/excel/FunctionShoppingHistoryExcel.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.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-08-14 + */ +@Data +public class FunctionShoppingHistoryExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户Id") + private String customerId; + + @Excel(name = "功能Id") + private String functionId; + + @Excel(name = "上下架状态 上架状态:0:下架、1:上架") + private Integer shoppingStatus; + + @Excel(name = "理由") + private String reason; + + @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/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFunctionDetailRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFunctionDetailRedis.java new file mode 100644 index 0000000000..c60f3b338f --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/CustomerFunctionDetailRedis.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-08-11 + */ +@Component +public class CustomerFunctionDetailRedis { + @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/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedRedis.java new file mode 100644 index 0000000000..f2854b11ef --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedRedis.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-08-11 + */ +@Component +public class FunctionCustomizedRedis { + @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/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedVisitedRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedVisitedRedis.java new file mode 100644 index 0000000000..fabdc63ff3 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionCustomizedVisitedRedis.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-08-13 + */ +@Component +public class FunctionCustomizedVisitedRedis { + @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/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionShoppingHistoryRedis.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionShoppingHistoryRedis.java new file mode 100644 index 0000000000..ebe8a91096 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/redis/FunctionShoppingHistoryRedis.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-08-14 + */ +@Component +public class FunctionShoppingHistoryRedis { + @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/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java new file mode 100644 index 0000000000..d0561093e3 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFunctionDetailService.java @@ -0,0 +1,154 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerFunctionDetailDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.CustomerFunctionCustomizedListResultDTO; +import com.epmet.dto.result.FunctionDetailResultDTO; +import com.epmet.entity.CustomerFunctionDetailEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户定制功能详情表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +public interface CustomerFunctionDetailService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-11 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-11 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerFunctionDetailDTO + * @author generator + * @date 2020-08-11 + */ + CustomerFunctionDetailDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-11 + */ + void save(CustomerFunctionDetailDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-11 + */ + void update(CustomerFunctionDetailDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-11 + */ + void delete(String[] ids); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 根据所属端和客户Id查询客户定制功能列表 + **/ + List resiAndWorkFunctionDetail(FunctionDetailFromDTO formDTO); + + /** + * 修改客户定制功能上下架 + * 修改上下架状态,保存上下架历史 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 09:17 2020-08-17 + **/ + Result updateShoppingStatus(UpdateShoppingStatusFormDTO formDTO); + + /** + * 客户定制功能修改 入参 + * 目前允许修改功能名称、大小图标 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:00 2020-08-17 + **/ + Result updateCustomerFunction(UpdateCustomerFunctionFormDTO formDTO); + + /** + * @param customerId + * @return + * @Author sun + * @Description 客户定制功能列表 + **/ + CustomerFunctionCustomizedListResultDTO customerFunctionList(String customerId); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 客户定制功能顺序修改 + **/ + void updateDisplayOrder(TokenDto tokenDto, List formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 定制功能采集 + **/ + Result customerFunctionCollect(CustomerFunctionCollectFormDTO formDTO); +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerHomeTemplateService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerHomeTemplateService.java index 4482538067..c0b7d6f5db 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerHomeTemplateService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerHomeTemplateService.java @@ -19,7 +19,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.controller.CustomerHomeTemplateFormDTO; import com.epmet.dto.CustomerHomeTemplateDTO; +import com.epmet.dto.result.ComponentListByCustomerResultDTO; +import com.epmet.dto.result.HomeDesignByCustomerResultDTO; import com.epmet.entity.CustomerHomeTemplateEntity; import java.util.List; @@ -101,4 +104,31 @@ public interface CustomerHomeTemplateService extends BaseService */ List getTemplateByClient(Integer client); + + /** + * @return com.epmet.dto.result.ComponentListByCustomerResultDTO + * @param clientType + * @author yinzuomei + * @description 获取可用组件列表 + * @Date 2020/8/24 21:16 + **/ + ComponentListByCustomerResultDTO getComponentListByCustomer(String clientType); + + /** + * @return com.epmet.dto.result.HomeDesignByCustomerResultDTO + * @param clientType 所属端:0.居民端,1.领导端 + * @author yinzuomei + * @description + * @Date 2020/8/24 22:06 + **/ + HomeDesignByCustomerResultDTO getHomeTemplate(String clientType); + + /** + * @return void + * @param formDTO + * @author yinzuomei + * @description 保存小程序首页配置 + * @Date 2020/8/24 22:20 + **/ + void saveCustomerHomeTemplate(CustomerHomeTemplateFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java new file mode 100644 index 0000000000..24411c0d80 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedService.java @@ -0,0 +1,162 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.commons.tools.utils.Result; +import com.epmet.dto.FunctionCustomizedDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; +import com.epmet.dto.result.FunctionCustomizedListResultDTO; +import com.epmet.entity.FunctionCustomizedEntity; + +import java.util.List; +import java.util.Map; + +/** + * 定制功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +public interface FunctionCustomizedService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-11 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-11 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FunctionCustomizedDTO + * @author generator + * @date 2020-08-11 + */ + FunctionCustomizedDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-11 + */ + void save(FunctionCustomizedDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-11 + */ + void update(FunctionCustomizedDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-11 + */ + void delete(String[] ids); + + /** + * 定制功能新增(功能表、定制功能表) + * + * @param formDTO + * @Author zhangyong + * @Date 09:54 2020-08-13 + **/ + void saveFunctionCustomized(SaveFunctionCustomizedFormDTO formDTO); + + /** + * 定制功能详情 + * 根据定制功能Id查询对应的详情数据 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:36 2020-08-13 + **/ + Result getFunctionCustomized(CommonFunctionIdFormDTO formDTO); + + /** + * 定制功能删除 + * 单条删除,在没有客户使用的前提下可以逻辑删除(客户定制功能详情表 ,没查到就是没人在使用) + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 11:03 2020-08-13 + **/ + Result deleteFunctionCustomized(CommonFunctionIdFormDTO formDTO); + + /** + * 定制功能修改 + * 有客户在使用该功能时则不允许修改上下架状态、业务域名和外链地址、所属端app, + * 只能修改功能名称和大小图标、功能说明 + * 修改的要判断是否有客户在使用,有用的要批量更新已使用客户数据 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 14:52 2020-08-13 + **/ + Result updateCustomized(UpdateCustomizedFormDTO formDTO); + + /** + * 定制功能列表 + * 按功能分组,先工作端在居民端,在按创建时间倒序 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:07 2020-08-14 + **/ + Result functionCustomizedList(FunctionCustomizedListFormDTO formDTO); + + /** + * 设置业务域名 + * @author zhaoqifeng + * @date 2020/8/19 16:15 + * @param formDTO + * @return void + */ + void customerDomain(CustomerDomainFormDTO formDTO); +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedVisitedService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedVisitedService.java new file mode 100644 index 0000000000..a87e756c02 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionCustomizedVisitedService.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; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.FunctionCustomizedVisitedDTO; +import com.epmet.dto.form.FunctionVisitedFromDTO; +import com.epmet.entity.FunctionCustomizedVisitedEntity; + +import java.util.List; +import java.util.Map; + +/** + * 定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-13 + */ +public interface FunctionCustomizedVisitedService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-13 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-13 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FunctionCustomizedVisitedDTO + * @author generator + * @date 2020-08-13 + */ + FunctionCustomizedVisitedDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-13 + */ + void save(FunctionCustomizedVisitedDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-13 + */ + void update(FunctionCustomizedVisitedDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-13 + */ + void delete(String[] ids); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 保存定制功能访问记录 + **/ + void saveFunctionVisited(FunctionVisitedFromDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionService.java index 7717980531..5f9bc6fad6 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionService.java @@ -21,6 +21,7 @@ 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.FunctionDTO; +import com.epmet.dto.form.QueryFunctionListFormDTO; import com.epmet.entity.FunctionEntity; import java.util.List; @@ -102,4 +103,21 @@ public interface FunctionService extends BaseService { * @Date 2020/3/23 22:10 **/ Result> queryFunctionList(); + + /** + * @param dto + * @return + * @Author sun + * @Description 默认功能新增 + **/ + void saveFunction(FunctionDTO dto); + + /** + * @param + * @return java.util.List + * @Author sun + * @Description 查询已上架的所有功能,供下拉框使用 + **/ + List getFunctionList(QueryFunctionListFormDTO formDTO); + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionShoppingHistoryService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionShoppingHistoryService.java new file mode 100644 index 0000000000..33f6d6ead6 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/FunctionShoppingHistoryService.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.FunctionShoppingHistoryDTO; +import com.epmet.entity.FunctionShoppingHistoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户定制功能上下架历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-14 + */ +public interface FunctionShoppingHistoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-08-14 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-08-14 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FunctionShoppingHistoryDTO + * @author generator + * @date 2020-08-14 + */ + FunctionShoppingHistoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-14 + */ + void save(FunctionShoppingHistoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-08-14 + */ + void update(FunctionShoppingHistoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-08-14 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java new file mode 100644 index 0000000000..d57623db5d --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFunctionDetailServiceImpl.java @@ -0,0 +1,280 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.CustomerFunctionDao; +import com.epmet.dao.CustomerFunctionDetailDao; +import com.epmet.dao.FunctionCustomizedDao; +import com.epmet.dao.FunctionShoppingHistoryDao; +import com.epmet.dto.CustomerFunctionDetailDTO; +import com.epmet.dto.FunctionCustomizedDTO; +import com.epmet.dto.FunctionShoppingHistoryDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.entity.CustomerFunctionDetailEntity; +import com.epmet.entity.CustomerFunctionEntity; +import com.epmet.entity.FunctionShoppingHistoryEntity; +import com.epmet.redis.CustomerFunctionDetailRedis; +import com.epmet.service.CustomerFunctionDetailService; +import com.epmet.service.FunctionShoppingHistoryService; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * 客户定制功能详情表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Service +public class CustomerFunctionDetailServiceImpl extends BaseServiceImpl implements CustomerFunctionDetailService { + + private Logger logger = LogManager.getLogger(CustomerFunctionDetailServiceImpl.class); + @Autowired + private CustomerFunctionDetailRedis customerFunctionDetailRedis; + @Autowired + private FunctionShoppingHistoryService functionShoppingHistoryService; + @Autowired + private FunctionCustomizedDao functionCustomizedDao; + @Autowired + private CustomerFunctionDao customerFunctionDao; + @Autowired + private FunctionShoppingHistoryDao functionShoppingHistoryDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerFunctionDetailDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerFunctionDetailDTO.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 CustomerFunctionDetailDTO get(String id) { + CustomerFunctionDetailEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerFunctionDetailDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerFunctionDetailDTO dto) { + CustomerFunctionDetailEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionDetailEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerFunctionDetailDTO dto) { + CustomerFunctionDetailEntity entity = ConvertUtils.sourceToTarget(dto, CustomerFunctionDetailEntity.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 根据所属端和客户Id查询客户定制功能列表 + **/ + @Override + public List resiAndWorkFunctionDetail(FunctionDetailFromDTO formDTO) { + //根据客户Id和所属端查询客户定制功能列表数据 + logger.info(String.format("根据客户Id和所属端查询客户定制功能列表,对应客户Id->%s,所属端->%s", formDTO.getCustomerId(), formDTO.getClientType())); + List list = baseDao.selectFunctionDetailList(formDTO); + try { + String join = String.join(",", new ArrayList<>()); + String customerParameter = java.net.URLEncoder.encode(join, "utf-8"); + list.forEach(l->{ + l.setCustomerParameter(customerParameter); + }); + } catch (Exception e) { + logger.error("CustomerFunctionDetailServiceImpl.resiAndWorkFunctionDetail->集合参数URLEncode失败"); + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); + } + return list; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result updateShoppingStatus(UpdateShoppingStatusFormDTO formDTO) { + // 用户定制功能上架,需判断,已上架的数量是否超过12 + if (NumConstant.ONE_STR.equals(formDTO.getShoppingStatus())){ + // 根据functionId,customerId,查询当前客户所属端 现已上架的 功能数量。 + CustomerFunctionDetailDTO functionDetailDTO = new CustomerFunctionDetailDTO(); + functionDetailDTO.setFunctionId(formDTO.getFunctionId()); + functionDetailDTO.setCustomerId(formDTO.getCustomerId()); + CustomerFunctionCollectResultDTO functionNum = baseDao.sumCustomerFunctionNum(functionDetailDTO); + if (NumConstant.TWELVE <= functionNum.getNum()){ + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(),"当前客户"+ functionNum.getFromAppName() +"已上架12个定制功能。不能继续上架!"); + } + } + // 修改 客户定制功能详情表,上下架状态 + baseDao.updateShoppingStatus(formDTO); + // 保存日志记录到 客户定制功能上下架历史表 + FunctionShoppingHistoryDTO historyDTO = ConvertUtils.sourceToTarget(formDTO, FunctionShoppingHistoryDTO.class); + historyDTO.setShoppingStatus(Integer.valueOf(formDTO.getShoppingStatus())); + functionShoppingHistoryService.save(historyDTO); + return new Result(); + } + + @Override + public Result updateCustomerFunction(UpdateCustomerFunctionFormDTO formDTO) { + baseDao.updateCustomerFunction(formDTO); + return new Result(); + } + + /** + * @param customerId + * @return + * @Author sun + * @Description 客户定制功能列表 + **/ + @Override + public CustomerFunctionCustomizedListResultDTO customerFunctionList(String customerId) { + CustomerFunctionCustomizedListResultDTO resultDTO = new CustomerFunctionCustomizedListResultDTO(); + //1.获取客户已有定制功能列表,按排序号排序 + List customerList = baseDao.selectCustomerFunction(customerId); + resultDTO.setCustomerList(customerList); + + //2.获取客户未有定制功能列表 + List functionIds = customerList.stream().map(CustomerResultDTO::getFunctionId).collect(Collectors.toList()); + List functionList = functionCustomizedDao.selectFunctionCustomizedList(functionIds); + functionList.forEach(fl->{ + fl.setCustomerId(customerId); + }); + resultDTO.setFunctionList(functionList); + + return resultDTO; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 客户定制功能顺序修改 + **/ + @Override + public void updateDisplayOrder(TokenDto tokenDto, List formDTO) { + //批量更新客户定制功能排序号信息 + List list = ConvertUtils.sourceToTarget(formDTO, CustomerFunctionDetailEntity.class); + list.forEach(l->{ + l.setUpdatedBy(tokenDto.getUserId()); + }); + baseDao.updateFunctionDetailList(list); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 定制功能采集 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public Result customerFunctionCollect(CustomerFunctionCollectFormDTO formDTO) { + //0.查询当前采集功能所属端,统计客户在当前所属端已上架功能总数 + CustomerFunctionDetailDTO customerFunctionDetailDTO = ConvertUtils.sourceToTarget(formDTO,CustomerFunctionDetailDTO.class); + CustomerFunctionCollectResultDTO dto = baseDao.sumCustomerFunctionNum(customerFunctionDetailDTO); + if (dto.getNum() >= NumConstant.TWELVE) { + return new Result().error(8000, String.format("当前客户在[%s]已存在12个上线功能,不允许再次采集!", dto.getFromAppName())); + } + + //1.查询定制功能详细信息 + FunctionCustomizedDTO functionDTO = functionCustomizedDao.selectByFunctionId(formDTO.getFunctionId()); + if(functionDTO == null){ + throw new RenException("根据定制功能Id未查询到定制功能详细信息"); + } + + //2.查询客户当前已有定制功能最大排序号 + CustomerFunctionDetailDTO detailDTO = baseDao.selectOrderByCustomerId(formDTO.getCustomerId()); + int displayOrder = NumConstant.ONE; + if(null!=detailDTO&&null!=detailDTO.getDisplayOrder()){ + displayOrder += detailDTO.getDisplayOrder(); + } + //3.给客户初始定制功能数据 + CustomerFunctionDetailEntity entity = new CustomerFunctionDetailEntity(); + entity.setCustomerId(formDTO.getCustomerId()); + entity.setFunctionId(formDTO.getFunctionId()); + entity.setFunctionName(functionDTO.getCustomizedName()); + entity.setIconLargeImg(functionDTO.getIconLargeImg()); + entity.setIconSmallImg(functionDTO.getIconSmallImg()); + entity.setDomainName(functionDTO.getDomainName()); + entity.setTargetLink(functionDTO.getTargetLink()); + entity.setShoppingStatus(NumConstant.ONE); + entity.setDisplayOrder(displayOrder); + baseDao.insert(entity); + + //4.客户功能权限表绑定关系 + CustomerFunctionEntity customerFunctionEntity = new CustomerFunctionEntity(); + customerFunctionEntity.setCustomerId(formDTO.getCustomerId()); + customerFunctionEntity.setFunctionId(formDTO.getFunctionId()); + customerFunctionDao.insert(customerFunctionEntity); + + //5.记录上下架操作日志 + FunctionShoppingHistoryEntity historyEntity = new FunctionShoppingHistoryEntity(); + historyEntity.setCustomerId(formDTO.getCustomerId()); + historyEntity.setFunctionId(functionDTO.getFunctionId()); + historyEntity.setShoppingStatus(NumConstant.ONE); + historyEntity.setReason(formDTO.getReason()); + functionShoppingHistoryDao.insert(historyEntity); + + return new Result(); + } + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerHomeTemplateServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerHomeTemplateServiceImpl.java index 220b1efc31..b94f5ad8c4 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerHomeTemplateServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerHomeTemplateServiceImpl.java @@ -21,10 +21,17 @@ 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.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.OperCustomizeConstant; +import com.epmet.constant.ReginConstant; +import com.epmet.controller.CustomerHomeTemplateFormDTO; import com.epmet.dao.CustomerHomeTemplateDao; import com.epmet.dto.CustomerHomeTemplateDTO; +import com.epmet.dto.form.HomeComponentFormDTO; +import com.epmet.dto.result.*; import com.epmet.entity.CustomerHomeTemplateEntity; import com.epmet.redis.CustomerHomeTemplateRedis; import com.epmet.service.CustomerHomeTemplateService; @@ -33,6 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -48,7 +56,8 @@ public class CustomerHomeTemplateServiceImpl extends BaseServiceImpl page(Map params) { IPage page = baseDao.selectPage( @@ -108,4 +117,85 @@ public class CustomerHomeTemplateServiceImpl extends BaseServiceImpl commonList=baseDao.selectListCommonComponent(clientType); + resultDTO.setCommonList(commonList); + List functionList = baseDao.selectListFunction(); + for (FunctionComponentResultDTO function : functionList) { + function.setComponentList(baseDao.selectListFunctionComponent(function.getFunctionId(), clientType)); + } + resultDTO.setFunctionList(functionList); + return resultDTO; + } + + /** + * @param clientType 所属端:0.居民端,1.领导端 + * @return com.epmet.dto.result.HomeDesignByCustomerResultDTO + * @author yinzuomei + * @description + * @Date 2020/8/24 22:06 + **/ + @Override + public HomeDesignByCustomerResultDTO getHomeTemplate(String clientType) { + HomeDesignByCustomerResultDTO resultDTO = new HomeDesignByCustomerResultDTO(); + //根据客户id,所属端获取客户首页配置的设计稿 + List list = baseDao.selectCustomerTemplate(clientType); + List titleList = new ArrayList<>(); + List topList = new ArrayList<>(); + List functionList = new ArrayList<>(); + List floatingList = new ArrayList<>(); + //使用过的组件集合 + List usedComponent = new ArrayList<>(); + for (CommonComponentDesignResultDTO c : list) { + usedComponent.add(c.getComponentId()); + //所属区域:0.标题区、1.置顶区、2.功能区、3.悬浮区 + if (ReginConstant.TITLE_LIST.equals(c.getRegion())) { + titleList.add(c); + } else if (ReginConstant.TOP_LIST.equals(c.getRegion())) { + topList.add(c); + } else if (ReginConstant.FUNCTION_LIST.equals(c.getRegion())) { + functionList.add(c); + } else if (ReginConstant.FLOATING_LIST.equals(c.getRegion())) { + floatingList.add(c); + } + } + resultDTO.setTitleList(titleList); + resultDTO.setTopList(topList); + resultDTO.setFloatingList(floatingList); + resultDTO.setFunctionList(functionList); + resultDTO.setUsedComponentIdList(usedComponent); + return resultDTO; + } + + /** + * @param formDTO + * @return void + * @author yinzuomei + * @description 保存小程序首页配置 + * @Date 2020/8/24 22:20 + **/ + @Override + public void saveCustomerHomeTemplate(CustomerHomeTemplateFormDTO formDTO) { + int deletedNum = baseDao.deleteByClientType(formDTO.getClientType(), loginUserUtil.getLoginUserId()); + for (HomeComponentFormDTO homeComponentFormDTO : formDTO.getComponentList()) { + CustomerHomeTemplateDTO customerHomeTemplateDTO = new CustomerHomeTemplateDTO(); + customerHomeTemplateDTO.setComponentId(homeComponentFormDTO.getComponentId()); + customerHomeTemplateDTO.setClientType(Integer.valueOf(formDTO.getClientType())); + customerHomeTemplateDTO.setRegion(homeComponentFormDTO.getRegion()); + customerHomeTemplateDTO.setConfiguration(homeComponentFormDTO.getConfiguration()); + customerHomeTemplateDTO.setDemoData(homeComponentFormDTO.getDemoData()); + customerHomeTemplateDTO.setDisplayOrder(homeComponentFormDTO.getDisplayOrder()); + save(customerHomeTemplateDTO); + } + } + } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java new file mode 100644 index 0000000000..9a7a1dc122 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedServiceImpl.java @@ -0,0 +1,385 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.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.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dao.CustomerFunctionDetailDao; +import com.epmet.dao.FunctionCustomizedDao; +import com.epmet.dto.CustomerFunctionDetailDTO; +import com.epmet.dto.CustomizedDTO; +import com.epmet.dto.FunctionCustomizedDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.FunctionCustomizedDetailResultDTO; +import com.epmet.dto.result.FunctionCustomizedListResultDTO; +import com.epmet.entity.CustomerFunctionDetailEntity; +import com.epmet.entity.FunctionCustomizedEntity; +import com.epmet.entity.FunctionEntity; +import com.epmet.redis.FunctionCustomizedRedis; +import com.epmet.service.CustomerFunctionDetailService; +import com.epmet.service.FunctionCustomizedService; +import com.epmet.service.FunctionService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 定制功能 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-11 + */ +@Service +public class FunctionCustomizedServiceImpl extends BaseServiceImpl implements FunctionCustomizedService { + + @Autowired + private FunctionCustomizedRedis functionCustomizedRedis; + @Autowired + private FunctionService functionService; + @Autowired + private CustomerFunctionDetailDao customerFunctionDetailDao; + @Autowired + private CustomerFunctionDetailService customerFunctionDetailService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FunctionCustomizedDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FunctionCustomizedDTO.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 FunctionCustomizedDTO get(String id) { + FunctionCustomizedEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FunctionCustomizedDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FunctionCustomizedDTO dto) { + FunctionCustomizedEntity entity = ConvertUtils.sourceToTarget(dto, FunctionCustomizedEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FunctionCustomizedDTO dto) { + FunctionCustomizedEntity entity = ConvertUtils.sourceToTarget(dto, FunctionCustomizedEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void saveFunctionCustomized(SaveFunctionCustomizedFormDTO formDTO) { + // 1、定制功能新增,保存数据到 功能表 + FunctionEntity functionEntity = this.saveFunction(formDTO); + // 2、定制功能新增,保存数据到 定制功能表 + FunctionCustomizedEntity entity = new FunctionCustomizedEntity(); + entity.setFunctionId(functionEntity.getId()); + entity.setCustomizedName(formDTO.getFunctionName()); + entity.setIconLargeImg(formDTO.getIconLargeImg()); + entity.setIconSmallImg(formDTO.getIconSmallImg()); + entity.setTargetLink(formDTO.getTargetLink()); + entity.setDomainName(formDTO.getDomainName()); + entity.setFromApp(formDTO.getFromApp()); + insert(entity); + } + + @Override + public Result getFunctionCustomized(CommonFunctionIdFormDTO formDTO) { + //1.查询定制功能详情信息 + FunctionCustomizedDetailResultDTO resultDTO = baseDao.getFunctionCustomizedByFunctionId(formDTO); + + //2.查询是否有客户在使用当前定制功能 + List list = customerFunctionDetailDao.selectCustomerIdByFunctionId(formDTO.getFunctionId()); + if (null == list || list.size() < NumConstant.ONE) { + resultDTO.setIsApply(NumConstant.ZERO); + } else { + resultDTO.setIsApply(NumConstant.ONE); + } + + return new Result().ok(resultDTO); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result deleteFunctionCustomized(CommonFunctionIdFormDTO formDTO) { + // 1.客户定制功能详情表 ,没查到就是没人在使用 + List customizedId = customerFunctionDetailDao.selectCustomerIdByFunctionId(formDTO.getFunctionId()); + if (customizedId != null && customizedId.size() > NumConstant.ZERO){ + return new Result<>().error(8000, "功能正在使用中,不允许删除!"); + } else { + // 2.单条逻辑删除 - 功能表 + String[] ids = new String[1]; + ids[0] = formDTO.getFunctionId(); + functionService.delete(ids); + // 3.单条逻辑删除 - 定制功能表 + baseDao.delByFunctionId(formDTO.getFunctionId()); + } + return new Result(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Result updateCustomized(UpdateCustomizedFormDTO formDTO) { + // 1. 客户定制功能详情表 ,没查到就是没人在使用 + List customizedId = customerFunctionDetailDao.selectCustomerIdByFunctionId(formDTO.getFunctionId()); + if (customizedId != null && customizedId.size() > NumConstant.ZERO){ + // 2.1 根据功能id,查询功能的详细信息 + CustomizedDTO customizedDTO = baseDao.selectCustomized(formDTO.getFunctionId()); + // 该集合,统一修改 客户定制功能详情表 + List upCustomizedInfo = new ArrayList<>(); + // 统一提示 不能进行修改的客户id + StringBuilder tipCustomizedInfoUserId = new StringBuilder(); + // 如果客户全都是使用的自定义模板,则只修改 功能表、定制功能表 + int flag = 0; + + // 如果这个功能,被客户重新定义了,则不会修改 + for (int i = 0; i < customizedId.size(); i++){ + if (null != customizedDTO){ + // 3.1 功能信息和客户信息:判断这个功能,用户使用的是默认的,还是自定义的 + if (customizedDTO.getCustomizedName().equals(customizedId.get(i).getFunctionName()) + && customizedDTO.getIconLargeImg().equals(customizedId.get(i).getIconLargeImg()) + && customizedDTO.getIconSmallImg().equals(customizedId.get(i).getIconSmallImg()) + && customizedDTO.getDomainName().equals(customizedId.get(i).getDomainName()) + && customizedDTO.getTargetLink().equals(customizedId.get(i).getTargetLink()) ){ + // 这个功能,客户使用的是默认的,则判断本次修改的字段,如果是功能名称和大小图标、功能说明,则批量更新客户数据,负责提示 不能修改 + if (!formDTO.getShoppingStatus().equals(customizedDTO.getShoppingStatus()) + || !formDTO.getTargetLink().equals(customizedDTO.getTargetLink()) + || !formDTO.getDomainName().equals(customizedDTO.getDomainName()) + || !formDTO.getFromApp().equals(customizedDTO.getFromApp()) ){ + // 4.1 如果修改的内容是其他字段,则返回语句 + tipCustomizedInfoUserId.append(customizedId.get(i).getId() + ","); + } else if (!formDTO.getFunctionName().equals(customizedDTO.getCustomizedName()) + || !formDTO.getFunctionExplain().equals(customizedDTO.getFunctionExplain()) + || !formDTO.getIconLargeImg().equals(customizedDTO.getIconLargeImg()) + || !formDTO.getIconSmallImg().equals(customizedDTO.getIconSmallImg())){ + // 4.2 如果修改的内容只是:功能名称和大小图标、功能说明,, 需要批量更新客户数据 + CustomerFunctionDetailEntity customer = new CustomerFunctionDetailEntity(); + customer.setFunctionName(formDTO.getFunctionName()); + customer.setIconLargeImg(formDTO.getIconLargeImg()); + customer.setIconSmallImg(formDTO.getIconSmallImg()); + customer.setId(customizedId.get(i).getId()); + upCustomizedInfo.add(customer); + } + } else { + // 3.2 用户使用的是自定义的功能,则不予处理 + // 但如果所有的客户,都是使用的自定义功能,则修改 功能表、定制功能表 + flag = flag + NumConstant.ONE; + } + } + } + if(flag == customizedId.size()){ + // 3.3 没有客户使用该 功能,根据入参参数,修改功能表、定制功能表 + this.functionNotUsed(formDTO); + } + if (upCustomizedInfo != null && upCustomizedInfo.size() > NumConstant.ZERO){ + // 5.1 修改 客户定制功能详情表 + customerFunctionDetailService.updateBatchById(upCustomizedInfo); + // 6. 客户正在使用该功能,根据入参参数,修改功能表、定制功能表 + this.functionInUse(formDTO); + } + // 5.2 提示哪些用户不能被修改 + if (tipCustomizedInfoUserId != null && tipCustomizedInfoUserId.length() >NumConstant.ZERO){ + return new Result<>().error(8000, "客户"+ tipCustomizedInfoUserId +"正在使用该功能不允许修改上下架状态、业务域名和外链地址、所属端app!"); + } + } else { + // 2.2 没有客户使用该 功能,根据入参参数,修改功能表、定制功能表 + this.functionNotUsed(formDTO); + } + return new Result(); + } + + @Override + public Result functionCustomizedList(FunctionCustomizedListFormDTO formDTO) { + int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); + formDTO.setPageNo(pageIndex); + FunctionCustomizedListResultDTO resultDTO = new FunctionCustomizedListResultDTO(); + resultDTO.setList(baseDao.selectListFunctionCustomizedList(formDTO)); + resultDTO.setTotal(baseDao.countTotalFunctionCustomizedList(formDTO)); + return new Result().ok(resultDTO); + } + + @Override + public void customerDomain(CustomerDomainFormDTO formDTO) { + //获取业务域名 + List list = baseDao.selectDomains(formDTO.getCustomerId()); + List workDomains = new ArrayList<>(); + List resiDomains = new ArrayList<>(); + if (null != list) { + for(FunctionCustomizedDTO dto : list) { + if (StringUtils.isNotBlank(dto.getDomainName())) { + String[] domainNames = dto.getDomainName().split(";"); + if (("resi").equals(dto.getFromApp())) { + resiDomains.addAll(Arrays.asList(domainNames)); + } else { + workDomains.addAll(Arrays.asList(domainNames)); + } + } + } + } + + String domainUrl = "https://epmet-cloud.elinkservice.cn/api/third/setting/setwebviewdomain"; + if(resiDomains.size() > NumConstant.ZERO) { + resiDomains = resiDomains.stream().distinct().collect(Collectors.toList()); + WebviewDomainFormDTO domainFormDTO = new WebviewDomainFormDTO(); + domainFormDTO.setCustomerId(formDTO.getCustomerId()); + domainFormDTO.setClientType("resi"); + domainFormDTO.setAction("set"); + domainFormDTO.setWebViewDomain(resiDomains); + String domainData = HttpClientManager.getInstance().sendPostByJSON(domainUrl, JSON.toJSONString(domainFormDTO)).getData(); + JSONObject domainObject = JSON.parseObject(domainData); + Result domainResult = ConvertUtils.mapToEntity(domainObject, Result.class); + domainResult.setCode(domainObject.getInteger("code")); + if (!domainResult.success()) { + throw new RenException(domainResult.getCode(), domainResult.getInternalMsg()); + } + } + + if(workDomains.size() > NumConstant.ZERO) { + workDomains = workDomains.stream().distinct().collect(Collectors.toList()); + WebviewDomainFormDTO domainFormDTO = new WebviewDomainFormDTO(); + domainFormDTO.setCustomerId(formDTO.getCustomerId()); + domainFormDTO.setClientType("work"); + domainFormDTO.setAction("set"); + domainFormDTO.setWebViewDomain(workDomains); + String domainData = HttpClientManager.getInstance().sendPostByJSON(domainUrl, JSON.toJSONString(domainFormDTO)).getData(); + JSONObject domainObject = JSON.parseObject(domainData); + Result domainResult = ConvertUtils.mapToEntity(domainObject, Result.class); + if (!domainResult.success()) { + throw new RenException(domainResult.getCode(), domainResult.getInternalMsg()); + } + } + } + + /** + * 保存数据到 功能表 + * @param formDTO + * @return com.epmet.entity.FunctionEntity + * @Author zhangyong + * @Date 10:03 2020-08-13 + **/ + private FunctionEntity saveFunction(SaveFunctionCustomizedFormDTO formDTO){ + FunctionEntity entity = new FunctionEntity(); + entity.setFunctionName(formDTO.getFunctionName()); + entity.setFunctionIcon(formDTO.getIconLargeImg()); + entity.setFunctionGroup(Integer.valueOf(formDTO.getFunctionGroup())); + entity.setShoppingStatus(Integer.valueOf(formDTO.getShoppingStatus())); + entity.setFunctionExplain(formDTO.getFunctionExplain()); + functionService.insert(entity); + return entity; + } + + /** + * 修改数据到 功能表 + * @param formDTO + * @param flag == 0 只修改图标和名称 + * == 1 修改全部字段 + * @Author zhangyong + * @Date 10:03 2020-08-13 + **/ + private void upFunction(UpdateCustomizedFormDTO formDTO, Integer flag){ + FunctionEntity entity = new FunctionEntity(); + entity.setId(formDTO.getFunctionId()); + entity.setFunctionName(formDTO.getFunctionName()); + entity.setFunctionIcon(formDTO.getIconLargeImg()); + entity.setFunctionExplain(formDTO.getFunctionExplain()); + if (NumConstant.ONE == flag){ + entity.setShoppingStatus(Integer.valueOf(formDTO.getShoppingStatus())); + } + functionService.updateById(entity); + } + + /** + * 客户未使用该功能,根据入参参数,修改功能表、定制功能表 + * @param formDTO + * @return void + * @Author zhangyong + * @Date 11:08 2020-08-14 + **/ + private void functionNotUsed(UpdateCustomizedFormDTO formDTO){ + // 1.修改 功能表, 修改的字段范围,是所有入参字段 + this.upFunction(formDTO, NumConstant.ONE); + // 2.修改 定制功能表, 修改的字段范围,是所有入参字段 + FunctionCustomizedEntity entity = ConvertUtils.sourceToTarget(formDTO, FunctionCustomizedEntity.class); + entity.setCustomizedName(formDTO.getFunctionName()); + baseDao.updateFunctionCustomized(entity); + } + + /** + * 客户正在使用该功能,根据入参参数,修改功能表、定制功能表 + * @param formDTO + * @return void + * @Author zhangyong + * @Date 14:00 2020-08-14 + **/ + private void functionInUse(UpdateCustomizedFormDTO formDTO){ + // 1.修改 功能表, 修改的字段范围,是:功能名称和大小图标 + this.upFunction(formDTO, NumConstant.ZERO); + + // 2.修改 定制功能表, 修改的字段范围,是:功能名称和大小图标 + FunctionCustomizedEntity entity = new FunctionCustomizedEntity(); + entity.setFunctionId(formDTO.getFunctionId()); + entity.setCustomizedName(formDTO.getFunctionName()); + entity.setIconLargeImg(formDTO.getIconLargeImg()); + entity.setIconSmallImg(formDTO.getIconSmallImg()); + baseDao.updateFunctionCustomized(entity); + } +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedVisitedServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedVisitedServiceImpl.java new file mode 100644 index 0000000000..481bb68736 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionCustomizedVisitedServiceImpl.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.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.FunctionCustomizedVisitedDao; +import com.epmet.dto.FunctionCustomizedVisitedDTO; +import com.epmet.dto.form.FunctionVisitedFromDTO; +import com.epmet.entity.FunctionCustomizedVisitedEntity; +import com.epmet.redis.FunctionCustomizedVisitedRedis; +import com.epmet.service.FunctionCustomizedVisitedService; +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-08-13 + */ +@Service +public class FunctionCustomizedVisitedServiceImpl extends BaseServiceImpl implements FunctionCustomizedVisitedService { + + @Autowired + private FunctionCustomizedVisitedRedis functionCustomizedVisitedRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FunctionCustomizedVisitedDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FunctionCustomizedVisitedDTO.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 FunctionCustomizedVisitedDTO get(String id) { + FunctionCustomizedVisitedEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FunctionCustomizedVisitedDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FunctionCustomizedVisitedDTO dto) { + FunctionCustomizedVisitedEntity entity = ConvertUtils.sourceToTarget(dto, FunctionCustomizedVisitedEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FunctionCustomizedVisitedDTO dto) { + FunctionCustomizedVisitedEntity entity = ConvertUtils.sourceToTarget(dto, FunctionCustomizedVisitedEntity.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 + @Transactional(rollbackFor = Exception.class) + public void saveFunctionVisited(FunctionVisitedFromDTO formDTO) { + FunctionCustomizedVisitedEntity entity = ConvertUtils.sourceToTarget(formDTO, FunctionCustomizedVisitedEntity.class); + insert(entity); + } + +} \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionServiceImpl.java index 65631c1b65..27f835593c 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionServiceImpl.java @@ -20,20 +20,27 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dao.FunctionDao; +import com.epmet.dto.CustomerDTO; import com.epmet.dto.FunctionDTO; +import com.epmet.dto.form.QueryFunctionListFormDTO; +import com.epmet.entity.CustomerFunctionEntity; import com.epmet.entity.FunctionEntity; +import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.redis.FunctionRedis; +import com.epmet.service.CustomerFunctionService; import com.epmet.service.FunctionService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -49,6 +56,10 @@ public class FunctionServiceImpl extends BaseServiceImpl page(Map params) { @@ -119,4 +130,47 @@ public class FunctionServiceImpl extends BaseServiceImpl>().ok(baseDao.selectFunctionList()); } + /** + * @param dto + * @return + * @Author sun + * @Description 默认功能新增 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void saveFunction(FunctionDTO dto) { + //1.调用oper-crm服务,查询有效客户列表 + Result> result = operCrmOpenFeignClient.getAllCustomerList(); + if(!result.success()){ + throw new RenException("调用oper_crm服务 获取有效客户列表失败"); + } + List list = result.getData(); + + //2.新增默认功能 + FunctionEntity functionEntity = ConvertUtils.sourceToTarget(dto, FunctionEntity.class); + insert(functionEntity); + + //3.为已有客户绑定新的默认功能关系 + List listEntity = new ArrayList<>(); + list.forEach(l->{ + CustomerFunctionEntity entity = new CustomerFunctionEntity(); + entity.setCustomerId(l.getId()); + entity.setFunctionId(functionEntity.getId()); + listEntity.add(entity); + }); + customerFunctionService.insertBatch(listEntity); + + } + + /** + * @param + * @return java.util.List + * @Author sun + * @Description 查询已上架的所有功能,供下拉框使用 + **/ + @Override + public List getFunctionList(QueryFunctionListFormDTO formDTO) { + return baseDao.selectQueryFunctionList(formDTO); + } + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionShoppingHistoryServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionShoppingHistoryServiceImpl.java new file mode 100644 index 0000000000..acd0aed260 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/FunctionShoppingHistoryServiceImpl.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.FunctionShoppingHistoryDao; +import com.epmet.dto.FunctionShoppingHistoryDTO; +import com.epmet.entity.FunctionShoppingHistoryEntity; +import com.epmet.redis.FunctionShoppingHistoryRedis; +import com.epmet.service.FunctionShoppingHistoryService; +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-08-14 + */ +@Service +public class FunctionShoppingHistoryServiceImpl extends BaseServiceImpl implements FunctionShoppingHistoryService { + + @Autowired + private FunctionShoppingHistoryRedis functionShoppingHistoryRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FunctionShoppingHistoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FunctionShoppingHistoryDTO.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 FunctionShoppingHistoryDTO get(String id) { + FunctionShoppingHistoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FunctionShoppingHistoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FunctionShoppingHistoryDTO dto) { + FunctionShoppingHistoryEntity entity = ConvertUtils.sourceToTarget(dto, FunctionShoppingHistoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FunctionShoppingHistoryDTO dto) { + FunctionShoppingHistoryEntity entity = ConvertUtils.sourceToTarget(dto, FunctionShoppingHistoryEntity.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/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql new file mode 100644 index 0000000000..b792d95677 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.4__add_customer_function_detail.sql @@ -0,0 +1,60 @@ +CREATE TABLE `customer_function_detail` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `FUNCTION_ID` varchar(64) NOT NULL COMMENT '功能Id', + `FUNCTION_NAME` varchar(128) NOT NULL COMMENT '自定义功能名称', + `ICON_LARGE_IMG` varchar(128) NOT NULL COMMENT '自定义大图标', + `ICON_SMALL_IMG` varchar(128) NOT NULL COMMENT '自定义小图标', + `DOMAIN_NAME` varchar(128) NOT NULL COMMENT '自定义业务域名(可设置多个 用分号分隔)', + `TARGET_LINK` varchar(128) NOT NULL COMMENT '外链地址', + `SHOPPING_STATUS` int(11) NOT NULL COMMENT '上架状态(0.下架 1.上架)', + `DISPLAY_ORDER` int(11) NOT 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='客户定制功能详情表'; + + + +ALTER TABLE `function_customized` +ADD COLUMN `DOMAIN_NAME` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '业务域名(可设置多个 用分号分隔)' AFTER `UPDATED_TIME`, +ADD COLUMN `FROM_APP` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源app(政府端:gov、居民端:resi)' AFTER `DOMAIN_NAME`; + + +CREATE TABLE function_customized_visited( + ID VARCHAR(64) NOT NULL COMMENT '主键' , + CUSTOMER_ID VARCHAR(32) NOT NULL COMMENT '客户ID' , + USER_ID VARCHAR(64) NOT NULL COMMENT '用户Id' , + CLIENT_TYPE VARCHAR(32) NOT NULL COMMENT '所属端 居民端:resi工作端:work' , + FUNCTION_ID VARCHAR(64) NOT NULL COMMENT '功能Id' , + URL VARCHAR(128) NOT NULL COMMENT '请求地址 访问的url地址' , + RESULT VARCHAR(1024) NOT NULL COMMENT '结果 成功success失败error' , + MSG VARCHAR(128) NOT NULL COMMENT '原因 失败的原因(例:请求超时、404、500等)' , + DEL_FLAG INT NOT NULL COMMENT '删除标识(0.未删除 1.已删除)' , + REVISION INT 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) +) COMMENT = '定制功能访问记录表 记录居民端、工作端那些人访问过定制功能以及访问的结果'; + + +CREATE TABLE function_shopping_history( + ID VARCHAR(64) NOT NULL COMMENT '主键' , + CUSTOMER_ID VARCHAR(64) NOT NULL COMMENT '客户Id' , + FUNCTION_ID VARCHAR(64) NOT NULL COMMENT '功能Id' , + SHOPPING_STATUS INT NOT NULL COMMENT '上下架状态 上架状态:0:下架、1:上架' , + REASON VARCHAR(1024) NOT NULL COMMENT '理由' , + DEL_FLAG INT NOT NULL COMMENT '删除标识(0.未删除 1.已删除)' , + REVISION INT 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) +) COMMENT = '客户定制功能上下架历史'; \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__up_function_customized_visited.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__up_function_customized_visited.sql new file mode 100644 index 0000000000..e6bf92320c --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.5__up_function_customized_visited.sql @@ -0,0 +1,7 @@ +ALTER TABLE `function_customized_visited` +MODIFY COLUMN `MSG` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '原因 失败的原因(例:请求超时、404、500等)' AFTER `RESULT`; + + +ALTER TABLE `function_customized_visited` +MODIFY COLUMN `URL` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '请求地址 访问的url地址' AFTER `FUNCTION_ID`; + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml new file mode 100644 index 0000000000..6766e64678 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFunctionDetailDao.xml @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + UPDATE customer_function_detail + SET + SHOPPING_STATUS = #{shoppingStatus}, + UPDATED_BY = #{userId}, + UPDATED_TIME = now() + WHERE + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + AND FUNCTION_ID = #{functionId} + + + + UPDATE customer_function_detail + SET + + FUNCTION_NAME = #{functionName}, + + + ICON_LARGE_IMG = #{iconLargeImg}, + + + ICON_SMALL_IMG = #{iconSmallImg}, + + UPDATED_BY = #{userId}, + UPDATED_TIME = now() + WHERE + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + AND FUNCTION_ID = #{functionId} + + + + UPDATE customer_function_detail + + + + + when customer_id = #{item.customerId} and function_id = #{item.functionId} then #{item.displayOrder} + + + + + + when customer_id = #{item.customerId} and function_id = #{item.functionId} then #{item.updatedBy} + + + + updated_time = now() + + WHERE + del_flag = '0' + + (customer_id = #{item.customerId} and function_id = #{item.functionId}) + + + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeTemplateDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeTemplateDao.xml index f6d4b056c1..c47c431bb9 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeTemplateDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerHomeTemplateDao.xml @@ -18,5 +18,91 @@ + + + + + + + + + + + + + UPDATE customer_home_template + SET DEL_FLAG = '1', + UPDATED_BY = #{userId}, + UPDATED_TIME = NOW() + WHERE + CLIENT_TYPE = #{clientType} + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml new file mode 100644 index 0000000000..a9840f4e42 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedDao.xml @@ -0,0 +1,163 @@ + + + + + + + + + update function_customized set DEL_FLAG = 1 where FUNCTION_ID = #{functionId} and DEL_FLAG = '0' + + + + + + + + + + + + + + + + + + UPDATE function_customized + SET + + CUSTOMIZED_NAME = #{customizedName}, + + + ICON_LARGE_IMG = #{iconLargeImg}, + + + ICON_SMALL_IMG = #{iconSmallImg}, + + + TARGET_LINK = #{targetLink}, + + + DOMAIN_NAME = #{domainName}, + + + FROM_APP = #{fromApp}, + + UPDATED_TIME = now() + WHERE + DEL_FLAG = '0' + AND FUNCTION_ID = #{functionId} + + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedVisitedDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedVisitedDao.xml new file mode 100644 index 0000000000..938b189b2b --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionCustomizedVisitedDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionDao.xml index 0a158f9cb4..363893a660 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionDao.xml @@ -38,4 +38,18 @@ AND shopping_status = #{shoppingStatus} + + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionShoppingHistoryDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionShoppingHistoryDao.xml new file mode 100644 index 0000000000..a591988091 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/FunctionShoppingHistoryDao.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/pom.xml b/epmet-module/pom.xml index dd7611267b..2f4b8d2ff8 100644 --- a/epmet-module/pom.xml +++ b/epmet-module/pom.xml @@ -42,6 +42,7 @@ epmet-third epmet-heart epmet-point + epmet-ext diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicDTO.java index 35e6963377..f60ac86651 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/ResiTopicDTO.java @@ -53,6 +53,11 @@ public class ResiTopicDTO implements Serializable { */ private String status; + /** + * 是否解决(已解决 resolved,未解决 unresolved) + */ + private String closedStatus; + /** * 省 */ diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java index 58853940ce..de32937a93 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/form/ResiTopicOperationFormDTO.java @@ -2,6 +2,7 @@ package com.epmet.resi.group.dto.topic.form; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -25,6 +26,12 @@ public class ResiTopicOperationFormDTO implements Serializable { */ private String operateReason; + /** + * 是否解决(已解决 resolved,未解决 unresolved) + */ + //@NotBlank(message = "解决状态不能为空") + private String closedStatus; + } diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index eaef30f6e7..c07b96ad77 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -142,8 +142,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java index 881374f12c..dacfd6dbb8 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/ResiGroupServiceImpl.java @@ -59,6 +59,7 @@ import com.epmet.resi.group.constant.MemberStateConstant; import com.epmet.resi.group.dto.UserRoleDTO; import com.epmet.resi.group.dto.group.*; import com.epmet.resi.group.dto.group.form.*; +import com.epmet.resi.group.dto.group.form.GridIdFormDTO; import com.epmet.resi.group.dto.group.form.ShouldVoteCountFormDTO; import com.epmet.resi.group.dto.group.result.*; import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO; diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicEntity.java index d16ba57c73..1214e5d71a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicEntity.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/ResiTopicEntity.java @@ -53,6 +53,11 @@ public class ResiTopicEntity extends BaseEpmetEntity { */ private String status; + /** + * 是否解决(已解决 resolved,未解决 unresolved) + */ + private String closedStatus; + /** * 省 */ diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index 958b1b4424..1a5d8964a3 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -523,6 +523,8 @@ public class ResiTopicServiceImpl extends BaseServiceImpl id = new ArrayList<>(); id.add(closeFormDTO.getTopicId()); baseDao.cancelHiddenOrCloseBatch(id,tokenDto.getUserId(),TopicConstant.CLOSED); diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.2__topic.sql b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.2__topic.sql new file mode 100644 index 0000000000..c087db0c7d --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/db/migration/V0.0.2__topic.sql @@ -0,0 +1 @@ +ALTER TABLE resi_topic ADD COLUMN CLOSED_STATUS varchar(32) NULL COMMENT '关闭状态:已解决 resolved,未解决 unresolved' AFTER STATUS; \ No newline at end of file diff --git a/epmet-module/resi-guide/resi-guide-server/pom.xml b/epmet-module/resi-guide/resi-guide-server/pom.xml index d5d481ac84..4aefd4cbe1 100644 --- a/epmet-module/resi-guide/resi-guide-server/pom.xml +++ b/epmet-module/resi-guide/resi-guide-server/pom.xml @@ -135,8 +135,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/resi-hall/resi-hall-server/pom.xml b/epmet-module/resi-hall/resi-hall-server/pom.xml index a7bed7047b..a81bf919dc 100644 --- a/epmet-module/resi-hall/resi-hall-server/pom.xml +++ b/epmet-module/resi-hall/resi-hall-server/pom.xml @@ -93,8 +93,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/resi-home/resi-home-server/pom.xml b/epmet-module/resi-home/resi-home-server/pom.xml index a1f2c10a7d..f6eebaaad7 100644 --- a/epmet-module/resi-home/resi-home-server/pom.xml +++ b/epmet-module/resi-home/resi-home-server/pom.xml @@ -113,8 +113,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-module/resi-mine/resi-mine-server/pom.xml b/epmet-module/resi-mine/resi-mine-server/pom.xml index 355be53030..35d2c0edda 100644 --- a/epmet-module/resi-mine/resi-mine-server/pom.xml +++ b/epmet-module/resi-mine/resi-mine-server/pom.xml @@ -137,8 +137,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false 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 21e9579a03..65ad6ccbc8 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.56 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-partymember-server:0.3.57 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 06f9dfc87e..7ee6d3c54e 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.56 + 0.3.57 com.epmet resi-partymember @@ -141,8 +141,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false 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 8a0958ff8b..93aa5af28c 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 @@ -173,15 +173,16 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService Result result = new Result(); //校验手机验证码是否正常 - //TODO 党员认证信息提交暂时注释验证码校验 - /*String code = partyMemberInfoRedis.getUserMobileCode(partyMemberInfoDTO.getUserId(), - partyMemberInfoDTO.getMobile(), - partyMemberInfoDTO.getCode()); - if (null == code) { - saveOrUpdateVisit(partyMemberInfoDTO.getPartymemberVisitId(), null, - PartyMemberConstant.OPERATE_AUTO_FAILED); - return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); - }*/ + if (StringUtils.isNotBlank(partyMemberInfoDTO.getCode())) { + String code = partyMemberInfoRedis.getUserMobileCode(partyMemberInfoDTO.getUserId(), + partyMemberInfoDTO.getMobile(), + partyMemberInfoDTO.getCode()); + if (null == code) { + saveOrUpdateVisit(partyMemberInfoDTO.getPartymemberVisitId(), null, + PartyMemberConstant.OPERATE_AUTO_FAILED); + return new Result().error(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); + } + } //获取党员基本信息(匹配) PartymemberConfirmAutoDTO confirmAutoDTO = diff --git a/epmet-module/resi-voice/resi-voice-server/pom.xml b/epmet-module/resi-voice/resi-voice-server/pom.xml index a78cb45ddd..5c087281de 100644 --- a/epmet-module/resi-voice/resi-voice-server/pom.xml +++ b/epmet-module/resi-voice/resi-voice-server/pom.xml @@ -99,8 +99,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-openapi/epmet-openapi-scan/pom.xml b/epmet-openapi/epmet-openapi-scan/pom.xml index 97029c52f2..46532a144e 100644 --- a/epmet-openapi/epmet-openapi-scan/pom.xml +++ b/epmet-openapi/epmet-openapi-scan/pom.xml @@ -101,8 +101,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false 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 0a62b41a07..0f307c3d47 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 @@ -108,6 +108,6 @@ public class UserWechatDTO implements Serializable{ */ private Date updatedTime; - @JsonIgnore + //@JsonIgnore private String sessionKey; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonStaffIdFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonStaffIdFormDTO.java new file mode 100644 index 0000000000..95d8b74e9d --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonStaffIdFormDTO.java @@ -0,0 +1,24 @@ +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 工作人员Id + * @ClassName CommonStaffIdFormDTO + * @Auth wangc + * @Date 2020-08-17 10:28 + */ +@Data +public class CommonStaffIdFormDTO implements Serializable { + + private static final long serialVersionUID = -5093758817860808310L; + + public interface StaffIdGroup extends CustomerClientShowGroup{} + + @NotBlank(message = "工作人员Id不能为空" , groups = StaffIdGroup.class) + private String staffId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserIdFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserIdFormDTO.java new file mode 100644 index 0000000000..340e91be92 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CommonUserIdFormDTO.java @@ -0,0 +1,22 @@ +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 userId + * @ClassName CommonUserIdFormDTO + * @Auth wangc + * @Date 2020-08-21 17:14 + */ +@Data +public class CommonUserIdFormDTO implements Serializable { + private static final long serialVersionUID = 3934409262981136977L; + public interface CommonUserIdGroup extends CustomerClientShowGroup{} + + @NotBlank(message = "用户Id不可为空", groups = CommonUserIdGroup.class) + private String userId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerListFormDTO.java new file mode 100644 index 0000000000..696e5a890c --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CustomerListFormDTO.java @@ -0,0 +1,26 @@ +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; + +/** + * 查询登陆用户客户列表(工作端) + * @CreateTime 2020/8/25 + */ +@Data +public class CustomerListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + public interface UserIdGroup extends CustomerClientShowGroup{} + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空",groups = UserIdGroup.class) + private String phone; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GovWebOperLoginFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GovWebOperLoginFormDTO.java new file mode 100644 index 0000000000..5acbfd6b05 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GovWebOperLoginFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description PC工作端登陆获取登陆人信息-接口入参 + * @Author sun + */ +@Data +public class GovWebOperLoginFormDTO implements Serializable { + private static final long serialVersionUID = -6653010297552029277L; + + @NotBlank(message = "客户Id不能为空") + private String customerId; + + @NotBlank(message = "手机号不能为空") + private String mobile; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java index aa999da0f6..75453a1d22 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/InfoSubmitFromDTO.java @@ -82,7 +82,7 @@ public class InfoSubmitFromDTO implements Serializable { /** * 手机验证码 */ - @NotBlank(message = "手机验证码不能为空") + // @NotBlank(message = "手机验证码不能为空") @Length(max=6,message = "手机验证码不能超过6位") private String mobileCode; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UpdateRootManageFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UpdateRootManageFormDTO.java new file mode 100644 index 0000000000..9f30b5e4eb --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UpdateRootManageFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/8/19 14:20 + */ +@Data +public class UpdateRootManageFormDTO implements Serializable { + private static final long serialVersionUID = 3954225931981940018L; + /** + * 根组织ID + */ + private String orgId; + /** + * 角色key + */ + private String roleKey; + /** + * 根管理员姓名 + */ + private String rootManageName; + /** + * 根管理员电话 + */ + private String rootManagePhone; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java new file mode 100644 index 0000000000..de8c542864 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/UserIdsFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/13 1:36 下午 + */ +@Data +public class UserIdsFormDTO implements Serializable { + + private static final long serialVersionUID = -6168528618954442905L; + + private List userIds; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java new file mode 100644 index 0000000000..3c6189e8b2 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CustomerListResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 查询登陆用户客户列表(工作端) + * @CreateTime 2020/8/25 + */ +@Data +public class CustomerListResultDTO implements Serializable { + + /** + * 客户Id + */ + private String customerId; + + /** + * 客户名称 + */ + private String customerName; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovWebOperLoginResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovWebOperLoginResultDTO.java new file mode 100644 index 0000000000..dc08614749 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovWebOperLoginResultDTO.java @@ -0,0 +1,16 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description PC工作端登陆获取登陆人信息-接口返参 + * @Author sun + */ +@Data +public class GovWebOperLoginResultDTO implements Serializable { + private static final long serialVersionUID = -5353521601282463394L; + private String userId; + private String passWord; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java new file mode 100644 index 0000000000..c6424eca94 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/RoleResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import jdk.nashorn.internal.ir.annotations.Ignore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:30 上午 + */ +@Data +public class RoleResultDTO implements Serializable { + + private static final long serialVersionUID = -432136606721817459L; + + /** + * 角色key + */ + private String roleKey; + + /** + * 角色名称 + */ + private String roleName; + + /** + * 用户id + */ + @JsonIgnore + private String userId; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java new file mode 100644 index 0000000000..04962a5396 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffBasicInfoResultDTO.java @@ -0,0 +1,63 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 获取pc工作端登陆用户信息 + * @CreateTime 2020/8/25 + */ +@Data +public class StaffBasicInfoResultDTO implements Serializable { + + /** + * 客户Id + */ + private String customerId; + + /** + * 用户Id + */ + private String id; + + /** + * 真实姓名 + */ + private String realName; + + /** + * 性别0.未知,1男,2.女 + */ + private String gender; + + /** + * 头像 + */ + private String headUrl; + + /** + * 邮箱 + */ + private String email; + + /** + * 手机号 + */ + private String phone; + + /** + * 微信openId + */ + private String wxOpenId; + + /** + * 超级管理员 0:否 1:是 + */ + private Integer superAdmin; + + /** + * 状态 0:停用 1:正常 + */ + private Integer status; +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinAgencyResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinAgencyResultDTO.java new file mode 100644 index 0000000000..93b650d538 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinAgencyResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/17 9:25 上午 + */ +@Data +public class StaffSinAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = -3440415906710443002L; + + /** + * 工作人员Id + */ + private String staffId; + + /** + * 工作人员名称 + */ + private String staffName; + + /** + * 头像 + */ + private String headPhoto; + + /** + * 性别,1男2女0未知 + */ + private Integer gender; + + /** + * 角色列表 + */ + private List roleList; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinGridResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinGridResultDTO.java new file mode 100644 index 0000000000..3827b2ea17 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/StaffSinGridResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/8/13 9:25 上午 + */ +@Data +public class StaffSinGridResultDTO implements Serializable { + + private static final long serialVersionUID = -3440415466710443002L; + + /** + * 工作人员Id + */ + private String staffId; + + /** + * 工作人员名称 + */ + private String staffName; + + /** + * 头像 + */ + private String headPhoto; + + /** + * 性别,1男2女0未知 + */ + private Integer gender; + + /** + * 角色列表 + */ + private List roleList; + +} 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 8ea872a683..4e3da40627 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 @@ -1,13 +1,10 @@ package com.epmet.feign; -import com.epmet.commons.tools.annotation.LoginUser; + import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerStaffDTO; -import com.epmet.dto.GovStaffRoleDTO; -import com.epmet.dto.UserBaseInfoDTO; -import com.epmet.dto.UserDTO; +import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.fallback.EpmetUserOpenFeignClientFallback; @@ -259,4 +256,54 @@ public interface EpmetUserOpenFeignClient { **/ @PostMapping(value = "epmetuser/gridlatest/latestgridinfo") Result latestGridInfo(@RequestBody LatestGridInfoFormDTO formDTO); + + /** + * @Description 查询工作人员的信息 + * @param formDTO + * @author zxc + * @date 2020/8/13 1:37 下午 + */ + @PostMapping("epmetuser/customerstaff/getstaffinfolist") + Result> getStaffInfoList(@RequestBody UserIdsFormDTO formDTO); + + + /** + * 修改根管理员信息 + * @author zhaoqifeng + * @date 2020/8/19 14:31 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("epmetuser/customerstaff/updaterootmanage") + Result updateRootManage(@RequestBody UpdateRootManageFormDTO formDTO); + + /** + * @Description 查找工作人员的信息 - 对外开放接口 + * @param staffParam + * @return + * @author wangc + * @date 2020.08.17 10:30 + **/ + @PostMapping("epmetuser/customerstaff/extstaffinfo") + Result extStaffInfo(@RequestBody CommonStaffIdFormDTO staffParam); + + /** + * @Description 查询当前用户信息 - 对外接口 + * @param param + * @return + * @author wangc + * @date 2020.08.21 17:16 + **/ + @PostMapping("/epmetuser/userbaseinfo/extuserinfo") + Result extUserInfo( @RequestBody CommonUserIdFormDTO param); + + /** + * 更改角色所属组织 + * @author zhaoqifeng + * @date 2020/8/31 10:36 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("epmetuser/staffrole/changeroleorg") + Result changeRoleOrg(@RequestBody StaffRoleDTO 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 6e137becc1..a60c9611ae 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 @@ -4,10 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerStaffDTO; -import com.epmet.dto.GovStaffRoleDTO; -import com.epmet.dto.UserBaseInfoDTO; -import com.epmet.dto.UserDTO; +import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.EpmetUserOpenFeignClient; @@ -183,4 +180,29 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien public Result latestGridInfo(LatestGridInfoFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "latestGridInfo", formDTO); } + + @Override + public Result> getStaffInfoList(UserIdsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getStaffInfoList", formDTO); + } + + @Override + public Result updateRootManage(UpdateRootManageFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "updateRootManage", formDTO); + } + + @Override + public Result extStaffInfo(CommonStaffIdFormDTO staffParam) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "extStaffInfo", staffParam); + } + + @Override + public Result extUserInfo(CommonUserIdFormDTO param) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "extUserInfo", param); + } + + @Override + public Result changeRoleOrg(StaffRoleDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "changeRoleOrg", formDTO); + } } diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index 15c0789d48..7f1bcc84c1 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.118 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.121 ports: - "8087:8087" network_mode: host # 不会创建新的网络 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 a9847b773c..0f080c990f 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.118 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-user-server:0.3.122 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 0d7cdfa705..b7c301d01b 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.118 + 0.3.122 com.epmet epmet-user @@ -150,8 +150,8 @@ 123456 true - 122.152.200.70:8848 - fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + 192.168.1.130:8848 + 6ceab336-d004-4acf-89c6-e121d06f4988 false diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java index fd0c0f5a9e..0075470f27 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.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; @@ -321,4 +323,82 @@ public class CustomerStaffController { public Result> getCustsomerStaffByIdAndPhone(@RequestBody ThirdCustomerStaffFormDTO formDTO) { return new Result>().ok(customerStaffService.getCustsomerStaffByIdAndPhone(formDTO)); } + + /** + * @Description 查询工作人员的信息 + * @param formDTO + * @author zxc + * @date 2020/8/13 1:45 下午 + */ + @PostMapping("getstaffinfolist") + public Result> getStaffInfoList(@RequestBody UserIdsFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(customerStaffService.getStaffInfoList(formDTO)); + } + + /** + * @Description 查找工作人员的信息 - 对外开放接口 + * @param staffParam + * @return + * @author wangc + * @date 2020.08.17 10:30 + **/ + @PostMapping("extstaffinfo") + public Result extStaffInfo(@RequestBody CommonStaffIdFormDTO staffParam){ + ValidatorUtils.validateEntity(staffParam, CommonStaffIdFormDTO.StaffIdGroup.class); + return new Result().ok(customerStaffService.extStaffInfo(staffParam)); + } + + /** + * 修改根管理员信息 + * @author zhaoqifeng + * @date 2020/8/19 14:31 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("updaterootmanage") + public Result updateRootManage(@RequestBody UpdateRootManageFormDTO formDTO) { + customerStaffService.updateRootManage(formDTO); + return new Result(); + } + + /** + * 查询登陆用户客户列表(工作端) + * 根据手机号查询customer_staff表数据,在根据查询到的数据的userId判断是不是根管理员,最后将同一手机号对应的客户列表且该手机都是根管理员的客户列表返给前端 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 10:03 2020-08-25 + **/ + @PostMapping(value = "customerlist") + public Result> customerList(@RequestBody CustomerListFormDTO formDTO){ + return customerStaffService.selectCustomerList(formDTO); + } + + /** + * 获取pc工作端登陆用户信息 + * 根据token中userId,去查询登陆用户基本信息 + * @param tokenDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 11:09 2020-08-25 + **/ + @PostMapping(value = "staffbasicinfo") + public Result staffBasicInfo(@LoginUser TokenDto tokenDTO){ + return customerStaffService.selectStaffBasicInfo(tokenDTO.getUserId()); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description PC工作端登陆-根据客户Id和手机号查询登陆用户信息 + **/ + @PostMapping("getstaffidandpwd") + public Result getStaffIdAndPwd(@RequestBody GovWebOperLoginFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(customerStaffService.getStaffIdAndPwd(formDTO)); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java index 488a103ef0..71ad8f1962 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffAgencyVisitedController.java @@ -62,4 +62,5 @@ public class StaffAgencyVisitedController { return staffAgencyVisitedService.saveStaffLoginRecord(formDTO); } + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java index 2eada17f01..60b4d5400e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffRoleController.java @@ -5,6 +5,7 @@ import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.GovStaffRoleDTO; +import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.CustomerRoleFormDTO; import com.epmet.dto.form.RolesUsersListFormDTO; @@ -167,4 +168,17 @@ public class StaffRoleController { public Result> getStaffRoles(@PathVariable String staffId) { return new Result>().ok(staffRoleService.getStaffRoles(staffId)); } + + /** + * 更改角色所属组织 + * @author zhaoqifeng + * @date 2020/8/31 10:29 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("changeroleorg") + public Result changeRoleOrg(@RequestBody StaffRoleDTO formDTO) { + staffRoleService.changeRoleOrg(formDTO); + return new Result(); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java index 154ec7d643..d8d9d969f3 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/UserBaseInfoController.java @@ -28,9 +28,11 @@ 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.UserBaseInfoDTO; +import com.epmet.dto.form.CommonUserIdFormDTO; import com.epmet.dto.form.IssueInitiatorFormDTO; import com.epmet.dto.form.ResiVolunteerAuthenticateFormDTO; import com.epmet.dto.result.CustomerUserDetailResultDTO; +import com.epmet.dto.result.ExtUserInfoResultDTO; import com.epmet.dto.result.ResiUserBaseInfoResultDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.entity.UserBaseInfoEntity; @@ -188,5 +190,18 @@ public class UserBaseInfoController { userBaseInfoService.clearUserCache(userIds); return new Result(); } + + /** + * @Description 查询当前用户信息 - 对外接口 + * @param param + * @return + * @author wangc + * @date 2020.08.21 17:16 + **/ + @PostMapping("extuserinfo") + Result extUserInfo( @RequestBody CommonUserIdFormDTO param){ + ValidatorUtils.validateEntity(param, CommonUserIdFormDTO.CommonUserIdGroup.class); + return new Result().ok(userBaseInfoService.extUserInfo(param)); + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java index be19478a91..2fdc573473 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java @@ -21,10 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.*; import com.epmet.dto.form.*; -import com.epmet.dto.result.DepartInStaffListResultDTO; -import com.epmet.dto.result.StaffInfoResultDTO; -import com.epmet.dto.result.CommonStaffInfoResultDTO; -import com.epmet.dto.result.StaffListResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.CustomerStaffEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -148,4 +145,50 @@ public interface CustomerStaffDao extends BaseDao { * @Description 根据客户ID、手机号查询政府端工作人员基本信息 **/ List selectStaff(ThirdCustomerStaffFormDTO formDTO); -} \ No newline at end of file + + /** + * @Description 查询工作人员的信息 + * @param userIds + * @author zxc + * @date 2020/8/13 1:45 下午 + */ + List getStaffInfoList(@Param("userIds")List userIds); + + /** + * @Description 查询工作人员信息 (对外接口) + * @param staffId + * @return + * @author wangc + * @date 2020.08.17 13:26 + **/ + ExtStaffInfoResultDTO selectStaffInfoExt(@Param("staffId") String staffId); + + /** + * 获取根管理员信息 + * @author zhaoqifeng + * @date 2020/8/19 14:14 + * @param orgId + * @param roleKey + * @return com.epmet.dto.CustomerStaffDTO + */ + CustomerStaffDTO selectRootManage(@Param("orgId") String orgId, @Param("roleKey") String roleKey); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 根据客户Id和手机号查询工作人员信息 + **/ + GovWebOperLoginResultDTO selectByCustomerIdAndPhone(GovWebOperLoginFormDTO formDTO); + + /** + * 获取pc工作端登陆用户信息 + * 根据token中userId,去查询登陆用户基本信息 + * + * @param userId + * @return com.epmet.dto.result.StaffBasicInfoResultDTO + * @Author zhangyong + * @Date 10:07 2020-08-26 + **/ + StaffBasicInfoResultDTO selectStaffBasicInfo(@Param("userId") String userId); +} 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 275a2e9742..0d019d63f6 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 @@ -20,6 +20,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; +import com.epmet.dto.result.RoleInfoResultDTO; +import com.epmet.dto.result.RoleResultDTO; import com.epmet.entity.GovStaffRoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -61,4 +63,12 @@ public interface GovStaffRoleDao extends BaseDao { List listRolesByCustomer(@Param("customerId") String customerId); GovStaffRoleResultDTO getDTOById(@Param("roleId") String roleId); + + /** + * @Description 查询用户的权限 + * @param userIds + * @author zxc + * @date 2020/8/13 2:14 下午 + */ + List getRoleInfoList(@Param("userIds")List userIds); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java index 4e55a5e731..4358e4910e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffAgencyVisitedDao.java @@ -40,5 +40,4 @@ public interface StaffAgencyVisitedDao extends BaseDao StaffLatestAgencyResultDTO selectLatestStaffWechatLoginRecord(String openId); - StaffLatestAgencyResultDTO selectLatestCustomer(String userId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java index 6869f1a5bf..554da4a12d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffGridVisitedDao.java @@ -23,6 +23,8 @@ import com.epmet.dto.form.LatestGridFormDTO; import com.epmet.entity.StaffGridVisitedEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.Date; + /** * 工作人员进入网格日志表 * @@ -41,4 +43,23 @@ public interface StaffGridVisitedDao extends BaseDao { **/ String selectStaffLatestGrid(LatestGridFormDTO latestGridFormDTO); + /** + * @Description 根据staffId和customerId查询当前用户上一次登陆的网格Id,Id,创建时间 + * @param latestGridFormDTO + * @return StaffGridVisitedEntity + * @author wangc + * @date 2020.08.27 15:05 + **/ + StaffGridVisitedEntity selectVisitedRecordByStaffId(LatestGridFormDTO latestGridFormDTO); + + /** + * @Description 更新工作人员网格登陆记录的时间 + * @param id + * @param date + * @return + * @author wangc + * @date 2020.08.27 16:28 + **/ + void updateRecordTime(String id, Date date); + } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java index 6de16bc4f8..dfc5407272 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/StaffRoleDao.java @@ -23,11 +23,13 @@ import com.epmet.commons.mybatis.entity.DataScope; import com.epmet.dto.StaffRoleDTO; import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.CustomerStaffRoleListFormDTO; -import com.epmet.dto.result.*; +import com.epmet.dto.result.CustomerStaffRoleListResultDTO; +import com.epmet.dto.result.CustomerStaffRoleResultDTO; +import com.epmet.dto.result.GovStaffRoleResultDTO; +import com.epmet.dto.result.StaffRolesResultDTO; import com.epmet.entity.StaffRoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; -import org.springframework.context.annotation.Scope; import java.util.List; @@ -100,4 +102,24 @@ public interface StaffRoleDao extends BaseDao { List selectStaffRoles(@Param("staffId") String staffId); List listStaffRoleEntytiesByStaffIdAndOrgId(@Param("agencyId") String agencyId, @Param("staffId") String staffId); -} \ No newline at end of file + + /** + * 根据用户id、角色id,查询 工作人员-角色关系表 + * + * @param staffId + * @param roleId + * @return com.epmet.dto.StaffRoleDTO + * @Author zhangyong + * @Date 10:45 2020-08-25 + **/ + StaffRoleDTO selectStaffRoleByStaffIdAndRoleId(@Param("staffId") String staffId, @Param("roleId") String roleId); + + /** + * 更改角色所属组织 + * @author zhaoqifeng + * @date 2020/8/31 10:33 + * @param dto + * @return void + */ + void updateStaffRoleOrgId(StaffRoleDTO dto); +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java index edbef03d60..996848c4ea 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java @@ -258,4 +258,61 @@ public interface CustomerStaffService extends BaseService { * @Description 根据客户ID、手机号查询政府端工作人员基本信息,校验用户是否存在 **/ List getCustsomerStaffByIdAndPhone(ThirdCustomerStaffFormDTO formDTO); -} \ No newline at end of file + + /** + * @Description 查询工作人员的信息 + * @param formDTO + * @author zxc + * @date 2020/8/13 1:45 下午 + */ + List getStaffInfoList( UserIdsFormDTO formDTO); + + /** + * @Description 查找工作人员的信息 - 对外开放接口 + * @param staffParam + * @return + * @author wangc + * @date 2020.08.17 10:30 + **/ + ExtStaffInfoResultDTO extStaffInfo(CommonStaffIdFormDTO staffParam); + + /** + * 修改根管理员信息 + * @author zhaoqifeng + * @date 2020/8/19 14:11 + * @param formDTO + * @return com.epmet.dto.CustomerStaffDTO + */ + void updateRootManage(UpdateRootManageFormDTO formDTO); + + /** + * 查询登陆用户客户列表(工作端) + * 根据手机号查询customer_staff表数据,在根据查询到的数据的userId判断是不是根管理员,最后将同一手机号对应的客户列表且该手机都是根管理员的客户列表返给前端 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 10:03 2020-08-25 + **/ + Result> selectCustomerList(CustomerListFormDTO formDTO); + + /** + * 获取pc工作端登陆用户信息 + * 根据token中userId,去查询登陆用户基本信息 + * + * @param userId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 11:10 2020-08-25 + **/ + Result selectStaffBasicInfo(String userId); + + /** + * @param formDTO + * @return + * @Author sun + * @Description PC工作端登陆-根据客户Id和手机号查询登陆用户信息 + **/ + GovWebOperLoginResultDTO getStaffIdAndPwd(GovWebOperLoginFormDTO formDTO); + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java index 71622dfa4a..9d584aa2e6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffAgencyVisitedService.java @@ -114,4 +114,5 @@ public interface StaffAgencyVisitedService extends BaseService { List getStaffRoles(String staffId); List getStaffRoleEntytiesByStaffIdAndOrgId(String agencyId, String staffId); + + /** + * 更改角色组织 + * @author zhaoqifeng + * @date 2020/8/31 10:31 + * @param formDTO + * @return void + */ + void changeRoleOrg(StaffRoleDTO formDTO); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java index 33e27f88a6..bf5cf90e67 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/UserBaseInfoService.java @@ -21,8 +21,10 @@ 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.UserBaseInfoDTO; +import com.epmet.dto.form.CommonUserIdFormDTO; import com.epmet.dto.form.ResiVolunteerAuthenticateFormDTO; import com.epmet.dto.result.CustomerUserDetailResultDTO; +import com.epmet.dto.result.ExtUserInfoResultDTO; import com.epmet.dto.result.ResiUserBaseInfoResultDTO; import com.epmet.dto.result.UserBaseInfoResultDTO; import com.epmet.entity.UserBaseInfoEntity; @@ -161,4 +163,13 @@ public interface UserBaseInfoService extends BaseService { * @date 2020.08.06 14:38 **/ void clearUserCache(List ids); + + /** + * @Description 查询当前用户信息 - 对外接口 + * @param param + * @return + * @author wangc + * @date 2020.08.21 17:16 + **/ + ExtUserInfoResultDTO extUserInfo(CommonUserIdFormDTO param); } 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 0f00a32191..72f9c416b2 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 @@ -17,12 +17,14 @@ 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.entity.DataScope; 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.ServiceConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.exception.RenException; @@ -36,6 +38,7 @@ import com.epmet.constant.RoleKeyConstants; import com.epmet.constant.UserConstant; import com.epmet.constant.UserRoleConstant; import com.epmet.dao.CustomerStaffDao; +import com.epmet.dao.GovStaffRoleDao; import com.epmet.dao.StaffRoleDao; import com.epmet.dto.*; import com.epmet.dto.form.*; @@ -46,6 +49,7 @@ import com.epmet.entity.StaffRoleEntity; import com.epmet.entity.UserEntity; import com.epmet.feign.AuthFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.redis.CustomerStaffRedis; import com.epmet.service.CustomerStaffService; import com.epmet.service.GovStaffRoleService; @@ -56,6 +60,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -93,6 +98,12 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl page(Map params) { @@ -540,4 +551,118 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl getStaffInfoList(UserIdsFormDTO formDTO) { + List userIds = formDTO.getUserIds(); + // 1. 根据userId查询人员基本信息 + List staffInfoList = customerStaffDao.getStaffInfoList(userIds); + if (staffInfoList.size() == NumConstant.ZERO){ + return staffInfoList; + } + // 2. 根据userId查询权限 + List roleInfoList = govStaffRoleDao.getRoleInfoList(userIds); + staffInfoList.forEach(staffInfo -> { + List roleResult = new ArrayList<>(); + roleInfoList.forEach(role -> { + if (staffInfo.getStaffId().equals(role.getUserId())){ + RoleResultDTO result = new RoleResultDTO(); + BeanUtils.copyProperties(role,result); + roleResult.add(result); + } + }); + staffInfo.setRoleList(roleResult); + }); + return staffInfoList; + } + + + /** + * @Description 查找工作人员的信息 - 对外开放接口 + * @param staffParam + * @return + * @author wangc + * @date 2020.08.17 10:30 + **/ + @Override + public ExtStaffInfoResultDTO extStaffInfo(CommonStaffIdFormDTO staffParam) { + //查找工作人员信息 + //最近一次登陆的而网格、人员信息、权限 + ExtStaffInfoResultDTO result = baseDao.selectStaffInfoExt(staffParam.getStaffId()); + result.setUserId(staffParam.getStaffId()); + if(null != result) { + Result govOrgResult = + govOrgOpenFeignClient.staffInfoExt(result); + if(govOrgResult.success() && null != govOrgResult.getData()){ + return govOrgResult.getData(); + } + } + return null; + } + + @Override + public void updateRootManage(UpdateRootManageFormDTO formDTO) { + CustomerStaffDTO dto = baseDao.selectRootManage(formDTO.getOrgId(), formDTO.getRoleKey()); + if (null == dto) { + throw new RenException("查询客户管理员失败"); + } + dto.setRealName(formDTO.getRootManageName()); + dto.setMobile(formDTO.getRootManagePhone()); + update(dto); + } + + @Override + public Result> selectCustomerList(CustomerListFormDTO formDTO) { + List listResultDTO = new ArrayList<>(); + CustomerDTO customerDTO = new CustomerDTO(); + // 1.根据手机号,去 customer_staff表,进行查询; 查询结果 多条:字段 customer_id,user_id + List customerStaffList = baseDao.selectListCustomerStaffDTO(formDTO.getPhone()); + + for (CustomerStaffDTO staffDTO : customerStaffList){ + // 2.根据 customer_id 去 gov_staff_role表,查询 customer_id + role_key = root_manager ,确定 根管理员的id,即roleId + GovStaffRoleDTO roleKey = govStaffRoleDao.getRoleByCustomerIdAndRoleKey(staffDTO.getCustomerId(), RoleKeyConstants.ROLE_KEY_ROOT_MANAGER); + // 3.根据roleId + staff_id(即 userId) 查 staff_role表的主键id, 如果查到了,那这个userId就是 根管理员 + StaffRoleDTO staffRoleDTO = staffRoleDao.selectStaffRoleByStaffIdAndRoleId(staffDTO.getUserId(), roleKey.getId()); + if (null != staffRoleDTO){ + // 4.如果userID是根管理员的话,则根据customerId 去 customer表 查询 id、customer_name + customerDTO.setId(staffDTO.getCustomerId()); + Result customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); + if (!customerInfo.success()) { + logger.error(String.format("获取根管理员信息失败,调用%s服务查询客户名称失败,入参%s", ServiceConstant.OPER_CRM_SERVER, JSON.toJSONString(staffDTO.getCustomerId()))); + } else { + if (null != customerInfo.getData()){ + CustomerListResultDTO resultDTO = new CustomerListResultDTO(); + resultDTO.setCustomerId(customerInfo.getData().getId()); + resultDTO.setCustomerName(customerInfo.getData().getCustomerName()); + listResultDTO.add(resultDTO); + } + } + } + } + return new Result>().ok(listResultDTO); + } + + @Override + public Result selectStaffBasicInfo(String userId) { + StaffBasicInfoResultDTO resultDTO = baseDao.selectStaffBasicInfo(userId); + return new Result().ok(resultDTO); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description PC工作端登陆-根据客户Id和手机号查询登陆用户信息 + **/ + @Override + public GovWebOperLoginResultDTO getStaffIdAndPwd(GovWebOperLoginFormDTO formDTO) { + //1.根据客户Id和手机号查询用户信息 + return baseDao.selectByCustomerIdAndPhone(formDTO); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java index 11fb4702ca..8118bbe6f6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffAgencyVisitedServiceImpl.java @@ -127,4 +127,6 @@ public class StaffAgencyVisitedServiceImpl extends BaseServiceImpl getStaffLatestGrid(LatestGridFormDTO latestGridFormDTO) { + Calendar currentCal = Calendar.getInstance(); + currentCal.setTime(new Date()); CustomerGridByUserIdResultDTO gridResult = new CustomerGridByUserIdResultDTO(); - String gridId = baseDao.selectStaffLatestGrid(latestGridFormDTO); + StaffGridVisitedEntity recordEntity = baseDao.selectVisitedRecordByStaffId(latestGridFormDTO); + String gridId = null == recordEntity ? null : recordEntity.getGridId(); if(StringUtils.isNotBlank(gridId)){ + Calendar recordCal = Calendar.getInstance(); + recordCal.setTime(recordEntity.getCreatedTime()); + if(currentCal.get(Calendar.YEAR) == recordCal.get(Calendar.YEAR) && + currentCal.get(Calendar.DAY_OF_YEAR) == recordCal.get(Calendar.DAY_OF_YEAR) + && StringUtils.isNotBlank(recordEntity.getId())){ + //同一天 更新 + baseDao.updateRecordTime(recordEntity.getId(),currentCal.getTime()); + }else{ + //非同一天 新增 + recordEntity.setCustomerId(latestGridFormDTO.getCustomerId()); + recordEntity.setStaffId(latestGridFormDTO.getStaffId()); + recordEntity.setId(null); + recordEntity.setCreatedTime(null); + baseDao.insert(recordEntity); + } CustomerGridFormDTO param = new CustomerGridFormDTO(); param.setGridId(gridId); Result gridInfoResult = diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java index 231ab010ea..bb85550f3c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffRoleServiceImpl.java @@ -182,4 +182,10 @@ public class StaffRoleServiceImpl extends BaseServiceImpl implements UserBaseInfoService { + private Logger logger = LogManager.getLogger(getClass()); + @Autowired private UserBaseInfoRedis userBaseInfoRedis; @Autowired @@ -65,6 +68,12 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -296,4 +305,52 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl roleList = userRoleDao.getUserRoleInfo(roleParam); + List roleListFormat = new LinkedList<>(); + if(null != roleList && !roleList.isEmpty()){ + roleList.forEach(role -> { + ExtRoleMapResultDTO object = ConvertUtils.sourceToTarget(role,ExtRoleMapResultDTO.class); + roleListFormat.add(object); + }); + result.setRoleList(roleListFormat); + } + + Result govOrgResult = + govOrgOpenFeignClient.userInfoExt(result); + if(govOrgResult.success() && null != govOrgResult.getData()){ + return govOrgResult.getData();} + + return result; + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index fd7b3a0072..e8148b7418 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -162,13 +162,15 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl - \ No newline at end of file + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 22f47ce8bc..a9da37f9d9 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 @@ -68,4 +68,22 @@ gsr.ORG_TYPE AS orgType FROM gov_staff_role gsr WHERE ID = #{roleId} + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml index 82bc2cace3..faaa5757e9 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffAgencyVisitedDao.xml @@ -35,19 +35,5 @@ sav.CREATED_TIME DESC LIMIT 1 - + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml index 73978e23f3..8805ed9dab 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffGridVisitedDao.xml @@ -33,4 +33,35 @@ LIMIT 1 + + + + + + UPDATE + STAFF_GRID_VISITED + SET + CREATED_TIME = #{date}, + UPDATED_TIME = #{date} + WHERE + DEL_FLAG = '0' + AND + ID = #{id} + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml index b02425c697..aabdfd6d71 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/StaffRoleDao.xml @@ -23,6 +23,11 @@ and sr.ORG_ID = #{orgId} and sr.DEL_FLAG = '0' + + UPDATE staff_role SET ORG_ID = #{orgId} + WHERE STAFF_ID = #{staffId} + AND DEL_FLAG = '0' + @@ -164,4 +169,16 @@ and sr.ORG_ID = #{agencyId} and sr.DEL_FLAG='0' - \ No newline at end of file + + + diff --git a/pom.xml b/pom.xml index ee379a6b7a..dcbdbc44dc 100644 --- a/pom.xml +++ b/pom.xml @@ -3,6 +3,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 + org.springframework.boot spring-boot-starter-parent