Browse Source

20220116新建开放平台项目

master
zy_Java 4 years ago
parent
commit
b58f6525e2
  1. 298
      cloudutil/src/main/java/com/ccsens/cloudutil/aspect/LogAspect.java
  2. 167
      cloudutil/src/main/java/com/ccsens/cloudutil/aspect/MustLoginAspect.java
  3. 25
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/ptos/dto/FeignProjectDto.java
  4. 34
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/ptos/dto/FeignUserDto.java
  5. 71
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/ptos/vo/FeignProjectVo.java
  6. 32
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/ptos/vo/FeignUserVo.java
  7. 15
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/HolidaysDto.java
  8. 31
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/LogDto.java
  9. 169
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/MemberRoleDto.java
  10. 56
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/ProjectDto.java
  11. 137
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/TallTaskDto.java
  12. 42
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/TaskDto.java
  13. 28
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/UserDto.java
  14. 62
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/WpsDto.java
  15. 18
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/HolidaysVo.java
  16. 57
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/MemberVo.java
  17. 28
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/PluginVo.java
  18. 46
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/ProjectVo.java
  19. 124
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/TaskVo.java
  20. 20
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/UserVo.java
  21. 15
      cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/WpsVo.java
  22. 55
      cloudutil/src/main/java/com/ccsens/cloudutil/config/FeignConfig.java
  23. 44
      cloudutil/src/main/java/com/ccsens/cloudutil/feign/DiplomatistFeignClient.java
  24. 41
      cloudutil/src/main/java/com/ccsens/cloudutil/feign/HealthFeignClient.java
  25. 68
      cloudutil/src/main/java/com/ccsens/cloudutil/feign/MtFeignClient.java
  26. 58
      cloudutil/src/main/java/com/ccsens/cloudutil/feign/PtosTallFeignClient.java
  27. 113
      cloudutil/src/main/java/com/ccsens/cloudutil/feign/Tall3FeignClient.java
  28. 477
      cloudutil/src/main/java/com/ccsens/cloudutil/feign/TallFeignClient.java
  29. 1
      pom.xml
  30. 4
      ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/api/DomainController.java
  31. 2
      ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/bean/dto/ProjectDto.java
  32. 54
      ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/service/DomainService.java
  33. 2
      ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/service/IDomainService.java
  34. 33
      ptos_open/.gitignore
  35. 331
      ptos_open/mvnw
  36. 188
      ptos_open/mvnw.cmd
  37. 84
      ptos_open/pom.xml
  38. 32
      ptos_open/src/main/java/com/ccsens/ptos_open/PtosOpenApplication.java
  39. 78
      ptos_open/src/main/java/com/ccsens/ptos_open/api/BusinessController.java
  40. 32
      ptos_open/src/main/java/com/ccsens/ptos_open/api/DebugController.java
  41. 55
      ptos_open/src/main/java/com/ccsens/ptos_open/api/PluginController.java
  42. 79
      ptos_open/src/main/java/com/ccsens/ptos_open/bean/dto/BusinessDto.java
  43. 53
      ptos_open/src/main/java/com/ccsens/ptos_open/bean/dto/PluginDto.java
  44. 216
      ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenBusiness.java
  45. 1341
      ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenBusinessExample.java
  46. 128
      ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenBusinessPlugin.java
  47. 821
      ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenBusinessPluginExample.java
  48. 139
      ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenPlugin.java
  49. 901
      ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenPluginExample.java
  50. 117
      ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenPluginImg.java
  51. 751
      ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenPluginImgExample.java
  52. 61
      ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenPluginWithBLOBs.java
  53. 72
      ptos_open/src/main/java/com/ccsens/ptos_open/bean/vo/BusinessVo.java
  54. 45
      ptos_open/src/main/java/com/ccsens/ptos_open/bean/vo/PluginVo.java
  55. 22
      ptos_open/src/main/java/com/ccsens/ptos_open/config/BeanConfig.java
  56. 128
      ptos_open/src/main/java/com/ccsens/ptos_open/config/SpringConfig.java
  57. 56
      ptos_open/src/main/java/com/ccsens/ptos_open/config/SwaggerConfigure.java
  58. 159
      ptos_open/src/main/java/com/ccsens/ptos_open/intercept/MybatisInterceptor.java
  59. 30
      ptos_open/src/main/java/com/ccsens/ptos_open/persist/mapper/OpenBusinessMapper.java
  60. 30
      ptos_open/src/main/java/com/ccsens/ptos_open/persist/mapper/OpenBusinessPluginMapper.java
  61. 30
      ptos_open/src/main/java/com/ccsens/ptos_open/persist/mapper/OpenPluginImgMapper.java
  62. 37
      ptos_open/src/main/java/com/ccsens/ptos_open/persist/mapper/OpenPluginMapper.java
  63. 43
      ptos_open/src/main/java/com/ccsens/ptos_open/service/BusinessService.java
  64. 49
      ptos_open/src/main/java/com/ccsens/ptos_open/service/IBusinessService.java
  65. 26
      ptos_open/src/main/java/com/ccsens/ptos_open/service/IPluginService.java
  66. 27
      ptos_open/src/main/java/com/ccsens/ptos_open/service/PluginService.java
  67. 17
      ptos_open/src/main/java/com/ccsens/ptos_open/util/OpenCodeError.java
  68. 56
      ptos_open/src/main/java/com/ccsens/ptos_open/util/OpenConstant.java
  69. 30
      ptos_open/src/main/resources/application-common.yml
  70. 51
      ptos_open/src/main/resources/application-dev.yml
  71. 41
      ptos_open/src/main/resources/application-prod.yml
  72. 49
      ptos_open/src/main/resources/application-test.yml
  73. 4
      ptos_open/src/main/resources/application.yml
  74. 34
      ptos_open/src/main/resources/druid-dev.yml
  75. 35
      ptos_open/src/main/resources/druid-prod.yml
  76. 34
      ptos_open/src/main/resources/druid-test.yml
  77. 196
      ptos_open/src/main/resources/logback-spring.xml
  78. 417
      ptos_open/src/main/resources/mapper_raw/OpenBusinessMapper.xml
  79. 291
      ptos_open/src/main/resources/mapper_raw/OpenBusinessPluginMapper.xml
  80. 275
      ptos_open/src/main/resources/mapper_raw/OpenPluginImgMapper.xml
  81. 424
      ptos_open/src/main/resources/mapper_raw/OpenPluginMapper.xml
  82. 6
      ptos_tall/src/main/java/com/ccsens/ptos_tall/api/ProjectController.java
  83. 27
      ptos_tall/src/main/java/com/ccsens/ptos_tall/api/UserController.java
  84. 24
      ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/dto/UserDto.java
  85. 20
      ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/vo/UserVo.java
  86. 8
      ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/dao/SysUserDao.java
  87. 14
      ptos_tall/src/main/java/com/ccsens/ptos_tall/service/IUserService.java
  88. 67
      ptos_tall/src/main/java/com/ccsens/ptos_tall/service/ProjectService.java
  89. 144
      ptos_tall/src/main/java/com/ccsens/ptos_tall/service/UserService.java
  90. 1
      ptos_tall/src/main/java/com/ccsens/ptos_tall/util/PtOsCodeError.java
  91. 3
      ptos_tall/src/main/java/com/ccsens/ptos_tall/util/PtOsConstant.java
  92. 1
      ptos_tall/src/main/resources/application-dev.yml
  93. 1
      ptos_tall/src/main/resources/application-prod.yml
  94. 1
      ptos_tall/src/main/resources/application-test.yml
  95. 10
      ptos_tall/src/main/resources/mapper_dao/SysUserDao.xml
  96. 13
      util/src/main/java/com/ccsens/util/JsonResponse.java
  97. 9
      util/src/main/java/com/ccsens/util/bean/dto/QueryDto.java
  98. 16
      wechatutil/src/main/java/com/ccsens/wechatutil/wxofficial/OfficialAccountMessageUtil.java

298
cloudutil/src/main/java/com/ccsens/cloudutil/aspect/LogAspect.java

@ -1,149 +1,149 @@
package com.ccsens.cloudutil.aspect;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.cloudutil.bean.tall.dto.LogDto;
import com.ccsens.cloudutil.feign.TallFeignClient;
import com.ccsens.util.UploadFileUtil_Servlet3;
import com.ccsens.util.WebConstant;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.Part;
import java.lang.reflect.Method;
import java.util.HashSet;
import java.util.Set;
/**
* @description:
* @author: wuHuiJuan
* @create: 2019/12/10 10:06
*/
@Order(1)
@Slf4j
@Aspect
@Component
public class LogAspect {
@Autowired
private TallFeignClient tallFeignClient;
/**不记录日志的接口*/
private Set<String> ignoreUrlSet = new HashSet<>();
{
ignoreUrlSet.add("/log/operation");
ignoreUrlSet.add("/users/token");
ignoreUrlSet.add("/users/claims");
}
@Pointcut("execution(* com.ccsens.tall.web..*(..)) || execution(* com.ccsens.ht.api..*(..))" +
" || execution(* com.ccsens.mt.api..*(..)) || execution(* com.ccsens.game.api..*(..))" +
" || execution(* com.ccsens.health.api..*(..)) || execution(* com.ccsens.pims.api..*(..))")
public void logAdvice(){
}
@Around("logAdvice()")
public Object around(ProceedingJoinPoint pjp) throws Throwable {
LogDto logDto = initLog(pjp);
Object result;
try {
result = pjp.proceed();
} catch (Throwable throwable) {
log.error("方法运行异常", throwable);
if (logDto != null) {
String message = throwable.toString();
logDto.setResult(message.length() > 1000 ? message.substring(0,1000) : message);
tallFeignClient.log(logDto);
}
throw throwable;
}
if (logDto != null) {
if("/users/signin".equals(logDto.getUrl()) && result != null){
JSONObject json = JSONObject.parseObject(JSON.toJSONString(result));
if(json.getIntValue("code") == 200 && json.get("data") != null){
long userId = json.getJSONObject("data").getLongValue("id");
logDto.setUserId(userId);
}
}
String message = result == null ? null : result.toString().length() > 1000 ? result.toString().substring(0, 1000) : result.toString();
logDto.setResult(message);
tallFeignClient.log(logDto);
}
return result;
}
/**
* 获取方法路径描述参数
* @param pjp
* @return
*/
private LogDto initLog(ProceedingJoinPoint pjp) {
//路径
HttpServletRequest request = ((ServletRequestAttributes)
RequestContextHolder.getRequestAttributes()).getRequest();
String url = request.getServletPath();
if (ignoreUrlSet.contains(url)){
log.info("保存日志,不进行记录");
return null;
}
LogDto dto = new LogDto();
dto.setUrl(url);
dto.setFacility(request.getHeader("fingerprint"));
//参数
Object[] args = pjp.getArgs();
StringBuilder param = new StringBuilder();
for (int i = 0; i < args.length; i++) {
if (args[i] == null) {
continue;
}else if (args[i] instanceof ServletResponse) {
continue;
} else if (args[i] instanceof ServletRequest) {
Object claims = request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS);
String userId = claims == null ? null : ((Claims) claims).getSubject();
if (userId != null) {
param.append("userId:").append(userId).append("--");
dto.setUserId(Long.parseLong(userId));
}
} else if (args[i] instanceof Part) {
param.append("file:").append(UploadFileUtil_Servlet3.getFileNameByPart((Part)args[i])).append("--");
}else {
param.append(args[i]).append("--");
}
}
dto.setParams(param.length() > 1000 ? param.substring(0, 1000) : param.toString());
try {
MethodSignature methodSignature = (MethodSignature) pjp.getSignature();
Method method = pjp.getTarget().getClass().getMethod(methodSignature.getName(), methodSignature.getParameterTypes());
ApiOperation annotation = method.getAnnotation(ApiOperation.class);
dto.setMethodDesc(annotation == null ? "" : annotation.value());
} catch (Exception e) {
log.error("获取方法时异常",e);
}
return dto;
}
}
//package com.ccsens.cloudutil.aspect;
//
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject;
//import com.ccsens.cloudutil.bean.tall.dto.LogDto;
//import com.ccsens.cloudutil.feign.TallFeignClient;
//import com.ccsens.util.UploadFileUtil_Servlet3;
//import com.ccsens.util.WebConstant;
//import io.jsonwebtoken.Claims;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.aspectj.lang.ProceedingJoinPoint;
//import org.aspectj.lang.annotation.Around;
//import org.aspectj.lang.annotation.Aspect;
//import org.aspectj.lang.annotation.Pointcut;
//import org.aspectj.lang.reflect.MethodSignature;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.core.annotation.Order;
//import org.springframework.stereotype.Component;
//import org.springframework.web.context.request.RequestContextHolder;
//import org.springframework.web.context.request.ServletRequestAttributes;
//
//import javax.servlet.ServletRequest;
//import javax.servlet.ServletResponse;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.Part;
//import java.lang.reflect.Method;
//import java.util.HashSet;
//import java.util.Set;
//
///**
// * @description:
// * @author: wuHuiJuan
// * @create: 2019/12/10 10:06
// */
//@Order(1)
//@Slf4j
//@Aspect
//@Component
//public class LogAspect {
//
// @Autowired
// private TallFeignClient tallFeignClient;
//
// /**不记录日志的接口*/
// private Set<String> ignoreUrlSet = new HashSet<>();
// {
// ignoreUrlSet.add("/log/operation");
// ignoreUrlSet.add("/users/token");
// ignoreUrlSet.add("/users/claims");
// }
//
//
// @Pointcut("execution(* com.ccsens.tall.web..*(..)) || execution(* com.ccsens.ht.api..*(..))" +
// " || execution(* com.ccsens.mt.api..*(..)) || execution(* com.ccsens.game.api..*(..))" +
// " || execution(* com.ccsens.health.api..*(..)) || execution(* com.ccsens.pims.api..*(..))")
// public void logAdvice(){
//
// }
//
// @Around("logAdvice()")
// public Object around(ProceedingJoinPoint pjp) throws Throwable {
// LogDto logDto = initLog(pjp);
//
//
// Object result;
// try {
// result = pjp.proceed();
// } catch (Throwable throwable) {
// log.error("方法运行异常", throwable);
// if (logDto != null) {
// String message = throwable.toString();
// logDto.setResult(message.length() > 1000 ? message.substring(0,1000) : message);
// tallFeignClient.log(logDto);
// }
// throw throwable;
// }
// if (logDto != null) {
// if("/users/signin".equals(logDto.getUrl()) && result != null){
// JSONObject json = JSONObject.parseObject(JSON.toJSONString(result));
// if(json.getIntValue("code") == 200 && json.get("data") != null){
// long userId = json.getJSONObject("data").getLongValue("id");
// logDto.setUserId(userId);
// }
// }
// String message = result == null ? null : result.toString().length() > 1000 ? result.toString().substring(0, 1000) : result.toString();
// logDto.setResult(message);
// tallFeignClient.log(logDto);
// }
//
// return result;
// }
//
// /**
// * 获取方法路径、描述、参数
// * @param pjp
// * @return
// */
// private LogDto initLog(ProceedingJoinPoint pjp) {
//
// //路径
// HttpServletRequest request = ((ServletRequestAttributes)
// RequestContextHolder.getRequestAttributes()).getRequest();
// String url = request.getServletPath();
//
// if (ignoreUrlSet.contains(url)){
// log.info("保存日志,不进行记录");
// return null;
// }
// LogDto dto = new LogDto();
// dto.setUrl(url);
// dto.setFacility(request.getHeader("fingerprint"));
// //参数
// Object[] args = pjp.getArgs();
// StringBuilder param = new StringBuilder();
// for (int i = 0; i < args.length; i++) {
// if (args[i] == null) {
// continue;
// }else if (args[i] instanceof ServletResponse) {
// continue;
// } else if (args[i] instanceof ServletRequest) {
// Object claims = request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS);
// String userId = claims == null ? null : ((Claims) claims).getSubject();
// if (userId != null) {
// param.append("userId:").append(userId).append("--");
// dto.setUserId(Long.parseLong(userId));
// }
//
// } else if (args[i] instanceof Part) {
// param.append("file:").append(UploadFileUtil_Servlet3.getFileNameByPart((Part)args[i])).append("--");
// }else {
// param.append(args[i]).append("--");
// }
//
// }
// dto.setParams(param.length() > 1000 ? param.substring(0, 1000) : param.toString());
// try {
// MethodSignature methodSignature = (MethodSignature) pjp.getSignature();
// Method method = pjp.getTarget().getClass().getMethod(methodSignature.getName(), methodSignature.getParameterTypes());
// ApiOperation annotation = method.getAnnotation(ApiOperation.class);
// dto.setMethodDesc(annotation == null ? "" : annotation.value());
// } catch (Exception e) {
// log.error("获取方法时异常",e);
// }
//
// return dto;
// }
//
//}

167
cloudutil/src/main/java/com/ccsens/cloudutil/aspect/MustLoginAspect.java

@ -1,10 +1,12 @@
package com.ccsens.cloudutil.aspect;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.servlet.ServletUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.cloudutil.feign.Tall3FeignClient;
import com.ccsens.cloudutil.bean.ptos.dto.FeignUserDto;
import com.ccsens.cloudutil.feign.PtosTallFeignClient;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
@ -38,7 +40,7 @@ import java.util.List;
@Component
public class MustLoginAspect {
@Autowired
private Tall3FeignClient tall3FeignClient;
private PtosTallFeignClient ptosTallFeignClient;
@Pointcut("@annotation(com.ccsens.cloudutil.annotation.MustLogin) || @annotation(com.ccsens.cloudutil.annotation.Login) ")
public void loginAdvice(){}
@ -50,19 +52,25 @@ public class MustLoginAspect {
RequestContextHolder.getRequestAttributes()).getRequest();
final String authHeader = request.getHeader(WebConstant.HEADER_KEY_TOKEN);
// if(StrUtil.isEmpty(authHeader)){
// return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
// }
//TODO 获取设备id
final String deviceId = request.getHeader("deviceId");
//TODO 获取客户端类型
final String clientType = request.getHeader("clientType");
//TODO 获取ip地址
final String clientIp = ServletUtil.getClientIP(request);
Object[] args = pjp.getArgs();
QueryDto dto = args == null || args.length < 1 ? null : (QueryDto) args[0];
//获取userId
JsonResponse response = null;
if(StrUtil.isNotEmpty(authHeader)){
byte clientType1 = Byte.parseByte(clientType == null ? "0" : clientType);
if(StrUtil.isNotEmpty(deviceId)){
log.info("MustLogin————token:{}", authHeader);
response = tall3FeignClient.getUserIdByToken(authHeader);
log.info("MustLogin————deviceId:{}", deviceId);
FeignUserDto.UserInfoByToken userInfoByToken = new FeignUserDto.UserInfoByToken(authHeader,deviceId,clientIp, clientType1);
response = ptosTallFeignClient.getUserIdByToken(userInfoByToken);
}
log.info("{}获取userId:{}", authHeader, response);
Signature signature = pjp.getSignature();
MethodSignature methodSignature = (MethodSignature) signature;
@ -70,25 +78,7 @@ public class MustLoginAspect {
MustLogin mustLoginAnnotation = targetMethod.getAnnotation(MustLogin.class);
fillSpecial(dto, mustLoginAnnotation);
if (mustLoginAnnotation == null) {
log.info("不是必须登录,有token,则添加userId,没有则不添加");
if (response != null && response.getCode().intValue() == CodeEnum.SUCCESS.getCode().intValue() && response.getData() != null) {
JSONObject json = JSONObject.parseObject(JSON.toJSONString(response.getData()));
Long userId = json.getLong("id");
String userName = json.getString("userName");
String avatarUrl = json.getString("avatarUrl");
String phone = json.getString("phone");
if (dto != null) {
dto.setUserId(userId);
dto.setUserName(userName);
dto.setAvatarUrl(avatarUrl);
dto.setPhone(phone);
}
}
Object result = pjp.proceed();
return result;
}
//必须登录,未登录直接返回未登录相关信息
//必须登录,未登录直接返回未登录相关信息
if (response == null) {
return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
@ -104,6 +94,11 @@ public class MustLoginAspect {
String userName = json.getString("userName");
String avatarUrl = json.getString("avatarUrl");
String phone = json.getString("phone");
String authType = json.getString("authType");
//token
String token = json.getString("token");
String refreshToken = json.getString("refreshToken");
if (userId == null || userId == 0) {
return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
}
@ -113,9 +108,19 @@ public class MustLoginAspect {
dto.setUserName(userName);
dto.setAvatarUrl(avatarUrl);
dto.setPhone(phone);
dto.setAuthType(Byte.parseByte(authType));
dto.setDeviceId(deviceId);
dto.setClientType(clientType1);
dto.setClientIp(clientIp);
}
Object result = pjp.proceed();
if(result instanceof JsonResponse && authHeader == null){
JsonResponse result1 = (JsonResponse) result;
if(result1.getCode() == 200 && result1.getData() != null){
result1.setTokenObj(token,refreshToken);
return result1;
}
}
return result;
}
@ -142,9 +147,113 @@ public class MustLoginAspect {
dto.setParam(arrayList);
}
break;
default:
}
}
}
// @Around("loginAdvice()")
// public Object around(ProceedingJoinPoint pjp) throws Throwable {
//
// HttpServletRequest request = ((ServletRequestAttributes)
// RequestContextHolder.getRequestAttributes()).getRequest();
//
// final String authHeader = request.getHeader(WebConstant.HEADER_KEY_TOKEN);
//// if(StrUtil.isEmpty(authHeader)){
//// return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
//// }
// Object[] args = pjp.getArgs();
// QueryDto dto = args == null || args.length < 1 ? null : (QueryDto) args[0];
//
// //获取userId
// JsonResponse response = null;
// if(StrUtil.isNotEmpty(authHeader)){
// log.info("MustLogin————token:{}", authHeader);
// response = tall3FeignClient.getUserIdByToken(authHeader);
// }
// log.info("{}获取userId:{}", authHeader, response);
//
// Signature signature = pjp.getSignature();
// MethodSignature methodSignature = (MethodSignature) signature;
// Method targetMethod = methodSignature.getMethod();
//
// MustLogin mustLoginAnnotation = targetMethod.getAnnotation(MustLogin.class);
// fillSpecial(dto, mustLoginAnnotation);
// if (mustLoginAnnotation == null) {
// log.info("不是必须登录,有token,则添加userId,没有则不添加");
// if (response != null && response.getCode().intValue() == CodeEnum.SUCCESS.getCode().intValue() && response.getData() != null) {
// JSONObject json = JSONObject.parseObject(JSON.toJSONString(response.getData()));
// Long userId = json.getLong("id");
// String userName = json.getString("userName");
// String avatarUrl = json.getString("avatarUrl");
// String phone = json.getString("phone");
// if (dto != null) {
// dto.setUserId(userId);
// dto.setUserName(userName);
// dto.setAvatarUrl(avatarUrl);
// dto.setPhone(phone);
// }
// }
// Object result = pjp.proceed();
// return result;
// }
// //必须登录,未登录直接返回未登录相关信息
// //必须登录,未登录直接返回未登录相关信息
// if (response == null) {
// return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
// }
// if (response.getCode().intValue() != CodeEnum.SUCCESS.getCode().intValue()) {
// return response;
// }
// if (response.getData() == null) {
// return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
// }
// JSONObject json = JSONObject.parseObject(JSON.toJSONString(response.getData()));
// Long userId = json.getLong("id");
// String userName = json.getString("userName");
// String avatarUrl = json.getString("avatarUrl");
// String phone = json.getString("phone");
// if (userId == null || userId == 0) {
// return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
// }
//
// if (dto != null) {
// dto.setUserId(userId);
// dto.setUserName(userName);
// dto.setAvatarUrl(avatarUrl);
// dto.setPhone(phone);
// }
//
// Object result = pjp.proceed();
// return result;
// }
//
// private void fillSpecial(QueryDto dto, MustLogin mustLoginAnnotation) {
// if (mustLoginAnnotation == null) {
// return;
// }
// if (dto != null && mustLoginAnnotation.type() > -1) {
// switch (mustLoginAnnotation.type()) {
// case 0:
// Object obj = dto.getParam();
// if (obj!= null && !obj.getClass().isArray()) {
// Class<?> aClass = dto.getParam().getClass();
// Object o = Array.newInstance(aClass, 1);
// Array.set(o, 0, dto.getParam());
// dto.setParam(o);
// }
// break;
// case 1:
// Object obj1 = dto.getParam();
// if (obj1!= null && !(obj1 instanceof List)) {
// ArrayList arrayList = new ArrayList();
// arrayList.add(dto.getParam());
// dto.setParam(arrayList);
// }
// break;
// }
//
// }
// }
}

25
cloudutil/src/main/java/com/ccsens/cloudutil/bean/ptos/dto/FeignProjectDto.java

@ -0,0 +1,25 @@
package com.ccsens.cloudutil.bean.ptos.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author AUSU
*/
@Data
public class FeignProjectDto {
@Data
@ApiModel("根据手机号查找用户能看的项目列表")
public static class QueryProjectByPhone{
@ApiModelProperty("开始时间")
private Long startTime;
@ApiModelProperty("结束时间")
private Long endTime;
@ApiModelProperty("结束时间")
private List<String> phone;
}
}

34
cloudutil/src/main/java/com/ccsens/cloudutil/bean/ptos/dto/FeignUserDto.java

@ -0,0 +1,34 @@
package com.ccsens.cloudutil.bean.ptos.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author
*/
@Data
public class FeignUserDto {
@Data
@ApiModel("通过token获取用户信息")
public static class UserInfoByToken{
@ApiModelProperty("token")
private String token;
@ApiModelProperty("设备id")
private String deviceId;
@ApiModelProperty("ip地址")
private String clientIp;
@ApiModelProperty("客户端类型 0-H5 1-App")
private Byte clientType;
public UserInfoByToken() {
}
public UserInfoByToken(String token, String deviceId, String clientIp, Byte clientType) {
this.token = token;
this.deviceId = deviceId;
this.clientIp = clientIp;
this.clientType = clientType;
}
}
}

71
cloudutil/src/main/java/com/ccsens/cloudutil/bean/ptos/vo/FeignProjectVo.java

@ -0,0 +1,71 @@
package com.ccsens.cloudutil.bean.ptos.vo;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.util.WebConstant;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author AUSU
*/
@Data
public class FeignProjectVo {
@Data
@ApiModel("日历下项目列表信息")
public static class ProjectInfo{
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("项目名")
private String name;
@ApiModelProperty("开始时间")
private Long startTime;
@ApiModelProperty("结束时间")
private Long endTime;
@ApiModelProperty("项目完成状态(0-未开始,1-进行中,2-暂停,3-已完成)")
private byte status;
@ApiModelProperty("访问路径)")
private String url;
@ApiModelProperty("所属域code")
private String domainCode;
@ApiModelProperty("所属业务code")
private String businessCode;
@ApiModelProperty("子项目")
private List<ProjectInfo> sonProjectList;
@JsonIgnore
@ApiModelProperty("父级id")
private Long parentId;
public Byte getStatus() {
long current = System.currentTimeMillis();
if(ObjectUtil.isNull(getStartTime()) || ObjectUtil.isNull(getEndTime())) {
return null;
}
if(getStartTime() > current){
this.status = (byte) WebConstant.EVENT_PROCESS.Pending.value;
}else if(getEndTime() < current){
this.status = (byte) WebConstant.EVENT_PROCESS.Expired.value;
}else{
this.status = (byte) WebConstant.EVENT_PROCESS.Processing.value;
}
return this.status;
}
public ProjectInfo() {
}
public ProjectInfo(Long id, String name, Long startTime, Long endTime, String url, String domainCode, String businessCode) {
this.id = id;
this.name = name;
this.startTime = startTime;
this.endTime = endTime;
this.url = url;
this.domainCode = domainCode;
this.businessCode = businessCode;
}
}
}

32
cloudutil/src/main/java/com/ccsens/cloudutil/bean/ptos/vo/FeignUserVo.java

@ -0,0 +1,32 @@
package com.ccsens.cloudutil.bean.ptos.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author
*/
@Data
public class FeignUserVo {
@Data
@ApiModel("根据token获取用户信息")
public static class TokenToUserId{
@ApiModelProperty("用户id")
private Long id;
@ApiModelProperty("用户名")
private String userName;
@ApiModelProperty("头像")
private String avatarUrl;
@ApiModelProperty("手机号")
private String phone;
@ApiModelProperty("用户类型 0未认证 1已认证")
private byte authType;
@ApiModelProperty("token")
private String token;
@ApiModelProperty("刷新token")
private String refreshToken;
}
}

15
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/HolidaysDto.java

@ -1,15 +0,0 @@
package com.ccsens.cloudutil.bean.tall.dto;
import lombok.Data;
/**
* @author
*/
@Data
public class HolidaysDto {
@Data
public static class GetHolidays{
private Long startTime;
private Long endTime;
}
}

31
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/LogDto.java

@ -1,31 +0,0 @@
package com.ccsens.cloudutil.bean.tall.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @description:
* @author: wuHuiJuan
* @create: 2019/12/09 18:01
*/
@Data
@ApiModel
public class LogDto {
private Long id;
@ApiModelProperty("接口地址")
private String url;
@ApiModelProperty("接口参数")
private String params;
@ApiModelProperty("接口描述")
private String methodDesc;
@ApiModelProperty("接口返回值(或异常)")
private String result;
@ApiModelProperty("设备信息")
private String facility;
@ApiModelProperty("设备信息")
private Long userId;
}

169
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/MemberRoleDto.java

@ -1,169 +0,0 @@
package com.ccsens.cloudutil.bean.tall.dto;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.PropUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @description:
* @author: wuHuiJuan
* @create: 2019/12/05 10:37
*/
public class MemberRoleDto {
@ApiModel("MemberRoleDtoAssign")
@Data
public static class Assign{
@ApiModelProperty("项目ID")
private Long projectId;
@ApiModelProperty("项目名称")
private String projectName = PropUtil.projectName;
@ApiModelProperty("角色")
private List<String> roleNames;
@ApiModelProperty("用户ID")
@NotNull
private Long userId;
@ApiModelProperty("用户名")
@NotNull
private String name;
@ApiModelProperty("操作人ID")
@NotNull
private Long createBy;
public CodeEnum check(){
//至少有一个条件
boolean noProject = (projectId == null || projectId == 0 ) && StrUtil.isBlank(projectName);
if (noProject) {
return CodeEnum.PARAM_ERROR;
}
return CodeEnum.SUCCESS;
}
}
@ApiModel("MemberRoleDtoDelete")
@Data
public static class Delete{
@ApiModelProperty("项目ID")
private Long projectId;
@ApiModelProperty("项目名称")
private String projectName = PropUtil.projectName;
@ApiModelProperty("角色")
private List<String> roleNames;
@ApiModelProperty("用户ID")
@NotNull
private Long userId;
public CodeEnum check(){
//至少有一个条件
boolean hasProject = (projectId == null || projectId == 0 ) && StrUtil.isBlank(projectName);
if (!hasProject) {
return CodeEnum.PARAM_ERROR;
}
return CodeEnum.SUCCESS;
}
public Assign toAssign(){
Assign assign = new Assign();
BeanUtils.copyProperties(this, assign);
return assign;
}
}
@Data
@ApiModel("添加成员")
public static class SaveMember{
@NotNull
@ApiModelProperty("项目id")
private Long projectId;
@ApiModelProperty("成员名")
private String memberName;
@NotEmpty
@ApiModelProperty("成员手机号")
private String phone;
@ApiModelProperty("所属角色的id")
private List<Long> roleId;
@ApiModelProperty("奖惩干系人手机号")
private String stakeholderPhone;
@ApiModelProperty("奖惩干系人姓名")
private String stakeholderName;
@ApiModelProperty("token")
private String token;
}
@Data
@ApiModel("添加角色")
public static class SaveRole{
@NotNull(message = "项目不能为空")
@ApiModelProperty("项目id")
private Long projectId;
@NotEmpty(message = "角色名不能为空")
@ApiModelProperty("角色名")
private String roleName;
@ApiModelProperty("token")
private String token;
}
@Data
@ApiModel
public static class GetMemberByPhone{
@ApiModelProperty("项目id")
private Long projectId;
@ApiModelProperty("手机号")
private String phone;
@ApiModelProperty("token")
private String token;
}
@Data
@ApiModel("给角色添加成员")
public static class SaveMemberInRole{
@NotNull(message = "角色Id不能为空")
@ApiModelProperty("角色id")
private Long roleId;
@ApiModelProperty("成员Id")
private Long memberId;
@ApiModelProperty("token")
private String token;
}
@Data
@ApiModel("给角色添加成员")
public static class DeleteRole{
@ApiModelProperty("角色id")
private Long roleId;
@ApiModelProperty("token")
private String token;
}
@Data
@ApiModel("给模板项目添加成员")
public static class SaveMemberForTemplate {
@NotNull(message = "项目id不能为空")
@ApiModelProperty("项目id")
private Long projectId;
@ApiModelProperty("成员列表")
private List<MemberForTemplate> memberForTemplate;
}
@Data
@ApiModel("模板项目成员信息")
public static class MemberForTemplate {
@ApiModelProperty("用户id(医生)")
private Long userId;
@ApiModelProperty("成员名")
private String memberName;
@ApiModelProperty("成员手机号")
private String phone;
@ApiModelProperty("所属角色的名称")
private List<String> roleName;
}
}

56
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/ProjectDto.java

@ -1,56 +0,0 @@
package com.ccsens.cloudutil.bean.tall.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
import java.util.Set;
/**
* @author AUSU
*/
@Data
public class ProjectDto {
@Data
@ApiModel("根据模板复制项目")
public static class CopyProject{
@NotNull(message = "请选择要复制得项目")
@ApiModelProperty("项目id")
private Long projectId;
@ApiModelProperty("新项目名字")
private String projectName;
}
@Data
@ApiModel("添加项目信息")
public static class SaveProjectDto{
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("父项目id")
private Long parentId;
@ApiModelProperty("项目名称")
private String name;
@ApiModelProperty("开始时间")
private Long startTime;
@ApiModelProperty("结束时间")
private Long endTime;
@ApiModelProperty("接口访问地址")
private String url;
@ApiModelProperty("模板code")
private String code;
@ApiModelProperty("用户列表")
private Set<Long> userIdList;
}
@Data
@ApiModel("保存用户项目列表")
public static class SaveUserProject{
@ApiModelProperty("项目id")
private List<Long> projectId;
@ApiModelProperty("用户id")
private List<Long> userId;
}
}

137
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/TallTaskDto.java

@ -1,137 +0,0 @@
package com.ccsens.cloudutil.bean.tall.dto;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.util.exception.BaseException;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NonNull;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
@ApiModel
public class TallTaskDto {
@ApiModel
@Data
public static class AddTask {
@ApiModelProperty("关联项目Id")
private Long projectId;
@ApiModelProperty("关联的任务id(detailId)")
private Long parentTaskId;
@ApiModelProperty("任务名称")
@NotEmpty(message = "任务名不能为空")
private String taskName;
@ApiModelProperty("任务描述")
private String description;
@ApiModelProperty("负责人id")
@NotNull(message = "请选择负责人")
private Long executorId;
@ApiModelProperty("开始时间")
private Long beginTime;
@ApiModelProperty("结束时间")
private Long endTime;
@ApiModelProperty("重复周期")
private String cycle;
@ApiModelProperty("交付物")
private String taskDeliver;
@ApiModelProperty("插件")
private List<Long> pluginList;
@ApiModelProperty("优先级 3,紧急重要 2,紧急不重要 1,重要不紧急 0,不重要不紧急 默认0")
private Byte priority;
@ApiModelProperty("任务提醒消息")
private TaskRemindByAdd taskRemind;
@ApiModelProperty("token")
private String token;
}
@Data
@ApiModel("添加时设置任务提醒")
public static class TaskRemindByAdd{
@ApiModelProperty("提醒时机 0不提醒 1开始前,2开始时,3开始后,4结束前,5结束时,6结束后,7自定义时间")
private Byte remindTiming;
@ApiModelProperty("时长 提醒时机是“开始时”或“结束时”可以为空")
private Long duration = 0L;
@ApiModelProperty("时间单位 0分钟 1小时 2天")
private Byte unit;
public Long getDuration(){
if(ObjectUtil.isNull(unit)) {
throw new BaseException("时间单位不能为空");
}
if(remindTiming == 7){
return duration;
}
switch (unit) {
case 0:
return duration * 60 * 1000L;
case 1:
return duration * 60 * 60 * 1000L;
case 2:
return duration * 24 * 60 * 60 * 1000L;
default:
return duration;
}
}
}
@Data
@ApiModel("修改任务详细信息")
public static class UpdateTaskInfo{
@ApiModelProperty("任务id")
private Long id;
@ApiModelProperty("任务名")
private String name;
@ApiModelProperty("任务详情")
private String description;
@ApiModelProperty("负责人")
private Long executorRole;
@ApiModelProperty("任务开始时间")
private Long beginTime;
@ApiModelProperty("任务结束时间")
private Long endTime;
@ApiModelProperty("重复频率")
private String cycle;
@ApiModelProperty("任务奖惩")
private Long money;
@ApiModelProperty("任务切换模式,0时间到立刻切换 1延迟delay_time切换 2手动切换")
private int delay;
@ApiModelProperty("延迟切换时间")
private Long delayTime;
@ApiModelProperty("优先级 3,紧急重要 2,紧急不重要 1,重要不紧急 0,不重要不紧急 默认0")
private Byte priority;
@ApiModelProperty("是否是里程碑 0否 1是")
private Byte milestone;
@ApiModelProperty("需要修改的插件Id")
private List<Long> plugins;
@ApiModelProperty("token")
private String token;
}
@Data
@ApiModel("修改插件配置")
public static class UpdatePluginConfig {
@NonNull
@ApiModelProperty("任务id")
private Long taskId;
@ApiModelProperty("任务插件id")
private Long taskPluginId;
@ApiModelProperty("页面接口路径")
private String webPath;
@ApiModelProperty("入参")
private String importParam;
@ApiModelProperty("放置位置 默认0 ,0任务名 1详情页 2任务下")
private Byte placeLocation;
@ApiModelProperty("程序位置 0:tall内部,1外部")
private Byte routineLocation;
@ApiModelProperty("token")
private String token;
public UpdatePluginConfig() {
}
}
}

42
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/TaskDto.java

@ -1,42 +0,0 @@
package com.ccsens.cloudutil.bean.tall.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* @description:
* @author: whj
* @time: 2021/6/3 10:10
*/
public class TaskDto {
@ApiModel
@Data
public static class StartTask {
@ApiModelProperty("项目Id")
@NotNull(message = "projectId is required.")
private Long projectId;
@ApiModelProperty("角色Id")
@NotNull(message = "roleId is required.")
private Long roleId;
@ApiModelProperty("任务在当前时间的subTimeId")
@NotNull(message = "taskId is required.")
private Long taskId;
@ApiModelProperty("开始任务的时间 如果为空则为当前时间")
private Long startTime;
@ApiModelProperty("是否修改后续任务的时间(0否,1是)")
private Byte isUpdateTime = 0;
}
@ApiModel
@Data
public static class TaskSubTimeId {
@ApiModelProperty("任务id")
private Long id;
@ApiModelProperty("任务完成状态0未完成 1进行中 2已完成")
private Integer completedStatus;
}
}

28
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/UserDto.java

@ -1,28 +0,0 @@
package com.ccsens.cloudutil.bean.tall.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
/**
* @description:
* @author: wuHuiJuan
* @create: 2019/12/05 10:22
*/
public class UserDto {
//默认注册
@Data
@ApiModel("UserDtoDefaultUserSingup")
public static class DefaultUserSingup{
@ApiModelProperty("手机号")
@NotEmpty(message = "手机号不能为空")
private String phone;
@ApiModelProperty("账号")
@NotEmpty(message = "账号不能为空.")
private String account;
@ApiModelProperty("来源")
private byte source;
}
}

62
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/dto/WpsDto.java

@ -1,62 +0,0 @@
package com.ccsens.cloudutil.bean.tall.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Map;
@Data
public class WpsDto {
@Data
@ApiModel("业务和WPS")
public static class Business{
@ApiModelProperty("业务ID")
private Long businessId;
@ApiModelProperty("wps文件ID")
private Long wpsFileId;
@ApiModelProperty("业务类型 0项目WBS 1交付物 2会议记录。后面是pims内的表:3产品依据表,4产品收入表,5成本表,6损益表,7现金流表")
private Byte businessType;
@ApiModelProperty("用户ID")
private Long userId;
@ApiModelProperty("文件名")
private String fileName;
@ApiModelProperty("文件路径,默认在WebConstant.UPLOAD_PATH_BASE下")
private String filePath;
@ApiModelProperty("文件实际存储路径")
private String realFilePath;
@ApiModelProperty("文件大小")
private Long fileSize;
@ApiModelProperty("操作类型 值:WebConstant Wps USER_OPERATION... ")
private byte operation;
@ApiModelProperty("操作权限 WebConstant Wps PROJECT_PRIVILEGE...")
private byte privilege;
@ApiModelProperty("操作权限查询路径")
private String privilegeQueryUrl;
}
@Data
@ApiModel("查找wps文件路径")
public static class VisitWpsUrl{
@NotNull
@ApiModelProperty("业务ID")
private Long businessId;
@NotNull
@ApiModelProperty("业务类型")
private byte businessType;
@NotNull
@ApiModelProperty("userId")
private Long userId;
@ApiModelProperty("访问路径")
private Map<String, String> params;
}
@Data
@ApiModel("异步通知")
public static class Async{
@ApiModelProperty("文件ID")
private Long fileId;
}
}

18
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/HolidaysVo.java

@ -1,18 +0,0 @@
package com.ccsens.cloudutil.bean.tall.vo;
import lombok.Data;
import java.util.List;
/**
* @author
*/
@Data
public class HolidaysVo {
@Data
public static class Holidays{
private List<String> workday;
private List<String> nonWorkday;
}
}

57
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/MemberVo.java

@ -1,57 +0,0 @@
package com.ccsens.cloudutil.bean.tall.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class MemberVo {
@Data
public static class MemberInfo{
private Long id;
private Long userId;
private Long projectId;
private String nickname;
private String avatarUrl;
private Integer no;
private String phone;
private String description;
private Long joinTime;
private Long stakeholderId;
}
@Data
@ApiModel("角色信息")
public static class RoleInfo{
@ApiModelProperty("角色id")
private Long roleId;
@ApiModelProperty("角色名")
private String roleName;
}
@Data
@ApiModel("添加时返回成员信息")
public static class Member{
@ApiModelProperty("成员id")
private Long memberId;
@ApiModelProperty("成员名")
private String memberName;
@ApiModelProperty("手机号")
private String phone;
@ApiModelProperty("userId")
private Long userId;
}
@Data
@ApiModel("查找项目内所有的成员")
public static class MemberList{
@ApiModelProperty("成员id")
private Long memberId;
@ApiModelProperty("成员名")
private String memberName;
@ApiModelProperty("userId")
private Long userId;
}
}

28
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/PluginVo.java

@ -1,28 +0,0 @@
package com.ccsens.cloudutil.bean.tall.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class PluginVo {
@ApiModel
@Data
public static class PluginSignField{
@ApiModelProperty("变量名")
private String name;
@ApiModelProperty("展示名")
private String description;
@ApiModelProperty("类型 0文本 1文本框 2单选 3多选")
private int type;
@ApiModelProperty("类型值(文本,单选,多选,展示的内容 例:{\"1\":\"男\",\"2\":\"女\"},)")
private String fieldValue;
@ApiModelProperty("正则表达式")
private String format;
@ApiModelProperty("是否必填")
private int isRequired;
@ApiModelProperty("是否支持模糊查询")
private int isFuzzy;
}
}

46
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/ProjectVo.java

@ -1,46 +0,0 @@
package com.ccsens.cloudutil.bean.tall.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author AUSU
*/
@Data
public class ProjectVo {
@Data
@ApiModel("复制的项目信息")
public static class ProjectInfo{
@ApiModelProperty("项目id")
private Long id;
@ApiModelProperty("任务详情")
private List<TaskDetail> taskDetails;
}
@Data
@ApiModel("任务详情")
public static class TaskDetail{
@ApiModelProperty("任务详情id")
private Long taskDetailId;
@ApiModelProperty("任务详情名称")
private String taskDetailName;
@ApiModelProperty("任务等级")
private Byte taskDetailLevel;
@ApiModelProperty("任务详情下的分解任务")
private List<TaskSub> taskSubList;
}
@Data
@ApiModel("分解任务")
public static class TaskSub{
@ApiModelProperty("分解任务id")
private Long taskSubId;
@ApiModelProperty("分解任务开始时间")
private Long startTime;
@ApiModelProperty("分解任务结束时间")
private Long endTime;
}
}

124
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/TaskVo.java

@ -1,124 +0,0 @@
package com.ccsens.cloudutil.bean.tall.vo;
import cn.hutool.core.util.ObjectUtil;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Data
public class TaskVo {
@Data
public static class TaskInfoWithFeign{
private Long id;
private String name;
private Long projectId;
private String projectName;
}
@ApiModel
@Data
public static class NormalTask{
@ApiModelProperty("任务详细信息id")
private Long detailId;
@ApiModelProperty("当前任务的时间段id")
private Long id;
@ApiModelProperty("名称")
private String name;
@ApiModelProperty("详细描述")
private String description;
@ApiModelProperty("父任务名称")
private String parentName;
@ApiModelProperty("所属项目id")
private Long projectId;
@ApiModelProperty("所属项目名称")
private String projectName;
@ApiModelProperty("负责人Id")
private Long executorRole;
@ApiModelProperty("负责人名称")
private String executorRoleName;
@ApiModelProperty("开始时间")
private Long beginTime;
@ApiModelProperty("结束时间")
private Long endTime;
@ApiModelProperty("时长")
private Long duration;
@ApiModelProperty("循环周期")
private String cycle;
@ApiModelProperty("跳转模式 0自动,1延迟,2手动")
private int delay;
@ApiModelProperty("实际开始时间")
private Long realBeginTime;
@ApiModelProperty("实际结束时间")
private Long realEndTime;
@ApiModelProperty("跳转结束时间")
private Long loopEndTime;
@ApiModelProperty("跳转的任务id")
private Long loopTo;
@ApiModelProperty("执行时间")
private Long execTimes;
@ApiModelProperty("奖惩")
private BigDecimal money;
@ApiModelProperty("状态:0-未开始,1-进行中,2-已完成")
private int process;
@ApiModelProperty("子项目id")
private Long subProjectId;
@ApiModelProperty("子项目名字")
private String subProjectName;
@ApiModelProperty("服务器时间")
private Long serverTime;
@ApiModelProperty("任务类型 0普通任务 1虚拟任务")
private int virtual;
@ApiModelProperty("有无分组")
private int hasGroup;
@ApiModelProperty("分数")
private BigDecimal score;
@ApiModelProperty("插件")
private List<PluginVo> plugins;
@ApiModelProperty("二级任务")
private List<NormalTask> secondTasks;
@ApiModelProperty("时间状态 0:正常 1:任务开始 2:任务结束")
private Byte timeStatus = 0;
@ApiModelProperty("当前周期内任务的序号")
private int sequence;
@ApiModelProperty("页面/接口路径")
private String webPath;
@ApiModelProperty("程序位置 0:tall内部,1外部")
private Byte routineLocation;
@ApiModelProperty("入参")
private String importParam;
public Long getDuration(){
if(ObjectUtil.isNotNull(beginTime) && ObjectUtil.isNotNull(endTime)) {
return endTime - beginTime;
}
return null;
}
public Long getServerTime(){
return System.currentTimeMillis();
}
}
@ApiModel
@Data
public static class PluginVo{
@ApiModelProperty("插件id")
private String id;
@ApiModelProperty("插件名")
private String name;
@ApiModelProperty("插件描述")
private String description;
@ApiModelProperty("显示分类")
private String showType;
@ApiModelProperty("页面/接口路径")
private String webPath;
@ApiModelProperty("程序位置 0:tall内部,1外部")
private Byte routineLocation;
@ApiModelProperty("入参")
private String importParam;
}
}

20
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/UserVo.java

@ -1,20 +0,0 @@
package com.ccsens.cloudutil.bean.tall.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @description:
* @author: wuHuiJuan
* @create: 2019/12/05 10:22
*/
public class UserVo {
//默认注册
@Data
@ApiModel("UserVoDefaultUserSingup")
public static class DefaultUserSingup{
@ApiModelProperty("用户ID")
private Long id;
}
}

15
cloudutil/src/main/java/com/ccsens/cloudutil/bean/tall/vo/WpsVo.java

@ -1,15 +0,0 @@
package com.ccsens.cloudutil.bean.tall.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class WpsVo {
@Data
public static class BusinessFileIdAndPath{
@ApiModelProperty("业务id")
private Long businessId;
@ApiModelProperty("文件路径")
private String filePath;
}
}

55
cloudutil/src/main/java/com/ccsens/cloudutil/config/FeignConfig.java

@ -1,55 +0,0 @@
//package com.ccsens.cloudutil.config;
//
//import com.fasterxml.jackson.databind.DeserializationFeature;
//import com.fasterxml.jackson.databind.ObjectMapper;
//import com.fasterxml.jackson.databind.module.SimpleModule;
//import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
//import feign.codec.Decoder;
//import feign.codec.Encoder;
//import feign.form.spring.SpringFormEncoder;
//import org.springframework.beans.factory.ObjectFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
//import org.springframework.cloud.openfeign.support.ResponseEntityDecoder;
//import org.springframework.cloud.openfeign.support.SpringDecoder;
//import org.springframework.cloud.openfeign.support.SpringEncoder;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.http.MediaType;
//import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
//
//import java.util.ArrayList;
//import java.util.List;
//
///**
// * @description:
// * @author: wuHuiJuan
// * @create: 2019/12/09 15:27
// */
//@Configuration
//public class FeignConfig {
//
// @Autowired
// private ObjectFactory<HttpMessageConverters> messageConverters;
//
// @Bean
// public Encoder feignFormEncoder() {
// return new SpringFormEncoder(new SpringEncoder(messageConverters));
// }
//
// @Bean
// public Decoder feignDecoder() {
// return new ResponseEntityDecoder(new SpringDecoder(() -> {
// MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
// List<MediaType> mediaTypeList = new ArrayList<>();
// mediaTypeList.add(MediaType.TEXT_HTML);
// mediaTypeList.add(MediaType.APPLICATION_JSON_UTF8);
// converter.setSupportedMediaTypes(mediaTypeList);
//
// ObjectMapper objectMapper = new ObjectMapper();
// objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
// converter.setObjectMapper(objectMapper); return new HttpMessageConverters(converter);
// }));
// }
//
//}

44
cloudutil/src/main/java/com/ccsens/cloudutil/feign/DiplomatistFeignClient.java

@ -0,0 +1,44 @@
package com.ccsens.cloudutil.feign;
import com.ccsens.cloudutil.bean.ptos.dto.FeignProjectDto;
import com.ccsens.cloudutil.bean.ptos.vo.FeignProjectVo;
import com.ccsens.cloudutil.config.FeignTokenConfig;
import com.ccsens.util.JsonResponse;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.List;
/**
* @author
*/
@FeignClient(name = "diplomatist", path = "",fallbackFactory = DiplomatistFeignClientFallBack.class,configuration = FeignTokenConfig.class)
public interface DiplomatistFeignClient {
/**
* 查询用户关联的其他域的项目信息
*/
@GetMapping("domain/ptDomainProject")
JsonResponse<List<FeignProjectVo.ProjectInfo>> queryDomainProject(FeignProjectDto.QueryProjectByPhone params);
}
@Slf4j
@Component
class DiplomatistFeignClientFallBack implements FallbackFactory<DiplomatistFeignClient> {
@Override
public DiplomatistFeignClient create(Throwable cause) {
log.error("访问传达室异常", cause);
return new DiplomatistFeignClient() {
@Override
public JsonResponse<List<FeignProjectVo.ProjectInfo>> queryDomainProject(FeignProjectDto.QueryProjectByPhone params) {
return null;
}
};
}
}

41
cloudutil/src/main/java/com/ccsens/cloudutil/feign/HealthFeignClient.java

@ -1,41 +0,0 @@
package com.ccsens.cloudutil.feign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(name = "health", path = "", fallbackFactory = HealthFeignClientFallBack.class)
public interface HealthFeignClient {
/**
* 获取suiteAccessToken
* @param suiteId
* @return
*/
@GetMapping("getSuiteAccessToken")
String getSuiteAccessToken(@RequestParam(name = "suiteId") String suiteId);
}
@Slf4j
@Component
class HealthFeignClientFallBack implements FallbackFactory<HealthFeignClient> {
@Override
public HealthFeignClient create(Throwable throwable) {
String msg = throwable == null ? "" : throwable.getMessage();
if (!StringUtils.isEmpty(msg)) {
log.error(msg);
}
return new HealthFeignClient() {
@Override
public String getSuiteAccessToken(String suiteId) {
return null;
}
};
}
}

68
cloudutil/src/main/java/com/ccsens/cloudutil/feign/MtFeignClient.java

@ -1,68 +0,0 @@
package com.ccsens.cloudutil.feign;
import com.ccsens.cloudutil.bean.QueryParam;
import com.ccsens.cloudutil.bean.tall.dto.LogDto;
import com.ccsens.cloudutil.bean.tall.dto.MemberRoleDto;
import com.ccsens.cloudutil.bean.tall.dto.UserDto;
import com.ccsens.cloudutil.bean.tall.vo.MemberVo;
import com.ccsens.cloudutil.bean.tall.vo.PluginVo;
import com.ccsens.cloudutil.bean.tall.vo.TaskVo;
import com.ccsens.util.JsonResponse;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import java.math.BigDecimal;
import java.util.List;
@FeignClient(name = "mt", path = "", fallbackFactory = MtFeignClientFallBack.class)
public interface MtFeignClient {
/**
* 普通成员获取自己对任务的评分
* @param taskId
* @param userId
* @return
*/
@GetMapping("plugins/memberScore")
BigDecimal getMemberScore(@RequestParam(name = "taskId")Long taskId, @RequestParam(name = "userId")Long userId);
/**
* 项目经理获取任务的平均分
* @param projectId
* @param taskId
* @return
*/
@GetMapping("plugins/adminScore")
BigDecimal getAdminScore(@RequestParam(name = "projectId")Long projectId, @RequestParam(name = "taskId")Long taskId);
}
@Slf4j
@Component
class MtFeignClientFallBack implements FallbackFactory<MtFeignClient> {
@Override
public MtFeignClient create(Throwable throwable) {
String msg = throwable == null ? "" : throwable.getMessage();
if (!StringUtils.isEmpty(msg)) {
log.error(msg);
}
return new MtFeignClient() {
@Override
public BigDecimal getMemberScore(Long taskId,Long userId) {
return null;
}
@Override
public BigDecimal getAdminScore(Long projectId,Long taskId) {
return null;
}
};
}
}

58
cloudutil/src/main/java/com/ccsens/cloudutil/feign/PtosTallFeignClient.java

@ -0,0 +1,58 @@
package com.ccsens.cloudutil.feign;
import com.ccsens.cloudutil.bean.ptos.dto.FeignProjectDto;
import com.ccsens.cloudutil.bean.ptos.dto.FeignUserDto;
import com.ccsens.cloudutil.bean.ptos.vo.FeignProjectVo;
import com.ccsens.cloudutil.bean.ptos.vo.FeignUserVo;
import com.ccsens.cloudutil.config.FeignTokenConfig;
import com.ccsens.util.JsonResponse;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.List;
/**
* @author
*/
@FeignClient(name = "ptostall", path = "",fallbackFactory = PtosTallFeignClientFallBack.class,configuration = FeignTokenConfig.class)
public interface PtosTallFeignClient {
/**
* 根据token获取userId
*/
@GetMapping("users/token")
JsonResponse<FeignUserVo.TokenToUserId> getUserIdByToken(FeignUserDto.UserInfoByToken params);
/**
* 根据手机号获取用户在本域的业务项目列表
*/
@GetMapping("project/byPhone")
JsonResponse<List<FeignProjectVo.ProjectInfo>> queryProjectByPhone(FeignProjectDto.QueryProjectByPhone params);
}
@Slf4j
@Component
class PtosTallFeignClientFallBack implements FallbackFactory<PtosTallFeignClient> {
@Override
public PtosTallFeignClient create(Throwable cause) {
log.error("访问ptosTall异常", cause);
return new PtosTallFeignClient() {
@Override
public JsonResponse<FeignUserVo.TokenToUserId> getUserIdByToken(FeignUserDto.UserInfoByToken params) {
return null;
}
@Override
public JsonResponse<List<FeignProjectVo.ProjectInfo>> queryProjectByPhone(FeignProjectDto.QueryProjectByPhone params) {
return null;
}
};
}
}

113
cloudutil/src/main/java/com/ccsens/cloudutil/feign/Tall3FeignClient.java

@ -1,113 +0,0 @@
package com.ccsens.cloudutil.feign;
import com.ccsens.cloudutil.bean.tall.dto.HolidaysDto;
import com.ccsens.cloudutil.bean.tall.dto.LogDto;
import com.ccsens.cloudutil.bean.tall.dto.ProjectDto;
import com.ccsens.cloudutil.bean.tall.vo.HolidaysVo;
import com.ccsens.cloudutil.config.FeignTokenConfig;
import com.ccsens.util.JsonResponse;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author
*/
@FeignClient(name = "tall3", path = "v3.0",fallbackFactory = Tall3FeignClientFallBack.class,configuration = FeignTokenConfig.class)
public interface Tall3FeignClient {
/**
* 根据token获取userId
*
* @param token
* @return
*/
@GetMapping("users/token")
JsonResponse getUserIdByToken(@RequestParam(required = true, name = "token") String token);
/**
* 记录操作日志
*
* @param logDto
* @return
*/
@RequestMapping("/log/operation")
JsonResponse log(LogDto logDto);
/**
* 在tall3内保存项目信息
*/
@RequestMapping("project/save")
JsonResponse saveProjectList(ProjectDto.SaveProjectDto projectDto);
/**
* tall3内保存用户项目列表
*/
@RequestMapping("project/saveUserProject")
JsonResponse saveUserProject(ProjectDto.SaveUserProject projectDto);
/**
* tall3内保存用户项目列表
*/
@RequestMapping("holidays")
JsonResponse<HolidaysVo.Holidays> getHolidays(HolidaysDto.GetHolidays getHolidays);
/**
* 根据手机号查找userId
*/
@GetMapping("/project/businessDeleteProject")
JsonResponse businessDeleteProject(@RequestParam(name = "projectId")Long projectId);
/**
* 根据手机号查找userId
*/
@GetMapping("/users/userIdByPhone")
JsonResponse<Long> getUserIdByPhone(@RequestParam(name = "phone")String phone);
}
@Slf4j
@Component
class Tall3FeignClientFallBack implements FallbackFactory<Tall3FeignClient> {
@Override
public Tall3FeignClient create(Throwable cause) {
log.error("访问tall3异常", cause);
return new Tall3FeignClient() {
@Override
public JsonResponse getUserIdByToken(String token) {
return null;
}
@Override
public JsonResponse log(LogDto logDto) {
return null;
}
@Override
public JsonResponse saveProjectList(ProjectDto.SaveProjectDto projectDto) {
return null;
}
@Override
public JsonResponse saveUserProject(ProjectDto.SaveUserProject projectDto) {
return null;
}
@Override
public JsonResponse<HolidaysVo.Holidays> getHolidays(HolidaysDto.GetHolidays getHolidays) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse businessDeleteProject(Long projectId) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse<Long> getUserIdByPhone(String phone) {
return JsonResponse.newInstance().fail();
}
};
}
}

477
cloudutil/src/main/java/com/ccsens/cloudutil/feign/TallFeignClient.java

@ -1,477 +0,0 @@
package com.ccsens.cloudutil.feign;
import com.ccsens.cloudutil.bean.QueryParam;
import com.ccsens.cloudutil.bean.tall.dto.*;
import com.ccsens.cloudutil.bean.tall.vo.*;
import com.ccsens.cloudutil.config.FeignTokenConfig;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @description:
* @author: wuHuiJuan
* @create: 2019/11/27 10:03
*/
@FeignClient(name = "tall", path = "v1.0",fallbackFactory = TallFeignClientFallBack.class,configuration = FeignTokenConfig.class)
public interface TallFeignClient {
/**
* 输入两个userid将两个账号合并保留企业用户的id
* @param userId 需要保存的userid
* @param uselessId 不需要保存的userid
* @return
*/
@GetMapping("/users/mergeUserId")
JsonResponse mergeUserId(@RequestParam(required = true, name = "userId") Long userId,@RequestParam(required = true, name = "uselessId") Long uselessId);
/**
* 获取
*
* @param map
* @return
*/
@PostMapping("/getPort")
String get(QueryParam map);
/**
* 注册用户
*
* @param signup
* @return
*/
@PostMapping("/defaultRegister")
JsonResponse<UserVo.DefaultUserSingup> defaultRegister(UserDto.DefaultUserSingup signup);
/**
* 为用户分配角色
*
* @param assign
* @return
*/
@RequestMapping("assignRoles")
JsonResponse assignRoles(MemberRoleDto.Assign assign);
/**
* 为用户删除角色
*
* @param deleteDto
* @return
*/
@RequestMapping("deleteRoles")
JsonResponse deleteRoles(MemberRoleDto.Delete deleteDto);
/**
* 根据token获取userId
*
* @param token
* @return
*/
@GetMapping("users/token")
JsonResponse getUserIdByToken(@RequestParam(required = true, name = "token") String token);
/**
* 记录操作日志
*
* @param logDto
* @return
*/
@RequestMapping("/log/operation")
JsonResponse log(LogDto logDto);
/**
* 通过任务id获得任务信息
*
* @param taskId
* @return
*/
@GetMapping("/tasks/projectId")
TaskVo.TaskInfoWithFeign getProjectId(@RequestParam(name = "taskId") Long taskId);
/**
* 查询该用户在项目中的member信息
*
* @return
*/
@GetMapping("/users/member")
JsonResponse<MemberVo.MemberInfo> getMemberByUserId(@RequestParam(name = "userId") Long userId, @RequestParam(name = "projectId") Long projectId);
/**
* 当用户不在项目中时查询该用户信息
*
* @return
*/
@GetMapping("/users/getUserInfo")
JsonResponse<MemberVo.MemberInfo> getUserByUserId(@RequestParam(name = "userId") Long userId);
/**
* 获取项目下的所有成员id
*
* @param projectId
* @return
*/
@GetMapping("/users/allMemberAll")
List<Long> getMemberIdListByProject(@RequestParam(name = "projectId") Long projectId);
/**
* 通过token获得userId(消息系统用)
*
* @param token
* @return
*/
@GetMapping("/users/claims")
String getUserId(@RequestParam(name = "token") String token);
/**
* 通过插件id获取签到字段和详细信息
*/
@GetMapping("/plugins/sign")
List<PluginVo.PluginSignField> getSignFieldByTaskPluginId(@RequestParam(name = "taskPluginId") Long taskPluginId);
/**
* 模糊查询
*/
@GetMapping("/plugins/fuzzy")
List<String> getSignFuzzy(@RequestParam(name = "taskPluginId") Long taskPluginId, @RequestParam(name = "signinName") String signinName, @RequestParam(name = "key") String key);
/**
* 通过插件id获取签到字段和详细信息
*/
@GetMapping("/plugins/task")
Long getTaskIdByTaskPluginId(@RequestParam(name = "taskPluginId") Long taskPluginId);
/**
* 保存WPS业务和文件记录
*/
@RequestMapping("/wps/saveWps")
JsonResponse saveWpsFile(WpsDto.Business business);
/**
* 查询WPS业务和文件记录
*/
@RequestMapping("/wps/visitUrls")
List<String> queryVisitUrls(WpsDto.VisitWpsUrl visitWpsUrl);
/**
* 根据wpsId查询wps文件路径
*/
@GetMapping("/wps/wpsId")
JsonResponse<WpsVo.BusinessFileIdAndPath> getPathByWpsId(@RequestParam(name = "wpsId")Long wpsId);
/**
* 根据手机号查找userId
*/
@GetMapping("/users/userIdByPhone")
JsonResponse<Long> getUserIdByPhone(@RequestParam(name = "phone")String phone);
/**
* 查找wps文件路径
*/
@GetMapping("/v1/3rd/getFilePath")
String getWpsFilePath(@RequestParam(name = "businessId") Long businessId,@RequestParam(name = "businessType") byte businessType);
/**
* 通过userId呵taskId查找用户信息
*/
@GetMapping("/users/memberByTask")
JsonResponse<MemberVo.MemberInfo> getMemberInfoByUserIdAndTaskId(@RequestParam(name = "userId") Long userId,@RequestParam(name = "taskId") Long taskId);
/**
* 添加任务
*/
@RequestMapping("/tasks")
JsonResponse<TaskVo.NormalTask> saveTask(TallTaskDto.AddTask addTask);
/**
* 修改任务
*/
@RequestMapping("/tasks/change")
JsonResponse<TaskVo.NormalTask> updataTask(TallTaskDto.UpdateTaskInfo updateTaskInfo);
/**
* 完成任务
*/
@RequestMapping("/tasks/finish")
JsonResponse<TaskVo.NormalTask> finishTask(TaskDto.TaskSubTimeId task);
/**
* 删除任务
*/
@DeleteMapping("/tasks")
JsonResponse deleteTask(@RequestParam(name = "taskId") Long taskId);
/**
* 修改任务插件配置
*/
@RequestMapping("/plugins/config")
JsonResponse<TaskVo.PluginVo> updatePluginConfig(TallTaskDto.UpdatePluginConfig updatePluginConfig);
/**
* 添加角色
*/
@RequestMapping("/roles/save")
JsonResponse<MemberVo.RoleInfo> saveRole(MemberRoleDto.SaveRole saveRole);
/**
* 添加成员
*/
@RequestMapping("/members/save")
JsonResponse<MemberVo.Member> saveMember(MemberRoleDto.SaveMember saveMember);
/**
* 将成员添加至角色内
*/
@RequestMapping("/roles/saveMember")
JsonResponse saveMemberInRole(MemberRoleDto.SaveMemberInRole saveMember);
/**
* 将成员从角色内删除
*/
@RequestMapping("/roles/deleteMember")
JsonResponse deleteMemberInRole(MemberRoleDto.SaveMemberInRole saveMember);
/**
* 通过手机号和项目id查询成员信息
*/
@RequestMapping("/members/query/memberByPhone")
JsonResponse<MemberVo.MemberList> queryMemberByPhone(MemberRoleDto.GetMemberByPhone getMemberByPhone);
/**
* 删除角色
*/
@RequestMapping("/roles/delete")
JsonResponse deleteRole(MemberRoleDto.DeleteRole deleteRole);
/**
* 根据项目模板复制项目
* @param copyProject 项目id
* @return 项目
*/
@RequestMapping(value = "/projects/copyProject",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"})
JsonResponse<ProjectVo.ProjectInfo> copyProjectNew(QueryDto<ProjectDto.CopyProject> copyProject);
/**
* 给复制后的模板项目添加成员
* @param memberForTemplate 项目id和成员
* @return 成功/失败
*/
@RequestMapping(value = "/members/addMemberForTemplate",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"})
JsonResponse addMemberForTemplate(QueryDto<MemberRoleDto.SaveMemberForTemplate> memberForTemplate);
/**
* 开始节点
* @param param 时间
* @return 结果
* @throws Exception
*/
@RequestMapping(value = "/tasks/start", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
JsonResponse startNode(TaskDto.StartTask param) throws Exception;
/**
* 在tall3内保存项目信息
*/
@RequestMapping("/project/save")
JsonResponse saveProjectList(ProjectDto.SaveProjectDto projectDto);
}
@Slf4j
@Component
class TallFeignClientFallBack implements FallbackFactory<TallFeignClient> {
@Override
public TallFeignClient create(Throwable throwable) {
log.error("yichang", throwable);
return new TallFeignClient() {
@Override
public JsonResponse mergeUserId(Long userId, Long uselessId) {
return JsonResponse.newInstance().fail();
}
@Override
public String get(QueryParam map) {
return "hello world";
}
@Override
public JsonResponse defaultRegister(UserDto.DefaultUserSingup signup) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse assignRoles(MemberRoleDto.Assign assign) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse deleteRoles(MemberRoleDto.Delete deleteDto) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse getUserIdByToken(String token) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse log(LogDto logDto) {
return JsonResponse.newInstance().fail();
}
@Override
public TaskVo.TaskInfoWithFeign getProjectId(Long taskId) {
return null;
}
@Override
public JsonResponse<MemberVo.MemberInfo> getMemberByUserId(Long userId, Long projectId) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse<MemberVo.MemberInfo> getUserByUserId(Long userId) {
return JsonResponse.newInstance().fail();
}
@Override
public List<Long> getMemberIdListByProject(Long projectId) {
return null;
}
@Override
public String getUserId(String token) {
return null;
}
@Override
public List<PluginVo.PluginSignField> getSignFieldByTaskPluginId(Long taskPluginId) {
return null;
}
@Override
public List<String> getSignFuzzy(Long taskPluginId, String signinName, String key) {
return null;
}
@Override
public Long getTaskIdByTaskPluginId(Long taskPluginId) {
return null;
}
@Override
public JsonResponse saveWpsFile(WpsDto.Business business) {
return JsonResponse.newInstance().fail();
}
@Override
public List<String> queryVisitUrls(WpsDto.VisitWpsUrl visitWpsUrl) {
return null;
}
@Override
public JsonResponse<WpsVo.BusinessFileIdAndPath> getPathByWpsId(Long async) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse<Long> getUserIdByPhone(String phone) {
return JsonResponse.newInstance().fail();
}
@Override
public String getWpsFilePath(Long businessId, byte businessType) {
return null;
}
@Override
public JsonResponse<MemberVo.MemberInfo> getMemberInfoByUserIdAndTaskId(Long userId, Long taskId) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse<TaskVo.NormalTask> saveTask(TallTaskDto.AddTask addTask) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse<TaskVo.NormalTask> updataTask(TallTaskDto.UpdateTaskInfo updateTaskInfo) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse<TaskVo.NormalTask> finishTask(TaskDto.TaskSubTimeId task) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse deleteTask(Long taskId) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse<TaskVo.PluginVo> updatePluginConfig(TallTaskDto.UpdatePluginConfig updatePluginConfig) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse<MemberVo.RoleInfo> saveRole(MemberRoleDto.SaveRole saveRole) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse<MemberVo.Member> saveMember(MemberRoleDto.SaveMember saveMember) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse saveMemberInRole(MemberRoleDto.SaveMemberInRole saveMember) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse deleteMemberInRole(MemberRoleDto.SaveMemberInRole saveMember) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse<MemberVo.MemberList> queryMemberByPhone(MemberRoleDto.GetMemberByPhone getMemberByPhone) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse deleteRole(MemberRoleDto.DeleteRole deleteRole) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse<ProjectVo.ProjectInfo> copyProjectNew(QueryDto<ProjectDto.CopyProject> copyProject) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse addMemberForTemplate(QueryDto<MemberRoleDto.SaveMemberForTemplate> memberForTemplate) {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse startNode(TaskDto.StartTask param) throws Exception {
return JsonResponse.newInstance().fail();
}
@Override
public JsonResponse saveProjectList(ProjectDto.SaveProjectDto projectDto) {
return JsonResponse.newInstance().fail();
}
};
}
}

1
pom.xml

@ -11,6 +11,7 @@
<module>wechatutil</module>
<module>ptos_tall</module>
<module>ptos_diplomatist</module>
<module>ptos_open</module>
<!-- <module>dh_ht</module>-->
</modules>

4
ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/api/DomainController.java

@ -33,7 +33,7 @@ public class DomainController {
@ApiOperation(value = "查询用户关联的其他域的项目信息(PT--传达室)", notes = "")
@RequestMapping(value = "/ptDomainProject", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ProjectVo.ProjectInfo>> queryDomainProject(HttpServletRequest request, @ApiParam @Validated @RequestBody ProjectDto.QueryProjectByPhone params) throws Exception{
public JsonResponse<List<ProjectVo.ProjectInfo>> queryDomainProject(@ApiParam @Validated @RequestBody ProjectDto.QueryProjectByPhone params) throws Exception{
log.info("PT查询用户关联的其他域的项目信息:{}",params);
List<ProjectVo.ProjectInfo> projectInfos = domainService.queryDomainProject(params);
log.info("PT查询用户关联的其他域的项目信息返回:{}",projectInfos);
@ -44,7 +44,7 @@ public class DomainController {
@RequestMapping(value = "/idcDomainProject", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ProjectVo.ProjectInfo>> idcDomainProject(HttpServletRequest request,@ApiParam @Validated @RequestBody HeartbeatDto.SendDomain params) throws Exception{
log.info("根据用户信息查询用户的访问权限:{}",params);
List<ProjectVo.ProjectInfo> projectInfos = domainService.idcDomainProject(params);
List<ProjectVo.ProjectInfo> projectInfos = domainService.idcDomainProject(params,ServletUtil.getClientIP(request));
log.info("根据用户信息查询用户的访问权限返回:{}",projectInfos);
return JsonResponse.newInstance().ok(projectInfos);
}

2
ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/bean/dto/ProjectDto.java

@ -47,7 +47,7 @@ public class ProjectDto {
private Long timestamp;
@ApiModelProperty("随机码")
private String noncestr;
@ApiModelProperty("随机码")
@ApiModelProperty("接口详细信息")
private QueryProjectByPhone projectByPhone;
public MessageDomainInfo() {

54
ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/service/DomainService.java

@ -11,6 +11,9 @@ import cn.hutool.crypto.asymmetric.RSA;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.cloudutil.bean.ptos.dto.FeignProjectDto;
import com.ccsens.cloudutil.bean.ptos.vo.FeignProjectVo;
import com.ccsens.cloudutil.feign.PtosTallFeignClient;
import com.ccsens.ptos_diplomatist.bean.dto.DomainDto;
import com.ccsens.ptos_diplomatist.bean.dto.HeartbeatDto;
import com.ccsens.ptos_diplomatist.bean.dto.ProjectDto;
@ -21,6 +24,7 @@ import com.ccsens.ptos_diplomatist.persist.dao.IdcDomainDao;
import com.ccsens.ptos_diplomatist.util.DiplomatistCodeError;
import com.ccsens.ptos_diplomatist.util.DiplomatistConstant;
import com.ccsens.ptos_diplomatist.util.RSAUtil;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.RestTemplateUtil;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
@ -44,6 +48,8 @@ public class DomainService implements IDomainService {
private IdcDomainDao domainDao;
@Resource
private Snowflake snowflake;
@Resource
private PtosTallFeignClient tallFeignClient;
@Override
public List<DomainVo.DomainInfo> heartbeatQueryList(HeartbeatDto.SendDomain param, String clientIp) {
@ -235,7 +241,7 @@ public class DomainService implements IDomainService {
}
@Override
public List<ProjectVo.ProjectInfo> idcDomainProject(HeartbeatDto.SendDomain params) {
public List<ProjectVo.ProjectInfo> idcDomainProject(HeartbeatDto.SendDomain params, String clientIp) {
List<ProjectVo.ProjectInfo> projectInfos = new ArrayList<>();
//验证信息是否正确
byte[] decode = verifyDomainMessage(params);
@ -247,38 +253,26 @@ public class DomainService implements IDomainService {
log.error("获取信息失败",e);
return null;
}
if(ObjectUtil.isNotNull(messageDomainInfo)){
//请求本域tall查找项目列表
//发送请求
//TODO 连接
String url = "/project/byPhone";
log.info("调用接口:{}--{}", url, messageDomainInfo.getProjectByPhone());
JSONObject jsonObject = null;
try {
String postBody = RestTemplateUtil.postBody(url, messageDomainInfo.getProjectByPhone());
jsonObject = JSONObject.parseObject(postBody);
}catch (Exception e){
log.error("调用接口失败",e);
}
if(ObjectUtil.isNotNull(jsonObject)){
log.info("接口返回:{}", jsonObject);
//请求正确返回则修改最后应答时间,否则无操作
Integer code = jsonObject.getInteger("code");
if (code != null && code == 200) {
JSONArray data = jsonObject.getJSONArray("data");
if(CollectionUtil.isNotEmpty(data)){
for (Object object : data) {
ProjectVo.ProjectInfo projectInfo;
try {
JSONObject object1 = (JSONObject) object;
projectInfo = object1.toJavaObject(ProjectVo.ProjectInfo.class);
projectInfos.add(projectInfo);
}catch (Exception e){
log.error("项目转换失败"+e);
}
if(ObjectUtil.isNull(messageDomainInfo)){
return null;
}
//验证ip白名单是否匹配
if(!messageDomainInfo.getHost().equals(clientIp)){
log.info("白名单不匹配:{}---实际请求{}",messageDomainInfo,clientIp);
// throw new BaseException(ptos_diplomatistCodeError.GET_DOMAIN_ERROR);
}
FeignProjectDto.QueryProjectByPhone projectByPhone = new FeignProjectDto.QueryProjectByPhone();
if(ObjectUtil.isNotNull(messageDomainInfo.getProjectByPhone())){
BeanUtil.copyProperties(messageDomainInfo.getProjectByPhone(),projectByPhone);
}
JsonResponse<List<FeignProjectVo.ProjectInfo>> response = tallFeignClient.queryProjectByPhone(projectByPhone);
if (response != null && response.getCode() == 200) {
if(CollectionUtil.isNotEmpty(response.getData())){
response.getData().forEach(project -> {
ProjectVo.ProjectInfo projectInfo = new ProjectVo.ProjectInfo();
BeanUtil.copyProperties(project,projectInfo);
projectInfos.add(projectInfo);
});
}
}
return projectInfos;

2
ptos_diplomatist/src/main/java/com/ccsens/ptos_diplomatist/service/IDomainService.java

@ -39,5 +39,5 @@ public interface IDomainService {
* @param params 其他域的加密信息
* @return 返回项目列表
*/
List<ProjectVo.ProjectInfo> idcDomainProject(HeartbeatDto.SendDomain params);
List<ProjectVo.ProjectInfo> idcDomainProject(HeartbeatDto.SendDomain params, String clientIp);
}

33
ptos_open/.gitignore

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### 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/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

331
ptos_open/mvnw

@ -0,0 +1,331 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ]; then
if [ -f /usr/local/etc/mavenrc ]; then
. /usr/local/etc/mavenrc
fi
if [ -f /etc/mavenrc ]; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ]; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false
darwin=false
mingw=false
case "$(uname)" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true ;;
Darwin*)
darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="$(/usr/libexec/java_home)"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ]; then
if [ -r /etc/gentoo-release ]; then
JAVA_HOME=$(java-config --jre-home)
fi
fi
if [ -z "$M2_HOME" ]; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ]; do
ls=$(ls -ld "$PRG")
link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' >/dev/null; then
PRG="$link"
else
PRG="$(dirname "$PRG")/$link"
fi
done
saveddir=$(pwd)
M2_HOME=$(dirname "$PRG")/..
# make it fully qualified
M2_HOME=$(cd "$M2_HOME" && pwd)
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=$(cygpath --unix "$M2_HOME")
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
[ -n "$CLASSPATH" ] &&
CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw; then
[ -n "$M2_HOME" ] &&
M2_HOME="$( (
cd "$M2_HOME"
pwd
))"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="$( (
cd "$JAVA_HOME"
pwd
))"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="$(which javac)"
if [ -n "$javaExecutable" ] && ! [ "$(expr \"$javaExecutable\" : '\([^ ]*\)')" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=$(which readlink)
if [ ! $(expr "$readLink" : '\([^ ]*\)') = "no" ]; then
if $darwin; then
javaHome="$(dirname \"$javaExecutable\")"
javaExecutable="$(cd \"$javaHome\" && pwd -P)/javac"
else
javaExecutable="$(readlink -f \"$javaExecutable\")"
fi
javaHome="$(dirname \"$javaExecutable\")"
javaHome=$(expr "$javaHome" : '\(.*\)/bin')
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ]; then
if [ -n "$JAVA_HOME" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="$(
\unset -f command
\command -v java
)"
fi
fi
if [ ! -x "$JAVACMD" ]; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ]; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]; then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ]; do
if [ -d "$wdir"/.mvn ]; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=$(
cd "$wdir/.."
pwd
)
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' <"$1")"
fi
}
BASE_DIR=$(find_maven_basedir "$(pwd)")
if [ -z "$BASE_DIR" ]; then
exit 1
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
fi
while IFS="=" read key value; do
case "$key" in wrapperUrl)
jarUrl="$value"
break
;;
esac
done <"$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
fi
if command -v wget >/dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
fi
elif command -v curl >/dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=$(cygpath --path --windows "$javaClass")
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=$(cygpath --path --windows "$M2_HOME")
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
[ -n "$CLASSPATH" ] &&
CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

188
ptos_open/mvnw.cmd

@ -0,0 +1,188 @@
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% ^
%JVM_CONFIG_MAVEN_PROPS% ^
%MAVEN_OPTS% ^
%MAVEN_DEBUG_OPTS% ^
-classpath %WRAPPER_JAR% ^
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%"=="on" pause
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%
cmd /C exit /B %ERROR_CODE%

84
ptos_open/pom.xml

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>ccsens_ptos</artifactId>
<groupId>com.ccsens</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<artifactId>ptos_open</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>ptos_open</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!--cloud 工具类-->
<dependency>
<artifactId>cloudutil</artifactId>
<groupId>com.ccsens</groupId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.ccsens</groupId>
<artifactId>util</artifactId>
<version>1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!--微信工具包-->
<dependency>
<artifactId>wechatutil</artifactId>
<groupId>com.ccsens</groupId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.7</version>
<configuration>
<configurationFile>${basedir}/src/main/resources/mbg.xml</configurationFile>
<overwrite>true</overwrite>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.34</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.ccsens.ptos_open.PtosOpenApplication</mainClass>
<!--<skip>true</skip>-->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

32
ptos_open/src/main/java/com/ccsens/ptos_open/PtosOpenApplication.java

@ -0,0 +1,32 @@
package com.ccsens.ptos_open;
import com.ccsens.cloudutil.ribbon.RibbonConfiguration;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
/**
* @author
*/
@MapperScan(basePackages = {"com.ccsens.ptos_tall.persist.*","com.ccsens.common.persist.*"})
@ServletComponentScan
@EnableAsync
//开启断路器功能
@EnableCircuitBreaker
@EnableFeignClients(basePackages = "com.ccsens.cloudutil.feign")
@SpringBootApplication
@ComponentScan(basePackages = "com.ccsens", excludeFilters = { @ComponentScan.Filter(type= FilterType.ASSIGNABLE_TYPE, value = RibbonConfiguration.class)})
public class PtosOpenApplication {
public static void main(String[] args) {
SpringApplication.run(PtosOpenApplication.class, args);
}
}

78
ptos_open/src/main/java/com/ccsens/ptos_open/api/BusinessController.java

@ -0,0 +1,78 @@
package com.ccsens.ptos_open.api;
import com.ccsens.ptos_open.bean.dto.BusinessDto;
import com.ccsens.ptos_open.bean.vo.BusinessVo;
import com.ccsens.ptos_open.bean.vo.PluginVo;
import com.ccsens.ptos_open.service.IBusinessService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author
*/
@Api(tags = "业务" , description = "业务相关接口")
@RestController
@RequestMapping("/business")
@Slf4j
public class BusinessController {
@Resource
private IBusinessService businessService;
@ApiOperation(value = "查询业务列表", notes = "")
@RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<PageInfo<BusinessVo.BusinessInfo>> queryBusiness(@ApiParam @Validated @RequestBody QueryDto<BusinessDto.QueryByPage> params) throws Exception{
log.info("查询业务列表:{}",params);
PageInfo<PluginVo.PluginInfo> pluginInfoPageInfo = businessService.queryBusiness(params.getParam(),params.getUserId());
log.info("分页返回业务信息");
return JsonResponse.newInstance().ok(pluginInfoPageInfo);
}
@ApiOperation(value = "添加业务信息", notes = "")
@RequestMapping(value = "/save", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse saveBusiness(@ApiParam @Validated @RequestBody QueryDto<BusinessDto.SaveBusiness> params) throws Exception{
log.info("添加业务信息:{}",params);
businessService.saveBusiness(params.getParam(),params.getUserId());
log.info("添加业务信息成功");
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "关联业务和插件", notes = "")
@RequestMapping(value = "/relevance", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse relevancePlugin(@ApiParam @Validated @RequestBody QueryDto<BusinessDto.RelevancePlugin> params) throws Exception{
log.info("关联业务和插件:{}",params);
businessService.relevancePlugin(params.getParam(),params.getUserId());
log.info("关联业务和插件成功");
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "查询业务下关联的插件", notes = "")
@RequestMapping(value = "/queryPlugin", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<PageInfo<BusinessVo.BusinessPlugin>> queryPlugin(@ApiParam @Validated @RequestBody QueryDto<BusinessDto.BusinessQueryPlugin> params) throws Exception{
log.info("查询业务下关联的插件:{}",params);
PageInfo<BusinessVo.BusinessPlugin> businessPluginPageInfo = businessService.businessQueryPlugin(params.getParam(),params.getUserId());
log.info("分页返回业务下关联的插件");
return JsonResponse.newInstance().ok(businessPluginPageInfo);
}
@ApiOperation(value = "修改业务下的插件配置信息", notes = "")
@RequestMapping(value = "/updateConfig", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse updateConfig(@ApiParam @Validated @RequestBody QueryDto<BusinessDto.UpdateConfig> params) throws Exception{
log.info("修改业务下的插件配置信息:{}",params);
businessService.updateConfig(params.getParam(),params.getUserId());
log.info("修改业务下的插件配置信息成功");
return JsonResponse.newInstance().ok();
}
}

32
ptos_open/src/main/java/com/ccsens/ptos_open/api/DebugController.java

@ -0,0 +1,32 @@
package com.ccsens.ptos_open.api;
import com.ccsens.util.JsonResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
/**
* @author
*/
@Api(tags = "DEBUG" , description = "DebugController | ")
@RestController
@RequestMapping("/debug")
@Slf4j
public class DebugController {
@ApiOperation(value = "/测试",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse debug(HttpServletRequest request) throws Exception {
return JsonResponse.newInstance().ok("测试");
}
}

55
ptos_open/src/main/java/com/ccsens/ptos_open/api/PluginController.java

@ -0,0 +1,55 @@
package com.ccsens.ptos_open.api;
import com.ccsens.ptos_open.bean.dto.PluginDto;
import com.ccsens.ptos_open.bean.vo.PluginVo;
import com.ccsens.ptos_open.service.IPluginService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author
*/
@Api(tags = "插件" , description = "插件相关接口")
@RestController
@RequestMapping("/plugin")
@Slf4j
public class PluginController {
@Resource
private IPluginService pluginService;
//TODO 开放平台的身份验证
// @MustLogin
@ApiOperation(value = "查询插件列表", notes = "")
@RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<PageInfo<PluginVo.PluginInfo>> queryPlugin(@ApiParam @Validated @RequestBody QueryDto<PluginDto.QueryByPage> params) throws Exception{
log.info("查询插件列表:{}",params);
PageInfo<PluginVo.PluginInfo> pluginInfoPageInfo = pluginService.queryPlugin(params.getParam(),params.getUserId());
log.info("分页返回插件信息");
return JsonResponse.newInstance().ok(pluginInfoPageInfo);
}
// @MustLogin
@ApiOperation(value = "创建插件", notes = "")
@RequestMapping(value = "/save", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse savePlugin(@ApiParam @Validated @RequestBody QueryDto<PluginDto.SavePlugin> params) throws Exception{
log.info("创建插件:{}",params);
pluginService.savePlugin(params.getParam(),params.getUserId());
log.info("创建插件成功");
return JsonResponse.newInstance().ok();
}
}

79
ptos_open/src/main/java/com/ccsens/ptos_open/bean/dto/BusinessDto.java

@ -0,0 +1,79 @@
package com.ccsens.ptos_open.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
/**
* @author
*/
@Data
public class BusinessDto {
@Data
@ApiModel("分页查找业务列表")
public static class QueryByPage{
@ApiModelProperty("业务名称,为空则不实用该条件")
private String name;
@ApiModelProperty("启用状态")
private Byte type;
@ApiModelProperty("查询深度 0则只查名称,1则查询全部")
private Byte depth = 0;
@ApiModelProperty("第几页")
private Integer pageNum = 1;
@ApiModelProperty("每页几条信息")
private Integer pageSize = 10;
}
@Data
@ApiModel("创建业务信息")
public static class SaveBusiness{
@ApiModelProperty("业务名")
private String name;
@ApiModelProperty("详情")
private String description;
@ApiModelProperty("访问路径前缀")
private String url;
@ApiModelProperty("是否启用 0不启用 1启用")
private byte startUsing;
@ApiModelProperty("是否公开 0否 1是")
private byte pub;
@ApiModelProperty("是否开启debug模式")
private byte debug;
}
@Data
@ApiModel("分页查找业务列表")
public static class RelevancePlugin{
@ApiModelProperty("插件id")
private Long pluginId;
@ApiModelProperty("业务id")
private Long businessId;
}
@Data
@ApiModel("分页查找业务列表")
public static class BusinessQueryPlugin{
@ApiModelProperty("业务id")
private Long businessId;
@ApiModelProperty("第几页")
private Integer pageNum = 1;
@ApiModelProperty("每页几条信息")
private Integer pageSize = 10;
}
@Data
@ApiModel("分页查找业务列表")
public static class UpdateConfig{
@NotNull
@ApiModelProperty("业务插件关联id")
private Long businessPluginId;
@ApiModelProperty("配置信息")
private String config;
@ApiModelProperty("是否开启debug模式 0不开启 1开启")
private Byte debug;
}
}

53
ptos_open/src/main/java/com/ccsens/ptos_open/bean/dto/PluginDto.java

@ -0,0 +1,53 @@
package com.ccsens.ptos_open.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author
*/
@Data
public class PluginDto {
@Data
@ApiModel("分页查找插件列表")
public static class QueryByPage{
@ApiModelProperty("插件名称,为空则不实用该条件")
private String name;
@ApiModelProperty("查询深度 0则只查名称,1则查询全部")
private Byte depth = 0;
@ApiModelProperty("第几页")
private Integer pageNum = 1;
@ApiModelProperty("每页几条信息")
private Integer pageSize = 10;
}
@Data
@ApiModel("添加插件")
public static class SavePlugin{
@ApiModelProperty("插件名")
private String name;
@ApiModelProperty("版本号")
private String versions;
@ApiModelProperty("简介")
private String intro;
@ApiModelProperty("详细说明")
private String description;
@ApiModelProperty("预览图")
private String preview;
@ApiModelProperty("轮播图")
private List<String> carousel;
@ApiModelProperty("html")
private String html;
@ApiModelProperty("css")
private String css;
@ApiModelProperty("js")
private String js;
@ApiModelProperty("config")
private String config;
@ApiModelProperty("是否公开 0不公开 1公开")
private byte publish;
}
}

216
ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenBusiness.java

@ -0,0 +1,216 @@
package com.ccsens.ptos_open.bean.po;
import java.io.Serializable;
import java.util.Date;
public class OpenBusiness implements Serializable {
private Long id;
private String name;
private String code;
private String description;
private String url;
private String appId;
private String secret;
private Long creatorId;
private Long lastAskTime;
private Long lastAnswerTime;
private Byte type;
private Byte pub;
private Byte startUsing;
private Byte debug;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code == null ? null : code.trim();
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url == null ? null : url.trim();
}
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId == null ? null : appId.trim();
}
public String getSecret() {
return secret;
}
public void setSecret(String secret) {
this.secret = secret == null ? null : secret.trim();
}
public Long getCreatorId() {
return creatorId;
}
public void setCreatorId(Long creatorId) {
this.creatorId = creatorId;
}
public Long getLastAskTime() {
return lastAskTime;
}
public void setLastAskTime(Long lastAskTime) {
this.lastAskTime = lastAskTime;
}
public Long getLastAnswerTime() {
return lastAnswerTime;
}
public void setLastAnswerTime(Long lastAnswerTime) {
this.lastAnswerTime = lastAnswerTime;
}
public Byte getType() {
return type;
}
public void setType(Byte type) {
this.type = type;
}
public Byte getPub() {
return pub;
}
public void setPub(Byte pub) {
this.pub = pub;
}
public Byte getStartUsing() {
return startUsing;
}
public void setStartUsing(Byte startUsing) {
this.startUsing = startUsing;
}
public Byte getDebug() {
return debug;
}
public void setDebug(Byte debug) {
this.debug = debug;
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", code=").append(code);
sb.append(", description=").append(description);
sb.append(", url=").append(url);
sb.append(", appId=").append(appId);
sb.append(", secret=").append(secret);
sb.append(", creatorId=").append(creatorId);
sb.append(", lastAskTime=").append(lastAskTime);
sb.append(", lastAnswerTime=").append(lastAnswerTime);
sb.append(", type=").append(type);
sb.append(", pub=").append(pub);
sb.append(", startUsing=").append(startUsing);
sb.append(", debug=").append(debug);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

1341
ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenBusinessExample.java

File diff suppressed because it is too large

128
ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenBusinessPlugin.java

@ -0,0 +1,128 @@
package com.ccsens.ptos_open.bean.po;
import java.io.Serializable;
import java.util.Date;
public class OpenBusinessPlugin implements Serializable {
private Long id;
private Long pluginId;
private Long businessId;
private String config;
private String code;
private Byte debug;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getPluginId() {
return pluginId;
}
public void setPluginId(Long pluginId) {
this.pluginId = pluginId;
}
public Long getBusinessId() {
return businessId;
}
public void setBusinessId(Long businessId) {
this.businessId = businessId;
}
public String getConfig() {
return config;
}
public void setConfig(String config) {
this.config = config == null ? null : config.trim();
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code == null ? null : code.trim();
}
public Byte getDebug() {
return debug;
}
public void setDebug(Byte debug) {
this.debug = debug;
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", pluginId=").append(pluginId);
sb.append(", businessId=").append(businessId);
sb.append(", config=").append(config);
sb.append(", code=").append(code);
sb.append(", debug=").append(debug);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

821
ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenBusinessPluginExample.java

@ -0,0 +1,821 @@
package com.ccsens.ptos_open.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class OpenBusinessPluginExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public OpenBusinessPluginExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andPluginIdIsNull() {
addCriterion("plugin_id is null");
return (Criteria) this;
}
public Criteria andPluginIdIsNotNull() {
addCriterion("plugin_id is not null");
return (Criteria) this;
}
public Criteria andPluginIdEqualTo(Long value) {
addCriterion("plugin_id =", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdNotEqualTo(Long value) {
addCriterion("plugin_id <>", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdGreaterThan(Long value) {
addCriterion("plugin_id >", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdGreaterThanOrEqualTo(Long value) {
addCriterion("plugin_id >=", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdLessThan(Long value) {
addCriterion("plugin_id <", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdLessThanOrEqualTo(Long value) {
addCriterion("plugin_id <=", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdIn(List<Long> values) {
addCriterion("plugin_id in", values, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdNotIn(List<Long> values) {
addCriterion("plugin_id not in", values, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdBetween(Long value1, Long value2) {
addCriterion("plugin_id between", value1, value2, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdNotBetween(Long value1, Long value2) {
addCriterion("plugin_id not between", value1, value2, "pluginId");
return (Criteria) this;
}
public Criteria andBusinessIdIsNull() {
addCriterion("business_id is null");
return (Criteria) this;
}
public Criteria andBusinessIdIsNotNull() {
addCriterion("business_id is not null");
return (Criteria) this;
}
public Criteria andBusinessIdEqualTo(Long value) {
addCriterion("business_id =", value, "businessId");
return (Criteria) this;
}
public Criteria andBusinessIdNotEqualTo(Long value) {
addCriterion("business_id <>", value, "businessId");
return (Criteria) this;
}
public Criteria andBusinessIdGreaterThan(Long value) {
addCriterion("business_id >", value, "businessId");
return (Criteria) this;
}
public Criteria andBusinessIdGreaterThanOrEqualTo(Long value) {
addCriterion("business_id >=", value, "businessId");
return (Criteria) this;
}
public Criteria andBusinessIdLessThan(Long value) {
addCriterion("business_id <", value, "businessId");
return (Criteria) this;
}
public Criteria andBusinessIdLessThanOrEqualTo(Long value) {
addCriterion("business_id <=", value, "businessId");
return (Criteria) this;
}
public Criteria andBusinessIdIn(List<Long> values) {
addCriterion("business_id in", values, "businessId");
return (Criteria) this;
}
public Criteria andBusinessIdNotIn(List<Long> values) {
addCriterion("business_id not in", values, "businessId");
return (Criteria) this;
}
public Criteria andBusinessIdBetween(Long value1, Long value2) {
addCriterion("business_id between", value1, value2, "businessId");
return (Criteria) this;
}
public Criteria andBusinessIdNotBetween(Long value1, Long value2) {
addCriterion("business_id not between", value1, value2, "businessId");
return (Criteria) this;
}
public Criteria andConfigIsNull() {
addCriterion("config is null");
return (Criteria) this;
}
public Criteria andConfigIsNotNull() {
addCriterion("config is not null");
return (Criteria) this;
}
public Criteria andConfigEqualTo(String value) {
addCriterion("config =", value, "config");
return (Criteria) this;
}
public Criteria andConfigNotEqualTo(String value) {
addCriterion("config <>", value, "config");
return (Criteria) this;
}
public Criteria andConfigGreaterThan(String value) {
addCriterion("config >", value, "config");
return (Criteria) this;
}
public Criteria andConfigGreaterThanOrEqualTo(String value) {
addCriterion("config >=", value, "config");
return (Criteria) this;
}
public Criteria andConfigLessThan(String value) {
addCriterion("config <", value, "config");
return (Criteria) this;
}
public Criteria andConfigLessThanOrEqualTo(String value) {
addCriterion("config <=", value, "config");
return (Criteria) this;
}
public Criteria andConfigLike(String value) {
addCriterion("config like", value, "config");
return (Criteria) this;
}
public Criteria andConfigNotLike(String value) {
addCriterion("config not like", value, "config");
return (Criteria) this;
}
public Criteria andConfigIn(List<String> values) {
addCriterion("config in", values, "config");
return (Criteria) this;
}
public Criteria andConfigNotIn(List<String> values) {
addCriterion("config not in", values, "config");
return (Criteria) this;
}
public Criteria andConfigBetween(String value1, String value2) {
addCriterion("config between", value1, value2, "config");
return (Criteria) this;
}
public Criteria andConfigNotBetween(String value1, String value2) {
addCriterion("config not between", value1, value2, "config");
return (Criteria) this;
}
public Criteria andCodeIsNull() {
addCriterion("code is null");
return (Criteria) this;
}
public Criteria andCodeIsNotNull() {
addCriterion("code is not null");
return (Criteria) this;
}
public Criteria andCodeEqualTo(String value) {
addCriterion("code =", value, "code");
return (Criteria) this;
}
public Criteria andCodeNotEqualTo(String value) {
addCriterion("code <>", value, "code");
return (Criteria) this;
}
public Criteria andCodeGreaterThan(String value) {
addCriterion("code >", value, "code");
return (Criteria) this;
}
public Criteria andCodeGreaterThanOrEqualTo(String value) {
addCriterion("code >=", value, "code");
return (Criteria) this;
}
public Criteria andCodeLessThan(String value) {
addCriterion("code <", value, "code");
return (Criteria) this;
}
public Criteria andCodeLessThanOrEqualTo(String value) {
addCriterion("code <=", value, "code");
return (Criteria) this;
}
public Criteria andCodeLike(String value) {
addCriterion("code like", value, "code");
return (Criteria) this;
}
public Criteria andCodeNotLike(String value) {
addCriterion("code not like", value, "code");
return (Criteria) this;
}
public Criteria andCodeIn(List<String> values) {
addCriterion("code in", values, "code");
return (Criteria) this;
}
public Criteria andCodeNotIn(List<String> values) {
addCriterion("code not in", values, "code");
return (Criteria) this;
}
public Criteria andCodeBetween(String value1, String value2) {
addCriterion("code between", value1, value2, "code");
return (Criteria) this;
}
public Criteria andCodeNotBetween(String value1, String value2) {
addCriterion("code not between", value1, value2, "code");
return (Criteria) this;
}
public Criteria andDebugIsNull() {
addCriterion("debug is null");
return (Criteria) this;
}
public Criteria andDebugIsNotNull() {
addCriterion("debug is not null");
return (Criteria) this;
}
public Criteria andDebugEqualTo(Byte value) {
addCriterion("debug =", value, "debug");
return (Criteria) this;
}
public Criteria andDebugNotEqualTo(Byte value) {
addCriterion("debug <>", value, "debug");
return (Criteria) this;
}
public Criteria andDebugGreaterThan(Byte value) {
addCriterion("debug >", value, "debug");
return (Criteria) this;
}
public Criteria andDebugGreaterThanOrEqualTo(Byte value) {
addCriterion("debug >=", value, "debug");
return (Criteria) this;
}
public Criteria andDebugLessThan(Byte value) {
addCriterion("debug <", value, "debug");
return (Criteria) this;
}
public Criteria andDebugLessThanOrEqualTo(Byte value) {
addCriterion("debug <=", value, "debug");
return (Criteria) this;
}
public Criteria andDebugIn(List<Byte> values) {
addCriterion("debug in", values, "debug");
return (Criteria) this;
}
public Criteria andDebugNotIn(List<Byte> values) {
addCriterion("debug not in", values, "debug");
return (Criteria) this;
}
public Criteria andDebugBetween(Byte value1, Byte value2) {
addCriterion("debug between", value1, value2, "debug");
return (Criteria) this;
}
public Criteria andDebugNotBetween(Byte value1, Byte value2) {
addCriterion("debug not between", value1, value2, "debug");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

139
ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenPlugin.java

@ -0,0 +1,139 @@
package com.ccsens.ptos_open.bean.po;
import java.io.Serializable;
import java.util.Date;
public class OpenPlugin implements Serializable {
private Long id;
private String name;
private String versions;
private String intro;
private String config;
private Byte publish;
private Long creatorId;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
public String getVersions() {
return versions;
}
public void setVersions(String versions) {
this.versions = versions == null ? null : versions.trim();
}
public String getIntro() {
return intro;
}
public void setIntro(String intro) {
this.intro = intro == null ? null : intro.trim();
}
public String getConfig() {
return config;
}
public void setConfig(String config) {
this.config = config == null ? null : config.trim();
}
public Byte getPublish() {
return publish;
}
public void setPublish(Byte publish) {
this.publish = publish;
}
public Long getCreatorId() {
return creatorId;
}
public void setCreatorId(Long creatorId) {
this.creatorId = creatorId;
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", versions=").append(versions);
sb.append(", intro=").append(intro);
sb.append(", config=").append(config);
sb.append(", publish=").append(publish);
sb.append(", creatorId=").append(creatorId);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

901
ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenPluginExample.java

@ -0,0 +1,901 @@
package com.ccsens.ptos_open.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class OpenPluginExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public OpenPluginExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andVersionsIsNull() {
addCriterion("versions is null");
return (Criteria) this;
}
public Criteria andVersionsIsNotNull() {
addCriterion("versions is not null");
return (Criteria) this;
}
public Criteria andVersionsEqualTo(String value) {
addCriterion("versions =", value, "versions");
return (Criteria) this;
}
public Criteria andVersionsNotEqualTo(String value) {
addCriterion("versions <>", value, "versions");
return (Criteria) this;
}
public Criteria andVersionsGreaterThan(String value) {
addCriterion("versions >", value, "versions");
return (Criteria) this;
}
public Criteria andVersionsGreaterThanOrEqualTo(String value) {
addCriterion("versions >=", value, "versions");
return (Criteria) this;
}
public Criteria andVersionsLessThan(String value) {
addCriterion("versions <", value, "versions");
return (Criteria) this;
}
public Criteria andVersionsLessThanOrEqualTo(String value) {
addCriterion("versions <=", value, "versions");
return (Criteria) this;
}
public Criteria andVersionsLike(String value) {
addCriterion("versions like", value, "versions");
return (Criteria) this;
}
public Criteria andVersionsNotLike(String value) {
addCriterion("versions not like", value, "versions");
return (Criteria) this;
}
public Criteria andVersionsIn(List<String> values) {
addCriterion("versions in", values, "versions");
return (Criteria) this;
}
public Criteria andVersionsNotIn(List<String> values) {
addCriterion("versions not in", values, "versions");
return (Criteria) this;
}
public Criteria andVersionsBetween(String value1, String value2) {
addCriterion("versions between", value1, value2, "versions");
return (Criteria) this;
}
public Criteria andVersionsNotBetween(String value1, String value2) {
addCriterion("versions not between", value1, value2, "versions");
return (Criteria) this;
}
public Criteria andIntroIsNull() {
addCriterion("intro is null");
return (Criteria) this;
}
public Criteria andIntroIsNotNull() {
addCriterion("intro is not null");
return (Criteria) this;
}
public Criteria andIntroEqualTo(String value) {
addCriterion("intro =", value, "intro");
return (Criteria) this;
}
public Criteria andIntroNotEqualTo(String value) {
addCriterion("intro <>", value, "intro");
return (Criteria) this;
}
public Criteria andIntroGreaterThan(String value) {
addCriterion("intro >", value, "intro");
return (Criteria) this;
}
public Criteria andIntroGreaterThanOrEqualTo(String value) {
addCriterion("intro >=", value, "intro");
return (Criteria) this;
}
public Criteria andIntroLessThan(String value) {
addCriterion("intro <", value, "intro");
return (Criteria) this;
}
public Criteria andIntroLessThanOrEqualTo(String value) {
addCriterion("intro <=", value, "intro");
return (Criteria) this;
}
public Criteria andIntroLike(String value) {
addCriterion("intro like", value, "intro");
return (Criteria) this;
}
public Criteria andIntroNotLike(String value) {
addCriterion("intro not like", value, "intro");
return (Criteria) this;
}
public Criteria andIntroIn(List<String> values) {
addCriterion("intro in", values, "intro");
return (Criteria) this;
}
public Criteria andIntroNotIn(List<String> values) {
addCriterion("intro not in", values, "intro");
return (Criteria) this;
}
public Criteria andIntroBetween(String value1, String value2) {
addCriterion("intro between", value1, value2, "intro");
return (Criteria) this;
}
public Criteria andIntroNotBetween(String value1, String value2) {
addCriterion("intro not between", value1, value2, "intro");
return (Criteria) this;
}
public Criteria andConfigIsNull() {
addCriterion("config is null");
return (Criteria) this;
}
public Criteria andConfigIsNotNull() {
addCriterion("config is not null");
return (Criteria) this;
}
public Criteria andConfigEqualTo(String value) {
addCriterion("config =", value, "config");
return (Criteria) this;
}
public Criteria andConfigNotEqualTo(String value) {
addCriterion("config <>", value, "config");
return (Criteria) this;
}
public Criteria andConfigGreaterThan(String value) {
addCriterion("config >", value, "config");
return (Criteria) this;
}
public Criteria andConfigGreaterThanOrEqualTo(String value) {
addCriterion("config >=", value, "config");
return (Criteria) this;
}
public Criteria andConfigLessThan(String value) {
addCriterion("config <", value, "config");
return (Criteria) this;
}
public Criteria andConfigLessThanOrEqualTo(String value) {
addCriterion("config <=", value, "config");
return (Criteria) this;
}
public Criteria andConfigLike(String value) {
addCriterion("config like", value, "config");
return (Criteria) this;
}
public Criteria andConfigNotLike(String value) {
addCriterion("config not like", value, "config");
return (Criteria) this;
}
public Criteria andConfigIn(List<String> values) {
addCriterion("config in", values, "config");
return (Criteria) this;
}
public Criteria andConfigNotIn(List<String> values) {
addCriterion("config not in", values, "config");
return (Criteria) this;
}
public Criteria andConfigBetween(String value1, String value2) {
addCriterion("config between", value1, value2, "config");
return (Criteria) this;
}
public Criteria andConfigNotBetween(String value1, String value2) {
addCriterion("config not between", value1, value2, "config");
return (Criteria) this;
}
public Criteria andPublishIsNull() {
addCriterion("publish is null");
return (Criteria) this;
}
public Criteria andPublishIsNotNull() {
addCriterion("publish is not null");
return (Criteria) this;
}
public Criteria andPublishEqualTo(Byte value) {
addCriterion("publish =", value, "publish");
return (Criteria) this;
}
public Criteria andPublishNotEqualTo(Byte value) {
addCriterion("publish <>", value, "publish");
return (Criteria) this;
}
public Criteria andPublishGreaterThan(Byte value) {
addCriterion("publish >", value, "publish");
return (Criteria) this;
}
public Criteria andPublishGreaterThanOrEqualTo(Byte value) {
addCriterion("publish >=", value, "publish");
return (Criteria) this;
}
public Criteria andPublishLessThan(Byte value) {
addCriterion("publish <", value, "publish");
return (Criteria) this;
}
public Criteria andPublishLessThanOrEqualTo(Byte value) {
addCriterion("publish <=", value, "publish");
return (Criteria) this;
}
public Criteria andPublishIn(List<Byte> values) {
addCriterion("publish in", values, "publish");
return (Criteria) this;
}
public Criteria andPublishNotIn(List<Byte> values) {
addCriterion("publish not in", values, "publish");
return (Criteria) this;
}
public Criteria andPublishBetween(Byte value1, Byte value2) {
addCriterion("publish between", value1, value2, "publish");
return (Criteria) this;
}
public Criteria andPublishNotBetween(Byte value1, Byte value2) {
addCriterion("publish not between", value1, value2, "publish");
return (Criteria) this;
}
public Criteria andCreatorIdIsNull() {
addCriterion("creator_id is null");
return (Criteria) this;
}
public Criteria andCreatorIdIsNotNull() {
addCriterion("creator_id is not null");
return (Criteria) this;
}
public Criteria andCreatorIdEqualTo(Long value) {
addCriterion("creator_id =", value, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdNotEqualTo(Long value) {
addCriterion("creator_id <>", value, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdGreaterThan(Long value) {
addCriterion("creator_id >", value, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdGreaterThanOrEqualTo(Long value) {
addCriterion("creator_id >=", value, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdLessThan(Long value) {
addCriterion("creator_id <", value, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdLessThanOrEqualTo(Long value) {
addCriterion("creator_id <=", value, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdIn(List<Long> values) {
addCriterion("creator_id in", values, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdNotIn(List<Long> values) {
addCriterion("creator_id not in", values, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdBetween(Long value1, Long value2) {
addCriterion("creator_id between", value1, value2, "creatorId");
return (Criteria) this;
}
public Criteria andCreatorIdNotBetween(Long value1, Long value2) {
addCriterion("creator_id not between", value1, value2, "creatorId");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

117
ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenPluginImg.java

@ -0,0 +1,117 @@
package com.ccsens.ptos_open.bean.po;
import java.io.Serializable;
import java.util.Date;
public class OpenPluginImg implements Serializable {
private Long id;
private Long pluginId;
private Long fileId;
private String filePath;
private Byte type;
private Long operator;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getPluginId() {
return pluginId;
}
public void setPluginId(Long pluginId) {
this.pluginId = pluginId;
}
public Long getFileId() {
return fileId;
}
public void setFileId(Long fileId) {
this.fileId = fileId;
}
public String getFilePath() {
return filePath;
}
public void setFilePath(String filePath) {
this.filePath = filePath == null ? null : filePath.trim();
}
public Byte getType() {
return type;
}
public void setType(Byte type) {
this.type = type;
}
public Long getOperator() {
return operator;
}
public void setOperator(Long operator) {
this.operator = operator;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", pluginId=").append(pluginId);
sb.append(", fileId=").append(fileId);
sb.append(", filePath=").append(filePath);
sb.append(", type=").append(type);
sb.append(", operator=").append(operator);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

751
ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenPluginImgExample.java

@ -0,0 +1,751 @@
package com.ccsens.ptos_open.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class OpenPluginImgExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public OpenPluginImgExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andPluginIdIsNull() {
addCriterion("plugin_id is null");
return (Criteria) this;
}
public Criteria andPluginIdIsNotNull() {
addCriterion("plugin_id is not null");
return (Criteria) this;
}
public Criteria andPluginIdEqualTo(Long value) {
addCriterion("plugin_id =", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdNotEqualTo(Long value) {
addCriterion("plugin_id <>", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdGreaterThan(Long value) {
addCriterion("plugin_id >", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdGreaterThanOrEqualTo(Long value) {
addCriterion("plugin_id >=", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdLessThan(Long value) {
addCriterion("plugin_id <", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdLessThanOrEqualTo(Long value) {
addCriterion("plugin_id <=", value, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdIn(List<Long> values) {
addCriterion("plugin_id in", values, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdNotIn(List<Long> values) {
addCriterion("plugin_id not in", values, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdBetween(Long value1, Long value2) {
addCriterion("plugin_id between", value1, value2, "pluginId");
return (Criteria) this;
}
public Criteria andPluginIdNotBetween(Long value1, Long value2) {
addCriterion("plugin_id not between", value1, value2, "pluginId");
return (Criteria) this;
}
public Criteria andFileIdIsNull() {
addCriterion("file_id is null");
return (Criteria) this;
}
public Criteria andFileIdIsNotNull() {
addCriterion("file_id is not null");
return (Criteria) this;
}
public Criteria andFileIdEqualTo(Long value) {
addCriterion("file_id =", value, "fileId");
return (Criteria) this;
}
public Criteria andFileIdNotEqualTo(Long value) {
addCriterion("file_id <>", value, "fileId");
return (Criteria) this;
}
public Criteria andFileIdGreaterThan(Long value) {
addCriterion("file_id >", value, "fileId");
return (Criteria) this;
}
public Criteria andFileIdGreaterThanOrEqualTo(Long value) {
addCriterion("file_id >=", value, "fileId");
return (Criteria) this;
}
public Criteria andFileIdLessThan(Long value) {
addCriterion("file_id <", value, "fileId");
return (Criteria) this;
}
public Criteria andFileIdLessThanOrEqualTo(Long value) {
addCriterion("file_id <=", value, "fileId");
return (Criteria) this;
}
public Criteria andFileIdIn(List<Long> values) {
addCriterion("file_id in", values, "fileId");
return (Criteria) this;
}
public Criteria andFileIdNotIn(List<Long> values) {
addCriterion("file_id not in", values, "fileId");
return (Criteria) this;
}
public Criteria andFileIdBetween(Long value1, Long value2) {
addCriterion("file_id between", value1, value2, "fileId");
return (Criteria) this;
}
public Criteria andFileIdNotBetween(Long value1, Long value2) {
addCriterion("file_id not between", value1, value2, "fileId");
return (Criteria) this;
}
public Criteria andFilePathIsNull() {
addCriterion("file_path is null");
return (Criteria) this;
}
public Criteria andFilePathIsNotNull() {
addCriterion("file_path is not null");
return (Criteria) this;
}
public Criteria andFilePathEqualTo(String value) {
addCriterion("file_path =", value, "filePath");
return (Criteria) this;
}
public Criteria andFilePathNotEqualTo(String value) {
addCriterion("file_path <>", value, "filePath");
return (Criteria) this;
}
public Criteria andFilePathGreaterThan(String value) {
addCriterion("file_path >", value, "filePath");
return (Criteria) this;
}
public Criteria andFilePathGreaterThanOrEqualTo(String value) {
addCriterion("file_path >=", value, "filePath");
return (Criteria) this;
}
public Criteria andFilePathLessThan(String value) {
addCriterion("file_path <", value, "filePath");
return (Criteria) this;
}
public Criteria andFilePathLessThanOrEqualTo(String value) {
addCriterion("file_path <=", value, "filePath");
return (Criteria) this;
}
public Criteria andFilePathLike(String value) {
addCriterion("file_path like", value, "filePath");
return (Criteria) this;
}
public Criteria andFilePathNotLike(String value) {
addCriterion("file_path not like", value, "filePath");
return (Criteria) this;
}
public Criteria andFilePathIn(List<String> values) {
addCriterion("file_path in", values, "filePath");
return (Criteria) this;
}
public Criteria andFilePathNotIn(List<String> values) {
addCriterion("file_path not in", values, "filePath");
return (Criteria) this;
}
public Criteria andFilePathBetween(String value1, String value2) {
addCriterion("file_path between", value1, value2, "filePath");
return (Criteria) this;
}
public Criteria andFilePathNotBetween(String value1, String value2) {
addCriterion("file_path not between", value1, value2, "filePath");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("type is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("type is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(Byte value) {
addCriterion("type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(Byte value) {
addCriterion("type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(Byte value) {
addCriterion("type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(Byte value) {
addCriterion("type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(Byte value) {
addCriterion("type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<Byte> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<Byte> values) {
addCriterion("type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(Byte value1, Byte value2) {
addCriterion("type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(Byte value1, Byte value2) {
addCriterion("type not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andOperatorIsNull() {
addCriterion("operator is null");
return (Criteria) this;
}
public Criteria andOperatorIsNotNull() {
addCriterion("operator is not null");
return (Criteria) this;
}
public Criteria andOperatorEqualTo(Long value) {
addCriterion("operator =", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotEqualTo(Long value) {
addCriterion("operator <>", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThan(Long value) {
addCriterion("operator >", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorGreaterThanOrEqualTo(Long value) {
addCriterion("operator >=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThan(Long value) {
addCriterion("operator <", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorLessThanOrEqualTo(Long value) {
addCriterion("operator <=", value, "operator");
return (Criteria) this;
}
public Criteria andOperatorIn(List<Long> values) {
addCriterion("operator in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotIn(List<Long> values) {
addCriterion("operator not in", values, "operator");
return (Criteria) this;
}
public Criteria andOperatorBetween(Long value1, Long value2) {
addCriterion("operator between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andOperatorNotBetween(Long value1, Long value2) {
addCriterion("operator not between", value1, value2, "operator");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

61
ptos_open/src/main/java/com/ccsens/ptos_open/bean/po/OpenPluginWithBLOBs.java

@ -0,0 +1,61 @@
package com.ccsens.ptos_open.bean.po;
import java.io.Serializable;
public class OpenPluginWithBLOBs extends OpenPlugin implements Serializable {
private String description;
private String html;
private String js;
private String css;
private static final long serialVersionUID = 1L;
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
public String getHtml() {
return html;
}
public void setHtml(String html) {
this.html = html == null ? null : html.trim();
}
public String getJs() {
return js;
}
public void setJs(String js) {
this.js = js == null ? null : js.trim();
}
public String getCss() {
return css;
}
public void setCss(String css) {
this.css = css == null ? null : css.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", description=").append(description);
sb.append(", html=").append(html);
sb.append(", js=").append(js);
sb.append(", css=").append(css);
sb.append("]");
return sb.toString();
}
}

72
ptos_open/src/main/java/com/ccsens/ptos_open/bean/vo/BusinessVo.java

@ -0,0 +1,72 @@
package com.ccsens.ptos_open.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* @author
*/
@Data
public class BusinessVo {
@Data
@ApiModel("业务信息")
public static class BusinessInfo{
@ApiModelProperty("业务id")
private Long id;
@ApiModelProperty("业务名")
private String name;
@ApiModelProperty("appId")
private String appId;
@ApiModelProperty("secret")
private String secret;
@ApiModelProperty("是否启用 0不启用 1启用")
private byte startUsing;
@ApiModelProperty("是否公开 0否 1是")
private byte pub;
@ApiModelProperty("创建时间")
private Long createTime;
}
@Data
@ApiModel("业务下的插件信息")
public static class BusinessPlugin{
@ApiModelProperty("业务插件关联id")
private Long businessPluginId;
@ApiModelProperty("插件在业务下的唯一code")
private String code;
@ApiModelProperty("插件名")
private String name;
@ApiModelProperty("config")
private String config;
@ApiModelProperty("是否开启debug模式")
private byte debug;
@ApiModelProperty("是否公开 0不公开 1公开")
private byte publish;
@ApiModelProperty("版本号")
private String versions;
@ApiModelProperty("简介")
private String intro;
@ApiModelProperty("更新时间")
private Long updateTime;
@ApiModelProperty("作者id(userId)")
private Long authorId;
@ApiModelProperty("作者名")
private String authorName;
@ApiModelProperty("预览图")
private String preview;
@ApiModelProperty("是否是自己的插件 0否 1是")
private Byte mine;
@ApiModelProperty("html")
private String html;
@ApiModelProperty("css")
private String css;
@ApiModelProperty("js")
private String js;
}
}

45
ptos_open/src/main/java/com/ccsens/ptos_open/bean/vo/PluginVo.java

@ -0,0 +1,45 @@
package com.ccsens.ptos_open.bean.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author
*/
@Data
public class PluginVo {
@Data
@ApiModel("插件信息")
public static class PluginInfo{
@ApiModelProperty("插件id")
private Long id;
@ApiModelProperty("插件名")
private String name;
@ApiModelProperty("版本号")
private String versions;
@ApiModelProperty("简介")
private String intro;
@ApiModelProperty("详细说明")
private String description;
@ApiModelProperty("更新时间")
private Long updateTime;
@ApiModelProperty("作者id(userId)")
private Long authorId;
@ApiModelProperty("作者名")
private String authorName;
@ApiModelProperty("预览图")
private String preview;
@ApiModelProperty("是否是自己的插件 0否 1是")
private Byte mine;
@ApiModelProperty("html")
private String html;
@ApiModelProperty("css")
private String css;
@ApiModelProperty("js")
private String js;
@ApiModelProperty("config")
private String config;
}
}

22
ptos_open/src/main/java/com/ccsens/ptos_open/config/BeanConfig.java

@ -0,0 +1,22 @@
package com.ccsens.ptos_open.config;
import com.ccsens.ptos_open.intercept.MybatisInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @description:
* @author: wuHuiJuan
* @create: 2019/12/03 18:01
*/
@Configuration
public class BeanConfig {
/**
* 注册拦截器
*/
@Bean
public MybatisInterceptor mybatisInterceptor() {
MybatisInterceptor interceptor = new MybatisInterceptor();
return interceptor;
}
}

128
ptos_open/src/main/java/com/ccsens/ptos_open/config/SpringConfig.java

@ -0,0 +1,128 @@
package com.ccsens.ptos_open.config;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import com.ccsens.util.config.DruidProps;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.*;
import javax.annotation.Resource;
import javax.sql.DataSource;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
import java.util.TimeZone;
@Configuration
public class SpringConfig implements WebMvcConfigurer {
@Resource
private DruidProps druidPropsUtil;
@Value("${spring.snowflake.workerId}")
private String workerId;
@Value("${spring.snowflake.datacenterId}")
private String datacenterId;
/**
* 配置Converter
* @return
*/
@Bean
public HttpMessageConverter<String> responseStringConverter() {
StringHttpMessageConverter converter = new StringHttpMessageConverter(
Charset.forName("UTF-8"));
return converter;
}
@Bean
public HttpMessageConverter<Object> responseJsonConverter(){
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
List<MediaType> mediaTypeList = new ArrayList<>();
mediaTypeList.add(MediaType.TEXT_HTML);
mediaTypeList.add(MediaType.APPLICATION_JSON_UTF8);
converter.setSupportedMediaTypes(mediaTypeList);
ObjectMapper objectMapper = new ObjectMapper();
SimpleModule simpleModule = new SimpleModule();
simpleModule.addSerializer(Long.class, ToStringSerializer.instance);
simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance);
objectMapper.registerModule(simpleModule);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
objectMapper.setTimeZone(TimeZone.getTimeZone("GMT+8"));
converter.setObjectMapper(objectMapper);
return converter;
}
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
converters.add(responseStringConverter());
converters.add(responseJsonConverter());
}
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
configurer.favorPathExtension(false);
}
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
// .allowedMethods("*") // 允许提交请求的方法,*表示全部允许
.allowedOrigins("*") // #允许向该服务器提交请求的URI,*表示全部允许
.allowCredentials(true) // 允许cookies跨域
.allowedHeaders("*") // #允许访问的头信息,*表示全部
.maxAge(18000L); // 预检请求的缓存时间(秒),即在这个时间段里,对于相同的跨域请求不会再预检了
}
/**
* 配置静态资源
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
registry.addResourceHandler("/uploads/**")
.addResourceLocations("file:///home/ptos_open/server//uploads/");
}
/**
* 配置拦截器
* @param registry
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
}
/**
* 配置数据源单数据源
*/
@Bean
public DataSource dataSource(){
return druidPropsUtil.createDruidDataSource();
}
@Bean
public Snowflake snowflake(){
return IdUtil.createSnowflake(Long.valueOf(workerId), Long.valueOf(datacenterId));
}
}

56
ptos_open/src/main/java/com/ccsens/ptos_open/config/SwaggerConfigure.java

@ -0,0 +1,56 @@
package com.ccsens.ptos_open.config;
import com.ccsens.util.WebConstant;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
@Configuration
@EnableSwagger2
@ConditionalOnExpression("${swagger.enable}")
//public class SwaggerConfigure extends WebMvcConfigurationSupport {
public class SwaggerConfigure /*implements WebMvcConfigurer*/ {
@Bean
public Docket customDocket() {
//
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors
.basePackage("com.ccsens.ptos_open.api"))
.build()
.globalOperationParameters(setHeaderToken());
}
private ApiInfo apiInfo() {
return new ApiInfo("Swagger Tall-game",//大标题 title
"This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",//小标题
"1.0.0",//版本
"http://swagger.io/terms/",//termsOfServiceUrl
"zhangsan",//作者
"Apache 2.0",//链接显示文字
"http://www.apache.org/licenses/LICENSE-2.0.html"//网站链接
);
}
private List<Parameter> setHeaderToken() {
ParameterBuilder tokenPar = new ParameterBuilder();
List<Parameter> pars = new ArrayList<>();
tokenPar.name(WebConstant.HEADER_KEY_TOKEN).description("token")
.defaultValue(WebConstant.HEADER_KEY_TOKEN_PREFIX)
.modelRef(new ModelRef("string")).parameterType("header").required(false).build();
pars.add(tokenPar.build());
return pars;
}
}

159
ptos_open/src/main/java/com/ccsens/ptos_open/intercept/MybatisInterceptor.java

@ -0,0 +1,159 @@
package com.ccsens.ptos_open.intercept;
import cn.hutool.core.collection.CollectionUtil;
import com.ccsens.util.WebConstant;
import org.apache.ibatis.executor.Executor;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.ResultMap;
import org.apache.ibatis.mapping.SqlSource;
import org.apache.ibatis.plugin.*;
import org.apache.ibatis.reflection.DefaultReflectorFactory;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.factory.DefaultObjectFactory;
import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.RowBounds;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Map;
import java.util.Properties;
/**
* @description:
* @author: wuHuiJuan
* @create: 2019/12/11 10:58
*/
@Intercepts({
@Signature(
type = Executor.class,
method = "query",
args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class}
)
})
public class MybatisInterceptor implements Interceptor {
@Override
public Object intercept(Invocation invocation) throws Throwable {
String selectByExample = "selectByExample";
String countByExample = "countByExample";
String countByExample2 = "selectByExample_COUNT";
String selectByPrimaryKey = "selectByPrimaryKey";
Object[] args = invocation.getArgs();
MappedStatement statement = (MappedStatement) args[0];
if (statement.getId().endsWith(selectByExample)
|| statement.getId().endsWith(countByExample)
|| statement.getId().endsWith(countByExample2)) {
//XXXExample
Object example = args[1];
addCondition(statement, example);
} else if (statement.getId().endsWith(selectByPrimaryKey)) {
BoundSql boundSql = statement.getBoundSql(args[1]);
String sql = boundSql.getSql() + " and rec_status = 0";
MappedStatement newStatement = newMappedStatement(statement, new BoundSqlSqlSource(boundSql));
MetaObject msObject = MetaObject.forObject(newStatement, new DefaultObjectFactory(), new DefaultObjectWrapperFactory(),new DefaultReflectorFactory());
msObject.setValue("sqlSource.boundSql.sql", sql);
args[0] = newStatement;
}
return invocation.proceed();
}
private void addCondition(MappedStatement statement, Object example) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException {
if (example instanceof Map) {
example = ((Map) example).get("_ORIGINAL_PARAMETER_OBJECT");
}
Method method = example.getClass().getMethod("getOredCriteria", null);
//获取到条件数组,第一个是Criteria
List list = (List) method.invoke(example);
if (CollectionUtil.isEmpty(list)) {
Class clazz = ((ResultMap) statement.getResultMaps().get(0)).getType();
String exampleName = clazz.getName() + "Example";
Object paramExample = Class.forName(exampleName).newInstance();
Method createCriteria = paramExample.getClass().getMethod("createCriteria");
Object criteria = createCriteria.invoke(paramExample);
Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class);
andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value);
list.add(criteria);
} else {
Object criteria = list.get(0);
Method getCriteria = criteria.getClass().getMethod("getCriteria");
List params = (List) getCriteria.invoke(criteria);
boolean hasDel = false;
for (Object param : params) {
Method getCondition = param.getClass().getMethod("getCondition");
Object condition = getCondition.invoke(param);
if ("rec_status =".equals(condition)) {
hasDel = true;
}
}
if (!hasDel) {
Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class);
andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value);
}
}
}
@Override
public Object plugin(Object target) {
return Plugin.wrap(target, this);
}
@Override
public void setProperties(Properties properties) {
}
private MappedStatement newMappedStatement(MappedStatement ms, SqlSource newSqlSource) {
MappedStatement.Builder builder =
new MappedStatement.Builder(ms.getConfiguration(), ms.getId(), newSqlSource, ms.getSqlCommandType());
builder.resource(ms.getResource());
builder.fetchSize(ms.getFetchSize());
builder.statementType(ms.getStatementType());
builder.keyGenerator(ms.getKeyGenerator());
if (ms.getKeyProperties() != null && ms.getKeyProperties().length != 0) {
StringBuilder keyProperties = new StringBuilder();
for (String keyProperty : ms.getKeyProperties()) {
keyProperties.append(keyProperty).append(",");
}
keyProperties.delete(keyProperties.length() - 1, keyProperties.length());
builder.keyProperty(keyProperties.toString());
}
builder.timeout(ms.getTimeout());
builder.parameterMap(ms.getParameterMap());
builder.resultMaps(ms.getResultMaps());
builder.resultSetType(ms.getResultSetType());
builder.cache(ms.getCache());
builder.flushCacheRequired(ms.isFlushCacheRequired());
builder.useCache(ms.isUseCache());
return builder.build();
}
// 定义一个内部辅助类,作用是包装sq
class BoundSqlSqlSource implements SqlSource {
private BoundSql boundSql;
public BoundSqlSqlSource(BoundSql boundSql) {
this.boundSql = boundSql;
}
@Override
public BoundSql getBoundSql(Object parameterObject) {
return boundSql;
}
}
}

30
ptos_open/src/main/java/com/ccsens/ptos_open/persist/mapper/OpenBusinessMapper.java

@ -0,0 +1,30 @@
package com.ccsens.ptos_open.persist.mapper;
import com.ccsens.ptos_open.bean.po.OpenBusiness;
import com.ccsens.ptos_open.bean.po.OpenBusinessExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface OpenBusinessMapper {
long countByExample(OpenBusinessExample example);
int deleteByExample(OpenBusinessExample example);
int deleteByPrimaryKey(Long id);
int insert(OpenBusiness record);
int insertSelective(OpenBusiness record);
List<OpenBusiness> selectByExample(OpenBusinessExample example);
OpenBusiness selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") OpenBusiness record, @Param("example") OpenBusinessExample example);
int updateByExample(@Param("record") OpenBusiness record, @Param("example") OpenBusinessExample example);
int updateByPrimaryKeySelective(OpenBusiness record);
int updateByPrimaryKey(OpenBusiness record);
}

30
ptos_open/src/main/java/com/ccsens/ptos_open/persist/mapper/OpenBusinessPluginMapper.java

@ -0,0 +1,30 @@
package com.ccsens.ptos_open.persist.mapper;
import com.ccsens.ptos_open.bean.po.OpenBusinessPlugin;
import com.ccsens.ptos_open.bean.po.OpenBusinessPluginExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface OpenBusinessPluginMapper {
long countByExample(OpenBusinessPluginExample example);
int deleteByExample(OpenBusinessPluginExample example);
int deleteByPrimaryKey(Long id);
int insert(OpenBusinessPlugin record);
int insertSelective(OpenBusinessPlugin record);
List<OpenBusinessPlugin> selectByExample(OpenBusinessPluginExample example);
OpenBusinessPlugin selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") OpenBusinessPlugin record, @Param("example") OpenBusinessPluginExample example);
int updateByExample(@Param("record") OpenBusinessPlugin record, @Param("example") OpenBusinessPluginExample example);
int updateByPrimaryKeySelective(OpenBusinessPlugin record);
int updateByPrimaryKey(OpenBusinessPlugin record);
}

30
ptos_open/src/main/java/com/ccsens/ptos_open/persist/mapper/OpenPluginImgMapper.java

@ -0,0 +1,30 @@
package com.ccsens.ptos_open.persist.mapper;
import com.ccsens.ptos_open.bean.po.OpenPluginImg;
import com.ccsens.ptos_open.bean.po.OpenPluginImgExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface OpenPluginImgMapper {
long countByExample(OpenPluginImgExample example);
int deleteByExample(OpenPluginImgExample example);
int deleteByPrimaryKey(Long id);
int insert(OpenPluginImg record);
int insertSelective(OpenPluginImg record);
List<OpenPluginImg> selectByExample(OpenPluginImgExample example);
OpenPluginImg selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") OpenPluginImg record, @Param("example") OpenPluginImgExample example);
int updateByExample(@Param("record") OpenPluginImg record, @Param("example") OpenPluginImgExample example);
int updateByPrimaryKeySelective(OpenPluginImg record);
int updateByPrimaryKey(OpenPluginImg record);
}

37
ptos_open/src/main/java/com/ccsens/ptos_open/persist/mapper/OpenPluginMapper.java

@ -0,0 +1,37 @@
package com.ccsens.ptos_open.persist.mapper;
import com.ccsens.ptos_open.bean.po.OpenPlugin;
import com.ccsens.ptos_open.bean.po.OpenPluginExample;
import com.ccsens.ptos_open.bean.po.OpenPluginWithBLOBs;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface OpenPluginMapper {
long countByExample(OpenPluginExample example);
int deleteByExample(OpenPluginExample example);
int deleteByPrimaryKey(Long id);
int insert(OpenPluginWithBLOBs record);
int insertSelective(OpenPluginWithBLOBs record);
List<OpenPluginWithBLOBs> selectByExampleWithBLOBs(OpenPluginExample example);
List<OpenPlugin> selectByExample(OpenPluginExample example);
OpenPluginWithBLOBs selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") OpenPluginWithBLOBs record, @Param("example") OpenPluginExample example);
int updateByExampleWithBLOBs(@Param("record") OpenPluginWithBLOBs record, @Param("example") OpenPluginExample example);
int updateByExample(@Param("record") OpenPlugin record, @Param("example") OpenPluginExample example);
int updateByPrimaryKeySelective(OpenPluginWithBLOBs record);
int updateByPrimaryKeyWithBLOBs(OpenPluginWithBLOBs record);
int updateByPrimaryKey(OpenPlugin record);
}

43
ptos_open/src/main/java/com/ccsens/ptos_open/service/BusinessService.java

@ -0,0 +1,43 @@
package com.ccsens.ptos_open.service;
import com.ccsens.ptos_open.bean.dto.BusinessDto;
import com.ccsens.ptos_open.bean.vo.BusinessVo;
import com.ccsens.ptos_open.bean.vo.PluginVo;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
/**
* @author
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class BusinessService implements IBusinessService {
@Override
public PageInfo<PluginVo.PluginInfo> queryBusiness(BusinessDto.QueryByPage param, Long userId) {
return null;
}
@Override
public void saveBusiness(BusinessDto.SaveBusiness param, Long userId) {
}
@Override
public void relevancePlugin(BusinessDto.RelevancePlugin param, Long userId) {
}
@Override
public PageInfo<BusinessVo.BusinessPlugin> businessQueryPlugin(BusinessDto.BusinessQueryPlugin param, Long userId) {
return null;
}
@Override
public void updateConfig(BusinessDto.UpdateConfig param, Long userId) {
}
}

49
ptos_open/src/main/java/com/ccsens/ptos_open/service/IBusinessService.java

@ -0,0 +1,49 @@
package com.ccsens.ptos_open.service;
import com.ccsens.ptos_open.bean.dto.BusinessDto;
import com.ccsens.ptos_open.bean.vo.BusinessVo;
import com.ccsens.ptos_open.bean.vo.PluginVo;
import com.github.pagehelper.PageInfo;
/**
* @author
*/
public interface IBusinessService {
/**
* 分页查询业务列表
* @param param 筛选条件
* @param userId userId
* @return 返回业务信息
*/
PageInfo<PluginVo.PluginInfo> queryBusiness(BusinessDto.QueryByPage param, Long userId);
/**
* 添加业务信息
* @param param 业务信息
* @param userId userId
*/
void saveBusiness(BusinessDto.SaveBusiness param, Long userId);
/**
* 关联业务和插件
* @param param 插件和业务id
* @param userId userId
*/
void relevancePlugin(BusinessDto.RelevancePlugin param, Long userId);
/**
* 分页查找业务下关联的插件信息
* @param param 业务id
* @param userId userId
* @return 分页返回插件id
*/
PageInfo<BusinessVo.BusinessPlugin> businessQueryPlugin(BusinessDto.BusinessQueryPlugin param, Long userId);
/**
* 修改业务下插件的配置信息
* @param param 配置信息
* @param userId userId
*/
void updateConfig(BusinessDto.UpdateConfig param, Long userId);
}

26
ptos_open/src/main/java/com/ccsens/ptos_open/service/IPluginService.java

@ -0,0 +1,26 @@
package com.ccsens.ptos_open.service;
import com.ccsens.ptos_open.bean.dto.PluginDto;
import com.ccsens.ptos_open.bean.vo.PluginVo;
import com.github.pagehelper.PageInfo;
/**
* @author
*/
public interface IPluginService {
/**
* 分页查找插件信息
* @param param 筛选条件
* @param userId userId
* @return 返回插件信息
*/
PageInfo<PluginVo.PluginInfo> queryPlugin(PluginDto.QueryByPage param, Long userId);
/**
* 添加插件
* @param param 插件信息
* @param userId userId
*/
void savePlugin(PluginDto.SavePlugin param, Long userId);
}

27
ptos_open/src/main/java/com/ccsens/ptos_open/service/PluginService.java

@ -0,0 +1,27 @@
package com.ccsens.ptos_open.service;
import com.ccsens.ptos_open.bean.dto.PluginDto;
import com.ccsens.ptos_open.bean.vo.PluginVo;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
/**
* @author
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class PluginService implements IPluginService {
@Override
public PageInfo<PluginVo.PluginInfo> queryPlugin(PluginDto.QueryByPage param, Long userId) {
return null;
}
@Override
public void savePlugin(PluginDto.SavePlugin param, Long userId) {
}
}

17
ptos_open/src/main/java/com/ccsens/ptos_open/util/OpenCodeError.java

@ -0,0 +1,17 @@
package com.ccsens.ptos_open.util;
import com.ccsens.util.CodeError;
/**
* @author
*/
public class OpenCodeError extends CodeError {
public static final Code ILLEGAL_LOG_IN = new Code(401,"非法登录",true);
public static final Code CLIENT_ERROR = new Code(501,"客户端类型异常",true);
public static final Code SIGNIN_TYPE_ERROR = new Code(502,"登录类型异常",true);
public static final Code NOT_PHONE = new Code(503,"手机号不能为空",true);
public static final Code NOT_SMS_CODE = new Code(504,"请填写手机号验证码",true);
public static final Code ERROR_SEND_TOO_FAST = new Code(504,"60秒内只能发送一次,请稍后再试",true);
}

56
ptos_open/src/main/java/com/ccsens/ptos_open/util/OpenConstant.java

@ -0,0 +1,56 @@
package com.ccsens.ptos_open.util;
import java.util.HashMap;
import java.util.Map;
/**
* @author
*/
public class OpenConstant {
/**业务离线时间*/
public static final Long LAST_ANSWER_TIME = 21 * 60 * 1000L;
/**是否发送验证码 0不发送 1发送*/
public static final String SMS_CODE = "1";
/**图片类型*/
public static final String FILE_TYPE_IMG = "bmp,jpg,jpeg,png,tif,gif,pcx,tga,exif,fpx,svg,psd,cdr,pcd,dxf,ufo,eps,ai,raw,WMF,webp";
/**文档类型*/
public static final String FILE_TYPE_DOCUMENT = "doc, dot, wps, wpt, docx, dotx, docm, dotm, xls, xlt, et, xlsx, xltx, csv, xlsm, xltm, ppt,pptx,pptm,ppsx,ppsm,pps,potx,potm,dpt,dps, pdf";
/**验证手机正则*/
public static final String PHONE_REGEX = "^[1]([3-9])[0-9]{9}$";
/**字符串分隔符*/
public static final String STRING_REGEX = ",|,|;|;|、|/";
/**wbs相关*/
public static final class WbsExcel {
/**wbsSheet*/
public static final String WBS_SHEET = "WBS";
/**项目成员Sheet*/
public static final String MEMBER_SHEET = "项目成员表";
/**项目信息头*/
public static final String PROJECT_INFO_TITLE = "项目信息";
/**任务信息头*/
public static final String TASK_INFO_TITLE = "项目任务分解";
/**excel文件格式验证*/
public static final String WBS_FILE_FORMAT = "xls,xlsx";
/**插件配置表*/
public static final String WBS_PLUGIN_CONFIG = "插件配置表";
}
/**wbs表时长对应关系表*/
public static final Map<String, Long> WBS_DURATION = new HashMap<>();
static {
WBS_DURATION.put("s",1000L);
WBS_DURATION.put("min",60 * 1000L);
WBS_DURATION.put("h",60 * 60 * 1000L);
WBS_DURATION.put("d",24 * 60 * 60 * 1000L);
WBS_DURATION.put("w",7 * 24 * 60 * 60 * 1000L);
WBS_DURATION.put("m",30 * 24 * 60 * 60 * 1000L);
WBS_DURATION.put("y",365 * 24 * 60 * 60 * 1000L);
}
}

30
ptos_open/src/main/resources/application-common.yml

@ -0,0 +1,30 @@
logging:
level:
com:
favorites: DEBUG
org:
hibernate: ERROR
springframework:
web: DEBUG
mybatis:
config-location: classpath:mybatis/mybatis-config.xml
mapper-locations: classpath*:mapper_*/*.xml
# type-aliases-package: com.ccsens.mtpro.bean
#server:
# tomcat:
# uri-encoding: UTF-8
spring:
http:
encoding:
charset: UTF-8
enabled: true
force: true
log-request-details: true
servlet:
multipart:
max-file-size: 10MB
max-request-size: 100MB
snowflake:
datacenterId: 10
workerId: 1

51
ptos_open/src/main/resources/application-dev.yml

@ -0,0 +1,51 @@
server:
port: 7300
servlet:
context-path:
spring:
application:
name: opt
datasource:
type: com.alibaba.druid.pool.DruidDataSource
# rabbitmq:
# host: 192.168.0.99
# password: 111111
# port: 5672
# username: admin
rabbitmq:
host: dd.tall.wiki
password: 111111
port: 5672
username: admin
redis:
database: 0
host: 127.0.0.1
jedis:
pool:
max-active: 200
max-idle: 10
max-wait: -1ms
min-idle: 0
password: ''
port: 6379
timeout: 1000ms
swagger:
enable: true
mybatisCache:
database: 1
host: 127.0.0.1
jedis:
pool:
max-active: 200
max-idle: 10
max-wait: -1
min-idle: 0
password: ''
port: 6379
timeout: 1000
smsCode: 0
file:
path: /home/ptos_open/server/uploads/
domain: https://test.tall.wiki/gateway/opt
imgDomain: https://test.tall.wiki/gateway/opt/uploads/

41
ptos_open/src/main/resources/application-prod.yml

@ -0,0 +1,41 @@
server:
port: 7300
servlet:
context-path:
spring:
application:
name: opt
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: 121.36.3.207
password: 111111
port: 5672
username: admin
redis:
database: 0
host: 127.0.0.1
jedis:
pool:
max-active: 200
max-idle: 10
max-wait: -1ms
min-idle: 0
password: ''
# password: 'areowqr!@43ef'
port: 6379
timeout: 1000ms
swagger:
enable: true
eureka:
instance:
ip-address: 101.201.226.21
gatewayUrl: https://www.tall.wiki/gateway/
notGatewayUrl: https://www.tall.wiki/
apiUrl: https://www.tall.wiki/
smsCode: 0
file:
path: /home/ptos_open/server/uploads/
domain: https://www.tall.wiki/gateway/opt
imgDomain: https://www.tall.wiki/gateway/opt/uploads/

49
ptos_open/src/main/resources/application-test.yml

@ -0,0 +1,49 @@
server:
port: 7300
servlet:
context-path:
spring:
application:
name: opt
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: dd.tall.wiki
password: 111111
port: 5672
username: admin
redis:
database: 0
host: 127.0.0.1
jedis:
pool:
max-active: 200
max-idle: 10
max-wait: -1ms
min-idle: 0
password: ''
port: 6379
timeout: 1000ms
swagger:
enable: true
mybatisCache:
database: 1
host: 127.0.0.1
jedis:
pool:
max-active: 200
max-idle: 10
max-wait: -1
min-idle: 0
password: ''
port: 6379
timeout: 1000
eureka:
instance:
ip-address: 127.0.0.1
smsCode: 0
file:
path: /home/ptos_open/server/uploads/
domain: https://test.tall.wiki/gateway/opt
imgDomain: https://test.tall.wiki/gateway/opt/uploads/

4
ptos_open/src/main/resources/application.yml

@ -0,0 +1,4 @@
spring:
profiles:
active: dev
include: common, util-dev

34
ptos_open/src/main/resources/druid-dev.yml

@ -0,0 +1,34 @@
spring:
datasource:
druid:
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
driverClassName: com.mysql.cj.jdbc.Driver
dynamicUrl: jdbc:mysql://localhost:3306/${schema}
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
filterName: druidFilter
filterProfileEnable: true
filterUrlPattern: /*
filters: stat,wall
initialSize: 5
maxActive: 20
maxPoolPreparedStatementPerConnectionSize: 20
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
# password: 37080c1f223685592316b02dad8816c019290a476e54ebb638f9aa3ba8b6bdb9
password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
servletLoginUsername: druid
servletName: druidServlet
servletResetEnable: true
servletUrlMapping: /druid/*
testOnBorrow: false
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://101.201.226.163:3306/tall_dh?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_TALL

35
ptos_open/src/main/resources/druid-prod.yml

@ -0,0 +1,35 @@
spring:
datasource:
druid:
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
driverClassName: com.mysql.cj.jdbc.Driver
dynamicUrl: jdbc:mysql://localhost:3306/${schema}
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
filterName: druidFilter
filterProfileEnable: true
filterUrlPattern: /*
filters: stat,wall
initialSize: 5
maxActive: 20
maxPoolPreparedStatementPerConnectionSize: 20
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
# password:
password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
servletLoginUsername: druid
servletName: druidServlet
servletResetEnable: true
servletUrlMapping: /druid/*
testOnBorrow: false
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
# url: jdbc:mysql://127.0.0.1/defaultwbs?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true
url: jdbc:mysql://101.201.226.163:3306/tall_dm?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_TALL

34
ptos_open/src/main/resources/druid-test.yml

@ -0,0 +1,34 @@
spring:
datasource:
druid:
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
driverClassName: com.mysql.cj.jdbc.Driver
dynamicUrl: jdbc:mysql://localhost:3306/${schema}
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
filterName: druidFilter
filterProfileEnable: true
filterUrlPattern: /*
filters: stat,wall
initialSize: 5
maxActive: 20
maxPoolPreparedStatementPerConnectionSize: 20
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
# password: 68073a279b399baa1fa12cf39bfbb65bfc1480ffee7b659ccc81cf19be8c4473
password:
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
servletLoginUsername: druid
servletName: druidServlet
servletResetEnable: true
servletUrlMapping: /druid/*
testOnBorrow: false
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://101.201.226.163:3306/tall_dm?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_TALL

196
ptos_open/src/main/resources/logback-spring.xml

@ -0,0 +1,196 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 -->
<!-- scan:当此属性设置为true时,配置文件如果发生改变,将会被重新加载,默认值为true -->
<!-- scanPeriod:设置监测配置文件是否有修改的时间间隔,如果没有给出时间单位,默认单位是毫秒。当scan为true时,此属性生效。默认的时间间隔为1分钟。 -->
<!-- debug:当此属性设置为true时,将打印出logback内部日志信息,实时查看logback运行状态。默认值为false。 -->
<configuration scan="true" scanPeriod="10 seconds">
<!--<include resource="org/springframework/boot/logging/logback/base.xml" />-->
<contextName>logback</contextName>
<!-- name的值是变量的名称,value的值时变量定义的值。通过定义的值会被插入到logger上下文中。定义变量后,可以使“${}”来使用变量。 -->
<property name="log.path" value="/home/ptos_open/server/log/" />
<!-- 彩色日志 -->
<!-- 彩色日志依赖的渲染类 -->
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!--输出到控制台-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>info</level>
</filter>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<!-- 设置字符集 -->
<charset>UTF-8</charset>
</encoder>
</appender>
<!--输出到文件-->
<!-- 时间滚动输出 level为 DEBUG 日志 -->
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_debug.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志归档 -->
<fileNamePattern>${log.path}/debug/log-debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 INFO 日志 -->
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_info.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>${log.path}/info/log-info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 WARN 日志 -->
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_warn.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/warn/log-warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录warn级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>warn</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 时间滚动输出 level为 ERROR 日志 -->
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文件的路径及文件名 -->
<file>${log.path}/log_error.log</file>
<!--日志文件输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/error/log-error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文件保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文件只记录ERROR级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!--
<logger>用来设置某一个包或者具体的某一个类的日志打印级别、
以及指定<appender><logger>仅有一个name属性,
一个可选的level和一个可选的addtivity属性。
name:用来指定受此logger约束的某一个包或者具体的某一个类。
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。
如果未设置此属性,那么当前logger将会继承上级的级别。
addtivity:是否向上级logger传递打印信息。默认是true。
-->
<!--<logger name="org.springframework.web" level="info"/>-->
<!--<logger name="org.springframework.scheduling.annotation.ScheduledAnnotationBeanPostProcessor" level="INFO"/>-->
<!--
使用mybatis的时候,sql语句是debug下才会打印,而这里我们只配置了info,所以想要查看sql语句的话,有以下两种操作:
第一种把<root level="info">改成<root level="DEBUG">这样就会打印sql,不过这样日志那边会出现很多其他消息
第二种就是单独给dao下目录配置debug模式,代码如下,这样配置sql语句会打印,其他还是正常info级别:
-->
<!--
root节点是必选节点,用来指定最基础的日志输出级别,只有一个level属性
level:用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,
不能设置为INHERITED或者同义词NULL。默认是DEBUG
可以包含零个或多个元素,标识这个appender将会添加到这个logger。
-->
<!--开发环境:打印控制台-->
<springProfile name="dev">
<logger name="com.ccsens.ptpro.persist.*" level="debug"/>
</springProfile>
<root level="info">
<appender-ref ref="CONSOLE" />
<appender-ref ref="DEBUG_FILE" />
<appender-ref ref="INFO_FILE" />
<appender-ref ref="WARN_FILE" />
<appender-ref ref="ERROR_FILE" />
</root>
<!--生产环境:输出到文件-->
<!--<springProfile name="pro">-->
<!--<root level="info">-->
<!--<appender-ref ref="CONSOLE" />-->
<!--<appender-ref ref="DEBUG_FILE" />-->
<!--<appender-ref ref="INFO_FILE" />-->
<!--<appender-ref ref="ERROR_FILE" />-->
<!--<appender-ref ref="WARN_FILE" />-->
<!--</root>-->
<!--</springProfile>-->
</configuration>

417
ptos_open/src/main/resources/mapper_raw/OpenBusinessMapper.xml

@ -0,0 +1,417 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.ptos_open.persist.mapper.OpenBusinessMapper">
<resultMap id="BaseResultMap" type="com.ccsens.ptos_open.bean.po.OpenBusiness">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="url" jdbcType="VARCHAR" property="url" />
<result column="app_id" jdbcType="VARCHAR" property="appId" />
<result column="secret" jdbcType="VARCHAR" property="secret" />
<result column="creator_id" jdbcType="BIGINT" property="creatorId" />
<result column="last_ask_time" jdbcType="BIGINT" property="lastAskTime" />
<result column="last_answer_time" jdbcType="BIGINT" property="lastAnswerTime" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="pub" jdbcType="TINYINT" property="pub" />
<result column="start_using" jdbcType="TINYINT" property="startUsing" />
<result column="debug" jdbcType="TINYINT" property="debug" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, code, description, url, app_id, secret, creator_id, last_ask_time, last_answer_time,
type, pub, start_using, debug, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.ptos_open.bean.po.OpenBusinessExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_open_business
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_open_business
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_open_business
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.ptos_open.bean.po.OpenBusinessExample">
delete from t_open_business
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.ptos_open.bean.po.OpenBusiness">
insert into t_open_business (id, name, code,
description, url, app_id,
secret, creator_id, last_ask_time,
last_answer_time, type, pub,
start_using, debug, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR},
#{description,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{appId,jdbcType=VARCHAR},
#{secret,jdbcType=VARCHAR}, #{creatorId,jdbcType=BIGINT}, #{lastAskTime,jdbcType=BIGINT},
#{lastAnswerTime,jdbcType=BIGINT}, #{type,jdbcType=TINYINT}, #{pub,jdbcType=TINYINT},
#{startUsing,jdbcType=TINYINT}, #{debug,jdbcType=TINYINT}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ptos_open.bean.po.OpenBusiness">
insert into t_open_business
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="code != null">
code,
</if>
<if test="description != null">
description,
</if>
<if test="url != null">
url,
</if>
<if test="appId != null">
app_id,
</if>
<if test="secret != null">
secret,
</if>
<if test="creatorId != null">
creator_id,
</if>
<if test="lastAskTime != null">
last_ask_time,
</if>
<if test="lastAnswerTime != null">
last_answer_time,
</if>
<if test="type != null">
type,
</if>
<if test="pub != null">
pub,
</if>
<if test="startUsing != null">
start_using,
</if>
<if test="debug != null">
debug,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="code != null">
#{code,jdbcType=VARCHAR},
</if>
<if test="description != null">
#{description,jdbcType=VARCHAR},
</if>
<if test="url != null">
#{url,jdbcType=VARCHAR},
</if>
<if test="appId != null">
#{appId,jdbcType=VARCHAR},
</if>
<if test="secret != null">
#{secret,jdbcType=VARCHAR},
</if>
<if test="creatorId != null">
#{creatorId,jdbcType=BIGINT},
</if>
<if test="lastAskTime != null">
#{lastAskTime,jdbcType=BIGINT},
</if>
<if test="lastAnswerTime != null">
#{lastAnswerTime,jdbcType=BIGINT},
</if>
<if test="type != null">
#{type,jdbcType=TINYINT},
</if>
<if test="pub != null">
#{pub,jdbcType=TINYINT},
</if>
<if test="startUsing != null">
#{startUsing,jdbcType=TINYINT},
</if>
<if test="debug != null">
#{debug,jdbcType=TINYINT},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ptos_open.bean.po.OpenBusinessExample" resultType="java.lang.Long">
select count(*) from t_open_business
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_open_business
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.code != null">
code = #{record.code,jdbcType=VARCHAR},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=VARCHAR},
</if>
<if test="record.url != null">
url = #{record.url,jdbcType=VARCHAR},
</if>
<if test="record.appId != null">
app_id = #{record.appId,jdbcType=VARCHAR},
</if>
<if test="record.secret != null">
secret = #{record.secret,jdbcType=VARCHAR},
</if>
<if test="record.creatorId != null">
creator_id = #{record.creatorId,jdbcType=BIGINT},
</if>
<if test="record.lastAskTime != null">
last_ask_time = #{record.lastAskTime,jdbcType=BIGINT},
</if>
<if test="record.lastAnswerTime != null">
last_answer_time = #{record.lastAnswerTime,jdbcType=BIGINT},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=TINYINT},
</if>
<if test="record.pub != null">
pub = #{record.pub,jdbcType=TINYINT},
</if>
<if test="record.startUsing != null">
start_using = #{record.startUsing,jdbcType=TINYINT},
</if>
<if test="record.debug != null">
debug = #{record.debug,jdbcType=TINYINT},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_open_business
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
code = #{record.code,jdbcType=VARCHAR},
description = #{record.description,jdbcType=VARCHAR},
url = #{record.url,jdbcType=VARCHAR},
app_id = #{record.appId,jdbcType=VARCHAR},
secret = #{record.secret,jdbcType=VARCHAR},
creator_id = #{record.creatorId,jdbcType=BIGINT},
last_ask_time = #{record.lastAskTime,jdbcType=BIGINT},
last_answer_time = #{record.lastAnswerTime,jdbcType=BIGINT},
type = #{record.type,jdbcType=TINYINT},
pub = #{record.pub,jdbcType=TINYINT},
start_using = #{record.startUsing,jdbcType=TINYINT},
debug = #{record.debug,jdbcType=TINYINT},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.ptos_open.bean.po.OpenBusiness">
update t_open_business
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="code != null">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="description != null">
description = #{description,jdbcType=VARCHAR},
</if>
<if test="url != null">
url = #{url,jdbcType=VARCHAR},
</if>
<if test="appId != null">
app_id = #{appId,jdbcType=VARCHAR},
</if>
<if test="secret != null">
secret = #{secret,jdbcType=VARCHAR},
</if>
<if test="creatorId != null">
creator_id = #{creatorId,jdbcType=BIGINT},
</if>
<if test="lastAskTime != null">
last_ask_time = #{lastAskTime,jdbcType=BIGINT},
</if>
<if test="lastAnswerTime != null">
last_answer_time = #{lastAnswerTime,jdbcType=BIGINT},
</if>
<if test="type != null">
type = #{type,jdbcType=TINYINT},
</if>
<if test="pub != null">
pub = #{pub,jdbcType=TINYINT},
</if>
<if test="startUsing != null">
start_using = #{startUsing,jdbcType=TINYINT},
</if>
<if test="debug != null">
debug = #{debug,jdbcType=TINYINT},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.ptos_open.bean.po.OpenBusiness">
update t_open_business
set name = #{name,jdbcType=VARCHAR},
code = #{code,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
url = #{url,jdbcType=VARCHAR},
app_id = #{appId,jdbcType=VARCHAR},
secret = #{secret,jdbcType=VARCHAR},
creator_id = #{creatorId,jdbcType=BIGINT},
last_ask_time = #{lastAskTime,jdbcType=BIGINT},
last_answer_time = #{lastAnswerTime,jdbcType=BIGINT},
type = #{type,jdbcType=TINYINT},
pub = #{pub,jdbcType=TINYINT},
start_using = #{startUsing,jdbcType=TINYINT},
debug = #{debug,jdbcType=TINYINT},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

291
ptos_open/src/main/resources/mapper_raw/OpenBusinessPluginMapper.xml

@ -0,0 +1,291 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.ptos_open.persist.mapper.OpenBusinessPluginMapper">
<resultMap id="BaseResultMap" type="com.ccsens.ptos_open.bean.po.OpenBusinessPlugin">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="plugin_id" jdbcType="BIGINT" property="pluginId" />
<result column="business_id" jdbcType="BIGINT" property="businessId" />
<result column="config" jdbcType="VARCHAR" property="config" />
<result column="code" jdbcType="VARCHAR" property="code" />
<result column="debug" jdbcType="TINYINT" property="debug" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, plugin_id, business_id, config, code, debug, operator, created_at, updated_at,
rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.ptos_open.bean.po.OpenBusinessPluginExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_open_business_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_open_business_plugin
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_open_business_plugin
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.ptos_open.bean.po.OpenBusinessPluginExample">
delete from t_open_business_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.ptos_open.bean.po.OpenBusinessPlugin">
insert into t_open_business_plugin (id, plugin_id, business_id,
config, code, debug,
operator, created_at, updated_at,
rec_status)
values (#{id,jdbcType=BIGINT}, #{pluginId,jdbcType=BIGINT}, #{businessId,jdbcType=BIGINT},
#{config,jdbcType=VARCHAR}, #{code,jdbcType=VARCHAR}, #{debug,jdbcType=TINYINT},
#{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ptos_open.bean.po.OpenBusinessPlugin">
insert into t_open_business_plugin
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="pluginId != null">
plugin_id,
</if>
<if test="businessId != null">
business_id,
</if>
<if test="config != null">
config,
</if>
<if test="code != null">
code,
</if>
<if test="debug != null">
debug,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="pluginId != null">
#{pluginId,jdbcType=BIGINT},
</if>
<if test="businessId != null">
#{businessId,jdbcType=BIGINT},
</if>
<if test="config != null">
#{config,jdbcType=VARCHAR},
</if>
<if test="code != null">
#{code,jdbcType=VARCHAR},
</if>
<if test="debug != null">
#{debug,jdbcType=TINYINT},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ptos_open.bean.po.OpenBusinessPluginExample" resultType="java.lang.Long">
select count(*) from t_open_business_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_open_business_plugin
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.pluginId != null">
plugin_id = #{record.pluginId,jdbcType=BIGINT},
</if>
<if test="record.businessId != null">
business_id = #{record.businessId,jdbcType=BIGINT},
</if>
<if test="record.config != null">
config = #{record.config,jdbcType=VARCHAR},
</if>
<if test="record.code != null">
code = #{record.code,jdbcType=VARCHAR},
</if>
<if test="record.debug != null">
debug = #{record.debug,jdbcType=TINYINT},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_open_business_plugin
set id = #{record.id,jdbcType=BIGINT},
plugin_id = #{record.pluginId,jdbcType=BIGINT},
business_id = #{record.businessId,jdbcType=BIGINT},
config = #{record.config,jdbcType=VARCHAR},
code = #{record.code,jdbcType=VARCHAR},
debug = #{record.debug,jdbcType=TINYINT},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.ptos_open.bean.po.OpenBusinessPlugin">
update t_open_business_plugin
<set>
<if test="pluginId != null">
plugin_id = #{pluginId,jdbcType=BIGINT},
</if>
<if test="businessId != null">
business_id = #{businessId,jdbcType=BIGINT},
</if>
<if test="config != null">
config = #{config,jdbcType=VARCHAR},
</if>
<if test="code != null">
code = #{code,jdbcType=VARCHAR},
</if>
<if test="debug != null">
debug = #{debug,jdbcType=TINYINT},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.ptos_open.bean.po.OpenBusinessPlugin">
update t_open_business_plugin
set plugin_id = #{pluginId,jdbcType=BIGINT},
business_id = #{businessId,jdbcType=BIGINT},
config = #{config,jdbcType=VARCHAR},
code = #{code,jdbcType=VARCHAR},
debug = #{debug,jdbcType=TINYINT},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

275
ptos_open/src/main/resources/mapper_raw/OpenPluginImgMapper.xml

@ -0,0 +1,275 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.ptos_open.persist.mapper.OpenPluginImgMapper">
<resultMap id="BaseResultMap" type="com.ccsens.ptos_open.bean.po.OpenPluginImg">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="plugin_id" jdbcType="BIGINT" property="pluginId" />
<result column="file_id" jdbcType="BIGINT" property="fileId" />
<result column="file_path" jdbcType="VARCHAR" property="filePath" />
<result column="type" jdbcType="TINYINT" property="type" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, plugin_id, file_id, file_path, type, operator, created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.ptos_open.bean.po.OpenPluginImgExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_open_plugin_img
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_open_plugin_img
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_open_plugin_img
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.ptos_open.bean.po.OpenPluginImgExample">
delete from t_open_plugin_img
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.ptos_open.bean.po.OpenPluginImg">
insert into t_open_plugin_img (id, plugin_id, file_id,
file_path, type, operator,
created_at, updated_at, rec_status
)
values (#{id,jdbcType=BIGINT}, #{pluginId,jdbcType=BIGINT}, #{fileId,jdbcType=BIGINT},
#{filePath,jdbcType=VARCHAR}, #{type,jdbcType=TINYINT}, #{operator,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ptos_open.bean.po.OpenPluginImg">
insert into t_open_plugin_img
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="pluginId != null">
plugin_id,
</if>
<if test="fileId != null">
file_id,
</if>
<if test="filePath != null">
file_path,
</if>
<if test="type != null">
type,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="pluginId != null">
#{pluginId,jdbcType=BIGINT},
</if>
<if test="fileId != null">
#{fileId,jdbcType=BIGINT},
</if>
<if test="filePath != null">
#{filePath,jdbcType=VARCHAR},
</if>
<if test="type != null">
#{type,jdbcType=TINYINT},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ptos_open.bean.po.OpenPluginImgExample" resultType="java.lang.Long">
select count(*) from t_open_plugin_img
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_open_plugin_img
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.pluginId != null">
plugin_id = #{record.pluginId,jdbcType=BIGINT},
</if>
<if test="record.fileId != null">
file_id = #{record.fileId,jdbcType=BIGINT},
</if>
<if test="record.filePath != null">
file_path = #{record.filePath,jdbcType=VARCHAR},
</if>
<if test="record.type != null">
type = #{record.type,jdbcType=TINYINT},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_open_plugin_img
set id = #{record.id,jdbcType=BIGINT},
plugin_id = #{record.pluginId,jdbcType=BIGINT},
file_id = #{record.fileId,jdbcType=BIGINT},
file_path = #{record.filePath,jdbcType=VARCHAR},
type = #{record.type,jdbcType=TINYINT},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.ptos_open.bean.po.OpenPluginImg">
update t_open_plugin_img
<set>
<if test="pluginId != null">
plugin_id = #{pluginId,jdbcType=BIGINT},
</if>
<if test="fileId != null">
file_id = #{fileId,jdbcType=BIGINT},
</if>
<if test="filePath != null">
file_path = #{filePath,jdbcType=VARCHAR},
</if>
<if test="type != null">
type = #{type,jdbcType=TINYINT},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.ptos_open.bean.po.OpenPluginImg">
update t_open_plugin_img
set plugin_id = #{pluginId,jdbcType=BIGINT},
file_id = #{fileId,jdbcType=BIGINT},
file_path = #{filePath,jdbcType=VARCHAR},
type = #{type,jdbcType=TINYINT},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

424
ptos_open/src/main/resources/mapper_raw/OpenPluginMapper.xml

@ -0,0 +1,424 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.ptos_open.persist.mapper.OpenPluginMapper">
<resultMap id="BaseResultMap" type="com.ccsens.ptos_open.bean.po.OpenPlugin">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="versions" jdbcType="VARCHAR" property="versions" />
<result column="intro" jdbcType="VARCHAR" property="intro" />
<result column="config" jdbcType="VARCHAR" property="config" />
<result column="publish" jdbcType="TINYINT" property="publish" />
<result column="creator_id" jdbcType="BIGINT" property="creatorId" />
<result column="operator" jdbcType="BIGINT" property="operator" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.ccsens.ptos_open.bean.po.OpenPluginWithBLOBs">
<result column="description" jdbcType="LONGVARCHAR" property="description" />
<result column="html" jdbcType="LONGVARCHAR" property="html" />
<result column="js" jdbcType="LONGVARCHAR" property="js" />
<result column="css" jdbcType="LONGVARCHAR" property="css" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, name, versions, intro, config, publish, creator_id, operator, created_at, updated_at,
rec_status
</sql>
<sql id="Blob_Column_List">
description, html, js, css
</sql>
<select id="selectByExampleWithBLOBs" parameterType="com.ccsens.ptos_open.bean.po.OpenPluginExample" resultMap="ResultMapWithBLOBs">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from t_open_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="com.ccsens.ptos_open.bean.po.OpenPluginExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_open_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from t_open_plugin
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_open_plugin
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.ptos_open.bean.po.OpenPluginExample">
delete from t_open_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.ptos_open.bean.po.OpenPluginWithBLOBs">
insert into t_open_plugin (id, name, versions,
intro, config, publish,
creator_id, operator, created_at,
updated_at, rec_status, description,
html, js, css
)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{versions,jdbcType=VARCHAR},
#{intro,jdbcType=VARCHAR}, #{config,jdbcType=VARCHAR}, #{publish,jdbcType=TINYINT},
#{creatorId,jdbcType=BIGINT}, #{operator,jdbcType=BIGINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}, #{description,jdbcType=LONGVARCHAR},
#{html,jdbcType=LONGVARCHAR}, #{js,jdbcType=LONGVARCHAR}, #{css,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.ptos_open.bean.po.OpenPluginWithBLOBs">
insert into t_open_plugin
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="name != null">
name,
</if>
<if test="versions != null">
versions,
</if>
<if test="intro != null">
intro,
</if>
<if test="config != null">
config,
</if>
<if test="publish != null">
publish,
</if>
<if test="creatorId != null">
creator_id,
</if>
<if test="operator != null">
operator,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
<if test="description != null">
description,
</if>
<if test="html != null">
html,
</if>
<if test="js != null">
js,
</if>
<if test="css != null">
css,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="versions != null">
#{versions,jdbcType=VARCHAR},
</if>
<if test="intro != null">
#{intro,jdbcType=VARCHAR},
</if>
<if test="config != null">
#{config,jdbcType=VARCHAR},
</if>
<if test="publish != null">
#{publish,jdbcType=TINYINT},
</if>
<if test="creatorId != null">
#{creatorId,jdbcType=BIGINT},
</if>
<if test="operator != null">
#{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
<if test="description != null">
#{description,jdbcType=LONGVARCHAR},
</if>
<if test="html != null">
#{html,jdbcType=LONGVARCHAR},
</if>
<if test="js != null">
#{js,jdbcType=LONGVARCHAR},
</if>
<if test="css != null">
#{css,jdbcType=LONGVARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.ptos_open.bean.po.OpenPluginExample" resultType="java.lang.Long">
select count(*) from t_open_plugin
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_open_plugin
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.versions != null">
versions = #{record.versions,jdbcType=VARCHAR},
</if>
<if test="record.intro != null">
intro = #{record.intro,jdbcType=VARCHAR},
</if>
<if test="record.config != null">
config = #{record.config,jdbcType=VARCHAR},
</if>
<if test="record.publish != null">
publish = #{record.publish,jdbcType=TINYINT},
</if>
<if test="record.creatorId != null">
creator_id = #{record.creatorId,jdbcType=BIGINT},
</if>
<if test="record.operator != null">
operator = #{record.operator,jdbcType=BIGINT},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
<if test="record.description != null">
description = #{record.description,jdbcType=LONGVARCHAR},
</if>
<if test="record.html != null">
html = #{record.html,jdbcType=LONGVARCHAR},
</if>
<if test="record.js != null">
js = #{record.js,jdbcType=LONGVARCHAR},
</if>
<if test="record.css != null">
css = #{record.css,jdbcType=LONGVARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
update t_open_plugin
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
versions = #{record.versions,jdbcType=VARCHAR},
intro = #{record.intro,jdbcType=VARCHAR},
config = #{record.config,jdbcType=VARCHAR},
publish = #{record.publish,jdbcType=TINYINT},
creator_id = #{record.creatorId,jdbcType=BIGINT},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT},
description = #{record.description,jdbcType=LONGVARCHAR},
html = #{record.html,jdbcType=LONGVARCHAR},
js = #{record.js,jdbcType=LONGVARCHAR},
css = #{record.css,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_open_plugin
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
versions = #{record.versions,jdbcType=VARCHAR},
intro = #{record.intro,jdbcType=VARCHAR},
config = #{record.config,jdbcType=VARCHAR},
publish = #{record.publish,jdbcType=TINYINT},
creator_id = #{record.creatorId,jdbcType=BIGINT},
operator = #{record.operator,jdbcType=BIGINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.ptos_open.bean.po.OpenPluginWithBLOBs">
update t_open_plugin
<set>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="versions != null">
versions = #{versions,jdbcType=VARCHAR},
</if>
<if test="intro != null">
intro = #{intro,jdbcType=VARCHAR},
</if>
<if test="config != null">
config = #{config,jdbcType=VARCHAR},
</if>
<if test="publish != null">
publish = #{publish,jdbcType=TINYINT},
</if>
<if test="creatorId != null">
creator_id = #{creatorId,jdbcType=BIGINT},
</if>
<if test="operator != null">
operator = #{operator,jdbcType=BIGINT},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
<if test="description != null">
description = #{description,jdbcType=LONGVARCHAR},
</if>
<if test="html != null">
html = #{html,jdbcType=LONGVARCHAR},
</if>
<if test="js != null">
js = #{js,jdbcType=LONGVARCHAR},
</if>
<if test="css != null">
css = #{css,jdbcType=LONGVARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.ccsens.ptos_open.bean.po.OpenPluginWithBLOBs">
update t_open_plugin
set name = #{name,jdbcType=VARCHAR},
versions = #{versions,jdbcType=VARCHAR},
intro = #{intro,jdbcType=VARCHAR},
config = #{config,jdbcType=VARCHAR},
publish = #{publish,jdbcType=TINYINT},
creator_id = #{creatorId,jdbcType=BIGINT},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT},
description = #{description,jdbcType=LONGVARCHAR},
html = #{html,jdbcType=LONGVARCHAR},
js = #{js,jdbcType=LONGVARCHAR},
css = #{css,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.ptos_open.bean.po.OpenPlugin">
update t_open_plugin
set name = #{name,jdbcType=VARCHAR},
versions = #{versions,jdbcType=VARCHAR},
intro = #{intro,jdbcType=VARCHAR},
config = #{config,jdbcType=VARCHAR},
publish = #{publish,jdbcType=TINYINT},
creator_id = #{creatorId,jdbcType=BIGINT},
operator = #{operator,jdbcType=BIGINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

6
ptos_tall/src/main/java/com/ccsens/ptos_tall/api/ProjectController.java

@ -1,5 +1,6 @@
package com.ccsens.ptos_tall.api;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.ptos_tall.bean.dto.ProjectDto;
import com.ccsens.ptos_tall.bean.vo.ProjectVo;
import com.ccsens.ptos_tall.service.IProjectService;
@ -30,6 +31,7 @@ public class ProjectController {
@Resource
private IProjectService projectService;
@MustLogin
@ApiOperation(value = "日历页获取项目列表", notes = "")
@RequestMapping(value = "/query", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ProjectVo.ProjectInfo>> queryProjectByUser(@ApiParam @Validated @RequestBody QueryDto<ProjectDto.QueryProjectDto> params) throws Exception{
@ -48,9 +50,9 @@ public class ProjectController {
@ApiOperation(value = "根据手机号获取用户在本域的业务项目列表", notes = "")
@RequestMapping(value = "/byPhone", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<List<ProjectVo.ProjectInfo>> queryProjectByPhone(@ApiParam @Validated @RequestBody QueryDto<ProjectDto.QueryProjectByPhone> params) throws Exception{
public JsonResponse<List<ProjectVo.ProjectInfo>> queryProjectByPhone(@ApiParam @Validated @RequestBody ProjectDto.QueryProjectByPhone params) throws Exception{
log.info("根据手机号获取用户在本域的业务项目列表:{}",params);
List<ProjectVo.ProjectInfo> businessInfos = projectService.queryProjectByPhone(params.getParam());
List<ProjectVo.ProjectInfo> businessInfos = projectService.queryProjectByPhone(params);
log.info("返回手机号用户的项目");
return JsonResponse.newInstance().ok(businessInfos);
}

27
ptos_tall/src/main/java/com/ccsens/ptos_tall/api/UserController.java

@ -1,19 +1,21 @@
package com.ccsens.ptos_tall.api;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.extra.servlet.ServletUtil;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.ptos_tall.bean.dto.ProjectDto;
import com.ccsens.ptos_tall.bean.dto.UserDto;
import com.ccsens.ptos_tall.bean.po.SysUser;
import com.ccsens.ptos_tall.bean.vo.ProjectVo;
import com.ccsens.ptos_tall.bean.vo.UserVo;
import com.ccsens.ptos_tall.service.IUserService;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.JwtUtil;
import com.ccsens.util.WebConstant;
import com.ccsens.util.bean.dto.QueryDto;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@ -38,14 +40,13 @@ public class UserController {
@RequestMapping(value = "/signin", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.TokenBean> userSignin(HttpServletRequest request, @ApiParam @Validated @RequestBody UserDto.SigninDto params) throws Exception{
log.info("登录:{}",params);
// String deviceId = request.getHeader("deviceId");
UserVo.TokenBean tokenBean = userService.userSignin(params,"", ServletUtil.getClientIP(request));
UserVo.TokenBean tokenBean = userService.userSignin(params,request.getHeader("deviceId"), ServletUtil.getClientIP(request));
log.info("返回用户信息");
return JsonResponse.newInstance().ok(tokenBean,tokenBean.getToken(),tokenBean.getRefreshToken());
}
@ApiOperation(value = "根据token换取用户信息", notes = "")
@RequestMapping(value = "/token", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
@RequestMapping(value = "/businessToken", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.BusinessUserInfo> userByBusinessToken(HttpServletRequest request, @ApiParam @Validated @RequestBody UserDto.BusinessToken params) throws Exception{
log.info("根据token换取用户信息:{}",params);
UserVo.BusinessUserInfo userInfo = userService.userByBusinessToken(params);
@ -70,4 +71,16 @@ public class UserController {
UserVo.VerificationCode vertifyCode = userService.getVertifyCode();
return JsonResponse.newInstance().ok(vertifyCode);
}
@ApiOperation(value = "根据token/deviceId获取用户信息",notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name="token",value = "token",required = true,paramType = "query")
})
@RequestMapping(value = "token",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.TokenToUserId> getUserByToken(@ApiParam @Validated @RequestBody UserDto.UserInfoByToken params) throws Exception {
log.info("MustLogin根据token查找用户信息:{}",params);
UserVo.TokenToUserId tokenToUserId = userService.getUserByToken(params);
return JsonResponse.newInstance().ok(tokenToUserId);
}
}

24
ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/dto/UserDto.java

@ -48,4 +48,28 @@ public class UserDto {
private String secret;
}
@Data
@ApiModel("通过token获取用户信息")
public static class UserInfoByToken{
@ApiModelProperty("token")
private String token;
@ApiModelProperty("设备id")
private String deviceId;
@ApiModelProperty("ip地址")
private String clientIp;
@ApiModelProperty("客户端类型 0-H5 1-App")
private Byte clientType;
public UserInfoByToken() {
}
public UserInfoByToken(String token, String deviceId, String clientIp, byte clientType) {
this.token = token;
this.deviceId = deviceId;
this.clientIp = clientIp;
this.clientType = clientType;
}
}
}

20
ptos_tall/src/main/java/com/ccsens/ptos_tall/bean/vo/UserVo.java

@ -59,4 +59,24 @@ public class UserVo {
@ApiModelProperty("图片的Base64字符串")
private String imageBase64;
}
@Data
@ApiModel("根据token获取用户信息")
public static class TokenToUserId{
@ApiModelProperty("用户id")
private Long id;
@ApiModelProperty("用户名")
private String userName;
@ApiModelProperty("头像")
private String avatarUrl;
@ApiModelProperty("手机号")
private String phone;
@ApiModelProperty("用户类型 0未认证 1已认证")
private byte authType;
@ApiModelProperty("token")
private String token;
@ApiModelProperty("刷新token")
private String refreshToken;
}
}

8
ptos_tall/src/main/java/com/ccsens/ptos_tall/persist/dao/SysUserDao.java

@ -1,9 +1,17 @@
package com.ccsens.ptos_tall.persist.dao;
import com.ccsens.ptos_tall.bean.po.SysUser;
import com.ccsens.ptos_tall.persist.mapper.SysUserMapper;
import org.apache.ibatis.annotations.Param;
/**
* @author
*/
public interface SysUserDao extends SysUserMapper {
/**
* 通过设备id获取关联的临时用户
* @param deviceId 设备id
* @return 返回用户信息
*/
SysUser getVisitorUser(@Param("deviceId") String deviceId);
}

14
ptos_tall/src/main/java/com/ccsens/ptos_tall/service/IUserService.java

@ -3,6 +3,8 @@ package com.ccsens.ptos_tall.service;
import com.ccsens.ptos_tall.bean.dto.UserDto;
import com.ccsens.ptos_tall.bean.vo.UserVo;
import java.util.Map;
/**
* @author
*/
@ -36,4 +38,16 @@ public interface IUserService {
* @return 返回base64图片
*/
UserVo.VerificationCode getVertifyCode();
/**
* 根据token或deviceId获取用户信息
* @param params token等信息
* @return 返回用户信息
*/
UserVo.TokenToUserId getUserByToken(UserDto.UserInfoByToken params);
/**
* 生成token
*/
UserVo.TokenBean generateToken(Object subject, Map<String, Object> payLoads);
}

67
ptos_tall/src/main/java/com/ccsens/ptos_tall/service/ProjectService.java

@ -1,20 +1,25 @@
package com.ccsens.ptos_tall.service;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.ptos_tall.bean.dto.DomainDto;
import com.ccsens.cloudutil.bean.ptos.dto.FeignProjectDto;
import com.ccsens.cloudutil.bean.ptos.vo.FeignProjectVo;
import com.ccsens.cloudutil.feign.DiplomatistFeignClient;
import com.ccsens.ptos_tall.bean.dto.ProjectDto;
import com.ccsens.ptos_tall.bean.po.IdcDomain;
import com.ccsens.ptos_tall.bean.po.SysAuth;
import com.ccsens.ptos_tall.bean.po.SysBusiness;
import com.ccsens.ptos_tall.bean.po.SysBusinessExample;
import com.ccsens.ptos_tall.bean.vo.ProjectVo;
import com.ccsens.ptos_tall.bean.vo.UserVo;
import com.ccsens.ptos_tall.persist.dao.IdcDomainDao;
import com.ccsens.ptos_tall.persist.dao.SysAuthDao;
import com.ccsens.ptos_tall.persist.mapper.SysBusinessMapper;
import com.ccsens.ptos_tall.util.PtOsConstant;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.RestTemplateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -22,9 +27,7 @@ import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author
@ -36,55 +39,33 @@ public class ProjectService implements IProjectService {
@Resource
private SysBusinessMapper businessMapper;
@Resource
private IdcDomainDao domainDao;
private DiplomatistFeignClient diplomatistFeignClient;
@Resource
private SysAuthDao sysAuthDao;
@Resource
private IUserService userService;
@Override
public List<ProjectVo.ProjectInfo> queryProjectByUser(String phone, ProjectDto.QueryProjectDto param, Long userId) {
List<ProjectVo.ProjectInfo> projectInfoList = new ArrayList<>();
//访问传达室,请求该用户在其他域的项目信息
ProjectDto.QueryProjectByPhone queryProjectByPhone = new ProjectDto.QueryProjectByPhone();
FeignProjectDto.QueryProjectByPhone queryProjectByPhone = new FeignProjectDto.QueryProjectByPhone();
queryProjectByPhone.setStartTime(param.getStartTime());
queryProjectByPhone.setEndTime(param.getEndTime());
queryProjectByPhone.setPhone(new ArrayList<>(Collections.singleton(phone)));
JsonResponse<List<FeignProjectVo.ProjectInfo>> response = diplomatistFeignClient.queryDomainProject(queryProjectByPhone);
DomainDto.TallToOtherDomain tallToOtherDomain = new DomainDto.TallToOtherDomain();
tallToOtherDomain.setUrl("/project/byPhone");
tallToOtherDomain.setParam(JSON.toJSONString(queryProjectByPhone));
//发送到本域的传达室
//查询自身域信息
IdcDomain selfDomains = domainDao.getOneself();
if(ObjectUtil.isNotNull(selfDomains)) {
String domainUrl = selfDomains.getUrl() + "/domain/tallToIdc";
log.info("调用接口:{}--", domainUrl);
JSONObject jsonObject = null;
try {
String postBody = RestTemplateUtil.postBody(domainUrl, param);
jsonObject = JSONObject.parseObject(postBody);
}catch (Exception e){
log.error("调用传达室异常", e);
}
log.info("接口返回:{}", jsonObject);
//请求正确返回则修改最后应答时间,否则无操作
if(jsonObject != null){
Integer code = jsonObject.getInteger("code");
if (code != null && code == 200) {
JSONArray data = jsonObject.getJSONArray("data");
if(CollectionUtil.isNotEmpty(data)){
for (Object object : data) {
ProjectVo.ProjectInfo projectInfo;
try {
JSONObject object1 = (JSONObject) object;
projectInfo = object1.toJavaObject(ProjectVo.ProjectInfo.class);
if (response != null && response.getCode() == 200) {
if(CollectionUtil.isNotEmpty(response.getData())){
response.getData().forEach(project -> {
ProjectVo.ProjectInfo projectInfo = new ProjectVo.ProjectInfo();
BeanUtil.copyProperties(project,projectInfo);
projectInfoList.add(projectInfo);
}catch (Exception e){
log.error("项目转换失败"+e);
}
}
}
}
});
}
}
//查询本域所有在线的业务信息
Long lastAnswerTime = System.currentTimeMillis() - PtOsConstant.LAST_ANSWER_TIME;
SysBusinessExample businessExample = new SysBusinessExample();
@ -142,7 +123,11 @@ public class ProjectService implements IProjectService {
@Override
public List<ProjectVo.ProjectInfo> queryProjectByPhone(ProjectDto.QueryProjectByPhone param) {
//根据手机号查询用户信息
SysAuth sysAuth = sysAuthDao.getByPhone(param.getPhone().get(0));
//生成token
Map<String, Object> theMap = CollectionUtil.newHashMap();
theMap.put("authId", String.valueOf(sysAuth.getId()));
UserVo.TokenBean tokenBean = userService.generateToken(sysAuth.getUserId(), theMap);
//查找所有在线的业务
//遍历业务
//查询用户在业务内的项目信息(带token过去)

144
ptos_tall/src/main/java/com/ccsens/ptos_tall/service/UserService.java

@ -13,10 +13,12 @@ import com.ccsens.ptos_tall.persist.dao.SysUserDao;
import com.ccsens.ptos_tall.persist.mapper.SysSigninLogMapper;
import com.ccsens.ptos_tall.persist.mapper.SysUserDeviceMapper;
import com.ccsens.ptos_tall.util.PtOsCodeError;
import com.ccsens.ptos_tall.util.PtOsConstant;
import com.ccsens.util.*;
import com.ccsens.util.bean.wx.po.WxOauth2UserInfo;
import com.ccsens.util.exception.BaseException;
import com.ccsens.util.wx.WxGzhUtil;
import io.jsonwebtoken.Claims;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
@ -50,6 +52,9 @@ public class UserService implements IUserService {
@Override
public UserVo.TokenBean userSignin(UserDto.SigninDto params, String deviceId, String clientIp) {
if(StrUtil.isBlank(deviceId)){
throw new BaseException(PtOsCodeError.ILLEGAL_LOG_IN);
}
//验证客户端类型
switch (params.getClient()) {
case 0:
@ -90,7 +95,7 @@ public class UserService implements IUserService {
//更新用户设备关联信息
saveUserDevice(userSign.getUserId(),deviceId,params.getClient());
//添加登录记录
saveSigninLog(userSign,deviceId,params.getClient(),clientIp);
saveSigninLog(userSign.getUserId(), userSign.getAuthId(),deviceId,params.getClient().byteValue(),clientIp);
//生成token
Map<String, Object> theMap = CollectionUtil.newHashMap();
@ -99,7 +104,6 @@ public class UserService implements IUserService {
tokenBean.setId(userSign.getUserId());
if(ObjectUtil.isNull(phone)){
//TODO 获取手机号
phone = sysAuthDao.getPhoneByUserId(userSign.getUserId());
}
tokenBean.setPhone(phone);
@ -109,7 +113,8 @@ public class UserService implements IUserService {
/**
* 获取token
*/
private UserVo.TokenBean generateToken(Object subject, Map<String, Object> payLoads) {
@Override
public UserVo.TokenBean generateToken(Object subject, Map<String, Object> payLoads) {
UserVo.TokenBean tokenBean = new UserVo.TokenBean();
//生成过期时间
long tokenExpired = 3600 * 1000L * 2;
@ -132,14 +137,14 @@ public class UserService implements IUserService {
/**
* 添加登录记录
*/
private void saveSigninLog(UserVo.UserSign userSign, String deviceId, Integer client, String clientIp) {
private void saveSigninLog(Long userId, Long authId, String deviceId, Byte client, String clientIp) {
SysSigninLog sysSigninLog = new SysSigninLog();
sysSigninLog.setId(snowflake.nextId());
sysSigninLog.setUserId(userSign.getUserId());
sysSigninLog.setAuthId(userSign.getAuthId());
sysSigninLog.setUserId(userId);
sysSigninLog.setAuthId(authId);
sysSigninLog.setTime(System.currentTimeMillis());
sysSigninLog.setDeviceId(deviceId);
sysSigninLog.setClientType(client.byteValue());
sysSigninLog.setClientType(client);
sysSigninLog.setIpAddress(clientIp);
sysSigninLogMapper.insertSelective(sysSigninLog);
}
@ -180,7 +185,7 @@ public class UserService implements IUserService {
//1.查找对应账户,不存在则注册
SysAuth theAuth = sysAuthDao.getByPhone(phone);
if (ObjectUtil.isNull(theAuth)) {
theAuth = saveUser(phone, null, WebConstant.IDENTIFY_TYPE.Phone,deviceId);
theAuth = saveUser(phone, deviceId);
}
//返回用户id和认证id
userSignVo = new UserVo.UserSign();
@ -222,10 +227,6 @@ public class UserService implements IUserService {
theAuth = new SysAuth();
theAuth.setId(snowflake.nextId());
theAuth.setUserId(sysAuthList.get(0).getUserId());
theAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.OAUTH2_Wx.value);
theAuth.setIdentifier(wxOauth2UserInfo.getOpenId());
theAuth.setCredential(wxOauth2UserInfo.getUnionId());
sysAuthDao.insertSelective(theAuth);
} else {
//新建用户并保存微信信息
SysUser user = new SysUser();
@ -241,12 +242,12 @@ public class UserService implements IUserService {
theAuth = new SysAuth();
theAuth.setId(snowflake.nextId());
theAuth.setUserId(user.getId());
}
theAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.OAUTH2_Wx.value);
theAuth.setIdentifier(wxOauth2UserInfo.getOpenId());
theAuth.setCredential(wxOauth2UserInfo.getUnionId());
sysAuthDao.insertSelective(theAuth);
}
}
//2.返回
userSignVo = new UserVo.UserSign();
userSignVo.setUserId(theAuth.getUserId());
@ -257,10 +258,10 @@ public class UserService implements IUserService {
/**
* 添加用户和认证方式
* 添加用户和手机号认证方式
* @return 认证信息
*/
private SysAuth saveUser(String identifier, String credential, WebConstant.IDENTIFY_TYPE identifyType, String deviceId) {
private SysAuth saveUser(String identifier, String deviceId) {
//1.添加user
SysUser user = new SysUser();
user.setId(snowflake.nextId());
@ -271,9 +272,9 @@ public class UserService implements IUserService {
SysAuth auth = new SysAuth();
auth.setId(snowflake.nextId());
auth.setUserId(user.getId());
auth.setIdentifyType((byte) identifyType.value);
auth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.Phone.value);
auth.setIdentifier(identifier);
auth.setCredential(credential);
auth.setCredential(null);
sysAuthDao.insertSelective(auth);
return auth;
}
@ -291,22 +292,6 @@ public class UserService implements IUserService {
return correct;
}
/**
* 通过用户查找手机号
* @param userId userId
* @return 手机号
*/
public String getPhone(Long userId) {
SysAuthExample authExample = new SysAuthExample();
authExample.createCriteria().andUserIdEqualTo(userId).andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value);
List<SysAuth> sysAuthList = sysAuthDao.selectByExample(authExample);
if (CollectionUtil.isNotEmpty(sysAuthList)) {
return sysAuthList.get(0).getIdentifier();
} else {
return null;
}
}
@Override
public UserVo.SmsCode getSignInSmsCode(String phone, String verificationCodeId, String verificationCodeValue) {
//检查图形验证码是否正确
@ -335,7 +320,7 @@ public class UserService implements IUserService {
}
//测试环境默认发送1111
String verifyCode = "1111";
if ("1".equalsIgnoreCase(PropUtil.smsCode)) {
if (PtOsConstant.SMS_CODE.equalsIgnoreCase(PropUtil.smsCode)) {
verifyCode = RandomUtil.randomNumbers(4);
}
//3.保存到redis中
@ -345,7 +330,7 @@ public class UserService implements IUserService {
redisUtil.set(RedisKeyManager.getSigninSmsExistKey(phone), verifyCode, codeExistInSeconds);
//5.发送验证码
if ("1".equalsIgnoreCase(PropUtil.smsCode)) {
if (PtOsConstant.SMS_CODE.equalsIgnoreCase(PropUtil.smsCode)) {
SmsUtil.sendSms(phone, verifyCode, "", codeValidInSeconds);
}
//6.返回
@ -374,6 +359,95 @@ public class UserService implements IUserService {
return vertifyCode;
}
@Override
public UserVo.TokenToUserId getUserByToken(UserDto.UserInfoByToken params) {
UserVo.TokenToUserId userInfo;
if(StrUtil.isNotBlank(params.getToken())){
//根据token获取userId
userInfo = getUserByToken(params.getToken());
}else {
//根据deviceId获取userId
userInfo = getUserByDeviceId(params);
}
return userInfo;
}
/**
* 根据token获取用户信息
* @param token token
*/
private UserVo.TokenToUserId getUserByToken(String token) {
UserVo.TokenToUserId userInfo = new UserVo.TokenToUserId();
//如果token不为空,获取用户信息
if (!token.startsWith(WebConstant.HEADER_KEY_TOKEN_PREFIX)) {
log.info("token不存在:{}",token);
throw new BaseException(CodeEnum.NOT_LOGIN);
}
String userToken = token.substring(WebConstant.HEADER_KEY_TOKEN_PREFIX.length());
//验证token是否有效
Claims claims;
try {
claims = JwtUtil.parseJWT(userToken, WebConstant.JWT_ACCESS_TOKEN_SECERT);
}catch(Exception e){
log.info("token无效");
throw new BaseException(CodeEnum.NOT_LOGIN);
}
//验证用户存根
if(!redisUtil.hasKey(RedisKeyManager.getTokenCachedKey(Long.valueOf(claims.getSubject())))){
log.info("用户存根不存在:{}",claims.getSubject());
throw new BaseException(CodeEnum.NOT_LOGIN);
}
userInfo.setId(Long.valueOf(claims.getSubject()));
//获取用户信息
SysUser sysUser = sysUserDao.selectByPrimaryKey(Long.valueOf(claims.getSubject()));
if(ObjectUtil.isNotNull(sysUser)){
userInfo.setAvatarUrl(sysUser.getAvatarUrl());
userInfo.setUserName(sysUser.getName());
userInfo.setAuthType(sysUser.getAuthType());
}
//查找手机号
userInfo.setPhone(sysAuthDao.getPhoneByUserId(Long.valueOf(claims.getSubject())));
return userInfo;
}
/**
* 根据deviceId获取userId
* @param params 设备id等
*/
private UserVo.TokenToUserId getUserByDeviceId(UserDto.UserInfoByToken params) {
UserVo.TokenToUserId userInfo = new UserVo.TokenToUserId();
//如果token为空,则用deviceId获取用户信息
if(StrUtil.isBlank(params.getDeviceId())){
throw new BaseException(PtOsCodeError.ILLEGAL_LOG_IN);
}
//查找deviceId关联的临时用户
SysUser sysUser = sysUserDao.getVisitorUser(params.getDeviceId());
if(ObjectUtil.isNotNull(sysUser)){
userInfo.setId(sysUser.getId());
userInfo.setAvatarUrl(sysUser.getAvatarUrl());
userInfo.setUserName(sysUser.getName());
}else {
//以前没有关联用户则新建一个
sysUser = new SysUser();
sysUser.setId(snowflake.nextId());
sysUser.setDeviceId(params.getDeviceId());
sysUser.setAuthType((byte) 0);
sysUserDao.insertSelective(sysUser);
userInfo.setId(sysUser.getId());
}
userInfo.setAuthType(sysUser.getAuthType());
//添加登录记录
saveSigninLog(sysUser.getId(), 0L,params.getDeviceId(), params.getClientType(),params.getClientIp());
//重新生成token
Map<String, Object> theMap = CollectionUtil.newHashMap();
theMap.put("authId", String.valueOf(0L));
UserVo.TokenBean tokenBean = generateToken(sysUser.getId(), theMap);
userInfo.setToken(tokenBean.getToken());
userInfo.setRefreshToken(tokenBean.getRefreshToken());
return userInfo;
}
@Override
public UserVo.BusinessUserInfo userByBusinessToken(UserDto.BusinessToken params) {
//验证业务的appId和secret

1
ptos_tall/src/main/java/com/ccsens/ptos_tall/util/PtOsCodeError.java

@ -7,6 +7,7 @@ import com.ccsens.util.CodeError;
*/
public class PtOsCodeError extends CodeError {
public static final Code ILLEGAL_LOG_IN = new Code(401,"非法登录",true);
public static final Code CLIENT_ERROR = new Code(501,"客户端类型异常",true);
public static final Code SIGNIN_TYPE_ERROR = new Code(502,"登录类型异常",true);
public static final Code NOT_PHONE = new Code(503,"手机号不能为空",true);

3
ptos_tall/src/main/java/com/ccsens/ptos_tall/util/PtOsConstant.java

@ -11,6 +11,9 @@ public class PtOsConstant {
/**业务离线时间*/
public static final Long LAST_ANSWER_TIME = 21 * 60 * 1000L;
/**是否发送验证码 0不发送 1发送*/
public static final String SMS_CODE = "1";
/**图片类型*/
public static final String FILE_TYPE_IMG = "bmp,jpg,jpeg,png,tif,gif,pcx,tga,exif,fpx,svg,psd,cdr,pcd,dxf,ufo,eps,ai,raw,WMF,webp";
/**文档类型*/

1
ptos_tall/src/main/resources/application-dev.yml

@ -44,6 +44,7 @@ mybatisCache:
port: 6379
timeout: 1000
smsCode: 0
file:
path: /home/ptos_tall/server//uploads/
domain: https://test.tall.wiki/gateway/ptostall

1
ptos_tall/src/main/resources/application-prod.yml

@ -34,6 +34,7 @@ eureka:
gatewayUrl: https://www.tall.wiki/gateway/
notGatewayUrl: https://www.tall.wiki/
apiUrl: https://www.tall.wiki/
smsCode: 0
file:
path: /home/ptos_tall/server//uploads/
domain: https://www.tall.wiki/gateway/ptos_tall

1
ptos_tall/src/main/resources/application-test.yml

@ -42,6 +42,7 @@ eureka:
instance:
ip-address: 127.0.0.1
smsCode: 0
file:
path: /home/ptos_tall/server//uploads/
domain: https://test.tall.wiki/gateway/ptos_tall

10
ptos_tall/src/main/resources/mapper_dao/SysUserDao.xml

@ -2,4 +2,14 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.ptos_tall.persist.dao.SysUserDao">
<select id="getVisitorUser" resultType="com.ccsens.ptos_tall.bean.po.SysUser">
SELECT
*
FROM
t_sys_user
WHERE
device_id = #{deviceId}
and auth_type = 0
and rec_status = 0
</select>
</mapper>

13
util/src/main/java/com/ccsens/util/JsonResponse.java

@ -51,6 +51,11 @@ public class JsonResponse<T> {
@ApiModelProperty(value = "token信息")
private TokenObj tokenObj = new TokenObj();
public void setTokenObj(String token, String refreshToken) {
this.tokenObj.setToken(token);
this.tokenObj.setRefreshToken(refreshToken);
}
@Data
@ApiModel("token信息")
public static class TokenObj{
@ -58,6 +63,14 @@ public class JsonResponse<T> {
private String token;
@ApiModelProperty(value = "refreshToken")
private String refreshToken;
// public TokenObj(String token, String refreshToken) {
// this.token = token;
// this.refreshToken = refreshToken;
// }
// public TokenObj() {
// }
}
public static class MD5Status{

9
util/src/main/java/com/ccsens/util/bean/dto/QueryDto.java

@ -26,4 +26,13 @@ public class QueryDto<T> {
private String avatarUrl;
@ApiModelProperty("手机号")
private String phone;
@ApiModelProperty("用户类型 0未认证 1已认证")
private Byte authType;
@ApiModelProperty("设备id")
private String deviceId;
@ApiModelProperty("客户端类型")
private Byte clientType;
@ApiModelProperty("ip地址")
private String clientIp;
}

16
wechatutil/src/main/java/com/ccsens/wechatutil/wxofficial/OfficialAccountMessageUtil.java

@ -1,36 +1,20 @@
package com.ccsens.wechatutil.wxofficial;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.cloudutil.bean.tall.vo.UserVo;
import com.ccsens.util.*;
import com.ccsens.util.annotation.OperateType;
import com.ccsens.util.bean.message.common.InMessage;
import com.ccsens.util.bean.message.common.MessageConstant;
import com.ccsens.util.config.RabbitMQConfig;
import com.ccsens.util.exception.BaseException;
import com.ccsens.util.wx.WxGzhUtil;
import com.ccsens.wechatutil.bean.dto.WxTemplateMessage;
import com.ccsens.wechatutil.bean.po.WxBaseEntity;
import com.ccsens.wechatutil.bean.po.WxOauth2UserInfo;
import com.ccsens.wechatutil.util.WxCodeError;
import com.ccsens.wechatutil.util.WxConstant;
import com.ccsens.wechatutil.wxcommon.WxCommonUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author

Loading…
Cancel
Save