提交代码
parent
9c1d0b36cf
commit
5023f645c9
|
@ -0,0 +1,78 @@
|
||||||
|
package com.ruoyi.api.base;
|
||||||
|
|
||||||
|
import com.ruoyi.common.utils.AuthRsaUtils;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.common.utils.sign.Md5Utils;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取系统token 请求参数
|
||||||
|
*
|
||||||
|
* @author: JiangYuQi
|
||||||
|
* @date: 2024/01/13 10:17
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Slf4j
|
||||||
|
public class PubTokenReqVo {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AppId
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "AppId不能为空")
|
||||||
|
@Size(min = 1, max = 64, message = "AppId格式异常")
|
||||||
|
private String appId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 签名
|
||||||
|
* RSA(用户账号 + 时间戳)加密
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "签名不能为空")
|
||||||
|
private String sign;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 时间戳
|
||||||
|
*/
|
||||||
|
@NotNull(message = "时间戳不能为空")
|
||||||
|
private Long timestamp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取登录签名
|
||||||
|
*
|
||||||
|
* @author: JiangYuQi
|
||||||
|
* @date: 2024/01/13 10:17
|
||||||
|
*/
|
||||||
|
public Boolean getLoginSign(String privateKey) {
|
||||||
|
boolean signFlag = false;
|
||||||
|
try {
|
||||||
|
System.out.println("appId=>>>"+appId);
|
||||||
|
System.out.println("privateKey=>>>"+privateKey);
|
||||||
|
System.out.println("timestamp=>>>"+timestamp);
|
||||||
|
String key = Md5Utils.hash(appId + privateKey + timestamp);
|
||||||
|
System.out.println("key=>>>"+key);
|
||||||
|
System.out.println("sign=>>>"+sign);
|
||||||
|
if (StringUtils.equals(sign, key)) {
|
||||||
|
signFlag = true;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
|
return signFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 效验时间签名[3分钟有效期]
|
||||||
|
*/
|
||||||
|
public Boolean checkTimestamp() {
|
||||||
|
boolean timestampFlag = false;
|
||||||
|
long timePoor = Math.abs(timestamp - System.currentTimeMillis());
|
||||||
|
if (timePoor < 1000 * 60 * 3) {
|
||||||
|
timestampFlag = true;
|
||||||
|
}
|
||||||
|
return timestampFlag;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,5 @@
|
||||||
package com.ruoyi.api.base;
|
package com.ruoyi.api.base;
|
||||||
|
|
||||||
import com.ruoyi.common.enums.HttpStatusEnum;
|
|
||||||
import com.ruoyi.common.exception.ServiceException;
|
|
||||||
import com.ruoyi.common.utils.AuthRsaUtils;
|
import com.ruoyi.common.utils.AuthRsaUtils;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
|
@ -0,0 +1,173 @@
|
||||||
|
package com.ruoyi.api.labour.controller;
|
||||||
|
|
||||||
|
import com.ruoyi.api.base.PubTokenReqVo;
|
||||||
|
import com.ruoyi.api.labour.domain.AiBoxApiReqVo;
|
||||||
|
import com.ruoyi.common.annotation.Anonymous;
|
||||||
|
import com.ruoyi.common.annotation.RateLimiter;
|
||||||
|
import com.ruoyi.common.config.RuoYiConfig;
|
||||||
|
import com.ruoyi.common.constant.CacheConstants;
|
||||||
|
import com.ruoyi.common.core.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||||
|
import com.ruoyi.common.core.page.TableDataInfo;
|
||||||
|
import com.ruoyi.common.core.redis.RedisCache;
|
||||||
|
import com.ruoyi.common.core.text.Convert;
|
||||||
|
import com.ruoyi.common.enums.*;
|
||||||
|
import com.ruoyi.common.exception.ServiceException;
|
||||||
|
import com.ruoyi.common.utils.SecurityUtils;
|
||||||
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
|
import com.ruoyi.framework.web.service.SysLoginService;
|
||||||
|
import com.ruoyi.system.domain.SysApplyConfig;
|
||||||
|
import com.ruoyi.system.service.ISysUserService;
|
||||||
|
import com.yanzhu.jh.video.domain.DevAiProjectData;
|
||||||
|
import com.yanzhu.jh.video.service.IDevAiProjectDataService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ai预警APIController
|
||||||
|
*
|
||||||
|
* @author JiangYuQi
|
||||||
|
* @date 2024-01-13
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/aiboxs")
|
||||||
|
public class AiBoxApiController extends BaseController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedisCache redisCache;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService userService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysLoginService loginService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDevAiProjectDataService devAiProjectDataService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取系统token
|
||||||
|
* 限流规则[60秒内最多请求10次,限流策略IP]
|
||||||
|
* @param req 请求信息
|
||||||
|
* @author JiangYuQi
|
||||||
|
* @date 2024-01-13
|
||||||
|
*/
|
||||||
|
@Anonymous
|
||||||
|
@ApiOperation(value = "获取TOKEN")
|
||||||
|
@RateLimiter(count = 10, limitType = LimitType.IP)
|
||||||
|
@PostMapping("/v1/getToken")
|
||||||
|
public AjaxResult getToken(@Validated @RequestBody PubTokenReqVo req) {
|
||||||
|
SysApplyConfig sysApplyConfig = redisCache.getCacheObject(CacheConstants.YANZHU_SYSTEM_CONFIG+req.getAppId());
|
||||||
|
if(sysApplyConfig==null){
|
||||||
|
throw new ServiceException(HttpStatusEnum.ERROR.getInfo(),HttpStatusEnum.ERROR.getCode());
|
||||||
|
}
|
||||||
|
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
||||||
|
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
||||||
|
}
|
||||||
|
if(!Objects.equals(ApplyCfgTypeEnum.AIBOXS.getCode(),sysApplyConfig.getCfgType())){
|
||||||
|
throw new ServiceException(HttpStatusEnum.ERROR.getInfo(),HttpStatusEnum.ERROR.getCode());
|
||||||
|
}
|
||||||
|
if(!req.checkTimestamp()){
|
||||||
|
throw new ServiceException(HttpStatusEnum.SINGET_TIMEOUT.getInfo(),HttpStatusEnum.SINGET_TIMEOUT.getCode());
|
||||||
|
}
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
String Authorization = "";
|
||||||
|
if (req.getLoginSign(sysApplyConfig.getPublicKey())) {
|
||||||
|
String key = "api.aiboxs.getToken:"+req.getAppId();
|
||||||
|
String obj = redisCache.getCacheObject(key);
|
||||||
|
if(StringUtils.isNotEmpty(obj)){
|
||||||
|
ajax.put("Authorization", obj);
|
||||||
|
}else{
|
||||||
|
Authorization = this.getAppIdLoginToken(req.getAppId(),sysApplyConfig);
|
||||||
|
ajax.put("Authorization", Authorization);
|
||||||
|
redisCache.setCacheObject(key,Authorization,30, TimeUnit.MINUTES);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
throw new ServiceException(HttpStatusEnum.SINGET_ERROR.getInfo(),HttpStatusEnum.SINGET_ERROR.getCode());
|
||||||
|
}
|
||||||
|
return ajax;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* appId登录创建用户并模拟登录
|
||||||
|
*
|
||||||
|
* @param appId 用户账号
|
||||||
|
* @return token
|
||||||
|
*/
|
||||||
|
private String getAppIdLoginToken(String appId,SysApplyConfig sysApplyConfig) {
|
||||||
|
// 查询用户是否存在,不存在则保存
|
||||||
|
SysUser sysUser = userService.selectUserByUserName(appId);
|
||||||
|
String password = Convert.toStr(System.currentTimeMillis());
|
||||||
|
if (sysUser == null) {
|
||||||
|
sysUser = new SysUser();
|
||||||
|
sysUser.setDeptId(sysApplyConfig.getDeptId());
|
||||||
|
sysUser.setUserName(Convert.toStr(sysApplyConfig.getAppId()));
|
||||||
|
sysUser.setNickName(Convert.toStr(sysApplyConfig.getAppId()));
|
||||||
|
sysUser.setUserType(UserTypeEnum.APPLY.getCode());
|
||||||
|
sysUser.setStatus("0");
|
||||||
|
sysUser.setCreateBy("AppId登录创建用户");
|
||||||
|
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
||||||
|
userService.insertUser(sysUser);
|
||||||
|
} else {
|
||||||
|
sysUser.setPassword(SecurityUtils.encryptPassword(password));
|
||||||
|
sysUser.setUpdateBy("AppId登录更新用户密码");
|
||||||
|
userService.updateUser(sysUser);
|
||||||
|
}
|
||||||
|
return loginService.unifiedLogin(appId, password);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取视频预警信息
|
||||||
|
* 限流规则[60秒内最多请求10次,限流策略IP]
|
||||||
|
* @param req 请求信息
|
||||||
|
* @author JiangYuQi
|
||||||
|
* @date 2024-01-13
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "获取视频预警信息")
|
||||||
|
@RateLimiter(time = 10, limitType = LimitType.IP)
|
||||||
|
@GetMapping("/v1/list")
|
||||||
|
public TableDataInfo list(AiBoxApiReqVo req) {
|
||||||
|
SysApplyConfig sysApplyConfig = redisCache.getCacheObject(CacheConstants.YANZHU_SYSTEM_CONFIG+super.getUsername());
|
||||||
|
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
||||||
|
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
||||||
|
}
|
||||||
|
if(!Objects.equals(ApplyCfgTypeEnum.AIBOXS.getCode(),sysApplyConfig.getCfgType())){
|
||||||
|
throw new ServiceException(HttpStatusEnum.ERROR.getInfo(),HttpStatusEnum.ERROR.getCode());
|
||||||
|
}
|
||||||
|
DevAiProjectData query = new DevAiProjectData();
|
||||||
|
query.setDeptId(sysApplyConfig.getDeptId());
|
||||||
|
query.setProjectId(sysApplyConfig.getProjectId());
|
||||||
|
Map<String, Object> params = new HashMap<>();
|
||||||
|
if(Objects.nonNull(req.getBeginTimestamp()) && Objects.nonNull(req.getEndTimestamp())){
|
||||||
|
Date beginTime = new Date(req.getBeginTimestamp());
|
||||||
|
params.put("beginTime",beginTime);
|
||||||
|
Date endTime = new Date(req.getEndTimestamp());
|
||||||
|
params.put("endTime",endTime);
|
||||||
|
}else{
|
||||||
|
if(Objects.nonNull(req.getBeginTimestamp())){
|
||||||
|
Date beginTime = new Date(req.getBeginTimestamp());
|
||||||
|
params.put("beginDate",beginTime);
|
||||||
|
}
|
||||||
|
if(Objects.nonNull(req.getEndTimestamp())){
|
||||||
|
Date endTime = new Date(req.getEndTimestamp());
|
||||||
|
params.put("endDate",endTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
query.setParams(params);
|
||||||
|
startPage();
|
||||||
|
List<DevAiProjectData> list = devAiProjectDataService.selectDevAiProjectDataList(query);
|
||||||
|
for(DevAiProjectData item:list){
|
||||||
|
item.setImageUrl(RuoYiConfig.getProjectUrl()+item.getImageUrl());
|
||||||
|
item.setMinImage(item.getImageUrl()+".min.jpg");
|
||||||
|
}
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
}
|
|
@ -108,11 +108,14 @@ public class LabourApiController extends BaseController {
|
||||||
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
||||||
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
||||||
}
|
}
|
||||||
AjaxResult ajax = AjaxResult.success();
|
if(!Objects.equals(ApplyCfgTypeEnum.LABOUR.getCode(),sysApplyConfig.getCfgType())){
|
||||||
String Authorization = "";
|
throw new ServiceException(HttpStatusEnum.ERROR.getInfo(),HttpStatusEnum.ERROR.getCode());
|
||||||
|
}
|
||||||
if(!req.checkTimestamp()){
|
if(!req.checkTimestamp()){
|
||||||
throw new ServiceException(HttpStatusEnum.SINGET_TIMEOUT.getInfo(),HttpStatusEnum.SINGET_TIMEOUT.getCode());
|
throw new ServiceException(HttpStatusEnum.SINGET_TIMEOUT.getInfo(),HttpStatusEnum.SINGET_TIMEOUT.getCode());
|
||||||
}
|
}
|
||||||
|
AjaxResult ajax = AjaxResult.success();
|
||||||
|
String Authorization = "";
|
||||||
if (req.getLoginSign(sysApplyConfig.getPrivateKey())) {
|
if (req.getLoginSign(sysApplyConfig.getPrivateKey())) {
|
||||||
String key = "api.labour.getToken:"+req.getAppId();
|
String key = "api.labour.getToken:"+req.getAppId();
|
||||||
String obj = redisCache.getCacheObject(key);
|
String obj = redisCache.getCacheObject(key);
|
||||||
|
@ -121,7 +124,7 @@ public class LabourApiController extends BaseController {
|
||||||
}else{
|
}else{
|
||||||
Authorization = this.getAppIdLoginToken(req.getAppId(),sysApplyConfig);
|
Authorization = this.getAppIdLoginToken(req.getAppId(),sysApplyConfig);
|
||||||
ajax.put("Authorization", Authorization);
|
ajax.put("Authorization", Authorization);
|
||||||
redisCache.setCacheObject(key,Authorization,28, TimeUnit.SECONDS);
|
redisCache.setCacheObject(key,Authorization,30, TimeUnit.MINUTES);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new ServiceException(HttpStatusEnum.SINGET_ERROR.getInfo(),HttpStatusEnum.SINGET_ERROR.getCode());
|
throw new ServiceException(HttpStatusEnum.SINGET_ERROR.getInfo(),HttpStatusEnum.SINGET_ERROR.getCode());
|
||||||
|
@ -183,6 +186,9 @@ public class LabourApiController extends BaseController {
|
||||||
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
||||||
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
||||||
}
|
}
|
||||||
|
if(!Objects.equals(ApplyCfgTypeEnum.LABOUR.getCode(),sysApplyConfig.getCfgType())){
|
||||||
|
throw new ServiceException(HttpStatusEnum.ERROR.getInfo(),HttpStatusEnum.ERROR.getCode());
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
// 上传并返回新文件名称
|
// 上传并返回新文件名称
|
||||||
String fileName = FileUploadUtils.uploadImages(RuoYiConfig.getUploadPath(), file);
|
String fileName = FileUploadUtils.uploadImages(RuoYiConfig.getUploadPath(), file);
|
||||||
|
@ -207,6 +213,9 @@ public class LabourApiController extends BaseController {
|
||||||
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
||||||
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
||||||
}
|
}
|
||||||
|
if(!Objects.equals(ApplyCfgTypeEnum.LABOUR.getCode(),sysApplyConfig.getCfgType())){
|
||||||
|
throw new ServiceException(HttpStatusEnum.ERROR.getInfo(),HttpStatusEnum.ERROR.getCode());
|
||||||
|
}
|
||||||
if(!req.checkTimestamp()){
|
if(!req.checkTimestamp()){
|
||||||
throw new ServiceException(HttpStatusEnum.SINGET_TIMEOUT.getInfo(),HttpStatusEnum.SINGET_TIMEOUT.getCode());
|
throw new ServiceException(HttpStatusEnum.SINGET_TIMEOUT.getInfo(),HttpStatusEnum.SINGET_TIMEOUT.getCode());
|
||||||
}
|
}
|
||||||
|
@ -271,6 +280,9 @@ public class LabourApiController extends BaseController {
|
||||||
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
||||||
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
||||||
}
|
}
|
||||||
|
if(!Objects.equals(ApplyCfgTypeEnum.LABOUR.getCode(),sysApplyConfig.getCfgType())){
|
||||||
|
throw new ServiceException(HttpStatusEnum.ERROR.getInfo(),HttpStatusEnum.ERROR.getCode());
|
||||||
|
}
|
||||||
if(!req.checkTimestamp()){
|
if(!req.checkTimestamp()){
|
||||||
throw new ServiceException(HttpStatusEnum.SINGET_TIMEOUT.getInfo(),HttpStatusEnum.SINGET_TIMEOUT.getCode());
|
throw new ServiceException(HttpStatusEnum.SINGET_TIMEOUT.getInfo(),HttpStatusEnum.SINGET_TIMEOUT.getCode());
|
||||||
}
|
}
|
||||||
|
@ -334,6 +346,9 @@ public class LabourApiController extends BaseController {
|
||||||
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
||||||
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
||||||
}
|
}
|
||||||
|
if(!Objects.equals(ApplyCfgTypeEnum.LABOUR.getCode(),sysApplyConfig.getCfgType())){
|
||||||
|
throw new ServiceException(HttpStatusEnum.ERROR.getInfo(),HttpStatusEnum.ERROR.getCode());
|
||||||
|
}
|
||||||
if(!req.checkTimestamp()){
|
if(!req.checkTimestamp()){
|
||||||
throw new ServiceException(HttpStatusEnum.SINGET_TIMEOUT.getInfo(),HttpStatusEnum.SINGET_TIMEOUT.getCode());
|
throw new ServiceException(HttpStatusEnum.SINGET_TIMEOUT.getInfo(),HttpStatusEnum.SINGET_TIMEOUT.getCode());
|
||||||
}
|
}
|
||||||
|
@ -404,6 +419,9 @@ public class LabourApiController extends BaseController {
|
||||||
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
||||||
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
||||||
}
|
}
|
||||||
|
if(!Objects.equals(ApplyCfgTypeEnum.LABOUR.getCode(),sysApplyConfig.getCfgType())){
|
||||||
|
throw new ServiceException(HttpStatusEnum.ERROR.getInfo(),HttpStatusEnum.ERROR.getCode());
|
||||||
|
}
|
||||||
if(!req.checkTimestamp()){
|
if(!req.checkTimestamp()){
|
||||||
throw new ServiceException(HttpStatusEnum.SINGET_TIMEOUT.getInfo(),HttpStatusEnum.SINGET_TIMEOUT.getCode());
|
throw new ServiceException(HttpStatusEnum.SINGET_TIMEOUT.getInfo(),HttpStatusEnum.SINGET_TIMEOUT.getCode());
|
||||||
}
|
}
|
||||||
|
@ -475,6 +493,9 @@ public class LabourApiController extends BaseController {
|
||||||
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
||||||
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
||||||
}
|
}
|
||||||
|
if(!Objects.equals(ApplyCfgTypeEnum.LABOUR.getCode(),sysApplyConfig.getCfgType())){
|
||||||
|
throw new ServiceException(HttpStatusEnum.ERROR.getInfo(),HttpStatusEnum.ERROR.getCode());
|
||||||
|
}
|
||||||
if(!req.checkTimestamp()){
|
if(!req.checkTimestamp()){
|
||||||
throw new ServiceException(HttpStatusEnum.SINGET_TIMEOUT.getInfo(),HttpStatusEnum.SINGET_TIMEOUT.getCode());
|
throw new ServiceException(HttpStatusEnum.SINGET_TIMEOUT.getInfo(),HttpStatusEnum.SINGET_TIMEOUT.getCode());
|
||||||
}
|
}
|
||||||
|
@ -608,6 +629,9 @@ public class LabourApiController extends BaseController {
|
||||||
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
if(StringUtils.equals(ShiFouEnum.SHI.getCode(),sysApplyConfig.getIsDel())){
|
||||||
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
throw new ServiceException(HttpStatusEnum.DISABLE.getInfo(),HttpStatusEnum.DISABLE.getCode());
|
||||||
}
|
}
|
||||||
|
if(!Objects.equals(ApplyCfgTypeEnum.LABOUR.getCode(),sysApplyConfig.getCfgType())){
|
||||||
|
throw new ServiceException(HttpStatusEnum.ERROR.getInfo(),HttpStatusEnum.ERROR.getCode());
|
||||||
|
}
|
||||||
if(!req.checkTimestamp()){
|
if(!req.checkTimestamp()){
|
||||||
throw new ServiceException(HttpStatusEnum.SINGET_TIMEOUT.getInfo(),HttpStatusEnum.SINGET_TIMEOUT.getCode());
|
throw new ServiceException(HttpStatusEnum.SINGET_TIMEOUT.getInfo(),HttpStatusEnum.SINGET_TIMEOUT.getCode());
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.ruoyi.api.labour.domain;
|
||||||
|
|
||||||
|
import com.ruoyi.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* API请求参数
|
||||||
|
*
|
||||||
|
* @author: JiangYuQi
|
||||||
|
* @date: 2024/01/13 12:21
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Slf4j
|
||||||
|
public class AiBoxApiReqVo extends BaseEntity {
|
||||||
|
|
||||||
|
private Long beginTimestamp;
|
||||||
|
|
||||||
|
private Long endTimestamp;
|
||||||
|
|
||||||
|
}
|
|
@ -7,7 +7,8 @@ package com.ruoyi.common.enums;
|
||||||
*/
|
*/
|
||||||
public enum ApplyCfgTypeEnum {
|
public enum ApplyCfgTypeEnum {
|
||||||
|
|
||||||
LABOUR("1", "劳务人员信息接入");
|
LABOUR("1", "劳务人员信息接入"),
|
||||||
|
AIBOXS("2", "视频智能预警接入");
|
||||||
|
|
||||||
private final String code;
|
private final String code;
|
||||||
private final String info;
|
private final String info;
|
||||||
|
|
|
@ -653,7 +653,7 @@ export default {
|
||||||
],
|
],
|
||||||
phonenumber: [
|
phonenumber: [
|
||||||
{
|
{
|
||||||
pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
|
pattern: /^[1-9][3|4|5|6|7|8|9][0-9]\d{8}$/,
|
||||||
message: "请输入正确的手机号码",
|
message: "请输入正确的手机号码",
|
||||||
trigger: "blur",
|
trigger: "blur",
|
||||||
},
|
},
|
||||||
|
|
|
@ -143,6 +143,8 @@ public class DevAiProjectData extends BaseEntity
|
||||||
@Excel(name = "数据状态")
|
@Excel(name = "数据状态")
|
||||||
private String isDel;
|
private String isDel;
|
||||||
|
|
||||||
|
private String minImage;
|
||||||
|
|
||||||
public String getProjectName() {
|
public String getProjectName() {
|
||||||
return projectName;
|
return projectName;
|
||||||
}
|
}
|
||||||
|
@ -438,6 +440,14 @@ public class DevAiProjectData extends BaseEntity
|
||||||
this.alarmTypeName = alarmTypeName;
|
this.alarmTypeName = alarmTypeName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getMinImage() {
|
||||||
|
return minImage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinImage(String minImage) {
|
||||||
|
this.minImage = minImage;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
|
@ -72,6 +72,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</if>
|
</if>
|
||||||
<if test="params.date != null"> and date(dapd.create_time) = date(#{params.date})</if>
|
<if test="params.date != null"> and date(dapd.create_time) = date(#{params.date})</if>
|
||||||
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and date(dapd.create_time) between #{params.beginTime} and #{params.endTime}</if>
|
<if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and date(dapd.create_time) between #{params.beginTime} and #{params.endTime}</if>
|
||||||
|
<if test="params.beginDate != null and params.beginDate != ''"> and date(dapd.create_time) <![CDATA[ >= ]]> #{params.beginDate}</if>
|
||||||
|
<if test="params.endDate != null and params.endDate != ''"> and date(dapd.create_time) <![CDATA[ <= ]]> #{params.endDate}</if>
|
||||||
</where>
|
</where>
|
||||||
order by dapd.create_time desc
|
order by dapd.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'> left join sur_project_userinfo spu on spu.project_id = sp.id</if>
|
<if test='nowRole == "15" or nowRole == "16" or nowRole == "17" or nowRole == "99"'> left join sur_project_userinfo spu on spu.project_id = sp.id</if>
|
||||||
<if test="deptId != null"> left join work_train_dept wtd2 on wtd2.train_id = wt.id and wtd2.is_main ='Y'</if>
|
<if test="deptId != null"> left join work_train_dept wtd2 on wtd2.train_id = wt.id and wtd2.is_main ='Y'</if>
|
||||||
<where>
|
<where>
|
||||||
and sp.isDel=0
|
and wt.is_del=0
|
||||||
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
|
<if test="proType != null and proType != ''"> and sp.projectType = #{proType}</if>
|
||||||
<if test="projectId != null"> and wt.project_id = #{projectId}</if>
|
<if test="projectId != null"> and wt.project_id = #{projectId}</if>
|
||||||
<if test="deptId != null"> and wtd2.dept_id = #{deptId}</if>
|
<if test="deptId != null"> and wtd2.dept_id = #{deptId}</if>
|
||||||
|
|
Loading…
Reference in New Issue