Commit e351124f by 胡懿

对接平台数据

parent a7d3c72e
...@@ -30,4 +30,5 @@ public class ErrorInfo { ...@@ -30,4 +30,5 @@ public class ErrorInfo {
public static ErrorCode DEVICE_REQ_CONF_PARENT_IS_CHILD = new ErrorCode(22, "不能设置自己的子DeviceReqConf为父DeviceReqConf"); public static ErrorCode DEVICE_REQ_CONF_PARENT_IS_CHILD = new ErrorCode(22, "不能设置自己的子DeviceReqConf为父DeviceReqConf");
public static ErrorCode PT_DEPT_INFO_NOT_EXISTS = new ErrorCode(23, "平台部门不存在"); public static ErrorCode PT_DEPT_INFO_NOT_EXISTS = new ErrorCode(23, "平台部门不存在");
public static ErrorCode PT_USER_INFO_NOT_EXISTS = new ErrorCode(24, "平台用户不存在");
} }
...@@ -59,13 +59,6 @@ public class DeviceLogInfoController { ...@@ -59,13 +59,6 @@ public class DeviceLogInfoController {
} }
@PostMapping("/initIllIotDBTable")
@Operation(summary = "初始设备访问时间序列")
public CommonResult<String> initIllIotDBTable() {
MyIotDbUtils.createDeviceLogInfoTimeseries(iotDbConfig);
MyIotDbUtils.createDeviceIllLogInfoTimeseries(iotDbConfig);
return CommonResult.success("初始化成功");
}
@GetMapping("/countDeviceIllLogInfo") @GetMapping("/countDeviceIllLogInfo")
......
...@@ -94,4 +94,10 @@ public class DeviceReqConfController { ...@@ -94,4 +94,10 @@ public class DeviceReqConfController {
BeanUtils.toBean(list, DeviceReqConfRespVO.class)); BeanUtils.toBean(list, DeviceReqConfRespVO.class));
} }
@GetMapping("/syncPtUser")
@Operation(summary = "同步平台设备信息")
public CommonResult<String> syncPtDevice() {
return success(deviceReqConfService.syncPtDevice());
}
} }
\ No newline at end of file
...@@ -33,7 +33,7 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*; ...@@ -33,7 +33,7 @@ import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 平台部门") @Tag(name = "管理后台 - 平台部门")
@RestController @RestController
@RequestMapping("/ptinfo/pt-dept-info") @RequestMapping("/admin-api/ptinfo/pt-dept-info")
@Validated @Validated
public class PtDeptInfoController { public class PtDeptInfoController {
...@@ -94,4 +94,10 @@ public class PtDeptInfoController { ...@@ -94,4 +94,10 @@ public class PtDeptInfoController {
BeanUtils.toBean(list, PtDeptInfoRespVO.class)); BeanUtils.toBean(list, PtDeptInfoRespVO.class));
} }
@GetMapping("/syncPtDept")
@Operation(summary = "同步平台部门信息")
public CommonResult<String> syncPtDept() {
return success(ptDeptInfoService.syncPtDept());
}
} }
\ No newline at end of file
package cn.gintone.controller;
import cn.gintone.controller.vo.PtUserInfoPageReqVO;
import cn.gintone.controller.vo.PtUserInfoRespVO;
import cn.gintone.controller.vo.PtUserInfoSaveReqVO;
import cn.gintone.entity.PtUserInfoDO;
import cn.gintone.service.PtUserInfoService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 平台用户")
@RestController
@RequestMapping("/admin-api/ptinfo/pt-user-info")
@Validated
public class PtUserInfoController {
@Resource
private PtUserInfoService ptUserInfoService;
@PostMapping("/create")
@Operation(summary = "创建平台用户")
@PreAuthorize("@ss.hasPermission('ptinfo:pt-user-info:create')")
public CommonResult<Long> createPtUserInfo(@Valid @RequestBody PtUserInfoSaveReqVO createReqVO) {
return success(ptUserInfoService.createPtUserInfo(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新平台用户")
@PreAuthorize("@ss.hasPermission('ptinfo:pt-user-info:update')")
public CommonResult<Boolean> updatePtUserInfo(@Valid @RequestBody PtUserInfoSaveReqVO updateReqVO) {
ptUserInfoService.updatePtUserInfo(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除平台用户")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('ptinfo:pt-user-info:delete')")
public CommonResult<Boolean> deletePtUserInfo(@RequestParam("id") Long id) {
ptUserInfoService.deletePtUserInfo(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得平台用户")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('ptinfo:pt-user-info:query')")
public CommonResult<PtUserInfoRespVO> getPtUserInfo(@RequestParam("id") Long id) {
PtUserInfoDO ptUserInfo = ptUserInfoService.getPtUserInfo(id);
return success(BeanUtils.toBean(ptUserInfo, PtUserInfoRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得平台用户分页")
@PreAuthorize("@ss.hasPermission('ptinfo:pt-user-info:query')")
public CommonResult<PageResult<PtUserInfoRespVO>> getPtUserInfoPage(@Valid PtUserInfoPageReqVO pageReqVO) {
PageResult<PtUserInfoDO> pageResult = ptUserInfoService.getPtUserInfoPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, PtUserInfoRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出平台用户 Excel")
@PreAuthorize("@ss.hasPermission('ptinfo:pt-user-info:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportPtUserInfoExcel(@Valid PtUserInfoPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<PtUserInfoDO> list = ptUserInfoService.getPtUserInfoPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "平台用户.xls", "数据", PtUserInfoRespVO.class,
BeanUtils.toBean(list, PtUserInfoRespVO.class));
}
@GetMapping("/syncPtUser")
@Operation(summary = "同步平台部门信息")
public CommonResult<String> syncPtUser() {
return success(ptUserInfoService.syncPtUser());
}
}
\ No newline at end of file
...@@ -32,51 +32,29 @@ public class WebLogInfoController { ...@@ -32,51 +32,29 @@ public class WebLogInfoController {
@Resource @Resource
private StringRedisTemplate stringRedisTemplate; private StringRedisTemplate stringRedisTemplate;
@PermitAll
@PostMapping("/initIotDBDatabase") @PostMapping("/initIotDBDatabase")
@Operation(summary = "初始化数据库") @Operation(summary = "初始化数据库")
public CommonResult<String> initIotDBDatabase() { public CommonResult<String> initIotDBDatabase() {
MyIotDbUtils.createDatabase(iotDbConfig); // MyIotDbUtils.createDatabase(iotDbConfig);
MyIotDbUtils.createWebLogInfoTimeseries(iotDbConfig); MyIotDbUtils.createWebLogInfoTimeseries(iotDbConfig);
MyIotDbUtils.createIllegalLogTimeseries(iotDbConfig); MyIotDbUtils.createIllegalLogTimeseries(iotDbConfig);
FileIotDbUtil.createFileLogInfoTimeseries(iotDbConfig); FileIotDbUtil.createFileLogInfoTimeseries(iotDbConfig);
SpecialPeopleIotDbUtils.createSpeLogInfoTimeseries(iotDbConfig); SpecialPeopleIotDbUtils.createSpeLogInfoTimeseries(iotDbConfig);
MyIotDbUtils.createDeviceLogInfoTimeseries(iotDbConfig);
MyIotDbUtils.createDeviceIllLogInfoTimeseries(iotDbConfig);
JarDecLogIotDbUtil.createJarDecLogInfoTimeseries(iotDbConfig); JarDecLogIotDbUtil.createJarDecLogInfoTimeseries(iotDbConfig);
return CommonResult.success("初始化成功");
}
@PostMapping("/initIotDBTable")
@Operation(summary = "初始化时间序列")
public CommonResult<String> initIotDBTable() {
MyIotDbUtils.createWebLogInfoTimeseries(iotDbConfig);
return CommonResult.success("初始化成功");
}
@PostMapping("/initIllIotDBTable") // delete timeseries root.myWebLogInfo.**
@Operation(summary = "初始非法访问化时间序列") // delete timeseries root.myDeviceLogInfo.**
public CommonResult<String> initIllIotDBTable() { // delete timeseries root.myDecFileLogInfo.**
MyIotDbUtils.createIllegalLogTimeseries(iotDbConfig);
return CommonResult.success("初始化成功");
}
@PostMapping("/initDecFileIotDBTable")
@Operation(summary = "初始化重要文件时间序列")
public CommonResult<String> initDecFileIotDBTable() {
FileIotDbUtil.createFileLogInfoTimeseries(iotDbConfig);
return CommonResult.success("初始化成功");
}
@PostMapping("/initSpeLogIotDBTable")
@Operation(summary = "初始化重点人群时间序列")
public CommonResult<String> initSpeLogIotDBTable() {
SpecialPeopleIotDbUtils.createSpeLogInfoTimeseries(iotDbConfig);
return CommonResult.success("初始化成功"); return CommonResult.success("初始化成功");
} }
@PostMapping("/initJarDecLogIotDBTable")
@Operation(summary = "初始化jar加密时间序列")
public CommonResult<String> initJarDecLogIotDBTable() {
JarDecLogIotDbUtil.createJarDecLogInfoTimeseries(iotDbConfig);
return CommonResult.success("初始化成功");
}
@PermitAll @PermitAll
@PostMapping("/saveWebLogInfo") @PostMapping("/saveWebLogInfo")
......
...@@ -40,4 +40,6 @@ public class DeviceConnetRuleInfoPageReqVO extends PageParam { ...@@ -40,4 +40,6 @@ public class DeviceConnetRuleInfoPageReqVO extends PageParam {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;
private String deviceSn; // 设备sn
} }
\ No newline at end of file
...@@ -47,5 +47,5 @@ public class DeviceConnetRuleInfoRespVO { ...@@ -47,5 +47,5 @@ public class DeviceConnetRuleInfoRespVO {
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;
private String deviceSn; // 设备sn
} }
\ No newline at end of file
...@@ -33,5 +33,5 @@ public class DeviceConnetRuleInfoSaveReqVO { ...@@ -33,5 +33,5 @@ public class DeviceConnetRuleInfoSaveReqVO {
@Schema(description = "用户名称", example = "芋艿") @Schema(description = "用户名称", example = "芋艿")
private String userName; private String userName;
private String deviceSn; // 设备sn
} }
\ No newline at end of file
...@@ -29,4 +29,10 @@ public class DeviceReqConfListReqVO { ...@@ -29,4 +29,10 @@ public class DeviceReqConfListReqVO {
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime; private LocalDateTime[] createTime;
private String snCode; // sn
private String address; // 地址
private String deviceEn; // 设备英文
private String regionName; // 区域名称
private String deviceTypeName;
} }
\ No newline at end of file
...@@ -36,4 +36,9 @@ public class DeviceReqConfRespVO { ...@@ -36,4 +36,9 @@ public class DeviceReqConfRespVO {
@ExcelProperty("创建时间") @ExcelProperty("创建时间")
private LocalDateTime createTime; private LocalDateTime createTime;
private String snCode; // sn
private String address; // 地址
private String deviceEn; // 设备英文
private String regionName; // 区域名称
private String deviceTypeName;
} }
\ No newline at end of file
...@@ -25,4 +25,9 @@ public class DeviceReqConfSaveReqVO { ...@@ -25,4 +25,9 @@ public class DeviceReqConfSaveReqVO {
@Schema(description = "父级id", example = "31343") @Schema(description = "父级id", example = "31343")
private Long parentId; private Long parentId;
private String snCode; // sn
private String address; // 地址
private String deviceEn; // 设备英文
private String regionName; // 区域名称
private String deviceTypeName;
} }
\ No newline at end of file
...@@ -16,7 +16,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ ...@@ -16,7 +16,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_
public class PtDeptInfoPageReqVO extends PageParam { public class PtDeptInfoPageReqVO extends PageParam {
@Schema(description = "部门id", example = "16712") @Schema(description = "部门id", example = "16712")
private Integer orgId; private String orgId;
@Schema(description = "部门编码") @Schema(description = "部门编码")
private String orgCode; private String orgCode;
...@@ -28,7 +28,7 @@ public class PtDeptInfoPageReqVO extends PageParam { ...@@ -28,7 +28,7 @@ public class PtDeptInfoPageReqVO extends PageParam {
private String orgType; private String orgType;
@Schema(description = "父部门id", example = "16885") @Schema(description = "父部门id", example = "16885")
private Integer parentOrgId; private String parentOrgId;
@Schema(description = "父部门名称", example = "芋艿") @Schema(description = "父部门名称", example = "芋艿")
private String parentOrgName; private String parentOrgName;
......
...@@ -18,7 +18,7 @@ public class PtDeptInfoRespVO { ...@@ -18,7 +18,7 @@ public class PtDeptInfoRespVO {
@Schema(description = "部门id", example = "16712") @Schema(description = "部门id", example = "16712")
@ExcelProperty("部门id") @ExcelProperty("部门id")
private Integer orgId; private String orgId;
@Schema(description = "部门编码") @Schema(description = "部门编码")
@ExcelProperty("部门编码") @ExcelProperty("部门编码")
...@@ -34,7 +34,7 @@ public class PtDeptInfoRespVO { ...@@ -34,7 +34,7 @@ public class PtDeptInfoRespVO {
@Schema(description = "父部门id", example = "16885") @Schema(description = "父部门id", example = "16885")
@ExcelProperty("父部门id") @ExcelProperty("父部门id")
private Integer parentOrgId; private String parentOrgId;
@Schema(description = "父部门名称", example = "芋艿") @Schema(description = "父部门名称", example = "芋艿")
@ExcelProperty("父部门名称") @ExcelProperty("父部门名称")
......
...@@ -13,7 +13,7 @@ public class PtDeptInfoSaveReqVO { ...@@ -13,7 +13,7 @@ public class PtDeptInfoSaveReqVO {
private Long id; private Long id;
@Schema(description = "部门id", example = "16712") @Schema(description = "部门id", example = "16712")
private Integer orgId; private String orgId;
@Schema(description = "部门编码") @Schema(description = "部门编码")
private String orgCode; private String orgCode;
...@@ -25,7 +25,7 @@ public class PtDeptInfoSaveReqVO { ...@@ -25,7 +25,7 @@ public class PtDeptInfoSaveReqVO {
private String orgType; private String orgType;
@Schema(description = "父部门id", example = "16885") @Schema(description = "父部门id", example = "16885")
private Integer parentOrgId; private String parentOrgId;
@Schema(description = "父部门名称", example = "芋艿") @Schema(description = "父部门名称", example = "芋艿")
private String parentOrgName; private String parentOrgName;
......
package cn.gintone.controller.vo;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 平台用户分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class PtUserInfoPageReqVO extends PageParam {
@Schema(description = "用户id", example = "28834")
private Long userId;
@Schema(description = "用户民", example = "李四")
private String userName;
@Schema(description = "用户真实姓名", example = "张三")
private String userRealName;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
private String orgId;
private String orgName;
}
\ No newline at end of file
package cn.gintone.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 平台用户 Response VO")
@Data
@ExcelIgnoreUnannotated
public class PtUserInfoRespVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "49")
@ExcelProperty("id")
private Long id;
@Schema(description = "用户id", example = "28834")
@ExcelProperty("用户id")
private Long userId;
@Schema(description = "用户民", example = "李四")
@ExcelProperty("用户民")
private String userName;
@Schema(description = "用户真实姓名", example = "张三")
@ExcelProperty("用户真实姓名")
private String userRealName;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
private String orgId;
private String orgName;
}
\ No newline at end of file
package cn.gintone.controller.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import javax.validation.constraints.*;
@Schema(description = "管理后台 - 平台用户新增/修改 Request VO")
@Data
public class PtUserInfoSaveReqVO {
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "49")
private Long id;
@Schema(description = "用户id", example = "28834")
private Long userId;
@Schema(description = "用户民", example = "李四")
private String userName;
@Schema(description = "用户真实姓名", example = "张三")
private String userRealName;
private String orgId;
private String orgName;
}
\ No newline at end of file
package cn.gintone.controller.vo; package cn.gintone.controller.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.*; import lombok.*;
import java.util.*; import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
...@@ -32,4 +33,14 @@ public class WebReqConfListReqVO { ...@@ -32,4 +33,14 @@ public class WebReqConfListReqVO {
@Schema(description = "父级id", example = "28717") @Schema(description = "父级id", example = "28717")
private Long parentId; private Long parentId;
/**
* 方位地址id
*/
@Schema(description = "api父级id", example = "28718")
private String apiId;
/**
* 访问地址父级id
*/
@Schema(description = "访问地址父级id", example = "28719")
private String apiParentId;
} }
\ No newline at end of file
...@@ -40,4 +40,16 @@ public class WebReqConfRespVO { ...@@ -40,4 +40,16 @@ public class WebReqConfRespVO {
@ExcelProperty("父级id") @ExcelProperty("父级id")
private Long parentId; private Long parentId;
/**
* 方位地址id
*/
@Schema(description = "api父级id", example = "28718")
@ExcelProperty("api父级id")
private String apiId;
/**
* 访问地址父级id
*/
@Schema(description = "访问地址父级id", example = "28719")
@ExcelProperty("api父级id")
private String apiParentId;
} }
\ No newline at end of file
...@@ -28,4 +28,14 @@ public class WebReqConfSaveReqVO { ...@@ -28,4 +28,14 @@ public class WebReqConfSaveReqVO {
@Schema(description = "父级id", example = "28717") @Schema(description = "父级id", example = "28717")
private Long parentId; private Long parentId;
/**
* 方位地址id
*/
@Schema(description = "api父级id", example = "28718")
private String apiId;
/**
* 访问地址父级id
*/
@Schema(description = "访问地址父级id", example = "28719")
private String apiParentId;
} }
\ No newline at end of file
package cn.gintone.dal;
import java.util.*;
import cn.gintone.controller.vo.PtUserInfoPageReqVO;
import cn.gintone.entity.PtUserInfoDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import org.apache.ibatis.annotations.Mapper;
/**
* 平台用户 Mapper
*
* @author 安全系统管理
*/
@Mapper
public interface PtUserInfoMapper extends BaseMapperX<PtUserInfoDO> {
default PageResult<PtUserInfoDO> selectPage(PtUserInfoPageReqVO reqVO) {
return selectPage(reqVO, new LambdaQueryWrapperX<PtUserInfoDO>()
.eqIfPresent(PtUserInfoDO::getUserId, reqVO.getUserId())
.likeIfPresent(PtUserInfoDO::getUserName, reqVO.getUserName())
.likeIfPresent(PtUserInfoDO::getUserRealName, reqVO.getUserRealName())
.eqIfPresent(PtUserInfoDO::getOrgId, reqVO.getOrgId())
.eqIfPresent(PtUserInfoDO::getOrgName, reqVO.getOrgName())
.betweenIfPresent(PtUserInfoDO::getCreateTime, reqVO.getCreateTime())
.orderByDesc(PtUserInfoDO::getId));
}
}
\ No newline at end of file
...@@ -11,6 +11,7 @@ public class DeviceIllLogInfo { ...@@ -11,6 +11,7 @@ public class DeviceIllLogInfo {
private String deviceName; // 设备名称 private String deviceName; // 设备名称
private String deviceTypeId; // 设备类型id private String deviceTypeId; // 设备类型id
private String deviceTypeName; // 设备类型名称 private String deviceTypeName; // 设备类型名称
private String deviceSn; // 设备类型名称
private String accessed; // 访问时间 private String accessed; // 访问时间
private String illType; // 日志类型() private String illType; // 日志类型()
private String clientIp; // 访问端ip private String clientIp; // 访问端ip
...@@ -165,6 +166,14 @@ public class DeviceIllLogInfo { ...@@ -165,6 +166,14 @@ public class DeviceIllLogInfo {
this.pageNum = pageNum; this.pageNum = pageNum;
} }
public String getDeviceSn() {
return deviceSn;
}
public void setDeviceSn(String deviceSn) {
this.deviceSn = deviceSn;
}
@Override @Override
public String toString() { public String toString() {
return "DeviceIllLogInfo{" + return "DeviceIllLogInfo{" +
...@@ -178,6 +187,7 @@ public class DeviceIllLogInfo { ...@@ -178,6 +187,7 @@ public class DeviceIllLogInfo {
", deviceName='" + deviceName + '\'' + ", deviceName='" + deviceName + '\'' +
", deviceTypeId='" + deviceTypeId + '\'' + ", deviceTypeId='" + deviceTypeId + '\'' +
", deviceTypeName='" + deviceTypeName + '\'' + ", deviceTypeName='" + deviceTypeName + '\'' +
", deviceSn='" + deviceSn + '\'' +
", accessed='" + accessed + '\'' + ", accessed='" + accessed + '\'' +
", illType='" + illType + '\'' + ", illType='" + illType + '\'' +
", clientIp='" + clientIp + '\'' + ", clientIp='" + clientIp + '\'' +
......
...@@ -11,6 +11,7 @@ public class DeviceLogInfo { ...@@ -11,6 +11,7 @@ public class DeviceLogInfo {
private String deviceName; // 设备名称 private String deviceName; // 设备名称
private String deviceTypeId; // 设备类型id private String deviceTypeId; // 设备类型id
private String deviceTypeName; // 设备类型名称 private String deviceTypeName; // 设备类型名称
private String deviceSn; // 设备sn
private String accessed; // 访问时间 private String accessed; // 访问时间
private String type; // 日志类型(info, warning, error) private String type; // 日志类型(info, warning, error)
private String clientIp; // 访问端ip private String clientIp; // 访问端ip
...@@ -167,6 +168,14 @@ public class DeviceLogInfo { ...@@ -167,6 +168,14 @@ public class DeviceLogInfo {
this.pageNum = pageNum; this.pageNum = pageNum;
} }
public String getDeviceSn() {
return deviceSn;
}
public void setDeviceSn(String deviceSn) {
this.deviceSn = deviceSn;
}
@Override @Override
public String toString() { public String toString() {
return "DeviceLogInfo{" + return "DeviceLogInfo{" +
...@@ -180,6 +189,7 @@ public class DeviceLogInfo { ...@@ -180,6 +189,7 @@ public class DeviceLogInfo {
", deviceName='" + deviceName + '\'' + ", deviceName='" + deviceName + '\'' +
", deviceTypeId='" + deviceTypeId + '\'' + ", deviceTypeId='" + deviceTypeId + '\'' +
", deviceTypeName='" + deviceTypeName + '\'' + ", deviceTypeName='" + deviceTypeName + '\'' +
", deviceSn='" + deviceSn + '\'' +
", accessed='" + accessed + '\'' + ", accessed='" + accessed + '\'' +
", type='" + type + '\'' + ", type='" + type + '\'' +
", clientIp='" + clientIp + '\'' + ", clientIp='" + clientIp + '\'' +
......
...@@ -5,7 +5,9 @@ public class PtBzInfo { ...@@ -5,7 +5,9 @@ public class PtBzInfo {
private String sbcode; // 编码 private String sbcode; // 编码
private String name; // 名称 private String name; // 名称
private String bztype; // 类型 private String bztype; // 类型
private String bztype_id; // 类型id
private String bgq; // 区域 private String bgq; // 区域
private String address; // 地址
public int getId() { public int getId() {
return id; return id;
...@@ -46,4 +48,20 @@ public class PtBzInfo { ...@@ -46,4 +48,20 @@ public class PtBzInfo {
public void setBgq(String bgq) { public void setBgq(String bgq) {
this.bgq = bgq; this.bgq = bgq;
} }
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getBztype_id() {
return bztype_id;
}
public void setBztype_id(String bztype_id) {
this.bztype_id = bztype_id;
}
} }
package cn.gintone.dtoPt; package cn.gintone.dtoPt;
public class PtDeptInfo { public class PtDeptInfo {
private Integer org_id; // 部门id private String ORG_ID; // 部门id
private String org_code; // 部门编码 private String ORG_CODE; // 部门编码
private String org_name; // 部门名称 private String ORG_NAME; // 部门名称
private String org_type; // 部门类型 private String ORG_TYPE; // 部门类型
private Integer PARENT_ORG_ID; // 父部门id private String PARENT_ORG_ID; // 父部门id
private String PARENT_ORG_NAME; // 父部门名称 private String PARENT_ORG_NAME; // 父部门名称
public Integer getOrg_id() { public String getORG_ID() {
return org_id; return ORG_ID;
} }
public void setOrg_id(Integer org_id) { public void setORG_ID(String ORG_ID) {
this.org_id = org_id; this.ORG_ID = ORG_ID;
} }
public String getOrg_code() { public void setPARENT_ORG_ID(String PARENT_ORG_ID) {
return org_code; this.PARENT_ORG_ID = PARENT_ORG_ID;
}
public void setOrg_code(String org_code) {
this.org_code = org_code;
} }
public String getOrg_name() { public String getORG_CODE() {
return org_name; return ORG_CODE;
} }
public void setOrg_name(String org_name) { public void setORG_CODE(String ORG_CODE) {
this.org_name = org_name; this.ORG_CODE = ORG_CODE;
} }
public String getOrg_type() { public String getORG_NAME() {
return org_type; return ORG_NAME;
} }
public void setOrg_type(String org_type) { public void setORG_NAME(String ORG_NAME) {
this.org_type = org_type; this.ORG_NAME = ORG_NAME;
} }
public Integer getPARENT_ORG_ID() { public String getORG_TYPE() {
return PARENT_ORG_ID; return ORG_TYPE;
} }
public void setPARENT_ORG_ID(Integer PARENT_ORG_ID) { public void setORG_TYPE(String ORG_TYPE) {
this.PARENT_ORG_ID = PARENT_ORG_ID; this.ORG_TYPE = ORG_TYPE;
} }
public String getPARENT_ORG_NAME() { public String getPARENT_ORG_NAME() {
...@@ -55,4 +51,8 @@ public class PtDeptInfo { ...@@ -55,4 +51,8 @@ public class PtDeptInfo {
public void setPARENT_ORG_NAME(String PARENT_ORG_NAME) { public void setPARENT_ORG_NAME(String PARENT_ORG_NAME) {
this.PARENT_ORG_NAME = PARENT_ORG_NAME; this.PARENT_ORG_NAME = PARENT_ORG_NAME;
} }
public String getPARENT_ORG_ID() {
return PARENT_ORG_ID;
}
} }
package cn.gintone.dtoPt; package cn.gintone.dtoPt;
public class PtGdInfo { public class PtGdInfo {
private String sbcode; // 设备编码 private Long id; // id
private String sbname; // 名称 private String sbname; // 设备名称
private String category_id; // 类别编码 private String category_id; // 类别id
private String category; // 类别 private String category; // 类别名称
private String sstype_id; // 所属点位类型编 private String sncode; // sn号
private String sstype; // 所属点位类型 private String address; // 地址
private String address; // 位置 private String region_name; // 区域名称
public String getSbcode() { public Long getId() {
return sbcode; return id;
} }
public void setSbcode(String sbcode) { public void setId(Long id) {
this.sbcode = sbcode; this.id = id;
} }
public String getSbname() { public String getSbname() {
...@@ -41,20 +41,12 @@ public class PtGdInfo { ...@@ -41,20 +41,12 @@ public class PtGdInfo {
this.category = category; this.category = category;
} }
public String getSstype_id() { public String getSncode() {
return sstype_id; return sncode;
} }
public void setSstype_id(String sstype_id) { public void setSncode(String sncode) {
this.sstype_id = sstype_id; this.sncode = sncode;
}
public String getSstype() {
return sstype;
}
public void setSstype(String sstype) {
this.sstype = sstype;
} }
public String getAddress() { public String getAddress() {
...@@ -64,4 +56,12 @@ public class PtGdInfo { ...@@ -64,4 +56,12 @@ public class PtGdInfo {
public void setAddress(String address) { public void setAddress(String address) {
this.address = address; this.address = address;
} }
public String getRegion_name() {
return region_name;
}
public void setRegion_name(String region_name) {
this.region_name = region_name;
}
} }
package cn.gintone.dtoPt; package cn.gintone.dtoPt;
public class PtJgInfo { public class PtJgInfo {
private Integer id; private Long id; // id
private String sbcode; // 井盖编码 private String sbname; // 设备名称
private String name; // 井盖名称 private String category_id; // 类别id
private String category_id; // 设施类型代码 private String category; // 类别名称
private String category; // 设施类型代码 private String sncode; // sn号码
private String address; // 检测位置 private String address; // 地址
private String region_name; // 区域名称
public Integer getId() {
public Long getId() {
return id; return id;
} }
public void setId(Integer id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
public String getSbcode() { public String getSbname() {
return sbcode; return sbname;
}
public void setSbcode(String sbcode) {
this.sbcode = sbcode;
} }
public String getName() { public void setSbname(String sbname) {
return name; this.sbname = sbname;
}
public void setName(String name) {
this.name = name;
} }
public String getCategory_id() { public String getCategory_id() {
...@@ -48,6 +41,14 @@ public class PtJgInfo { ...@@ -48,6 +41,14 @@ public class PtJgInfo {
this.category = category; this.category = category;
} }
public String getSncode() {
return sncode;
}
public void setSncode(String sncode) {
this.sncode = sncode;
}
public String getAddress() { public String getAddress() {
return address; return address;
} }
...@@ -55,4 +56,12 @@ public class PtJgInfo { ...@@ -55,4 +56,12 @@ public class PtJgInfo {
public void setAddress(String address) { public void setAddress(String address) {
this.address = address; this.address = address;
} }
public String getRegion_name() {
return region_name;
}
public void setRegion_name(String region_name) {
this.region_name = region_name;
}
} }
package cn.gintone.dtoPt;
public class PtMenuInfo {
private Integer P_ID;
private String P_VALUE;
private String P_NAME;
private String PARENT_P_ID;
public Integer getP_ID() {
return P_ID;
}
public void setP_ID(Integer p_ID) {
P_ID = p_ID;
}
public String getP_VALUE() {
return P_VALUE;
}
public void setP_VALUE(String p_VALUE) {
P_VALUE = p_VALUE;
}
public String getP_NAME() {
return P_NAME;
}
public void setP_NAME(String p_NAME) {
P_NAME = p_NAME;
}
public String getPARENT_P_ID() {
return PARENT_P_ID;
}
public void setPARENT_P_ID(String PARENT_P_ID) {
this.PARENT_P_ID = PARENT_P_ID;
}
}
package cn.gintone.dtoPt; package cn.gintone.dtoPt;
public class PtUserInfo { public class PtUserInfo {
private Integer u_id; private Long u_id;
private String u_name; // 用户名 private String u_name; // 用户名
private String u_real_name; // ⽤户真实姓名 private String u_real_name; // ⽤户真实姓名
private String org_id; // 部门id
private String org_name;
public Integer getU_id() { public Long getU_id() {
return u_id; return u_id;
} }
public void setU_id(Integer u_id) { public void setU_id(Long u_id) {
this.u_id = u_id; this.u_id = u_id;
} }
...@@ -28,4 +30,20 @@ public class PtUserInfo { ...@@ -28,4 +30,20 @@ public class PtUserInfo {
public void setU_real_name(String u_real_name) { public void setU_real_name(String u_real_name) {
this.u_real_name = u_real_name; this.u_real_name = u_real_name;
} }
public String getOrg_id() {
return org_id;
}
public void setOrg_id(String org_id) {
this.org_id = org_id;
}
public String getOrg_name() {
return org_name;
}
public void setOrg_name(String org_name) {
this.org_name = org_name;
}
} }
package cn.gintone.dtoPt;
public class PtYLDInfo {
private Long id; // id
private String sbname; // 设备名称
private String category_id; // 类别id
private String category; // 类别名称
private String sncode; // sn号码
private String address; // 地址
private String region_name; // 区域名称
public String getSbname() {
return sbname;
}
public void setSbname(String sbname) {
this.sbname = sbname;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getRegion_name() {
return region_name;
}
public void setRegion_name(String region_name) {
this.region_name = region_name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getSncode() {
return sncode;
}
public void setSncode(String sncode) {
this.sncode = sncode;
}
public String getCategory_id() {
return category_id;
}
public void setCategory_id(String category_id) {
this.category_id = category_id;
}
public String getCategory() {
return category;
}
public void setCategory(String category) {
this.category = category;
}
}
...@@ -56,4 +56,6 @@ public class DeviceConnetRuleInfoDO extends BaseDO { ...@@ -56,4 +56,6 @@ public class DeviceConnetRuleInfoDO extends BaseDO {
*/ */
private String userName; private String userName;
private String deviceSn; // 设备sn
} }
\ No newline at end of file
...@@ -41,9 +41,15 @@ public class DeviceReqConfDO extends BaseDO { ...@@ -41,9 +41,15 @@ public class DeviceReqConfDO extends BaseDO {
* 设备类型id * 设备类型id
*/ */
private String deviceTypeId; private String deviceTypeId;
private String deviceTypeName;
/** /**
* 父级id * 父级id
*/ */
private Long parentId; private Long parentId;
private String snCode; // sn
private String address; // 地址
private String deviceEn; // 设备英文
private String regionName; // 区域名称
} }
\ No newline at end of file
...@@ -30,7 +30,7 @@ public class PtDeptInfoDO extends BaseDO { ...@@ -30,7 +30,7 @@ public class PtDeptInfoDO extends BaseDO {
/** /**
* 部门id * 部门id
*/ */
private Integer orgId; private String orgId;
/** /**
* 部门编码 * 部门编码
*/ */
...@@ -46,7 +46,7 @@ public class PtDeptInfoDO extends BaseDO { ...@@ -46,7 +46,7 @@ public class PtDeptInfoDO extends BaseDO {
/** /**
* 父部门id * 父部门id
*/ */
private Integer parentOrgId; private String parentOrgId;
/** /**
* 父部门名称 * 父部门名称
*/ */
......
package cn.gintone.entity;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
/**
* 平台用户 DO
*
* @author 安全系统管理
*/
@TableName("t_pt_user_info")
@KeySequence("t_pt_user_info_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class PtUserInfoDO extends BaseDO {
/**
* id
*/
@TableId
private Long id;
/**
* 用户id
*/
private Long userId;
/**
* 用户民
*/
private String userName;
/**
* 用户真实姓名
*/
private String userRealName;
private String orgId;
private String orgName;
}
\ No newline at end of file
...@@ -47,5 +47,13 @@ public class WebReqConfDO extends BaseDO { ...@@ -47,5 +47,13 @@ public class WebReqConfDO extends BaseDO {
* 父级id * 父级id
*/ */
private Long parentId; private Long parentId;
/**
* 方位地址id
*/
private String apiId;
/**
* 访问地址父级id
*/
private String apiParentId;
} }
\ No newline at end of file
...@@ -148,7 +148,7 @@ public class MyIotDbUtils { ...@@ -148,7 +148,7 @@ public class MyIotDbUtils {
values.add(webLogInfo.getType()); values.add(webLogInfo.getType());
values.add(webLogInfo.getClientIp()); values.add(webLogInfo.getClientIp());
values.add(webLogInfo.getRemark()); values.add(webLogInfo.getRemark());
sessionPool.insertRecord("root.myWebLogInfo.tableThree", System.currentTimeMillis(), list5, list6, values); sessionPool.insertRecord("root.myWebLogInfo.tableTwo", System.currentTimeMillis(), list5, list6, values);
sessionPool.close(); sessionPool.close();
} catch (IoTDBConnectionException e) { } catch (IoTDBConnectionException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
...@@ -607,6 +607,7 @@ public class MyIotDbUtils { ...@@ -607,6 +607,7 @@ public class MyIotDbUtils {
sessionPool.createTimeseries("root.myDeviceLogInfo.tableOne.deviceName", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED); sessionPool.createTimeseries("root.myDeviceLogInfo.tableOne.deviceName", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED);
sessionPool.createTimeseries("root.myDeviceLogInfo.tableOne.deviceTypeId", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED); sessionPool.createTimeseries("root.myDeviceLogInfo.tableOne.deviceTypeId", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED);
sessionPool.createTimeseries("root.myDeviceLogInfo.tableOne.deviceTypeName", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED); sessionPool.createTimeseries("root.myDeviceLogInfo.tableOne.deviceTypeName", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED);
sessionPool.createTimeseries("root.myDeviceLogInfo.tableOne.deviceSn", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED);
sessionPool.createTimeseries("root.myDeviceLogInfo.tableOne.accessed", TSDataType.TIMESTAMP, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED); sessionPool.createTimeseries("root.myDeviceLogInfo.tableOne.accessed", TSDataType.TIMESTAMP, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED);
sessionPool.createTimeseries("root.myDeviceLogInfo.tableOne.type", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED); sessionPool.createTimeseries("root.myDeviceLogInfo.tableOne.type", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED);
sessionPool.createTimeseries("root.myDeviceLogInfo.tableOne.clientIp", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED); sessionPool.createTimeseries("root.myDeviceLogInfo.tableOne.clientIp", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED);
...@@ -640,6 +641,7 @@ public class MyIotDbUtils { ...@@ -640,6 +641,7 @@ public class MyIotDbUtils {
sessionPool.createTimeseries("root.myDeviceLogInfo.tableTwo.deviceName", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED); sessionPool.createTimeseries("root.myDeviceLogInfo.tableTwo.deviceName", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED);
sessionPool.createTimeseries("root.myDeviceLogInfo.tableTwo.deviceTypeId", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED); sessionPool.createTimeseries("root.myDeviceLogInfo.tableTwo.deviceTypeId", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED);
sessionPool.createTimeseries("root.myDeviceLogInfo.tableTwo.deviceTypeName", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED); sessionPool.createTimeseries("root.myDeviceLogInfo.tableTwo.deviceTypeName", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED);
sessionPool.createTimeseries("root.myDeviceLogInfo.tableTwo.deviceSn", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED);
sessionPool.createTimeseries("root.myDeviceLogInfo.tableTwo.accessed", TSDataType.TIMESTAMP, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED); sessionPool.createTimeseries("root.myDeviceLogInfo.tableTwo.accessed", TSDataType.TIMESTAMP, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED);
sessionPool.createTimeseries("root.myDeviceLogInfo.tableTwo.illType", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED); sessionPool.createTimeseries("root.myDeviceLogInfo.tableTwo.illType", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED);
sessionPool.createTimeseries("root.myDeviceLogInfo.tableTwo.clientIp", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED); sessionPool.createTimeseries("root.myDeviceLogInfo.tableTwo.clientIp", TSDataType.TEXT, TSEncoding.PLAIN, CompressionType.UNCOMPRESSED);
...@@ -695,6 +697,7 @@ public class MyIotDbUtils { ...@@ -695,6 +697,7 @@ public class MyIotDbUtils {
list5.add("deviceName"); list5.add("deviceName");
list5.add("deviceTypeId"); list5.add("deviceTypeId");
list5.add("deviceTypeName"); list5.add("deviceTypeName");
list5.add("deviceSn");
list5.add("accessed"); list5.add("accessed");
list5.add("type"); list5.add("type");
list5.add("clientIp"); list5.add("clientIp");
...@@ -709,6 +712,7 @@ public class MyIotDbUtils { ...@@ -709,6 +712,7 @@ public class MyIotDbUtils {
list6.add(TSDataType.TEXT); list6.add(TSDataType.TEXT);
list6.add(TSDataType.TEXT); list6.add(TSDataType.TEXT);
list6.add(TSDataType.TEXT); list6.add(TSDataType.TEXT);
list6.add(TSDataType.TEXT);
list6.add(TSDataType.TIMESTAMP); list6.add(TSDataType.TIMESTAMP);
list6.add(TSDataType.TEXT); list6.add(TSDataType.TEXT);
list6.add(TSDataType.TEXT); list6.add(TSDataType.TEXT);
...@@ -723,6 +727,7 @@ public class MyIotDbUtils { ...@@ -723,6 +727,7 @@ public class MyIotDbUtils {
values.add(deviceLogInfo.getDeviceName()); values.add(deviceLogInfo.getDeviceName());
values.add(deviceLogInfo.getDeviceTypeId()); values.add(deviceLogInfo.getDeviceTypeId());
values.add(deviceLogInfo.getDeviceTypeName()); values.add(deviceLogInfo.getDeviceTypeName());
values.add(deviceLogInfo.getDeviceSn());
values.add(MyDateUtils.stringToLong(deviceLogInfo.getAccessed())); values.add(MyDateUtils.stringToLong(deviceLogInfo.getAccessed()));
values.add(deviceLogInfo.getType()); values.add(deviceLogInfo.getType());
values.add(deviceLogInfo.getClientIp()); values.add(deviceLogInfo.getClientIp());
...@@ -778,6 +783,7 @@ public class MyIotDbUtils { ...@@ -778,6 +783,7 @@ public class MyIotDbUtils {
list5.add("deviceName"); list5.add("deviceName");
list5.add("deviceTypeId"); list5.add("deviceTypeId");
list5.add("deviceTypeName"); list5.add("deviceTypeName");
list5.add("deviceSn");
list5.add("accessed"); list5.add("accessed");
list5.add("illType"); list5.add("illType");
list5.add("clientIp"); list5.add("clientIp");
...@@ -792,6 +798,7 @@ public class MyIotDbUtils { ...@@ -792,6 +798,7 @@ public class MyIotDbUtils {
list6.add(TSDataType.TEXT); list6.add(TSDataType.TEXT);
list6.add(TSDataType.TEXT); list6.add(TSDataType.TEXT);
list6.add(TSDataType.TEXT); list6.add(TSDataType.TEXT);
list6.add(TSDataType.TEXT);
list6.add(TSDataType.TIMESTAMP); list6.add(TSDataType.TIMESTAMP);
list6.add(TSDataType.TEXT); list6.add(TSDataType.TEXT);
list6.add(TSDataType.TEXT); list6.add(TSDataType.TEXT);
...@@ -806,6 +813,7 @@ public class MyIotDbUtils { ...@@ -806,6 +813,7 @@ public class MyIotDbUtils {
values.add(deviceIllLogInfo.getDeviceName()); values.add(deviceIllLogInfo.getDeviceName());
values.add(deviceIllLogInfo.getDeviceTypeId()); values.add(deviceIllLogInfo.getDeviceTypeId());
values.add(deviceIllLogInfo.getDeviceTypeName()); values.add(deviceIllLogInfo.getDeviceTypeName());
values.add(deviceIllLogInfo.getDeviceSn());
values.add(MyDateUtils.stringToLong(deviceIllLogInfo.getAccessed())); values.add(MyDateUtils.stringToLong(deviceIllLogInfo.getAccessed()));
values.add(deviceIllLogInfo.getIllType()); values.add(deviceIllLogInfo.getIllType());
values.add(deviceIllLogInfo.getClientIp()); values.add(deviceIllLogInfo.getClientIp());
...@@ -901,7 +909,7 @@ public class MyIotDbUtils { ...@@ -901,7 +909,7 @@ public class MyIotDbUtils {
int offsetNum = (deviceLogInfo.getPageNum() - 1) * deviceLogInfo.getPageSize(); int offsetNum = (deviceLogInfo.getPageNum() - 1) * deviceLogInfo.getPageSize();
int limitNum = deviceLogInfo.getPageSize(); int limitNum = deviceLogInfo.getPageSize();
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("select roleId, roleName, userId, username, deviceId, deviceName, deviceTypeId, deviceTypeName, accessed, type, clientIp, remark from root.myDeviceLogInfo.tableOne"); sb.append("select roleId, roleName, userId, username, deviceId, deviceName, deviceTypeId, deviceTypeName, deviceSn, accessed, type, clientIp, remark from root.myDeviceLogInfo.tableOne");
if ((null != deviceLogInfo.getEndTime() && 0 != deviceLogInfo.getEndTime()) if ((null != deviceLogInfo.getEndTime() && 0 != deviceLogInfo.getEndTime())
|| (null != deviceLogInfo.getBeginTime() && 0 != deviceLogInfo.getBeginTime()) || (null != deviceLogInfo.getBeginTime() && 0 != deviceLogInfo.getBeginTime())
|| (null != deviceLogInfo.getType() && !"".equals(deviceLogInfo.getType()))) { || (null != deviceLogInfo.getType() && !"".equals(deviceLogInfo.getType()))) {
...@@ -954,13 +962,15 @@ public class MyIotDbUtils { ...@@ -954,13 +962,15 @@ public class MyIotDbUtils {
Field field7 = fields.get(7); Field field7 = fields.get(7);
String deviceTypeName = field7.getStringValue(); String deviceTypeName = field7.getStringValue();
Field field8 = fields.get(8); Field field8 = fields.get(8);
long accessed = field8.getLongV(); String deviceSn = field8.getStringValue();
Field field9 = fields.get(9); Field field9 = fields.get(9);
String type = field9.getStringValue(); long accessed = field9.getLongV();
Field field10 = fields.get(10); Field field10 = fields.get(10);
String clientIp = field10.getStringValue(); String type = field10.getStringValue();
Field field11 = fields.get(11); Field field11 = fields.get(11);
String remark = field11.getStringValue(); String clientIp = field11.getStringValue();
Field field12 = fields.get(12);
String remark = field12.getStringValue();
DeviceLogInfo deviceLogInfo1 = new DeviceLogInfo(); DeviceLogInfo deviceLogInfo1 = new DeviceLogInfo();
deviceLogInfo1.setTimesta(timestamp); deviceLogInfo1.setTimesta(timestamp);
...@@ -974,6 +984,7 @@ public class MyIotDbUtils { ...@@ -974,6 +984,7 @@ public class MyIotDbUtils {
deviceLogInfo1.setDeviceName(deviceName); deviceLogInfo1.setDeviceName(deviceName);
deviceLogInfo1.setDeviceTypeId(deviceTypeId); deviceLogInfo1.setDeviceTypeId(deviceTypeId);
deviceLogInfo1.setDeviceTypeName(deviceTypeName); deviceLogInfo1.setDeviceTypeName(deviceTypeName);
deviceLogInfo1.setDeviceSn(deviceSn);
deviceLogInfo1.setAccessed(MyDateUtils.longToString(accessed)); deviceLogInfo1.setAccessed(MyDateUtils.longToString(accessed));
deviceLogInfo1.setType(type); deviceLogInfo1.setType(type);
...@@ -1073,7 +1084,7 @@ public class MyIotDbUtils { ...@@ -1073,7 +1084,7 @@ public class MyIotDbUtils {
int offsetNum = (deviceIllLogInfo.getPageNum() - 1) * deviceIllLogInfo.getPageSize(); int offsetNum = (deviceIllLogInfo.getPageNum() - 1) * deviceIllLogInfo.getPageSize();
int limitNum = deviceIllLogInfo.getPageSize(); int limitNum = deviceIllLogInfo.getPageSize();
StringBuffer sb = new StringBuffer(); StringBuffer sb = new StringBuffer();
sb.append("select roleId, roleName, userId, username, deviceId, deviceName, deviceTypeId, deviceTypeName, accessed, illType, clientIp, remark from root.myDeviceLogInfo.tableTwo"); sb.append("select roleId, roleName, userId, username, deviceId, deviceName, deviceTypeId, deviceTypeName, deviceSn, accessed, illType, clientIp, remark from root.myDeviceLogInfo.tableTwo");
if ((null != deviceIllLogInfo.getEndTime() && 0 != deviceIllLogInfo.getEndTime()) if ((null != deviceIllLogInfo.getEndTime() && 0 != deviceIllLogInfo.getEndTime())
|| (null != deviceIllLogInfo.getBeginTime() && 0 != deviceIllLogInfo.getBeginTime()) || (null != deviceIllLogInfo.getBeginTime() && 0 != deviceIllLogInfo.getBeginTime())
|| (null != deviceIllLogInfo.getIllType() && !"".equals(deviceIllLogInfo.getIllType()))) { || (null != deviceIllLogInfo.getIllType() && !"".equals(deviceIllLogInfo.getIllType()))) {
...@@ -1126,13 +1137,15 @@ public class MyIotDbUtils { ...@@ -1126,13 +1137,15 @@ public class MyIotDbUtils {
Field field7 = fields.get(7); Field field7 = fields.get(7);
String deviceTypeName = field7.getStringValue(); String deviceTypeName = field7.getStringValue();
Field field8 = fields.get(8); Field field8 = fields.get(8);
long accessed = field8.getLongV(); String deviceSn = field8.getStringValue();
Field field9 = fields.get(9); Field field9 = fields.get(9);
String illType = field9.getStringValue(); long accessed = field9.getLongV();
Field field10 = fields.get(10); Field field10 = fields.get(10);
String clientIp = field10.getStringValue(); String illType = field10.getStringValue();
Field field11 = fields.get(11); Field field11 = fields.get(11);
String remark = field11.getStringValue(); String clientIp = field11.getStringValue();
Field field12 = fields.get(12);
String remark = field12.getStringValue();
DeviceIllLogInfo deviceIllLogInfo1 = new DeviceIllLogInfo(); DeviceIllLogInfo deviceIllLogInfo1 = new DeviceIllLogInfo();
deviceIllLogInfo1.setTimesta(timestamp); deviceIllLogInfo1.setTimesta(timestamp);
...@@ -1146,6 +1159,7 @@ public class MyIotDbUtils { ...@@ -1146,6 +1159,7 @@ public class MyIotDbUtils {
deviceIllLogInfo1.setDeviceName(deviceName); deviceIllLogInfo1.setDeviceName(deviceName);
deviceIllLogInfo1.setDeviceTypeId(deviceTypeId); deviceIllLogInfo1.setDeviceTypeId(deviceTypeId);
deviceIllLogInfo1.setDeviceTypeName(deviceTypeName); deviceIllLogInfo1.setDeviceTypeName(deviceTypeName);
deviceIllLogInfo1.setDeviceSn(deviceSn);
deviceIllLogInfo1.setAccessed(MyDateUtils.longToString(accessed)); deviceIllLogInfo1.setAccessed(MyDateUtils.longToString(accessed));
deviceIllLogInfo1.setIllType(illType); deviceIllLogInfo1.setIllType(illType);
......
...@@ -7,7 +7,25 @@ import org.springframework.stereotype.Component; ...@@ -7,7 +7,25 @@ import org.springframework.stereotype.Component;
@Component @Component
@ConfigurationProperties(prefix = "basicinfo") @ConfigurationProperties(prefix = "basicinfo")
public class BasicUrlConf { public class BasicUrlConf {
private String deptInfoUrl;
private String userInfoUrl; private String userInfoUrl;
private String menuInfoUrl;
// 设备信息
private String bzInfoUrl;
private String fkclInfoUrl;
private String sxtInfoUrl;
private String yldInfoUrl;
private String gdInfoUrl;
private String jgInfoUrl;
public String getDeptInfoUrl() {
return deptInfoUrl;
}
public void setDeptInfoUrl(String deptInfoUrl) {
this.deptInfoUrl = deptInfoUrl;
}
public String getUserInfoUrl() { public String getUserInfoUrl() {
return userInfoUrl; return userInfoUrl;
...@@ -16,4 +34,60 @@ public class BasicUrlConf { ...@@ -16,4 +34,60 @@ public class BasicUrlConf {
public void setUserInfoUrl(String userInfoUrl) { public void setUserInfoUrl(String userInfoUrl) {
this.userInfoUrl = userInfoUrl; this.userInfoUrl = userInfoUrl;
} }
public String getMenuInfoUrl() {
return menuInfoUrl;
}
public void setMenuInfoUrl(String menuInfoUrl) {
this.menuInfoUrl = menuInfoUrl;
}
public String getBzInfoUrl() {
return bzInfoUrl;
}
public void setBzInfoUrl(String bzInfoUrl) {
this.bzInfoUrl = bzInfoUrl;
}
public String getFkclInfoUrl() {
return fkclInfoUrl;
}
public void setFkclInfoUrl(String fkclInfoUrl) {
this.fkclInfoUrl = fkclInfoUrl;
}
public String getSxtInfoUrl() {
return sxtInfoUrl;
}
public void setSxtInfoUrl(String sxtInfoUrl) {
this.sxtInfoUrl = sxtInfoUrl;
}
public String getYldInfoUrl() {
return yldInfoUrl;
}
public void setYldInfoUrl(String yldInfoUrl) {
this.yldInfoUrl = yldInfoUrl;
}
public String getGdInfoUrl() {
return gdInfoUrl;
}
public void setGdInfoUrl(String gdInfoUrl) {
this.gdInfoUrl = gdInfoUrl;
}
public String getJgInfoUrl() {
return jgInfoUrl;
}
public void setJgInfoUrl(String jgInfoUrl) {
this.jgInfoUrl = jgInfoUrl;
}
} }
...@@ -7,6 +7,7 @@ import cn.gintone.controller.vo.DeviceConnetRuleInfoRespVO; ...@@ -7,6 +7,7 @@ import cn.gintone.controller.vo.DeviceConnetRuleInfoRespVO;
import cn.gintone.controller.vo.DeviceConnetRuleInfoSaveReqVO; import cn.gintone.controller.vo.DeviceConnetRuleInfoSaveReqVO;
import cn.gintone.controller.vo.VisitInfoSaveReqVO; import cn.gintone.controller.vo.VisitInfoSaveReqVO;
import cn.gintone.dal.DeviceConnetRuleInfoMapper; import cn.gintone.dal.DeviceConnetRuleInfoMapper;
import cn.gintone.dal.PtDeptInfoMapper;
import cn.gintone.dto.*; import cn.gintone.dto.*;
import cn.gintone.entity.DeviceConnetRuleInfoDO; import cn.gintone.entity.DeviceConnetRuleInfoDO;
import cn.gintone.entity.VisitInfoDO; import cn.gintone.entity.VisitInfoDO;
...@@ -44,6 +45,8 @@ public class DeviceConnetRuleInfoServiceImpl implements DeviceConnetRuleInfoServ ...@@ -44,6 +45,8 @@ public class DeviceConnetRuleInfoServiceImpl implements DeviceConnetRuleInfoServ
private IotDbConfig iotDbConfig; private IotDbConfig iotDbConfig;
@Autowired @Autowired
private UserRoleMapper userRoleMapper; private UserRoleMapper userRoleMapper;
@Autowired
private PtDeptInfoMapper ptDeptInfoMapper;
@Override @Override
public Long createConnetRuleInfo(DeviceConnetRuleInfoSaveReqVO createReqVO) { public Long createConnetRuleInfo(DeviceConnetRuleInfoSaveReqVO createReqVO) {
...@@ -172,10 +175,10 @@ public class DeviceConnetRuleInfoServiceImpl implements DeviceConnetRuleInfoServ ...@@ -172,10 +175,10 @@ public class DeviceConnetRuleInfoServiceImpl implements DeviceConnetRuleInfoServ
MyIotDbUtils.inserOneDeviceLogInfo_ill(iotDbConfig, deviceIllLogInfo); MyIotDbUtils.inserOneDeviceLogInfo_ill(iotDbConfig, deviceIllLogInfo);
return; return;
} }
// 获取用户信息和角色信息------需要调用平台的接口 boolean isLegal = false; // 是否合法。false:不合法,true:合法
/*// 获取用户信息和角色信息------需要调用平台的接口
List<UserRoleDO> userRoleDOS = userRoleMapper.selectListByUserId(Long.parseLong(userId)); List<UserRoleDO> userRoleDOS = userRoleMapper.selectListByUserId(Long.parseLong(userId));
boolean isLegal = false; // 是否合法。false:不合法,true:合法
// 先查询角色规则 // 先查询角色规则
if (null != userRoleDOS && !userRoleDOS.isEmpty()) { if (null != userRoleDOS && !userRoleDOS.isEmpty()) {
for (UserRoleDO userRoleDO : userRoleDOS) { for (UserRoleDO userRoleDO : userRoleDOS) {
...@@ -188,7 +191,7 @@ public class DeviceConnetRuleInfoServiceImpl implements DeviceConnetRuleInfoServ ...@@ -188,7 +191,7 @@ public class DeviceConnetRuleInfoServiceImpl implements DeviceConnetRuleInfoServ
} }
} }
} }*/
// 查询用户规则,如果配置了用户规则,则按照用户规则走 // 查询用户规则,如果配置了用户规则,则按照用户规则走
List<DeviceConnetRuleInfoDO> deviceConnetRuleInfoDOList = connetRuleInfoMapper.selectList(new LambdaQueryWrapper<DeviceConnetRuleInfoDO>() List<DeviceConnetRuleInfoDO> deviceConnetRuleInfoDOList = connetRuleInfoMapper.selectList(new LambdaQueryWrapper<DeviceConnetRuleInfoDO>()
...@@ -202,7 +205,17 @@ public class DeviceConnetRuleInfoServiceImpl implements DeviceConnetRuleInfoServ ...@@ -202,7 +205,17 @@ public class DeviceConnetRuleInfoServiceImpl implements DeviceConnetRuleInfoServ
); );
if (null != deviceConnetRuleInfoDOS && deviceConnetRuleInfoDOS.size() > 0) { if (null != deviceConnetRuleInfoDOS && deviceConnetRuleInfoDOS.size() > 0) {
isLegal = true; isLegal = true;
} else {
deviceConnetRuleInfoDOS = connetRuleInfoMapper.selectList(new LambdaQueryWrapper<DeviceConnetRuleInfoDO>()
.eq(DeviceConnetRuleInfoDO::getUserId, userId)
.like(DeviceConnetRuleInfoDO::getDeviceSn, deviceLogInfo.getDeviceSn())
);
if (null != deviceConnetRuleInfoDOS && deviceConnetRuleInfoDOS.size() > 0) {
isLegal = true;
}
} }
} }
if (!isLegal) { if (!isLegal) {
......
...@@ -54,4 +54,5 @@ public interface DeviceReqConfService { ...@@ -54,4 +54,5 @@ public interface DeviceReqConfService {
*/ */
List<DeviceReqConfDO> getDeviceReqConfList(DeviceReqConfListReqVO listReqVO); List<DeviceReqConfDO> getDeviceReqConfList(DeviceReqConfListReqVO listReqVO);
String syncPtDevice();
} }
\ No newline at end of file
...@@ -4,7 +4,12 @@ import cn.gintone.ErrorInfo; ...@@ -4,7 +4,12 @@ import cn.gintone.ErrorInfo;
import cn.gintone.controller.vo.DeviceReqConfListReqVO; import cn.gintone.controller.vo.DeviceReqConfListReqVO;
import cn.gintone.controller.vo.DeviceReqConfSaveReqVO; import cn.gintone.controller.vo.DeviceReqConfSaveReqVO;
import cn.gintone.dal.DeviceReqConfMapper; import cn.gintone.dal.DeviceReqConfMapper;
import cn.gintone.dtoPt.*;
import cn.gintone.entity.DeviceReqConfDO; import cn.gintone.entity.DeviceReqConfDO;
import cn.gintone.myconf.BasicUrlConf;
import cn.gintone.utils.BasicInfoHttpUtils;
import cn.iocoder.yudao.module.system.controller.admin.auth.myVo.PtResult;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -23,7 +28,8 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU ...@@ -23,7 +28,8 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU
@Service @Service
@Validated @Validated
public class DeviceReqConfServiceImpl implements DeviceReqConfService { public class DeviceReqConfServiceImpl implements DeviceReqConfService {
@Resource
private BasicUrlConf basicUrlConf;
@Resource @Resource
private DeviceReqConfMapper deviceReqConfMapper; private DeviceReqConfMapper deviceReqConfMapper;
...@@ -131,4 +137,267 @@ public class DeviceReqConfServiceImpl implements DeviceReqConfService { ...@@ -131,4 +137,267 @@ public class DeviceReqConfServiceImpl implements DeviceReqConfService {
return deviceReqConfMapper.selectList(listReqVO); return deviceReqConfMapper.selectList(listReqVO);
} }
@Override
public String syncPtDevice() {
DeviceReqConfDO deviceReqConfDO_bz_type = deviceReqConfMapper.selectOne(new QueryWrapper<DeviceReqConfDO>()
.lambda()
.eq(DeviceReqConfDO::getDeviceEn, "bz")
);
PtResult<PtData<PtBzInfo>> bzInfo = BasicInfoHttpUtils.getBzInfo(basicUrlConf.getBzInfoUrl(), "", "");
if (null != bzInfo) {
PtData<PtBzInfo> data = bzInfo.getData();
if (null != data) {
List<PtBzInfo> rowDataList = data.getRowData();
if (null != rowDataList) {
for (PtBzInfo ptBzInfo : rowDataList) {
DeviceReqConfDO deviceReqConf = new DeviceReqConfDO();
deviceReqConf.setDeviceName(ptBzInfo.getName());
deviceReqConf.setDeviceId(ptBzInfo.getId() + "");
deviceReqConf.setDeviceTypeId(ptBzInfo.getBztype_id());
deviceReqConf.setDeviceTypeName(ptBzInfo.getBztype());
deviceReqConf.setParentId(deviceReqConfDO_bz_type.getId());
deviceReqConf.setSnCode(ptBzInfo.getId() + "");
deviceReqConf.setAddress(ptBzInfo.getAddress());
deviceReqConf.setRegionName(ptBzInfo.getBgq());
DeviceReqConfDO deviceReqConfDO = deviceReqConfMapper.selectOne(new QueryWrapper<DeviceReqConfDO>()
.lambda()
.eq(DeviceReqConfDO::getDeviceId, deviceReqConf.getDeviceId())
.eq(DeviceReqConfDO::getSnCode, deviceReqConf.getSnCode())
);
if (null != deviceReqConfDO) {
deviceReqConfDO.setDeviceName(ptBzInfo.getName());
deviceReqConfDO.setDeviceId(ptBzInfo.getId() + "");
deviceReqConfDO.setDeviceTypeId(ptBzInfo.getBztype_id());
deviceReqConfDO.setDeviceTypeName(ptBzInfo.getBztype());
deviceReqConfDO.setParentId(deviceReqConfDO_bz_type.getId());
deviceReqConfDO.setSnCode(ptBzInfo.getId() + "");
deviceReqConfDO.setAddress(ptBzInfo.getAddress());
deviceReqConfDO.setRegionName(ptBzInfo.getBgq());
deviceReqConfMapper.updateById(deviceReqConfDO);
} else {
deviceReqConfMapper.insert(deviceReqConf);
}
}
}
}
}
DeviceReqConfDO deviceReqConfDO_fkcl_type = deviceReqConfMapper.selectOne(new QueryWrapper<DeviceReqConfDO>()
.lambda()
.eq(DeviceReqConfDO::getDeviceEn, "fk")
);
PtResult<PtData<PtCarInfo>> fkclInfoList = BasicInfoHttpUtils.getFKCLInfo(basicUrlConf.getFkclInfoUrl(), "", "");
if (null != fkclInfoList) {
PtData<PtCarInfo> data = fkclInfoList.getData();
if (null != data) {
List<PtCarInfo> rowDataList = data.getRowData();
if (null != rowDataList) {
for (PtCarInfo ptCarInfo : rowDataList) {
DeviceReqConfDO deviceReqConf = new DeviceReqConfDO();
deviceReqConf.setDeviceId(ptCarInfo.getId() + "");
deviceReqConf.setSnCode(ptCarInfo.getCphm());
deviceReqConf.setDeviceTypeId(ptCarInfo.getCllxbm());
deviceReqConf.setParentId(deviceReqConfDO_fkcl_type.getId());
deviceReqConf.setDeviceTypeName(ptCarInfo.getCllx());
DeviceReqConfDO deviceReqConfDO = deviceReqConfMapper.selectOne(new QueryWrapper<DeviceReqConfDO>()
.lambda()
.eq(DeviceReqConfDO::getDeviceId, deviceReqConf.getDeviceId())
.eq(DeviceReqConfDO::getSnCode, deviceReqConf.getSnCode())
);
if (null != deviceReqConfDO) {
deviceReqConfDO.setDeviceId(ptCarInfo.getId() + "");
deviceReqConfDO.setSnCode(ptCarInfo.getCphm());
deviceReqConfDO.setDeviceTypeId(ptCarInfo.getCllxbm());
deviceReqConfDO.setDeviceTypeName(ptCarInfo.getCllx());
deviceReqConfDO.setParentId(deviceReqConfDO_fkcl_type.getId());
deviceReqConfMapper.updateById(deviceReqConfDO);
} else {
deviceReqConfMapper.insert(deviceReqConf);
}
}
}
}
}
DeviceReqConfDO deviceReqConfDO_sxt_type = deviceReqConfMapper.selectOne(new QueryWrapper<DeviceReqConfDO>()
.lambda()
.eq(DeviceReqConfDO::getDeviceEn, "sxt")
);
PtResult<PtData<PtSXTInfo>> sxtInfoList = BasicInfoHttpUtils.getSXTInfo(basicUrlConf.getSxtInfoUrl(), "", "");
if (null != sxtInfoList) {
PtData<PtSXTInfo> data = sxtInfoList.getData();
if (null != data) {
List<PtSXTInfo> rowDataList = data.getRowData();
if (null != rowDataList) {
for (PtSXTInfo ptSXTInfo : rowDataList) {
DeviceReqConfDO deviceReqConf = new DeviceReqConfDO();
deviceReqConf.setDeviceName(ptSXTInfo.getSxtmc());
deviceReqConf.setDeviceId(ptSXTInfo.getId() + "");
deviceReqConf.setDeviceTypeId(ptSXTInfo.getSxtlxbh());
deviceReqConf.setDeviceTypeName(ptSXTInfo.getSxtlxmc());
deviceReqConf.setParentId(deviceReqConfDO_sxt_type.getId());
deviceReqConf.setSnCode(ptSXTInfo.getSxtbh() + "");
deviceReqConf.setAddress(ptSXTInfo.getWzbs());
DeviceReqConfDO deviceReqConfDO = deviceReqConfMapper.selectOne(new QueryWrapper<DeviceReqConfDO>()
.lambda()
.eq(DeviceReqConfDO::getDeviceId, deviceReqConf.getDeviceId())
.eq(DeviceReqConfDO::getSnCode, deviceReqConf.getSnCode())
);
if (null != deviceReqConfDO) {
deviceReqConfDO.setDeviceName(ptSXTInfo.getSxtmc());
deviceReqConfDO.setDeviceId(ptSXTInfo.getId() + "");
deviceReqConfDO.setDeviceTypeId(ptSXTInfo.getSxtlxbh());
deviceReqConfDO.setDeviceTypeName(ptSXTInfo.getSxtlxmc());
deviceReqConfDO.setParentId(deviceReqConfDO_sxt_type.getId());
deviceReqConfDO.setSnCode(ptSXTInfo.getSxtbh() + "");
deviceReqConfDO.setAddress(ptSXTInfo.getWzbs());
deviceReqConfMapper.updateById(deviceReqConfDO);
} else {
deviceReqConfMapper.insert(deviceReqConf);
}
}
}
}
}
DeviceReqConfDO deviceReqConfDO_yld_type = deviceReqConfMapper.selectOne(new QueryWrapper<DeviceReqConfDO>()
.lambda()
.eq(DeviceReqConfDO::getDeviceEn, "yld")
);
PtResult<PtData<PtYLDInfo>> yldInfoList = BasicInfoHttpUtils.getYLDInfo(basicUrlConf.getYldInfoUrl(), "", "");
if (null != yldInfoList) {
PtData<PtYLDInfo> data = yldInfoList.getData();
if (null != data) {
List<PtYLDInfo> rowDataList = data.getRowData();
if (null != rowDataList) {
for (PtYLDInfo ptYLDInfo : rowDataList) {
DeviceReqConfDO deviceReqConf = new DeviceReqConfDO();
deviceReqConf.setDeviceName(ptYLDInfo.getSbname());
deviceReqConf.setDeviceId(ptYLDInfo.getId() + "");
deviceReqConf.setDeviceTypeId(ptYLDInfo.getCategory_id());
deviceReqConf.setDeviceTypeName(ptYLDInfo.getCategory());
deviceReqConf.setParentId(deviceReqConfDO_yld_type.getId());
deviceReqConf.setSnCode(ptYLDInfo.getSncode() + "");
deviceReqConf.setAddress(ptYLDInfo.getAddress());
deviceReqConf.setRegionName(ptYLDInfo.getRegion_name());
DeviceReqConfDO deviceReqConfDO = deviceReqConfMapper.selectOne(new QueryWrapper<DeviceReqConfDO>()
.lambda()
.eq(DeviceReqConfDO::getDeviceId, deviceReqConf.getDeviceId())
.eq(DeviceReqConfDO::getSnCode, deviceReqConf.getSnCode())
);
if (null != deviceReqConfDO) {
deviceReqConfDO.setDeviceName(ptYLDInfo.getSbname());
deviceReqConfDO.setDeviceId(ptYLDInfo.getId() + "");
deviceReqConfDO.setDeviceTypeId(ptYLDInfo.getCategory_id());
deviceReqConfDO.setDeviceTypeName(ptYLDInfo.getCategory());
deviceReqConfDO.setParentId(deviceReqConfDO_yld_type.getId());
deviceReqConfDO.setSnCode(ptYLDInfo.getSncode() + "");
deviceReqConfDO.setAddress(ptYLDInfo.getAddress());
deviceReqConfDO.setRegionName(ptYLDInfo.getRegion_name());
deviceReqConfMapper.updateById(deviceReqConfDO);
} else {
deviceReqConfMapper.insert(deviceReqConf);
}
}
}
}
}
DeviceReqConfDO deviceReqConfDO_gd_type = deviceReqConfMapper.selectOne(new QueryWrapper<DeviceReqConfDO>()
.lambda()
.eq(DeviceReqConfDO::getDeviceEn, "gd")
);
PtResult<PtData<PtGdInfo>> gdInfoList = BasicInfoHttpUtils.getGDInfo(basicUrlConf.getGdInfoUrl(), "", "");
if (null != gdInfoList) {
PtData<PtGdInfo> data = gdInfoList.getData();
if (null != data) {
List<PtGdInfo> rowDataList = data.getRowData();
if (null != rowDataList) {
for (PtGdInfo ptGdInfo : rowDataList) {
DeviceReqConfDO deviceReqConf = new DeviceReqConfDO();
deviceReqConf.setDeviceName(ptGdInfo.getSbname());
deviceReqConf.setDeviceId(ptGdInfo.getId() + "");
deviceReqConf.setDeviceTypeId(ptGdInfo.getCategory_id());
deviceReqConf.setDeviceTypeName(ptGdInfo.getCategory());
deviceReqConf.setParentId(deviceReqConfDO_gd_type.getId());
deviceReqConf.setSnCode(ptGdInfo.getSncode() + "");
deviceReqConf.setAddress(ptGdInfo.getAddress());
deviceReqConf.setRegionName(ptGdInfo.getRegion_name());
DeviceReqConfDO deviceReqConfDO = deviceReqConfMapper.selectOne(new QueryWrapper<DeviceReqConfDO>()
.lambda()
.eq(DeviceReqConfDO::getDeviceId, deviceReqConf.getDeviceId())
.eq(DeviceReqConfDO::getSnCode, deviceReqConf.getSnCode())
);
if (null != deviceReqConfDO) {
deviceReqConfDO.setDeviceName(ptGdInfo.getSbname());
deviceReqConfDO.setDeviceId(ptGdInfo.getId() + "");
deviceReqConfDO.setDeviceTypeId(ptGdInfo.getCategory_id());
deviceReqConfDO.setDeviceTypeName(ptGdInfo.getCategory());
deviceReqConfDO.setParentId(deviceReqConfDO_gd_type.getId());
deviceReqConfDO.setSnCode(ptGdInfo.getSncode() + "");
deviceReqConfDO.setAddress(ptGdInfo.getAddress());
deviceReqConfDO.setRegionName(ptGdInfo.getRegion_name());
deviceReqConfMapper.updateById(deviceReqConfDO);
} else {
deviceReqConfMapper.insert(deviceReqConf);
}
}
}
}
}
DeviceReqConfDO deviceReqConfDO_jg_type = deviceReqConfMapper.selectOne(new QueryWrapper<DeviceReqConfDO>()
.lambda()
.eq(DeviceReqConfDO::getDeviceEn, "jg")
);
PtResult<PtData<PtJgInfo>> jgInfo = BasicInfoHttpUtils.getJgInfo(basicUrlConf.getJgInfoUrl(), "", "");
if (null != jgInfo) {
PtData<PtJgInfo> data = jgInfo.getData();
if (null != data) {
List<PtJgInfo> rowDataList = data.getRowData();
if (null != rowDataList) {
for (PtJgInfo ptJgInfo : rowDataList) {
DeviceReqConfDO deviceReqConf = new DeviceReqConfDO();
deviceReqConf.setDeviceName(ptJgInfo.getSbname());
deviceReqConf.setDeviceId(ptJgInfo.getId() + "");
deviceReqConf.setDeviceTypeId(ptJgInfo.getCategory_id());
deviceReqConf.setDeviceTypeName(ptJgInfo.getCategory());
deviceReqConf.setParentId(deviceReqConfDO_jg_type.getId());
deviceReqConf.setSnCode(ptJgInfo.getSncode() + "");
deviceReqConf.setAddress(ptJgInfo.getAddress());
deviceReqConf.setRegionName(ptJgInfo.getRegion_name());
DeviceReqConfDO deviceReqConfDO = deviceReqConfMapper.selectOne(new QueryWrapper<DeviceReqConfDO>()
.lambda()
.eq(DeviceReqConfDO::getDeviceId, deviceReqConf.getDeviceId())
.eq(DeviceReqConfDO::getSnCode, deviceReqConf.getSnCode())
);
if (null != deviceReqConfDO) {
deviceReqConfDO.setDeviceName(ptJgInfo.getSbname());
deviceReqConfDO.setDeviceId(ptJgInfo.getId() + "");
deviceReqConfDO.setDeviceTypeId(ptJgInfo.getCategory_id());
deviceReqConfDO.setDeviceTypeName(ptJgInfo.getCategory());
deviceReqConfDO.setParentId(deviceReqConfDO_jg_type.getId());
deviceReqConfDO.setSnCode(ptJgInfo.getSncode() + "");
deviceReqConfDO.setAddress(ptJgInfo.getAddress());
deviceReqConfDO.setRegionName(ptJgInfo.getRegion_name());
deviceReqConfMapper.updateById(deviceReqConfDO);
} else {
deviceReqConfMapper.insert(deviceReqConf);
}
}
}
}
}
return "同步成功";
}
} }
\ No newline at end of file
...@@ -4,6 +4,7 @@ import java.util.*; ...@@ -4,6 +4,7 @@ import java.util.*;
import javax.validation.*; import javax.validation.*;
import cn.gintone.controller.vo.PtDeptInfoPageReqVO; import cn.gintone.controller.vo.PtDeptInfoPageReqVO;
import cn.gintone.controller.vo.PtDeptInfoRespVO;
import cn.gintone.controller.vo.PtDeptInfoSaveReqVO; import cn.gintone.controller.vo.PtDeptInfoSaveReqVO;
import cn.gintone.entity.PtDeptInfoDO; import cn.gintone.entity.PtDeptInfoDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
...@@ -54,4 +55,9 @@ public interface PtDeptInfoService { ...@@ -54,4 +55,9 @@ public interface PtDeptInfoService {
*/ */
PageResult<PtDeptInfoDO> getPtDeptInfoPage(PtDeptInfoPageReqVO pageReqVO); PageResult<PtDeptInfoDO> getPtDeptInfoPage(PtDeptInfoPageReqVO pageReqVO);
/**
* 同步平台数据
* @return
*/
String syncPtDept();
} }
\ No newline at end of file
...@@ -2,9 +2,17 @@ package cn.gintone.service; ...@@ -2,9 +2,17 @@ package cn.gintone.service;
import cn.gintone.ErrorInfo; import cn.gintone.ErrorInfo;
import cn.gintone.controller.vo.PtDeptInfoPageReqVO; import cn.gintone.controller.vo.PtDeptInfoPageReqVO;
import cn.gintone.controller.vo.PtDeptInfoRespVO;
import cn.gintone.controller.vo.PtDeptInfoSaveReqVO; import cn.gintone.controller.vo.PtDeptInfoSaveReqVO;
import cn.gintone.dal.PtDeptInfoMapper; import cn.gintone.dal.PtDeptInfoMapper;
import cn.gintone.dtoPt.PtData;
import cn.gintone.dtoPt.PtDeptInfo;
import cn.gintone.entity.PtDeptInfoDO; import cn.gintone.entity.PtDeptInfoDO;
import cn.gintone.myconf.BasicUrlConf;
import cn.gintone.utils.BasicInfoHttpUtils;
import cn.iocoder.yudao.module.system.controller.admin.auth.myVo.PtResult;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
...@@ -28,6 +36,11 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU ...@@ -28,6 +36,11 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU
public class PtDeptInfoServiceImpl implements PtDeptInfoService { public class PtDeptInfoServiceImpl implements PtDeptInfoService {
@Resource @Resource
private BasicUrlConf basicUrlConf;
@Resource
private StringRedisTemplate stringRedisTemplate;
@Resource
private PtDeptInfoMapper ptDeptInfoMapper; private PtDeptInfoMapper ptDeptInfoMapper;
@Override @Override
...@@ -72,4 +85,42 @@ public class PtDeptInfoServiceImpl implements PtDeptInfoService { ...@@ -72,4 +85,42 @@ public class PtDeptInfoServiceImpl implements PtDeptInfoService {
return ptDeptInfoMapper.selectPage(pageReqVO); return ptDeptInfoMapper.selectPage(pageReqVO);
} }
@Override
public String syncPtDept() {
String pdToken = stringRedisTemplate.opsForValue().get("pdToken");
PtResult<PtData<PtDeptInfo>> result = BasicInfoHttpUtils.getDeptInfo(basicUrlConf.getDeptInfoUrl(), "secure", pdToken);
PtData<PtDeptInfo> data = result.getData();
List<PtDeptInfo> rowData = data.getRowData();
if (rowData != null && rowData.size() > 0) {
for (PtDeptInfo deptInfo : rowData) {
PtDeptInfoSaveReqVO createReqVO = new PtDeptInfoSaveReqVO();
createReqVO.setOrgId(deptInfo.getORG_ID());
PtDeptInfoDO ptDeptInfoDO = ptDeptInfoMapper.selectOne(new QueryWrapper<PtDeptInfoDO>()
.lambda()
.eq(PtDeptInfoDO::getOrgId, createReqVO.getOrgId())
);
if (ptDeptInfoDO != null) {
ptDeptInfoDO.setOrgCode(deptInfo.getORG_CODE());
ptDeptInfoDO.setOrgName(deptInfo.getORG_NAME());
ptDeptInfoDO.setOrgType(deptInfo.getORG_TYPE());
ptDeptInfoDO.setParentOrgId(deptInfo.getPARENT_ORG_ID());
ptDeptInfoDO.setParentOrgName(deptInfo.getPARENT_ORG_NAME());
ptDeptInfoMapper.updateById(ptDeptInfoDO);
} else {
createReqVO.setOrgCode(deptInfo.getORG_CODE());
createReqVO.setOrgName(deptInfo.getORG_NAME());
createReqVO.setOrgType(deptInfo.getORG_TYPE());
createReqVO.setParentOrgId(deptInfo.getPARENT_ORG_ID());
createReqVO.setParentOrgName(deptInfo.getPARENT_ORG_NAME());
createPtDeptInfo(createReqVO);
}
}
}
return "同步成功";
}
} }
\ No newline at end of file
package cn.gintone.service;
import cn.gintone.controller.vo.WebReqConfSaveReqVO;
import cn.gintone.dal.SysAbbreMapper;
import cn.gintone.dtoPt.PtData;
import cn.gintone.dtoPt.PtMenuInfo;
import cn.gintone.entity.SysAbbreDO;
import cn.gintone.myconf.BasicUrlConf;
import cn.gintone.utils.BasicInfoHttpUtils;
import cn.iocoder.yudao.module.system.controller.admin.auth.myVo.PtResult;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
@Component
public class PtTimeTaskService {
@Resource
private BasicUrlConf basicUrlConf;
@Autowired
private WebReqConfService webReqConfService;
@Autowired
private SysAbbreMapper sysAbbreMapper;
@Scheduled(fixedDelay = 10000)
public void executeEvery5Minutes() {
SysAbbreDO secure = sysAbbreMapper.selectOne(new QueryWrapper<SysAbbreDO>()
.lambda()
.eq(SysAbbreDO::getAbbreEn, "SLPT")
);
PtResult<PtData<PtMenuInfo>> ptMenuList = BasicInfoHttpUtils.getPtMenu(basicUrlConf.getMenuInfoUrl(), "", "");
PtData<PtMenuInfo> data = ptMenuList.getData();
if (data != null) {
List<PtMenuInfo> rowDataList = data.getRowData();
if (rowDataList != null && rowDataList.size() > 0) {
for (PtMenuInfo rowData : rowDataList) {
String pValue = rowData.getP_VALUE();
if (pValue != null && pValue.length() > 1) {
WebReqConfSaveReqVO webReqConfSaveReqVO = new WebReqConfSaveReqVO();
webReqConfSaveReqVO.setApiUrl(pValue);
webReqConfSaveReqVO.setApiId(rowData.getP_ID() + "");
if (null != rowData.getPARENT_P_ID()) {
webReqConfSaveReqVO.setApiParentId(rowData.getPARENT_P_ID() + "");
}
webReqConfSaveReqVO.setApiName(rowData.getP_NAME());
webReqConfSaveReqVO.setAbbreId(secure.getId());
webReqConfSaveReqVO.setAbbreCn(secure.getAbbreCn());
webReqConfService.myCreateWebReqConf(webReqConfSaveReqVO);
}
}
}
}
System.out.println(123);
}
}
package cn.gintone.service;
import java.util.*;
import javax.validation.*;
import cn.gintone.controller.vo.PtUserInfoPageReqVO;
import cn.gintone.controller.vo.PtUserInfoSaveReqVO;
import cn.gintone.entity.PtUserInfoDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
/**
* 平台用户 Service 接口
*
* @author 安全系统管理
*/
public interface PtUserInfoService {
/**
* 创建平台用户
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createPtUserInfo(@Valid PtUserInfoSaveReqVO createReqVO);
/**
* 更新平台用户
*
* @param updateReqVO 更新信息
*/
void updatePtUserInfo(@Valid PtUserInfoSaveReqVO updateReqVO);
/**
* 删除平台用户
*
* @param id 编号
*/
void deletePtUserInfo(Long id);
/**
* 获得平台用户
*
* @param id 编号
* @return 平台用户
*/
PtUserInfoDO getPtUserInfo(Long id);
/**
* 获得平台用户分页
*
* @param pageReqVO 分页查询
* @return 平台用户分页
*/
PageResult<PtUserInfoDO> getPtUserInfoPage(PtUserInfoPageReqVO pageReqVO);
String syncPtUser();
}
\ No newline at end of file
package cn.gintone.service;
import cn.gintone.ErrorInfo;
import cn.gintone.controller.vo.PtDeptInfoSaveReqVO;
import cn.gintone.controller.vo.PtUserInfoPageReqVO;
import cn.gintone.controller.vo.PtUserInfoSaveReqVO;
import cn.gintone.dal.PtUserInfoMapper;
import cn.gintone.dtoPt.PtData;
import cn.gintone.dtoPt.PtDeptInfo;
import cn.gintone.dtoPt.PtUserInfo;
import cn.gintone.entity.PtUserInfoDO;
import cn.gintone.myconf.BasicUrlConf;
import cn.gintone.utils.BasicInfoHttpUtils;
import cn.iocoder.yudao.module.system.controller.admin.auth.myVo.PtResult;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
/**
* 平台用户 Service 实现类
*
* @author 安全系统管理
*/
@Service
@Validated
public class PtUserInfoServiceImpl implements PtUserInfoService {
@Resource
private BasicUrlConf basicUrlConf;
@Resource
private StringRedisTemplate stringRedisTemplate;
@Resource
private PtUserInfoMapper ptUserInfoMapper;
@Override
public Long createPtUserInfo(PtUserInfoSaveReqVO createReqVO) {
// 插入
PtUserInfoDO ptUserInfo = BeanUtils.toBean(createReqVO, PtUserInfoDO.class);
ptUserInfoMapper.insert(ptUserInfo);
// 返回
return ptUserInfo.getId();
}
@Override
public void updatePtUserInfo(PtUserInfoSaveReqVO updateReqVO) {
// 校验存在
validatePtUserInfoExists(updateReqVO.getId());
// 更新
PtUserInfoDO updateObj = BeanUtils.toBean(updateReqVO, PtUserInfoDO.class);
ptUserInfoMapper.updateById(updateObj);
}
@Override
public void deletePtUserInfo(Long id) {
// 校验存在
validatePtUserInfoExists(id);
// 删除
ptUserInfoMapper.deleteById(id);
}
private void validatePtUserInfoExists(Long id) {
if (ptUserInfoMapper.selectById(id) == null) {
throw exception(ErrorInfo.PT_USER_INFO_NOT_EXISTS);
}
}
@Override
public PtUserInfoDO getPtUserInfo(Long id) {
return ptUserInfoMapper.selectById(id);
}
@Override
public PageResult<PtUserInfoDO> getPtUserInfoPage(PtUserInfoPageReqVO pageReqVO) {
return ptUserInfoMapper.selectPage(pageReqVO);
}
@Override
public String syncPtUser() {
String pdToken = stringRedisTemplate.opsForValue().get("pdToken");
PtResult<PtData<PtUserInfo>> result = BasicInfoHttpUtils.getUserInfo(basicUrlConf.getUserInfoUrl(), "secure", pdToken);
PtData<PtUserInfo> data = result.getData();
List<PtUserInfo> rowData = data.getRowData();
if (rowData != null && rowData.size() > 0) {
for (PtUserInfo ptUserInfo : rowData) {
PtUserInfoSaveReqVO createReqVO = new PtUserInfoSaveReqVO();
createReqVO.setUserId(ptUserInfo.getU_id());
createReqVO.setUserName(ptUserInfo.getU_name());
createReqVO.setUserRealName(ptUserInfo.getU_real_name());
createReqVO.setOrgId(ptUserInfo.getOrg_id());
createReqVO.setOrgName(ptUserInfo.getOrg_name());
PtUserInfoDO ptUserInfoDO = ptUserInfoMapper.selectOne(new QueryWrapper<PtUserInfoDO>()
.lambda()
.eq(PtUserInfoDO::getUserId, createReqVO.getUserId())
);
if (ptUserInfoDO != null) {
ptUserInfoDO.setUserId(createReqVO.getUserId());
ptUserInfoDO.setUserName(createReqVO.getUserName());
ptUserInfoDO.setUserRealName(createReqVO.getUserRealName());
ptUserInfoDO.setOrgId(createReqVO.getOrgId());
ptUserInfoDO.setOrgName(createReqVO.getOrgName());
ptUserInfoMapper.updateById(ptUserInfoDO);
} else {
createPtUserInfo(createReqVO);
}
}
}
return "同步成功";
}
}
\ No newline at end of file
...@@ -150,9 +150,9 @@ public class VisitInfoServiceImpl implements VisitInfoService { ...@@ -150,9 +150,9 @@ public class VisitInfoServiceImpl implements VisitInfoService {
return; return;
} }
// 获取用户信息和角色信息------需要调用平台的接口 // 获取用户信息和角色信息------需要调用平台的接口
List<UserRoleDO> userRoleDOS = userRoleMapper.selectListByUserId(Long.parseLong(userId));
boolean isLegal = false; // 是否合法。false:不合法,true:合法 boolean isLegal = false; // 是否合法。false:不合法,true:合法
/*List<UserRoleDO> userRoleDOS = userRoleMapper.selectListByUserId(Long.parseLong(userId));
// 先查询角色规则 // 先查询角色规则
if (null != userRoleDOS && !userRoleDOS.isEmpty()) { if (null != userRoleDOS && !userRoleDOS.isEmpty()) {
for (UserRoleDO userRoleDO : userRoleDOS) { for (UserRoleDO userRoleDO : userRoleDOS) {
...@@ -165,7 +165,7 @@ public class VisitInfoServiceImpl implements VisitInfoService { ...@@ -165,7 +165,7 @@ public class VisitInfoServiceImpl implements VisitInfoService {
} }
} }
} }*/
// 查询用户规则,如果配置了用户规则,则按照用户规则走 // 查询用户规则,如果配置了用户规则,则按照用户规则走
List<VisitInfoDO> visitInfoDOS = visitInfoMapper.selectList(new LambdaQueryWrapper<VisitInfoDO>() List<VisitInfoDO> visitInfoDOS = visitInfoMapper.selectList(new LambdaQueryWrapper<VisitInfoDO>()
......
...@@ -3,9 +3,12 @@ package cn.gintone.service; ...@@ -3,9 +3,12 @@ package cn.gintone.service;
import cn.gintone.ErrorInfo; import cn.gintone.ErrorInfo;
import cn.gintone.controller.vo.VisitPageReqVO; import cn.gintone.controller.vo.VisitPageReqVO;
import cn.gintone.controller.vo.VisitSaveReqVO; import cn.gintone.controller.vo.VisitSaveReqVO;
import cn.gintone.dal.VisitInfoMapper;
import cn.gintone.dal.VisitMapper; import cn.gintone.dal.VisitMapper;
import cn.gintone.entity.VisitDO; import cn.gintone.entity.VisitDO;
import cn.gintone.entity.VisitInfoDO;
import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.common.pojo.PageResult;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -29,7 +32,7 @@ public class VisitServiceImpl implements VisitService { ...@@ -29,7 +32,7 @@ public class VisitServiceImpl implements VisitService {
private VisitMapper visitMapper; private VisitMapper visitMapper;
@Autowired @Autowired
private VisitInfoService visitInfoService; private VisitInfoMapper visitInfoMapper;
@Override @Override
public Long createVisit(VisitSaveReqVO createReqVO) { public Long createVisit(VisitSaveReqVO createReqVO) {
...@@ -54,8 +57,11 @@ public class VisitServiceImpl implements VisitService { ...@@ -54,8 +57,11 @@ public class VisitServiceImpl implements VisitService {
// 校验存在 // 校验存在
validateVisitExists(id); validateVisitExists(id);
// 删除 // 删除
visitInfoMapper.delete(new UpdateWrapper<VisitInfoDO>()
.lambda()
.eq(VisitInfoDO::getVisitId, id)
);
visitMapper.deleteById(id); visitMapper.deleteById(id);
visitInfoService.deleteVisitInfo(id);
} }
private void validateVisitExists(Long id) { private void validateVisitExists(Long id) {
......
...@@ -52,4 +52,6 @@ public interface WebReqConfService { ...@@ -52,4 +52,6 @@ public interface WebReqConfService {
*/ */
List<WebReqConfDO> getWebReqConfList(WebReqConfListReqVO listReqVO); List<WebReqConfDO> getWebReqConfList(WebReqConfListReqVO listReqVO);
Long myCreateWebReqConf(@Valid WebReqConfSaveReqVO createReqVO);
} }
\ No newline at end of file
...@@ -7,6 +7,7 @@ import cn.gintone.dal.VisitInfoMapper; ...@@ -7,6 +7,7 @@ import cn.gintone.dal.VisitInfoMapper;
import cn.gintone.dal.WebReqConfMapper; import cn.gintone.dal.WebReqConfMapper;
import cn.gintone.entity.VisitInfoDO; import cn.gintone.entity.VisitInfoDO;
import cn.gintone.entity.WebReqConfDO; import cn.gintone.entity.WebReqConfDO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -142,4 +143,30 @@ public class WebReqConfServiceImpl implements WebReqConfService { ...@@ -142,4 +143,30 @@ public class WebReqConfServiceImpl implements WebReqConfService {
return webReqConfMapper.selectList(listReqVO); return webReqConfMapper.selectList(listReqVO);
} }
@Override
public Long myCreateWebReqConf(WebReqConfSaveReqVO createReqVO) {
List<WebReqConfDO> webReqConfDOS = webReqConfMapper.selectList(new QueryWrapper<WebReqConfDO>()
.lambda()
.eq(WebReqConfDO::getApiId, createReqVO.getApiId())
);
if (webReqConfDOS != null && webReqConfDOS.size() > 0) {
for (WebReqConfDO webReqConfDO : webReqConfDOS) {
webReqConfDO.setApiUrl(createReqVO.getApiUrl());
webReqConfDO.setApiName(createReqVO.getApiName());
webReqConfMapper.updateById(webReqConfDO);
}
return 0L;
} else {
// 校验父级id的有效性
// validateParentWebReqConf(null, createReqVO.getParentId());
// 校验api名称的唯一性
// validateWebReqConfApiNameUnique(null, createReqVO.getParentId(), createReqVO.getApiName());
// 插入
WebReqConfDO webReqConf = BeanUtils.toBean(createReqVO, WebReqConfDO.class);
webReqConfMapper.insert(webReqConf);
return webReqConf.getId();
}
}
} }
\ No newline at end of file
...@@ -21,7 +21,13 @@ public class BasicInfoHttpUtils { ...@@ -21,7 +21,13 @@ public class BasicInfoHttpUtils {
Map<String, String> headers = new HashMap<String, String>(); Map<String, String> headers = new HashMap<String, String>();
headers.put("appkey", appkey); headers.put("appkey", appkey);
headers.put("Authorization", pdToken); headers.put("Authorization", pdToken);
String rStr = MyHttpThreeUtils.postJson(url, headers, null);
Map<String, Object> map = new HashMap<>();
map.put("page", 1);
map.put("pageSize", 10000);
String jsonString = JSON.toJSONString(map);
String rStr = MyHttpThreeUtils.postJson(url, headers, jsonString);
PtResult<PtData<PtDeptInfo>> result = JSON.parseObject(rStr, new TypeReference<PtResult<PtData<PtDeptInfo>>>() {}); PtResult<PtData<PtDeptInfo>> result = JSON.parseObject(rStr, new TypeReference<PtResult<PtData<PtDeptInfo>>>() {});
return result; return result;
} }
...@@ -37,7 +43,14 @@ public class BasicInfoHttpUtils { ...@@ -37,7 +43,14 @@ public class BasicInfoHttpUtils {
Map<String, String> headers = new HashMap<String, String>(); Map<String, String> headers = new HashMap<String, String>();
headers.put("appkey", appkey); headers.put("appkey", appkey);
headers.put("Authorization", pdToken); headers.put("Authorization", pdToken);
String rStr = MyHttpThreeUtils.postJson(url, headers, null);
Map<String, Object> map = new HashMap<>();
map.put("page", 1);
map.put("pageSize", 100000);
String jsonString = JSON.toJSONString(map);
String rStr = MyHttpThreeUtils.postJson(url, headers, jsonString);
PtResult<PtData<PtUserInfo>> result = JSON.parseObject(rStr, new TypeReference<PtResult<PtData<PtUserInfo>>>() {}); PtResult<PtData<PtUserInfo>> result = JSON.parseObject(rStr, new TypeReference<PtResult<PtData<PtUserInfo>>>() {});
return result; return result;
} }
...@@ -91,7 +104,23 @@ public class BasicInfoHttpUtils { ...@@ -91,7 +104,23 @@ public class BasicInfoHttpUtils {
} }
/** /**
* 管点信息 * 易涝点设备信息
* @param url
* @param appkey
* @param pdToken
* @return
*/
public static PtResult<PtData<PtYLDInfo>> getYLDInfo(String url, String appkey, String pdToken) {
Map<String, String> headers = new HashMap<String, String>();
headers.put("appkey", appkey);
headers.put("Authorization", pdToken);
String rStr = MyHttpThreeUtils.postJson(url, headers, null);
PtResult<PtData<PtYLDInfo>> result = JSON.parseObject(rStr, new TypeReference<PtResult<PtData<PtYLDInfo>>>() {});
return result;
}
/**
* 管点设备信息
* @param url * @param url
* @param appkey * @param appkey
* @param pdToken * @param pdToken
...@@ -121,4 +150,21 @@ public class BasicInfoHttpUtils { ...@@ -121,4 +150,21 @@ public class BasicInfoHttpUtils {
PtResult<PtData<PtJgInfo>> result = JSON.parseObject(rStr, new TypeReference<PtResult<PtData<PtJgInfo>>>() {}); PtResult<PtData<PtJgInfo>> result = JSON.parseObject(rStr, new TypeReference<PtResult<PtData<PtJgInfo>>>() {});
return result; return result;
} }
/**
* 获取平台菜单信息
* @param url
* @param appkey
* @param pdToken
* @return
*/
public static PtResult<PtData<PtMenuInfo>> getPtMenu(String url, String appkey, String pdToken) {
Map<String, String> headers = new HashMap<String, String>();
headers.put("appkey", appkey);
headers.put("Authorization", pdToken);
String rStr = MyHttpThreeUtils.postJson(url, headers, null);
PtResult<PtData<PtMenuInfo>> result = JSON.parseObject(rStr, new TypeReference<PtResult<PtData<PtMenuInfo>>>() {});
return result;
}
} }
<?xml version="1.0" encoding="UTF-8"?> <?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"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.iocoder.yudao.module.ptinfo.dal.mysql.ptdeptinfo.PtDeptInfoMapper"> <mapper namespace="cn.gintone.dal.PtDeptInfoMapper">
<!-- <!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
......
<?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="cn.gintone.dal.PtUserInfoMapper">
<!--
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
-->
</mapper>
\ No newline at end of file
...@@ -11,6 +11,7 @@ import cn.iocoder.yudao.framework.security.core.myVo.LoginUserInfo; ...@@ -11,6 +11,7 @@ import cn.iocoder.yudao.framework.security.core.myVo.LoginUserInfo;
import cn.iocoder.yudao.framework.security.core.myVo.PtResult; import cn.iocoder.yudao.framework.security.core.myVo.PtResult;
import cn.iocoder.yudao.framework.security.core.util.MyHttpTwoUtils; import cn.iocoder.yudao.framework.security.core.util.MyHttpTwoUtils;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.security.utils.MyReadApplicationUtils;
import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler; import cn.iocoder.yudao.framework.web.core.handler.GlobalExceptionHandler;
import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils; import cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils;
import cn.iocoder.yudao.module.system.api.oauth2.OAuth2TokenApi; import cn.iocoder.yudao.module.system.api.oauth2.OAuth2TokenApi;
...@@ -52,41 +53,48 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter { ...@@ -52,41 +53,48 @@ public class TokenAuthenticationFilter extends OncePerRequestFilter {
@SuppressWarnings("NullableProblems") @SuppressWarnings("NullableProblems")
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
throws ServletException, IOException { throws ServletException, IOException {
MyReadApplicationUtils.readApplication();
String pdToken = request.getHeader("pdToken"); String pdToken = request.getHeader("pdToken");
StringBuffer requestURL = request.getRequestURL(); StringBuffer requestURL = request.getRequestURL();
stringRedisTemplate.opsForValue().set("pdToken", pdToken); stringRedisTemplate.opsForValue().set("pdToken", pdToken);
// System.out.println(requestURL.toString()); // System.out.println(requestURL.toString());
if (requestURL.toString().contains("system/") || requestURL.toString().contains("get-by-website") || requestURL.toString().contains("checkPdToken")) { if (requestURL.toString().contains("system/") || requestURL.toString().contains("get-by-website") || requestURL.toString().contains("checkPdToken") || requestURL.toString().contains("initIotDBDatabase")) {
} else { } else {
if (StrUtil.isBlank(pdToken)) { if (StrUtil.isBlank(pdToken)) {
pdToken = request.getParameter("pdToken"); CommonResult<?> result = new CommonResult<>();
if (StrUtil.isBlank(pdToken)) { result.setCode(403);
CommonResult<?> result = new CommonResult<>(); result.setMsg("未登录");
result.setCode(403); ServletUtils.writeJSON(response, result);
result.setMsg("未登录"); return;
} else {
Map<String, String> headers = new HashMap<>();
headers.put("appkey", MyReadApplicationUtils.getAppkey());
headers.put("Authorization", pdToken);
String rStr = MyHttpTwoUtils.get(MyReadApplicationUtils.getUserByToken(), headers, null);
PtResult<LoginUserInfo> result = JSON.parseObject(rStr, new TypeReference<PtResult<LoginUserInfo>>() {});
if (null == result || result.getCode() != 200) {
CommonResult<?> result1 = new CommonResult<>();
result1.setCode(403);
result1.setMsg("未登录");
ServletUtils.writeJSON(response, result); ServletUtils.writeJSON(response, result);
return; } else if (null == result || result.getCode() == 5001) {
CommonResult<?> result1 = new CommonResult<>();
result1.setCode(402);
result1.setMsg("Token无效");
ServletUtils.writeJSON(response, result);
} else { } else {
/*Map<String, String> headers = new HashMap<>(); LoginUserInfo data = result.getData();
headers.put("appkey", "secure"); String accessToken = data.getAccessToken();
headers.put("Authorization", pdToken); String refreshToken = data.getRefreshToken();
String rStr = MyHttpTwoUtils.get("http://127.0.0.1:7006/oauth/N100101", headers, null); stringRedisTemplate.opsForValue().set("pdToken", accessToken);
PtResult<LoginUserInfo> result = JSON.parseObject(rStr, new TypeReference<PtResult<LoginUserInfo>>() {}); stringRedisTemplate.opsForValue().set("refreshToken", refreshToken);
if (null == result || !result.getCode().equals("200")) { stringRedisTemplate.opsForValue().set("pdUserInfo", JSON.toJSONString(data));
CommonResult<?> result1 = new CommonResult<>();
result1.setCode(403);
result1.setMsg("未登录");
ServletUtils.writeJSON(response, result);
} else {
LoginUserInfo data = result.getData();
String accessToken = data.getAccessToken();
stringRedisTemplate.opsForValue().set("pdToken", accessToken);
}*/
} }
return;
} }
// return;
} }
String token = SecurityFrameworkUtils.obtainAuthorization(request, String token = SecurityFrameworkUtils.obtainAuthorization(request,
......
...@@ -4,7 +4,7 @@ public class PtResult<T> { ...@@ -4,7 +4,7 @@ public class PtResult<T> {
private String msg; private String msg;
private String eventId; private String eventId;
private String flag; private String flag;
private String code; private Integer code;
private T data; private T data;
private String errorStack; private String errorStack;
...@@ -12,7 +12,7 @@ public class PtResult<T> { ...@@ -12,7 +12,7 @@ public class PtResult<T> {
public PtResult() { public PtResult() {
} }
public PtResult(String code, String msg, T data, String eventId, String flag, String errorStack) { public PtResult(Integer code, String msg, T data, String eventId, String flag, String errorStack) {
this.msg = msg; this.msg = msg;
this.eventId = eventId; this.eventId = eventId;
this.flag = flag; this.flag = flag;
...@@ -45,11 +45,11 @@ public class PtResult<T> { ...@@ -45,11 +45,11 @@ public class PtResult<T> {
this.flag = flag; this.flag = flag;
} }
public String getCode() { public Integer getCode() {
return code; return code;
} }
public void setCode(String code) { public void setCode(Integer code) {
this.code = code; this.code = code;
} }
......
...@@ -9,6 +9,7 @@ import org.springframework.http.*; ...@@ -9,6 +9,7 @@ import org.springframework.http.*;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap; import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
...@@ -80,8 +81,14 @@ public class MyHttpTwoUtils { ...@@ -80,8 +81,14 @@ public class MyHttpTwoUtils {
// 处理URL参数 // 处理URL参数
String fullUrl = buildUrlWithParams(url, params); String fullUrl = buildUrlWithParams(url, params);
ResponseEntity<String> response = restTemplate.exchange( ResponseEntity<String> response = null;
fullUrl, HttpMethod.GET, requestEntity, String.class); try {
response = restTemplate.exchange(
fullUrl, HttpMethod.GET, requestEntity, String.class);
} catch (RestClientException e) {
System.out.println(e.getMessage());
return null;
}
return response.getBody(); return response.getBody();
} }
...@@ -100,8 +107,14 @@ public class MyHttpTwoUtils { ...@@ -100,8 +107,14 @@ public class MyHttpTwoUtils {
} }
HttpEntity<String> requestEntity = new HttpEntity<>(body, httpHeaders); HttpEntity<String> requestEntity = new HttpEntity<>(body, httpHeaders);
ResponseEntity<String> response = restTemplate.exchange( ResponseEntity<String> response = null;
url, HttpMethod.POST, requestEntity, String.class); try {
response = restTemplate.exchange(
url, HttpMethod.POST, requestEntity, String.class);
} catch (RestClientException e) {
System.out.println(e.getMessage());
return null;
}
return response.getBody(); return response.getBody();
} }
......
package cn.iocoder.yudao.framework.security.utils;
import org.yaml.snakeyaml.Yaml;
import java.io.InputStream;
import java.util.Map;
public class MyReadApplicationUtils {
private static MyReadApplicationUtils myReadApplicationUtils;
private static String userByToken;
private static String appkey;
private static String userByrefresh;
private MyReadApplicationUtils() {
}
public static MyReadApplicationUtils getInstance() {
if (myReadApplicationUtils == null) {
myReadApplicationUtils = new MyReadApplicationUtils();
}
return myReadApplicationUtils;
}
public static String getUserByToken() {
if (null == userByToken || "".equals(userByToken)) {
readApplication();
}
return userByToken;
}
public static String getRefreByToken() {
if (null == userByrefresh || "".equals(userByrefresh)) {
readApplication();
}
return userByrefresh;
}
public static String getAppkey() {
if (null == appkey || "".equals(appkey)) {
readApplication();
}
return appkey;
}
public static void readApplication() {
// 1. 加载 application.yml 文件
Yaml yaml = new Yaml();
InputStream inputStream = MyReadApplicationUtils.class
.getClassLoader()
.getResourceAsStream("pttokeninfo.yml");
if (inputStream == null) {
throw new RuntimeException("pttokeninfo.yml 文件未找到!");
}
// 2. 解析 YAML 为 Map
Map<String, Object> yamlMap = yaml.load(inputStream);
// 3. 提取 pttoken 配置
Map<String, Object> pttokenConfig = (Map<String, Object>) yamlMap.get("pttoken");
if (pttokenConfig == null) {
throw new RuntimeException("pttoken 配置未找到!");
}
// 4. 获取具体配置项
userByToken = (String) pttokenConfig.get("user-by-token");
appkey = (String) pttokenConfig.get("appkey");
}
}
package cn.iocoder.yudao.module.system.controller.admin.myUtils; package cn.iocoder.yudao.module.system.controller.admin.myUtils;
import cn.iocoder.yudao.module.system.controller.admin.auth.myVo.LoginUserInfo;
import cn.iocoder.yudao.module.system.controller.admin.auth.myVo.PtResult;
import cn.iocoder.yudao.module.system.controller.admin.conf.PtUrlConf;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import java.util.HashMap;
import java.util.Map;
public class PtTokenUtils { public class PtTokenUtils {
public static PtResult<LoginUserInfo> getUserByToken(PtUrlConf ptUrlConf, String appkey, String authorization) {
// 带参数和请求头
Map<String, String> headers = new HashMap<>();
headers.put("appkey", appkey);
headers.put("Authorization", authorization);
String rStr = MyHttpUtils.get(ptUrlConf.getGetUserByToken(), headers, null);
PtResult<LoginUserInfo> result = JSON.parseObject(rStr, new TypeReference<PtResult<LoginUserInfo>>() {});
return result;
}
} }
...@@ -2,6 +2,7 @@ package cn.iocoder.yudao.server; ...@@ -2,6 +2,7 @@ package cn.iocoder.yudao.server;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;
/** /**
* 项目的启动类 * 项目的启动类
...@@ -13,6 +14,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; ...@@ -13,6 +14,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @author 芋道源码 * @author 芋道源码
*/ */
@SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package} @SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package}
@EnableScheduling
@SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}.server", "${yudao.info.base-package}.module","cn.gintone.**"}) @SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}.server", "${yudao.info.base-package}.module","cn.gintone.**"})
public class YudaoServerApplication { public class YudaoServerApplication {
......
...@@ -2,16 +2,17 @@ server: ...@@ -2,16 +2,17 @@ server:
port: 48080 port: 48080
--- #################### 数据库相关配置 #################### --- #################### 数据库相关配置 ####################
spring: spring:
autoconfigure: autoconfigure:
exclude: exclude:
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
- org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration # 默认 local 环境,不开启 Quartz 的自动配置
- de.codecentric.boot.admin.server.config.AdminServerAutoConfiguration # 禁用 Spring Boot Admin 的 Server 的自动配置
- de.codecentric.boot.admin.server.ui.config.AdminServerUiAutoConfiguration # 禁用 Spring Boot Admin 的 Server UI 的自动配置
- de.codecentric.boot.admin.client.config.SpringBootAdminClientAutoConfiguration # 禁用 Spring Boot Admin 的 Client 的自动配置
- org.springframework.ai.autoconfigure.vectorstore.qdrant.QdrantVectorStoreAutoConfiguration # 禁用 AI 模块的 Qdrant,手动创建 - org.springframework.ai.autoconfigure.vectorstore.qdrant.QdrantVectorStoreAutoConfiguration # 禁用 AI 模块的 Qdrant,手动创建
- org.springframework.ai.autoconfigure.vectorstore.milvus.MilvusVectorStoreAutoConfiguration # 禁用 AI 模块的 Milvus,手动创建 - org.springframework.ai.autoconfigure.vectorstore.milvus.MilvusVectorStoreAutoConfiguration # 禁用 AI 模块的 Milvus,手动创建
# 数据源配置项 # 数据源配置项
autoconfigure:
exclude:
- com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure # 排除 Druid 的自动配置,使用 dynamic-datasource-spring-boot-starter 配置多数据源
datasource: datasource:
druid: # Druid 【监控】相关的全局配置 druid: # Druid 【监控】相关的全局配置
web-stat-filter: web-stat-filter:
...@@ -33,42 +34,62 @@ spring: ...@@ -33,42 +34,62 @@ spring:
multi-statement-allow: true multi-statement-allow: true
dynamic: # 多数据源配置 dynamic: # 多数据源配置
druid: # Druid 【连接池】相关的全局配置 druid: # Druid 【连接池】相关的全局配置
initial-size: 5 # 初始连接数 initial-size: 1 # 初始连接数
min-idle: 10 # 最小连接池数量 min-idle: 1 # 最小连接池数量
max-active: 20 # 最大连接池数量 max-active: 20 # 最大连接池数量
max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒 max-wait: 600000 # 配置获取连接等待超时的时间,单位:毫秒
time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒 time-between-eviction-runs-millis: 60000 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位:毫秒
min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒 min-evictable-idle-time-millis: 300000 # 配置一个连接在池中最小生存的时间,单位:毫秒
max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒 max-evictable-idle-time-millis: 900000 # 配置一个连接在池中最大生存的时间,单位:毫秒
validation-query: SELECT 1 # 配置检测连接是否有效 validation-query: SELECT 1 FROM DUAL # 配置检测连接是否有效
test-while-idle: true test-while-idle: true
test-on-borrow: false test-on-borrow: false
test-on-return: false test-on-return: false
primary: master primary: master
datasource: datasource:
master: master:
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例
username: root # url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=true&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true # MySQL Connector/J 5.X 连接的示例
password: 123456 # url: jdbc:postgresql://127.0.0.1:5432/ruoyi-vue-pro # PostgreSQL 连接的示例
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
# url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true;useUnicode=true;characterEncoding=utf-8 # SQLServer 连接的示例
# url: jdbc:dm://127.0.0.1:5236?schema=RUOYI_VUE_PRO # DM 连接的示例
url: jdbc:kingbase8://127.0.0.1:54321/test # 人大金仓 KingbaseES 连接的示例
# url: jdbc:postgresql://192.168.19.128:54321/test # OpenGauss 连接的示例
username: kingbase
password: kingbase
# username: sa # SQL Server 连接的示例
# password: Yudao@2024 # SQL Server 连接的示例
# username: SYSDBA # DM 连接的示例
# password: SYSDBA001 # DM 连接的示例
# username: root # OpenGauss 连接的示例
# password: Yudao@2024 # OpenGauss 连接的示例
slave: # 模拟从库,可根据自己需要修改
lazy: true # 开启懒加载,保证启动速度 lazy: true # 开启懒加载,保证启动速度
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true&rewriteBatchedStatements=true # MySQL Connector/J 8.X 连接的示例 url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&rewriteBatchedStatements=true&nullCatalogMeansCurrent=true
username: root username: root
password: 123456 password: 123456
# tdengine: # IoT 数据库(需要 IoT 物联网再开启噢!)
# url: jdbc:TAOS-RS://127.0.0.1:6041/ruoyi_vue_pro
# driver-class-name: com.taosdata.jdbc.rs.RestfulDriver
# username: root
# password: taosdata
# druid:
# validation-query: SELECT SERVER_STATUS() # TDengine 数据源的有效性检查 SQL
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
redis: redis:
host: 400-infra.server.iocoder.cn # 地址 host: 127.0.0.1 # 地址
port: 6379 # 端口 port: 6379 # 端口
database: 1 # 数据库索引 database: 0 # 数据库索引
# password: 123456 # 密码,建议生产环境开启 # password: dev # 密码,建议生产环境开启
--- #################### 定时任务相关配置 #################### --- #################### 定时任务相关配置 ####################
# Quartz 配置项,对应 QuartzProperties 配置类 # Quartz 配置项,对应 QuartzProperties 配置类
spring: spring:
quartz: quartz:
auto-startup: true # 测试环境,需要开启 Job auto-startup: true # 本地开发环境,尽量不要开启 Job
scheduler-name: schedulerName # Scheduler 名字。默认为 schedulerName scheduler-name: schedulerName # Scheduler 名字。默认为 schedulerName
job-store-type: jdbc # Job 存储器类型。默认为 memory 表示内存,可选 jdbc 使用数据库。 job-store-type: jdbc # Job 存储器类型。默认为 memory 表示内存,可选 jdbc 使用数据库。
wait-for-jobs-to-complete-on-shutdown: true # 应用关闭时,是否等待定时任务执行完成。默认为 false ,建议设置为 true wait-for-jobs-to-complete-on-shutdown: true # 应用关闭时,是否等待定时任务执行完成。默认为 false ,建议设置为 true
...@@ -102,20 +123,28 @@ rocketmq: ...@@ -102,20 +123,28 @@ rocketmq:
spring: spring:
# RabbitMQ 配置项,对应 RabbitProperties 配置类 # RabbitMQ 配置项,对应 RabbitProperties 配置类
# rabbitmq: rabbitmq:
# host: 127.0.0.1 # RabbitMQ 服务的地址 # host: 192.168.19.205
# port: 5672 # RabbitMQ 服务的端口 # host: 127.0.0.1
# username: guest # RabbitMQ 服务的账号 # port: 5672
# password: guest # RabbitMQ 服务的密码 # username: kalo
# password: kalo
# virtual-host: /
# Kafka 配置项,对应 KafkaProperties 配置类 # Kafka 配置项,对应 KafkaProperties 配置类
kafka: kafka:
bootstrap-servers: 192.168.19.128:9092 # bootstrap-servers: 192.168.19.128:9092
bootstrap-servers: 59.195.13.208:9092
producer: producer:
retries: 3 retries: 3
timeout: 60000 request.timeout.ms: 60000
max.block.ms: 60000 # 防止元数据获取超时
key.serializer: org.apache.kafka.common.serialization.StringSerializer
value.serializer: org.apache.kafka.common.serialization.StringSerializer
consumer: consumer:
group-id: weblog_consumer_group group-id: weblog_consumer_group
auto-offset-reset: earliest auto-offset-reset: earliest
enable-auto-commit: false # 建议手动提交偏移量
max.poll.interval.ms: 300000 # 根据业务处理时间调整
admin: admin:
auto-create: true auto-create: true
--- #################### 服务保障相关配置 #################### --- #################### 服务保障相关配置 ####################
...@@ -151,21 +180,54 @@ spring: ...@@ -151,21 +180,54 @@ spring:
logging: logging:
file: file:
name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径 name: ${user.home}/logs/${spring.application.name}.log # 日志文件名,全路径
level:
# 配置自己写的 MyBatis Mapper 打印日志
cn.iocoder.yudao.module.bpm.dal.mysql: debug
cn.iocoder.yudao.module.infra.dal.mysql: debug
cn.iocoder.yudao.module.infra.dal.mysql.logger.ApiErrorLogMapper: INFO # 配置 ApiErrorLogMapper 的日志级别为 info,避免和 GlobalExceptionHandler 重复打印
cn.iocoder.yudao.module.infra.dal.mysql.job.JobLogMapper: INFO # 配置 JobLogMapper 的日志级别为 info
cn.iocoder.yudao.module.infra.dal.mysql.file.FileConfigMapper: INFO # 配置 FileConfigMapper 的日志级别为 info
cn.iocoder.yudao.module.pay.dal.mysql: debug
cn.iocoder.yudao.module.pay.dal.mysql.notify.PayNotifyTaskMapper: INFO # 配置 PayNotifyTaskMapper 的日志级别为 info
cn.iocoder.yudao.module.system.dal.mysql: debug
cn.iocoder.yudao.module.system.dal.mysql.sms.SmsChannelMapper: INFO # 配置 SmsChannelMapper 的日志级别为 info
cn.iocoder.yudao.module.tool.dal.mysql: debug
cn.iocoder.yudao.module.member.dal.mysql: debug
cn.iocoder.yudao.module.trade.dal.mysql: debug
cn.iocoder.yudao.module.promotion.dal.mysql: debug
cn.iocoder.yudao.module.statistics.dal.mysql: debug
cn.iocoder.yudao.module.crm.dal.mysql: debug
cn.iocoder.yudao.module.erp.dal.mysql: debug
cn.iocoder.yudao.module.iot.dal.mysql: debug
cn.iocoder.yudao.module.iot.dal.tdengine: DEBUG
cn.iocoder.yudao.module.ai.dal.mysql: debug
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿:先禁用,Spring Boot 3.X 存在部分错误的 WARN 提示
debug: false
--- #################### 微信公众号相关配置 #################### --- #################### 微信公众号、小程序相关配置 ####################
wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档 wx:
mp: mp: # 公众号配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-mp-spring-boot-starter/README.md 文档
# 公众号配置(必填) # app-id: wx041349c6f39b268b # 测试号(牛希尧提供的)
app-id: wx041349c6f39b268b # secret: 5abee519483bc9f8cb37ce280e814bd0
secret: 5abee519483bc9f8cb37ce280e814bd0 app-id: wx5b23ba7a5589ecbb # 测试号(自己的)
secret: 2a7b3b20c537e52e74afd395eb85f61f
# app-id: wxa69ab825b163be19 # 测试号(Kongdy 提供的)
# secret: bd4f9fab889591b62aeac0d7b8d8b4a0
# 存储配置,解决 AccessToken 的跨节点的共享 # 存储配置,解决 AccessToken 的跨节点的共享
config-storage: config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取 type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
key-prefix: wx # Redis Key 的前缀 key-prefix: wx # Redis Key 的前缀
http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台 http-client-type: HttpClient # 采用 HttpClient 请求微信公众号平台
miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档 miniapp: # 小程序配置(必填),参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-starters/wx-java-miniapp-spring-boot-starter/README.md 文档
appid: wx63c280fe3248a3e7 # appid: wx62056c0d5e8db250 # 测试号(牛希尧提供的)
secret: 6f270509224a7ae1296bbf1c8cb97aed # secret: 333ae72f41552af1e998fe1f54e1584a
# appid: wx63c280fe3248a3e7 # wenhualian的接口测试号
# secret: 6f270509224a7ae1296bbf1c8cb97aed
# appid: wxc4598c446f8a9cb3 # 测试号(Kongdy 提供的)
# secret: 4a1a04e07f6a4a0751b39c3064a92c8b
appid: wx66186af0759f47c9 # 测试号(puhui 提供的)
secret: 3218bcbd112cbc614c7264ceb20144ac
config-storage: config-storage:
type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取 type: RedisTemplate # 采用 RedisTemplate 操作 Redis,会自动从 Spring 中获取
key-prefix: wa # Redis Key 的前缀 key-prefix: wa # Redis Key 的前缀
...@@ -175,11 +237,21 @@ wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-sta ...@@ -175,11 +237,21 @@ wx: # 参见 https://github.com/Wechat-Group/WxJava/blob/develop/spring-boot-sta
# 芋道配置项,设置当前项目所有自定义的配置 # 芋道配置项,设置当前项目所有自定义的配置
yudao: yudao:
captcha:
enable: false # 本地环境,暂时关闭图片验证码,方便登录等接口的测试;
security:
mock-enable: true
pay: pay:
order-notify-url: http://yunai.natapp1.cc/admin-api/pay/notify/order # 支付渠道的【支付】回调地址 order-notify-url: http://yunai.natapp1.cc/admin-api/pay/notify/order # 支付渠道的【支付】回调地址
refund-notify-url: http://yunai.natapp1.cc/admin-api/pay/notify/refund # 支付渠道的【退款】回调地址 refund-notify-url: http://yunai.natapp1.cc/admin-api/pay/notify/refund # 支付渠道的【退款】回调地址
transfer-notify-url: https://yunai.natapp1.cc/admin-api/pay/notify/transfer # 支付渠道的【转账】回调地址 transfer-notify-url: http://yunai.natapp1.cc/admin-api/pay/notify/transfer # 支付渠道的【转账】回调地址
demo: false # 开启演示模式 access-log: # 访问日志的配置项
enable: false
demo: false # 关闭演示模式
wxa-code:
env-version: develop # 小程序版本: 正式版为 "release";体验版为 "trial";开发版为 "develop"
wxa-subscribe-message:
miniprogram-state: developer # 跳转小程序类型:开发版为 “developer”;体验版为 “trial”为;正式版为 “formal”
tencent-lbs-key: TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E # QQ 地图的密钥 https://lbs.qq.com/service/staticV2/staticGuide/staticDoc tencent-lbs-key: TVDBZ-TDILD-4ON4B-PFDZA-RNLKH-VVF6E # QQ 地图的密钥 https://lbs.qq.com/service/staticV2/staticGuide/staticDoc
justauth: justauth:
...@@ -209,26 +281,14 @@ justauth: ...@@ -209,26 +281,14 @@ justauth:
prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE:: prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟 timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟
--- #################### iot相关配置 TODO 芋艿【IOT】:再瞅瞅 ####################
--- #################### iot相关配置 TODO 芋艿:再瞅瞅 ####################
iot:
emq:
# 账号
username: anhaohao
# 密码
password: ahh@123456
# 主机地址
hostUrl: tcp://chaojiniu.top:1883
# 客户端Id,不能相同,采用随机数 ${random.value}
client-id: ${random.int}
# 默认主题
default-topic: test
# 保持连接
keepalive: 60
# 清除会话(设置为false,断开连接,重连后使用原来的会话 保留订阅的主题,能接收离线期间的消息)
clearSession: true
# 插件配置
pf4j: pf4j:
pluginsDir: ${user.home}/plugins # 插件目录 # pluginsDir: /tmp/
\ No newline at end of file pluginsDir: ../plugins
iotdb:
# ip: 192.168.19.191
ip: 127.0.0.1
port: 6667
username: root
password: root
\ No newline at end of file
...@@ -54,10 +54,10 @@ spring: ...@@ -54,10 +54,10 @@ spring:
# url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例 # url: jdbc:oracle:thin:@127.0.0.1:1521:xe # Oracle 连接的示例
# url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true;useUnicode=true;characterEncoding=utf-8 # SQLServer 连接的示例 # url: jdbc:sqlserver://127.0.0.1:1433;DatabaseName=ruoyi-vue-pro;SelectMethod=cursor;encrypt=false;rewriteBatchedStatements=true;useUnicode=true;characterEncoding=utf-8 # SQLServer 连接的示例
# url: jdbc:dm://127.0.0.1:5236?schema=RUOYI_VUE_PRO # DM 连接的示例 # url: jdbc:dm://127.0.0.1:5236?schema=RUOYI_VUE_PRO # DM 连接的示例
url: jdbc:kingbase8://127.0.0.1:54321/test # 人大金仓 KingbaseES 连接的示例 url: jdbc:kingbase8://127.0.0.1:54321/ht_aq # 人大金仓 KingbaseES 连接的示例
# url: jdbc:postgresql://192.168.19.128:54321/test # OpenGauss 连接的示例 # url: jdbc:postgresql://192.168.19.128:54321/test # OpenGauss 连接的示例
username: kingbase username: ht_aq
password: kingbase password: ht@1234
# username: sa # SQL Server 连接的示例 # username: sa # SQL Server 连接的示例
# password: Yudao@2024 # SQL Server 连接的示例 # password: Yudao@2024 # SQL Server 连接的示例
# username: SYSDBA # DM 连接的示例 # username: SYSDBA # DM 连接的示例
...@@ -81,8 +81,8 @@ spring: ...@@ -81,8 +81,8 @@ spring:
redis: redis:
host: 127.0.0.1 # 地址 host: 127.0.0.1 # 地址
port: 6379 # 端口 port: 6379 # 端口
database: 0 # 数据库索引 database: 1 # 数据库索引
# password: dev # 密码,建议生产环境开启 password: SXht@062025. # 密码,建议生产环境开启
--- #################### 定时任务相关配置 #################### --- #################### 定时任务相关配置 ####################
...@@ -132,7 +132,7 @@ spring: ...@@ -132,7 +132,7 @@ spring:
# virtual-host: / # virtual-host: /
# Kafka 配置项,对应 KafkaProperties 配置类 # Kafka 配置项,对应 KafkaProperties 配置类
kafka: kafka:
bootstrap-servers: 192.168.19.128:9092 bootstrap-servers: localhost:9092
producer: producer:
retries: 3 retries: 3
timeout: 60000 timeout: 60000
...@@ -278,4 +278,11 @@ justauth: ...@@ -278,4 +278,11 @@ justauth:
--- #################### iot相关配置 TODO 芋艿【IOT】:再瞅瞅 #################### --- #################### iot相关配置 TODO 芋艿【IOT】:再瞅瞅 ####################
pf4j: pf4j:
# pluginsDir: /tmp/ # pluginsDir: /tmp/
pluginsDir: ../plugins pluginsDir: ../plugins
\ No newline at end of file
iotdb:
# ip: 192.168.19.191
ip: 127.0.0.1
port: 6667
username: root
password: root
\ No newline at end of file
...@@ -4,6 +4,7 @@ spring: ...@@ -4,6 +4,7 @@ spring:
profiles: profiles:
active: local active: local
# active: dev
main: main:
allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。 allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。
...@@ -364,24 +365,26 @@ debug: false ...@@ -364,24 +365,26 @@ debug: false
pf4j: pf4j:
pluginsDir: /Users/anhaohao/code/gitee/ruoyi-vue-pro/plugins # 插件目录 pluginsDir: /Users/anhaohao/code/gitee/ruoyi-vue-pro/plugins # 插件目录
iotdb:
# ip: 192.168.19.191
ip: 127.0.0.1
port: 6667
username: root
password: root
aes: aes:
Key: sx+htIs=6a2t8qt% Key: sx+htIs=6a2t8qt%
ptauth: ptauth:
loginUrl: http://3h.sritcloud.com:8000/oauth/N1001 loginUrl: http://59.195.13.243:8000/oauth/N1001
getUserByToken: http://127.0.0.1:7006/oauth/N100101 getUserByToken: http://59.195.13.243:8000/oauth/N100101
getUserByCode: http://3h.sritcloud.com:8000/oauth/N100102 getUserByCode: http://59.195.13.243:8000/oauth/N100102
logOffToken: http://3h.sritcloud.com:8000/oauth/N1007 logOffToken: http://59.195.13.243:8000/oauth/N1007
refTokenUrl: http://3h.sritcloud.com:8000/oauth/N1010 refTokenUrl: http://59.195.13.243:8000/oauth/N1010
logOffTokenAndJump: http://3h.sritcloud.com:8000/oauth/oauth/logout?redirect_uri= logOffTokenAndJump: http://59.195.13.243:8000/oauth/oauth/logout?redirect_uri=
basicinfo: basicinfo:
userInfoUrl: http://59.195.13.243:8000/srit-open-api/data-service/api/user-info-list userInfoUrl: http://59.195.13.243:8000/srit-open-api/data-service/api/user-info-list
\ No newline at end of file deptInfoUrl: http://59.195.13.243:8000/srit-open-api/data-service/api/org-info-list
menuInfoUrl: http://59.195.13.243:8000/srit-open-api/data-service/api/sys-permission
bzInfoUrl: http://59.195.13.243:8000/srit-open-api/data-service/api/bzxxb
fkclInfoUrl: http://59.195.13.243:8000/srit-open-api/data-service/api/fkclxxb
sxtInfoUrl: http://59.195.13.243:8000/srit-open-api/data-service/api/sxtxxb
yldInfoUrl: http://59.195.13.243:8000/srit-open-api/data-service/api/yldsbxx
gdInfoUrl: http://59.195.13.243:8000/srit-open-api/data-service/api/dwd-obj-sbxx-gdsbxx
jgInfoUrl: http://59.195.13.243:8000/srit-open-api/data-service/api/dwd-obj-sbxx-jgsbxx
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment