diff --git a/epmet-auth/deploy/docker-compose-dev.yml b/epmet-auth/deploy/docker-compose-dev.yml index 8498362d05..b2609df0b1 100644 --- a/epmet-auth/deploy/docker-compose-dev.yml +++ b/epmet-auth/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-auth-server: container_name: epmet-auth-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.36 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.43 ports: - "8081:8081" network_mode: host # 使用现有网络 diff --git a/epmet-auth/pom.xml b/epmet-auth/pom.xml index e0f97c1757..ab11a183fc 100644 --- a/epmet-auth/pom.xml +++ b/epmet-auth/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.36 + 0.3.43 com.epmet epmet-cloud @@ -80,6 +80,12 @@ 1.0.0 compile + + com.epmet + epmet-commons-tools-wx-mp + 1.0.0 + compile + com.epmet epmet-user-client @@ -104,6 +110,18 @@ 2.0.0 compile + + com.github.binarywang + weixin-java-mp + 3.6.0 + compile + + + com.epmet + epmet-third-client + 2.0.0 + compile + @@ -154,10 +172,10 @@ - wx67fdf7da3fee1890 - ae15094f485af9e5c6b5a8a55945332a - 111 - 111 + wxcb6ce2ed0c5ae54c + c7f74941ee97fa9b2e1065772d34c397 + 12345678Yzm + jiKrJoPQsUIP9ayAwmuJQeAVPBjFOh5D1JxFDd7ZSU3 wx07674c23af51b521 a2fd0d29b007cbbcf8c8dda8c693d99b @@ -191,10 +209,10 @@ - wx67fdf7da3fee1890 - ae15094f485af9e5c6b5a8a55945332a - 111 - 111 + wxcb6ce2ed0c5ae54c + c7f74941ee97fa9b2e1065772d34c397 + 12345678Yzm + jiKrJoPQsUIP9ayAwmuJQeAVPBjFOh5D1JxFDd7ZSU3 wx07674c23af51b521 a2fd0d29b007cbbcf8c8dda8c693d99b @@ -228,10 +246,10 @@ - wx67fdf7da3fee1890 - ae15094f485af9e5c6b5a8a55945332a - 111 - 111 + wxcb6ce2ed0c5ae54c + c7f74941ee97fa9b2e1065772d34c397 + 12345678Yzm + jiKrJoPQsUIP9ayAwmuJQeAVPBjFOh5D1JxFDd7ZSU3 wx07674c23af51b521 a2fd0d29b007cbbcf8c8dda8c693d99b diff --git a/epmet-auth/src/main/java/com/epmet/constant/PublicUserLoginConstant.java b/epmet-auth/src/main/java/com/epmet/constant/PublicUserLoginConstant.java new file mode 100644 index 0000000000..e29d75ad0c --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/constant/PublicUserLoginConstant.java @@ -0,0 +1,22 @@ +package com.epmet.constant; + +/** + * @author sun + * @dscription + */ +public interface PublicUserLoginConstant { + + /** + * 初始化用户信息失败 + */ + String SAVE_USER_EXCEPTION = "初始化用户信息失败"; + /** + * 是否登陆(true false) + */ + String PARAMETER_EXCEPTION = "是否登陆值错误"; + /** + * 用户登陆 新增访问记录 + */ + String SAVE_VISITED_EXCEPTION = "用户登陆,新增访问记录失败"; + +} diff --git a/epmet-auth/src/main/java/com/epmet/controller/PublicUserLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/PublicUserLoginController.java new file mode 100644 index 0000000000..d083b2a26b --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/controller/PublicUserLoginController.java @@ -0,0 +1,74 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.constant.PublicUserLoginConstant; +import com.epmet.dto.form.LoginByPhoneFormDTO; +import com.epmet.dto.form.PaWxCodeFormDTO; +import com.epmet.dto.form.PublicSendSmsCodeFormDTO; +import com.epmet.dto.result.UserTokenResultDTO; +import com.epmet.service.PublicUserLoginService; +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/7/8 18:29 + */ +@RestController +@RequestMapping("publicuser") +public class PublicUserLoginController { + + @Autowired + private PublicUserLoginService publicUserLoginService; + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author sun + * @description 解析wxcode获取用户信息并生成token + **/ + @PostMapping(value = "/wxcodetotoken") + public Result wxCodeToToken(@RequestBody PaWxCodeFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PaWxCodeFormDTO.AddUserInternalGroup.class); + return new Result().ok(publicUserLoginService.wxCodeToToken(formDTO)); + } + + /** + * @param formDTO 手机号 + * @return com.epmet.commons.tools.utils.Result + * @Author sun + * @Description 公众号登录-发送验证码 + **/ + @PostMapping(value = "/sendsmscode") + public Result sendSmsCode(@RequestBody PublicSendSmsCodeFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO,PublicSendSmsCodeFormDTO.AddUserShowGroup.class); + if(formDTO.getIsLogon()!=true&&formDTO.getIsLogon()!=false){ + throw new RenException(PublicUserLoginConstant.PARAMETER_EXCEPTION); + } + publicUserLoginService.sendSmsCode(formDTO); + return new Result(); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author sun + * @Description 公众号-手机验证码登陆 + **/ + @PostMapping(value = "/loginbyphone") + public Result loginByPhone(@LoginUser TokenDto tokenDTO, @RequestBody LoginByPhoneFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, LoginByPhoneFormDTO.AddUserShowGroup.class, LoginByPhoneFormDTO.LoginByPhone.class); + return new Result().ok(publicUserLoginService.loginByPhone(tokenDTO, formDTO)); + } + + +} diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/LoginByPhoneFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/LoginByPhoneFormDTO.java new file mode 100644 index 0000000000..8b09d458d9 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/LoginByPhoneFormDTO.java @@ -0,0 +1,38 @@ +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 LoginByPhoneFormDTO implements Serializable { + private static final long serialVersionUID = 4193133227120225342L; + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + public interface LoginByPhone extends CustomerClientShowGroup{} + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空", groups = {AddUserShowGroup.class}) + private String phone; + + /** + * 验证码 + */ + @NotBlank(message="验证码不能为空", groups = {LoginByPhone.class}) + private String smsCode; + +} + diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/PaWxCodeFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/PaWxCodeFormDTO.java new file mode 100644 index 0000000000..33161e90c9 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/PaWxCodeFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/8 18:32 + */ +@Data +public class PaWxCodeFormDTO implements Serializable { + private static final long serialVersionUID = -207861963128774742L; + public interface AddUserInternalGroup {} + /** + * wxCode + */ + @NotBlank(message = "wxCode不能为空",groups = {AddUserInternalGroup.class}) + private String wxCode; +} diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/PublicSendSmsCodeFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/PublicSendSmsCodeFormDTO.java new file mode 100644 index 0000000000..22b096ca6a --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/PublicSendSmsCodeFormDTO.java @@ -0,0 +1,33 @@ +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 PublicSendSmsCodeFormDTO implements Serializable { + private static final long serialVersionUID = -1852541457359282018L; + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空", groups = {AddUserShowGroup.class}) + private String phone; + /** + * 是否登陆(登陆:true 注册:false) + */ + private Boolean isLogon; +} diff --git a/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java b/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java index acdd85f490..50433bdaf0 100644 --- a/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java +++ b/epmet-auth/src/main/java/com/epmet/redis/CaptchaRedis.java @@ -11,6 +11,7 @@ package com.epmet.redis; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.dto.form.PublicSendSmsCodeFormDTO; import com.epmet.dto.form.SendSmsCodeFormDTO; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -82,4 +83,28 @@ public class CaptchaRedis { String smsCode = (String) redisUtils.get(smsCodeKey); return smsCode; } + + /** + * @param sendSmsCodeFormDTO app、client、phone + * @param smsCode 验证码 + * @return void + * @Author sun + * @Description 公众号-短信验证码存入redis + **/ + public void savePublicSmsCode(PublicSendSmsCodeFormDTO sendSmsCodeFormDTO, String smsCode) { + String smsCodeKey = RedisKeys.getLoginSmsCodeKey(LoginConstant.APP_PUBLIC, LoginConstant.CLIENT_MP, sendSmsCodeFormDTO.getPhone()); + logger.info(String.format("短信验证码key=%s", smsCodeKey)); + redisUtils.set(smsCodeKey, smsCode, MINUTE_THIRTY_EXPIRE); + } + /** + * @param phone + * @return java.lang.String + * @Author sun + * @Description 公众号-获取登录时发送的验证码 + **/ + public String getPublicSmsCode(String phone) { + String smsCodeKey = RedisKeys.getLoginSmsCodeKey(LoginConstant.APP_PUBLIC, LoginConstant.CLIENT_MP, phone); + String smsCode = (String) redisUtils.get(smsCodeKey); + return smsCode; + } } diff --git a/epmet-auth/src/main/java/com/epmet/service/PublicUserLoginService.java b/epmet-auth/src/main/java/com/epmet/service/PublicUserLoginService.java new file mode 100644 index 0000000000..0ee6449c90 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/PublicUserLoginService.java @@ -0,0 +1,41 @@ +package com.epmet.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.LoginByPhoneFormDTO; +import com.epmet.dto.form.PaWxCodeFormDTO; +import com.epmet.dto.form.PublicSendSmsCodeFormDTO; +import com.epmet.dto.result.UserTokenResultDTO; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/8 18:31 + */ +public interface PublicUserLoginService { + + /** + * @return + * @param formDTO + * @author sun + * @description 解析wxcode获取用户信息并生成token + **/ + UserTokenResultDTO wxCodeToToken(PaWxCodeFormDTO formDTO); + + /** + * @param formDTO 手机号 + * @return com.epmet.commons.tools.utils.Result + * @Author sun + * @Description 公众号登录-发送验证码 + **/ + void sendSmsCode(PublicSendSmsCodeFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author sun + * @Description 公众号-手机验证码登陆 + **/ + UserTokenResultDTO loginByPhone(TokenDto tokenDTO, LoginByPhoneFormDTO formDTO); + +} diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/PublicUserLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/PublicUserLoginServiceImpl.java new file mode 100644 index 0000000000..21c0bc8c53 --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/service/impl/PublicUserLoginServiceImpl.java @@ -0,0 +1,239 @@ +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.utils.CpUserDetailRedis; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.PhoneValidatorUtils; +import com.epmet.constant.PublicUserLoginConstant; +import com.epmet.constant.SmsTemplateConstant; +import com.epmet.dto.PaCustomerDTO; +import com.epmet.dto.PaUserDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.CustomerUserResultDTO; +import com.epmet.dto.result.SaveUserResultDTO; +import com.epmet.dto.result.SendVerificationCodeResultDTO; +import com.epmet.dto.result.UserTokenResultDTO; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.feign.EpmetThirdFeignClient; +import com.epmet.jwt.JwtTokenProperties; +import com.epmet.jwt.JwtTokenUtils; +import com.epmet.redis.CaptchaRedis; +import com.epmet.service.PublicUserLoginService; +import me.chanjar.weixin.common.error.WxErrorException; +import me.chanjar.weixin.mp.api.WxMpService; +import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken; +import me.chanjar.weixin.mp.bean.result.WxMpUser; +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.util.HashMap; +import java.util.Map; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/8 18:31 + */ +@Service +public class PublicUserLoginServiceImpl implements PublicUserLoginService { + private static final Logger logger = LoggerFactory.getLogger(PublicUserLoginServiceImpl.class); + private static final String SEND_SMS_CODE_ERROR = "发送短信验证码异常,手机号[%s],code[%s],msg[%s]"; + @Autowired + private WxMpService wxMpService; + @Autowired + private EpmetThirdFeignClient epmetThirdFeignClient; + @Autowired + private JwtTokenUtils jwtTokenUtils; + @Autowired + private JwtTokenProperties jwtTokenProperties; + @Autowired + private CpUserDetailRedis cpUserDetailRedis; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; + @Autowired + private CaptchaRedis captchaRedis; + + + @Override + public UserTokenResultDTO wxCodeToToken(PaWxCodeFormDTO formDTO) { + //1.通过微信code获取用户基本信息 + WxMpUser wxMpUser = this.getWxMpUser(formDTO.getWxCode()); + + //2.将获取的用户基本信息初始化到数据库 + Result result = epmetThirdFeignClient.saveUser(wxMpUser); + if (!result.success()) { + throw new RenException(PublicUserLoginConstant.SAVE_USER_EXCEPTION); + } + SaveUserResultDTO resultDTO = result.getData(); + + //3.获取用户token + String token = this.generateGovWxmpToken(resultDTO.getUserId()); + //4.保存到redis + this.saveLatestGovTokenDto(resultDTO, wxMpUser, token); + UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setToken(token); + return userTokenResultDTO; + } + + private WxMpUser getWxMpUser(String wxCode) { + WxMpUser wxMpUser = null; + try { + WxMpOAuth2AccessToken wxMpOAuth2AccessToken = wxMpService.oauth2getAccessToken(wxCode); + wxMpUser = wxMpService.oauth2getUserInfo(wxMpOAuth2AccessToken, null); + } catch (WxErrorException e) { + logger.error("->[getWxMpUser]::error[{}]", "解析微信用户信息失败", e.getMessage()); + e.printStackTrace(); + throw new RenException("解析微信用户信息失败" + e.getMessage()); + } + if (null == wxMpUser ) { + logger.error("wxMpUser is null"); + throw new RenException("解析微信用户信息失败 wxMpUser is null"); + } + /*if(StringUtils.isBlank(wxMpUser.getUnionId())){ + logger.error("wxMpUser.getUnionId() is null"); + // throw new RenException("解析微信用户信息失败"); + }*/ + return wxMpUser; + } + + /** + * @Description 生成token + **/ + private String generateGovWxmpToken(String userId) { + Map map = new HashMap<>(); + map.put("app", LoginConstant.APP_PUBLIC); + map.put("client", LoginConstant.CLIENT_MP); + map.put("userId", userId); + String token = jwtTokenUtils.createToken(map); + logger.info("app:" + LoginConstant.APP_PUBLIC + ";client:" + LoginConstant.CLIENT_MP + ";userId:" + userId + ";生成token[" + token + "]"); + return token; + } + + //保存tokenDto到redis + private void saveLatestGovTokenDto(SaveUserResultDTO resultDTO, WxMpUser wxMpUser, String token) { + TokenDto tokenDTO = new TokenDto(); + int expire = jwtTokenProperties.getExpire(); + tokenDTO.setApp(LoginConstant.APP_PUBLIC); + tokenDTO.setClient(LoginConstant.CLIENT_MP); + tokenDTO.setOpenId(wxMpUser.getOpenId()); + tokenDTO.setUnionId(null == wxMpUser.getUnionId() ? "" : wxMpUser.getUnionId()); + tokenDTO.setToken(token); + //首次初始化时还没有客户 + tokenDTO.setCustomerId(""); + tokenDTO.setUserId(resultDTO.getUserId()); + tokenDTO.setExpireTime(jwtTokenUtils.getExpiration(token).getTime()); + tokenDTO.setUpdateTime(System.currentTimeMillis()); + cpUserDetailRedis.set(tokenDTO, expire); + logger.info("截止时间:" + DateUtils.format(jwtTokenUtils.getExpiration(token), "yyyy-MM-dd HH:mm:ss")); + } + + /** + * @param formDTO 手机号 + * @return com.epmet.commons.tools.utils.Result + * @Author sun + * @Description 公众号登录-发送验证码 + **/ + @Override + public void sendSmsCode(PublicSendSmsCodeFormDTO formDTO) { + //1、校验手机号是否符合规范 + if (!PhoneValidatorUtils.isMobile(formDTO.getPhone())) { + logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getPhone(), EpmetErrorCode.ERROR_PHONE.getCode(), EpmetErrorCode.ERROR_PHONE.getMsg())); + throw new RenException(EpmetErrorCode.ERROR_PHONE.getCode()); + } + //2、根据手机号校验用户是否存在 + Result Result = epmetThirdFeignClient.checkPaUser(formDTO.getPhone()); + if (!Result.success()) { + logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getPhone(), Result.getCode(), Result.getMsg())); + throw new RenException(Result.getCode()); + } + CustomerUserResultDTO ResultDTO = Result.getData(); + //登陆 + if (formDTO.getIsLogon() && null == ResultDTO.getPaUserResult()) { + throw new RenException(EpmetErrorCode.PUBLIC_NOT_EXISTS.getCode()); + } + //注册 + if (!formDTO.getIsLogon() && null != ResultDTO.getPaUserResult()) { + throw new RenException(EpmetErrorCode.MOBILE_USED.getCode()); + } + //3、发送短信验证码 + SendVerificationCodeFormDTO sendVerificationCodeFormDTO = new SendVerificationCodeFormDTO(); + sendVerificationCodeFormDTO.setMobile(formDTO.getPhone()); + //登陆或注册对应的短息模板 + sendVerificationCodeFormDTO.setAliyunTemplateCode(formDTO.getIsLogon() ? SmsTemplateConstant.LGOIN_CONFIRM : SmsTemplateConstant.USER_REGISTER); + Result smsCodeResult = epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO); + if (!smsCodeResult.success()) { + logger.error(String.format(SEND_SMS_CODE_ERROR, formDTO.getPhone(), smsCodeResult.getCode(), smsCodeResult.getMsg())); + throw new RenException(smsCodeResult.getCode()); + } + //4、保存短信验证码(删除现有短信验证码、将新的短信验证码存入Redis) + captchaRedis.savePublicSmsCode(formDTO, smsCodeResult.getData().getCode()); + logger.info(String.format("发送短信验证码成功,手机号[%s]", formDTO.getPhone())); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author sun + * @Description 公众号-手机验证码登陆 + **/ + @Override + public UserTokenResultDTO loginByPhone(TokenDto tokenDTO, LoginByPhoneFormDTO formDTO) { + //1.根据手机号查询到用户、客户信息 + Result result = epmetThirdFeignClient.checkPaUser(formDTO.getPhone()); + if (!result.success()) { + logger.error(String.format("手机验证码登录异常,手机号[%s],code[%s],msg[%s]", formDTO.getPhone(), result.getCode(), result.getMsg())); + throw new RenException(result.getCode()); + } + CustomerUserResultDTO resultDTO = result.getData(); + + //2.用户不存在时不允许登陆 + PaUserDTO userDTO = resultDTO.getPaUserResult(); + if (null == userDTO || StringUtils.isBlank(userDTO.getId())) { + throw new RenException(EpmetErrorCode.PUBLIC_NOT_EXISTS.getCode()); + } + + //3.校验验证码是否正确 + String rightSmsCode = captchaRedis.getPublicSmsCode(formDTO.getPhone()); + if (!formDTO.getSmsCode().equals(rightSmsCode)) { + logger.error(String.format("验证码错误code[%s],msg[%s]", EpmetErrorCode.MOBILE_CODE_ERROR.getCode(), EpmetErrorCode.MOBILE_CODE_ERROR.getMsg())); + throw new RenException(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); + } + //获取缓存中的token + TokenDto redisTokenDTO = cpUserDetailRedis.get(LoginConstant.APP_PUBLIC, LoginConstant.CLIENT_MP, userDTO.getId(), TokenDto.class); + if (redisTokenDTO == null) { + return null; + } + + //4.判断是否存在客户信息,是否需要生成新的token + PaCustomerDTO customerDTO = resultDTO.getPaCustomerResult(); + if (null != customerDTO && !StringUtils.isBlank(customerDTO.getId())) { + redisTokenDTO.setCustomerId(customerDTO.getId()); + int expire = jwtTokenProperties.getExpire(); + cpUserDetailRedis.set(redisTokenDTO, expire); + } + + //5.登陆成功,访问记录表新增访问记录(访问记录新增失败不应影响用户登陆) + SaveUserVisitedFormDTO visited = new SaveUserVisitedFormDTO(); + visited.setUserId(userDTO.getId()); + visited.setLogonUserId(tokenDTO.getUserId()); + visited.setPhone(formDTO.getPhone()); + Result visitedResult = epmetThirdFeignClient.saveUserVisited(visited); + if(!visitedResult.success()){ + logger.error(PublicUserLoginConstant.SAVE_VISITED_EXCEPTION); + } + + //6.返回token + UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); + userTokenResultDTO.setToken(redisTokenDTO.getToken()); + return userTokenResultDTO; + } + +} diff --git a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/constant/LoginConstant.java b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/constant/LoginConstant.java index b546108bc8..17cb456a1a 100644 --- a/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/constant/LoginConstant.java +++ b/epmet-commons/epmet-common-clienttoken/src/main/java/com/epmet/common/token/constant/LoginConstant.java @@ -21,6 +21,11 @@ public interface LoginConstant { */ String APP_OPER = "oper"; + /** + * 公众号 + */ + String APP_PUBLIC = "public"; + /** * web */ @@ -30,4 +35,9 @@ public interface LoginConstant { * 微信小程序 */ String CLIENT_WXMP = "wxmp"; + + /** + * E事通服务号 + */ + String CLIENT_MP = "mp"; } 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 00c957c680..c6d5234ddd 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 @@ -31,6 +31,7 @@ public interface NumConstant { int THIRTY = 30; int FORTY = 40; int FIFTY = 50; + int SIXTY = 60; int ONE_HUNDRED = 100; int ONE_THOUSAND = 1000; int MAX = 99999999; @@ -48,5 +49,6 @@ public interface NumConstant { String THREE_STR = "3"; String FOUR_STR = "4"; String FIVE_STR = "5"; + String POSITIVE_EIGHT_STR = "+8"; } 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 9e73b1a49f..db6dea1b61 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java @@ -119,6 +119,11 @@ public interface ServiceConstant { */ String DATA_STATISTICAL_SERVER = "data-statistical-server"; + /** + * 微信第三方平台 + */ + String EPMET_THIRD_SERVER = "epmet-third-server"; + /** * 爱心互助 */ 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 aa7bc28867..36f968e3b0 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 @@ -82,7 +82,10 @@ public enum EpmetErrorCode { DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), ARTICLE_PUBLISH_ERROR(8801, "发布文章失败,请刷新重试"), - CUSTOMER_VALIDATE_ERROR(8999, "内部数据校验异常"); + CUSTOMER_VALIDATE_ERROR(8999, "内部数据校验异常"), + + //公众号 865..开头的码 + PUBLIC_NOT_EXISTS(8651,"手机号未注册,请先完成信息注册"); private int code; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index d0c21c4d9a..f79b22ccb5 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -481,4 +481,11 @@ public class DateUtils { cale.set(Calendar.DAY_OF_MONTH, 0); return cale.getTime(); } + + public static String formatTimestamp(Long timestamp, String pattern) { + //设置格式 + SimpleDateFormat format = new SimpleDateFormat(pattern); + return format.format(timestamp); + } + } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java index 2cfaed7588..261153eea7 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java @@ -8,6 +8,7 @@ import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.codec.binary.Base64; +import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpStatus; import org.apache.http.NameValuePair; @@ -27,7 +28,10 @@ import org.springframework.util.CollectionUtils; import javax.crypto.Mac; import javax.crypto.spec.SecretKeySpec; +import java.io.ByteArrayOutputStream; +import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.net.URLEncoder; import java.util.ArrayList; import java.util.List; @@ -204,6 +208,67 @@ public class HttpClientManager { return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); } + /** + * desc: 发送get请求 + * param:url, params + * return: CallResult + * date: 2019/2/21 9:16 + * + * @author: jianjun liu + */ + public Result sendGetFile(String url, Map params) { + + try { + URIBuilder builder = new URIBuilder(url); + if (!CollectionUtils.isEmpty(params)) { + Set set = params.keySet(); + for (String key : set) { + builder.setParameter(key, params.get(key) == null ? "" : String.valueOf(params.get(key))); + } + } + HttpGet httpGet = new HttpGet(builder.build()); + httpGet.setConfig(requestConfig); + return executeToByte(httpGet); + } catch (Exception e) { + log.error("sendGet exception", e); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + } + + private Result executeToByte(HttpRequestBase httpMethod) { + CloseableHttpResponse response = null; + try { + response = httpclient.execute(httpMethod); + log.debug("http send response:{}", JSON.toJSONString(response)); + if (response != null && response.getStatusLine() != null) { + if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) { + InputStream in = response.getEntity().getContent(); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + byte[] buffer = new byte[4096]; + int n = 0; + while (-1 != (n = in.read(buffer))) { + output.write(buffer, 0, n); + } + return new Result().ok(ArrayUtils.toObject(output.toByteArray())); + } else { + log.warn("execute http method fail,httpStatus:{0}", response.getStatusLine().getStatusCode()); + } + } + } catch (Exception e) { + log.error("execute exception", e); + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), e.getMessage()); + } finally { + httpMethod.releaseConnection(); + try { + if (response != null) { + response.close(); + } + } catch (IOException e) { + } + } + return new Result().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); + } + public static void main(String[] args) { String url = "http://localhost:8107/epmetscan/api/textSyncScan"; TextTaskDTO p = new TextTaskDTO(); diff --git a/epmet-gateway/deploy/docker-compose-dev.yml b/epmet-gateway/deploy/docker-compose-dev.yml index 757bce4583..451de14e3d 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.23 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.26 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 5bdf5fda68..35a4e7e1e2 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.22 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/epmet-gateway:0.3.25 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/deploy/docker-compose-test.yml b/epmet-gateway/deploy/docker-compose-test.yml index 44bcb9c5dd..3dfa75ed94 100644 --- a/epmet-gateway/deploy/docker-compose-test.yml +++ b/epmet-gateway/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-gateway-server: container_name: epmet-gateway-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-gateway:0.3.22 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-gateway:0.3.25 ports: - "8080:8080" network_mode: host # 使用现有网络 diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index edb6deb03d..25a2c69fa1 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.23 + 0.3.26 com.epmet epmet-cloud @@ -185,6 +185,10 @@ lb://epmet-openapi-scan + + lb://epmet-third-server + + lb://epmet-heart-server @@ -273,9 +277,11 @@ lb://data-statistical-server lb://epmet-openapi-scan - + + lb://epmet-third-server + lb://epmet-heart-server - + http://127.0.0.1:8112 @@ -356,9 +362,11 @@ lb://data-statistical-server lb://epmet-openapi-scan - + + lb://epmet-third-server + lb://epmet-heart-server - + http://127.0.0.1:8112 diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 17a6252b9f..c2105542bb 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -286,10 +286,19 @@ spring: filters: - StripPrefix=1 - CpAuth=true + #微信第三方平台 + - id: epmet-third-server + uri: @gateway.routes.epmet-third-server.uri@ + order: 31 + predicates: + - Path=${server.servlet.context-path}/third/** + filters: + - StripPrefix=1 + - CpAuth=true # 爱心互助 - id: epmet-heart-server uri: @gateway.routes.epmet-heart-server.url@ - order: 31 + order: 32 predicates: - Path=${server.servlet.context-path}/heart/** filters: @@ -298,7 +307,7 @@ spring: # 积分银行 - id: epmet-point-server uri: @gateway.routes.epmet-point-server.url@ - order: 32 + order: 33 predicates: - Path=${server.servlet.context-path}/point/** filters: @@ -418,11 +427,6 @@ epmet: - /gov/issue/** - /gov/project/** - /resi/home/** - - /gov/voice/** - - /resi/voice/** - - /data/report/** - - /heart/** - - /point/** swaggerUrls: jwt: diff --git a/epmet-module/epmet-third/epmet-third-client/pom.xml b/epmet-module/epmet-third/epmet-third-client/pom.xml new file mode 100644 index 0000000000..3a2173aa25 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/pom.xml @@ -0,0 +1,35 @@ + + + 4.0.0 + + + epmet-third + com.epmet + 2.0.0 + + + + epmet-third-client + jar + + + + com.epmet + epmet-commons-tools + 2.0.0 + + + com.github.binarywang + weixin-java-mp + 3.6.0 + compile + + + + + ${project.artifactId} + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthCodeDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthCodeDTO.java new file mode 100644 index 0000000000..5f8d148691 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthCodeDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 授权回调url反参表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +public class AuthCodeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 授权方APPID + */ + private String authAppid; + + /** + * 授权码 + */ + private String authCode; + + /** + * 到期时间 + */ + private Date expiresInTime; + + /** + * + */ + private Integer delFlag; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String updatedBy; + + /** + * + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthResultRecordDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthResultRecordDTO.java new file mode 100644 index 0000000000..6d64c5af52 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthResultRecordDTO.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-07-15 + */ +@Data +public class AuthResultRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 第三方平台AppId 第三方平台AppId + */ + private String componentAppId; + + /** + * 微信返回创建时间 微信返回创建时间 + */ + private Date wechatCreateTime; + + /** + * 通知类型 + */ + private String infoType; + + /** + * 授权方AppId + */ + private String authorizerAppId; + + /** + * 授权码(auth_code) + */ + private String authorizationCode; + + /** + * 授权码过期时间 + */ + private Date expiresInTime; + + /** + * 预授权码 + */ + private String preAuthCode; + + /** + * 删除状态 + */ + 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/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthorizationInfoDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthorizationInfoDTO.java new file mode 100644 index 0000000000..394b8680bc --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/AuthorizationInfoDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 授权信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +public class AuthorizationInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 授权方 appid + */ + private String authorizerAppid; + + /** + * 接口调用令牌(在授权的公众号/小程序具备 API 权限时,才有此返回值)【第三方和微信交互使用】 + */ + private String authorizerAccessToken; + + /** + * 到期时间 + */ + private Date expiresInTime; + + /** + * 刷新令牌(在授权的公众号具备API权限时,才有此返回值),刷新令牌主要用于第三方平台获取和刷新已授权用户的 authorizer_access_token。一旦丢失,只能让用户重新授权,才能再次拿到新的刷新令牌。用户重新授权后,之前的刷新令牌会失效 + */ + private String authorizerRefreshToken; + + /** + * + */ + private Integer delFlag; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String updatedBy; + + /** + * + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/BindingAccountDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/BindingAccountDTO.java new file mode 100644 index 0000000000..87a4abdaac --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/BindingAccountDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 公众号/小程序绑定开放平台帐号表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +public class BindingAccountDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id ID + */ + private String id; + + /** + * 开放平台账号ID 开放平台账号ID + */ + private String openPlatformAccountId; + + /** + * 公众号/小程序APPID(授权方APPID) 授权方APPID + */ + private String authAppId; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 客户端 居民端:resi,工作端:work + */ + private String clientType; + + /** + * + */ + 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/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/BusinessInfoDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/BusinessInfoDTO.java new file mode 100644 index 0000000000..e29f749675 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/BusinessInfoDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 功能开通状况表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +public class BusinessInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 主表ID + */ + private String primaryId; + + /** + * 功能类型 open_store:是否开通微信门店功能 open_scan:是否开通微信扫商品功能 open_pay:是否开通微信支付功能 open_card:是否开通微信卡券功能 open_shake:是否开通微信摇一摇功能 + */ + private String funcType; + + /** + * 开通状态 0:未开通,1:已开通 + */ + private Integer openStatus; + + /** + * 删除状态 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/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditRecordDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditRecordDTO.java new file mode 100644 index 0000000000..014490dad5 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditRecordDTO.java @@ -0,0 +1,144 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 代码审核记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-15 + */ +@Data +public class CodeAuditRecordDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 模板ID + */ + private String templateId; + + /** + * 客户端类型:resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 授权方AppId + */ + private String authAppId; + + /** + * 小程序的原始 ID + */ + private String toUserName; + + /** + * 发送方帐号(一个 OpenID,此时发送方是系统帐号) + */ + private String fromUserName; + + /** + * 消息创建时间 (整型),时间戳 + */ + private Date wechatCreateTime; + + /** + * 消息类型 event + */ + private String msgType; + + /** + * 事件类型 +weapp_audit_success:审核通过, +weapp_audit_fail:审核不通过, +weapp_audit_delay:审核延后 + */ + private String event; + + /** + * 审核成功时的时间戳 + */ + private Date succTime; + + /** + * 审核不通过的时间戳 + */ + private Date failTime; + + /** + * 审核延后时的时间戳 + */ + private Date delayTime; + + /** + * 审核不通过的原因 + */ + private String reason; + + /** + * 审核不通过的截图示例。用 | 分隔的 media_id 的列表,可通过获取永久素材接口拉取截图内容 + */ + private String screenShot; + + /** + * 删除状态 + */ + 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/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.java new file mode 100644 index 0000000000..880e646668 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeAuditResultDTO.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; + + +/** + * 代码审核j结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +public class CodeAuditResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 代码ID + */ + private String codeId; + + /** + * 审核ID + */ + private String auditId; + + /** + * 审核结果 审核中:auditing,审核成功audit_success,审核被拒绝audit_failed,已撤回:withdrawn,审核延后:delay + */ + private String result; + + /** + * 原因 + */ + private String reason; + + /** + * 当审核被拒绝时,会返回审核失败的小程序截图示例。用 | 分隔的 media_id 的列表 + */ + private String screenShot; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeCustomerDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeCustomerDTO.java new file mode 100644 index 0000000000..2a4c2227fc --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeCustomerDTO.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-07-09 + */ +@Data +public class CodeCustomerDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户名 + */ + private String customerName; + + /** + * 模板ID + */ + private String templateId; + + /** + * 小程序类型 居民端resi,工作端work + */ + private String clientType; + + /** + * APPID + */ + private String appId; + + /** + * 自定义配置 + */ + private String extJson; + + /** + * 代码版本号 + */ + private String userVersion; + + /** + * 代码描述 + */ + private String userDesc; + + /** + * 状态 未审核:unaudited,审核中:auditing,审核成功audit_success,审核被拒绝audit_failed,已撤回:withdrawn,审核延后:delay,发布成功release_success, 发布失败release_failed + */ + private String status; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeMediaDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeMediaDTO.java new file mode 100644 index 0000000000..09332ac8a3 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CodeMediaDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 代码素材 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +public class CodeMediaDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 代码ID + */ + private String codeId; + + /** + * 素材ID + */ + private String mediaId; + + /** + * 素材名 + */ + private String mediaName; + + /** + * 素材类型 图片(image)、语音(voice)、视频(video)和缩略图(thumb) + */ + private String mediaType; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/ComponentAccessTokenDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/ComponentAccessTokenDTO.java new file mode 100644 index 0000000000..037f39a214 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/ComponentAccessTokenDTO.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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 第三方平台调用凭证 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +public class ComponentAccessTokenDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 令牌 【第三方平台接口的调用凭据】 + */ + private String componentAccessToken; + + /** + * 令牌到期时间 + */ + private Date expiresInTime; + + /** + * 删除状态 0:正常 1:删除 + */ + private Integer delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/ComponentVerifyTicketDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/ComponentVerifyTicketDTO.java new file mode 100644 index 0000000000..c167790abb --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/ComponentVerifyTicketDTO.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 微信发送的ticket表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +public class ComponentVerifyTicketDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 第三方平台ID + */ + private String componentAppId; + + /** + * component_verify_ticket + */ + private String typeInfo; + + /** + * 票据内容 + */ + private String componentVerifyTicket; + + /** + * 删除标识 0-否,1-是 + */ + private String delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CustomerCodeOperationHistoryDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CustomerCodeOperationHistoryDTO.java new file mode 100644 index 0000000000..9d400efb40 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CustomerCodeOperationHistoryDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户代码操作历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +public class CustomerCodeOperationHistoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 代码ID + */ + private String codeId; + + /** + * 版本 + */ + private String version; + + /** + * 操作类型 操作 上传upload,审核audit,撤回undo,发布release + */ + private String operation; + + /** + * 描述 + */ + private String describe; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CustomerMpDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CustomerMpDTO.java new file mode 100644 index 0000000000..3a106817f7 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/CustomerMpDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户小程序关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +public class CustomerMpDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * pa_customer的id + */ + private String customerId; + + /** + * resi,work + */ + private String client; + + /** + * 小程序的appId + */ + private String appId; + + /** + * 是否已经授权 0:未授权,1:已授权 + */ + private Integer authorizationFlag; + + /** + * 删除标识: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/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/FuncInfoDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/FuncInfoDTO.java new file mode 100644 index 0000000000..14cbcd763e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/FuncInfoDTO.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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 授权给开发者的权限集列表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +public class FuncInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 权限类别 + */ + private String funcscopeCategory; + + /** + * 权限ID + */ + private String funcscopeId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 授权方APPID + */ + private String authorizationInfoAppid; + + /** + * + */ + private Integer delFlag; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String updatedBy; + + /** + * + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniCategoryInfoDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniCategoryInfoDTO.java new file mode 100644 index 0000000000..098f476306 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniCategoryInfoDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 小程序配置类目信息表 小程序配置类目信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +public class MiniCategoryInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 主表ID + */ + private String primaryId; + + /** + * 类目排序 first , second + */ + private String categorySort; + + /** + * 类目名称 资讯,文娱...... + */ + private String categoryName; + + /** + * 删除状态 + */ + 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/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniInfoDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniInfoDTO.java new file mode 100644 index 0000000000..501f9437d2 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniInfoDTO.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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 小程序信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +public class MiniInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImg; + + /** + * 小程序类型 默认为 0 + */ + private String serviceTypeInfo; + + /** + * 小程序认证类型 小程序认证类型 + */ + private String verifyTypeInfo; + + /** + * 原始 ID + */ + private String userName; + + /** + * 主体名称 + */ + private String principalName; + + /** + * 账号介绍 + */ + private String signature; + + /** + * 二维码图片的 URL + */ + private String qrcodeUrl; + + /** + * 删除状态 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/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniNetworkInfoDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniNetworkInfoDTO.java new file mode 100644 index 0000000000..c928d9afab --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/MiniNetworkInfoDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 小程序配置合法域名信息表 小程序配置合法域名信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +public class MiniNetworkInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 主表ID + */ + private String primaryId; + + /** + * 类型 + */ + private String networkType; + + /** + * 域名 RequestDomain,WsRequestDomain,UploadDomain,DownloadDomain + */ + private String url; + + /** + * 删除状态 + */ + 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/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/OpenPlatformAccountDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/OpenPlatformAccountDTO.java new file mode 100644 index 0000000000..f9dacb70ce --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/OpenPlatformAccountDTO.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 java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 开放平台账号表 + + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +public class OpenPlatformAccountDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id ID + */ + private String id; + + /** + * openId 所创建的开放平台帐号的 appid + */ + private String openAppId; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaCustomerAgencyDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaCustomerAgencyDTO.java new file mode 100644 index 0000000000..e659efc669 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaCustomerAgencyDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户根组织信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +public class PaCustomerAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id,来源于customer.id + */ + private String customerId; + + /** + * 根组织名称 + */ + private String agencyName; + + /** + * 级别 + */ + private String level; + + /** + * 地区编码 + */ + private String areaCode; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String district; + + /** + * 党支部数量 + */ + private Integer partybranchnum; + + /** + * 删除标识 + */ + 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/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaCustomerDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaCustomerDTO.java new file mode 100644 index 0000000000..dd175f0747 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaCustomerDTO.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +public class PaCustomerDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户id,本主键和oper_crm.customer.id一致 + */ + private String id; + + /** + * 客户名称,默认是根组织名称 + */ + private String customerName; + + /** + * 是否已经完成客户信息初始化 0:未初始化,1:已初始化 + */ + private Integer isInitialize; + + /** + * 删除标识: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/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaCustomerUserAgencyDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaCustomerUserAgencyDTO.java new file mode 100644 index 0000000000..5bec4b8aa1 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaCustomerUserAgencyDTO.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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 用户组织关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +public class PaCustomerUserAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id,来源于pa_customer.id + */ + private String customerId; + + /** + * pa_customer_agency.id + */ + private String agencyId; + + /** + * pa_user.id + */ + private String userId; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaInfoDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaInfoDTO.java new file mode 100644 index 0000000000..8d5768aa62 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaInfoDTO.java @@ -0,0 +1,129 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 公众号信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +public class PaInfoDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImg; + + /** + * 公众号类型 0:订阅号 +1:由历史老帐号升级后的订阅号 +2:服务号 + */ + private String serviceTypeInfo; + + /** + * 公众号认证类型 -1:未认证 +0:微信认证 +1:新浪微博认证 +2:腾讯微博认证 +3:已资质认证通过但还未通过名称认证 +4:已资质认证通过、还未通过名称认证,但通过了新浪微博认证 +5:已资质认证通过、还未通过名称认证,但通过了腾讯微博认证 + */ + private String verifyTypeInfo; + + /** + * 原始ID + */ + private String userName; + + /** + * 主体名称 + */ + private String principalName; + + /** + * 公众号所设置的微信号,可能为空 公众号所设置的微信号,可能为空 + */ + private String alias; + + /** + * 二维码图片的 URL + */ + private String qrcodeUrl; + + /** + * 删除状态 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/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaUserDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaUserDTO.java new file mode 100644 index 0000000000..1a61724055 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaUserDTO.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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 公众号用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +public class PaUserDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * user表的id + */ + private String id; + + /** + * 手机号 + */ + private String phone; + + /** + * 姓 + */ + private String realName; + + /** + * 1男2女0未知 + */ + private String gender; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaUserVisitedDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaUserVisitedDTO.java new file mode 100644 index 0000000000..84f9601199 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaUserVisitedDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 公众号登陆记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +public class PaUserVisitedDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * user表的id + */ + private String id; + + /** + * 用户Id pa_user.id + */ + private String userId; + + /** + * 登陆手机号对应的openId【pa_user_wechat表手机号对应的openId】 + */ + private String wxOpenId; + + /** + * 登陆用户的openId + */ + private String openId; + + /** + * 登陆用户使用的登陆手机号 + */ + private String phone; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaUserWechatDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaUserWechatDTO.java new file mode 100644 index 0000000000..29106ab239 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PaUserWechatDTO.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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 公众号用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +public class PaUserWechatDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * user表的id + */ + private String id; + + /** + * 用户Id user.id + */ + private String userId; + + /** + * 注册用户的微信openId + */ + private String wxOpenId; + + /** + * + */ + private String unionId; + + /** + * 1男2女0未知 + */ + private String gender; + + /** + * 昵称 + */ + private String nickname; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 国家 + */ + private String country; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 语言 + */ + private String language; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PreAuthTokenDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PreAuthTokenDTO.java new file mode 100644 index 0000000000..e77f95db84 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/PreAuthTokenDTO.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.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 预授权码历史记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +public class PreAuthTokenDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 预授权码 【第三方平台方实现授权托管的必备信息,每个预授权码有效期为 10 分钟。需要先获取令牌才能调用】 + */ + private String preAuthToken; + + /** + * 预授权码有效期 + */ + private Date expiresInTime; + + /** + * 删除状态 0:正常 1:删除 + */ + private Integer delFlag; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthCodeFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthCodeFormDTO.java new file mode 100644 index 0000000000..390e0c7aab --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthCodeFormDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @CreateTime 2020/7/8 17:53 + */ +@Data +public class AuthCodeFormDTO implements Serializable { + + private static final long serialVersionUID = -6163303184086480522L; + + /** + * 客户ID + */ + private String customerId; + + /** + * resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 授权方AppId + */ + private String authAppId; + + /** + * 授权码 + */ + private String authCode; + + /** + * 有效期 10min + */ + private Date expiresInTime; + + /** + * 删除状态 0:正常 1:已删除 + */ + private Integer delFlag = 0; + + /** + * 创建者 + */ + private String createdBy = "APP_USER"; + + /** + * 更新者 + */ + private String updatedBy = "APP_USER"; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthorizationInfoFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthorizationInfoFormDTO.java new file mode 100644 index 0000000000..2004536f1c --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthorizationInfoFormDTO.java @@ -0,0 +1,52 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @CreateTime 2020/7/9 10:30 + */ +@Data +public class AuthorizationInfoFormDTO implements Serializable { + + private static final long serialVersionUID = -1117036477221128930L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 授权方 appid + */ + private String authorizerAppid; + + /** + * 接口调用令牌(在授权的公众号/小程序具备 API 权限时,才有此返回值) + */ + private String authorizerAccessToken; + + /** + * authorizer_access_token 的有效期(在授权的公众号/小程序具备API权限时,才有此返回值),单位:秒 + */ + private Date expiresInTime; + + /** + * 刷新令牌(在授权的公众号具备API权限时,才有此返回值),刷新令牌主要用于第三方平台获取和刷新已授权用户的 authorizer_access_token。一旦丢失,只能让用户重新授权,才能再次拿到新的刷新令牌。用户重新授权后,之前的刷新令牌会失效 + */ + private String authorizerRefreshToken; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + private Integer delFlag = 0; + + private String createdBy = "APP_USER"; + + private String updatedBy = "APP_USER"; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthorizerAccessTokenFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthorizerAccessTokenFormDTO.java new file mode 100644 index 0000000000..2e5528ea64 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/AuthorizerAccessTokenFormDTO.java @@ -0,0 +1,47 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @CreateTime 2020/7/9 17:29 + */ +@Data +public class AuthorizerAccessTokenFormDTO implements Serializable { + + private static final long serialVersionUID = 268927093061495006L; + + /** + * 授权方令牌 + */ + private String authorizerAccessToken; + + /** + * 有效期,单位:秒 + */ + private Date expiresInTime; + + /** + * 刷新令牌 + */ + private String authorizerRefreshToken; + + /** + * 授权方APPID + */ + private String authAppid; + + /** + * 客户ID + */ + private String customerId; + + private Integer delFlag = 0; + + private String createdBy = "APP_USER"; + + private String updatedBy = "APP_USER"; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BindingAccountFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BindingAccountFormDTO.java new file mode 100644 index 0000000000..9221628d6b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BindingAccountFormDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/7/13 17:58 + */ +@Data +public class BindingAccountFormDTO implements Serializable { + + private static final long serialVersionUID = 7969402941219659678L; + + /** + * 开放平台账号ID 开放平台账号ID + */ + private String openPlatformAccountId; + + /** + * 公众号/小程序APPID(授权方APPID) 授权方APPID + */ + private String authAppId; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 客户端 居民端:resi,工作端:work + */ + private String clientType; + + private Integer delFlag = 0; + private Integer revision = 0; + private String createdBy = "APP_USER"; + private String updatedBy = "APP_USER"; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BusinessInfoFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BusinessInfoFormDTO.java new file mode 100644 index 0000000000..7a47dd2bb3 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/BusinessInfoFormDTO.java @@ -0,0 +1,60 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/7/14 15:54 + */ +@Data +public class BusinessInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 570372083578341740L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 主表ID + */ + private String primaryId; + + /** + * 功能类型 open_store:是否开通微信门店功能 open_scan:是否开通微信扫商品功能 open_pay:是否开通微信支付功能 open_card:是否开通微信卡券功能 open_shake:是否开通微信摇一摇功能 + */ + private String funcType; + + /** + * 开通状态 0:未开通,1:已开通 + */ + private Integer openStatus; + + /** + * 删除状态 0:正常,1:删除 + */ + private Integer delFlag = 0; + + /** + * 乐观锁 + */ + private Integer revision = 0; + + /** + * 创建人 + */ + private String createdBy = "APP_USER"; + + /** + * 更新人 + */ + private String updatedBy = "APP_USER"; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeAuditRecordFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeAuditRecordFormDTO.java new file mode 100644 index 0000000000..c0530f1bb7 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeAuditRecordFormDTO.java @@ -0,0 +1,115 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @CreateTime 2020/7/15 14:13 + */ +@Data +public class CodeAuditRecordFormDTO implements Serializable { + + private static final long serialVersionUID = 2295533266066734315L; + + /** + * ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 模板ID + */ + private String templateId; + + /** + * 客户端类型:resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 授权方AppId + */ + private String authAppId; + + /** + * 小程序的原始 ID + */ + private String toUserName; + + /** + * 发送方帐号(一个 OpenID,此时发送方是系统帐号) + */ + private String fromUserName; + + /** + * 消息创建时间 (整型),时间戳 + */ + private Date wechatCreateTime; + + /** + * 消息类型 event + */ + private String msgType; + + /** + * 事件类型 + weapp_audit_success:审核通过, + weapp_audit_fail:审核不通过, + weapp_audit_delay:审核延后 + */ + private String event; + + /** + * 审核成功时的时间戳 + */ + private Date succTime; + + /** + * 审核不通过的时间戳 + */ + private Date failTime; + + /** + * 审核延后时的时间戳 + */ + private Date delayTime; + + /** + * 审核不通过的原因 + */ + private String reason; + + /** + * 审核不通过的截图示例。用 | 分隔的 media_id 的列表,可通过获取永久素材接口拉取截图内容 + */ + private String screenShot; + + /** + * 删除状态 + */ + private Integer delFlag = 0; + + /** + * 乐观锁 + */ + private Integer revision = 0; + + /** + * 创建人 + */ + private String createdBy = "APP_USER"; + + /** + * 更新人 + */ + private String updatedBy = "APP_USER"; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeCommonFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeCommonFormDTO.java new file mode 100644 index 0000000000..083f145ba6 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeCommonFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/14 17:50 + */ +@Data +public class CodeCommonFormDTO implements Serializable { + private static final long serialVersionUID = -8923691903900141713L; + /** + * 客户ID + */ + private String customerId; + /** + * 代码ID + */ + private String codeId; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeUploadFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeUploadFormDTO.java new file mode 100644 index 0000000000..87c717603d --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CodeUploadFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/9 14:24 + */ +@NoArgsConstructor +@Data +public class CodeUploadFormDTO implements Serializable { + + private static final long serialVersionUID = 1295337818281424509L; + /** + * 小程序类型 居民端resi, 工作段work + */ + private String clientType; + /** + * 客户ID + */ + private String customerId; + /** + * 代码库中的代码模板 ID + */ + private String templateId; + /** + * 第三方自定义的配置 + */ + private String extJson; + /** + * 代码版本号 + */ + private String userVersion; + /** + * 代码描述 + */ + private String userDesc; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ComponentAccessTokenFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ComponentAccessTokenFormDTO.java new file mode 100644 index 0000000000..d09b6cd4fb --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ComponentAccessTokenFormDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @CreateTime 2020/7/9 8:54 + */ +@Data +public class ComponentAccessTokenFormDTO implements Serializable { + + private static final long serialVersionUID = -2860559047843944065L; + + /** + * 令牌 【第三方平台接口的调用凭据】 + */ + private String componentAccessToken; + + /** + * 令牌有效期 单位:s 最长 60*60*2 + */ + private Date expiresInTime; + + /** + * 删除状态 0:正常 1:删除 + */ + private Integer delFlag = 0; + + /** + * 创建人 + */ + private String createdBy = "APP_USER"; + + /** + * 更新人 + */ + private String updatedBy = "APP_USER"; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ComponentVerifyTicketFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ComponentVerifyTicketFormDTO.java new file mode 100644 index 0000000000..54afadfc32 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ComponentVerifyTicketFormDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @CreateTime 2020/7/7 11:12 + */ +@Data +public class ComponentVerifyTicketFormDTO implements Serializable { + + private static final long serialVersionUID = -6547893374373422628L; + + /** + * 主键 + */ + private String id; + + /** + * 第三方平台ID + */ + private String componentAppId; + + /** + * component_verify_ticket + */ + private String typeInfo = "component_verify_ticket"; + + /** + * 票据内容 + */ + private String componentVerifyTicket; + + /** + * 删除标识 0-否,1-是 + */ + private String delFlag = "0"; + + /** + * 创建人 + */ + private String createdBy = "APP_USER"; + + /** + * 更新人 + */ + private String updatedBy = "APP_USER"; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CreateAgencyFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CreateAgencyFormDTO.java new file mode 100644 index 0000000000..4ab159bb59 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CreateAgencyFormDTO.java @@ -0,0 +1,56 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author sun + * @Description 公众号-创建组织-接口入参 + */ +@Data +public class CreateAgencyFormDTO implements Serializable { + + private static final long serialVersionUID = -6547893374373422628L; + + public interface AddUserInternalGroup {} + + /** + * 根组织名称 + */ + @NotBlank(message = "组织名称不能为空") + private String agencyName; + + /** + * 级别 + */ + @NotBlank(message = "组织级别不能为空") + private String level; + + /** + * 地区编码 + */ + @NotBlank(message = "地区编码不能为空") + private String areaCode; + + /** + * 省(中国字) + */ + private String province = ""; + + /** + * 市(中国字) + */ + private String city = ""; + + /** + * 区(中国字) + */ + private String district = ""; + + /** + * 党支部数量 + */ + private Integer partyBranchNum = 0; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CreateOpenFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CreateOpenFormDTO.java new file mode 100644 index 0000000000..fae9e3e610 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/CreateOpenFormDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/7/13 17:36 + */ +@Data +public class CreateOpenFormDTO implements Serializable { + + private static final long serialVersionUID = 7656834022953140875L; + + private String id; + + /** + * openId 所创建的开放平台帐号的 appid + */ + private String openid; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 乐观锁 + */ + private Integer revision = 0; + + /** + * 创建者 + */ + private String createdBy = "APP_USER"; + + /** + * 修改者 + */ + private String updatedBy = "APP_USER"; + + /** + * 是否已删除(0-未删除,1-已删除) + */ + private String delFlag = "0"; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/FuncInfoFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/FuncInfoFormDTO.java new file mode 100644 index 0000000000..e8b0c182bb --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/FuncInfoFormDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/7/9 10:43 + */ +@Data +public class FuncInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 5468844633023377254L; + + /** + * 权限类别 + */ + private String funcscopeCategory; + + /** + * 权限ID + */ + private String funcscopeId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 授权方APPID + */ + private String authorizationInfoAppid; + + private Integer delFlag = 0; + + private String createdBy = "APP_USER"; + + private String updatedBy = "APP_USER"; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/GoToAuthFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/GoToAuthFormDTO.java new file mode 100644 index 0000000000..d9e9ae1790 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/GoToAuthFormDTO.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 + * @CreateTime 2020/7/13 10:30 + */ +@Data +public class GoToAuthFormDTO implements Serializable { + + private static final long serialVersionUID = 4171794043794295829L; + public interface GoToAuth extends CustomerClientShowGroup{} + + /** + * 客户端类型 resi:居民端 , work:工作端 + */ + @NotBlank(message = "客户端类型不能为空",groups = {GoToAuth.class}) + private String clientType; + + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniCategoryInfoFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniCategoryInfoFormDTO.java new file mode 100644 index 0000000000..f5fd4ab9a1 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniCategoryInfoFormDTO.java @@ -0,0 +1,60 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/7/14 15:53 + */ +@Data +public class MiniCategoryInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 9211011906485259736L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 主表ID + */ + private String primaryId; + + /** + * 类目排序 first , second + */ + private String categorySort; + + /** + * 类目名称 资讯,文娱...... + */ + private String categoryName; + + /** + * 删除状态 + */ + private Integer delFlag = 0; + + /** + * 乐观锁 + */ + private Integer revision = 0; + + /** + * 创建人 + */ + private String createdBy = "APP_USER"; + + /** + * 更新人 + */ + private String updatedBy = "APP_USER"; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniInfoFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniInfoFormDTO.java new file mode 100644 index 0000000000..072877f958 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniInfoFormDTO.java @@ -0,0 +1,76 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/7/14 15:20 + */ +@Data +public class MiniInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 2970966756786695782L; + + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImg; + + /** + * 小程序类型 默认为 0 + */ + private String serviceTypeInfo; + + /** + * 小程序认证类型 小程序认证类型 + */ + private String verifyTypeInfo; + + /** + * 原始 ID + */ + private String userName; + + /** + * 主体名称 + */ + private String principalName; + + /** + * 账号介绍 + */ + private String signature; + + /** + * 二维码图片的 URL + */ + private String qrcodeUrl; + + private Integer delFlag = 0; + + private Integer revision = 0; + + private String createdBy = "APP_USER"; + + private String updatedBy = "APP_USER"; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniNetworkInfoFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniNetworkInfoFormDTO.java new file mode 100644 index 0000000000..91a8e4f1e4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MiniNetworkInfoFormDTO.java @@ -0,0 +1,60 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/7/14 15:52 + */ +@Data +public class MiniNetworkInfoFormDTO implements Serializable { + + private static final long serialVersionUID = -2171502778870475956L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 主表ID + */ + private String primaryId; + + /** + * 类型 + */ + private String networkType; + + /** + * 域名 RequestDomain,WsRequestDomain,UploadDomain,DownloadDomain + */ + private String url; + + /** + * 删除状态 + */ + private Integer delFlag = 0; + + /** + * 乐观锁 + */ + private Integer revision = 0; + + /** + * 创建人 + */ + private String createdBy = "APP_USER"; + + /** + * 更新人 + */ + private String updatedBy = "APP_USER"; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MyInfoFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MyInfoFormDTO.java new file mode 100644 index 0000000000..052133e0df --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/MyInfoFormDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author sun + * @Description 公众号-查询我的信息-接口入参 + */ +@Data +public class MyInfoFormDTO implements Serializable { + + private static final long serialVersionUID = -6547893374373422628L; + + public interface AddUserInternalGroup { + } + + /** + * 客户Id + */ + //@NotBlank(message = "客户Id不能为空", groups = {MyInfoFormDTO.AddUserInternalGroup.class}) + private String customerId; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PaInfoFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PaInfoFormDTO.java new file mode 100644 index 0000000000..d91c84cfa3 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PaInfoFormDTO.java @@ -0,0 +1,95 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/7/14 15:27 + */ +@Data +public class PaInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 2495498009170200556L; + + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImg; + + /** + * 公众号类型 0:订阅号 + 1:由历史老帐号升级后的订阅号 + 2:服务号 + */ + private String serviceTypeInfo; + + /** + * 公众号认证类型 -1:未认证 + 0:微信认证 + 1:新浪微博认证 + 2:腾讯微博认证 + 3:已资质认证通过但还未通过名称认证 + 4:已资质认证通过、还未通过名称认证,但通过了新浪微博认证 + 5:已资质认证通过、还未通过名称认证,但通过了腾讯微博认证 + */ + private String verifyTypeInfo; + + /** + * 原始ID + */ + private String userName; + + /** + * 主体名称 + */ + private String principalName; + + /** + * 公众号所设置的微信号,可能为空 公众号所设置的微信号,可能为空 + */ + private String alias; + + /** + * 二维码图片的 URL + */ + private String qrcodeUrl; + + /** + * 删除状态 0:正常,1:删除 + */ + private Integer delFlag = 0; + + /** + * 乐观锁 + */ + private Integer revision = 0; + + /** + * 创建人 + */ + private String createdBy = "APP_USER"; + + /** + * 更新人 + */ + private String updatedBy = "APP_USER"; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PreAuthTokenFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PreAuthTokenFormDTO.java new file mode 100644 index 0000000000..532936c99d --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/PreAuthTokenFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @CreateTime 2020/7/9 9:15 + */ +@Data +public class PreAuthTokenFormDTO implements Serializable { + + private static final long serialVersionUID = 2970040842154724385L; + + /** + * 预授权码 【第三方平台方实现授权托管的必备信息,每个预授权码有效期为 10 分钟。需要先获取令牌才能调用】 + */ + private String preAuthToken; + + /** + * 预授权码有效期 单位:s 最长 60*60*2 + */ + private Date expiresInTime; + + /** + * 删除状态 0:正常 1:删除 + */ + private Integer delFlag = 0; + + /** + * 创建人 + */ + private String createdBy = "APP_USER"; + + /** + * 更新人 + */ + private String updatedBy = "APP_USER"; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/RegisterFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/RegisterFormDTO.java new file mode 100644 index 0000000000..fe16eaab4c --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/RegisterFormDTO.java @@ -0,0 +1,54 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author sun + * @Description 公众号-手机号注册-接口入参 + */ +@Data +public class RegisterFormDTO implements Serializable { + + private static final long serialVersionUID = -6547893374373422628L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空", groups = {AddUserInternalGroup.class, AddUserShowGroup.class}) + private String phone; + + /** + * 手机短信验证码 + */ + @NotBlank(message = "验证码不能为空", groups = {AddUserShowGroup.class}) + private String smsCode; + + /** + * 姓氏 + */ + @NotBlank(message = "姓氏不能为空", groups = {AddUserShowGroup.class}) + private String surName; + + /** + * 性别 1男2女0未知 + */ + @NotNull(message = "用户性别不能为空", groups = {AddUserShowGroup.class}) + private Integer gender; + + /** + * token中userId + */ + private String userId; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/RegisterInfoFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/RegisterInfoFormDTO.java new file mode 100644 index 0000000000..7b20804835 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/RegisterInfoFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author sun + * @Description 公众号-查询公众号注册的客户列表-接口入参 + */ +@Data +public class RegisterInfoFormDTO implements Serializable { + + private static final long serialVersionUID = -6547893374373422628L; + + public interface AddUserInternalGroup { + } + + /** + * 当前页 + * */ + @Min(value = 1) + private Integer pageNo = 1; + + /** + * 每页显示数量 + * */ + private Integer pageSize = 20; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SaveUserVisitedFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SaveUserVisitedFormDTO.java new file mode 100644 index 0000000000..eecf8da6d0 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SaveUserVisitedFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author sun + * @Description 公众号-用户登陆新增访问记录-接口入参 + */ +@Data +public class SaveUserVisitedFormDTO implements Serializable { + + private static final long serialVersionUID = -6547893374373422628L; + + public interface AddUserInternalGroup {} + + /** + * 登陆手机号对应的userId + */ + private String userId; + + /** + * 登陆人userId + */ + private String logonUserId; + + /** + * 登陆手机号 + */ + private String phone; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java new file mode 100644 index 0000000000..e88d58e3f9 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/SubmitAuditFormDTO.java @@ -0,0 +1,126 @@ +package com.epmet.dto.form; + +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/7/14 16:37 + */ +@Data +public class SubmitAuditFormDTO implements Serializable { + private static final long serialVersionUID = -2136272127561529025L; + /** + * 上传代码ID + */ + private String codeId; + + /** + * 小程序版本说明和功能解释 + */ + private String versionDesc; + /** + * 反馈内容,至多 200 字 + */ + private String feedbackInfo; + /** + * 用 | 分割的 media_id 列表,至多 5 张图片, 可以通过新增临时素材接口上传而得到 + */ + private String feedbackStuff; + /** + * 审核项列表(选填,至多填写 5 项) + */ + private List itemList; + /** + * 预览信息(小程序页面截图和操作录屏) + */ + private List previewInfo; + /** + * 用户生成内容场景(UGC)信息安全声明 + */ + private List ugcDeclare; + + @NoArgsConstructor + @Data + private static class ItemListBean { + /** + * 小程序的页面,可通过获取小程序的页面列表接口获得 + */ + private String address; + /** + * 小程序的标签,用空格分隔,标签至多 10 个,标签长度至多 20 + */ + private String tag; + /** + * 一级类目名称 + */ + private String firstClass; + /** + * 二级类目名称 + */ + private String secondClass; + /** + * 三级类目名称 + */ + private String thirdClass; + /** + * 一级类目的 ID + */ + private String firstId; + /** + * 二级类目的 ID + */ + private String secondId; + /** + * 三级类目的 ID + */ + private String thirdId; + /** + * 小程序页面的标题,标题长度至多 32 + */ + private String title; + } + + @NoArgsConstructor + @Data + private static class PreviewInfoBean { + /** + * 录屏mediaid列表,可以通过提审素材上传接口获得 + */ + private List videoIdList; + /** + * 截屏mediaid列表,可以通过提审素材上传接口获得 + */ + private List picIdList; + } + + @NoArgsConstructor + @Data + private static class UgcDeclareBean { + /** + * UGC场景 0,不涉及用户生成内容, 1.用户资料,2.图片,3.视频,4.文本,5其他, 可多选,当scene填0时无需填写下列字段 + */ + private List scene; + /** + * 当scene选其他时的说明,不超时256字 + */ + private String otherSceneDesc; + /** + * 内容安全机制 1.使用平台建议的内容安全API,2.使用其他的内容审核产品,3.通过人工审核把关,4.未做内容审核把关 + */ + private List method; + /** + * 是否有审核团队, 0.无,1.有,默认0 + */ + private Integer hasAuditTeam; + /** + * 说明当前对UGC内容的审核机制,不超过256字 + */ + private String auditDesc; + } +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ThirdPlatformEventFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ThirdPlatformEventFormDTO.java new file mode 100644 index 0000000000..bb1c6f2bb1 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/ThirdPlatformEventFormDTO.java @@ -0,0 +1,44 @@ +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 + * @CreateTime 2020/7/6 9:57 + */ +@Data +public class ThirdPlatformEventFormDTO implements Serializable { + + private static final long serialVersionUID = -8855993636150332559L; + + public interface ThirdPlatForm extends CustomerClientShowGroup{} + + /** + * 时间戳 + */ + @NotBlank(message = "timeStamp不能为空",groups = {ThirdPlatForm.class}) + private String timeStamp; + + /** + * 随机数 + */ + @NotBlank(message = "nonce不能为空",groups = {ThirdPlatForm.class}) + private String nonce; + + /** + * 消息体签名 + */@NotBlank(message = "msgSignature不能为空",groups = {ThirdPlatForm.class}) + + private String msgSignature; + + /** + * 消息体 + */ + @NotBlank(message = "postData不能为空",groups = {ThirdPlatForm.class}) + private String postData; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/UploadListFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/UploadListFormDTO.java new file mode 100644 index 0000000000..64f3483f55 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/UploadListFormDTO.java @@ -0,0 +1,46 @@ +package com.epmet.dto.form; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/14 15:57 + */ +@NoArgsConstructor +@Data +public class UploadListFormDTO implements Serializable { + + private static final long serialVersionUID = 5733465036099223190L; + /** + * 客户ID + */ + private String customerId; + /** + * 小程序类型 居民端resi,工作端work + */ + private String clientType; + /** + * 状态 + */ + private String status; + /** + * 开始时间 + */ + private String startTime; + /** + * 结束时间 + */ + private String endTime; + /** + * 页数 + */ + private Integer page; + /** + * 页面条数 + */ + private Integer limit; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/WeChatPlatformAuthCodeFormDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/WeChatPlatformAuthCodeFormDTO.java new file mode 100644 index 0000000000..1cd006b004 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/form/WeChatPlatformAuthCodeFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/7/7 10:28 + */ +@Data +public class WeChatPlatformAuthCodeFormDTO implements Serializable { + + private static final long serialVersionUID = -9047434066325122697L; + + /** + * 预授权码 + */ + private String authCode; + + /** + * 有效期,单位:秒 + */ + private Integer expiresIn; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AgencyLevelListResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AgencyLevelListResultDTO.java new file mode 100644 index 0000000000..6f879233f3 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AgencyLevelListResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 公众号-查询组织级别-接口返参 + */ +@Data +public class AgencyLevelListResultDTO implements Serializable { + + private static final long serialVersionUID = 3253989119352850315L; + + /** + * 机关级别(社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province) + */ + private String levelKey; + /** + * 级别对应的名称 + */ + private String levelName; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthCodeResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthCodeResultDTO.java new file mode 100644 index 0000000000..21eb773600 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthCodeResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/7/15 10:00 + */ +@Data +public class AuthCodeResultDTO implements Serializable { + + private static final long serialVersionUID = 4642988014737245076L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthorizationInfoResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthorizationInfoResultDTO.java new file mode 100644 index 0000000000..1d20dc3aac --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/AuthorizationInfoResultDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * 权限集列表 + * @Author zxc + * @CreateTime 2020/7/8 13:39 + */ +@Data +public class AuthorizationInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 3253989119352850315L; + + /** + * 授权方 appid + */ + private String authorizer_appid; + + /** + * 接口调用令牌(在授权的公众号/小程序具备 API 权限时,才有此返回值) + */ + private String authorizer_access_token; + + /** + * authorizer_access_token 的有效期(在授权的公众号/小程序具备API权限时,才有此返回值),单位:秒 + */ + private String expires_in; + + /** + * 刷新令牌(在授权的公众号具备API权限时,才有此返回值),刷新令牌主要用于第三方平台获取和刷新已授权用户的 authorizer_access_token。 + * 一旦丢失,只能让用户重新授权,才能再次拿到新的刷新令牌。用户重新授权后,之前的刷新令牌会失效 + */ + private String authorizer_refresh_token; + + /** + * 授权给开发者的权限集列表 + */ + private List func_info; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CreateAgencyResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CreateAgencyResultDTO.java new file mode 100644 index 0000000000..285b662e40 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CreateAgencyResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * @Author sun + * @Description 公众号-创建组织-接口返参 + */ +@Data +public class CreateAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 3253989119352850315L; + + /** + * 新增客户Id + */ + private String customerId; + /** + * 包含customerId的token + */ + private String token; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CreateOpenResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CreateOpenResultDTO.java new file mode 100644 index 0000000000..1a7d67e1f9 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CreateOpenResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/7/13 16:17 + */ +@Data +public class CreateOpenResultDTO implements Serializable { + + private static final long serialVersionUID = -7130231978776634403L; + + private String id; + + /** + * 所创建的开放平台帐号的 appid + */ + private String openAppId; + + /** + * 错误信息 + */ + private String errMsg; + + /** + * 返回码 + * 0:ok, + * -1:system error , 系统错误 + * 40013:invalid appid , appid 无效 + * 89000:account has bound open ,该公众号/小程序 已经绑定了开放平台帐号 + */ + private Integer errCode; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerAgencyResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerAgencyResultDTO.java new file mode 100644 index 0000000000..6b361e8c4f --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerAgencyResultDTO.java @@ -0,0 +1,65 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 公众号-查询公众号注册的客户列表-接口返参 + */ +@Data +public class CustomerAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 3253989119352850315L; + + /** + * 客户Id + */ + private String customerId = ""; + /** + * 组织Id + */ + private String agencyId = ""; + /** + * 组织名称 + */ + private String agencyName = ""; + /** + * 组织级别 + */ + private String level = ""; + /** + * 省 + */ + private String province = ""; + /** + * 市 + */ + private String city = ""; + /** + * 区 + */ + private String district = ""; + /** + * 党支部数量 + */ + private Integer partybranchnum; + /** + * 居民端授权状态(0:未授权,1:已授权) + */ + private Integer resiAuth; + /** + * 政府端授权状态(0:未授权,1:已授权) + */ + private Integer workAuth; + /** + * 政府端授权状态(0:未授权,1:已授权) + */ + private Integer initState; + /** + * 注册人手机号 + */ + private String phone; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerIdAndClientResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerIdAndClientResultDTO.java new file mode 100644 index 0000000000..a802fb5de8 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerIdAndClientResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/7/15 15:44 + */ +@Data +public class CustomerIdAndClientResultDTO implements Serializable { + + private static final long serialVersionUID = -7427184790539679353L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户端类型 + */ + private String clientType; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerUserResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerUserResultDTO.java new file mode 100644 index 0000000000..3b8d20f9e9 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/CustomerUserResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.result; + +import com.epmet.dto.PaCustomerDTO; +import com.epmet.dto.PaUserDTO; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 根据手机号查询用户信息、客户信息-接口返参 + * @Author sun + */ +@Data +public class CustomerUserResultDTO implements Serializable { + private static final long serialVersionUID = 5214475907074876716L; + + /** + * 用户信息 + */ + private PaUserDTO paUserResult; + /** + * 用户对应的客户信息 + */ + private PaCustomerDTO paCustomerResult; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/GoToAuthResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/GoToAuthResultDTO.java new file mode 100644 index 0000000000..5f2404efa8 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/GoToAuthResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/7/10 15:55 + */ +@Data +public class GoToAuthResultDTO implements Serializable { + + private static final long serialVersionUID = -8759961913652933215L; + + /** + * 第三方AppId + */ + @JsonIgnore + private String componentAppId; + + /** + * 预授权码 + */ + @JsonIgnore + private String preAuthCode; + + /** + * 回调地址【获取 授权码和过期时间】 + */ + @JsonIgnore + private String redirectUri; + + /** + * 客户ID + */ + @JsonIgnore + private String customerId; + + /** + * 反参:拼好的url,包括回调地址 + */ + private String url; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/MyInfoResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/MyInfoResultDTO.java new file mode 100644 index 0000000000..62dd3471db --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/MyInfoResultDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 公众号-查询我的信息-接口返参 + */ +@Data +public class MyInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 3253989119352850315L; + + /** + * 客户Id + */ + private String customerId = ""; + /** + * 组织名称 + */ + private String agencyName = ""; + /** + * 组织级别 + */ + private String level = ""; + /** + * 省 + */ + private String province = ""; + /** + * 市 + */ + private String city = ""; + /** + * 区 + */ + private String district = ""; + /** + * 党支部数量 + */ + private Integer partyBranchNum; + /** + * 居民端授权状态(0:未授权,1:已授权) + */ + private Integer resiAuthorization; + /** + * 政府端授权状态(0:未授权,1:已授权) + */ + private Integer workAuthorization; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/RegisterInfoResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/RegisterInfoResultDTO.java new file mode 100644 index 0000000000..64c1f03e5e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/RegisterInfoResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author sun + * @Description 公众号-查询公众号注册的客户列表-接口返参 + */ +@Data +public class RegisterInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 3253989119352850315L; + + /** + * 总记录数 + */ + private Integer total; + /** + * 客户组织列表 + */ + private List agencyList; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/ResultBean.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/ResultBean.java new file mode 100644 index 0000000000..5248dc8cb2 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/ResultBean.java @@ -0,0 +1,24 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/7/6 9:08 + */ +@Data +public class ResultBean implements Serializable { + + private static final long serialVersionUID = -1528288965079007980L; + + private Object data; + + private String msg; + + private String errorMsg; + + private Integer code; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/SaveUserResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/SaveUserResultDTO.java new file mode 100644 index 0000000000..bd2ce393a4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/SaveUserResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 授权用户信息时新增或更新用户信息-接口返参 + */ +@Data +public class SaveUserResultDTO implements Serializable { + + private static final long serialVersionUID = 3253989119352850315L; + + /** + * 新增或已有用户的Id + */ + private String userId; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateAndAppIdResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateAndAppIdResultDTO.java new file mode 100644 index 0000000000..96dc655981 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateAndAppIdResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/7/15 15:56 + */ +@Data +public class TemplateAndAppIdResultDTO implements Serializable { + + private static final long serialVersionUID = -3875904833509300177L; + + /** + * 模板ID + */ + private String templateId; + + /** + * 授权方AppId + */ + private String authAppId; + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateListResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateListResultDTO.java new file mode 100644 index 0000000000..083ca650d9 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/TemplateListResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/14 15:22 + */ +@NoArgsConstructor +@Data +public class TemplateListResultDTO implements Serializable { + + private static final long serialVersionUID = -5545336708096791516L; + /** + * 模板 id + */ + private String templateId; + /** + * 模板描述 + */ + private String userDesc; + /** + * 模板版本号 + */ + private String userVersion; + /** + * 模板创建时间yyyy-mm-dd + */ + private String createTime; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/UploadListResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/UploadListResultDTO.java new file mode 100644 index 0000000000..82d88b084a --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/UploadListResultDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/14 16:20 + */ +@NoArgsConstructor +@Data +public class UploadListResultDTO implements Serializable { + + private static final long serialVersionUID = -8110308954072076978L; + /** + * 代码ID + */ + private String id; + /** + * 客户名 + */ + private String customerId; + /** + * 客户名 + */ + private String customerName; + /** + * 居民端resi 工作端work + */ + private String clientType; + /** + * 代码描述 + */ + private String codeInfo; + /** + * 版本号 + */ + private String version; + /** + * 状态 未审核:unaudited,审核中:auditing,审核成功audit_success,审核被拒绝audit_failed,已撤回:withdrawn,审核延后:delay,发布成功release_success, 发布失败release_failed + */ + private String status; + /** + * 上传时间 + */ + private String uploadTime; + /** + * 审核ID + */ + private String auditId; + /** + * 小程序APP ID + */ + private String appId; + /** + * 提交审核时间 + */ + private String auditTime; +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/WillOverDueResultDTO.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/WillOverDueResultDTO.java new file mode 100644 index 0000000000..666c73ff15 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/dto/result/WillOverDueResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/7/9 17:01 + */ +@Data +public class WillOverDueResultDTO implements Serializable { + + private static final long serialVersionUID = -9073227815312384742L; + + /** + * 授权方令牌 + */ + private String authorizerAccessToken; + + /** + * 刷新令牌 + */ + private String authorizerRefreshToken; + + /** + * 授权方AppId + */ + private String authAppId; + + /** + * 客户Id + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdFeignClient.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdFeignClient.java new file mode 100644 index 0000000000..4b038324ac --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/EpmetThirdFeignClient.java @@ -0,0 +1,52 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.SaveUserVisitedFormDTO; +import com.epmet.dto.result.CustomerUserResultDTO; +import com.epmet.dto.result.SaveUserResultDTO; +import com.epmet.feign.fallback.EpmetThirdFeignClientFallback; +import me.chanjar.weixin.mp.bean.result.WxMpUser; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.http.MediaType; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; + +/** + * 本服务对外开放的API,其他服务通过引用此client调用该服务 + * + * @Author zxc + * @CreateTime 2020/7/5 14:45 + */ +@FeignClient(name = ServiceConstant.EPMET_THIRD_SERVER, fallback = EpmetThirdFeignClientFallback.class) + +public interface EpmetThirdFeignClient { + + /** + * @param wxMpUser + * @return + * @Author sun + * @Description 根据openId新增或更新用户信息 + **/ + @PostMapping(value = "third/pauser/saveuser", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result saveUser(@RequestBody WxMpUser wxMpUser); + + /** + * @param phone + * @return + * @Author sun + * @Description 根据手机号查询公众号用户基本信息,校验用户是否存在 + **/ + @PostMapping(value = "third/pauser/checkpauser/{phone}") + Result checkPaUser(@PathVariable("phone") String phone); + + /** + * @param visited + * @return + * @Author sun + * @Description 用户登陆,新增访问记录数据 + **/ + @PostMapping(value = "third/pauservisited/saveuservisited") + Result saveUserVisited(@RequestBody SaveUserVisitedFormDTO visited); +} diff --git a/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdFeignClientFallback.java b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdFeignClientFallback.java new file mode 100644 index 0000000000..b1965cad5a --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-client/src/main/java/com/epmet/feign/fallback/EpmetThirdFeignClientFallback.java @@ -0,0 +1,34 @@ +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.SaveUserVisitedFormDTO; +import com.epmet.dto.result.CustomerUserResultDTO; +import com.epmet.dto.result.SaveUserResultDTO; +import com.epmet.feign.EpmetThirdFeignClient; +import me.chanjar.weixin.mp.bean.result.WxMpUser; +import org.springframework.stereotype.Component; + +/** + * @Author zxc + * @CreateTime 2020/7/5 14:46 + */ +@Component +public class EpmetThirdFeignClientFallback implements EpmetThirdFeignClient { + + @Override + public Result saveUser(WxMpUser wxMpUser) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "saveUser", wxMpUser); + } + + @Override + public Result checkPaUser(String phone) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "checkPaUser", phone); + } + + @Override + public Result saveUserVisited(SaveUserVisitedFormDTO visited) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_THIRD_SERVER, "saveUserVisited", visited); + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/.gitignore b/epmet-module/epmet-third/epmet-third-server/.gitignore new file mode 100644 index 0000000000..a2a3040aa8 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/.gitignore @@ -0,0 +1,31 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/** +!**/src/test/** + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ + +### VS Code ### +.vscode/ diff --git a/epmet-module/epmet-third/epmet-third-server/Dockerfile b/epmet-module/epmet-third/epmet-third-server/Dockerfile new file mode 100644 index 0000000000..d0fef3d421 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-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 8110 + +ENTRYPOINT ["sh", "-c", "$RUN_INSTRUCT"] \ No newline at end of file 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 new file mode 100644 index 0000000000..58e0013a0e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-dev.yml @@ -0,0 +1,17 @@ +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.13 + ports: + - "8110:8110" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/dev:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml new file mode 100644 index 0000000000..9cf4fac4ef --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-prod.yml @@ -0,0 +1,17 @@ +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.14 + ports: + - "8110:8110" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/prod:/logs" + environment: + RUN_INSTRUCT: "java -Xms256m -Xmx512m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 600M \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml new file mode 100644 index 0000000000..1b21690631 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/deploy/docker-compose-test.yml @@ -0,0 +1,17 @@ +version: "3.7" +services: + epmet-third-server: + container_name: epmet-third-server-test + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-third-server:0.0.13 + ports: + - "8110:8110" + network_mode: host # 使用现有网络 + volumes: + - "/opt/epmet-cloud-logs/test:/logs" + environment: + RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + deploy: + resources: + limits: + cpus: '0.1' + memory: 250M \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/pom.xml b/epmet-module/epmet-third/epmet-third-server/pom.xml new file mode 100644 index 0000000000..3312989042 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/pom.xml @@ -0,0 +1,263 @@ + + + 4.0.0 + 0.0.14 + + + com.epmet + epmet-third + 2.0.0 + + + epmet-third-server + jar + + + 3.2.2 + 1.1.0 + 1.0.5 + 2.3.28 + + + + + com.epmet + epmet-third-client + 2.0.0 + + + com.epmet + epmet-commons-tools + 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 + + + com.epmet + epmet-common-clienttoken + 2.0.0 + compile + + + com.epmet + oper-crm-client + 2.0.0 + compile + + + + + ${project.artifactId} + + + org.springframework.boot + spring-boot-maven-plugin + + + org.apache.maven.plugins + maven-surefire-plugin + + true + + + + ${project.basedir}/src/main/java + + + true + ${basedir}/src/main/resources + + + + + + dev + + true + + + 8110 + dev + + + + + + epmet_third_user + EpmEt-db-UsEr + + 0 + 192.168.1.130 + 6379 + 123456 + + true + 122.152.200.70:8848 + fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b + + + false + + + false + + + + test + + + 8110 + 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 + + + 8110 + 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-third/epmet-third-server/src/main/java/com/epmet/EpmetThirdApplication.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/EpmetThirdApplication.java new file mode 100644 index 0000000000..2aba843b3f --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/EpmetThirdApplication.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 EpmetThirdApplication { + + public static void main(String[] args) { + SpringApplication.run(EpmetThirdApplication.class, args); + } + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..49581cf63c --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.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.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/epmet-third/epmet-third-server/src/main/java/com/epmet/config/ModuleConfigImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/config/ModuleConfigImpl.java new file mode 100644 index 0000000000..fc8136796e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-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 "epmetthird"; + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/CodeConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/CodeConstant.java new file mode 100644 index 0000000000..6089c8b936 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/CodeConstant.java @@ -0,0 +1,49 @@ +package com.epmet.constant; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/15 14:39 + */ +public interface CodeConstant { + /** + * 居民端 + */ + String RESI = "resi"; + /** + * 工作端 + */ + String WORK = "work"; + /** + * 未审核 + */ + String UNAUDITED = "unaudited"; + /** + * 审核中 + */ + String AUDITING = "auditing"; + /** + * 审核成功 + */ + String AUDIT_SUCCESS = "audit_success"; + /** + * 审核被拒绝 + */ + String AUDIT_FAILED = "audit_failed"; + /** + * 已撤回 + */ + String WITHDRAWN = "withdrawn"; + /** + * 审核延后 + */ + String DELAY = "delay"; + /** + * 发布成功 + */ + String RELEASE_SUCCESS = "release_success"; + /** + * 发布失败 + */ + String RELEASE_FAILED = "release_failed"; +} 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 new file mode 100644 index 0000000000..dce046fc84 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ModuleConstant.java @@ -0,0 +1,83 @@ +package com.epmet.constant; + +/** + * @Description + * @author zxc + */ +public interface ModuleConstant { + + String FUNC_INFO = "func_info"; + + //获得授权事件的票据 如下 + String UTF8 = "UTF-8"; + String MSG_SIGNATURE = "msg_signature"; + String TIMESTAMP = "timestamp"; + String NONCE = "nonce"; + String INFO_TYPE = "InfoType"; + String TICKET_UNDERLINE_KEY = "component_verify_ticket"; + String TICKET_KEY = "ComponentVerifyTicket"; + String APP_ID = "AppId"; + String AUTHORIZATION_CODE_HUMP = "AuthorizationCode"; + String UNAUTHORIZED = "unauthorized"; + String AUTHORIZED = "authorized"; + String NULL_CHAR = ""; + String SUCCESS = "success"; + String AUTHORIZER_APP_ID_HUMP = "AuthorizerAppid"; + + // 获取 component_access_token 如下 + String COMPONENT_APPID = "component_appid"; + String COMPONENT_APPSECRET = "component_appsecret"; + String COMPONENT_ACCESS_TOKEN = "component_access_token"; + String EXPIRES_IN = "expires_in"; + + //获取预授权码 如下 + String PRE_AUTH_CODE = "pre_auth_code"; + + //使用授权码获取授权信息 如下 + String AUTHORIZATION_CODE = "authorization_code"; + String AUTHORIZATION_INFO = "authorization_info"; + + //获取/刷新接口调用令牌 如下 + String AUTHORIZER_APPID = "authorizer_appid"; + String AUTHORIZER_REFRESH_TOKEN = "authorizer_refresh_token"; + String AUTHORIZER_ACCESS_TOKEN = "authorizer_access_token"; + + //授权回调URL 如下 + String AUTH_CODE = "auth_code"; + String ERR_CODE = "errcode"; + String ERR_MSG = "errmsg"; + String OPEN_APP_ID = "open_appid"; + String LOW_APP_ID = "appid"; + + String CUSTOMER_ID = "customerId"; + String CLIENT = "client"; + + //创建开放平台账号 + String ACCESS_TOKEN = "access_token"; + + //获取并保存授权方账号基本信息 如下 + String COMPONENT_APP_ID = "component_appid"; + String AUTHORIZER_APP_ID = "authorizer_appid"; + String AUTHORIZER_INFO = "authorizer_info"; + String MINI_PROGRAM_INFO = "miniprograminfo"; + String BUSINESS_INFO = "business_info"; + String CATEGORIES = "categories"; + String NETWORK = "network"; + + //代码审核结果推送 如下 + String EVENT = "Event"; + String WEAPP_AUDIT_SUCCESS = "weapp_audit_success"; //审核通过 + String WEAPP_AUDIT_FAIL = "weapp_audit_fail"; //审核不通过 + String WEAPP_AUDIT_DELAY = "weapp_audit_delay"; //审核延后 + String DELAY = "delay"; + String AUDIT_SUCCESS = "audit_success"; + String AUDIT_FAILED = "audit_failed"; + + int FORTY_THOUSAND_AND_THIRTEEN = 40013; + int EIGHTY_NINE_THOUSAND = 89000; + int EIGHTY_NINE_THOUSAND_AND_ONE = 89001; + int EIGHTY_NINE_THOUSAND_AND_THREE = 89003; + int EIGHTY_NINE_THOUSAND_AND_FOUR = 89004; + + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/PaConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/PaConstant.java new file mode 100644 index 0000000000..9f43dface4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/PaConstant.java @@ -0,0 +1,63 @@ +package com.epmet.constant; + +/** + * @Description 公众号-常量 + * @author sun + */ +public interface PaConstant { + + /** + * 手机号注册 + */ + String PHONE_EXCEPTION = "手机号已存在,不允许再次注册"; + /** + * 更新用户信息失败 + */ + String UPDATE_USER_EXCEPTION = "更新用户信息失败"; + /** + * 根据userId查询pa_user_wechat表失败 + */ + String SELECT_WECHAT_EXCEPTION = "获取用户微信信息失败"; + /** + * 保存用户访问记录数据失败 + */ + String SAVE_VISITED_EXCEPTION = "保存用户访问记录数据失败"; + + /** + * 组织级别对应的key、name + */ + String PROVINCE_KEY = "province"; + String PROVINCE_NAME = "省级"; + String CITY_KEY = "city"; + String CITY_NAME = "区县级"; + String STREET_KEY = "street"; + String STREET_NAME = "乡(镇、街道)级"; + String COMMUNITY_KEY = "community"; + String COMMUNITY_NAME = "社区级"; + + /** + * 客户小程序关系表小程序所属端 + */ + String RESI_CLIENT = "resi"; + String WORK_CLIENT = "work"; + + /** + * 查询客户组织信息失败 + */ + String SELECT_AGENCY_EXCEPTION = "获取客户组织信息失败"; + /** + * 查询客户小程序授权信息失败 + */ + String CUSTOMER_MP_EXCEPTION = "获取客户小程序授权信息失败"; + + /** + * 客户小程序所属端key值 + */ + String CLIENT_RESI = "resi"; + String CLIENT_WORK = "work"; + + /** + * 获取缓存中token信息失败 + */ + String TOKEN_EXCEPTION = "token已过期"; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/TencentAuthTypeConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/TencentAuthTypeConstant.java new file mode 100644 index 0000000000..080b993fae --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/TencentAuthTypeConstant.java @@ -0,0 +1,33 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @CreateTime 2020/7/13 9:08 + */ +public interface TencentAuthTypeConstant { + + /** + * 公众号认证类型 + */ + String AUTH_MINUS_ONE = "未认证"; + String AUTH_ZERO = "微信认证"; + String AUTH_ONE = "新浪微博认证"; + String AUTH_TWO = "腾讯微博认证"; + String AUTH_THREE = "已资质认证通过但还未通过名称认证"; + String AUTH_FOUR = "已资质认证通过、还未通过名称认证,但通过了新浪微博认证"; + String AUTH_FIVE = "已资质认证通过、还未通过名称认证,但通过了腾讯微博认证"; + + /** + * 公众号类型 + */ + String ZERO = "订阅号"; + String ONE = "由历史老帐号升级后的订阅号"; + String TWO = "服务号"; + + /** + * 小程序认证类型 + */ + String MINI_AUTH_MINUS_ONE = "未认证"; + String MINI_AUTH_ZERO = "微信认证"; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdApiConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdApiConstant.java new file mode 100644 index 0000000000..5b05154cbc --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdApiConstant.java @@ -0,0 +1,59 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @CreateTime 2020/7/8 17:59 + */ +public interface ThirdApiConstant { + + /** + * 获取预授权码 + */ + String API_CREATE_PREAUTHCODE_URL = "https://api.weixin.qq.com/cgi-bin/component/api_create_preauthcode"; + + /** + * 使用授权码获取授权信息请求地址 + */ + String API_QUERY_AUTH_URL = "https://api.weixin.qq.com/cgi-bin/component/api_query_auth"; + + /** + * 获取令牌请求地址 + */ + String API_COMPONENT_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/component/api_component_token"; + + String API_AUTHORIZER_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/component/api_authorizer_token"; + + /** + * 授权回调url + */ + String API_REDIRECT_URL = "https://epmet-dev.elinkservice.cn/api/third/redirectauthcode"; + + /** + * 反参授权回调url + */ + String API_RETURN_REDIRECT_URL = "https://epmet-dev.elinkservice.cn/api/third/redirectauthcode?client=%s&customerId=%s"; + + /** + * 授权注册页面扫码授权 + * component_appid:第三方AppId + * pre_auth_code:预授权码 + * redirect_uri:回调url(获取授权码) + */ + String API_AUTH_REGISTER_URL = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?component_appid=%s&pre_auth_code=%s&redirect_uri=%s"; + + /** + * 创建开放平台帐号并绑定公众号/小程序 + */ + String API_CREATE_OPEN = "https://api.weixin.qq.com/cgi-bin/open/create"; + + /** + * 公众号/小程序绑定到开放平台帐号下 + */ + String API_BIND_OPEN = "https://api.weixin.qq.com/cgi-bin/open/bind?"; + + /** + * 获取授权方的帐号基本信息 + */ + String API_GET_AUTHORIZER_INFO = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_info"; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdPlatformConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdPlatformConstant.java new file mode 100644 index 0000000000..e86eafb02d --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdPlatformConstant.java @@ -0,0 +1,29 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @CreateTime 2020/7/6 9:48 + */ +public interface ThirdPlatformConstant { + + /** + * 第三方平台appId + */ +// String PLATFORM_APP_ID = "****************"; + + /** + * 第三方平台 secret + */ +// String PLATFORM_APP_SECRET = "****************"; + + /** + * 第三方平台 消息加解密Key + */ + String PLATFORM_AES_KEY = "****************"; + + /** + * 第三方平台 消息校验Token + */ +// String PLATFORM_COMPONENT_TOKEN = "****************"; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdRedisKeyConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdRedisKeyConstant.java new file mode 100644 index 0000000000..43e1e19f52 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdRedisKeyConstant.java @@ -0,0 +1,50 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @CreateTime 2020/7/8 18:16 + */ +public interface ThirdRedisKeyConstant { + + /** + * : + */ + String COLON = ":"; + + /** + * component_verify_ticket 【令牌】目录 + */ + String TICKET_REDIS_KEY = "epmet:wechartthird:componentverifyticket"; + + /** + * pre_auth_code 预授权码 + */ + String PRE_AUTH_CODE_REDIS_KEY = "epmet:wechartthird:preauthcode"; + + /** + * component_access_token + */ + String ACCESS_TOKEN_REDIS_KEY = "epmet:wechartthird:componentaccesstoken"; + + /** + * authorizer_refresh_token 刷新令牌,获取授权信息时得到 第三方和微信交互使用的 + */ + String THIRD_AUTHORIZER_REFRESH_TOKEN_REDIS_KEY = "epmet:wechartthird:thirdauthorizerrefreshtoken"; + + /** + * 第三方 和 授权方交互使用的 + */ + String AUTHORIZER_REFRESH_TOKEN_REDIS_KEY = "epmet:wechartthird:authorizerrefreshtoken"; + + /** + * auth_code 授权码 + */ + String AUTH_CODE_REDIS_KEY = "epmet:wechartthird:authcode"; + + /** + * authorization_info 授权信息 + */ + String AUTH_INFO_REDIS_KEY = "epmet:wechartthird:authinfo"; + + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdRunTimeInfoConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdRunTimeInfoConstant.java new file mode 100644 index 0000000000..2e0448a712 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/constant/ThirdRunTimeInfoConstant.java @@ -0,0 +1,83 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @CreateTime 2020/7/10 9:27 + */ +public interface ThirdRunTimeInfoConstant { + + String AUTH_TICKET = "====================授权票据【ComponentVerifyTicket】:【%s】===================="; + + String ERROR_TICKET = "微信开放平台,第三方平台获取【验证票据】失败"; + + String END_TICKET = "==============================结束授权事件接收URL================================="; + + String START_RECEIVE = "==============================开始授权事件接收URL================================="; + + String URL_TICKET = "授权事件接收URL,验证票据"; + + String SUCCESS_TICKET = "第三方平台授权事件接收URL,验证票据成功"; + + String ERROR_URL_TICKET = "第三方平台授权事件接收URL,验证票据异常"; + + String SUCCESS_ACCESS_TOKEN = "====================结束执行定时任务获取令牌【component_access_token】===================="; + + String FAILURE_ACCESS_TOKEN = "微信开放平台,第三方平台获取【令牌】失败"; + + String ENCRYPT = "Encrypt:%s"; + + String MSG = "msg:%s"; + + String START_GET_COMPONENT_ACCESS_TOKEN = "====================开始执行定时任务获取令牌【component_access_token】===================="; + + String START_DELETE_COMPONENT_ACCESS_TOKEN = "====================开始逻辑删除【component_access_token】===================="; + + String START_GET_PRE_AUTH_CODE = "====================开始执行定时任务获取预授权码【pre_auth_code】===================="; + + String POST_RESULT = "====================返回post结果:%s"; + + String FAILURE_GET_PRE_AUTH_CODE = "微信开放平台,第三方平台获取【预授权码】失败"; + + String END_GET_PRE_AUTH_CODE = "====================结束获取预授权码【pre_auth_code】===================="; + + String START_GET_AUTH_INFO = "=====================开始获取【authorization_info】====================="; + + String START_INSERT_FUNC_INFO = "================================开始插入【func_info】===================================="; + + String END_GET_AUTH_INFO = "=====================结束获取【authorization_info】====================="; + + String CREATE_AND_BIND_SUCCESS = "创建开放平台帐号并绑定公众号/小程序"; + + String BIND_SUCCESS = "绑定公众号/小程序到开放平台"; + + /** + * 对应错误码:-1 + */ + String SYSTEM_ERROR = "系统错误"; + + /** + * 对应错误码:40013 + */ + String INVALID_APP_ID = "appId 或 openAppId 无效"; + + /** + * 对应错误码:89000 + */ + String ACCOUNT_HAS_BOUND_OPEN = "该公众号/小程序 已经绑定了开放平台帐号"; + + /** + * 对应错误码:89001 + */ + String NOT_SAME_CONTRACTOR = "Authorizer 与开放平台帐号主体不相同"; + + /** + * 对应错误码:89003 + */ + String NOT_ALLOWED_OPERATE = "该开放平台帐号并非通过 api 创建,不允许操作"; + + /** + * 对应错误码:89004 + */ + String TO_LIMIT = "该开放平台帐号所绑定的公众号/小程序已达上限(100 个)"; + +} 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 new file mode 100644 index 0000000000..45c8a65cb4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AppLetAuthorizationController.java @@ -0,0 +1,39 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.GoToAuthFormDTO; +import com.epmet.dto.result.GoToAuthResultDTO; +import com.epmet.service.AppLetAuthorizationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @Author zxc + * @CreateTime 2020/7/10 15:48 + */ +@RestController +@RequestMapping("auth") +public class AppLetAuthorizationController { + + @Autowired + private AppLetAuthorizationService appLetAuthorizationService; + + /** + * @Description 小程序点击“去授权”的时候 + * @param tokenDto + * @author zxc + */ + @PostMapping("gotoauth") + public Result goToAuth(@LoginUser TokenDto tokenDto, @RequestBody GoToAuthFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + GoToAuthResultDTO goToAuthResultDTO = appLetAuthorizationService.goToAuth(tokenDto,formDTO); + return new Result().ok(goToAuthResultDTO); + } + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AuthRedirectController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AuthRedirectController.java new file mode 100644 index 0000000000..b1b89e380d --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/AuthRedirectController.java @@ -0,0 +1,35 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.ComponentVerifyTicketService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * @Author zxc + * @CreateTime 2020/7/10 9:04 + */ +@RestController +@RequestMapping("redirectauthcode") +public class AuthRedirectController { + + @Autowired + private ComponentVerifyTicketService componentVerifyTicketService; + + /** + * @Description 授权回调URL + * @param + * @author zxc + */ + @GetMapping("redirect") + public Result redirectUri(HttpServletRequest request, HttpServletResponse response){ + componentVerifyTicketService.redirectUri(request,response); + return new Result(); + } + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeAuditResultController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeAuditResultController.java new file mode 100644 index 0000000000..a0524c1b48 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeAuditResultController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CodeAuditResultDTO; +import com.epmet.service.CodeAuditResultService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + + +/** + * 代码审核j结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@RestController +@RequestMapping("codeauditresult") +public class CodeAuditResultController { + + @Autowired + private CodeAuditResultService codeAuditResultService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = codeAuditResultService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CodeAuditResultDTO data = codeAuditResultService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CodeAuditResultDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + codeAuditResultService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CodeAuditResultDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + codeAuditResultService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + codeAuditResultService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java new file mode 100644 index 0000000000..59eef94f35 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeController.java @@ -0,0 +1,85 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CodeCommonFormDTO; +import com.epmet.dto.form.CodeUploadFormDTO; +import com.epmet.dto.form.SubmitAuditFormDTO; +import com.epmet.dto.form.UploadListFormDTO; +import com.epmet.dto.result.TemplateListResultDTO; +import com.epmet.dto.result.UploadListResultDTO; +import oracle.jdbc.proxy.annotation.Post; +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 zhaoqifeng + * @dscription 代码管理 + * @date 2020/7/9 11:02 + */ +@RestController +@RequestMapping("code") +public class CodeController { + + /** + * 获取代码模板列表 + * @author zhaoqifeng + * @date 2020/7/14 15:10 + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("templatelist") + public Result> templateList() { + return null; + } + + /** + * 代码上传 + * @author zhaoqifeng + * @date 2020/7/9 14:23 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("upload") + public Result upload(@RequestBody CodeUploadFormDTO formDTO) { + return new Result<>(); + } + + /** + * 已上传代码列表 + * @author zhaoqifeng + * @date 2020/7/14 16:30 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("uploadlist") + public Result> uploadList(@RequestBody UploadListFormDTO formDTO) { + return new Result<>(); + } + + /** + * 提交审核 + * @author zhaoqifeng + * @date 2020/7/14 16:40 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("audit") + public Result submitAudit(@RequestBody SubmitAuditFormDTO formDTO) { + return new Result<>(); + } + + /** + * 审核撤回 + * @author zhaoqifeng + * @date 2020/7/14 17:52 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("undo") + public Result undo(@RequestBody CodeCommonFormDTO formDTO) { + return new Result<>(); + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeCustomerController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeCustomerController.java new file mode 100644 index 0000000000..d4a193821c --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeCustomerController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CodeCustomerDTO; +import com.epmet.service.CodeCustomerService; +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-07-09 + */ +@RestController +@RequestMapping("codecustomer") +public class CodeCustomerController { + + @Autowired + private CodeCustomerService codeCustomerService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = codeCustomerService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CodeCustomerDTO data = codeCustomerService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CodeCustomerDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + codeCustomerService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CodeCustomerDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + codeCustomerService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + codeCustomerService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeMediaController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeMediaController.java new file mode 100644 index 0000000000..c8ad829979 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CodeMediaController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CodeMediaDTO; +import com.epmet.service.CodeMediaService; +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-07-09 + */ +@RestController +@RequestMapping("codemedia") +public class CodeMediaController { + + @Autowired + private CodeMediaService codeMediaService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = codeMediaService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CodeMediaDTO data = codeMediaService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CodeMediaDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + codeMediaService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CodeMediaDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + codeMediaService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + codeMediaService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/ComponentVerifyTicketController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/ComponentVerifyTicketController.java new file mode 100644 index 0000000000..4a2a6791f5 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/ComponentVerifyTicketController.java @@ -0,0 +1,32 @@ +package com.epmet.controller; + +import com.epmet.service.ComponentVerifyTicketService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + + +/** + * @Author zxc + * @CreateTime 2020/7/6 9:07 + */ +@Slf4j +@RestController +@RequestMapping("verifyticket") +public class ComponentVerifyTicketController { + + @Autowired + private ComponentVerifyTicketService componentVerifyTicketService; + + /** + * @Description 获取验证票据3 + * @author zxc + */ + @PostMapping(value = "/callback") + public String componentVerifyTicket(HttpServletRequest request, HttpServletResponse response) { + return componentVerifyTicketService.componentVerifyTicket(request,response); + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CustomerCodeOperationHistoryController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CustomerCodeOperationHistoryController.java new file mode 100644 index 0000000000..a764889ed6 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CustomerCodeOperationHistoryController.java @@ -0,0 +1,84 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.CustomerCodeOperationHistoryDTO; +import com.epmet.service.CustomerCodeOperationHistoryService; +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-07-09 + */ +@RestController +@RequestMapping("customercodeoperationhistory") +public class CustomerCodeOperationHistoryController { + + @Autowired + private CustomerCodeOperationHistoryService customerCodeOperationHistoryService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerCodeOperationHistoryService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerCodeOperationHistoryDTO data = customerCodeOperationHistoryService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerCodeOperationHistoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerCodeOperationHistoryService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerCodeOperationHistoryDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerCodeOperationHistoryService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerCodeOperationHistoryService.delete(ids); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CustomerMpController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CustomerMpController.java new file mode 100644 index 0000000000..fc1cfafafb --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/CustomerMpController.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.CustomerMpDTO; +import com.epmet.excel.CustomerMpExcel; +import com.epmet.service.CustomerMpService; +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-07-09 + */ +@RestController +@RequestMapping("customermp") +public class CustomerMpController { + + @Autowired + private CustomerMpService customerMpService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerMpService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + CustomerMpDTO data = customerMpService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody CustomerMpDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + customerMpService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody CustomerMpDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerMpService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerMpService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerMpService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerMpExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaCustomerAgencyController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaCustomerAgencyController.java new file mode 100644 index 0000000000..f459d78524 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaCustomerAgencyController.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.PaCustomerAgencyDTO; +import com.epmet.excel.PaCustomerAgencyExcel; +import com.epmet.service.PaCustomerAgencyService; +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-07-09 + */ +@RestController +@RequestMapping("pacustomeragency") +public class PaCustomerAgencyController { + + @Autowired + private PaCustomerAgencyService paCustomerAgencyService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = paCustomerAgencyService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + PaCustomerAgencyDTO data = paCustomerAgencyService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody PaCustomerAgencyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + paCustomerAgencyService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody PaCustomerAgencyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + paCustomerAgencyService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + paCustomerAgencyService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = paCustomerAgencyService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PaCustomerAgencyExcel.class); + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..60962bd6a0 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaCustomerController.java @@ -0,0 +1,108 @@ +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.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.dto.form.CreateAgencyFormDTO; +import com.epmet.dto.form.MyInfoFormDTO; +import com.epmet.dto.form.RegisterFormDTO; +import com.epmet.dto.form.RegisterInfoFormDTO; +import com.epmet.dto.result.AgencyLevelListResultDTO; +import com.epmet.dto.result.CreateAgencyResultDTO; +import com.epmet.dto.result.MyInfoResultDTO; +import com.epmet.service.*; +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/7/8 17:18 + */ +@RestController +@RequestMapping("pacustomer") +public class PaCustomerController { + + @Autowired + private PaUserService paUserService; + @Autowired + private PaCustomerService paCustomerService; + @Autowired + private PaCustomerAgencyService paCustomerAgencyService; + @Autowired + private PaCustomerUserAgencyService paCustomerUserAgencyService; + @Autowired + private CustomerMpService customerMpService; + + /** + * @param formDTO + * @return + * @Author sun + * @Description 公众号-手机号注册 + **/ + @PostMapping("register") + public Result register(@LoginUser TokenDto tokenDTO, @RequestBody RegisterFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, RegisterFormDTO.AddUserInternalGroup.class, RegisterFormDTO.AddUserShowGroup.class); + formDTO.setUserId(tokenDTO.getUserId()); + paCustomerService.register(formDTO); + return new Result(); + } + + /** + * @return + * @Author sun + * @Description 公众号-查询组织级别 + **/ + @PostMapping("agencylevellist") + public Result> agencyLevelList() { + return new Result>().ok(paCustomerService.agencyLevelList()); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 公众号-创建组织 + **/ + @PostMapping("createagency") + public Result createAgency(@LoginUser TokenDto tokenDTO, @RequestBody CreateAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, DefaultGroup.class); + return new Result().ok(paCustomerService.createAgency(tokenDTO, formDTO)); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 公众号-查询我的信息 + **/ + @PostMapping("myinfo") + public Result myInfo(@LoginUser TokenDto tokenDTO, @RequestBody MyInfoFormDTO formDTO) { + //ValidatorUtils.validateEntity(formDTO, MyInfoFormDTO.AddUserInternalGroup.class); + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(paCustomerService.myInfo(tokenDTO, formDTO)); + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 查询公众号注册的客户信息列表 + **/ + @PostMapping("registerinfo") + public Result registerInfo(@LoginUser TokenDto tokenDTO, @RequestBody RegisterInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(paCustomerService.registerInfo(formDTO)); + } + + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaCustomerUserAgencyController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaCustomerUserAgencyController.java new file mode 100644 index 0000000000..9906427507 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaCustomerUserAgencyController.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.PaCustomerUserAgencyDTO; +import com.epmet.excel.PaCustomerUserAgencyExcel; +import com.epmet.service.PaCustomerUserAgencyService; +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-07-09 + */ +@RestController +@RequestMapping("pacustomeruseragency") +public class PaCustomerUserAgencyController { + + @Autowired + private PaCustomerUserAgencyService paCustomerUserAgencyService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = paCustomerUserAgencyService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + PaCustomerUserAgencyDTO data = paCustomerUserAgencyService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody PaCustomerUserAgencyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + paCustomerUserAgencyService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody PaCustomerUserAgencyDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + paCustomerUserAgencyService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + paCustomerUserAgencyService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = paCustomerUserAgencyService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PaCustomerUserAgencyExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaUserController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaUserController.java new file mode 100644 index 0000000000..d7c07bc506 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaUserController.java @@ -0,0 +1,119 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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.PaUserDTO; +import com.epmet.dto.result.CustomerUserResultDTO; +import com.epmet.dto.result.SaveUserResultDTO; +import com.epmet.excel.PaUserExcel; +import com.epmet.service.PaUserService; +import me.chanjar.weixin.mp.bean.result.WxMpUser; +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-07-09 + */ +@RestController +@RequestMapping("pauser") +public class PaUserController { + + @Autowired + private PaUserService paUserService; + + @GetMapping("page") + public Result> page(@RequestParam Map params) { + PageData page = paUserService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id) { + PaUserDTO data = paUserService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody PaUserDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + paUserService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody PaUserDTO dto) { + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + paUserService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids) { + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + paUserService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = paUserService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PaUserExcel.class); + } + + /** + * @param wxMpUser + * @return + * @Author sun + * @Description 根据openId新增或更新用户信息 + **/ + @PostMapping(value = "/saveuser") + public Result saveUser(@RequestBody WxMpUser wxMpUser) { + return new Result().ok(paUserService.saveUser(wxMpUser)); + } + + /** + * @param phone + * @return + * @Author sun + * @Description 根据手机号查询公众号用户基本信息,校验用户是否存在 + **/ + @PostMapping(value = "/checkpauser/{phone}") + public Result checkPaUser(@PathVariable("phone") String phone) { + return new Result().ok(paUserService.checkPaUser(phone)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaUserVisitedController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaUserVisitedController.java new file mode 100644 index 0000000000..16f5caab3a --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaUserVisitedController.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.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.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.PaUserVisitedDTO; +import com.epmet.dto.form.SaveUserVisitedFormDTO; +import com.epmet.excel.PaUserVisitedExcel; +import com.epmet.service.PaUserVisitedService; +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-07-09 + */ +@RestController +@RequestMapping("pauservisited") +public class PaUserVisitedController { + + @Autowired + private PaUserVisitedService paUserVisitedService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = paUserVisitedService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + PaUserVisitedDTO data = paUserVisitedService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody PaUserVisitedDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + paUserVisitedService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody PaUserVisitedDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + paUserVisitedService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + paUserVisitedService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = paUserVisitedService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PaUserVisitedExcel.class); + } + + /** + * @param visited + * @return + * @Author sun + * @Description 用户登陆,新增访问记录数据 + **/ + @PostMapping(value = "/saveuservisited") + public Result saveUserVisited(@RequestBody SaveUserVisitedFormDTO visited) { + paUserVisitedService.saveUserVisited(visited); + return new Result(); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaUserWechatController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaUserWechatController.java new file mode 100644 index 0000000000..6a44a17cf7 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PaUserWechatController.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.PaUserWechatDTO; +import com.epmet.excel.PaUserWechatExcel; +import com.epmet.service.PaUserWechatService; +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-07-09 + */ +@RestController +@RequestMapping("pauserwechat") +public class PaUserWechatController { + + @Autowired + private PaUserWechatService paUserWechatService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = paUserWechatService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + PaUserWechatDTO data = paUserWechatService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody PaUserWechatDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + paUserWechatService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody PaUserWechatDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + paUserWechatService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + paUserWechatService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = paUserWechatService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, PaUserWechatExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PublicAccountCallBackController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PublicAccountCallBackController.java new file mode 100644 index 0000000000..e1a47748a7 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/PublicAccountCallBackController.java @@ -0,0 +1,66 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.ArrayList; +import java.util.Collections; + +/** + * 党群e事通公众号(客服号) + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/8 12:43 + */ +@RestController +@RequestMapping("pa") +public class PublicAccountCallBackController { + private Logger logger = LogManager.getLogger(); + /** + * @param signature 微信加密签名,signature结合了开发者填写的token参数和请求中的timestamp参数、nonce参数。 + * @param timestamp 时间戳 + * @param nonce 随机数 + * @param echostr 随机字符串 + * @return java.lang.String + * @author yinzuomei + * @description 确认此次GET请求来自微信服务器,请原样返回echostr参数内容,则接入生效,成为开发者成功,否则接入失败 + * @Date 2020/7/8 12:47 + **/ + @GetMapping(value = "/callback") + public String wxServerValdation(@RequestParam("signature") String signature, + @RequestParam("timestamp") String timestamp, + @RequestParam("nonce") String nonce, + @RequestParam("echostr") String echostr) { + if (StringUtils.isEmpty(signature) || StringUtils.isEmpty(timestamp) || StringUtils.isEmpty(nonce) || StringUtils.isEmpty(echostr)) { + logger.warn("入参错误"); + return ""; + } + ArrayList list = new ArrayList(); + list.add(nonce); + list.add(timestamp); + //这是第5步中你设置的Token + list.add("12345678Yzm"); + Collections.sort(list); + String sha1Singnature = DigestUtils.sha1Hex(list.get(0) + list.get(1) + list.get(2)); + if (sha1Singnature.equals(signature)) { + logger.info("校验成功"); + return echostr; + } else { + logger.warn("校验失败"); + return ""; + } + } + + @GetMapping(value = "test") + public Result test(){ + return new Result<>().ok("test"); + } + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/WarrantController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/WarrantController.java new file mode 100644 index 0000000000..1acb7a60ab --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/WarrantController.java @@ -0,0 +1,34 @@ +package com.epmet.controller; + +import com.epmet.exception.AesException; +import com.epmet.service.WarrantService; +import lombok.extern.slf4j.Slf4j; +import org.dom4j.DocumentException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * @Author zxc + * @CreateTime 2020/7/10 10:41 + */ +@Slf4j +@RestController +@RequestMapping("warrant") +public class WarrantController { + + @Autowired + private WarrantService warrantService; + + @RequestMapping(value ="/{APPID}/callback") + public void acceptMessageAndEvent(HttpServletRequest request, @PathVariable("APPID") String appid, + HttpServletResponse response)throws IOException, DocumentException, AesException { + warrantService.acceptMessageAndEvent(request, appid, response); + } + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/WeChatNotifyController.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/WeChatNotifyController.java new file mode 100644 index 0000000000..27e1051b58 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/controller/WeChatNotifyController.java @@ -0,0 +1,58 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.ComponentVerifyTicketService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +/** + * @Author zxc + * @CreateTime 2020/7/8 15:06 + */ +@Slf4j +@RestController +@RequestMapping("wechatthird") +public class WeChatNotifyController { + + @Autowired + private ComponentVerifyTicketService componentVerifyTicketService; + + /** + * @Description 定时获取 (令牌,component_access_token) + * 令牌(component_access_token)是第三方平台接口的调用凭据。令牌的获取是有限制的,每个令牌的有效期为 2 小时 + * @param + * @author zxc + */ + @PostMapping("componentaccesstoken") + public Result getComponentAccessToken() { + log.info("开始获取【component_access_token】......"); + componentVerifyTicketService.getComponentAccessToken(); + log.info("已成功获取到【component_access_token】......"); + return new Result(); + } + + /** + * @Description 获取预授权码 + * @param + * @author zxc + */ + @PostMapping("preauthcode") + public Result preAuthCode(){ + componentVerifyTicketService.preAuthCode(); + return new Result(); + } + + /** + * @Description 获取/刷新接口调用令牌 + * @author zxc + */ + @PostMapping("refreshtoken") + public Result refreshToken(){ + log.info("开始刷新/获取接口调用令牌......"); + componentVerifyTicketService.refreshToken(); + log.info("刷新/获取接口调用令牌......成功了"); + return new Result(); + } + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthCodeDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthCodeDao.java new file mode 100644 index 0000000000..53bf395ea1 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthCodeDao.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; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.AuthCodeFormDTO; +import com.epmet.dto.result.AuthCodeResultDTO; +import com.epmet.entity.AuthCodeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 授权回调url反参表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Mapper +public interface AuthCodeDao extends BaseDao { + + /** + * @Description 插入 授权码 + * @param formDTO + * @author zxc + */ + void insertRedirectAuthCode(AuthCodeFormDTO formDTO); + + /** + * @Description 根据authCode查询客户ID和客户端类型 + * @param authCode + * @author zxc + */ + AuthCodeResultDTO selectCustomerIdByAuthCode(@Param("authCode")String authCode); + + /** + * @Description 回填 auth_code表 authAppId + * @param customerId + * @param clientType + * @param authAppId + * @author zxc + */ + void updateAppId(@Param("customerId")String customerId,@Param("clientType")String clientType,@Param("authAppId")String authAppId); + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthResultRecordDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthResultRecordDao.java new file mode 100644 index 0000000000..ca98874003 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthResultRecordDao.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.AuthResultRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 授权结果记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-15 + */ +@Mapper +public interface AuthResultRecordDao extends BaseDao { + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..3e98b5a623 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/AuthorizationInfoDao.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.dao; + +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.result.WillOverDueResultDTO; +import com.epmet.entity.AuthorizationInfoEntity; +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-07-08 + */ +@Mapper +public interface AuthorizationInfoDao extends BaseDao { + + /** + * @Description 插入 授权信息 + * @param formDTO + * @author zxc + */ + void insertAuthorizationInfo(AuthorizationInfoFormDTO formDTO); + + /** + * @Description 逻辑删除授权信息 + * @param customerId + * @author zxc + */ + void updateOldAuthorizationInfo(@Param("customerId")String customerId); + + /** + * 根据客户ID,客户端类型获取授权信息 + * @author zhaoqifeng + * @date 2020/7/15 14:08 + * @param customerId 客户ID + * @param clientType 客户端类型 + * @return com.epmet.dto.AuthorizationInfoDTO + */ + AuthorizationInfoDTO getAuthInfoByCustomer(@Param("customerId") String customerId, @Param("clientType") String clientType); + void updateOldAuthorizationInfo(@Param("customerId")String customerId,@Param("clientType")String clientType); + + /** + * @Description 查询即将过期的 authorizer_access_token + * @param + * @author zxc + */ + List checkWillOverDue(); + + /** + * @Description 插入 authorizer_access_token + * @param refreshAccessToken + * @author zxc + */ + void insertAuthorizerAccessToken(AuthorizerAccessTokenFormDTO refreshAccessToken); + + /** + * @Description 逻辑删除 授权方的authorizer_access_token + * @param customerId + * @author zxc + */ + void updateOldAuthorizerAccessToken(@Param("customerId")String customerId,@Param("clientType")String clientType); + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BindingAccountDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BindingAccountDao.java new file mode 100644 index 0000000000..4ea9771d2c --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BindingAccountDao.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.BindingAccountFormDTO; +import com.epmet.entity.BindingAccountEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 公众号/小程序绑定开放平台帐号表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-13 + */ +@Mapper +public interface BindingAccountDao extends BaseDao { + + /** + * @Description 插入 公众号/小程序绑定开放平台帐号表 + * @param formDTO + * @author zxc + */ + void insertBindingAccount(BindingAccountFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BusinessInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BusinessInfoDao.java new file mode 100644 index 0000000000..622f257d7b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/BusinessInfoDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.BusinessInfoFormDTO; +import com.epmet.entity.BusinessInfoEntity; +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-07-13 + */ +@Mapper +public interface BusinessInfoDao extends BaseDao { + + /** + * @Description 功能开通信息插入 + * @param businessInfoList + * @author zxc + */ + void insertBusinessInfo(@Param("businessInfoList") List businessInfoList); + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditRecordDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditRecordDao.java new file mode 100644 index 0000000000..1aca1dff12 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditRecordDao.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.CodeAuditRecordFormDTO; +import com.epmet.entity.CodeAuditRecordEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 代码审核记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-15 + */ +@Mapper +public interface CodeAuditRecordDao extends BaseDao { + + /** + * @Description 插入代码审核结果 + * @param formDTO + * @author zxc + */ + void insertCodeAuditRecord(CodeAuditRecordFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditResultDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditResultDao.java new file mode 100644 index 0000000000..6ead2846d6 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeAuditResultDao.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CodeAuditResultDTO; +import com.epmet.entity.CodeAuditResultEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 代码审核结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Mapper +public interface CodeAuditResultDao extends BaseDao { + /** + * 获取审核结果信息 + * @author zhaoqifeng + * @date 2020/7/15 17:10 + * @param codeId + * @return com.epmet.dto.CodeAuditResultDTO + */ + CodeAuditResultDTO selectAuditResultByCodeId(@Param("codeId") String codeId); + + /** + * @Description 更新 代码审核结果中的审核状态 + * @param customerId + * @param codeCustomerId + * @author zxc + */ + void updateAuditResult(@Param("customerId")String customerId,@Param("codeCustomerId")String codeCustomerId,@Param("codeResult")String codeResult); + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.java new file mode 100644 index 0000000000..7b3e60abe3 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeCustomerDao.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; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.UploadListFormDTO; +import com.epmet.dto.result.UploadListResultDTO; +import com.epmet.dto.form.CodeAuditRecordFormDTO; +import com.epmet.dto.result.TemplateAndAppIdResultDTO; +import com.epmet.entity.CodeCustomerEntity; +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-07-09 + */ +@Mapper +public interface CodeCustomerDao extends BaseDao { + /** + * 获取上传代码列表 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/7/15 15:22 + */ + List selectCodeList(UploadListFormDTO formDTO); + + /** + * @Description 根据客户id和客户端类型获取 代码模板ID和授权方AppId + * @param customerId + * @param clientType + * @author zxc + */ + TemplateAndAppIdResultDTO selectTemplateAndAppId(@Param("customerId")String customerId,@Param("clientType")String clientType); + + /** + * @Description 查询 code_customer 表ID + * @param codeAuditRecord + * @author zxc + */ + String selectCodeCustomerId(CodeAuditRecordFormDTO codeAuditRecord); + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeMediaDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeMediaDao.java new file mode 100644 index 0000000000..ef06035847 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CodeMediaDao.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.CodeMediaEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 代码素材 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Mapper +public interface CodeMediaDao extends BaseDao { + +} \ 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 new file mode 100644 index 0000000000..67d38d540c --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ComponentAccessTokenDao.java @@ -0,0 +1,72 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.ComponentAccessTokenFormDTO; +import com.epmet.entity.ComponentAccessTokenEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 第三方平台调用凭证 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Mapper +public interface ComponentAccessTokenDao extends BaseDao { + + /** + * @Description 插入component_access_token信息 + * @param formDTO + * @author zxc + */ + void insertComponentAccessToken(ComponentAccessTokenFormDTO formDTO); + + /** + * @Description 逻辑删除旧的 component_access_token信息 + * @param + * @author zxc + */ + void updateOldComponentAccessToken(); + + /** + * @Description 查询component_access_token 数量 + * @param + * @author zxc + */ + Integer selectAccessTokenCount(); + + /** + * @Description 查询即将过期【component_access_token】的数量 + * @param + * @author zxc + */ + Integer selectWillOverTokenCount(); + + /** + * 获取Component Access Token + * @author zhaoqifeng + * @date 2020/7/15 10:00 + * @return java.lang.String + */ + String getComponentAccessToken(); + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ComponentVerifyTicketDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ComponentVerifyTicketDao.java new file mode 100644 index 0000000000..9c29569f0e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/ComponentVerifyTicketDao.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.ComponentVerifyTicketFormDTO; +import com.epmet.entity.ComponentVerifyTicketEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 微信发送的ticket表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Mapper +public interface ComponentVerifyTicketDao extends BaseDao { + + /** + * @Description 插入 票据【component_verify_ticket】 + * @param formDTO + * @author zxc + */ + void insertComponentVerifyTicket(ComponentVerifyTicketFormDTO formDTO); + + /** + * @Description 逻辑删除 【component_verify_ticket】 + * @param + * @author zxc + */ + void updateOldComponentVerifyTicket(); + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CustomerCodeOperationHistoryDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CustomerCodeOperationHistoryDao.java new file mode 100644 index 0000000000..63ca70fb2b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CustomerCodeOperationHistoryDao.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.CustomerCodeOperationHistoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户代码操作历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Mapper +public interface CustomerCodeOperationHistoryDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CustomerMpDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CustomerMpDao.java new file mode 100644 index 0000000000..c8609064e9 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/CustomerMpDao.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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerMpDTO; +import com.epmet.dto.form.AuthCodeFormDTO; +import com.epmet.entity.CustomerMpEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; +import org.apache.ibatis.annotations.Param; + +/** + * 客户小程序关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Mapper +public interface CustomerMpDao extends BaseDao { + + /** + * @param customerId + * @return + * @Author sun + * @Description 查询客户小程序授权结果信息 + **/ + List selectByCustomerId(@Param("customerId") String customerId); + + /** + * @param + * @return + * @Author sun + * @Description 查询所有客户小程序的授权信息 + **/ + List selectAll(); + + /** + * @Description 查询授权的数量 + * @param customerId + * @author zxc + */ + Integer selectAuthCount(@Param("customerId")String customerId); + + /** + * @Description 回填customer_mp的appId + * @param formDTO + * @author zxc + */ + void updateAppIDByCustomerIdAndClient(AuthCodeFormDTO formDTO); + + /** + * @Description 修改小程序授权的状态 + * @param authAppId + * @author zxc + */ + void updateAuthorizationFlag(@Param("authAppId")String authAppId); + + /** + * @Description 根据 客户Id和授权方AppId查询clientType + * @param customerId + * @param authAppId + * @author zxc + */ + String selectClientTypeByCustomerIdAndAuthId(@Param("customerId")String customerId,@Param("authAppId")String authAppId); + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/FuncInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/FuncInfoDao.java new file mode 100644 index 0000000000..722a1b889d --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/FuncInfoDao.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.FuncInfoFormDTO; +import com.epmet.entity.FuncInfoEntity; +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-07-08 + */ +@Mapper +public interface FuncInfoDao extends BaseDao { + + /** + * @Description 插入授权列表信息 + * @param funcInfoList + * @author zxc + */ + void insertFuncInfo(@Param("funcInfoList") List funcInfoList); + + /** + * @Description 逻辑删除 权限列表 + * @param customerId + * @author zxc + */ + void updateOldFuncInfo(@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/MiniCategoryInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniCategoryInfoDao.java new file mode 100644 index 0000000000..e233f5372b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniCategoryInfoDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.MiniCategoryInfoFormDTO; +import com.epmet.entity.MiniCategoryInfoEntity; +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-07-13 + */ +@Mapper +public interface MiniCategoryInfoDao extends BaseDao { + + /** + * @Description 小程序配置的类目信息插入 + * @param miniCategoryInfoList + * @author zxc + */ + void insertCategoryInfo(@Param("miniCategoryInfoList") List miniCategoryInfoList); + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java new file mode 100644 index 0000000000..26e7dbf7e8 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniInfoDao.java @@ -0,0 +1,50 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.MiniInfoFormDTO; +import com.epmet.dto.result.CustomerIdAndClientResultDTO; +import com.epmet.entity.MiniInfoEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 小程序信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-13 + */ +@Mapper +public interface MiniInfoDao extends BaseDao { + + /** + * @Description 插入小程序信息 + * @param formDTO + * @author zxc + */ + void insertMiniInfo(MiniInfoFormDTO formDTO); + + /** + * @Description 根据原始ID查询 customerId 和 clientType + * @param toUserName + * @author zxc + */ + CustomerIdAndClientResultDTO selectCustomerIdAndClientByToUserName(@Param("toUserName")String toUserName); + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniNetworkInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniNetworkInfoDao.java new file mode 100644 index 0000000000..361d4bb256 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/MiniNetworkInfoDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.MiniNetworkInfoFormDTO; +import com.epmet.entity.MiniNetworkInfoEntity; +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-07-13 + */ +@Mapper +public interface MiniNetworkInfoDao extends BaseDao { + + /** + * @Description 小程序配置的合法域名信息插入 + * @param networkInfoList + * @author zxc + */ + void insertNetworkInfo(@Param("networkInfoList") List networkInfoList); + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenPlatformAccountDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenPlatformAccountDao.java new file mode 100644 index 0000000000..2ec5ef1588 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/OpenPlatformAccountDao.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.CreateOpenFormDTO; +import com.epmet.dto.result.CreateOpenResultDTO; +import com.epmet.entity.OpenPlatformAccountEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 开放平台账号表 + + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-13 + */ +@Mapper +public interface OpenPlatformAccountDao extends BaseDao { + + /** + * @Description 插入开放平台账号 + * @param coForm + * @author zxc + */ + void insertOpenPlatFormAccount(CreateOpenFormDTO coForm); + + /** + * @Description 根据客户Id查询已绑定开放平台的账号ID + * @param customerId + * @author zxc + */ + String selectOpenAppIdByCustomerId(@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/PaCustomerAgencyDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaCustomerAgencyDao.java new file mode 100644 index 0000000000..219d88fd83 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaCustomerAgencyDao.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.PaCustomerAgencyDTO; +import com.epmet.entity.PaCustomerAgencyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 客户根组织信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Mapper +public interface PaCustomerAgencyDao extends BaseDao { + + /** + * @Description 根据userId查询客户Id + * @param userId + * @author zxc + */ + String getCustomerIdByUserId(@Param("userId")String userId); + + /** + * @param customerId + * @return + * @Author sun + * @Description 公众号-查询客户组织信息 + **/ + PaCustomerAgencyDTO selectCustomerAgency(@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/PaCustomerDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaCustomerDao.java new file mode 100644 index 0000000000..de4111e6c6 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaCustomerDao.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.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.PaCustomerDTO; +import com.epmet.dto.result.CustomerAgencyResultDTO; +import com.epmet.entity.PaCustomerEntity; +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-07-09 + */ +@Mapper +public interface PaCustomerDao extends BaseDao { + + /** + * @param userId + * @return + * @Author sun + * @Description 公众号-根据userId查询用户对应的客户信息 + **/ + List selectCustomerByUserId(@Param("userId") String userId); + + /** + * @param + * @return + * @Author sun + * @Description 查询公众号注册的客户信息列表 + **/ + List registerInfo(); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaCustomerUserAgencyDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaCustomerUserAgencyDao.java new file mode 100644 index 0000000000..123300af1a --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaCustomerUserAgencyDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.PaCustomerUserAgencyDTO; +import com.epmet.entity.PaCustomerUserAgencyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 用户组织关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Mapper +public interface PaCustomerUserAgencyDao extends BaseDao { + + /** + * @param userId + * @return + * @Author sun + * @Description 根据userId查询客户信息 + **/ + PaCustomerUserAgencyDTO selectByUserId(@Param("userId") String userId); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaInfoDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaInfoDao.java new file mode 100644 index 0000000000..f605e6a7d3 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaInfoDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.PaInfoFormDTO; +import com.epmet.entity.PaInfoEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 公众号信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-13 + */ +@Mapper +public interface PaInfoDao extends BaseDao { + + /** + * @Description 公众号信息插入 + * @param formDTO + * @author zxc + */ + void insertPaInfo(PaInfoFormDTO formDTO); + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaUserDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaUserDao.java new file mode 100644 index 0000000000..2ced9f5760 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaUserDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.PaUserDTO; +import com.epmet.entity.PaUserEntity; +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-07-09 + */ +@Mapper +public interface PaUserDao extends BaseDao { + + /** + * @param phone + * @return + * @Author sun + * @Description 根据手机号查询公众号用户基本信息,校验用户是否存在 + **/ + List selectUserByPhone(@Param("phone") String phone); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaUserVisitedDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaUserVisitedDao.java new file mode 100644 index 0000000000..d1910601c7 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaUserVisitedDao.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.PaUserVisitedEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 公众号登陆记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Mapper +public interface PaUserVisitedDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaUserWechatDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaUserWechatDao.java new file mode 100644 index 0000000000..8d3f6a6351 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PaUserWechatDao.java @@ -0,0 +1,50 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.PaUserWechatDTO; +import com.epmet.entity.PaUserWechatEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 公众号用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Mapper +public interface PaUserWechatDao extends BaseDao { + + /** + * @param openId + * @return + * @Author sun + * @Description 根据openId查询user_wechat表信息 + **/ + PaUserWechatDTO selectWechatByOpenId(@Param("openId") String openId); + + /** + * @param dto + * @return + * @Author sun + * @Description 根据userId查询user_wechat表信息 + **/ + PaUserWechatEntity selectWechatByUserId(PaUserWechatDTO dto); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PreAuthTokenDao.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PreAuthTokenDao.java new file mode 100644 index 0000000000..defe7f5bb0 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/dao/PreAuthTokenDao.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.PreAuthTokenFormDTO; +import com.epmet.entity.PreAuthTokenEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 预授权码历史记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-08 + */ +@Mapper +public interface PreAuthTokenDao extends BaseDao { + + /** + * @Description 插入 预授权码 + * @param formDTO + * @author zxc + */ + void insertPreAuthToken(PreAuthTokenFormDTO formDTO); + + /** + * @Description 逻辑删 pre_auth_code + * @param + * @author zxc + */ + void updateOldPreAuthCode(); + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthCodeEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthCodeEntity.java new file mode 100644 index 0000000000..3ab4b6607d --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthCodeEntity.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.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 授权回调url反参表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("auth_code") +public class AuthCodeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 授权方APPID + */ + private String authAppid; + + /** + * 授权码 + */ + private String authCode; + + /** + * 到期时间 + */ + private Date expiresInTime; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthResultRecordEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthResultRecordEntity.java new file mode 100644 index 0000000000..c9fd91b40f --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthResultRecordEntity.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-07-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("auth_result_record") +public class AuthResultRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 第三方平台AppId 第三方平台AppId + */ + private String componentAppId; + + /** + * 微信返回创建时间 微信返回创建时间 + */ + private Date wechatCreateTime; + + /** + * 通知类型 + */ + private String infoType; + + /** + * 授权方AppId + */ + private String authorizerAppId; + + /** + * 授权码(auth_code) + */ + private String authorizationCode; + + /** + * 授权码过期时间 + */ + private Date expiresInTime; + + /** + * 预授权码 + */ + private String preAuthCode; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthorizationInfoEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthorizationInfoEntity.java new file mode 100644 index 0000000000..372c8265b6 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/AuthorizationInfoEntity.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.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-07-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("authorization_info") +public class AuthorizationInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 授权方 appid + */ + private String authorizerAppid; + + /** + * 接口调用令牌(在授权的公众号/小程序具备 API 权限时,才有此返回值)【第三方和微信交互使用】 + */ + private String authorizerAccessToken; + + /** + * 到期时间 + */ + private Date expiresInTime; + + /** + * 刷新令牌(在授权的公众号具备API权限时,才有此返回值),刷新令牌主要用于第三方平台获取和刷新已授权用户的 authorizer_access_token。一旦丢失,只能让用户重新授权,才能再次拿到新的刷新令牌。用户重新授权后,之前的刷新令牌会失效 + */ + private String authorizerRefreshToken; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/BindingAccountEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/BindingAccountEntity.java new file mode 100644 index 0000000000..bf30343ad0 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/BindingAccountEntity.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-07-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("binding_account") +public class BindingAccountEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 开放平台账号ID 开放平台账号ID + */ + private String openPlatformAccountId; + + /** + * 公众号/小程序APPID(授权方APPID) 授权方APPID + */ + private String authAppId; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 客户端 居民端:resi,工作端:work + */ + private String clientType; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/BusinessInfoEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/BusinessInfoEntity.java new file mode 100644 index 0000000000..7f49030d68 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/BusinessInfoEntity.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.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-07-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("business_info") +public class BusinessInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 主表ID 主表ID + */ + private String primaryId; + + /** + * 功能类型 open_store:是否开通微信门店功能 open_scan:是否开通微信扫商品功能 open_pay:是否开通微信支付功能 open_card:是否开通微信卡券功能 open_shake:是否开通微信摇一摇功能 + */ + private String funcType; + + /** + * 开通状态 0:未开通,1:已开通 + */ + private Integer openStatus; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditRecordEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditRecordEntity.java new file mode 100644 index 0000000000..2f75ae13cb --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditRecordEntity.java @@ -0,0 +1,114 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +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-07-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("code_audit_record") +public class CodeAuditRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 模板ID + */ + private String templateId; + + /** + * 客户端类型:resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 授权方AppId + */ + private String authAppId; + + /** + * 小程序的原始 ID + */ + private String toUserName; + + /** + * 发送方帐号(一个 OpenID,此时发送方是系统帐号) + */ + private String fromUserName; + + /** + * 消息创建时间 (整型),时间戳 + */ + private Date wechatCreateTime; + + /** + * 消息类型 event + */ + private String msgType; + + /** + * 事件类型 +weapp_audit_success:审核通过, +weapp_audit_fail:审核不通过, +weapp_audit_delay:审核延后 + */ + private String event; + + /** + * 审核成功时的时间戳 + */ + private Date succTime; + + /** + * 审核不通过的时间戳 + */ + private Date failTime; + + /** + * 审核延后时的时间戳 + */ + private Date delayTime; + + /** + * 审核不通过的原因 + */ + private String reason; + + /** + * 审核不通过的截图示例。用 | 分隔的 media_id 的列表,可通过获取永久素材接口拉取截图内容 + */ + private String screenShot; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.java new file mode 100644 index 0000000000..69d7b4b775 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeAuditResultEntity.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; + +/** + * 代码审核j结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("code_audit_result") +public class CodeAuditResultEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 代码ID + */ + private String codeId; + + /** + * 审核ID + */ + private String auditId; + + /** + * 审核结果 审核中:auditing,审核成功audit_success,审核被拒绝audit_failed,已撤回:withdrawn,审核延后:delay + */ + private String result; + + /** + * 原因 + */ + private String reason; + + /** + * 当审核被拒绝时,会返回审核失败的小程序截图示例。用 | 分隔的 media_id 的列表 + */ + private String screenShot; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeCustomerEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeCustomerEntity.java new file mode 100644 index 0000000000..5bd2485033 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeCustomerEntity.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-07-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("code_customer") +public class CodeCustomerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户名 + */ + private String customerName; + + /** + * 模板ID + */ + private String templateId; + + /** + * 小程序类型 居民端resi,工作端work + */ + private String clientType; + + /** + * APPID + */ + private String appId; + + /** + * 自定义配置 + */ + private String extJson; + + /** + * 代码版本号 + */ + private String userVersion; + + /** + * 代码描述 + */ + private String userDesc; + + /** + * 状态 未审核:unaudited,审核中:auditing,审核成功audit_success,审核被拒绝audit_failed,已撤回:withdrawn,审核延后:delay,发布成功release_success, 发布失败release_failed + */ + private String status; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeMediaEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeMediaEntity.java new file mode 100644 index 0000000000..51202ed323 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CodeMediaEntity.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-07-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("code_media") +public class CodeMediaEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 代码ID + */ + private String codeId; + + /** + * 素材ID + */ + private String mediaId; + + /** + * 素材名 + */ + private String mediaName; + + /** + * 素材类型 图片(image)、语音(voice)、视频(video)和缩略图(thumb) + */ + private String mediaType; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ComponentAccessTokenEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ComponentAccessTokenEntity.java new file mode 100644 index 0000000000..c2b35c1cd4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ComponentAccessTokenEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 第三方平台调用凭证 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("component_access_token") +public class ComponentAccessTokenEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 令牌 【第三方平台接口的调用凭据】 + */ + private String componentAccessToken; + + /** + * 令牌到期时间 + */ + private Date expiresInTime; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ComponentVerifyTicketEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ComponentVerifyTicketEntity.java new file mode 100644 index 0000000000..f11ad037e9 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/ComponentVerifyTicketEntity.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; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 微信发送的ticket表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("component_verify_ticket") +public class ComponentVerifyTicketEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 第三方平台ID + */ + private String appid; + + /** + * component_verify_ticket + */ + private String typeInfo; + + /** + * 票据内容 + */ + private String componentVerifyTicket; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CustomerCodeOperationHistoryEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CustomerCodeOperationHistoryEntity.java new file mode 100644 index 0000000000..e747bb57d4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CustomerCodeOperationHistoryEntity.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.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-07-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_code_operation_history") +public class CustomerCodeOperationHistoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 代码ID + */ + private String codeId; + + /** + * 版本 + */ + private String version; + + /** + * 操作类型 操作 上传upload,审核audit,撤回undo,发布release + */ + private String operation; + + /** + * 描述 + */ + private String describe; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CustomerMpEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CustomerMpEntity.java new file mode 100644 index 0000000000..dcd1dbe613 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/CustomerMpEntity.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-07-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_mp") +public class CustomerMpEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * pa_customer的id + */ + private String customerId; + + /** + * resi,work + */ + private String client; + + /** + * 小程序的appId + */ + private String appId; + + /** + * 是否已经授权 0:未授权,1:已授权 + */ + private Integer authorizationFlag; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/FuncInfoEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/FuncInfoEntity.java new file mode 100644 index 0000000000..409174b938 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/FuncInfoEntity.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-07-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("func_info") +public class FuncInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 权限类别 + */ + private String funcscopeCategory; + + /** + * 权限ID + */ + private String funcscopeId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 授权方APPID + */ + private String authorizationInfoAppid; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniCategoryInfoEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniCategoryInfoEntity.java new file mode 100644 index 0000000000..4ba976c442 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniCategoryInfoEntity.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.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-07-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("mini_category_info") +public class MiniCategoryInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 主表ID + */ + private String primaryId; + + /** + * 类目排序 first , second + */ + private String categorySort; + + /** + * 类目名称 资讯,文娱...... + */ + private String categoryName; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniInfoEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniInfoEntity.java new file mode 100644 index 0000000000..b45f524a0b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniInfoEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +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-07-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("mini_info") +public class MiniInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImg; + + /** + * 小程序类型 默认为 0 + */ + private String serviceTypeInfo; + + /** + * 小程序认证类型 小程序认证类型 + */ + private String verifyTypeInfo; + + /** + * 原始 ID + */ + private String userName; + + /** + * 主体名称 + */ + private String principalName; + + /** + * 账号介绍 + */ + private String signature; + + /** + * 二维码图片的 URL + */ + private String qrcodeUrl; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniNetworkInfoEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniNetworkInfoEntity.java new file mode 100644 index 0000000000..e873f52ecb --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/MiniNetworkInfoEntity.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.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-07-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("mini_network_info") +public class MiniNetworkInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 主表ID 主表ID + */ + private String primaryId; + + /** + * 类型 + */ + private String networkType; + + /** + * 域名 RequestDomain,WsRequestDomain,UploadDomain,DownloadDomain + */ + private String url; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/OpenPlatformAccountEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/OpenPlatformAccountEntity.java new file mode 100644 index 0000000000..892de984ac --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/OpenPlatformAccountEntity.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.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-07-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("open_platform_account") +public class OpenPlatformAccountEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * openId 所创建的开放平台帐号的 appid + */ + private String openAppId; + + /** + * 客户ID 客户ID + */ + private String customerId; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaCustomerAgencyEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaCustomerAgencyEntity.java new file mode 100644 index 0000000000..7b52b8ec2b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaCustomerAgencyEntity.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户根组织信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pa_customer_agency") +public class PaCustomerAgencyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id,来源于customer.id + */ + private String customerId; + + /** + * 根组织名称 + */ + private String agencyName; + + /** + * 级别 + */ + private String level; + + /** + * 地区编码 + */ + private String areaCode; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String district; + + /** + * 党支部数量 + */ + private Integer partybranchnum; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaCustomerEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaCustomerEntity.java new file mode 100644 index 0000000000..9c32baf589 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaCustomerEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pa_customer") +public class PaCustomerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户名称,默认是根组织名称 + */ + private String customerName; + + /** + * 是否已经完成客户信息初始化 0:未初始化,1:已初始化 + */ + private Integer isInitialize; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaCustomerUserAgencyEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaCustomerUserAgencyEntity.java new file mode 100644 index 0000000000..4f0c90ddfe --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaCustomerUserAgencyEntity.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; + +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-07-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pa_customer_user_agency") +public class PaCustomerUserAgencyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id,来源于customer.id + */ + private String customerId; + + /** + * pa_customer_agency.id + */ + private String agencyId; + + /** + * pa_user.id + */ + private String userId; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaInfoEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaInfoEntity.java new file mode 100644 index 0000000000..7968591b02 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaInfoEntity.java @@ -0,0 +1,99 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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-07-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pa_info") +public class PaInfoEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 客户端类型 resi:居民端,work:工作端 + */ + private String clientType; + + /** + * 昵称 + */ + private String nickName; + + /** + * 头像 + */ + private String headImg; + + /** + * 公众号类型 0:订阅号 +1:由历史老帐号升级后的订阅号 +2:服务号 + */ + private String serviceTypeInfo; + + /** + * 公众号认证类型 -1:未认证 +0:微信认证 +1:新浪微博认证 +2:腾讯微博认证 +3:已资质认证通过但还未通过名称认证 +4:已资质认证通过、还未通过名称认证,但通过了新浪微博认证 +5:已资质认证通过、还未通过名称认证,但通过了腾讯微博认证 + */ + private String verifyTypeInfo; + + /** + * 原始ID + */ + private String userName; + + /** + * 主体名称 + */ + private String principalName; + + /** + * 公众号所设置的微信号,可能为空 公众号所设置的微信号,可能为空 + */ + private String alias; + + /** + * 二维码图片的 URL + */ + private String qrcodeUrl; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaUserEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaUserEntity.java new file mode 100644 index 0000000000..21565600a6 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaUserEntity.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; + +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-07-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pa_user") +public class PaUserEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 手机号 + */ + private String phone; + + /** + * 姓 + */ + private String realName; + + /** + * 1男2女0未知 + */ + private String gender; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaUserVisitedEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaUserVisitedEntity.java new file mode 100644 index 0000000000..4eb51375ba --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaUserVisitedEntity.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-07-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pa_user_visited") +public class PaUserVisitedEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户Id pa_user.id + */ + private String userId; + + /** + * 登陆手机号对应的openId【pa_user_wechat表手机号对应的openId】 + */ + private String wxOpenId; + + /** + * 登陆用户的openId + */ + private String openId; + + /** + * 登陆用户使用的登陆手机号 + */ + private String phone; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaUserWechatEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaUserWechatEntity.java new file mode 100644 index 0000000000..c618051cb8 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PaUserWechatEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +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-07-09 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pa_user_wechat") +public class PaUserWechatEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 用户Id user.id + */ + private String userId; + + /** + * 注册用户的微信openId + */ + private String wxOpenId; + + /** + * + */ + private String unionId; + + /** + * 1男2女0未知 + */ + private String gender; + + /** + * 昵称 + */ + private String nickname; + + /** + * 头像 + */ + private String headImgUrl; + + /** + * 国家 + */ + private String country; + + /** + * 省份 + */ + private String province; + + /** + * 城市 + */ + private String city; + + /** + * 语言 + */ + private String language; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PreAuthTokenEntity.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PreAuthTokenEntity.java new file mode 100644 index 0000000000..90ee22dd33 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/entity/PreAuthTokenEntity.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 预授权码历史记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("pre_auth_token") +public class PreAuthTokenEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 预授权码 【第三方平台方实现授权托管的必备信息,每个预授权码有效期为 10 分钟。需要先获取令牌才能调用】 + */ + private String preAuthToken; + + /** + * 预授权码有效期 + */ + private Date expiresInTime; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/CustomerMpExcel.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/CustomerMpExcel.java new file mode 100644 index 0000000000..cdfd902755 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/CustomerMpExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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-07-09 + */ +@Data +public class CustomerMpExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "pa_customer的id") + private String customerId; + + @Excel(name = "resi,work") + private String client; + + @Excel(name = "小程序的appId") + private String appId; + + @Excel(name = "是否已经授权:0.未授权 1.已授权") + private Integer authorizationFlag; + + @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/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaCustomerAgencyExcel.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaCustomerAgencyExcel.java new file mode 100644 index 0000000000..065b2203db --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaCustomerAgencyExcel.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户根组织信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +public class PaCustomerAgencyExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户id,来源于customer.id") + private String customerId; + + @Excel(name = "根组织名称") + private String agencyName; + + @Excel(name = "级别") + private String level; + + @Excel(name = "地区编码") + private String areaCode; + + @Excel(name = "省") + private String province; + + @Excel(name = "市") + private String city; + + @Excel(name = "区") + private String district; + + @Excel(name = "党支部数量") + private Integer partybranchnum; + + @Excel(name = "删除标识") + 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/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaCustomerExcel.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaCustomerExcel.java new file mode 100644 index 0000000000..eadef64de2 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaCustomerExcel.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 客户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Data +public class PaCustomerExcel { + + @Excel(name = "客户id,本主键和oper_crm.customer.id一致") + private String id; + + @Excel(name = "客户名称,默认是根组织名称") + private String customerName; + + @Excel(name = "是否已经完成客户信息初始化:0.未初始化 1.已初始化") + private Integer isInitialize; + + @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/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaCustomerUserAgencyExcel.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaCustomerUserAgencyExcel.java new file mode 100644 index 0000000000..889be75cb9 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaCustomerUserAgencyExcel.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-07-09 + */ +@Data +public class PaCustomerUserAgencyExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "客户id,来源于customer.id") + private String customerId; + + @Excel(name = "pa_customer_agency.id") + private String agencyId; + + @Excel(name = "pa_user.id") + private String userId; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaUserExcel.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaUserExcel.java new file mode 100644 index 0000000000..96c7263c1e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaUserExcel.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-07-09 + */ +@Data +public class PaUserExcel { + + @Excel(name = "本主键会用作customer_staff里的user_id,user表的id") + private Integer id; + + @Excel(name = "手机号") + private String phone; + + @Excel(name = "姓") + private String realName; + + @Excel(name = "1男2女0未知") + private String gender; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaUserVisitedExcel.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaUserVisitedExcel.java new file mode 100644 index 0000000000..03a908a88d --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaUserVisitedExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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-07-09 + */ +@Data +public class PaUserVisitedExcel { + + @Excel(name = "本主键会用作customer_staff里的user_id,user表的id") + private Integer id; + + @Excel(name = "用户Id pa_user.id") + private String userId; + + @Excel(name = "登陆手机号对应的openId【pa_user_wechat表手机号对应的openId】") + private String wxOpenId; + + @Excel(name = "登陆用户的openId") + private String openId; + + @Excel(name = "登陆用户使用的登陆手机号") + private String phone; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaUserWechatExcel.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaUserWechatExcel.java new file mode 100644 index 0000000000..1ddb2bf024 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/excel/PaUserWechatExcel.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.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-07-09 + */ +@Data +public class PaUserWechatExcel { + + @Excel(name = "本主键会用作customer_staff里的user_id,user表的id") + private Integer id; + + @Excel(name = "用户Id user.id") + private String userId; + + @Excel(name = "注册用户的微信openId") + private String wxOpenId; + + @Excel(name = "") + private String unionId; + + @Excel(name = "1男2女0未知") + private String gender; + + @Excel(name = "昵称") + private String nickname; + + @Excel(name = "头像") + private String headImgUrl; + + @Excel(name = "国家") + private String country; + + @Excel(name = "省份") + private String province; + + @Excel(name = "城市") + private String city; + + @Excel(name = "语言") + private String language; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/exception/AesException.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/exception/AesException.java new file mode 100644 index 0000000000..6b03534378 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/exception/AesException.java @@ -0,0 +1,65 @@ +package com.epmet.exception; + +/** + * @Author zxc + * @CreateTime 2020/7/6 10:03 + */ +@SuppressWarnings("serial") +public class AesException extends Exception { + + public final static int OK = 0; + public final static int ValidateSignatureError = -40001; + public final static int ParseXmlError = -40002; + public final static int ComputeSignatureError = -40003; + public final static int IllegalAesKey = -40004; + public final static int ValidateCorpidError = -40005; + public final static int EncryptAESError = -40006; + public final static int DecryptAESError = -40007; + public final static int IllegalBuffer = -40008; + public final static int EncodeBase64Error = -40009; + public final static int DecodeBase64Error = -40010; + public final static int GenReturnXmlError = -40011; + + private int code; + + private static String getMessage(int code) { + switch (code) { + case ValidateSignatureError: + return "签名验证错误"; + case ParseXmlError: + return "xml解析失败"; + case ComputeSignatureError: + return "sha加密生成签名失败"; + case IllegalAesKey: + return "SymmetricKey非法"; + case ValidateCorpidError: + return "corpid校验失败"; + case EncryptAESError: + return "aes加密失败"; + case DecryptAESError: + return "aes解密失败"; + case IllegalBuffer: + return "解密后得到的buffer非法"; + case EncodeBase64Error: + return "base64加密错误"; + case DecodeBase64Error: + return "base64解密错误"; + case GenReturnXmlError: + return "xml生成失败"; + default: + return null; // cannot be + } + } + + public int getCode() { + return code; + } + + public AesException(int code) { + super(getMessage(code)); + this.code = code; + } + +} + + diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeAuditResultRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeAuditResultRedis.java new file mode 100644 index 0000000000..0b66bbd2b3 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeAuditResultRedis.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; + +/** + * 代码审核j结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Component +public class CodeAuditResultRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeCustomerRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeCustomerRedis.java new file mode 100644 index 0000000000..6b5901d833 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeCustomerRedis.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-07-09 + */ +@Component +public class CodeCustomerRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeMediaRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeMediaRedis.java new file mode 100644 index 0000000000..99d1257967 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CodeMediaRedis.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-07-09 + */ +@Component +public class CodeMediaRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CustomerCodeOperationHistoryRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CustomerCodeOperationHistoryRedis.java new file mode 100644 index 0000000000..247e724de9 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CustomerCodeOperationHistoryRedis.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-07-09 + */ +@Component +public class CustomerCodeOperationHistoryRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CustomerMpRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CustomerMpRedis.java new file mode 100644 index 0000000000..0695487db2 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/CustomerMpRedis.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-07-09 + */ +@Component +public class CustomerMpRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaCustomerAgencyRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaCustomerAgencyRedis.java new file mode 100644 index 0000000000..b343ca7eae --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaCustomerAgencyRedis.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-07-09 + */ +@Component +public class PaCustomerAgencyRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaCustomerRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaCustomerRedis.java new file mode 100644 index 0000000000..f0169f57de --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaCustomerRedis.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-07-09 + */ +@Component +public class PaCustomerRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaCustomerUserAgencyRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaCustomerUserAgencyRedis.java new file mode 100644 index 0000000000..074051791e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaCustomerUserAgencyRedis.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-07-09 + */ +@Component +public class PaCustomerUserAgencyRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaUserRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaUserRedis.java new file mode 100644 index 0000000000..d66da0300f --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaUserRedis.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-07-09 + */ +@Component +public class PaUserRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaUserVisitedRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaUserVisitedRedis.java new file mode 100644 index 0000000000..d74d8663aa --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaUserVisitedRedis.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-07-09 + */ +@Component +public class PaUserVisitedRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaUserWechatRedis.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaUserWechatRedis.java new file mode 100644 index 0000000000..171a852f3b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/PaUserWechatRedis.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-07-09 + */ +@Component +public class PaUserWechatRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/RedisThird.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/RedisThird.java new file mode 100644 index 0000000000..de326be7d7 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/redis/RedisThird.java @@ -0,0 +1,135 @@ +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.constant.ModuleConstant; +import com.epmet.constant.ThirdRedisKeyConstant; +import com.epmet.dto.form.AuthCodeFormDTO; +import com.epmet.dto.form.AuthorizationInfoFormDTO; +import com.epmet.dto.form.AuthorizerAccessTokenFormDTO; +import com.epmet.dto.result.AuthorizationInfoResultDTO; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Component; + +import java.util.concurrent.TimeUnit; + +/** + * @Author zxc + * @CreateTime 2020/7/7 9:33 + */ +@Slf4j +@Component +public class RedisThird { + + @Autowired + private RedisTemplate redisTemplate; + @Autowired + private RedisUtils redisUtils; + + /** + * @Description 缓存 component_verify_ticket 有效期:9min (官方有效期 10分钟) + * @param verifyTicket + * @author zxc + */ + public void setComponentVerifyTicket(String verifyTicket){ + redisUtils.set(ThirdRedisKeyConstant.TICKET_REDIS_KEY,verifyTicket,-1); + } + + /** + * @Description 获取 component_verify_ticket + * @author zxc + */ + public String getComponentVerifyTicket(){ + return redisTemplate.opsForValue().get(ThirdRedisKeyConstant.TICKET_REDIS_KEY).toString(); + } + + /** + * @Description 缓存 component_access_token 有效期: (官网有效期:2H) + * @param accessToken + * @author zxc + */ + public void setComponentAccessToken (String accessToken){ + String key = ThirdRedisKeyConstant.ACCESS_TOKEN_REDIS_KEY; + redisUtils.set(key,accessToken,-1); + } + + /** + * @Description 获取 component_access_token + * @author zxc + */ + public String getComponentAccessToken(){ + return redisTemplate.opsForValue().get(ThirdRedisKeyConstant.ACCESS_TOKEN_REDIS_KEY).toString(); + } + + /** + * @Description 缓存 pre_auth_code 有效期: (官方有效期 10分钟) + * @param authCode pre_auth_code 预授权码 + * @author zxc + */ + public void setPreAuthCode(String authCode){ + redisUtils.set(ThirdRedisKeyConstant.PRE_AUTH_CODE_REDIS_KEY,authCode,-1); + } + + /** + * @Description 缓存 刷新令牌 【授权信息(不包括 授权给开发者的权限集列表)】 + * (在授权的公众号具备API权限时,才有此返回值),刷新令牌主要用于第三方平台获取和刷新已授权用户的 authorizer_access_token。 + * 一旦丢失,只能让用户重新授权,才能再次拿到新的刷新令牌。用户重新授权后,之前的刷新令牌会失效 + * @param authInfoDTO + * @author zxc + */ + public void setAuthorizerRefreshToken(AuthorizationInfoFormDTO authInfoDTO){ + String key = ThirdRedisKeyConstant.AUTHORIZER_REFRESH_TOKEN_REDIS_KEY + ThirdRedisKeyConstant.COLON + authInfoDTO.getCustomerId()+ThirdRedisKeyConstant.COLON+authInfoDTO.getClientType(); + redisUtils.set(key,authInfoDTO,-1); + } + + /** + * @Description 获取刷新 + * @param key = epmet:wechartthird:authorizerrefreshtoken:customerId:clientType + * @author zxc + */ + public String getAuthorizerRefreshToken(String key){ + return redisTemplate.opsForValue().get(ThirdRedisKeyConstant.AUTHORIZER_REFRESH_TOKEN_REDIS_KEY+key).toString(); + } + + /** + * @Description 缓存授权码 auth_Code + * @param + * @author zxc + */ + public void setAuthCode(AuthCodeFormDTO formDTO){ + String key = ThirdRedisKeyConstant.AUTH_CODE_REDIS_KEY+ThirdRedisKeyConstant.COLON+formDTO.getCustomerId()+ThirdRedisKeyConstant.COLON+formDTO.getClientType(); + redisUtils.set(key,formDTO,-1); + } + + /** + * @Description 获取授权码 + * 授权码, 会在授权成功时(回调url)返回给第三方平台【code、expiresIn】 + * @param key + * @author zxc + */ + public String getAuthCode(String key){ + return redisTemplate.opsForValue().get(ThirdRedisKeyConstant.AUTH_CODE_REDIS_KEY+key).toString(); + } + + /** + * @Description 缓存授权信息【完整的,包括 授权给开发者的权限集列表 】 + * @param authInfo + * @author zxc + */ + public void setAuthInfo(AuthorizationInfoResultDTO authInfo){ + redisUtils.set(ThirdRedisKeyConstant.AUTH_INFO_REDIS_KEY,authInfo,-1); + } + + /** + * @Description 缓存 刷新后的 授权方令牌 【authorizer_access_token】 和 刷新令牌 【authorizer_refresh_token】 + * @param refreshAccessToken + * @param clientType + * @author zxc + */ + /*public void setAuthorizerRefreshToken(AuthorizerAccessTokenFormDTO refreshAccessToken,String clientType){ + String key = ThirdRedisKeyConstant.AUTHORIZER_REFRESH_TOKEN_REDIS_KEY + ThirdRedisKeyConstant.COLON + refreshAccessToken.getCustomerId()+ThirdRedisKeyConstant.COLON+clientType; + redisUtils.set(key,refreshAccessToken,-1); + }*/ + +} 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 new file mode 100644 index 0000000000..30fa445a54 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/AppLetAuthorizationService.java @@ -0,0 +1,20 @@ +package com.epmet.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.GoToAuthFormDTO; +import com.epmet.dto.result.GoToAuthResultDTO; + +/** + * @Author zxc + * @CreateTime 2020/7/10 15:52 + */ +public interface AppLetAuthorizationService { + + /** + * @Description 小程序点击“去授权”的时候 + * @param tokenDto + * @author zxc + */ + GoToAuthResultDTO goToAuth(TokenDto tokenDto, GoToAuthFormDTO formDTO); + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeAuditResultService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeAuditResultService.java new file mode 100644 index 0000000000..5f93c4031e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeAuditResultService.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.CodeAuditResultDTO; +import com.epmet.entity.CodeAuditResultEntity; + +import java.util.List; +import java.util.Map; + +/** + * 代码审核j结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +public interface CodeAuditResultService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CodeAuditResultDTO + * @author generator + * @date 2020-07-09 + */ + CodeAuditResultDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void save(CodeAuditResultDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void update(CodeAuditResultDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-09 + */ + void delete(String[] ids); + + /** + * 获取审核结果信息 + * + * @param codeId + * @return com.epmet.dto.CodeAuditResultDTO + * @author zhaoqifeng + * @date 2020/7/15 17:13 + */ + CodeAuditResultDTO getAuditResultByCodeId(String codeId); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeCustomerService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeCustomerService.java new file mode 100644 index 0000000000..bfa85cc383 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeCustomerService.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.CodeCustomerDTO; +import com.epmet.dto.form.UploadListFormDTO; +import com.epmet.entity.CodeCustomerEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户代码关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +public interface CodeCustomerService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CodeCustomerDTO + * @author generator + * @date 2020-07-09 + */ + CodeCustomerDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void save(CodeCustomerDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void update(CodeCustomerDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-09 + */ + void delete(String[] ids); + + /** + * 获取上传代码列表 + * @author zhaoqifeng + * @date 2020/7/15 15:14 + * @param formDTO + * @return com.epmet.commons.tools.page.PageData + */ + PageData getCodeList(UploadListFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeMediaService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeMediaService.java new file mode 100644 index 0000000000..a4caade450 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeMediaService.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.CodeMediaDTO; +import com.epmet.entity.CodeMediaEntity; + +import java.util.List; +import java.util.Map; + +/** + * 代码素材 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +public interface CodeMediaService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CodeMediaDTO + * @author generator + * @date 2020-07-09 + */ + CodeMediaDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void save(CodeMediaDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void update(CodeMediaDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-09 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java new file mode 100644 index 0000000000..2ba332f663 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CodeService.java @@ -0,0 +1,65 @@ +package com.epmet.service; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.form.CodeCommonFormDTO; +import com.epmet.dto.form.CodeUploadFormDTO; +import com.epmet.dto.form.SubmitAuditFormDTO; +import com.epmet.dto.form.UploadListFormDTO; +import com.epmet.dto.result.TemplateListResultDTO; +import com.epmet.dto.result.UploadListResultDTO; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/10 10:27 + */ +public interface CodeService { + + /** + * 获取代码模板列表 + * + * @return java.util.List < com.epmet.dto.result.TemplateListResultDTO> + * @author zhaoqifeng + * @date 2020/7/14 18:15 + */ + List templateList(); + + /** + * 代码上传 + * + * @param formDTO + * @author zhaoqifeng + * @date 2020/7/14 18:15 + */ + void upload(CodeUploadFormDTO formDTO); + + /** + * 已上传代码列表 + * + * @param formDTO + * @return java.util.List < com.epmet.dto.result.UploadListResultDTO> + * @author zhaoqifeng + * @date 2020/7/14 18:15 + */ + PageData uploadList(UploadListFormDTO formDTO); + + /** + * 提交审核 + * + * @param formDTO + * @author zhaoqifeng + * @date 2020/7/14 18:15 + */ + void submitAudit(SubmitAuditFormDTO formDTO); + + /** + * 审核撤回 + * + * @param formDTO + * @author zhaoqifeng + * @date 2020/7/14 18:15 + */ + void undo(CodeCommonFormDTO formDTO); +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ComponentVerifyTicketService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ComponentVerifyTicketService.java new file mode 100644 index 0000000000..2fb00e3322 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/ComponentVerifyTicketService.java @@ -0,0 +1,46 @@ +package com.epmet.service; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * @Author zxc + * @CreateTime 2020/7/6 11:19 + */ +public interface ComponentVerifyTicketService { + + /** + * 获得授权事件的票据 + * @return 如果获得只需要返回 SUCCESS + * @Author zxc + */ + String componentVerifyTicket(HttpServletRequest request, HttpServletResponse response); + + /** + * @Description 定时获取 (令牌,component_access_token) + * 令牌(component_access_token)是第三方平台接口的调用凭据。令牌的获取是有限制的,每个令牌的有效期为 2 小时 + * @author zxc + */ + void getComponentAccessToken(); + + /** + * @Description 每个预授权码有效期为 10 分钟。需要先获取令牌才能调用 获取预授权码 + * @author zxc + */ + String preAuthCode(); + + /** + * @Description 获取/刷新接口调用令牌 + * @param + * @author zxc + */ + void refreshToken(); + + /** + * @Description 授权回调URL + * @param + * @author zxc + */ + void redirectUri(HttpServletRequest request, HttpServletResponse response); + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CustomerCodeOperationHistoryService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CustomerCodeOperationHistoryService.java new file mode 100644 index 0000000000..986fce9c09 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CustomerCodeOperationHistoryService.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.CustomerCodeOperationHistoryDTO; +import com.epmet.entity.CustomerCodeOperationHistoryEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户代码操作历史 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +public interface CustomerCodeOperationHistoryService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerCodeOperationHistoryDTO + * @author generator + * @date 2020-07-09 + */ + CustomerCodeOperationHistoryDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void save(CustomerCodeOperationHistoryDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void update(CustomerCodeOperationHistoryDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-09 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CustomerMpService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CustomerMpService.java new file mode 100644 index 0000000000..ba98b8b295 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/CustomerMpService.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.CustomerMpDTO; +import com.epmet.entity.CustomerMpEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户小程序关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +public interface CustomerMpService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerMpDTO + * @author generator + * @date 2020-07-09 + */ + CustomerMpDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void save(CustomerMpDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void update(CustomerMpDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-09 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaCustomerAgencyService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaCustomerAgencyService.java new file mode 100644 index 0000000000..75d9445b5c --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaCustomerAgencyService.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.PaCustomerAgencyDTO; +import com.epmet.entity.PaCustomerAgencyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户根组织信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +public interface PaCustomerAgencyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PaCustomerAgencyDTO + * @author generator + * @date 2020-07-09 + */ + PaCustomerAgencyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void save(PaCustomerAgencyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void update(PaCustomerAgencyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-09 + */ + void delete(String[] ids); +} \ No newline at end of file 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 new file mode 100644 index 0000000000..e0d5da1a3e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaCustomerService.java @@ -0,0 +1,142 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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.PaCustomerDTO; +import com.epmet.dto.form.CreateAgencyFormDTO; +import com.epmet.dto.form.MyInfoFormDTO; +import com.epmet.dto.form.RegisterFormDTO; +import com.epmet.dto.form.RegisterInfoFormDTO; +import com.epmet.dto.result.AgencyLevelListResultDTO; +import com.epmet.dto.result.CreateAgencyResultDTO; +import com.epmet.dto.result.MyInfoResultDTO; +import com.epmet.entity.PaCustomerEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +public interface PaCustomerService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PaCustomerDTO + * @author generator + * @date 2020-07-09 + */ + PaCustomerDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void save(PaCustomerDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void update(PaCustomerDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-09 + */ + void delete(String[] ids); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 公众号-手机号注册 + **/ + void register(RegisterFormDTO formDTO); + + /** + * @return + * @Author sun + * @Description 公众号-查询组织级别 + **/ + List agencyLevelList(); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 公众号-创建组织 + **/ + CreateAgencyResultDTO createAgency(TokenDto tokenDTO, CreateAgencyFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 公众号-查询我的信息 + **/ + MyInfoResultDTO myInfo(TokenDto tokenDTO, MyInfoFormDTO formDTO); + + /** + * @param formDTO + * @return + * @Author sun + * @Description 查询公众号注册的客户信息列表 + **/ + PageData registerInfo(RegisterInfoFormDTO formDTO); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaCustomerUserAgencyService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaCustomerUserAgencyService.java new file mode 100644 index 0000000000..279c16a5ce --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaCustomerUserAgencyService.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.PaCustomerUserAgencyDTO; +import com.epmet.entity.PaCustomerUserAgencyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 用户组织关系表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +public interface PaCustomerUserAgencyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PaCustomerUserAgencyDTO + * @author generator + * @date 2020-07-09 + */ + PaCustomerUserAgencyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void save(PaCustomerUserAgencyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void update(PaCustomerUserAgencyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-09 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaUserService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaUserService.java new file mode 100644 index 0000000000..c9208eef81 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaUserService.java @@ -0,0 +1,114 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.PaUserDTO; +import com.epmet.dto.result.CustomerUserResultDTO; +import com.epmet.dto.result.SaveUserResultDTO; +import com.epmet.entity.PaUserEntity; +import me.chanjar.weixin.mp.bean.result.WxMpUser; + +import java.util.List; +import java.util.Map; + +/** + * 公众号用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +public interface PaUserService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PaUserDTO + * @author generator + * @date 2020-07-09 + */ + PaUserDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void save(PaUserDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void update(PaUserDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-09 + */ + void delete(String[] ids); + + /** + * @param wxMpUser + * @return + * @Author sun + * @Description 根据openId新增或更新用户信息 + **/ + SaveUserResultDTO saveUser(WxMpUser wxMpUser); + + /** + * @param phone + * @return + * @Author sun + * @Description 根据手机号查询公众号用户基本信息,校验用户是否存在 + **/ + CustomerUserResultDTO checkPaUser(String phone); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaUserVisitedService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaUserVisitedService.java new file mode 100644 index 0000000000..d67c581dea --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaUserVisitedService.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.PaUserVisitedDTO; +import com.epmet.dto.form.SaveUserVisitedFormDTO; +import com.epmet.entity.PaUserVisitedEntity; + +import java.util.List; +import java.util.Map; + +/** + * 公众号登陆记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +public interface PaUserVisitedService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PaUserVisitedDTO + * @author generator + * @date 2020-07-09 + */ + PaUserVisitedDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void save(PaUserVisitedDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void update(PaUserVisitedDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-09 + */ + void delete(String[] ids); + + /** + * @param visited + * @return + * @Author sun + * @Description 用户登陆,新增访问记录数据 + **/ + void saveUserVisited(SaveUserVisitedFormDTO visited); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaUserWechatService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaUserWechatService.java new file mode 100644 index 0000000000..31c520d793 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/PaUserWechatService.java @@ -0,0 +1,103 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.PaUserWechatDTO; +import com.epmet.entity.PaUserWechatEntity; + +import java.util.List; +import java.util.Map; + +/** + * 公众号用户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +public interface PaUserWechatService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-07-09 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-07-09 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return PaUserWechatDTO + * @author generator + * @date 2020-07-09 + */ + PaUserWechatDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void save(PaUserWechatDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-07-09 + */ + void update(PaUserWechatDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-07-09 + */ + void delete(String[] ids); + + /** + * @param openId + * @return + * @Author sun + * @Description 根据openId查询user_wechat表信息 + **/ + PaUserWechatDTO getWechatByOpenId(String openId); +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/WarrantService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/WarrantService.java new file mode 100644 index 0000000000..8475322c5b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/WarrantService.java @@ -0,0 +1,19 @@ +package com.epmet.service; + +import com.epmet.exception.AesException; +import org.dom4j.DocumentException; +import org.springframework.web.bind.annotation.PathVariable; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +/** + * @Author zxc + * @CreateTime 2020/7/10 11:03 + */ +public interface WarrantService { + + void acceptMessageAndEvent(HttpServletRequest request,String appid,HttpServletResponse response)throws IOException, DocumentException, AesException; + +} 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 new file mode 100644 index 0000000000..49d182479a --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/AppLetAuthorizationServiceImpl.java @@ -0,0 +1,60 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.constant.ModuleConstant; +import com.epmet.constant.ThirdApiConstant; +import com.epmet.dao.ComponentAccessTokenDao; +import com.epmet.dao.PaCustomerAgencyDao; +import com.epmet.dto.form.GoToAuthFormDTO; +import com.epmet.dto.result.GoToAuthResultDTO; +import com.epmet.redis.RedisThird; +import com.epmet.service.AppLetAuthorizationService; +import com.epmet.service.ComponentVerifyTicketService; +import com.google.gson.JsonObject; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * @Author zxc + * @CreateTime 2020/7/10 15:52 + */ +@Slf4j +@Service +public class AppLetAuthorizationServiceImpl implements AppLetAuthorizationService { + + @Autowired + private PaCustomerAgencyDao paCustomerAgencyDao; + @Autowired + private ComponentVerifyTicketService componentVerifyTicketService; + @Autowired + private ComponentAccessTokenDao componentAccessTokenDao; + @Autowired + private RedisThird redisThird; + @Value("${third.platform.appId}") + private String componentAppId; + + /** + * @Description 小程序点击“去授权”的时候 + * @param tokenDto + * @author zxc + */ + @Override + public GoToAuthResultDTO goToAuth(TokenDto tokenDto, GoToAuthFormDTO formDTO) { + GoToAuthResultDTO result = new GoToAuthResultDTO(); + String userId = tokenDto.getUserId(); + String customerId = paCustomerAgencyDao.getCustomerIdByUserId(userId); + //获取预授权码 + String preAuthCode = componentVerifyTicketService.preAuthCode(); + String redirectUrl = String.format(ThirdApiConstant.API_RETURN_REDIRECT_URL, formDTO.getClientType(), customerId); + String authUrl = String.format(ThirdApiConstant.API_AUTH_REGISTER_URL, componentAppId, preAuthCode, redirectUrl); + result.setUrl(authUrl); + return result; + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeAuditResultServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeAuditResultServiceImpl.java new file mode 100644 index 0000000000..8898ed569f --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeAuditResultServiceImpl.java @@ -0,0 +1,109 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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.CodeAuditResultDao; +import com.epmet.dto.CodeAuditResultDTO; +import com.epmet.entity.CodeAuditResultEntity; +import com.epmet.redis.CodeAuditResultRedis; +import com.epmet.service.CodeAuditResultService; +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; + +/** + * 代码审核j结果 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Service +public class CodeAuditResultServiceImpl extends BaseServiceImpl implements CodeAuditResultService { + + @Autowired + private CodeAuditResultRedis codeAuditResultRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CodeAuditResultDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CodeAuditResultDTO.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 CodeAuditResultDTO get(String id) { + CodeAuditResultEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CodeAuditResultDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CodeAuditResultDTO dto) { + CodeAuditResultEntity entity = ConvertUtils.sourceToTarget(dto, CodeAuditResultEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CodeAuditResultDTO dto) { + CodeAuditResultEntity entity = ConvertUtils.sourceToTarget(dto, CodeAuditResultEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public CodeAuditResultDTO getAuditResultByCodeId(String codeId) { + return baseDao.selectAuditResultByCodeId(codeId); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeCustomerServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeCustomerServiceImpl.java new file mode 100644 index 0000000000..3181daebdc --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeCustomerServiceImpl.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.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.CodeCustomerDao; +import com.epmet.dto.CodeCustomerDTO; +import com.epmet.dto.form.UploadListFormDTO; +import com.epmet.dto.result.UploadListResultDTO; +import com.epmet.entity.CodeCustomerEntity; +import com.epmet.redis.CodeCustomerRedis; +import com.epmet.service.CodeCustomerService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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-07-09 + */ +@Service +public class CodeCustomerServiceImpl extends BaseServiceImpl implements CodeCustomerService { + + @Autowired + private CodeCustomerRedis codeCustomerRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CodeCustomerDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CodeCustomerDTO.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 CodeCustomerDTO get(String id) { + CodeCustomerEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CodeCustomerDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CodeCustomerDTO dto) { + CodeCustomerEntity entity = ConvertUtils.sourceToTarget(dto, CodeCustomerEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CodeCustomerDTO dto) { + CodeCustomerEntity entity = ConvertUtils.sourceToTarget(dto, CodeCustomerEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public PageData getCodeList(UploadListFormDTO formDTO) { + PageHelper.startPage(formDTO.getPage(), formDTO.getLimit()); + List list = baseDao.selectCodeList(formDTO); + PageInfo pageInfo = new PageInfo<>(list); + return new PageData<>(list, pageInfo.getTotal()); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeMediaServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeMediaServiceImpl.java new file mode 100644 index 0000000000..4447d8ed66 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeMediaServiceImpl.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.CodeMediaDao; +import com.epmet.dto.CodeMediaDTO; +import com.epmet.entity.CodeMediaEntity; +import com.epmet.redis.CodeMediaRedis; +import com.epmet.service.CodeMediaService; +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-07-09 + */ +@Service +public class CodeMediaServiceImpl extends BaseServiceImpl implements CodeMediaService { + + @Autowired + private CodeMediaRedis codeMediaRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CodeMediaDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CodeMediaDTO.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 CodeMediaDTO get(String id) { + CodeMediaEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CodeMediaDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CodeMediaDTO dto) { + CodeMediaEntity entity = ConvertUtils.sourceToTarget(dto, CodeMediaEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CodeMediaDTO dto) { + CodeMediaEntity entity = ConvertUtils.sourceToTarget(dto, CodeMediaEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-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 new file mode 100644 index 0000000000..8cf9b54571 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CodeServiceImpl.java @@ -0,0 +1,179 @@ +package com.epmet.service.impl; + +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.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.CodeConstant; +import com.epmet.dao.AuthorizationInfoDao; +import com.epmet.dao.ComponentAccessTokenDao; +import com.epmet.dto.AuthorizationInfoDTO; +import com.epmet.dto.CodeAuditResultDTO; +import com.epmet.dto.CodeCustomerDTO; +import com.epmet.dto.CustomerDTO; +import com.epmet.dto.form.CodeCommonFormDTO; +import com.epmet.dto.form.CodeUploadFormDTO; +import com.epmet.dto.form.SubmitAuditFormDTO; +import com.epmet.dto.form.UploadListFormDTO; +import com.epmet.dto.result.TemplateListResultDTO; +import com.epmet.feign.OperCrmOpenFeignClient; +import com.epmet.service.CodeAuditResultService; +import com.epmet.service.CodeCustomerService; +import com.epmet.service.CodeService; +import com.epmet.wxapi.param.WxMaCodeAuditStatusReq; +import com.epmet.wxapi.param.WxMaCodeCommitReq; +import com.epmet.wxapi.param.WxMaCodeSubmitAuditRequest; +import com.epmet.wxapi.result.WxMaAuditStatusResult; +import com.epmet.wxapi.result.WxMaTemplateResult; +import com.epmet.wxapi.result.WxResult; +import com.epmet.wxapi.service.WxMaCodeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/10 10:27 + */ +@Service +public class CodeServiceImpl implements CodeService { + + @Autowired + private WxMaCodeService wxMaCodeService; + @Autowired + private ComponentAccessTokenDao componentAccessTokenDao; + @Autowired + private AuthorizationInfoDao authorizationInfoDao; + @Autowired + private CodeCustomerService codeCustomerService; + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; + @Autowired + private CodeAuditResultService codeAuditResultService; + + @Override + public List templateList() { + List resultList = new ArrayList<>(); + //获取COMPONENT_ACCESS_TOKEN + String accessToken = componentAccessTokenDao.getComponentAccessToken(); + //调用微信API获取模板列表 + WxResult> wxResult = wxMaCodeService.getTemplateList(accessToken); + if (!wxResult.success()) { + throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg()); + } + if (null == wxResult.getData() || wxResult.getData().size() == NumConstant.ZERO) { + return resultList; + } + wxResult.getData().forEach(temp -> { + TemplateListResultDTO dto = new TemplateListResultDTO(); + dto.setTemplateId(temp.getTemplateId()); + dto.setUserVersion(temp.getUserVersion()); + dto.setUserDesc(temp.getUserDesc()); + dto.setCreateTime(DateUtils.formatTimestamp(temp.getCreateTime(), DateUtils.DATE_PATTERN)); + resultList.add(dto); + }); + return resultList; + } + + @Override + public void upload(CodeUploadFormDTO formDTO) { + //获取小程序调用令牌 + AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(formDTO.getCustomerId(), formDTO.getClientType()); + if (null == authInfo) { + throw new RenException("未授权"); + } + //TODO 获取第三方自定义配置 + String extJson = "{}"; + + WxMaCodeCommitReq request = ConvertUtils.sourceToTarget(formDTO, WxMaCodeCommitReq.class); + request.setExtJson(extJson); + //调用微信API上传代码 + WxResult wxResult = wxMaCodeService.commit(authInfo.getAuthorizerAccessToken(), request); + //上传失败,抛出异常 + if (!wxResult.success()) { + throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg()); + } + //获取客户信息 + CustomerDTO customerDTO = new CustomerDTO(); + customerDTO.setId(formDTO.getCustomerId()); + Result customerInfo = operCrmOpenFeignClient.getCustomerInfo(customerDTO); + if (!customerInfo.success()) { + throw new RenException(customerInfo.getCode(), customerInfo.getMsg()); + } + //TODO 将之前上传信息删除 + + //将上传信息存入表中 + CodeCustomerDTO codeCustomerDTO = ConvertUtils.sourceToTarget(formDTO, CodeCustomerDTO.class); + codeCustomerDTO.setCustomerName(customerInfo.getData().getCustomerName()); + codeCustomerDTO.setExtJson(extJson); + codeCustomerDTO.setStatus(CodeConstant.UNAUDITED); + codeCustomerService.save(codeCustomerDTO); + } + + @Override + public PageData uploadList(UploadListFormDTO formDTO) { + //TODO 更新审核状态 + return codeCustomerService.getCodeList(formDTO); + } + + @Override + public void submitAudit(SubmitAuditFormDTO formDTO) { + //获取上传代码信息 + CodeCustomerDTO codeCustomerDTO = codeCustomerService.get(formDTO.getCodeId()); + //获取小程序调用令牌 + AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType()); + //调用微信API上提交审核 + WxMaCodeSubmitAuditRequest request = ConvertUtils.sourceToTarget(formDTO, WxMaCodeSubmitAuditRequest.class); + WxResult wxResult = wxMaCodeService.submitAudit(authInfo.getAuthorizerAccessToken(), request); + if (!wxResult.success()) { + throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg()); + } + //将数据存入代码审核表 + CodeAuditResultDTO codeAuditResultDTO = new CodeAuditResultDTO(); + codeAuditResultDTO.setCustomerId(codeCustomerDTO.getCustomerId()); + codeAuditResultDTO.setCodeId(codeCustomerDTO.getId()); + codeAuditResultDTO.setAuditId(wxResult.getData()); + codeAuditResultDTO.setResult(CodeConstant.AUDITING); + codeAuditResultService.save(codeAuditResultDTO); + //更新代码表状态 + codeCustomerDTO.setStatus(CodeConstant.AUDITING); + codeCustomerService.update(codeCustomerDTO); + } + + @Override + public void undo(CodeCommonFormDTO formDTO) { + //获取上传代码信息 + CodeCustomerDTO codeCustomerDTO = codeCustomerService.get(formDTO.getCodeId()); + //获取审核结果信息 + CodeAuditResultDTO codeAuditResultDTO = codeAuditResultService.getAuditResultByCodeId(formDTO.getCodeId()); + //获取小程序调用令牌 + AuthorizationInfoDTO authInfo = authorizationInfoDao.getAuthInfoByCustomer(codeCustomerDTO.getCustomerId(), codeCustomerDTO.getClientType()); + //调用微信API获取最新审核状态 + WxMaCodeAuditStatusReq request = new WxMaCodeAuditStatusReq(); + request.setAuditId(codeAuditResultDTO.getAuditId()); + WxResult wxAuditResult = wxMaCodeService.getAuditStatus(authInfo.getAuthorizerAccessToken(), request); + if (!wxAuditResult.success() ) { + throw new RenException(wxAuditResult.getErrorCode(), wxAuditResult.getErrorMsg()); + } + if (wxAuditResult.getData().getStatus() != NumConstant.TWO) { + throw new RenException("该条记录状态已不是审核中,无法撤回"); + } + //调用微信API撤销审核 + WxResult wxResult = wxMaCodeService.undoCodeAudit(authInfo.getAuthorizerAccessToken()); + if (!wxResult.success()) { + throw new RenException(wxResult.getErrorCode(), wxResult.getErrorMsg()); + } + //更新审核结果 + codeAuditResultDTO.setResult(CodeConstant.WITHDRAWN); + codeAuditResultService.update(codeAuditResultDTO); + //更新代码表状态 + codeCustomerDTO.setStatus(CodeConstant.WITHDRAWN); + codeCustomerService.update(codeCustomerDTO); + } + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java new file mode 100644 index 0000000000..6e2916dac6 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/ComponentVerifyTicketServiceImpl.java @@ -0,0 +1,617 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.nacos.client.config.utils.IOUtils; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.constant.ModuleConstant; +import com.epmet.constant.ThirdApiConstant; +import com.epmet.constant.ThirdRunTimeInfoConstant; +import com.epmet.dao.*; +import com.epmet.dto.form.*; +import com.epmet.dto.result.AuthCodeResultDTO; +import com.epmet.dto.result.AuthorizationInfoResultDTO; +import com.epmet.dto.result.CreateOpenResultDTO; +import com.epmet.dto.result.WillOverDueResultDTO; +import com.epmet.redis.RedisThird; +import com.epmet.service.ComponentVerifyTicketService; +import com.epmet.util.WXBizMsgCrypt; +import com.epmet.util.WXXmlToMapUtil; +import com.epmet.util.XmlUtil; +import com.github.pagehelper.util.StringUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Field; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.util.*; + +import static com.epmet.constant.ThirdRunTimeInfoConstant.*; + +/** + * @Author zxc + * @CreateTime 2020/7/6 11:21 + */ +@Slf4j +@Service +public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketService { + + @Autowired + private RedisThird redisThird; + @Autowired + private ComponentVerifyTicketDao ticketDao; + @Autowired + private AuthCodeDao authCodeDao; + @Autowired + private ComponentAccessTokenDao componentAccessTokenDao; + @Autowired + private PreAuthTokenDao preAuthTokenDao; + @Autowired + private AuthorizationInfoDao authorizationInfoDao; + @Autowired + private FuncInfoDao funcInfoDao; + @Autowired + private CustomerMpDao customerMpDao; + @Autowired + private PaInfoDao paInfoDao; + @Autowired + private OpenPlatformAccountDao openPlatformAccountDao; + @Autowired + private BindingAccountDao bindingAccountDao; + @Autowired + private MiniInfoDao miniInfoDao; + @Autowired + private MiniNetworkInfoDao miniNetworkInfoDao; + @Autowired + private MiniCategoryInfoDao miniCategoryInfoDao; + @Autowired + private BusinessInfoDao businessInfoDao; + + @Value("${third.platform.appId}") + private String componentAppId; + @Value("${third.platform.appSecret}") + private String appSecret; + @Value("${third.platform.aesKey}") + private String aesKey; + @Value("${third.platform.token}") + private String token; + + /** + * @Description 获得授权事件的票据 + * @param + * @author zxc + */ + @Transactional(rollbackFor = Exception.class) + @Override + public String componentVerifyTicket(HttpServletRequest request, HttpServletResponse response) { + log.info(ThirdRunTimeInfoConstant.START_RECEIVE); + try { + request.setCharacterEncoding(ModuleConstant.UTF8); + response.setCharacterEncoding(ModuleConstant.UTF8); + // 微信加密签名 + String msgSignature = request.getParameter(ModuleConstant.MSG_SIGNATURE); + // 时间戳 + String timeStamp = request.getParameter(ModuleConstant.TIMESTAMP); + // 随机数 + String nonce = request.getParameter(ModuleConstant.NONCE); + // 从请求中读取整个post数据 + InputStream inputStream; + String postData = null; + inputStream = request.getInputStream(); + postData= IOUtils.toString(inputStream,ModuleConstant.UTF8); + //从XML中获取标签内的密文文本 + String encrypt = XmlUtil.toXml(postData); + log.info(String.format(ThirdRunTimeInfoConstant.ENCRYPT,encrypt)); + //格式化密文文本,否则没有标签,会解密失败,参考官方的加解密代码JAVA版本 + String format = ""; + String fromXML = String.format(format, encrypt); + + String msg = ""; //解密后的明文 + WXBizMsgCrypt wxcpt; + if(StringUtil.isEmpty(encrypt)) { + msg = fromXML; + } else { + wxcpt = new WXBizMsgCrypt(token,aesKey, componentAppId); + // 解密消息 + msg = wxcpt.decryptMsg(msgSignature, timeStamp, nonce, fromXML); + } + log.info(String.format(ThirdRunTimeInfoConstant.MSG,msg)); + // 将xml转为map + Map result = WXXmlToMapUtil.xmlToMap(msg); + String infotype = result.get(ModuleConstant.INFO_TYPE); //获取infotype,注:微信开放平台文档中标明固定为:"component_verify_ticket",但参考其他代码,还包含authorized??? + log.info(infotype); + switch (infotype){ + case ModuleConstant.TICKET_UNDERLINE_KEY: //接收票据 【component_verify_ticket】 + String ComponentVerifyTicket = result.get(ModuleConstant.TICKET_KEY); + // 缓存 ticket + redisThird.setComponentVerifyTicket(ComponentVerifyTicket); + // 存数据库 + ComponentVerifyTicketFormDTO ticketFormDTO = new ComponentVerifyTicketFormDTO(); + ticketFormDTO.setComponentAppId(componentAppId); + ticketFormDTO.setComponentVerifyTicket(ComponentVerifyTicket); + //先逻辑删 + ticketDao.updateOldComponentVerifyTicket(); + ticketDao.insertComponentVerifyTicket(ticketFormDTO); + log.info(ModuleConstant.TICKET_UNDERLINE_KEY+":"+ComponentVerifyTicket); + break; + case ModuleConstant.AUTHORIZED: //授权成功 + // 更改customer_mp 授权信息,appId,并绑定 + String authAppId = result.get(ModuleConstant.APP_ID); + String authCode = result.get(ModuleConstant.AUTHORIZATION_CODE_HUMP); + AuthCodeResultDTO authCodeResultDTO = authCodeDao.selectCustomerIdByAuthCode(authCode); + String clientType = authCodeResultDTO.getClientType(); + String customerId = authCodeResultDTO.getCustomerId(); + this.updateCustomerMpAppIdAndCreateOpenPlatform(customerId,authAppId,clientType); + this.authInfoByAuthCode(authCode, customerId,clientType); + authCodeDao.updateAppId(customerId,clientType,authAppId); + this.saveAuthAccountInfo(customerId,authAppId,clientType); +// customerMpDao.updateAuthorizationFlag(authAppId); + case ModuleConstant.UNAUTHORIZED://用户取消授权 + //todo 取消授权 + String authorizerAppId = result.get(ModuleConstant.AUTHORIZER_APP_ID_HUMP); + customerMpDao.updateAuthorizationFlag(authorizerAppId); + } + } catch (Exception e) { + log.error(e.getMessage()); + return ModuleConstant.SUCCESS; + } + log.info(ThirdRunTimeInfoConstant.END_TICKET); + Integer tokenCount = componentAccessTokenDao.selectAccessTokenCount(); + if (tokenCount == NumConstant.ZERO){ + this.getComponentAccessToken(); + } + return ModuleConstant.SUCCESS; + } + + /** + * @Description 定时获取 (令牌,component_access_token) 第三方与微信交互使用的component_access_token + * 每十分钟执行一次,判断是否有马上超时的(15分钟以内算马上超时) + * @param + * @author zxc + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void getComponentAccessToken() { + log.info(ThirdRunTimeInfoConstant.START_GET_COMPONENT_ACCESS_TOKEN); + Map reMap; + //距离超时时间小于15分钟的数量 + Integer tokenCount = componentAccessTokenDao.selectWillOverTokenCount(); + if (tokenCount > NumConstant.ZERO) { + try { + String componentVerifyTicket = redisThird.getComponentVerifyTicket(); + JSONObject jsonObject = new JSONObject(); + jsonObject.put(ModuleConstant.COMPONENT_APPID, componentAppId); + jsonObject.put(ModuleConstant.COMPONENT_APPSECRET, appSecret); + jsonObject.put(ModuleConstant.TICKET_UNDERLINE_KEY, componentVerifyTicket); + String post = HttpClientManager.getInstance().sendPostByJSON(ThirdApiConstant.API_COMPONENT_TOKEN_URL, JSON.toJSONString(jsonObject)).getData(); + HashMap hashMap = JSON.parseObject(post, HashMap.class); + String componentAccessToken = hashMap.get(ModuleConstant.COMPONENT_ACCESS_TOKEN); + String expiresIn = hashMap.get(ModuleConstant.EXPIRES_IN); + Date expiresInTime = this.countExpirationTime(expiresIn); + if (StringUtils.isNotEmpty(componentAccessToken)) { + //令牌信息存DB + ComponentAccessTokenFormDTO formDTO = new ComponentAccessTokenFormDTO(); + formDTO.setComponentAccessToken(componentAccessToken); + formDTO.setExpiresInTime(expiresInTime); + //先逻辑删,在插入 + log.info(ThirdRunTimeInfoConstant.START_DELETE_COMPONENT_ACCESS_TOKEN); + componentAccessTokenDao.updateOldComponentAccessToken(); + componentAccessTokenDao.insertComponentAccessToken(formDTO); + //存缓存 + redisThird.setComponentAccessToken(componentAccessToken); + } else { + throw new RenException(ThirdRunTimeInfoConstant.FAILURE_ACCESS_TOKEN); + } + } catch (Exception e) { + e.printStackTrace(); + } + log.info(ThirdRunTimeInfoConstant.SUCCESS_ACCESS_TOKEN); + } + } + + /** + * @Description 获取预授权码 + * @param + * @author zxc + */ + @Transactional(rollbackFor = Exception.class) + @Override + public String preAuthCode() { + log.info(START_GET_PRE_AUTH_CODE); + String preAuthCode = ""; + try { + String accessToken = redisThird.getComponentAccessToken(); + JSONObject jsonObject = new JSONObject(); + jsonObject.put(ModuleConstant.COMPONENT_APPID, componentAppId); + String post = HttpClientManager.getInstance().sendPostByJSON(ThirdApiConstant.API_CREATE_PREAUTHCODE_URL + accessToken, JSON.toJSONString(jsonObject)).getData(); + log.info(String.format(POST_RESULT,post)); + HashMap hashMap = JSON.parseObject(post, HashMap.class); + preAuthCode = hashMap.get(ModuleConstant.PRE_AUTH_CODE); + String expiresIn = hashMap.get(ModuleConstant.EXPIRES_IN); + Date expiresInTime = this.countExpirationTime(expiresIn); + if (StringUtils.isNotEmpty(preAuthCode)) { + //预授权码 存DB + PreAuthTokenFormDTO formDTO = new PreAuthTokenFormDTO(); + formDTO.setPreAuthToken(preAuthCode); + formDTO.setExpiresInTime(expiresInTime); + //先逻辑删除,在插入DB + preAuthTokenDao.updateOldPreAuthCode(); + preAuthTokenDao.insertPreAuthToken(formDTO); + //预授权码 放入缓存 + redisThird.setPreAuthCode(preAuthCode); + } else { + throw new RuntimeException(FAILURE_GET_PRE_AUTH_CODE); + } + } catch (Exception e) { + e.printStackTrace(); + } + log.info(END_GET_PRE_AUTH_CODE); + return preAuthCode; + } + + /** + * @Description 使用授权码获取授权信息 请求参数:【component_access_token、component_appid、authorization_code】 + * @author zxc + */ + @Transactional(rollbackFor = Exception.class) + public AuthorizationInfoResultDTO authInfoByAuthCode(String authCode,String customerId,String clientType) { + log.info(START_GET_AUTH_INFO); + AuthorizationInfoResultDTO authorizationInfoResultDTO = new AuthorizationInfoResultDTO(); + // 获取令牌【component_access_token】 + String accessToken = redisThird.getComponentAccessToken(); + // 使用授权码获取授权信息 + JSONObject jsonObject = new JSONObject(); + jsonObject.put(ModuleConstant.COMPONENT_APPID, componentAppId); + jsonObject.put(ModuleConstant.AUTHORIZATION_CODE, authCode); + String authInfo = HttpClientManager.getInstance().sendPostByJSON(ThirdApiConstant.API_QUERY_AUTH_URL + accessToken, JSON.toJSONString(jsonObject)).getData(); + HashMap hashMap = JSON.parseObject(authInfo, HashMap.class); + Map map = hashMap.get(ModuleConstant.AUTHORIZATION_INFO); + authorizationInfoResultDTO = mapToEntity(map, AuthorizationInfoResultDTO.class); + String expiresIn = authorizationInfoResultDTO.getExpires_in(); + Date expiresInTime = this.countExpirationTime(expiresIn); + //授权信息分为两张表,基础信息authorization_info,授权列表func_info + // 1. 基础信息 + AuthorizationInfoFormDTO authInfoDTO = new AuthorizationInfoFormDTO(); + authInfoDTO.setAuthorizerAppid(authorizationInfoResultDTO.getAuthorizer_appid()); + authInfoDTO.setAuthorizerAccessToken(authorizationInfoResultDTO.getAuthorizer_access_token()); + authInfoDTO.setAuthorizerRefreshToken(authorizationInfoResultDTO.getAuthorizer_refresh_token()); + authInfoDTO.setExpiresInTime(expiresInTime); + authInfoDTO.setCustomerId(customerId); + authInfoDTO.setClientType(clientType); + //先逻辑删除,在插入 + authorizationInfoDao.updateOldAuthorizationInfo(customerId,clientType); + authorizationInfoDao.insertAuthorizationInfo(authInfoDTO); + // 2. 权限列表 + log.info(START_INSERT_FUNC_INFO); + List funcInfos = new ArrayList<>(); + List func_info = authorizationInfoResultDTO.getFunc_info(); + for (Map map1 : func_info) { + List key = (List)map1.keySet(); + FuncInfoFormDTO fu = new FuncInfoFormDTO(); + String funcscopeCategory = key.get(NumConstant.ZERO).toString(); + fu.setFuncscopeCategory(funcscopeCategory); + Map funcscope = (Map) map1.get(funcscopeCategory); + String funcscopeId = funcscope.get("id").toString(); + fu.setFuncscopeId(funcscopeId); + fu.setAuthorizationInfoAppid(authorizationInfoResultDTO.getAuthorizer_appid()); + fu.setCustomerId(customerId); + funcInfos.add(fu); + } + //先逻辑删除,在插入 + funcInfoDao.updateOldFuncInfo(customerId); + funcInfoDao.insertFuncInfo(funcInfos); + // 授权信息放入缓存 + redisThird.setAuthInfo(authorizationInfoResultDTO); + //authorizer_refresh_token 放入缓存 + redisThird.setAuthorizerRefreshToken(authInfoDTO); + log.info(END_GET_AUTH_INFO); + return authorizationInfoResultDTO; + } + + /** + * @Description 获取/刷新接口调用令牌 + * @param + * @author zxc + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void refreshToken() { + //查询 即将过期的 authorizer_access_token + List willOverDueResultDTOS = authorizationInfoDao.checkWillOverDue(); + if (willOverDueResultDTOS.size() != NumConstant.ZERO && null != willOverDueResultDTOS){ + willOverDueResultDTOS.forEach(willOverDueDTO -> { + String authAppId = willOverDueDTO.getAuthAppId(); + String customerId = willOverDueDTO.getCustomerId(); + String clientType = willOverDueDTO.getClientType(); + JSONObject jsonObject = new JSONObject(); + //授权方AppId + jsonObject.put(ModuleConstant.AUTHORIZER_APPID,authAppId); + //第三方平台AppId + jsonObject.put(ModuleConstant.COMPONENT_APPID,componentAppId); + jsonObject.put(ModuleConstant.AUTHORIZER_REFRESH_TOKEN,willOverDueDTO.getAuthorizerRefreshToken()); + String data = HttpClientManager.getInstance().sendPostByJSON(ThirdApiConstant.API_AUTHORIZER_TOKEN_URL, JSON.toJSONString(jsonObject)).getData(); + Map map = JSON.parseObject(data, HashMap.class); + //authorizer_access_token + String authorizerAccessToken = map.get(ModuleConstant.AUTHORIZER_ACCESS_TOKEN).toString(); + String expiresIn = map.get(ModuleConstant.EXPIRES_IN).toString(); + String authorizerRefreshToken = map.get(ModuleConstant.AUTHORIZER_REFRESH_TOKEN).toString(); + Date expiresInTime = this.countExpirationTime(expiresIn); + //更新DB + AuthorizerAccessTokenFormDTO formDTO = new AuthorizerAccessTokenFormDTO(); + AuthorizationInfoFormDTO authorizationInfo = new AuthorizationInfoFormDTO(); + BeanUtils.copyProperties(formDTO,authorizationInfo); + authorizationInfo.setAuthorizerAppid(authAppId); + formDTO.setAuthorizerAccessToken(authorizerAccessToken); + formDTO.setAuthorizerRefreshToken(authorizerRefreshToken); + formDTO.setExpiresInTime(expiresInTime); + formDTO.setCustomerId(customerId); + formDTO.setAuthAppid(authAppId); + //先逻辑删除,在插入 + authorizationInfoDao.updateOldAuthorizerAccessToken(willOverDueDTO.getCustomerId(),clientType); + authorizationInfoDao.insertAuthorizerAccessToken(formDTO); + + //缓存 refreshAuthorizerAccessToken + redisThird.setAuthorizerRefreshToken(authorizationInfo); + }); + } + + } + + /** + * @Description 授权回调URL,回调时并获取授权信息 + * @param + * @author zxc + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void redirectUri(HttpServletRequest request, HttpServletResponse response) { + try { + request.setCharacterEncoding(ModuleConstant.UTF8); + response.setCharacterEncoding(ModuleConstant.UTF8); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + String customerId = request.getParameter(ModuleConstant.CUSTOMER_ID); + String client = request.getParameter(ModuleConstant.CLIENT); + String authCode = request.getParameter(ModuleConstant.AUTH_CODE); + String expiresIn = request.getParameter(ModuleConstant.EXPIRES_IN); + Date expiresInTime = this.countExpirationTime(expiresIn); +// AuthorizationInfoResultDTO authorizationInfo = this.authInfoByAuthCode(authCode, customerId,client); + //authCode存数据库 + AuthCodeFormDTO formDTO = new AuthCodeFormDTO(); + formDTO.setAuthCode(authCode); + formDTO.setExpiresInTime(expiresInTime); + formDTO.setClientType(client); + //授权方AppId +// formDTO.setAuthAppId(authorizationInfo.getAuthorizer_appid()); + formDTO.setCustomerId(customerId); +// this.updateCustomerMpAppIdAndCreateOpenPlatform(customerId,authorizationInfo.getAuthorizer_appid(),client); + authCodeDao.insertRedirectAuthCode(formDTO); + //authCode存缓存 + redisThird.setAuthCode(formDTO); + + } + + /** + * @Description 获取授权方的帐号基本信息并保存 + * @param customerId + * @param authAppId + * @author zxc + */ + @Transactional(rollbackFor = Exception.class) + public void saveAuthAccountInfo(String customerId, String authAppId,String clientType) { + JSONObject jsonObject = new JSONObject(); + jsonObject.put(ModuleConstant.COMPONENT_APP_ID,componentAppId); + jsonObject.put(ModuleConstant.AUTHORIZER_APP_ID,authAppId); + String data = HttpClientManager.getInstance().sendPostByJSON(ThirdApiConstant.API_GET_AUTHORIZER_INFO, JSON.toJSONString(jsonObject)).getData(); + Map map = JSON.parseObject(data, Map.class); + Map authorizerInfo = map.get(ModuleConstant.AUTHORIZER_INFO); + // 存在 “miniprograminfo” 字段为小程序,不存在为公众号 + boolean keyExist = authorizerInfo.containsKey(ModuleConstant.MINI_PROGRAM_INFO); + if (keyExist == true){ + MiniInfoFormDTO miniInfoFormDTO = this.mapToEntity(authorizerInfo, MiniInfoFormDTO.class); + miniInfoFormDTO.setCustomerId(customerId); + miniInfoFormDTO.setClientType(clientType); + //基础信息插入 + miniInfoDao.insertMiniInfo(miniInfoFormDTO); + String primaryId = miniInfoFormDTO.getId(); + //todo 功能的开通状况信息插入 + List businessInfoList = new ArrayList<>(); + Map businessInfo = (Map) authorizerInfo.get(ModuleConstant.BUSINESS_INFO); + businessInfo.forEach((key, value) -> { + BusinessInfoFormDTO businessInfoForm = new BusinessInfoFormDTO(); + businessInfoForm.setCustomerId(customerId); + businessInfoForm.setClientType(clientType); + businessInfoForm.setFuncType(key.toString()); + businessInfoForm.setOpenStatus(Integer.valueOf(value.toString())); + businessInfoForm.setPrimaryId(primaryId); + businessInfoList.add(businessInfoForm); + }); + businessInfoDao.insertBusinessInfo(businessInfoList); + //todo 小程序配置的合法域名信息插入 + Map miniProgramInfo = (Map) authorizerInfo.get(ModuleConstant.MINI_PROGRAM_INFO); + List networkInfoList = new ArrayList<>(); + Map networkInfo = (Map) miniProgramInfo.get(ModuleConstant.NETWORK); + networkInfo.forEach((key,value) -> { + MiniNetworkInfoFormDTO miniNetworkInfoForm = new MiniNetworkInfoFormDTO(); + miniNetworkInfoForm .setCustomerId(customerId); + miniNetworkInfoForm.setClientType(clientType); + miniNetworkInfoForm.setNetworkType(key.toString()); + miniNetworkInfoForm.setUrl(value.toString()); + miniNetworkInfoForm.setPrimaryId(primaryId); + networkInfoList.add(miniNetworkInfoForm); + }); + miniNetworkInfoDao.insertNetworkInfo(networkInfoList); + //todo 小程序配置的类目信息插入 + List categoryInfoList = new ArrayList<>(); + List categories = (List) miniProgramInfo.get(ModuleConstant.CATEGORIES); + categories.forEach(category -> { + category.forEach((key,value) -> { + MiniCategoryInfoFormDTO categoryInfo = new MiniCategoryInfoFormDTO(); + categoryInfo.setCustomerId(customerId); + categoryInfo.setClientType(clientType); + categoryInfo.setCategorySort(key.toString()); + categoryInfo.setCategoryName(value.toString()); + categoryInfo.setPrimaryId(primaryId); + categoryInfoList.add(categoryInfo); + }); + }); + miniCategoryInfoDao.insertCategoryInfo(categoryInfoList); + }else { + PaInfoFormDTO paInfoFormDTO = this.mapToEntity(authorizerInfo, PaInfoFormDTO.class); + //公众号基本信息插入 + paInfoDao.insertPaInfo(paInfoFormDTO); + String primaryId = paInfoFormDTO.getId(); + //todo 功能的开通状况信息插入 + List businessInfoList = new ArrayList<>(); + Map businessInfo = (Map) authorizerInfo.get(ModuleConstant.BUSINESS_INFO); + businessInfo.forEach((key, value) -> { + BusinessInfoFormDTO businessInfoForm = new BusinessInfoFormDTO(); + businessInfoForm.setCustomerId(customerId); + businessInfoForm.setClientType(clientType); + businessInfoForm.setFuncType(key.toString()); + businessInfoForm.setOpenStatus(Integer.valueOf(value.toString())); + businessInfoForm.setPrimaryId(primaryId); + businessInfoList.add(businessInfoForm); + }); + businessInfoDao.insertBusinessInfo(businessInfoList); + } + + + } + + /** + * @Description 1.创建开放平台账号并绑定 2.回填 customer_mp appId + * @param + * @author zxc + */ + @Transactional(rollbackFor = Exception.class) + public void updateCustomerMpAppIdAndCreateOpenPlatform(String customerId,String authAppId,String clientType){ + Integer authCount = customerMpDao.selectAuthCount(customerId); + String openPlatformId = null; + if (authCount==NumConstant.ZERO){ + //没有任何一个小程序/公众号授权,【先创建,再绑定】 + JSONObject jsonObject = new JSONObject(); + jsonObject.put(ModuleConstant.APP_ID,authAppId); + String data = HttpClientManager.getInstance().sendPostByJSON(ThirdApiConstant.API_CREATE_OPEN, JSON.toJSONString(jsonObject)).getData(); + Map map = JSON.parseObject(data, Map.class); + CreateOpenResultDTO createOpen = new CreateOpenResultDTO(); + createOpen.setErrCode(Integer.valueOf(map.get(ModuleConstant.ERR_CODE))); + createOpen.setErrMsg(map.get(ModuleConstant.ERR_MSG)); + createOpen.setOpenAppId(map.get(ModuleConstant.OPEN_APP_ID)); + switch (createOpen.getErrCode()){ + case NumConstant.ONE: + log.info(CREATE_AND_BIND_SUCCESS); + break; + case NumConstant.ONE_NEG: + throw new RenException(SYSTEM_ERROR); + case ModuleConstant.FORTY_THOUSAND_AND_THIRTEEN: + throw new RenException(INVALID_APP_ID); + case ModuleConstant.EIGHTY_NINE_THOUSAND: + throw new RenException(ACCOUNT_HAS_BOUND_OPEN); + } + CreateOpenFormDTO coForm = new CreateOpenFormDTO(); + coForm.setOpenid(map.get(ModuleConstant.OPEN_APP_ID)); + coForm.setCustomerId(customerId); + //插入 open_platform_account 表 + openPlatformAccountDao.insertOpenPlatFormAccount(coForm); + openPlatformId = coForm.getId(); + }else if (authCount>NumConstant.ZERO){ + String openAppId = openPlatformAccountDao.selectOpenAppIdByCustomerId(customerId); + JSONObject jsonObject = new JSONObject(); + jsonObject.put(ModuleConstant.LOW_APP_ID,componentAppId); + jsonObject.put(ModuleConstant.OPEN_APP_ID,openAppId); + String data = HttpClientManager.getInstance().sendPostByJSON(ThirdApiConstant.API_BIND_OPEN, JSON.toJSONString(jsonObject)).getData(); + Map map = JSON.parseObject(data, Map.class); + CreateOpenResultDTO createOpen = new CreateOpenResultDTO(); + createOpen.setErrCode(Integer.valueOf(map.get(ModuleConstant.ERR_CODE))); + createOpen.setErrMsg(map.get(ModuleConstant.ERR_MSG)); + switch (createOpen.getErrCode()){ + case NumConstant.ONE: + log.info(BIND_SUCCESS); + break; + case NumConstant.ONE_NEG: + throw new RenException(SYSTEM_ERROR); + case ModuleConstant.FORTY_THOUSAND_AND_THIRTEEN: + throw new RenException(INVALID_APP_ID); + case ModuleConstant.EIGHTY_NINE_THOUSAND: + throw new RenException(ACCOUNT_HAS_BOUND_OPEN); + case ModuleConstant.EIGHTY_NINE_THOUSAND_AND_ONE: + throw new RenException(NOT_SAME_CONTRACTOR); + case ModuleConstant.EIGHTY_NINE_THOUSAND_AND_THREE: + throw new RenException(NOT_ALLOWED_OPERATE); + case ModuleConstant.EIGHTY_NINE_THOUSAND_AND_FOUR: + throw new RenException(TO_LIMIT); + } + } + AuthCodeFormDTO formDTO = new AuthCodeFormDTO(); + formDTO.setClientType(clientType); + formDTO.setAuthAppId(authAppId); + formDTO.setCustomerId(customerId); + //回填customer_mp的appId 只需以上三个字段 + customerMpDao.updateAppIDByCustomerIdAndClient(formDTO); + //插入 binding_account + BindingAccountFormDTO bindingAccount = new BindingAccountFormDTO(); + bindingAccount.setOpenPlatformAccountId(openPlatformId); + bindingAccount.setAuthAppId(authAppId); + bindingAccount.setClientType(clientType); + bindingAccount.setCustomerId(customerId); + bindingAccountDao.insertBindingAccount(bindingAccount); + } + + /** + * @Description map 转 Entity + * @param map + * @param entity + * @author zxc + */ + public T mapToEntity(Map map, Class entity) { + T t = null; + try { + t = entity.newInstance(); + for(Field field : entity.getDeclaredFields()) { + if (map.containsKey(field.getName())) { + boolean flag = field.isAccessible(); + field.setAccessible(true); + Object object = map.get(field.getName()); + if (object!= null && field.getType().isAssignableFrom(object.getClass())) { + field.set(t, object); + } + field.setAccessible(flag); + } + } + return t; + } catch (InstantiationException e) { + e.printStackTrace(); + } catch (IllegalAccessException e) { + e.printStackTrace(); + } + return t; + } + + /** + * @Description 转换过期时间 + * @param expiresIn + * @author zxc + */ + public Date countExpirationTime(String expiresIn){ + long now = LocalDateTime.now().toEpochSecond(ZoneOffset.of(NumConstant.POSITIVE_EIGHT_STR)); + long expiresInTime = now + Long.valueOf(expiresIn); + LocalDateTime localDateTime = Instant.ofEpochMilli(expiresInTime).atZone(ZoneOffset.ofHours(NumConstant.EIGHT)).toLocalDateTime(); + Date date = Date.from(localDateTime.atZone(ZoneOffset.ofHours(NumConstant.EIGHT)).toInstant()); + return date; + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CustomerCodeOperationHistoryServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CustomerCodeOperationHistoryServiceImpl.java new file mode 100644 index 0000000000..fc424619cc --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CustomerCodeOperationHistoryServiceImpl.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.CustomerCodeOperationHistoryDao; +import com.epmet.dto.CustomerCodeOperationHistoryDTO; +import com.epmet.entity.CustomerCodeOperationHistoryEntity; +import com.epmet.redis.CustomerCodeOperationHistoryRedis; +import com.epmet.service.CustomerCodeOperationHistoryService; +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-07-09 + */ +@Service +public class CustomerCodeOperationHistoryServiceImpl extends BaseServiceImpl implements CustomerCodeOperationHistoryService { + + @Autowired + private CustomerCodeOperationHistoryRedis customerCodeOperationHistoryRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerCodeOperationHistoryDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerCodeOperationHistoryDTO.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 CustomerCodeOperationHistoryDTO get(String id) { + CustomerCodeOperationHistoryEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerCodeOperationHistoryDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerCodeOperationHistoryDTO dto) { + CustomerCodeOperationHistoryEntity entity = ConvertUtils.sourceToTarget(dto, CustomerCodeOperationHistoryEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerCodeOperationHistoryDTO dto) { + CustomerCodeOperationHistoryEntity entity = ConvertUtils.sourceToTarget(dto, CustomerCodeOperationHistoryEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CustomerMpServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CustomerMpServiceImpl.java new file mode 100644 index 0000000000..5bb85272a0 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/CustomerMpServiceImpl.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.CustomerMpDao; +import com.epmet.dto.CustomerMpDTO; +import com.epmet.entity.CustomerMpEntity; +import com.epmet.redis.CustomerMpRedis; +import com.epmet.service.CustomerMpService; +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-07-09 + */ +@Service +public class CustomerMpServiceImpl extends BaseServiceImpl implements CustomerMpService { + + @Autowired + private CustomerMpRedis customerMpRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerMpDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerMpDTO.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 CustomerMpDTO get(String id) { + CustomerMpEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, CustomerMpDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(CustomerMpDTO dto) { + CustomerMpEntity entity = ConvertUtils.sourceToTarget(dto, CustomerMpEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerMpDTO dto) { + CustomerMpEntity entity = ConvertUtils.sourceToTarget(dto, CustomerMpEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerAgencyServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerAgencyServiceImpl.java new file mode 100644 index 0000000000..f3301377d0 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerAgencyServiceImpl.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.PaCustomerAgencyDao; +import com.epmet.dto.PaCustomerAgencyDTO; +import com.epmet.entity.PaCustomerAgencyEntity; +import com.epmet.redis.PaCustomerAgencyRedis; +import com.epmet.service.PaCustomerAgencyService; +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-07-09 + */ +@Service +public class PaCustomerAgencyServiceImpl extends BaseServiceImpl implements PaCustomerAgencyService { + + @Autowired + private PaCustomerAgencyRedis paCustomerAgencyRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PaCustomerAgencyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PaCustomerAgencyDTO.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 PaCustomerAgencyDTO get(String id) { + PaCustomerAgencyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PaCustomerAgencyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PaCustomerAgencyDTO dto) { + PaCustomerAgencyEntity entity = ConvertUtils.sourceToTarget(dto, PaCustomerAgencyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PaCustomerAgencyDTO dto) { + PaCustomerAgencyEntity entity = ConvertUtils.sourceToTarget(dto, PaCustomerAgencyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-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 new file mode 100644 index 0000000000..1c744dc9ee --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerServiceImpl.java @@ -0,0 +1,374 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.common.token.constant.LoginConstant; +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.redis.RedisKeys; +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.PaConstant; +import com.epmet.dao.*; +import com.epmet.dto.*; +import com.epmet.dto.form.CreateAgencyFormDTO; +import com.epmet.dto.form.MyInfoFormDTO; +import com.epmet.dto.form.RegisterFormDTO; +import com.epmet.dto.form.RegisterInfoFormDTO; +import com.epmet.dto.result.AgencyLevelListResultDTO; +import com.epmet.dto.result.CreateAgencyResultDTO; +import com.epmet.dto.result.CustomerAgencyResultDTO; +import com.epmet.dto.result.MyInfoResultDTO; +import com.epmet.entity.*; +import com.epmet.redis.PaCustomerRedis; +import com.epmet.service.CustomerMpService; +import com.epmet.service.PaCustomerAgencyService; +import com.epmet.service.PaCustomerService; +import com.epmet.service.PaCustomerUserAgencyService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +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.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 客户信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-07-09 + */ +@Service +public class PaCustomerServiceImpl extends BaseServiceImpl implements PaCustomerService { + + private Logger logger = LogManager.getLogger(PaCustomerServiceImpl.class); + @Autowired + private PaCustomerRedis paCustomerRedis; + @Autowired + private PaUserDao paUserDao; + @Autowired + private PaUserWechatDao paUserWechatDao; + @Autowired + private PaUserVisitedDao paUserVisitedDao; + @Autowired + private PaCustomerAgencyDao paCustomerAgencyDao; + @Autowired + private CustomerMpDao customerMpDao; + @Autowired + private PaCustomerUserAgencyDao paCustomerUserAgencyDao; + @Autowired + private RedisUtils redisUtils; + @Autowired + private PaCustomerAgencyService paCustomerAgencyService; + @Autowired + private PaCustomerUserAgencyService paCustomerUserAgencyService; + @Autowired + private CustomerMpService customerMpService; + @Autowired + private CpUserDetailRedis cpUserDetailRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PaCustomerDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PaCustomerDTO.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 PaCustomerDTO get(String id) { + PaCustomerEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PaCustomerDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PaCustomerDTO dto) { + PaCustomerEntity entity = ConvertUtils.sourceToTarget(dto, PaCustomerEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PaCustomerDTO dto) { + PaCustomerEntity entity = ConvertUtils.sourceToTarget(dto, PaCustomerEntity.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 register(RegisterFormDTO formDTO) { + //1.根据手机号查询到用户信息,判断用户是否存 + List userList = paUserDao.selectUserByPhone(formDTO.getPhone()); + if (null != userList && userList.size() > NumConstant.ZERO) { + throw new RenException(PaConstant.PHONE_EXCEPTION); + } + + //2.校验验证码是否正确 + String smsCodeKey = RedisKeys.getLoginSmsCodeKey(LoginConstant.APP_PUBLIC, LoginConstant.CLIENT_MP, formDTO.getPhone()); + String rightSmsCode = (String) redisUtils.get(smsCodeKey); + if (!formDTO.getSmsCode().equals(rightSmsCode)) { + logger.error(String.format("验证码错误code[%s],msg[%s]", EpmetErrorCode.MOBILE_CODE_ERROR.getCode(), EpmetErrorCode.MOBILE_CODE_ERROR.getMsg())); + throw new RenException(EpmetErrorCode.MOBILE_CODE_ERROR.getCode()); + } + + //3.pa_user表更新数据 + PaUserEntity userEntity = new PaUserEntity(); + userEntity.setId(formDTO.getUserId()); + userEntity.setPhone(formDTO.getPhone()); + userEntity.setRealName(formDTO.getSurName()); + userEntity.setGender(formDTO.getGender().toString()); + if (paUserDao.updateById(userEntity) < NumConstant.ONE) { + throw new RenException(PaConstant.UPDATE_USER_EXCEPTION); + } + + //2.访问记录表新增数据 + PaUserWechatDTO dto = new PaUserWechatDTO(); + dto.setUserId(formDTO.getUserId()); + PaUserWechatEntity wechatEntity = paUserWechatDao.selectWechatByUserId(dto); + if (null == wechatEntity) { + throw new RenException(PaConstant.SELECT_WECHAT_EXCEPTION); + } + PaUserVisitedEntity visitedEntity = new PaUserVisitedEntity(); + visitedEntity.setUserId(formDTO.getUserId()); + visitedEntity.setWxOpenId(wechatEntity.getWxOpenId()); + visitedEntity.setOpenId(wechatEntity.getWxOpenId()); + visitedEntity.setPhone(formDTO.getPhone()); + if (paUserVisitedDao.insert(visitedEntity) < NumConstant.ONE) { + throw new RenException(PaConstant.SAVE_VISITED_EXCEPTION); + } + } + + /** + * @return + * @Author sun + * @Description 公众号-查询组织级别 + **/ + @Override + public List agencyLevelList() { + List list = new ArrayList<>(); + AgencyLevelListResultDTO dto1 = new AgencyLevelListResultDTO(); + dto1.setLevelKey(PaConstant.PROVINCE_KEY); + dto1.setLevelName(PaConstant.PROVINCE_NAME); + list.add(dto1); + AgencyLevelListResultDTO dto2 = new AgencyLevelListResultDTO(); + dto2.setLevelKey(PaConstant.CITY_KEY); + dto2.setLevelName(PaConstant.CITY_NAME); + list.add(dto2); + AgencyLevelListResultDTO dto3 = new AgencyLevelListResultDTO(); + dto3.setLevelKey(PaConstant.STREET_KEY); + dto3.setLevelName(PaConstant.STREET_NAME); + list.add(dto3); + AgencyLevelListResultDTO dto4 = new AgencyLevelListResultDTO(); + dto4.setLevelKey(PaConstant.COMMUNITY_KEY); + dto4.setLevelName(PaConstant.COMMUNITY_NAME); + list.add(dto4); + return list; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 公众号-创建组织 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public CreateAgencyResultDTO createAgency(TokenDto tokenDTO, CreateAgencyFormDTO formDTO) { + //1.客户表初始化数据 + PaCustomerEntity entity = new PaCustomerEntity(); + entity.setIsInitialize(NumConstant.ZERO); + entity.setCustomerName(formDTO.getAgencyName()); + baseDao.insert(entity); + + //2.客户组织表初始化数据 + PaCustomerAgencyEntity agencyEntity = new PaCustomerAgencyEntity(); + agencyEntity.setCustomerId(entity.getId()); + agencyEntity.setAgencyName(formDTO.getAgencyName()); + agencyEntity.setLevel(formDTO.getLevel()); + agencyEntity.setAreaCode(formDTO.getAreaCode()); + agencyEntity.setProvince(formDTO.getProvince()); + agencyEntity.setCity(formDTO.getCity()); + agencyEntity.setDistrict(formDTO.getDistrict()); + agencyEntity.setPartybranchnum(formDTO.getPartyBranchNum()); + paCustomerAgencyService.insert(agencyEntity); + + //3.客户组织用户关系表初始化数据 + PaCustomerUserAgencyEntity cuaEntity = new PaCustomerUserAgencyEntity(); + cuaEntity.setCustomerId(entity.getId()); + cuaEntity.setAgencyId(agencyEntity.getId()); + cuaEntity.setUserId(tokenDTO.getUserId()); + paCustomerUserAgencyService.insert(cuaEntity); + + //4.客户小程序关系表初始化数据 + List listEntity = new ArrayList<>(); + CustomerMpEntity mpEntity1 = new CustomerMpEntity(); + mpEntity1.setCustomerId(entity.getId()); + mpEntity1.setAuthorizationFlag(NumConstant.ZERO); + mpEntity1.setClient(PaConstant.RESI_CLIENT); + listEntity.add(mpEntity1); + CustomerMpEntity mpEntity2 = ConvertUtils.sourceToTarget(mpEntity1, CustomerMpEntity.class); + mpEntity2.setClient(PaConstant.WORK_CLIENT); + listEntity.add(mpEntity2); + customerMpService.insertBatch(listEntity); + + //5.token中添加customerId + //5-1.获取redis中的token + //获取缓存中的token + TokenDto redisTokenDTO = cpUserDetailRedis.get(LoginConstant.APP_PUBLIC, LoginConstant.CLIENT_MP, tokenDTO.getUserId(), TokenDto.class); + if (redisTokenDTO == null) { + throw new RenException(PaConstant.TOKEN_EXCEPTION); + } + //5-2.添加customerId + redisTokenDTO.setCustomerId(entity.getId()); + //获取key的剩余过期时间 + String key = RedisKeys.getCpUserKey(LoginConstant.APP_PUBLIC, LoginConstant.CLIENT_MP, tokenDTO.getUserId()); + long expire = redisUtils.getExpire(key); + cpUserDetailRedis.set(redisTokenDTO, expire); + //6.接口返参 + CreateAgencyResultDTO resultDTO = new CreateAgencyResultDTO(); + resultDTO.setCustomerId(entity.getId()); + resultDTO.setToken(redisTokenDTO.getToken()); + + return resultDTO; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 公众号-查询我的信息 + **/ + @Override + public MyInfoResultDTO myInfo(TokenDto tokenDTO, MyInfoFormDTO formDTO) { + + //0.根据token中userId查询对应的客户Id,客户Id没有则表示用户没有填写过组织信息,需要继续完善信息 + PaCustomerUserAgencyDTO dto = paCustomerUserAgencyDao.selectByUserId(tokenDTO.getUserId()); + if(null==dto||null==dto.getCustomerId()){ + return new MyInfoResultDTO(); + } + String customerId = dto.getCustomerId(); + + //1.查询客户组织信息 + PaCustomerAgencyDTO agencyDTO = paCustomerAgencyDao.selectCustomerAgency(customerId); + if (null == agencyDTO) { + throw new RenException(PaConstant.SELECT_AGENCY_EXCEPTION); + } + + //2.查询客户小程序授权结果信息 + List listMpDTO = customerMpDao.selectByCustomerId(customerId); + if (null == agencyDTO || listMpDTO.size() != NumConstant.TWO) { + throw new RenException(PaConstant.CUSTOMER_MP_EXCEPTION); + } + + //3.封装结果信息 + MyInfoResultDTO resultDTO = ConvertUtils.sourceToTarget(agencyDTO, MyInfoResultDTO.class); + resultDTO.setPartyBranchNum(agencyDTO.getPartybranchnum()); + for (CustomerMpDTO mp : listMpDTO) { + if (PaConstant.CLIENT_RESI.equals(mp.getClient())) { + resultDTO.setResiAuthorization(mp.getAuthorizationFlag()); + } + if (PaConstant.CLIENT_WORK.equals(mp.getClient())) { + resultDTO.setWorkAuthorization(mp.getAuthorizationFlag()); + } + } + + return resultDTO; + } + + /** + * @param formDTO + * @return + * @Author sun + * @Description 查询公众号注册的客户信息列表 + **/ + @Override + public PageData registerInfo(RegisterInfoFormDTO formDTO) { + //分页参数 + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); + //1.查询客户组织信息 + List list = baseDao.registerInfo(); + //2.查询客户小程序授权信息 + List mpList = customerMpDao.selectAll(); + //3.封装数据 + list.forEach(l -> { + mpList.forEach(mp -> { + if (l.getCustomerId().equals(mp.getCustomerId())) { + //居民端小程序授权情况 + if (PaConstant.CLIENT_RESI.equals(mp.getClient())) { + l.setResiAuth(mp.getAuthorizationFlag()); + } + //政府端小程序授权情况 + if (PaConstant.CLIENT_WORK.equals(mp.getClient())) { + l.setWorkAuth(mp.getAuthorizationFlag()); + } + } + }); + }); + PageInfo pageInfo = new PageInfo<>(); + return new PageData<>(list, pageInfo.getTotal()); + } + + + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerUserAgencyServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerUserAgencyServiceImpl.java new file mode 100644 index 0000000000..3ddecf4123 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaCustomerUserAgencyServiceImpl.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.PaCustomerUserAgencyDao; +import com.epmet.dto.PaCustomerUserAgencyDTO; +import com.epmet.entity.PaCustomerUserAgencyEntity; +import com.epmet.redis.PaCustomerUserAgencyRedis; +import com.epmet.service.PaCustomerUserAgencyService; +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-07-09 + */ +@Service +public class PaCustomerUserAgencyServiceImpl extends BaseServiceImpl implements PaCustomerUserAgencyService { + + @Autowired + private PaCustomerUserAgencyRedis paCustomerUserAgencyRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PaCustomerUserAgencyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PaCustomerUserAgencyDTO.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 PaCustomerUserAgencyDTO get(String id) { + PaCustomerUserAgencyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PaCustomerUserAgencyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PaCustomerUserAgencyDTO dto) { + PaCustomerUserAgencyEntity entity = ConvertUtils.sourceToTarget(dto, PaCustomerUserAgencyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PaCustomerUserAgencyDTO dto) { + PaCustomerUserAgencyEntity entity = ConvertUtils.sourceToTarget(dto, PaCustomerUserAgencyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaUserServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaUserServiceImpl.java new file mode 100644 index 0000000000..2184893584 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaUserServiceImpl.java @@ -0,0 +1,193 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.PaCustomerDao; +import com.epmet.dao.PaUserDao; +import com.epmet.dto.PaCustomerDTO; +import com.epmet.dto.PaUserDTO; +import com.epmet.dto.PaUserWechatDTO; +import com.epmet.dto.result.CustomerUserResultDTO; +import com.epmet.dto.result.SaveUserResultDTO; +import com.epmet.entity.PaUserEntity; +import com.epmet.entity.PaUserWechatEntity; +import com.epmet.redis.PaUserRedis; +import com.epmet.service.PaUserService; +import com.epmet.service.PaUserWechatService; +import me.chanjar.weixin.mp.bean.result.WxMpUser; +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-07-09 + */ +@Service +public class PaUserServiceImpl extends BaseServiceImpl implements PaUserService { + + @Autowired + private PaUserRedis paUserRedis; + @Autowired + private PaUserWechatService paUserWechatService; + @Autowired + private PaCustomerDao paCustomerDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PaUserDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PaUserDTO.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 PaUserDTO get(String id) { + PaUserEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PaUserDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PaUserDTO dto) { + PaUserEntity entity = ConvertUtils.sourceToTarget(dto, PaUserEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PaUserDTO dto) { + PaUserEntity entity = ConvertUtils.sourceToTarget(dto, PaUserEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param wxMpUser + * @return + * @Author sun + * @Description 根据openId新增或更新用户信息 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public SaveUserResultDTO saveUser(WxMpUser wxMpUser) { + SaveUserResultDTO resultDTO = new SaveUserResultDTO(); + //1.根据openId查询user_wechat表是否存在用户信息 + PaUserWechatDTO wechatDTO = paUserWechatService.getWechatByOpenId(wxMpUser.getOpenId()); + + //2.不存在则新增用户信息,存在则更新user_wechat表信息 + if (null == wechatDTO || null == wechatDTO.getId()) { + //2.1、user表新增数据 + PaUserEntity userEntity = new PaUserEntity(); + baseDao.insert(userEntity); + //2.2、user_wechat表新增数据 + PaUserWechatEntity wechatEntity = new PaUserWechatEntity(); + wechatEntity.setUserId(userEntity.getId()); + wechatEntity.setWxOpenId(wxMpUser.getOpenId()); + wechatEntity.setUnionId(null == wxMpUser.getUnionId() ? "" : wxMpUser.getUnionId()); + wechatEntity.setGender(wxMpUser.getSex().toString()); + wechatEntity.setNickname(wxMpUser.getNickname()); + wechatEntity.setHeadImgUrl(null == wxMpUser.getHeadImgUrl() ? "" : wxMpUser.getHeadImgUrl()); + wechatEntity.setCountry(null == wxMpUser.getCountry() ? "" : wxMpUser.getCountry()); + wechatEntity.setProvince(null == wxMpUser.getProvince() ? "" : wxMpUser.getProvince()); + wechatEntity.setCity(null == wxMpUser.getCity() ? "" : wxMpUser.getCity()); + wechatEntity.setLanguage(null == wxMpUser.getLanguage() ? "" : wxMpUser.getLanguage()); + paUserWechatService.insert(wechatEntity); + + resultDTO.setUserId(userEntity.getId()); + } else { + //2.3、更新user_wechat表数据 + PaUserWechatEntity wechatEntity = ConvertUtils.sourceToTarget(wechatDTO, PaUserWechatEntity.class); + wechatEntity.setGender(wxMpUser.getSex().toString()); + wechatEntity.setNickname(wxMpUser.getNickname()); + wechatEntity.setHeadImgUrl(null == wxMpUser.getHeadImgUrl() ? "" : wxMpUser.getHeadImgUrl()); + wechatEntity.setCountry(null == wxMpUser.getCountry() ? "" : wxMpUser.getCountry()); + wechatEntity.setProvince(null == wxMpUser.getProvince() ? "" : wxMpUser.getProvince()); + wechatEntity.setCity(null == wxMpUser.getCity() ? "" : wxMpUser.getCity()); + wechatEntity.setLanguage(null == wxMpUser.getLanguage() ? "" : wxMpUser.getLanguage()); + paUserWechatService.updateById(wechatEntity); + + resultDTO.setUserId(wechatDTO.getUserId()); + } + + //3.返回userId + return resultDTO; + } + + /** + * @param phone + * @return + * @Author sun + * @Description 根据手机号查询公众号用户基本信息,校验用户是否存在 + **/ + @Override + public CustomerUserResultDTO checkPaUser(String phone) { + CustomerUserResultDTO resultDTO = new CustomerUserResultDTO(); + List userList = baseDao.selectUserByPhone(phone); + if (null == userList || userList.size() < NumConstant.ONE) { + resultDTO.setPaUserResult(null); + resultDTO.setPaCustomerResult(null); + return resultDTO; + } + PaUserDTO dto = userList.get(NumConstant.ZERO); + List customerList = paCustomerDao.selectCustomerByUserId(dto.getId()); + + resultDTO.setPaUserResult(dto); + resultDTO.setPaCustomerResult(customerList.size() > NumConstant.ZERO ? customerList.get(NumConstant.ZERO) : null); + + return resultDTO; + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaUserVisitedServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaUserVisitedServiceImpl.java new file mode 100644 index 0000000000..2071fde88f --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaUserVisitedServiceImpl.java @@ -0,0 +1,141 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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.PaUserVisitedDao; +import com.epmet.dao.PaUserWechatDao; +import com.epmet.dto.PaUserVisitedDTO; +import com.epmet.dto.PaUserWechatDTO; +import com.epmet.dto.form.SaveUserVisitedFormDTO; +import com.epmet.entity.PaUserVisitedEntity; +import com.epmet.entity.PaUserWechatEntity; +import com.epmet.redis.PaUserVisitedRedis; +import com.epmet.service.PaUserVisitedService; +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-07-09 + */ +@Service +public class PaUserVisitedServiceImpl extends BaseServiceImpl implements PaUserVisitedService { + + @Autowired + private PaUserVisitedRedis paUserVisitedRedis; + @Autowired + private PaUserWechatDao paUserWechatDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PaUserVisitedDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PaUserVisitedDTO.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 PaUserVisitedDTO get(String id) { + PaUserVisitedEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PaUserVisitedDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PaUserVisitedDTO dto) { + PaUserVisitedEntity entity = ConvertUtils.sourceToTarget(dto, PaUserVisitedEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PaUserVisitedDTO dto) { + PaUserVisitedEntity entity = ConvertUtils.sourceToTarget(dto, PaUserVisitedEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param visited + * @return + * @Author sun + * @Description 用户登陆,新增访问记录数据 + **/ + @Override + @Transactional(rollbackFor = Exception.class) + public void saveUserVisited(SaveUserVisitedFormDTO visited) { + PaUserWechatDTO dto = new PaUserWechatDTO(); + //1.查询登陆手机号对应的用户微信信息 + dto.setUserId(visited.getUserId()); + PaUserWechatEntity userEntity = paUserWechatDao.selectWechatByUserId(dto); + + //2.查询当前登陆人对应的微信信息 + String openId = userEntity.getWxOpenId(); + if(!visited.getUserId().equals(visited.getLogonUserId())){ + dto.setUserId(visited.getLogonUserId()); + PaUserWechatEntity logonUser = paUserWechatDao.selectWechatByUserId(dto); + openId = logonUser.getWxOpenId(); + } + + //3.新增访问记录数据 + PaUserVisitedEntity entity = new PaUserVisitedEntity(); + entity.setUserId(visited.getUserId()); + entity.setWxOpenId(userEntity.getWxOpenId()); + entity.setOpenId(openId); + entity.setPhone(visited.getPhone()); + baseDao.insert(entity); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaUserWechatServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaUserWechatServiceImpl.java new file mode 100644 index 0000000000..9fb9089c5e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/PaUserWechatServiceImpl.java @@ -0,0 +1,115 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.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.PaUserWechatDao; +import com.epmet.dto.PaUserWechatDTO; +import com.epmet.entity.PaUserWechatEntity; +import com.epmet.redis.PaUserWechatRedis; +import com.epmet.service.PaUserWechatService; +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-07-09 + */ +@Service +public class PaUserWechatServiceImpl extends BaseServiceImpl implements PaUserWechatService { + + @Autowired + private PaUserWechatRedis paUserWechatRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PaUserWechatDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PaUserWechatDTO.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 PaUserWechatDTO get(String id) { + PaUserWechatEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PaUserWechatDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PaUserWechatDTO dto) { + PaUserWechatEntity entity = ConvertUtils.sourceToTarget(dto, PaUserWechatEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PaUserWechatDTO dto) { + PaUserWechatEntity entity = ConvertUtils.sourceToTarget(dto, PaUserWechatEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @param openId + * @return + * @Author sun + * @Description 根据openId查询user_wechat表信息 + **/ + @Override + public PaUserWechatDTO getWechatByOpenId(String openId) { + return baseDao.selectWechatByOpenId(openId); + } + +} \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/WarrantServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/WarrantServiceImpl.java new file mode 100644 index 0000000000..1db2652bfa --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/service/impl/WarrantServiceImpl.java @@ -0,0 +1,129 @@ +package com.epmet.service.impl; + +import com.alibaba.nacos.client.config.utils.IOUtils; +import com.epmet.constant.ModuleConstant; +import com.epmet.constant.ThirdRunTimeInfoConstant; +import com.epmet.dao.CodeAuditRecordDao; +import com.epmet.dao.CodeAuditResultDao; +import com.epmet.dao.CodeCustomerDao; +import com.epmet.dao.MiniInfoDao; +import com.epmet.dto.form.CodeAuditRecordFormDTO; +import com.epmet.dto.result.CustomerIdAndClientResultDTO; +import com.epmet.dto.result.TemplateAndAppIdResultDTO; +import com.epmet.exception.AesException; +import com.epmet.service.WarrantService; +import com.epmet.util.WXBizMsgCrypt; +import com.epmet.util.WXXmlToMapUtil; +import com.epmet.util.XmlUtil; +import com.github.pagehelper.util.StringUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.dom4j.DocumentException; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.util.Map; + +/** + * @Author zxc + * @CreateTime 2020/7/10 11:03 + */ +@Slf4j +@Service +public class WarrantServiceImpl implements WarrantService { + + @Value("${third.platform.appId}") + private String componentAppId; + @Value("${third.platform.appSecret}") + private String appSecret; + @Value("${third.platform.aesKey}") + private String aesKey; + @Value("${third.platform.token}") + private String token; + @Autowired + private ComponentVerifyTicketServiceImpl componentVerifyTicketService; + @Autowired + private CodeAuditRecordDao codeAuditRecordDao; + @Autowired + private MiniInfoDao miniInfoDao; + @Autowired + private CodeCustomerDao codeCustomerDao; + @Autowired + private CodeAuditResultDao codeAuditResultDao; + + /** + * @Description 1.保存代码审核结果 2.更新代码上传结果 + * @param request + * @param appid + * @param response + * @author zxc + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void acceptMessageAndEvent(HttpServletRequest request, String appid, HttpServletResponse response)throws IOException, DocumentException, AesException { + request.setCharacterEncoding(ModuleConstant.UTF8); + String msgSignature = request.getParameter(ModuleConstant.MSG_SIGNATURE); + String timeStamp = request.getParameter(ModuleConstant.TIMESTAMP); + String nonce = request.getParameter(ModuleConstant.NONCE); + if (!StringUtils.isNotBlank(msgSignature)) { + return;// 微信推送给第三方开放平台的消息一定是加过密的,无消息加密无法解密消息 + } + InputStream inputStream; + String postData = null; + inputStream = request.getInputStream(); + postData= IOUtils.toString(inputStream,ModuleConstant.UTF8); + //从XML中获取标签内的密文文本 + String encrypt = XmlUtil.toXml(postData); + log.info(String.format(ThirdRunTimeInfoConstant.ENCRYPT,encrypt)); + //格式化密文文本,否则没有标签,会解密失败,参考官方的加解密代码JAVA版本 + String format = ""; + String fromXML = String.format(format, encrypt); + + String msg = ""; //解密后的明文 + WXBizMsgCrypt wxcpt; + if(StringUtil.isEmpty(encrypt)) { + msg = fromXML; + } else { + wxcpt = new WXBizMsgCrypt(token,aesKey, componentAppId); + // 解密消息 + msg = wxcpt.decryptMsg(msgSignature, timeStamp, nonce, fromXML); + } + log.info(String.format(ThirdRunTimeInfoConstant.MSG,msg)); + // 将xml转为map + Map result = WXXmlToMapUtil.multilayerXmlToMap(msg); + CodeAuditRecordFormDTO codeAuditRecord = componentVerifyTicketService.mapToEntity(result, CodeAuditRecordFormDTO.class); + String toUserName = codeAuditRecord.getToUserName();//小程序原始ID + CustomerIdAndClientResultDTO customerIdAndClientResultDTO = miniInfoDao.selectCustomerIdAndClientByToUserName(toUserName); + String clientType = customerIdAndClientResultDTO.getClientType(); + String customerId = customerIdAndClientResultDTO.getCustomerId(); + TemplateAndAppIdResultDTO templateAndAppId = codeCustomerDao.selectTemplateAndAppId(customerId, clientType); + String authAppId = templateAndAppId.getAuthAppId(); + String templateId = templateAndAppId.getTemplateId(); + codeAuditRecord.setClientType(clientType); + codeAuditRecord.setCustomerId(customerId); + codeAuditRecord.setAuthAppId(authAppId); + codeAuditRecord.setTemplateId(templateId); + //插入 代码审核 记录 + codeAuditRecordDao.insertCodeAuditRecord(codeAuditRecord); + // 修改 code_audit_result 中的代码审核结果 + String event = codeAuditRecord.getEvent(); + String codeResult = null; + switch (event){ + case ModuleConstant.WEAPP_AUDIT_SUCCESS: + codeResult = ModuleConstant.AUDIT_SUCCESS; + case ModuleConstant.WEAPP_AUDIT_FAIL: + codeResult = ModuleConstant.AUDIT_FAILED; + case ModuleConstant.WEAPP_AUDIT_DELAY: + codeResult = ModuleConstant.DELAY; + } + String codeCustomerId = codeCustomerDao.selectCodeCustomerId(codeAuditRecord); + codeAuditResultDao.updateAuditResult(customerId,codeCustomerId,codeResult); + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/OkHttpHelper.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/OkHttpHelper.java new file mode 100644 index 0000000000..0c11244db8 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/OkHttpHelper.java @@ -0,0 +1,30 @@ +package com.epmet.util; + +import okhttp3.*; +import org.springframework.stereotype.Component; + +import java.io.IOException; + +/** + * @Author zxc + * @CreateTime 2020/7/7 17:39 + */ +@Component +public class OkHttpHelper { + + public static final MediaType JSON = MediaType.get("application/json; charset=utf-8"); + + OkHttpClient client = new OkHttpClient(); + + public String post(String url, String json) throws IOException { + RequestBody body = RequestBody.create(JSON, json); + Request request = new Request.Builder() + .url(url) + .post(body) + .build(); + try (Response response = client.newCall(request).execute()) { + return response.body().string(); + } + } + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/PKCS7EncoderUtil.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/PKCS7EncoderUtil.java new file mode 100644 index 0000000000..1cfac333af --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/PKCS7EncoderUtil.java @@ -0,0 +1,63 @@ +package com.epmet.util; + +import com.epmet.commons.tools.constant.NumConstant; + +import java.nio.charset.Charset; +import java.util.Arrays; + +/** + * @Author zxc + * @CreateTime 2020/7/6 10:45 + */ +public class PKCS7EncoderUtil { + + static Charset CHARSET = Charset.forName("utf-8"); + static int BLOCK_SIZE = 32; + + /** + * 获得对明文进行补位填充的字节. + * + * @param count 需要进行填充补位操作的明文字节个数 + * @return 补齐用的字节数组 + */ + static byte[] encode(int count) { + // 计算需要填充的位数 + int amountToPad = BLOCK_SIZE - (count % BLOCK_SIZE); + if (amountToPad == NumConstant.ZERO) { + amountToPad = BLOCK_SIZE; + } + // 获得补位所用的字符 + char padChr = chr(amountToPad); + String tmp = new String(); + for (int index = NumConstant.ZERO; index < amountToPad; index++) { + tmp += padChr; + } + return tmp.getBytes(CHARSET); + } + + /** + * 删除解密后明文的补位字符 + * + * @param decrypted 解密后的明文 + * @return 删除补位字符后的明文 + */ + static byte[] decode(byte[] decrypted) { + int pad = (int) decrypted[decrypted.length - 1]; + if (pad < NumConstant.ONE || pad > 32) { + pad = NumConstant.ZERO; + } + return Arrays.copyOfRange(decrypted, 0, decrypted.length - pad); + } + + /** + * 将数字转化成ASCII码对应的字符,用于对明文进行补码 + * + * @param a 需要转化的数字 + * @return 转化得到的字符 + */ + static char chr(int a) { + byte target = (byte) (a & 0xFF); + return (char) target; + } + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/WXBizMsgCrypt.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/WXBizMsgCrypt.java new file mode 100644 index 0000000000..332e363eaa --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/WXBizMsgCrypt.java @@ -0,0 +1,246 @@ +package com.epmet.util; + +import com.epmet.exception.AesException; +import me.chanjar.weixin.common.util.crypto.PKCS7Encoder; +import org.apache.commons.codec.binary.Base64; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; +import org.xml.sax.InputSource; + +import java.io.StringReader; +import java.nio.charset.Charset; +import java.security.MessageDigest; +import java.util.Arrays; + +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; + +/** + * 提供接收和推送给公众平台消息的加解密接口(UTF8编码的字符串). + *

    *
  1. 第三方回复加密消息给公众平台
  2. *
  3. 第三方收到公众平台发送的消息,验证消息的安全性,并对消息进行解密。
  4. + *
+ * 说明:异常java.security.InvalidKeyException:illegal Key Size的解决方案 + *
    + *
  1. 在官方网站下载JCE无限制权限策略文件(JDK7的下载地址: * + * http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html
  2. + *
  3. 下载后解压,可以看到local_policy.jar和US_export_policy.jar以及readme.txt
  4. + *
  5. 如果安装了JRE,将两个jar文件放到%JRE_HOME%\lib\security目录下覆盖原来的文件
  6. + *
  7. 如果安装了JDK,将两个jar文件放到%JDK_HOME%\jre\lib\security目录下覆盖原来文件
  8. + * + *
+ */ + +/** + * @Author zxc + * @CreateTime 2020/7/6 9:51 + */ +public class WXBizMsgCrypt { + static Charset CHARSET = Charset.forName("utf-8"); + Base64 base64 = new Base64(); + byte[] aesKey; + String token; + String appId; + + /** + * 构造函数 + * @param token 公众平台上,开发者设置的token + * @param encodingAesKey 公众平台上,开发者设置的EncodingAESKey + * @param appId 公众平台appid + * + * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息 + */ + public WXBizMsgCrypt(String token, String encodingAesKey, String appId) throws AesException { + if (encodingAesKey.length() != 43) { + throw new AesException(AesException.IllegalAesKey); + } + + this.token = token; + this.appId = appId; + aesKey = Base64.decodeBase64(encodingAesKey + "="); + } + + // 还原4个字节的网络字节序 + int recoverNetworkBytesOrder(byte[] orderBytes) { + int sourceNumber = 0; + for (int i = 0; i < 4; i++) { + sourceNumber <<= 8; + sourceNumber |= orderBytes[i] & 0xff; + } + return sourceNumber; + } + + /** + * 对密文进行解密. + * @param text 需要解密的密文 + * @return 解密得到的明文 + * @throws AesException aes解密失败 + */ + String decrypt(String text) throws AesException { + byte[] original; + try { + // 设置解密模式为AES的CBC模式 + Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding"); + SecretKeySpec key_spec = new SecretKeySpec(aesKey, "AES"); + IvParameterSpec iv = new IvParameterSpec(Arrays.copyOfRange(aesKey, 0, 16)); + cipher.init(Cipher.DECRYPT_MODE, key_spec, iv); + + // 使用BASE64对密文进行解码 + byte[] encrypted = Base64.decodeBase64(text); + + // 解密 + original = cipher.doFinal(encrypted); + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.DecryptAESError); + } + + String xmlContent, from_appid; + try { + // 去除补位字符 + byte[] bytes = PKCS7Encoder.decode(original); + + // 分离16位随机字符串,网络字节序和AppId + byte[] networkOrder = Arrays.copyOfRange(bytes, 16, 20); + + int xmlLength = recoverNetworkBytesOrder(networkOrder); + + xmlContent = new String(Arrays.copyOfRange(bytes, 20, 20 + xmlLength), CHARSET); + from_appid = + new String(Arrays.copyOfRange(bytes, 20 + xmlLength, bytes.length), CHARSET); + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.IllegalBuffer); + } + + // appid不相同的情况 + if (!from_appid.equals(appId)) { + throw new AesException(AesException.ValidateSignatureError); + } + return xmlContent; + + } + + /** + * * 检验消息的真实性,并且获取解密后的明文. + *
    + *
  1. 利用收到的密文生成安全签名,进行签名验证
  2. + *
  3. 若验证通过,则提取xml中的加密消息
  4. + *
  5. 对消息进行解密
  6. + *
+ * + * @param msgSignature 签名串,对应URL参数的msg_signature + * @param timeStamp 时间戳,对应URL参数的timestamp + * @param nonce 随机串,对应URL参数的nonce + * @param postData 密文,对应POST请求的数据 + * @return 解密后的原文 + * @throws AesException 执行失败,请查看该异常的错误码和具体的错误信息 + */ + public String decryptMsg(String msgSignature, String timeStamp, String nonce, String postData) + throws AesException { + + // 密钥,公众账号的app secret + // 提取密文 + Object[] encrypt = extract(postData); + + // 验证安全签名 + String signature = getSHA1(token, timeStamp, nonce, encrypt[1].toString()); + + // 和URL中的签名比较是否相等 + // System.out.println("第三方收到URL中的签名:" + msg_sign); + // System.out.println("第三方校验签名:" + signature); + if (!signature.equals(msgSignature)) { + throw new AesException(AesException.ValidateSignatureError); + } + + // 解密 + String result = decrypt(encrypt[1].toString()); + return result; + } + + /** + * 提取出xml数据包中的加密消息 + * @param xmltext 待提取的xml字符串 + * @return 提取出的加密消息字符串 + * @throws AesException + */ + public static Object[] extract(String xmltext) throws AesException { + Object[] result = new Object[3]; + try { + DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); + dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + dbf.setFeature("http://xml.org/sax/features/external-general-entities", false); + dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false); + dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); + dbf.setXIncludeAware(false); + dbf.setExpandEntityReferences(false); + DocumentBuilder db = dbf.newDocumentBuilder(); + StringReader sr = new StringReader(xmltext); + InputSource is = new InputSource(sr); + Document document = db.parse(is); + + Element root = document.getDocumentElement(); + NodeList nodelist1 = root.getElementsByTagName("Encrypt"); + NodeList nodelist2 = root.getElementsByTagName("ToUserName"); + result[0] = 0; + result[1] = nodelist1.item(0).getTextContent(); + + //注意这里,获取ticket中的xml里面没有ToUserName这个元素,官网原示例代码在这里会报空 + //空指针,所以需要处理一下 + if (nodelist2 != null) { + if (nodelist2.item(0) != null) { + result[2] = nodelist2.item(0).getTextContent(); + } + } + return result; + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.ParseXmlError); + } + } + + /** + * 用SHA1算法生成安全签名 + * @param token 票据 + * @param timestamp 时间戳 + * @param nonce 随机字符串 + * @param encrypt 密文 + * @return 安全签名 + * @throws + * AesException + */ + public static String getSHA1(String token, String timestamp, String nonce, String encrypt) + throws AesException { + try { + String[] array = new String[]{token, timestamp, nonce, encrypt}; + StringBuffer sb = new StringBuffer(); + // 字符串排序 + Arrays.sort(array); + for (int i = 0; i < 4; i++) { + sb.append(array[i]); + } + String str = sb.toString(); + // SHA1签名生成 + MessageDigest md = MessageDigest.getInstance("SHA-1"); + md.update(str.getBytes()); + byte[] digest = md.digest(); + + StringBuffer hexstr = new StringBuffer(); + String shaHex = ""; + for (int i = 0; i < digest.length; i++) { + shaHex = Integer.toHexString(digest[i] & 0xFF); + if (shaHex.length() < 2) { + hexstr.append(0); + } + hexstr.append(shaHex); + } + return hexstr.toString(); + } catch (Exception e) { + e.printStackTrace(); + throw new AesException(AesException.ComputeSignatureError); + } + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/WXXmlToMapUtil.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/WXXmlToMapUtil.java new file mode 100644 index 0000000000..e7b119ed20 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/WXXmlToMapUtil.java @@ -0,0 +1,230 @@ +package com.epmet.util; + +import org.dom4j.Document; +import org.dom4j.DocumentException; +import org.dom4j.DocumentHelper; +import org.dom4j.Element; +import org.dom4j.io.OutputFormat; +import org.dom4j.io.SAXReader; +import org.dom4j.io.XMLWriter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.StringReader; +import java.io.StringWriter; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; + +/** + * @Author zxc + * @CreateTime 2020/7/6 9:51 + */ +public class WXXmlToMapUtil { + + private static final Logger logger = LoggerFactory.getLogger(WXXmlToMapUtil.class); + + /** + * XML格式字符串转换为Map + * + * @param xml XML字符串 + * @return XML数据转换后的Map + */ + public static Map xmlToMap(String xml) { + try { + Map data = new HashMap<>(); + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + InputStream stream = new ByteArrayInputStream(xml.getBytes("UTF-8")); + org.w3c.dom.Document doc = documentBuilder.parse(stream); + doc.getDocumentElement().normalize(); + NodeList nodeList = doc.getDocumentElement().getChildNodes(); + for (int idx = 0; idx < nodeList.getLength(); ++idx) { + Node node = nodeList.item(idx); + if (node.getNodeType() == Node.ELEMENT_NODE) { + org.w3c.dom.Element element = (org.w3c.dom.Element) node; + data.put(element.getNodeName(), element.getTextContent()); + } + } + stream.close(); + return data; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * 将Map转换为XML格式的字符串 + * + * @param data Map类型数据 + * @return XML格式的字符串 + */ + public static String mapToXml(Map data) throws Exception { + try { + DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); + org.w3c.dom.Document document = documentBuilder.newDocument(); + org.w3c.dom.Element root = document.createElement("xml"); + document.appendChild(root); + for (String key : data.keySet()) { + String value = data.get(key); + if (value == null) { + value = ""; + } + value = value.trim(); + org.w3c.dom.Element filed = document.createElement(key); + filed.appendChild(document.createTextNode(value)); + root.appendChild(filed); + } + TransformerFactory tf = TransformerFactory.newInstance(); + Transformer transformer = tf.newTransformer(); + DOMSource source = new DOMSource(document); + transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); + transformer.setOutputProperty(OutputKeys.INDENT, "yes"); + StringWriter writer = new StringWriter(); + StreamResult result = new StreamResult(writer); + transformer.transform(source, result); + String output = writer.getBuffer().toString(); //.replaceAll("\n|\r", ""); + writer.close(); + return output; + } catch (Exception e) { + e.printStackTrace(); + return null; + } + } + + /** + * (多层)xml格式字符串转换为map + * + * @param xml xml字符串 + * @return 第一个为Root节点,Root节点之后为Root的元素,如果为多层,可以通过key获取下一层Map + */ + public static Map multilayerXmlToMap(String xml) { + Document doc = null; + try { + doc = DocumentHelper.parseText(xml); + } catch (DocumentException e) { + logger.error("xml字符串解析,失败 --> {}", e); + } + Map map = new HashMap<>(); + if (null == doc) { + return map; + } + // 获取根元素 + Element rootElement = doc.getRootElement(); + recursionXmlToMap(rootElement, map); + return map; + } + + /** + * multilayerXmlToMap核心方法,递归调用 + * + * @param element 节点元素 + * @param outmap 用于存储xml数据的map + */ + private static void recursionXmlToMap(Element element, Map outmap) { + // 得到根元素下的子元素列表 + List list = element.elements(); + int size = list.size(); + if (size == 0) { + // 如果没有子元素,则将其存储进map中 + outmap.put(element.getName(), element.getTextTrim()); + } else { + // innermap用于存储子元素的属性名和属性值 + Map innermap = new HashMap<>(); + // 遍历子元素 + list.forEach(childElement -> recursionXmlToMap(childElement, innermap)); + outmap.put(element.getName(), innermap); + } + } + + /** + * (多层)map转换为xml格式字符串 + * + * @param map 需要转换为xml的map + * @param isCDATA 是否加入CDATA标识符 true:加入 false:不加入 + * @return xml字符串 + */ + public static String multilayerMapToXml(Map map, boolean isCDATA) { + String parentName = "xml"; + Document doc = DocumentHelper.createDocument(); + doc.addElement(parentName); + String xml = recursionMapToXml(doc.getRootElement(), parentName, map, isCDATA); + return formatXML(xml); + } + + /** + * multilayerMapToXml核心方法,递归调用 + * + * @param element 节点元素 + * @param parentName 根元素属性名 + * @param map 需要转换为xml的map + * @param isCDATA 是否加入CDATA标识符 true:加入 false:不加入 + * @return xml字符串 + */ + private static String recursionMapToXml(Element element, String parentName, Map map, boolean isCDATA) { + Element xmlElement = element.addElement(parentName); + map.keySet().forEach(key -> { + Object obj = map.get(key); + if (obj instanceof Map) { + recursionMapToXml(xmlElement, key, (Map) obj, isCDATA); + } else { + String value = obj == null ? "" : obj.toString(); + if (isCDATA) { + xmlElement.addElement(key).addCDATA(value); + } else { + xmlElement.addElement(key).addText(value); + } + } + }); + return xmlElement.asXML(); + } + + /** + * 格式化xml,显示为容易看的XML格式 + * + * @param xml 需要格式化的xml字符串 + */ + public static String formatXML(String xml) { + String requestXML = null; + try { + // 拿取解析器 + SAXReader reader = new SAXReader(); + Document document = reader.read(new StringReader(xml)); + if (null != document) { + StringWriter stringWriter = new StringWriter(); + // 格式化,每一级前的空格 + OutputFormat format = new OutputFormat(" ", true); + // xml声明与内容是否添加空行 + format.setNewLineAfterDeclaration(false); + // 是否设置xml声明头部 + format.setSuppressDeclaration(false); + // 是否分行 + format.setNewlines(true); + XMLWriter writer = new XMLWriter(stringWriter, format); + writer.write(document); + writer.flush(); + writer.close(); + requestXML = stringWriter.getBuffer().toString(); + } + return requestXML; + } catch (Exception e) { + logger.error("格式化xml,失败 --> {}", e); + return null; + } + } +} + diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/XmlUtil.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/XmlUtil.java new file mode 100644 index 0000000000..1fdc3d0307 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/util/XmlUtil.java @@ -0,0 +1,172 @@ +package com.epmet.util; +import com.google.common.collect.Lists; +import com.thoughtworks.xstream.XStream; +import com.thoughtworks.xstream.core.util.QuickWriter; +import com.thoughtworks.xstream.io.HierarchicalStreamWriter; +import com.thoughtworks.xstream.io.naming.NoNameCoder; +import com.thoughtworks.xstream.io.xml.CompactWriter; +import com.thoughtworks.xstream.io.xml.DomDriver; +import com.thoughtworks.xstream.io.xml.PrettyPrintWriter; +import com.thoughtworks.xstream.io.xml.XppDriver; + +import java.io.StringWriter; +import java.io.Writer; +import java.nio.charset.StandardCharsets; +import java.util.List; + +public class XmlUtil { + + /** + * 转换不带CDDATA的XML + * + * @return + * @ + */ + private static XStream getXStream() { + // 实例化XStream基本对象 + XStream xstream = new XStream(new DomDriver(StandardCharsets.UTF_8.name(), new NoNameCoder() { + // 不对特殊字符进行转换,避免出现重命名字段时的“双下划线” + @Override + public String encodeNode(String name) { + return name; + } + })); + // 忽视XML与JAVABEAN转换时,XML中的字段在JAVABEAN中不存在的部分 + xstream.ignoreUnknownElements(); + return xstream; + } + + + + /** + * 转换带CDDATA的XML + * + * @return + * @ + */ + private static XStream getXStreamWithCData(List ignoreCDATA) { + // 实例化XStream扩展对象 + XStream xstream = new XStream(new XppDriver() { + // 扩展xstream,使其支持CDATA块 + @Override + public HierarchicalStreamWriter createWriter(Writer out) { + return new PrettyPrintWriter(out) { + boolean cdata = true; + // 不对特殊字符进行转换,避免出现重命名字段时的“双下划线” + @Override + public String encodeNode(String name) { + if(!ignoreCDATA.isEmpty()){ + for(String str:ignoreCDATA){ + if(str.equals(name)){ + cdata=false; + return name; + } + } + } + cdata=true; + return name; + } + // 对xml节点的转换都增加CDATA标记 + @Override + protected void writeText(QuickWriter writer, String text) { + if (cdata) { + writer.write(""); + } else { + writer.write(text); + } + } + + + }; + } + }); + // 忽视XML与JAVABEAN转换时,XML中的字段在JAVABEAN中不存在的部分 + xstream.ignoreUnknownElements(); + return xstream; + } + + /** + * 以压缩的方式输出XML + * + * @param obj + * @return + */ + public static String toCompressXml(Object obj) { + XStream xstream = getXStream(); + StringWriter sw = new StringWriter(); + // 识别obj类中的注解 + xstream.processAnnotations(obj.getClass()); + // 设置JavaBean的类别名 + xstream.aliasType("xml", obj.getClass()); + xstream.marshal(obj, new CompactWriter(sw)); + return sw.toString(); + } + + /** + * 以格式化的方式输出XML + * + * @param obj + * @return + */ + public static String toXml(Object obj) { + XStream xstream = getXStream(); + // 识别obj类中的注解 + xstream.processAnnotations(obj.getClass()); + // 设置JavaBean的类别名 + xstream.aliasType("xml", obj.getClass()); + return xstream.toXML(obj); + } + + /** + * 转换成JavaBean + * + * @param xmlStr + * @param cls + * @return + */ + @SuppressWarnings("unchecked") + public static T toBean(String xmlStr, Class cls) { + XStream xstream = getXStream(); + // 识别cls类中的注解 + xstream.processAnnotations(cls); + // 设置JavaBean的类别名 + xstream.aliasType("xml", cls); + T t = (T) xstream.fromXML(xmlStr); + return t; + } + + /** + * 以格式化的方式输出XML + * + * @param obj + * @return + */ + public static String toXmlWithCData(Object obj,List ignoreCDAA) { + XStream xstream = getXStreamWithCData(ignoreCDAA); + // 识别obj类中的注解 + xstream.processAnnotations(obj.getClass()); + // 设置JavaBean的类别名 + xstream.aliasType("xml", obj.getClass()); + return xstream.toXML(obj); + } + + /** + * 转换成JavaBean + * + * @param xmlStr + * @param cls + * @return + */ + @SuppressWarnings("unchecked") + public static T toBeanWithCData(String xmlStr, Class cls) { + XStream xstream = getXStreamWithCData(null); + // 识别cls类中的注解 + xstream.processAnnotations(cls); + // 设置JavaBean的类别名 + xstream.alias("xml", cls); + T t = (T) xstream.fromXML(xmlStr); + return t; + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java new file mode 100644 index 0000000000..3fe8d49f7e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/constant/WxMaCodeConstant.java @@ -0,0 +1,74 @@ +package com.epmet.wxapi.constant; + +/** + * 代码管理api url + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/10 12:57 + */ +public interface WxMaCodeConstant { + /** + * 为授权的小程序帐号上传小程序代码. + */ + String COMMIT_URL = "https://api.weixin.qq.com/wxa/commit"; + + /** + * 获取体验版二维码 + */ + String GET_QRCODE_URL = "https://api.weixin.qq.com/wxa/get_qrcode"; + + /** + * + */ + String GET_CATEGORY_URL = "https://api.weixin.qq.com/wxa/get_category"; + + /** + * 获取已上传的代码的页面列表 + */ + String GET_PAGE_URL = "https://api.weixin.qq.com/wxa/get_page"; + + /** + * 提交审核 + */ + String SUBMIT_AUDIT_URL = "https://api.weixin.qq.com/wxa/submit_audit"; + + /** + * 查询指定发布审核单的审核状态 + */ + String GET_AUDIT_STATUS_URL = "https://api.weixin.qq.com/wxa/get_auditstatus"; + + /** + * 查询最新一次提交的审核状态 + */ + String GET_LATEST_AUDIT_STATUS_URL = "https://api.weixin.qq.com/wxa/get_latest_auditstatus"; + + /** + * 发布已通过审核的小程序 + */ + String RELEASE_URL = "https://api.weixin.qq.com/wxa/release"; + + /** + * 修改小程序线上代码的可见状态(仅供第三方代小程序调用) + */ + String CHANGE_VISIT_STATUS_URL = "https://api.weixin.qq.com/wxa/change_visitstatus"; + + /** + * 版本回退 调用本接口可以将小程序的线上版本进行回退 + */ + String REVERT_CODE_RELEASE_URL = "https://api.weixin.qq.com/wxa/revertcoderelease"; + + /** + * 查询当前设置的最低基础库版本及各版本用户占比 + */ + String GET_SUPPORT_VERSION_URL = "https://api.weixin.qq.com/cgi-bin/wxopen/getweappsupportversion"; + + /** + * 设置最低基础库版本 + */ + String SET_SUPPORT_VERSION_URL = "https://api.weixin.qq.com/cgi-bin/wxopen/setweappsupportversion"; + + /** + * 小程序审核撤回 + */ + String UNDO_CODE_AUDIT_URL = "https://api.weixin.qq.com/wxa/undocodeaudit"; +} 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 new file mode 100644 index 0000000000..7e21cdf51c --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/enums/WxMaErrorMsgEnum.java @@ -0,0 +1,482 @@ +package com.epmet.wxapi.enums; + +import lombok.Getter; + +/** + * 微信小程序错误码 + * + * @author biggates + */ +@Getter +public enum WxMaErrorMsgEnum { + /** + * 请求成功. + */ + CODE_0(0, "请求成功"), + + /** + *
+     * 获取 access_token 时 AppSecret 错误,
+     * 或者 access_token 无效。请开发者认真比对 AppSecret 的正确性,或查看是否正在为恰当的小程序调用接口
+     * 对应操作:sendCustomerMessage
+     * 对应地址:
+     * POST https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/customer-message/sendCustomerMessage.html
+     * 
+ */ + CODE_40001(40001, "access_token 无效或 AppSecret 错误"), + /** + *
+     * 不合法的凭证类型
+     * 对应操作:sendCustomerMessage
+     * 对应地址:
+     * POST https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/customer-message/sendCustomerMessage.html
+     * 
+ */ + CODE_40002(40002, "不合法的凭证类型"), + /** + *
+     * touser不是正确的openid.
+     * 对应操作:sendCustomerMessage, sendUniformMessage
+     * 对应地址:
+     * POST https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN
+     * POST https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/customer-message/sendCustomerMessage.html
+     * https://developers.weixin.qq.com/miniprogram/dev/api/open-api/uniform-message/sendUniformMessage.html
+     * 
+ */ + CODE_40003(40003, "openid 不正确"), + /** + *
+     * 无效媒体文件类型
+     * 对应操作:uploadTempMedia
+     * 对应地址:
+     * POST https://api.weixin.qq.com/cgi-bin/media/upload?access_token=ACCESS_TOKEN&type=TYPE
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/customer-message/uploadTempMedia.html
+     * 
+ */ + CODE_40004(40004, "无效媒体文件类型"), + /** + *
+     * 无效媒体文件 ID.
+     * 对应操作:getTempMedia
+     * 对应地址:
+     * GET https://api.weixin.qq.com/cgi-bin/media/get?access_token=ACCESS_TOKEN&media_id=MEDIA_ID
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/customer-message/getTempMedia.html
+     * 
+ */ + CODE_40007(40007, "无效媒体文件 ID"), + /** + *
+     * appid不正确,或者不符合绑定关系要求.
+     * 对应操作:sendUniformMessage
+     * 对应地址:
+     * POST https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/uniform-message/sendUniformMessage.html
+     * 
+ */ + CODE_40013(40013, "appid不正确,或者不符合绑定关系要求"), + /** + *
+     * template_id 不正确.
+     * 对应操作:sendUniformMessage, sendTemplateMessage
+     * 对应地址:
+     * POST https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?access_token=ACCESS_TOKEN
+     * POST https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/uniform-message/sendUniformMessage.html
+     * https://developers.weixin.qq.com/miniprogram/dev/api/open-api/template-message/sendTemplateMessage.html
+     * 
+ */ + CODE_40037(40037, "template_id 不正确"), + /** + *
+     * form_id不正确,或者过期.
+     * 对应操作:sendUniformMessage, sendTemplateMessage
+     * 对应地址:
+     * POST https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?access_token=ACCESS_TOKEN
+     * POST https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/uniform-message/sendUniformMessage.html
+     * https://developers.weixin.qq.com/miniprogram/dev/api/open-api/template-message/sendTemplateMessage.html
+     * 
+ */ + CODE_41028(41028, "form_id 不正确,或者过期"), + /** + *
+     * code 或 template_id 不正确.
+     * 对应操作:code2Session, sendUniformMessage, sendTemplateMessage
+     * 对应地址:
+     * GET https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code
+     * POST https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?access_token=ACCESS_TOKEN
+     * POST https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/code2Session.html
+     * https://developers.weixin.qq.com/miniprogram/dev/api/open-api/uniform-message/sendUniformMessage.html
+     * https://developers.weixin.qq.com/miniprogram/dev/api/open-api/template-message/sendTemplateMessage.html
+     * 
+ */ + CODE_41029(41029, "请求的参数不正确"), + /** + *
+     * form_id 已被使用,或者所传page页面不存在,或者小程序没有发布
+     * 对应操作:sendUniformMessage, getWXACodeUnlimit
+     * 对应地址:
+     * POST https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?access_token=ACCESS_TOKEN
+     * POST https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/uniform-message/sendUniformMessage.html
+     *  https://developers.weixin.qq.com/miniprogram/dev/api/open-api/qr-code/getWXACodeUnlimit.html
+     * 
+ */ + CODE_41030(41030, "请求的参数不正确"), + /** + *
+     * 调用分钟频率受限.
+     * 对应操作:getWXACodeUnlimit, sendUniformMessage, sendTemplateMessage
+     * 对应地址:
+     * POST https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?access_token=ACCESS_TOKEN
+     * POST https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=ACCESS_TOKEN
+     * POST https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/uniform-message/sendUniformMessage.html
+     * https://developers.weixin.qq.com/miniprogram/dev/api/open-api/qr-code/getWXACodeUnlimit.html
+     * 
+ */ + CODE_45009(45009, "调用分钟频率受限"), + /** + *
+     * 频率限制,每个用户每分钟100次.
+     * 对应操作:code2Session
+     * 对应地址:
+     * GET https://api.weixin.qq.com/sns/jscode2session?appid=APPID&secret=SECRET&js_code=JSCODE&grant_type=authorization_code
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/login/code2Session.html
+     * 
+ */ + CODE_45011(45011, "频率限制,每个用户每分钟100次"), + /** + *
+     * 回复时间超过限制.
+     * 对应操作:sendCustomerMessage
+     * 对应地址:
+     * POST https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/customer-message/sendCustomerMessage.html
+     * 
+ */ + CODE_45015(45015, "回复时间超过限制"), + /** + *
+     * 接口调用超过限额, 或生成码个数总和到达最大个数限制.
+     * 对应操作:createWXAQRCode, sendTemplateMessage
+     * 对应地址:
+     * POST https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=ACCESS_TOKEN
+     * POST https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/qr-code/getWXACode.html
+     * https://developers.weixin.qq.com/miniprogram/dev/api/open-api/template-message/sendTemplateMessage.html
+     * 
+ */ + CODE_45029(45029, "接口调用超过限额"), + /** + *
+     * 客服接口下行条数超过上限.
+     * 对应操作:sendCustomerMessage
+     * 对应地址:
+     * POST https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/customer-message/sendCustomerMessage.html
+     * 
+ */ + CODE_45047(45047, "客服接口下行条数超过上限"), + /** + *
+     * command字段取值不对
+     * 对应操作:customerTyping
+     * 对应地址:
+     * POST https://api.weixin.qq.com/cgi-bin/message/custom/typing?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/customer-message/customerTyping.html
+     * 
+ */ + CODE_45072(45072, "command字段取值不对"), + /** + *
+     * 下发输入状态,需要之前30秒内跟用户有过消息交互.
+     * 对应操作:customerTyping
+     * 对应地址:
+     * POST https://api.weixin.qq.com/cgi-bin/message/custom/typing?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/customer-message/customerTyping.html
+     */
+    CODE_45080(45080, "下发输入状态,需要之前30秒内跟用户有过消息交互"),
+    /**
+     * 
+     * 已经在输入状态,不可重复下发.
+     * 对应操作:customerTyping
+     * 对应地址:
+     * POST https://api.weixin.qq.com/cgi-bin/message/custom/typing?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/customer-message/customerTyping.html
+     * 
+ */ + CODE_45081(45081, "已经在输入状态,不可重复下发"), + /** + *
+     * API 功能未授权,请确认小程序已获得该接口.
+     * 对应操作:sendCustomerMessage
+     * 对应地址:
+     * POST https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/customer-message/sendCustomerMessage.html
+     * 
+ */ + CODE_48001(48001, "API 功能未授权"), + /** + *
+     * 内容含有违法违规内容.
+     * 对应操作:imgSecCheck, msgSecCheck
+     * 对应地址:
+     * POST https://api.weixin.qq.com/wxa/img_sec_check?access_token=ACCESS_TOKEN
+     * POST https://api.weixin.qq.com/wxa/msg_sec_check?access_token=ACCESS_TOKEN
+     * 参考文档地址: https://developers.weixin.qq.com/miniprogram/dev/api/open-api/sec-check/imgSecCheck.html
+     * https://developers.weixin.qq.com/miniprogram/dev/api/open-api/sec-check/msgSecCheck.html
+     * 
+ */ + CODE_87014(87014, "内容含有违法违规内容"), + /** + * 系统繁忙,此时请开发者稍候再试. + */ + CODE_MINUS_1(-1, "系统繁忙,此时请开发者稍候再试"), + /** + * code 无效. + */ + CODE_40029(40029, "code 无效"), + /** + * access_token 过期. + */ + CODE_42001(42001, "access_token 过期"), + /** + * post 数据为空. + */ + CODE_44002(44002, "post 数据为空"), + /** + * post 数据中参数缺失. + */ + CODE_47001(47001, "post 数据中参数缺失"), + /** + * 参数 activity_id 错误. + */ + CODE_47501(47501, "参数 activity_id 错误"), + /** + * 参数 target_state 错误. + */ + CODE_47502(47502, "参数 target_state 错误"), + /** + * 参数 version_type 错误. + */ + CODE_47503(47503, "参数 version_type 错误"), + /** + * activity_id 过期. + */ + CODE_47504(47504, "activity_id 过期"), + /** + * 没有绑定开放平台帐号. + */ + CODE_89002(89002, "没有绑定开放平台帐号"), + /** + * 订单无效. + */ + CODE_89300(89300, "订单无效"), + + /** + * 代小程序实现业务的错误码,部分和小程序业务一致 + * https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/Mini_Programs/Intro.html + */ + CODE_85060(85060, "无效的taskid"), + + CODE_85027(85027, "身份证绑定管理员名额达到上限"), + + CODE_85061(85061, "手机号绑定管理员名额达到上限"), + + CODE_85026(85026, "微信号绑定管理员名额达到上限"), + + CODE_85063(85063, "身份证黑名单"), + + CODE_85062(85062, "手机号黑名单"), + + CODE_85016(85016, "域名数量超过限制"), + + CODE_85017(85017, "没有新增域名,请确认小程序已经添加了域名或该域名是否没有在第三方平台添加"), + + CODE_85018(85018, "域名没有在第三方平台设置"), + + CODE_89019(89019, "业务域名无更改,无需重复设置"), + + CODE_89020(89020, "尚未设置小程序业务域名,请先在第三方平台中设置小程序业务域名后在调用本接口"), + + CODE_89021(89021, "请求保存的域名不是第三方平台中已设置的小程序业务域名或子域名"), + + CODE_89029(89029, "业务域名数量超过限制"), + + CODE_89231(89231, "个人小程序不支持调用 setwebviewdomain 接口"), + + CODE_91001(91001, "不是公众号快速创建的小程序"), + + CODE_91002(91002, "小程序发布后不可改名"), + + CODE_91003(91003, "改名状态不合法"), + + CODE_91004(91004, "昵称不合法"), + + CODE_91005(91005, "昵称 15 天主体保护"), + + CODE_91006(91006, "昵称命中微信号"), + + CODE_91007(91007, "昵称已被占用"), + + CODE_91008(91008, "昵称命中 7 天侵权保护期"), + + CODE_91009(91009, "需要提交材料"), + + CODE_91010(91010, "其他错误"), + + CODE_91011(91011, "查不到昵称修改审核单信息"), + + CODE_91012(91012, "其他错误"), + + CODE_91013(91013, "占用名字过多"), + + CODE_91014(91014, "+号规则 同一类型关联名主体不一致"), + + CODE_91015(91015, "原始名不同类型主体不一致"), + + CODE_91016(91016, "名称占用者 ≥2"), + + CODE_91017(91017, "+号规则 不同类型关联名主体不一致"), + + CODE_40097(40097, "参数错误"), + + CODE_41006(41006, "media_id 不能为空"), + + CODE_46001(46001, "media_id 不存在"), + + CODE_40009(40009, "图片尺寸太大"), + + CODE_53202(53202, "本月头像修改次数已用完"), + + CODE_53200(53200, "本月功能介绍修改次数已用完"), + + CODE_53201(53201, "功能介绍内容命中黑名单关键字"), + + CODE_85083(85083, "搜索标记位被封禁,无法修改"), + + CODE_85084(85084, "非法的 status 值,只能填 0 或者 1"), + + CODE_85013(85013, "无效的自定义配置"), + + CODE_85014(85014, "无效的模版编号"), + + CODE_85043(85043, "模版错误"), + + CODE_85044(85044, "代码包超过大小限制"), + + CODE_85045(85045, "ext_json 有不存在的路径"), + + CODE_85046(85046, "tabBar 中缺少 path"), + + CODE_85047(85047, "pages 字段为空"), + + CODE_85048(85048, "ext_json 解析失败"), + + CODE_80082(80082, "没有权限使用该插件"), + + CODE_80067(80067, "找不到使用的插件"), + + CODE_80066(80066, "非法的插件版本"), + + CODE_86000(86000, "不是由第三方代小程序进行调用"), + + CODE_86001(86001, "不存在第三方的已经提交的代码"), + + CODE_85006(85006, "标签格式错误"), + + CODE_85007(85007, "页面路径错误"), + + CODE_85008(85008, "类目填写错误"), + + CODE_85009(85009, "已经有正在审核的版本"), + + CODE_85010(85010, "item_list 有项目为空"), + + CODE_85011(85011, "标题填写错误"), + + CODE_85023(85023, "审核列表填写的项目数不在 1-5 以内"), + + CODE_85077(85077, "小程序类目信息失效(类目中含有官方下架的类目,请重新选择类目)"), + + CODE_86002(86002, "小程序还未设置昵称、头像、简介。请先设置完后再重新提交"), + + CODE_85085(85085, "近 7 天提交审核的小程序数量过多,请耐心等待审核完毕后再次提交"), + + CODE_85086(85086, "提交代码审核之前需提前上传代码"), + + CODE_85087(85087, "小程序已使用 api navigateToMiniProgram,请声明跳转 appid 列表后再次提交"), + + CODE_85012(85012, "无效的审核 id"), + + CODE_87013(87013, "撤回次数达到上限(每天一次,每个月 10 次)"), + + CODE_85019(85019, "没有审核版本"), + + CODE_85020(85020, "审核状态未满足发布"), + + CODE_87011(87011, "现网已经在灰度发布,不能进行版本回退"), + + CODE_87012(87012, "该版本不能回退,可能的原因:1:无上一个线上版用于回退 2:此版本为已回退版本,不能回退 3:此版本为回退功能上线之前的版本,不能回退"), + + CODE_85079(85079, "小程序没有线上版本,不能进行灰度"), + + CODE_85080(85080, "小程序提交的审核未审核通过"), + + CODE_85081(85081, "无效的发布比例"), + + CODE_85082(85082, "当前的发布比例需要比之前设置的高"), + + CODE_85021(85021, "状态不可变"), + + CODE_85022(85022, "action 非法"), + + CODE_89401(89401, "系统不稳定,请稍后再试,如多次失败请通过社区反馈"), + + CODE_89402(89402, "该审核单不在待审核队列,请检查是否已提交审核或已审完"), + + CODE_89403(89403, "本单属于平台不支持加急种类,请等待正常审核流程"), + + CODE_89404(89404, "本单已加速成功,请勿重复提交"), + + CODE_89405(89405, "本月加急额度不足,请提升提审质量以获取更多额度"), + + CODE_85064(85064, "找不到模版/草稿"), + + CODE_85065(85065, "模版库已满"), + + /** + * 小程序订阅消息错误码 + * https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/subscribe-message/subscribeMessage.send.html + */ + CODE_43101(43101, "用户拒绝接受消息,如果用户之前曾经订阅过,则表示用户取消了订阅关系"), + + CODE_47003(47003, "模板参数不准确,可能为空或者不满足规则,errmsg会提示具体是哪个字段出错"), + ; + + private int code; + private String msg; + + WxMaErrorMsgEnum(int code, String msg) { + this.code = code; + this.msg = msg; + } + + /** + * 通过错误代码查找其中文含义. + */ + public static String findMsgByCode(int code) { + for (WxMaErrorMsgEnum value : WxMaErrorMsgEnum.values()) { + if (value.code == code) { + return value.msg; + } + } + + return null; + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeAuditStatus.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeAuditStatus.java new file mode 100644 index 0000000000..0115b8d9d2 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeAuditStatus.java @@ -0,0 +1,9 @@ +package com.epmet.wxapi.param; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/10 18:05 + */ +public class WxMaCodeAuditStatus { +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeAuditStatusReq.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeAuditStatusReq.java new file mode 100644 index 0000000000..b2fdf65fae --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeAuditStatusReq.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/7/13 15:49 + */ +@Data +public class WxMaCodeAuditStatusReq implements Serializable { + private static final long serialVersionUID = -504705519949598098L; + @SerializedName("auditid") + private String auditId; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeCommitReq.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeCommitReq.java new file mode 100644 index 0000000000..9e24a99689 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeCommitReq.java @@ -0,0 +1,40 @@ +package com.epmet.wxapi.param; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/10 11:14 + */ +@Data +public class WxMaCodeCommitReq implements Serializable { + private static final long serialVersionUID = 9084356213189926999L; + + /** + * 代码库中的代码模版ID + */ + @SerializedName("template_id") + private String templateId; + /** + * 第三方自定义的配置 + */ + @SerializedName("ext_json") + private String extJson; + /** + * 代码版本号,开发者可自定义 + */ + @SerializedName("user_version") + private String userVersion; + /** + * 代码描述,开发者可自定义 + */ + + @SerializedName("user_desc") + private String userDesc; + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeExtConfigReq.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeExtConfigReq.java new file mode 100644 index 0000000000..5296862502 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeExtConfigReq.java @@ -0,0 +1,203 @@ +package com.epmet.wxapi.param; + +import lombok.Builder; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/10 11:19 + */ +@Data +public class WxMaCodeExtConfigReq implements Serializable { + private static final long serialVersionUID = 130934305232989991L; + /** + * 配置 ext.json 是否生效. + * 必填:是 + */ + private boolean extEnable; + /** + * 配置 extAppid. + * 必填:是 + */ + private String extAppid; + /** + * 开发自定义的数据字段. + * 必填:否 + */ + private Object ext; + /** + * 单独设置每个页面的 json. + * 必填:否 + * key: page 名称,如 pages/logs/logs + * value: page 配置 + */ + private Map extPages; + /** + * 是否直接提交到待审核列表. + * 必填:否 + */ + private Boolean directCommit; + /** + * 设置页面路径(同 app.json 相同的字段,填写会覆盖 app.json). + * 必填:否 + */ + private List pages; + /** + * 设置默认页面的窗口表现(同 app.json 相同的字段,填写会覆盖 app.json) + * 必填:否 + */ + private PageConfig window; + /** + * 设置各种网络请求的超时时间(同 app.json 相同的字段,填写会覆盖 app.json) + * 必填:否 + */ + private NetworkTimeout networkTimeout; + /** + * 设置是否开启 debug 模式(同 app.json 相同的字段,填写会覆盖 app.json) + * 必填:否 + */ + private Boolean debug; + /** + * 底部 tab 栏的表现. + * 必填:否 + */ + private TabBar tabBar; + + /** + * page.json 配置,页面配置 + * 文档:https://mp.weixin.qq.com/debug/wxadoc/dev/framework/config.html + */ + @Data + @Builder + public static class PageConfig { + /** + * 导航栏背景颜色,如"#000000" HexColor. + * 默认:#000000 + */ + private String navigationBarBackgroundColor; + /** + * 导航栏标题颜色,仅支持 black/white. + * 默认:white + */ + private String navigationBarTextStyle; + /** + * 导航栏标题文字内容. + */ + private String navigationBarTitleText; + /** + * 窗口的背景色 HexColor. + * 默认:#ffffff + */ + private String backgroundColor; + /** + * 下拉背景字体、loading 图的样式,仅支持 dark/light. + * 默认:dark + */ + private String backgroundTextStyle; + /** + * 是否开启下拉刷新,详见页面相关事件处理函数. + * 默认:false + */ + private String enablePullDownRefresh; + /** + * 设置为 true 则页面整体不能上下滚动;只在 page.json 中有效,无法在 app.json 中设置该项. + * 默认:false + */ + private Boolean disableScroll; + /** + * 页面上拉触底事件触发时距页面底部距离,单位为px. + * 默认:50 + */ + private Integer onReachBottomDistance; + } + + /** + * tabBar 配置. + */ + @Data + @Builder + public static class TabBar { + /** + * HexColor, tab 上的文字默认颜色. + */ + private String color; + /** + * HexColor, tab 上的文字选中时的颜色. + */ + private String selectedColor; + /** + * HexColor, tab 的背景色. + */ + private String backgroundColor; + /** + * tabbar 上边框的颜色,仅支持 black/white. + */ + private String borderStyle; + /** + * tab 的列表,最少2个、最多5个 tab. + */ + private List list; + /** + * 可选值 bottom、top. + */ + private String position; + + /** + * list item. + */ + @Data + @Builder + public static class Item { + /** + * 页面路径,必须在 pages 中先定义. + */ + private String pagePath; + /** + * tab 上按钮文字. + */ + private String text; + /** + * 图片路径,icon 大小限制为40kb,建议尺寸为 81px * 81px,当 postion 为 top 时,此参数无效,不支持网络图片. + */ + private String iconPath; + /** + * 选中时的图片路径,icon 大小限制为40kb,建议尺寸为 81px * 81px ,当 postion 为 top 时,此参数无效. + */ + private String selectedIconPath; + } + } + + /** + * 各种网络请求的超时时间. + */ + @Data + @Builder + public static class NetworkTimeout { + /** + * wx.request的超时时间,单位毫秒,默认为:60000. + * 必填:否 + */ + private Integer request; + /** + * wx.connectSocket的超时时间,单位毫秒,默认为:60000. + * 必填:否 + */ + private Integer connectSocket; + /** + * wx.uploadFile的超时时间,单位毫秒,默认为:60000. + * 必填:否 + */ + private Integer uploadFile; + /** + * wx.downloadFile的超时时间,单位毫秒,默认为:60000. + * 必填:否 + */ + private Integer downloadFile; + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeSubmitAuditRequest.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeSubmitAuditRequest.java new file mode 100644 index 0000000000..c9fa07b8e4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/param/WxMaCodeSubmitAuditRequest.java @@ -0,0 +1,145 @@ +package com.epmet.wxapi.param; + +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/7/10 18:04 + */ +@NoArgsConstructor +@Data +public class WxMaCodeSubmitAuditRequest implements Serializable { + + private static final long serialVersionUID = -3919598581372634816L; + /** + * 小程序版本说明和功能解释 + */ + @SerializedName("version_desc") + private String versionDesc; + /** + * 反馈内容,至多 200 字 + */ + @SerializedName("feedback_info") + private String feedbackInfo; + /** + * 用 | 分割的 media_id 列表,至多 5 张图片, 可以通过新增临时素材接口上传而得到 + */ + @SerializedName("feedback_stuff") + private String feedbackStuff; + /** + * 审核项列表(选填,至多填写 5 项) + */ + @SerializedName("item_list") + private List itemList; + /** + * 预览信息(小程序页面截图和操作录屏) + */ + @SerializedName("preview_info") + private List previewInfo; + /** + * 用户生成内容场景(UGC)信息安全声明 + */ + @SerializedName("ugc_declare") + private List ugcDeclare; + + @NoArgsConstructor + @Data + private static class ItemListBean { + /** + * 小程序的页面,可通过获取小程序的页面列表接口获得 + */ + @SerializedName("address") + private String address; + /** + * 小程序的标签,用空格分隔,标签至多 10 个,标签长度至多 20 + */ + @SerializedName("tag") + private String tag; + /** + * 一级类目名称 + */ + @SerializedName("first_class") + private String firstClass; + /** + * 二级类目名称 + */ + @SerializedName("second_class") + private String secondClass; + /** + * 三级类目名称 + */ + @SerializedName("third_class") + private String thirdClass; + /** + * 一级类目的 ID + */ + @SerializedName("first_id") + private String firstId; + /** + * 二级类目的 ID + */ + @SerializedName("second_id") + private String secondId; + /** + * 三级类目的 ID + */ + @SerializedName("third_id") + private String thirdId; + /** + * 小程序页面的标题,标题长度至多 32 + */ + @SerializedName("title") + private String title; + } + + @NoArgsConstructor + @Data + private static class PreviewInfoBean { + /** + * 录屏mediaid列表,可以通过提审素材上传接口获得 + */ + @SerializedName("Video_id_list") + private List videoIdList; + /** + * 截屏mediaid列表,可以通过提审素材上传接口获得 + */ + @SerializedName("pic_id_list") + private List picIdList; + } + + @NoArgsConstructor + @Data + private static class UgcDeclareBean { + /** + * UGC场景 0,不涉及用户生成内容, 1.用户资料,2.图片,3.视频,4.文本,5其他, 可多选,当scene填0时无需填写下列字段 + */ + @SerializedName("scene") + private List scene; + /** + * 当scene选其他时的说明,不超时256字 + */ + @SerializedName("other_scene_desc") + private String otherSceneDesc; + /** + * 内容安全机制 1.使用平台建议的内容安全API,2.使用其他的内容审核产品,3.通过人工审核把关,4.未做内容审核把关 + */ + @SerializedName("method") + private List method; + /** + * 是否有审核团队, 0.无,1.有,默认0 + */ + @SerializedName("has_audit_team") + private Integer hasAuditTeam; + /** + * 说明当前对UGC内容的审核机制,不超过256字 + */ + @SerializedName("audit_desc") + private String auditDesc; + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaAuditStatusResult.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaAuditStatusResult.java new file mode 100644 index 0000000000..2b13169a46 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaAuditStatusResult.java @@ -0,0 +1,40 @@ +package com.epmet.wxapi.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/13 15:53 + */ +@Data +public class WxMaAuditStatusResult implements Serializable { + private static final long serialVersionUID = 3461409352381952089L; + /** + * 返回码 + */ + private Integer errcode; + /** + * 错误信息 + */ + private String errmsg; + /** + * 审核状态 + */ + private Integer status; + /** + * 当 status = 1 时,返回的拒绝原因; status = 4 时,返回的延后原因 + */ + private String reason; + /** + * 当 status = 1 时,会返回审核失败的小程序截图示例。用 | 分隔的 media_id 的列表,可通过获取永久素材接口拉取截图内容 + */ + private String screenshot; + + public boolean success(){ + return errcode == 0; + } + +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaCategoryResult.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaCategoryResult.java new file mode 100644 index 0000000000..a8bbb25e5e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaCategoryResult.java @@ -0,0 +1,52 @@ +package com.epmet.wxapi.result; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/10 16:51 + */ +@Data +public class WxMaCategoryResult implements Serializable { + /** + * 一级类目名称 + */ + private String firstClass; + /** + * 二级类目名称 + */ + private String secondClass; + /** + * 三级类目名称 + */ + private String thirdClass; + /** + * 一级类目的ID编号 + */ + private String firstId; + /** + * 二级类目的ID编号 + */ + private String secondId; + /** + * 三级类目的ID编号 + */ + private String thirdId; + + /** + * 小程序的页面,可通过“获取小程序的第三方提交代码的页面配置”接口获得 + */ + private String address; + /** + * 小程序的标签,多个标签用空格分隔,标签不能多于10个,标签长度不超过20 + */ + private String tag; + /** + * 小程序页面的标题,标题长度不超过32 + */ + private String title; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaGetCategoryResult.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaGetCategoryResult.java new file mode 100644 index 0000000000..b120ad55df --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaGetCategoryResult.java @@ -0,0 +1,28 @@ +package com.epmet.wxapi.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/13 10:17 + */ +@Data +public class WxMaGetCategoryResult implements Serializable { + private static final long serialVersionUID = -2665257152145041516L; + /** + * 返回码 + */ + private Integer errcode; + /** + * 错误信息 + */ + private String errmsg; + /** + * 可填选的类目信息列表 + */ + private List categoryList; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaGetPageResult.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaGetPageResult.java new file mode 100644 index 0000000000..5305288c88 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaGetPageResult.java @@ -0,0 +1,28 @@ +package com.epmet.wxapi.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/13 13:38 + */ +@Data +public class WxMaGetPageResult implements Serializable { + private static final long serialVersionUID = -3057343239059623208L; + /** + * 返回码 + */ + private Integer errcode; + /** + * 错误信息 + */ + private String errmsg; + /** + * 错误信息 + */ + private List pageList; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaTemplateListResult.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaTemplateListResult.java new file mode 100644 index 0000000000..513598c1d8 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaTemplateListResult.java @@ -0,0 +1,32 @@ +package com.epmet.wxapi.result; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/15 10:22 + */ +@Data +public class WxMaTemplateListResult implements Serializable { + private static final long serialVersionUID = -331693492663419441L; + /** + * 返回码 + */ + @SerializedName("errcode") + private Integer errCode; + /** + * 错误信息 + */ + @SerializedName("errmsg") + private String errMsg; + /** + * 模板信息列表 + */ + @SerializedName("template_list") + private List templateList; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaTemplateResult.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaTemplateResult.java new file mode 100644 index 0000000000..2e5ded186b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxMaTemplateResult.java @@ -0,0 +1,36 @@ +package com.epmet.wxapi.result; + +import com.google.gson.annotations.SerializedName; +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/7/15 10:24 + */ +@Data +public class WxMaTemplateResult implements Serializable { + private static final long serialVersionUID = 5770192375722597547L; + /** + * 模板 id + */ + @SerializedName("template_id") + private String templateId; + /** + * 模板版本号,开发者自定义字段 + */ + @SerializedName("user_version") + private String userVersion; + /** + * 模板描述,开发者自定义字段 + */ + @SerializedName("user_desc") + private String userDesc; + /** + * 被添加为模板的时间 + */ + @SerializedName("create_time") + private Long createTime; +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxResult.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxResult.java new file mode 100644 index 0000000000..5672f47a5e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/result/WxResult.java @@ -0,0 +1,43 @@ +package com.epmet.wxapi.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 微信统一返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/10 13:22 + */ +@Data +public class WxResult implements Serializable { + /** + * 微信错误代码. + */ + private int errorCode=0; + + /** + * 微信错误信息. + */ + private String errorMsg="success"; + + /** + * 微信接口返回的错误原始信息(英文). json串 + */ + private String errorMsgEn; + + /** + * 响应数据 + */ + private T data; + + public WxResult ok(T data) { + this.setData(data); + return this; + } + + public boolean success(){ + return errorCode == 0 ? true : false; + } +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java new file mode 100644 index 0000000000..60d243f62d --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/WxMaCodeService.java @@ -0,0 +1,107 @@ +package com.epmet.wxapi.service; + +import com.epmet.wxapi.param.WxMaCodeAuditStatusReq; +import com.epmet.wxapi.param.WxMaCodeCommitReq; +import com.epmet.wxapi.param.WxMaCodeSubmitAuditRequest; +import com.epmet.wxapi.result.WxMaAuditStatusResult; +import com.epmet.wxapi.result.WxMaTemplateResult; +import com.epmet.wxapi.result.WxResult; + +import java.util.List; + +/** + * 小程序代码管理相关 API(大部分只能是第三方平台调用) + * 文档:https://open.weixin.qq.com/cgi-bin/showdocument?action=dir_list&t=resource/res_list&verify=1&id=open1489140610_Uavc4&token=&lang=zh_CN + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/10 11:21 + */ +public interface WxMaCodeService { + + /** + * 获取代码模板列表 + * + * @param accessToken + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/7/15 10:20 + */ + WxResult> getTemplateList(String accessToken); + + /** + * 为授权的小程序帐号上传小程序代码(仅仅支持第三方开放平台). + * + * @param accessToken 小程序接口调用令牌 + * @param commitRequest 请求参数 + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/7/10 14:11 + */ + WxResult commit(String accessToken, WxMaCodeCommitReq commitRequest); + + /** + * 获取体验小程序的体验二维码. + * + * @param accessToken 小程序接口调用令牌 + * @param path 指定体验版二维码跳转到某个具体页面 + * @return com.epmet.wxapi.result.WxResult + * @author zhaoqifeng + * @date 2020/7/10 15:25 + */ + WxResult getQrCode(String accessToken, String path); + + /** + * 获取授权小程序帐号的可选类目. + * + * @param accessToken 提交审核参数 + * @return List + */ + WxResult getCategory(String accessToken); + + /** + * 获取小程序的第三方提交代码的页面配置(仅供第三方开发者代小程序调用). + * + * @param accessToken 提交审核参数 + * @return page_list 页面配置列表 + */ + WxResult getPage(String accessToken); + + /** + * 将第三方提交的代码包提交审核(仅供第三方开发者代小程序调用). + * + * @param accessToken 提交审核参数 + * @param auditRequest 提交审核参数 + * @return 审核编号 + */ + WxResult submitAudit(String accessToken, WxMaCodeSubmitAuditRequest auditRequest); + + /** + * 查询指定版本审核状态(仅供第三方代小程序调用). + * + * @param accessToken 提交审核参数 + * @param request 提交审核参数 + * @return 审核状态 + */ + WxResult getAuditStatus(String accessToken, WxMaCodeAuditStatusReq request); + + /** + * 发布已通过审核的小程序(仅供第三方代小程序调用). + * + * @param accessToken 提交审核参数 + * @return 发布结果 + */ + WxResult release(String accessToken); + + /** + * 小程序审核撤回. + * 单个帐号每天审核撤回次数最多不超过1次,一个月不超过10次 + * + * @param accessToken 提交审核参数 + * @return 撤回结果 + */ + WxResult undoCodeAudit(String accessToken); + + //TODO 设置服务器域名 + + //TODO 设置业务域名 +} diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java new file mode 100644 index 0000000000..41c1e17f7e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/java/com/epmet/wxapi/service/impl/WxMaCodeServiceImpl.java @@ -0,0 +1,212 @@ +package com.epmet.wxapi.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.commons.tools.utils.Result; +import com.epmet.wxapi.constant.WxMaCodeConstant; +import com.epmet.wxapi.param.WxMaCodeAuditStatusReq; +import com.epmet.wxapi.param.WxMaCodeCommitReq; +import com.epmet.wxapi.param.WxMaCodeSubmitAuditRequest; +import com.epmet.wxapi.result.*; +import com.epmet.wxapi.service.WxMaCodeService; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.io.UnsupportedEncodingException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/7/10 11:23 + */ +@Service +public class WxMaCodeServiceImpl implements WxMaCodeService { + private static final String ERR_CODE = "errcode"; + private static final String ERR_MSG = "errmsg"; + + @Override + public WxResult> getTemplateList(String accessToken) { + WxResult> result = new WxResult<>(); + String url = WxMaCodeConstant.COMMIT_URL + "?" + "access_token=" + accessToken; + Result templateListResult = HttpClientManager.getInstance().sendGet(url, null); + if (!templateListResult.success()) { + result.setErrorCode(templateListResult.getCode()); + result.setErrorMsg(templateListResult.getMsg()); + return result; + } + Gson gson = new Gson(); + WxMaTemplateListResult templateList = new Gson().fromJson(templateListResult.getData(), WxMaTemplateListResult.class); + result.setErrorCode(templateList.getErrCode()); + result.setErrorMsg(templateList.getErrMsg()); + result.setData(templateList.getTemplateList()); + return result; + } + + @Override + public WxResult commit(String accessToken, WxMaCodeCommitReq commitRequest) { + WxResult result = new WxResult(); + String url = WxMaCodeConstant.COMMIT_URL + "?" + "access_token=" + accessToken; + Result commitResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(commitRequest)); + if (!commitResult.success()) { + result.setErrorCode(commitResult.getCode()); + result.setErrorMsg(commitResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(commitResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(jsonObject.getString(ERR_MSG)); + return result; + } + + @Override + public WxResult getQrCode(String accessToken, String path) { + WxResult result = new WxResult<>(); + StringBuilder url = new StringBuilder(WxMaCodeConstant.GET_QRCODE_URL).append("?access_token").append(accessToken); + if (StringUtils.isNotBlank(path)) { + try { + url.append("?path=").append(URLEncoder.encode(path, StandardCharsets.UTF_8.name())); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + } + Result qrCodeResult = HttpClientManager.getInstance().sendGetFile(url.toString(), null); + if (!qrCodeResult.success()) { + result.setErrorCode(qrCodeResult.getCode()); + result.setErrorMsg(qrCodeResult.getMsg()); + return result; + } + + result.setData(qrCodeResult.getData()); + + return result; + } + + @Override + public WxResult getCategory(String accessToken) { + WxResult> result = new WxResult<>(); + String url = WxMaCodeConstant.GET_CATEGORY_URL + "?" + "access_token=" + accessToken; + Result getCategoryResult = HttpClientManager.getInstance().sendGet(url, null); + if (!getCategoryResult.success()) { + result.setErrorCode(getCategoryResult.getCode()); + result.setErrorMsg(getCategoryResult.getMsg()); + return result; + } + WxMaGetCategoryResult categoryResult = JSONObject.parseObject(getCategoryResult.getData(), WxMaGetCategoryResult.class); + result.setErrorCode(categoryResult.getErrcode()); + result.setErrorMsg(categoryResult.getErrmsg()); + result.setData(categoryResult.getCategoryList()); + return result; + } + + @Override + public WxResult getPage(String accessToken) { + WxResult> result = new WxResult<>(); + String url = WxMaCodeConstant.GET_PAGE_URL + "?" + "access_token=" + accessToken; + Result getPageResult = HttpClientManager.getInstance().sendGet(url, null); + if (!getPageResult.success()) { + result.setErrorCode(getPageResult.getCode()); + result.setErrorMsg(getPageResult.getMsg()); + return result; + } + WxMaGetPageResult pageResult = JSONObject.parseObject(getPageResult.getData(), WxMaGetPageResult.class); + result.setErrorCode(pageResult.getErrcode()); + result.setErrorMsg(pageResult.getErrmsg()); + result.setData(pageResult.getPageList()); + return result; + } + + @Override + public WxResult submitAudit(String accessToken, WxMaCodeSubmitAuditRequest auditRequest) { + WxResult result = new WxResult<>(); + String url = WxMaCodeConstant.SUBMIT_AUDIT_URL + "?" + "access_token=" + accessToken; + Result submitResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(auditRequest)); + if (!submitResult.success()) { + result.setErrorCode(submitResult.getCode()); + result.setErrorMsg(submitResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(submitResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(jsonObject.getString(ERR_MSG)); + result.setData(jsonObject.getString("auditid")); + return result; + } + + @Override + public WxResult getAuditStatus(String accessToken, WxMaCodeAuditStatusReq request) { + WxResult result = new WxResult<>(); + String url = WxMaCodeConstant.COMMIT_URL + "?" + "access_token=" + accessToken; + Result statusResult = HttpClientManager.getInstance().sendPostByJSON(url, toJson(request)); + if (!statusResult.success()) { + result.setErrorCode(statusResult.getCode()); + result.setErrorMsg(statusResult.getMsg()); + return result; + } + WxMaAuditStatusResult auditStatusResult = JSONObject.parseObject(statusResult.getData(), WxMaAuditStatusResult.class); + if (!auditStatusResult.success()){ + result.setErrorCode(auditStatusResult.getErrcode()); + result.setErrorMsg(auditStatusResult.getErrmsg()); + return result; + } + result.ok(auditStatusResult); + return result; + } + + @Override + public WxResult release(String accessToken) { + WxResult result = new WxResult(); + String url = WxMaCodeConstant.RELEASE_URL + "?" + "access_token=" + accessToken; + Result releaseResult = HttpClientManager.getInstance().sendPostByJSON(url, null); + if (!releaseResult.success()) { + result.setErrorCode(releaseResult.getCode()); + result.setErrorMsg(releaseResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(releaseResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(jsonObject.getString(ERR_MSG)); + return result; + } + + @Override + public WxResult undoCodeAudit(String accessToken) { + WxResult result = new WxResult(); + String url = WxMaCodeConstant.UNDO_CODE_AUDIT_URL + "?" + "access_token=" + accessToken; + Result undoResult = HttpClientManager.getInstance().sendGet(url, null); + if (!undoResult.success()) { + result.setErrorCode(undoResult.getCode()); + result.setErrorMsg(undoResult.getMsg()); + return result; + } + JSONObject jsonObject = JSONObject.parseObject(undoResult.getData()); + result.setErrorCode(jsonObject.getInteger(ERR_CODE)); + result.setErrorMsg(jsonObject.getString(ERR_MSG)); + return result; + } + + public static void main(String[] args) { + String url = "{\"errcode\":0,\"errmsg\":\"ok\",\"category_list\":[{\"first_class\":\"工具\",\"second_class\":\"备忘录\",\"first_id\":1,\"second_id\":2,}\n" + + "{\"first_class\":\"教育\",\"second_class\":\"学历教育\",\"third_class\":\"高等\",\"first_id\":3,\"second_id\":4,\"third_id\":5,}]}"; + WxMaGetCategoryResult video = JSONObject.parseObject(url, WxMaGetCategoryResult.class); + WxResult> result = new WxResult<>(); + result.setErrorCode(video.getErrcode()); + result.setErrorMsg(video.getErrmsg()); + result.setData(video.getCategoryList()); + System.out.println(result); + WxMaCodeSubmitAuditRequest request = new WxMaCodeSubmitAuditRequest(); + request.setVersionDesc("aasdf"); + } + + private String toJson(Object object) { + GsonBuilder gsonBuilder = new GsonBuilder(); + gsonBuilder.setPrettyPrinting(); + Gson gson = gsonBuilder.create(); + return gson.toJson(object); + } +} \ No newline at end of file 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 new file mode 100644 index 0000000000..56a7c1b6dd --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml @@ -0,0 +1,106 @@ +server: + port: @server.port@ + servlet: + context-path: /third + +spring: + main: + allow-bean-definition-overriding: true + application: + name: epmet-third-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 +third: + platform: + appId: wx9681884b28ed7927 + appSecret: xxx + aesKey: d6dbde92c67e11eabac1c03fd56f7847qazxswedcvg + token: 1ae5f230c67f11eabac1c03fd56f7847 \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.1__demo.sql b/epmet-module/epmet-third/epmet-third-server/src/main/resources/db/migration/V0.0.1__demo.sql new file mode 100644 index 0000000000..7a51a3f595 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-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-third/epmet-third-server/src/main/resources/logback-spring.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..fc91993807 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-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-third/epmet-third-server/src/main/resources/mapper/AuthCodeDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthCodeDao.xml new file mode 100644 index 0000000000..4d605df059 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthCodeDao.xml @@ -0,0 +1,45 @@ + + + + + + + INSERT INTO auth_code ( ID, CUSTOMER_ID, CLIENT_TYPE, AUTH_CODE, EXPIRES_IN_TIME, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + ( + REPLACE ( UUID(), '-', '' ), + #{customerId}, + #{clientType} + #{authCode}, + #{expiresInTime}, + #{delFlag}, + #{createdBy}, + NOW(), + #{updatedBy}, + NOW() + ) + + + + + UPDATE auth_code + SET auth_appid = #{authAppId} + WHERE + del_flag = 0 + AND customer_id = #{customerId} + AND client_type = #{clientType} + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthResultRecordDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthResultRecordDao.xml new file mode 100644 index 0000000000..d0c2ba2654 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthResultRecordDao.xml @@ -0,0 +1,6 @@ + + + + + + \ 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 new file mode 100644 index 0000000000..ea012b7f0a --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizationInfoDao.xml @@ -0,0 +1,81 @@ + + + + + + + + INSERT INTO authorization_info ( ID, CUSTOMER_ID, AUTHORIZER_APPID, AUTHORIZER_ACCESS_TOKEN, EXPIRES_IN_TIME, AUTHORIZER_REFRESH_TOKEN, CLIENT_TYPE, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + ( + REPLACE ( UUID(), '-', '' ), + #{customerId}, + #{authorizerAppid}, + #{authorizerAccessToken}, + #{expiresInTime}, + #{authorizerRefreshToken}, + #{clientType} + #{delFlag}, + #{createdBy}, + NOW(), + #{updatedBy}, + NOW() + ) + + + + + update authorization_info set del_flag = 1 where customer_id = #{customerId} AND client_type = #{clientType} + + + + + + + + INSERT INTO authorization_info ( ID, AUTHORIZER_ACCESS_TOKEN, EXPIRES_IN_TIME, AUTHORIZER_REFRESH_TOKEN, AUTHORIZER_APPID, CUSTOMER_ID,CLIENT_TYPE, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + ( + REPLACE ( UUID(), '-', '' ), + #{authorizerAccessToken}, + #{expiresInTime}, + #{authorizerRefreshToken}, + #{authAppid}, + #{customerId}, + #{clientType}, + #{delFlag}, + #{createdBy}, + NOW(), + #{updatedBy}, + NOW() + ) + + + + + update authorization_info set del_flag = 1 where customer_id = #{customerId} AND client_type = #{clientType} + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizerRefreshTokenDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizerRefreshTokenDao.xml new file mode 100644 index 0000000000..a1a2f133d5 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/AuthorizerRefreshTokenDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/BindingAccountDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/BindingAccountDao.xml new file mode 100644 index 0000000000..8547b41dcf --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/BindingAccountDao.xml @@ -0,0 +1,24 @@ + + + + + + + + INSERT INTO binding_account ( ID, OPEN_PLATFORM_ACCOUNT_ID, AUTH_APP_ID, CUSTOMER_ID, CLIENT_TYPE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + ( + REPLACE ( UUID(), '-', '' ), + #{openPlatformAccountId}, + #{authAppId}, + #{customerId}, + #{clientType}, + #{delFlag}, + #{revision}, + #{createDBy}, + NOW(), + #{updatedBy}, + NOW() + ) + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/BusinessInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/BusinessInfoDao.xml new file mode 100644 index 0000000000..ec69aa585a --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/BusinessInfoDao.xml @@ -0,0 +1,27 @@ + + + + + + + + INSERT INTO business_info ( ID, CUSTOMER_ID, CLIENT_TYPE, PRIMARY_ID, FUNC_TYPE, OPEN_STATUS, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{business.customerId}, + #{business.clientType}, + #{business.primaryId}, + #{business.funcType}, + #{business.openStatus}, + #{business.delFlag}, + #{business.revision}, + #{business.createdBy}, + NOW(), + #{business.updatedBy}, + NOW() + ) + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditRecordDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditRecordDao.xml new file mode 100644 index 0000000000..f0d102d0f4 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditRecordDao.xml @@ -0,0 +1,35 @@ + + + + + + + + INSERT INTO code_audit_result ( ID, CUSTOMER_ID, TEMPLATE_ID, CLIENT_TYPE, AUTH_APP_ID, TO_USER_NAME, FROM_USER_NAME, WECHAT_CREATE_TIME, + MSG_TYPE, EVENT, SUCC_TIME, FAIL_TIME, DELAY_TIME, REASON, SCREEN_SHOT, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + VALUES + ( + REPLACE ( UUID(), '-', '' ), + #{customerId}, + #{templateId}, + #{clientType}, + #{authAppId}, + #{toUserName}, + #{fromUserName}, + #{wechatCreateTime}, + #{msgType}, + #{event}, + IFNULL(#{succTime},NULL), + IFNULL(#{failTime},NULL), + IFNULL(#{delayTime},NULL), + IFNULL(#{reason},NULL), + IFNULL(#{screenShot},NULL), + #{delFlag}, + #{revision}, + #{createdBy}, + NOW(), + #{updatedBy}, + NOW() + ) + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditResultDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditResultDao.xml new file mode 100644 index 0000000000..b880a03e60 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeAuditResultDao.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + UPDATE code_audit_result + SET result = #{codeResult} + WHERE del_flag = '0' + AND customer_id = #{customerId} + AND template_id = #{templateId} + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml new file mode 100644 index 0000000000..6761472660 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeCustomerDao.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeMediaDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeMediaDao.xml new file mode 100644 index 0000000000..c89b8a54d3 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CodeMediaDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ 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 new file mode 100644 index 0000000000..e3cda3bc0e --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentAccessTokenDao.xml @@ -0,0 +1,51 @@ + + + + + + + + INSERT INTO component_access_token ( ID, COMPONENT_ACCESS_TOKEN, EXPIRES_IN_TIME, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + ( + REPLACE ( UUID(), '-', '' ), + #{componentAccessToken}, + #{expiresInTime}, + #{delFlag}, + #{createdBy}, + NOW(), + #{updatedBy}, + NOW() + ) + + + + + update component_access_token set del_flag = 1 + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentVerifyTicketDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentVerifyTicketDao.xml new file mode 100644 index 0000000000..ba33593a48 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/ComponentVerifyTicketDao.xml @@ -0,0 +1,29 @@ + + + + + + + + INSERT INTO component_verify_ticket ( ID, COMPONENT_APP_ID, TYPE_INFO, COMPONENT_VERIFY_TICKET, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + ( + REPLACE ( UUID(), '-', '' ), + #{componentAppId}, + #{typeInfo}, + #{componentVerifyTicket}, + #{delFlag}, + #{createdBy}, + NOW(), + #{updatedBy}, + NOW() + ) + + + + + update component_verify_ticket set del_flag = 1 + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerCodeOperationHistoryDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerCodeOperationHistoryDao.xml new file mode 100644 index 0000000000..09ae8b2e78 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerCodeOperationHistoryDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml new file mode 100644 index 0000000000..ac7b8b4346 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/CustomerMpDao.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + UPDATE customer_mp + SET app_id = #{authAppId},authorization_flag = 1 + WHERE + customer_id = #{customerId} + AND del_flag = '0' + AND client = #{client} + + + + + UPDATE customer_mp + SET authorization_flag = 0 + WHERE + app_id = #{authAppId} + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/FuncInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/FuncInfoDao.xml new file mode 100644 index 0000000000..c3af697392 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/FuncInfoDao.xml @@ -0,0 +1,31 @@ + + + + + + + + + INSERT INTO func_info ( ID, FUNCSCOPE_CATEGORY, FUNCSCOPE_ID, CUSTOMER_ID, AUTHORIZATION_INFO_APPID, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + ( + REPLACE ( UUID(), '-', '' ), + #{func.funcscopeCategory}, + #{func.funcscopeId}, + #{func.customerId} + #{func.authorizationInfoAppid}, + #{func.delFlag}, + #{func.createdBy}, + NOW(), + #{func.updatedBy}, + NOW() + ) + + + + + + update func_info set del_flag = 0 where customer_id = #{customerId} + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniCategoryInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniCategoryInfoDao.xml new file mode 100644 index 0000000000..49aacc185b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniCategoryInfoDao.xml @@ -0,0 +1,27 @@ + + + + + + + + INSERT INTO mini_category_info ( ID, CUSTOMER_ID, CLIENT_TYPE, PRIMARY_ID, CATEGORY_SORT, CATEGORY_NAME, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{category.customerId}, + #{category.clientType}, + #{category.primaryId}, + #{category.categorySort}, + #{category.categoryName}, + #{category.delFlag}, + #{category.revision}, + #{category.createdBy}, + NOW(), + #{category.updatedBy}, + NOW() + ) + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml new file mode 100644 index 0000000000..c838415721 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniInfoDao.xml @@ -0,0 +1,55 @@ + + + + + + + + + SELECT LAST_INSERT_ID() AS id + + INSERT INTO mini_info ( ID, CUSTOMER_ID, CLIENT_TYPE, NICK_NAME, HEAD_IMG, SERVICE_TYPE_INFO, VERIFY_TYPE_INFO, USER_NAME, + PRINCIPAL_NAME, SIGNATURE, QRCODE_URL, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + VALUES + ( + REPLACE ( UUID(), '-', '' ), + #{customerId}, + #{clientType}, + #{nickName}, + #{headImg}, + #{serviceTypeInfo}, + #{verifyTypeInfo}, + #{userName}, + #{principalName}, + #{signature}, + #{qrcodeUrl}, + #{delFlag}, + #{revision}, + #{createdBy}, + NOW(), + #{updatedBy}, + NOW() + ) + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniNetworkInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniNetworkInfoDao.xml new file mode 100644 index 0000000000..e6dcc273ce --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/MiniNetworkInfoDao.xml @@ -0,0 +1,27 @@ + + + + + + + + INSERT INTO mini_network_info ( ID, PRIMARY_ID, CUSTOMER_ID, CLIENT_TYPE, NETWORK_TYPE, URL, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{network.primaryId}, + #{network.customerId}, + #{network.clientType}, + #{network.networkType}, + #{network.url}, + #{network.delFlag}, + #{network.revision}, + #{network.createdBy}, + NOW(), + #{network.updatedBy}, + NOW() + ) + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenFlatformAccountDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenFlatformAccountDao.xml new file mode 100644 index 0000000000..efaa55adad --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/OpenFlatformAccountDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + SELECT LAST_INSERT_ID() AS id + + INSERT INTO open_platform_account ( ID, OPEN_APP_ID, CUSTOMER_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + ( + REPLACE ( UUID(), '-', '' ), + #{openAppId}, + #{customerId}, + #{delFlag}, + #{revision}, + #{createdBy}, + NOW(), + #{updatedBy}, + NOW() + ) + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerAgencyDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerAgencyDao.xml new file mode 100644 index 0000000000..99181ddebe --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerAgencyDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + \ 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 new file mode 100644 index 0000000000..609937e09f --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerDao.xml @@ -0,0 +1,44 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerUserAgencyDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerUserAgencyDao.xml new file mode 100644 index 0000000000..36465c774b --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaCustomerUserAgencyDao.xml @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaInfoDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaInfoDao.xml new file mode 100644 index 0000000000..8715fb65f0 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaInfoDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + SELECT LAST_INSERT_ID() AS id + + INSERT INTO pa_info ( ID, CUSTOMER_ID, CLIENT_TYPE, NICK_NAME, HEAD_IMG, SERVICE_TYPE_INFO, VERIFY_TYPE_INFO, USER_NAME, + PRINCIPAL_NAME, ALIAS, QRCODE_URL, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + VALUES + ( + REPLACE ( UUID(), '-', '' ), + #{customerId}, + #{clientType}, + #{nickName}, + #{headImg}, + #{serviceTypeInfo}, + #{verifyTypeInfo}, + #{userName}, + #{principalName}, + #{alias}, + #{qrcodeUrl}, + #{delFlag}, + #{revision}, + #{createdBy}, + NOW(), + #{updatedBy}, + NOW() + ) + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaUserDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaUserDao.xml new file mode 100644 index 0000000000..56db230fa9 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaUserDao.xml @@ -0,0 +1,19 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaUserVisitedDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaUserVisitedDao.xml new file mode 100644 index 0000000000..9023e43184 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaUserVisitedDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaUserWechatDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaUserWechatDao.xml new file mode 100644 index 0000000000..e571713767 --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PaUserWechatDao.xml @@ -0,0 +1,46 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PreAuthTokenDao.xml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PreAuthTokenDao.xml new file mode 100644 index 0000000000..319909947d --- /dev/null +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/mapper/PreAuthTokenDao.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + INSERT INTO pre_auth_token ( ID, PRE_AUTH_TOKEN, EXPIRES_IN_TIME, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + ( + REPLACE ( UUID(), '-', '' ), + #{preAuthToken}, + #{expiresInTime}, + #{delFlag}, + #{createdBy}, + NOW(), + #{updatedBy}, + NOW() + ) + + + + + update pre_auth_token set del_flag = 0 + + + \ No newline at end of file diff --git a/epmet-module/epmet-third/pom.xml b/epmet-module/epmet-third/pom.xml new file mode 100644 index 0000000000..883b02ddb7 --- /dev/null +++ b/epmet-module/epmet-third/pom.xml @@ -0,0 +1,21 @@ + + + + epmet-module + com.epmet + 2.0.0 + + 4.0.0 + + epmet-third + pom + + + epmet-third-client + epmet-third-server + + + + \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml index 4b27e8212c..58a75a2195 100644 --- a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-issue-server: container_name: gov-issue-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-issue-server:0.3.51 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-issue-server:0.3.52 ports: - "8101:8101" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-prod.yml b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-prod.yml index ccc53b97d9..312e064441 100644 --- a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-issue-server: container_name: gov-issue-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-issue-server:0.3.51 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-issue-server:0.3.52 ports: - "8101:8101" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml index 6d12039b0a..54760eca82 100644 --- a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-issue-server: container_name: gov-issue-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-issue-server:0.3.51 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-issue-server:0.3.52 ports: - "8101:8101" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index 6eeb2a35c3..9ec2c6e91d 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.51 + 0.3.52 gov-issue com.epmet diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index 4306b83ac9..94411a1b51 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -365,6 +365,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp if (StringUtils.isNotBlank(formDTO.getCloseReason())) { TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); taskDTO.setContent(formDTO.getCloseReason()); textScanParamDTO.getTasks().add(taskDTO); Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); @@ -509,6 +510,7 @@ public class IssueServiceImpl extends BaseServiceImpl imp if (StringUtils.isNotBlank(formDTO.getPublicReply())) { TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); TextTaskDTO taskDTO = new TextTaskDTO(); + taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); taskDTO.setContent(formDTO.getPublicReply()); textScanParamDTO.getTasks().add(taskDTO); Result textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); 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 ec96daa291..de87b9eea4 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 @@ -223,7 +223,7 @@ public class StaffAgencyServiceImpl implements StaffAgencyService { return staffGridResult; } } - logger.error(String.format("客户id%s,staffId%s查询最后一次登录网格为空",latestGridFormDTO.getCustomerId(),latestGridFormDTO.getStaffId())); + logger.info(String.format("客户id%s,staffId%s查询最后一次登录网格为空",latestGridFormDTO.getCustomerId(),latestGridFormDTO.getStaffId())); //.error(StaffAgencyConstant.QUERY_LATEST_GRID_INFO_FAILED) return new Result<>(); } 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 f5f033e08c..042e4aeb80 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.38 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.39 ports: - "8102:8102" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml index f3f7157861..215ddefc6a 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-project-server: container_name: gov-project-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-project-server:0.3.38 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-project-server:0.3.39 ports: - "8102:8102" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml index be230acf39..d00c633082 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-project-server: container_name: gov-project-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-project-server:0.3.38 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-project-server:0.3.39 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 ab5057b85d..283a6616be 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.38 + 0.3.39 gov-project com.epmet diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java index a77a0e1b37..8c8a2dc776 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java @@ -190,6 +190,7 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); 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 28b2e71720..ea153d138d 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 @@ -303,6 +303,7 @@ public class ProjectServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); @@ -381,6 +382,7 @@ public class ProjectServiceImpl extends BaseServiceImpl textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); diff --git a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-prod.yml b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-prod.yml index a91f4e4c9a..8fcad365f2 100644 --- a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-prod.yml +++ b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-voice-server: container_name: gov-voice-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-voice-server:0.3.58 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/gov-voice-server:0.3.60 ports: - "8105:8105" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml index 64a93fed78..534a815584 100644 --- a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-voice-server: container_name: gov-voice-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-voice-server:0.3.58 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-voice-server:0.3.59 ports: - "8105:8105" network_mode: host # 使用现有网络 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 5b85dd5438..b14ab6036d 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 @@ -1,9 +1,12 @@ package com.epmet.feign; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerDTO; import org.springframework.cloud.openfeign.FeignClient; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.feign.fallback.OperCrmOpenFeignClientFallback; +import org.springframework.web.bind.annotation.PostMapping; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -13,4 +16,11 @@ import com.epmet.feign.fallback.OperCrmOpenFeignClientFallback; */ @FeignClient(name = ServiceConstant.OPER_CRM_SERVER, fallback = OperCrmOpenFeignClientFallback.class) public interface OperCrmOpenFeignClient { + /** + * 获取客户信息 + * @param dto + * @return + */ + @PostMapping("/oper/crm/getcostomerInfo") + Result getCustomerInfo(CustomerDTO dto); } 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 896781e016..39594aa4fe 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 @@ -1,5 +1,9 @@ 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.CustomerDTO; import com.epmet.feign.OperCrmOpenFeignClient; import org.springframework.stereotype.Component; @@ -11,4 +15,8 @@ import org.springframework.stereotype.Component; */ @Component public class OperCrmOpenFeignClientFallback implements OperCrmOpenFeignClient { + @Override + public Result getCustomerInfo(CustomerDTO dto) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getCustomerInfo", dto); + } } diff --git a/epmet-module/pom.xml b/epmet-module/pom.xml index 28533ed679..dd7611267b 100644 --- a/epmet-module/pom.xml +++ b/epmet-module/pom.xml @@ -39,8 +39,9 @@ resi-voice data-statistical data-report + epmet-third epmet-heart - epmet-point - + epmet-point + diff --git a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml index 281ea59d07..e260e52f61 100644 --- a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml +++ b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-group-server: container_name: resi-group-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/resi-group-server:0.3.61 + image: 192.168.1.130:10080/epmet-cloud-dev/resi-group-server:0.3.62 ports: - "8095:8095" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-prod.yml b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-prod.yml index 5a39890745..ed45553393 100644 --- a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-prod.yml +++ b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-prod.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-group-server: container_name: resi-group-server-prod - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-group-server:0.3.61 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-master/resi-group-server:0.3.62 ports: - "8095:8095" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-test.yml b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-test.yml index 6d5b2048fa..8ba5a78e5e 100644 --- a/epmet-module/resi-group/resi-group-server/deploy/docker-compose-test.yml +++ b/epmet-module/resi-group/resi-group-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: resi-group-server: container_name: resi-group-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-group-server:0.3.61 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-group-server:0.3.62 ports: - "8095:8095" network_mode: host # 使用现有网络 diff --git a/epmet-module/resi-group/resi-group-server/pom.xml b/epmet-module/resi-group/resi-group-server/pom.xml index 0b734ec6b3..f5a85b9ff7 100644 --- a/epmet-module/resi-group/resi-group-server/pom.xml +++ b/epmet-module/resi-group/resi-group-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.61 + 0.3.62 com.epmet resi-group diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java index 120e09d831..30c1ee44ba 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/invitation/service/impl/GroupInvitationServiceImpl.java @@ -199,7 +199,7 @@ public class GroupInvitationServiceImpl extends BaseServiceImpl 4.0.0 - 0.3.17 + 0.3.23 epmet-openapi-scan jar @@ -43,12 +43,12 @@ com.aliyun aliyun-java-sdk-core - 3.5.0 + 4.1.1 com.aliyun aliyun-java-sdk-green - 3.5.0 + 3.5.1 diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/SysResponseEnum.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/SysResponseEnum.java index 67ee3cc9d2..f906186333 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/SysResponseEnum.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/enu/SysResponseEnum.java @@ -19,10 +19,13 @@ public enum SysResponseEnum { */ /*通用枚举 */ EXCEPTION(10001,"系统异常"), + THIRD_PLATFORM_SERVER_ERROR(10002,"第三方检测服务异常,请稍候重试"), + THIRD_PLATFORM_RESP_STATUS_ERROR(10003,"第三方检测服务响应异常,请稍候重试"), + THIRD_PLATFORM_RESP_CODE_ERROR(10004,"第三方检测服务检测异常,请稍候重试"), /*审核内容 业务 01*/ - SCAN_TASK_LIST_PARAM_ERROR(110010001,"任务列表不能为空"), + SCAN_TASK_LIST_PARAM_ERROR(110010001,"任务列表长度超过限制"), SCAN_PARAM_ERROR(110010002,"参数格式不正确"), ; diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/exception/ExeCuteHttpException.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/exception/ExeCuteHttpException.java deleted file mode 100644 index 99daf84bae..0000000000 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/exception/ExeCuteHttpException.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.epmet.openapi.scan.common.exception; - -import com.epmet.commons.tools.utils.MessageUtils; -import com.epmet.openapi.scan.common.enu.SysResponseEnum; - -/** - * @author jianjun liu - * @email liujianjun@yunzongnet.com - * @date 2020-06-05 10:31 - **/ -public class ExeCuteHttpException extends RuntimeException { - private int code; - private String msg; - - public ExeCuteHttpException(String msg) { - this(SysResponseEnum.EXCEPTION.getCode(), msg); - } - public ExeCuteHttpException(int code, String... params) { - this.code = code; - this.msg = MessageUtils.getMessage(code, params); - - } -} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/exception/ExecuteHttpException.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/exception/ExecuteHttpException.java new file mode 100644 index 0000000000..a5694da79c --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/common/exception/ExecuteHttpException.java @@ -0,0 +1,29 @@ +package com.epmet.openapi.scan.common.exception; + +import com.epmet.openapi.scan.common.enu.SysResponseEnum; + +/** + * @author jianjun liu + * @date 2020-06-05 10:31 + **/ +public class ExecuteHttpException extends RuntimeException { + private int code; + private String msg; + + public ExecuteHttpException(String msg) { + this(SysResponseEnum.EXCEPTION.getCode(), msg); + } + + public ExecuteHttpException(int code, String msg) { + this.code = code; + this.msg = msg; + } + + public int getCode() { + return code; + } + + public String getMsg() { + return msg; + } +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/ScanController.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/ScanController.java index efaae3ddd5..8a0b268e50 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/ScanController.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/controller/ScanController.java @@ -24,7 +24,6 @@ public class ScanController { @Autowired private ScanService scanService; - /** * desc:图片同步检测接口 * @@ -34,8 +33,7 @@ public class ScanController { @RequestMapping("imgSyncScan") public Result ImgSyncScan(@RequestBody ImgScanParam param) { ValidatorUtils.validateEntity(param); - Result scanResultResult = scanService.sendSyncImgScan(param); - return scanResultResult; + return scanService.sendSyncImgScan(param); } /** @@ -47,13 +45,11 @@ public class ScanController { @RequestMapping("textSyncScan") public Result textSyncScan(@RequestBody TextScanParam param) { ValidatorUtils.validateEntity(param); - Result scanResultResult = scanService.sendTextScan(param); - return scanResultResult; + return scanService.sendTextScan(param); } //@RequestMapping("imgAsyncScan") public Result ImgAsyncScan(@RequestBody ImgScanParam param) { - Result scanResultResult = scanService.sendASyncImgScan(param); - return scanResultResult; + return null;//scanService.sendASyncImgScan(param); } } diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanService.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanService.java index 6f1959a2f8..f48937bc42 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanService.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanService.java @@ -3,7 +3,6 @@ package com.epmet.openapi.scan.service.impl; import com.epmet.commons.tools.utils.Result; import com.epmet.openapi.scan.support.param.ImgScanParam; import com.epmet.openapi.scan.support.param.TextScanParam; -import com.epmet.openapi.scan.support.result.ImgAsyncScanResult; import com.epmet.openapi.scan.support.result.SyncScanResult; /** @@ -28,10 +27,4 @@ public interface ScanService { * @return */ public Result sendSyncImgScan(ImgScanParam imgScanParam); - /** - * desc:扫描图片内容 异步 - * @param imgScanParam - * @return - */ - public Result sendASyncImgScan(ImgScanParam imgScanParam); } diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java index 58fd107bc0..3756eb1764 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java @@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.aliyuncs.AcsRequest; -import com.aliyuncs.green.model.v20180509.ImageAsyncScanRequest; import com.aliyuncs.green.model.v20180509.ImageSyncScanRequest; import com.aliyuncs.green.model.v20180509.TextScanRequest; import com.aliyuncs.http.FormatType; @@ -15,13 +14,12 @@ import com.epmet.openapi.scan.common.enu.ImgSceneEnum; import com.epmet.openapi.scan.common.enu.SuggestionEnum; import com.epmet.openapi.scan.common.enu.SysResponseEnum; import com.epmet.openapi.scan.common.enu.TextSceneEnum; -import com.epmet.openapi.scan.common.exception.ExeCuteHttpException; +import com.epmet.openapi.scan.common.exception.ExecuteHttpException; import com.epmet.openapi.scan.common.util.IAcsClientUtil; import com.epmet.openapi.scan.support.param.ImgScanParam; import com.epmet.openapi.scan.support.param.ImgTask; import com.epmet.openapi.scan.support.param.TextScanParam; import com.epmet.openapi.scan.support.param.TextTask; -import com.epmet.openapi.scan.support.result.ImgAsyncScanResult; import com.epmet.openapi.scan.support.result.ScanTaskResult; import com.epmet.openapi.scan.support.result.SceneDetailResult; import com.epmet.openapi.scan.support.result.SyncScanResult; @@ -49,7 +47,6 @@ public class ScanServiceImpl implements ScanService { @Override public Result sendTextScan(TextScanParam textScanParam) { - //默认参数 // 鉴黄 暴恐涉政 textScanParam.setScenes(TextSceneEnum.getTextSceneList()); @@ -69,7 +66,7 @@ public class ScanServiceImpl implements ScanService { try { textScanRequest.setHttpContent(JSON.toJSONString(textScanParam).getBytes(SysConstant.UTF8), SysConstant.UTF8, FormatType.JSON); } catch (UnsupportedEncodingException e) { - log.error("sendTextScan exception", e.getMessage()); + log.error("sendTextScan parse param exception", e); } @@ -78,18 +75,18 @@ public class ScanServiceImpl implements ScanService { */ textScanRequest.setConnectTimeout(3000); textScanRequest.setReadTimeout(6000); + try { SyncScanResult textScanResult = executeSyncText(textScanRequest); return new Result().ok(textScanResult); - } catch (Exception e) { - log.error("sendTextScan exception", e); - throw new ExeCuteHttpException(SysResponseEnum.EXCEPTION.getCode(), SysResponseEnum.EXCEPTION.getMsg()); + } catch (ExecuteHttpException e) { + log.error("sendTextScan execute Exception", e); + return new Result().error(e.getCode(), e.getMsg()); } } @Override public Result sendSyncImgScan(ImgScanParam imgScanParam) { - ImageSyncScanRequest imageSyncScanRequest = new ImageSyncScanRequest(); imageSyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式 imageSyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法 @@ -109,7 +106,7 @@ public class ScanServiceImpl implements ScanService { try { imageSyncScanRequest.setHttpContent(JSON.toJSONString(imgScanParam).getBytes(SysConstant.UTF8), SysConstant.UTF8, FormatType.JSON); } catch (UnsupportedEncodingException e) { - log.error("sendSyncImgScan exception", e.getMessage()); + log.error("sendSyncImgScan parse param exception", e); return new Result().error(SysResponseEnum.SCAN_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_PARAM_ERROR.getMsg()); } @@ -122,49 +119,9 @@ public class ScanServiceImpl implements ScanService { try { SyncScanResult scanResult = executeSyncImg(imageSyncScanRequest); return new Result().ok(scanResult); - } catch (Exception e) { - log.error("sendImgScan execute Exception", e); - return new Result().error(SysResponseEnum.EXCEPTION.getCode(), SysResponseEnum.EXCEPTION.getMsg()); - } - } - - @Override - public Result sendASyncImgScan(ImgScanParam imgScanParam) { - ImageAsyncScanRequest imageAsyncScanRequest = new ImageAsyncScanRequest(); - imageAsyncScanRequest.setAcceptFormat(FormatType.JSON); // 指定api返回格式 - imageAsyncScanRequest.setMethod(com.aliyuncs.http.MethodType.POST); // 指定请求方法 - imageAsyncScanRequest.setEncoding(SysConstant.UTF8); - imageAsyncScanRequest.setRegionId(regionId); - - //默认参数 - // 鉴黄 暴恐涉政 - imgScanParam.setScenes(ImgSceneEnum.getImgSceneList()); - imgScanParam.setBizType(bizType); - - List imgTasks = imgScanParam.getTasks(); - if (CollectionUtils.isEmpty(imgTasks) || imgTasks.size() > SysConstant.MAX_IMG_TASKS) { - return new Result().error(SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_TASK_LIST_PARAM_ERROR.getMsg()); - } - - try { - imageAsyncScanRequest.setHttpContent(JSON.toJSONString(imgScanParam).getBytes(SysConstant.UTF8), SysConstant.UTF8, FormatType.JSON); - } catch (UnsupportedEncodingException e) { - log.error("sendASyncImgScan exception", e.getMessage()); - return new Result().error(SysResponseEnum.SCAN_PARAM_ERROR.getCode(), SysResponseEnum.SCAN_PARAM_ERROR.getMsg()); - } - - /** - * 请务必设置超时时间 - */ - imageAsyncScanRequest.setConnectTimeout(3000); - imageAsyncScanRequest.setReadTimeout(6000); - - try { - ImgAsyncScanResult scanResult = null;//executeAsyncImg(imageAsyncScanRequest); - return new Result().ok(scanResult); - } catch (Exception e) { - log.error("sendImgScan execute Exception", e); - return new Result().error(SysResponseEnum.EXCEPTION.getCode(), SysResponseEnum.EXCEPTION.getMsg()); + } catch (ExecuteHttpException e) { + log.error("sendImgScan execute exception,param:{},fail msg:{}", JSON.toJSONString(imgScanParam), e.getMsg()); + return new Result().error(e.getCode(), e.getMsg()); } } @@ -209,15 +166,15 @@ public class ScanServiceImpl implements ScanService { return result; } else { log.warn("executeSyncText response not success. code:{}", scrResponse.getInteger(SysConstant.CODE)); - throw new ExeCuteHttpException("executeSyncText detect not success. code:" + scrResponse.getInteger(SysConstant.CODE)); + throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_RESP_CODE_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_RESP_CODE_ERROR.getMsg() + ",status:" + httpResponse.getStatus()); } } else { - log.warn("executeSyncText response not success. status:{}", httpResponse.getStatus()); - throw new ExeCuteHttpException("response not success. status:" + httpResponse.getStatus()); + log.warn("executeSyncText response status is not success. httpResponse:{}", JSON.toJSONString(httpResponse)); + throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getMsg() + ",status:" + httpResponse.getStatus()); } } catch (Exception e) { - log.warn("executeSyncText exception", e); - throw new ExeCuteHttpException(SysResponseEnum.EXCEPTION.getCode(), SysResponseEnum.EXCEPTION.getMsg()); + log.error("executeSyncText exception IAcsClientUtil do action exception", e); + throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getMsg()); } } @@ -260,15 +217,15 @@ public class ScanServiceImpl implements ScanService { return result; } else { log.warn("executeSyncImg detect not success. code:{}", scrResponse.getInteger(SysConstant.CODE)); - throw new ExeCuteHttpException("detect not success. code:" + scrResponse.getInteger(SysConstant.CODE)); + throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_RESP_CODE_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_RESP_CODE_ERROR.getMsg() + ",status:" + httpResponse.getStatus()); } } else { - log.warn("executeSyncImg response not success. status:{}", httpResponse.getStatus()); - throw new ExeCuteHttpException("response not success. status:" + httpResponse.getStatus()); + log.warn("executeSyncImg response status is not success. httpResponse:{}", JSON.toJSONString(httpResponse)); + throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_RESP_STATUS_ERROR.getMsg() + ",status:" + httpResponse.getStatus()); } } catch (Exception e) { - log.warn("executeSyncImg exception", e); - throw new ExeCuteHttpException(SysResponseEnum.EXCEPTION.getCode(), SysResponseEnum.EXCEPTION.getMsg()); + log.error("executeSyncImg exception IAcsClientUtil do action exception", e); + throw new ExecuteHttpException(SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getCode(), SysResponseEnum.THIRD_PLATFORM_SERVER_ERROR.getMsg()); } } } diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgTask.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgTask.java index 2ec15a9593..487485b7fc 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgTask.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgTask.java @@ -2,7 +2,7 @@ package com.epmet.openapi.scan.support.param; import lombok.Data; -import javax.validation.constraints.NotNull; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -20,12 +20,12 @@ public class ImgTask implements Serializable { * 要检测的数据id 非必填 * * */ - @NotNull(message = "dataId不能为空") + @NotBlank(message = "dataId不能为空") private String dataId; /** * 图片url 必填 */ - @NotNull(message = "图片URL不能为空") + @NotBlank(message = "图片URL不能为空") private String url; } diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextTask.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextTask.java index aeb976506c..08215e3e5b 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextTask.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextTask.java @@ -1,7 +1,9 @@ package com.epmet.openapi.scan.support.param; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -19,10 +21,13 @@ public class TextTask implements Serializable { * 要检测的数据id 非必填 * * */ + @NotBlank(message = "dataId不能为空") private String dataId; /** * 文本内容 必填 最多不能超过10000 */ + @NotBlank(message = "待检测文本不能为空") + @Length(max = 10000,message = "待检测文本最大为10000") private String content; }