增加继电器分组
This commit is contained in:
parent
f2f94ec05d
commit
ad48a995a7
|
|
@ -171,6 +171,12 @@ public class SysDictController {
|
||||||
public Result<List<DictModel>> getDictItems(@PathVariable("dictCode") String dictCode, @RequestParam(value = "sign",required = false) String sign,HttpServletRequest request) {
|
public Result<List<DictModel>> getDictItems(@PathVariable("dictCode") String dictCode, @RequestParam(value = "sign",required = false) String sign,HttpServletRequest request) {
|
||||||
log.info(" dictCode : "+ dictCode);
|
log.info(" dictCode : "+ dictCode);
|
||||||
Result<List<DictModel>> result = new Result<List<DictModel>>();
|
Result<List<DictModel>> result = new Result<List<DictModel>>();
|
||||||
|
if(dictCode.contains("undefined")){
|
||||||
|
List<DictModel> emptyList = new ArrayList<>();
|
||||||
|
result.setSuccess(true);
|
||||||
|
result.setResult(emptyList);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
//update-begin-author:taoyan date:20220317 for: VUEN-222【安全机制】字典接口、online报表、online图表等接口,加一些安全机制
|
//update-begin-author:taoyan date:20220317 for: VUEN-222【安全机制】字典接口、online报表、online图表等接口,加一些安全机制
|
||||||
if(!dictQueryBlackListHandler.isPass(dictCode)){
|
if(!dictQueryBlackListHandler.isPass(dictCode)){
|
||||||
return result.error500(dictQueryBlackListHandler.getError());
|
return result.error500(dictQueryBlackListHandler.getError());
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,9 @@ import org.jeecg.common.iot.common.DTOCamControl;
|
||||||
import org.jeecg.common.iot.common.IotDeviceCtlResult;
|
import org.jeecg.common.iot.common.IotDeviceCtlResult;
|
||||||
import org.jeecg.common.system.query.QueryGenerator;
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
import org.jeecg.common.system.util.JwtUtil;
|
import org.jeecg.common.system.util.JwtUtil;
|
||||||
|
import org.jeecg.common.util.EntityFieldUtil;
|
||||||
import org.jeecg.common.vo.DeviceCmdVo;
|
import org.jeecg.common.vo.DeviceCmdVo;
|
||||||
|
import org.jeecg.common.vo.DeviceCmdVo2;
|
||||||
import org.jeecg.modules.appmana.service.*;
|
import org.jeecg.modules.appmana.service.*;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
|
@ -70,6 +72,9 @@ public class SurvDeviceDeployController extends JeecgController<SurvDeviceDeploy
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISurvDeviceDeployService deviceDeployService;
|
private ISurvDeviceDeployService deviceDeployService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISurvDeviceDeployRelayService relayService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISurvConfigService survConfigService;
|
private ISurvConfigService survConfigService;
|
||||||
|
|
||||||
|
|
@ -241,6 +246,54 @@ public class SurvDeviceDeployController extends JeecgController<SurvDeviceDeploy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@AutoLog(value = "发送设备控制指令")
|
||||||
|
@ApiOperation(value="发送设备控制指令", notes="发送设备控制指令")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:edit")
|
||||||
|
@PostMapping(value = "/sendDeviceCmd")
|
||||||
|
public Result sendDeviceCmd(@RequestBody DeviceCmdVo deviceCmdVo) {
|
||||||
|
Assert.notBlank(deviceCmdVo.getOps(),"指令无效");
|
||||||
|
//获取指令
|
||||||
|
SurvDeviceDeployRelay relay = relayService.getById(deviceCmdVo.getRelayId());
|
||||||
|
Assert.notNull(relay,"控制项无效");
|
||||||
|
SurvDeviceDeploy deviceDeploy = deviceDeployService.getById(relay.getDeployId());
|
||||||
|
if(deviceDeploy != null){
|
||||||
|
|
||||||
|
String cmds = "";
|
||||||
|
String fieldName = relay.getEntityField();
|
||||||
|
if (IotConstants.DEVICE_CLOSE.equals(deviceCmdVo.getOps())) {//关逻辑
|
||||||
|
cmds = relay.getRegisterCmdOn();
|
||||||
|
} else if (IotConstants.DEVICE_ON.equals(deviceCmdVo.getOps())) {//开逻辑
|
||||||
|
cmds = relay.getRegisterCmdOff();
|
||||||
|
} else if (IotConstants.DEVICE_STOP.equals(deviceCmdVo.getOps())) {//停逻辑
|
||||||
|
cmds = relay.getRegisterCmdStop();
|
||||||
|
}
|
||||||
|
deviceDeploy.setSendInfo(cmds);
|
||||||
|
deviceDeployService.updateById(deviceDeploy);
|
||||||
|
|
||||||
|
try {
|
||||||
|
Thread.sleep(8 * 1000);
|
||||||
|
}catch (InterruptedException e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
SurvTransdataOrientwater transdataOrientwater = orientwaterService.getOneByDeviceCode(deviceDeploy.getDeployCode());
|
||||||
|
|
||||||
|
if(transdataOrientwater!=null){
|
||||||
|
String vals = EntityFieldUtil.getFieldValue(transdataOrientwater,fieldName,String.class);
|
||||||
|
if(deviceCmdVo.getOps().equals(vals)){
|
||||||
|
return Result.ok("操作成功");
|
||||||
|
}else{
|
||||||
|
return Result.error("最新数据的球阀状态与操作不一致,请联系管理员");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return Result.error("未收到该设备的最新数据,请稍后再次查看是否成功");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
return Result.error("无效的设备");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发送设备控制指令
|
* 发送设备控制指令
|
||||||
*
|
*
|
||||||
|
|
@ -255,8 +308,8 @@ public class SurvDeviceDeployController extends JeecgController<SurvDeviceDeploy
|
||||||
@AutoLog(value = "发送设备控制指令")
|
@AutoLog(value = "发送设备控制指令")
|
||||||
@ApiOperation(value="发送设备控制指令", notes="发送设备控制指令")
|
@ApiOperation(value="发送设备控制指令", notes="发送设备控制指令")
|
||||||
@RequiresPermissions("appmana:surv_device_deploy:edit")
|
@RequiresPermissions("appmana:surv_device_deploy:edit")
|
||||||
@PostMapping(value = "/sendDeviceCmd")
|
@PostMapping(value = "/sendDeviceCmd2")
|
||||||
public Result sendDeviceCmd(@RequestBody DeviceCmdVo deviceCmdVo) {
|
public Result sendDeviceCmd2(@RequestBody DeviceCmdVo2 deviceCmdVo) {
|
||||||
if(StringUtils.isBlank(deviceCmdVo.getDeployCode())){
|
if(StringUtils.isBlank(deviceCmdVo.getDeployCode())){
|
||||||
return Result.error("设备号不能为空");
|
return Result.error("设备号不能为空");
|
||||||
}
|
}
|
||||||
|
|
@ -354,4 +407,36 @@ public class SurvDeviceDeployController extends JeecgController<SurvDeviceDeploy
|
||||||
List<SurvDeviceDeploy> pageList = survDeviceDeployService.getDeviceListByStation(null,deviceFilterDTO.getDeployTypes());
|
List<SurvDeviceDeploy> pageList = survDeviceDeployService.getDeviceListByStation(null,deviceFilterDTO.getDeployTypes());
|
||||||
return Result.OK(pageList);
|
return Result.OK(pageList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping(value = "/getRelayList")
|
||||||
|
public Result<JSONObject> getRelayList(@RequestParam String deployId) {
|
||||||
|
|
||||||
|
SurvDeviceDeploy deploy = deviceDeployService.getById(deployId);
|
||||||
|
Assert.notNull(deploy,"无效设备");
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
Date dateTime = null;
|
||||||
|
if(PollutionConstants.WATER_ORIENT.equals(deploy.getDeployType())){
|
||||||
|
SurvTransdataOrientwater orientwater = orientwaterService.getOneByDeviceCode(deploy.getDeployCode());
|
||||||
|
if(orientwater!=null) {
|
||||||
|
dateTime = orientwater.getDataDateTime();
|
||||||
|
}
|
||||||
|
} else if (PollutionConstants.WATER_LIVE.contains(deploy.getDeployType())) {
|
||||||
|
SurvTransdataLivestockwater livestockwater = livestockwaterService.getOneByDeviceCode(deploy.getDeployCode());
|
||||||
|
if(livestockwater!=null) {
|
||||||
|
dateTime = livestockwater.getDataDateTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<SurvDeviceDeployRelay> pageList = relayService.relayList(deployId,null);
|
||||||
|
jsonObject.put("relayList",pageList);
|
||||||
|
|
||||||
|
if(dateTime==null) {
|
||||||
|
jsonObject.put("dataTime", "该设备没有监测数据返回");
|
||||||
|
}else{
|
||||||
|
jsonObject.put("dataTime",dateTime);
|
||||||
|
}
|
||||||
|
return Result.OK(jsonObject);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,229 @@
|
||||||
|
package org.jeecg.modules.appmana.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.entity.SurvDeviceDeployRelay;
|
||||||
|
import org.jeecg.common.iot.common.DeviceRelayTypeVo;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.util.JwtUtil;
|
||||||
|
import org.jeecg.common.system.vo.DictModel;
|
||||||
|
import org.jeecg.common.vo.dict.DictVo;
|
||||||
|
import org.jeecg.modules.appmana.service.ISurvConfigService;
|
||||||
|
import org.jeecg.modules.appmana.service.ISurvDeviceDeployRelayService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 设备继电器
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-12-20
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Api(tags = "99. 设备继电器 id")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/appmana/survDeviceDeployRelay")
|
||||||
|
@Slf4j
|
||||||
|
public class SurvDeviceDeployRelayController extends JeecgController<SurvDeviceDeployRelay, ISurvDeviceDeployRelayService> {
|
||||||
|
@Autowired
|
||||||
|
private ISurvDeviceDeployRelayService fDeviceDeployRelayService;
|
||||||
|
@Autowired
|
||||||
|
private ISurvConfigService configService;
|
||||||
|
|
||||||
|
|
||||||
|
//@AutoLog(value = "设备继电器-分页列表查询")
|
||||||
|
@ApiOperation(value = "01. 分页查询", notes = "")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<SurvDeviceDeployRelay>> queryPageList(SurvDeviceDeployRelay fDeviceDeployRelay,
|
||||||
|
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
if(StringUtils.isNotBlank(fDeviceDeployRelay.getRelayId())){
|
||||||
|
fDeviceDeployRelay.setDeployId(fDeviceDeployRelay.getRelayId());
|
||||||
|
}
|
||||||
|
QueryWrapper<SurvDeviceDeployRelay> queryWrapper = QueryGenerator.initQueryWrapper(fDeviceDeployRelay, req.getParameterMap());
|
||||||
|
Page<SurvDeviceDeployRelay> page = new Page<SurvDeviceDeployRelay>(pageNo, pageSize);
|
||||||
|
IPage<SurvDeviceDeployRelay> pageList = fDeviceDeployRelayService.page(page, queryWrapper);
|
||||||
|
fDeviceDeployRelayService.fills(pageList.getRecords());
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@AutoLog(value = "设备继电器-添加")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@ApiOperation(value = "02. 添加", notes = "")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody SurvDeviceDeployRelay fDeviceDeployRelay, HttpServletRequest request) {
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
fDeviceDeployRelay.setCreateBy(username);
|
||||||
|
fDeviceDeployRelay.setCreateTime(new Date());
|
||||||
|
fDeviceDeployRelayService.processGroupName(fDeviceDeployRelay);
|
||||||
|
fDeviceDeployRelayService.save(fDeviceDeployRelay);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "设备继电器-编辑")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@ApiOperation(value = "03. 编辑", notes = "")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:edit")
|
||||||
|
@PostMapping(value = "/edit")
|
||||||
|
public Result<String> edit(@RequestBody SurvDeviceDeployRelay fDeviceDeployRelay, HttpServletRequest request) {
|
||||||
|
//创建、更新时间不能编辑
|
||||||
|
fDeviceDeployRelay.setCreateTime(null);
|
||||||
|
fDeviceDeployRelay.setUpdateTime(null);
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
fDeviceDeployRelay.setUpdateBy(username);
|
||||||
|
fDeviceDeployRelayService.processGroupName(fDeviceDeployRelay);
|
||||||
|
fDeviceDeployRelayService.updateById(fDeviceDeployRelay);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "设备继电器-通过id删除")
|
||||||
|
@ApiOperation(value = "04.通过id删除", notes = "")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
fDeviceDeployRelayService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@AutoLog(value = "设备继电器-批量删除")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@ApiOperation(value = "04. 批量删除", notes = "")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
this.fDeviceDeployRelayService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//@AutoLog(value = "设备继电器-通过id查询")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@ApiOperation(value = "05. 通过id查询", notes = "")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<SurvDeviceDeployRelay> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||||
|
SurvDeviceDeployRelay fDeviceDeployRelay = fDeviceDeployRelayService.getById(id);
|
||||||
|
if (fDeviceDeployRelay == null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(fDeviceDeployRelay);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@ApiOperation(value = "06. 导出excel", notes = "")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:exportXls")
|
||||||
|
@GetMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, SurvDeviceDeployRelay fDeviceDeployRelay) {
|
||||||
|
return super.exportXls(request, fDeviceDeployRelay, SurvDeviceDeployRelay.class, "设备继电器");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@ApiOperation(value = "07. 导入excel", notes = "")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:importExcel")
|
||||||
|
@PostMapping(value = "/importExcel")
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, SurvDeviceDeployRelay.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "设备继电器-同步")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@ApiOperation(value = "04. 设备继电器-同步", notes = "")
|
||||||
|
@PostMapping(value = "/syncRelays")
|
||||||
|
public Result<String> syncRelays(@RequestParam(name = "ids", required = true) String ids) {
|
||||||
|
boolean b = fDeviceDeployRelayService.syncRelays(Arrays.asList(ids.split(",")));
|
||||||
|
if(b){
|
||||||
|
return Result.OK("同步成功!");
|
||||||
|
}else{
|
||||||
|
return Result.error("同步失败,请联系管理员!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重复校验
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/relayItemCheck", method = RequestMethod.GET)
|
||||||
|
@ApiOperation("重复校验接口")
|
||||||
|
public Result<Object> relayItemCheck(SurvDeviceDeployRelay fDeviceDeployRelay, HttpServletRequest request) {
|
||||||
|
// SurvDeviceDeployRelay relay = fDeviceDeployRelayService.getById(fDeviceDeployRelay.getId());
|
||||||
|
// Assert.notNull(relay,"无效继电器");
|
||||||
|
|
||||||
|
Long num = Long.valueOf(0);
|
||||||
|
LambdaQueryWrapper<SurvDeviceDeployRelay> queryWrapper = new LambdaQueryWrapper<SurvDeviceDeployRelay>();
|
||||||
|
queryWrapper.eq(SurvDeviceDeployRelay::getRelayKey, fDeviceDeployRelay.getRelayKey());
|
||||||
|
queryWrapper.eq(SurvDeviceDeployRelay::getDeployId, fDeviceDeployRelay.getDeployId());
|
||||||
|
if (StringUtils.isNotBlank(fDeviceDeployRelay.getId())) {
|
||||||
|
// 编辑页面校验
|
||||||
|
queryWrapper.ne(SurvDeviceDeployRelay::getId, fDeviceDeployRelay.getId());
|
||||||
|
}
|
||||||
|
num = fDeviceDeployRelayService.count(queryWrapper);
|
||||||
|
if (num == 0) {
|
||||||
|
// 该值可用
|
||||||
|
return Result.ok("该值可用!");
|
||||||
|
} else {
|
||||||
|
// 该值不可用
|
||||||
|
log.info("该值不可用,系统中已存在!");
|
||||||
|
return Result.error("该值不可用,系统中已存在!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation("13.获取继电器种类")
|
||||||
|
@ApiOperationSupport(order = 13)
|
||||||
|
@GetMapping("/getRelayType")
|
||||||
|
public Result getRelayType() {
|
||||||
|
/*1=风机,2=水泵,3=增氧机,4=湿帘,5=遮阳,6=开窗,7=保温,8=投食机*/
|
||||||
|
List<DeviceRelayTypeVo> relayTypeVos = new ArrayList<>();
|
||||||
|
|
||||||
|
|
||||||
|
List<DictVo> dictModels = configService.getDictByCode("iot_relay_type");
|
||||||
|
if(!dictModels.isEmpty()){
|
||||||
|
for (DictVo dictModel : dictModels) {
|
||||||
|
DeviceRelayTypeVo deviceRelayTypeVo = new DeviceRelayTypeVo();
|
||||||
|
deviceRelayTypeVo.setRelayType(dictModel.getValue());
|
||||||
|
deviceRelayTypeVo.setRelayTypeName(dictModel.getText());
|
||||||
|
relayTypeVos.add(deviceRelayTypeVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return Result.ok(relayTypeVos);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,178 @@
|
||||||
|
package org.jeecg.modules.appmana.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.entity.SurvDeviceDeployRelaygroup;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.util.JwtUtil;
|
||||||
|
import org.jeecg.modules.appmana.service.ISurvDeviceDeployRelaygroupService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 继电器分组
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-03-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Api(tags="99. 继电器分组 id")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/appmana/survDeviceDeployRelaygroup")
|
||||||
|
@Slf4j
|
||||||
|
public class SurvDeviceDeployRelaygroupController extends JeecgController<SurvDeviceDeployRelaygroup, ISurvDeviceDeployRelaygroupService> {
|
||||||
|
@Autowired
|
||||||
|
private ISurvDeviceDeployRelaygroupService fDeviceDeployRelaygroupService;
|
||||||
|
|
||||||
|
|
||||||
|
//@AutoLog(value = "继电器分组-分页列表查询")
|
||||||
|
@ApiOperation(value="01. 分页查询", notes="")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<SurvDeviceDeployRelaygroup>> queryPageList(SurvDeviceDeployRelaygroup fDeviceDeployRelaygroup,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<SurvDeviceDeployRelaygroup> queryWrapper = QueryGenerator.initQueryWrapper(fDeviceDeployRelaygroup, req.getParameterMap());
|
||||||
|
Page<SurvDeviceDeployRelaygroup> page = new Page<SurvDeviceDeployRelaygroup>(pageNo, pageSize);
|
||||||
|
IPage<SurvDeviceDeployRelaygroup> pageList = fDeviceDeployRelaygroupService.page(page, queryWrapper);
|
||||||
|
fDeviceDeployRelaygroupService.fills(pageList.getRecords());
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@AutoLog(value = "继电器分组-添加")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@ApiOperation(value="02. 添加", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody SurvDeviceDeployRelaygroup fDeviceDeployRelaygroup, HttpServletRequest request) {
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
fDeviceDeployRelaygroup.setCreateBy(username);
|
||||||
|
fDeviceDeployRelaygroup.setCreateTime(new Date());
|
||||||
|
fDeviceDeployRelaygroupService.save(fDeviceDeployRelaygroup);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "继电器分组-编辑")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@ApiOperation(value="03. 编辑", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:edit")
|
||||||
|
@PostMapping(value = "/edit")
|
||||||
|
public Result<String> edit(@RequestBody SurvDeviceDeployRelaygroup fDeviceDeployRelaygroup, HttpServletRequest request) {
|
||||||
|
//创建、更新时间不能编辑
|
||||||
|
fDeviceDeployRelaygroup.setCreateTime(null);
|
||||||
|
fDeviceDeployRelaygroup.setUpdateTime(null);
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
fDeviceDeployRelaygroup.setUpdateBy(username);
|
||||||
|
fDeviceDeployRelaygroupService.updateById(fDeviceDeployRelaygroup);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "继电器分组-通过id删除")
|
||||||
|
@ApiOperation(value="04.通过id删除", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
fDeviceDeployRelaygroupService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@AutoLog(value = "继电器分组-批量删除")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@ApiOperation(value="04. 批量删除", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.fDeviceDeployRelaygroupService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//@AutoLog(value = "继电器分组-通过id查询")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@ApiOperation(value="05. 通过id查询", notes="")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<SurvDeviceDeployRelaygroup> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
SurvDeviceDeployRelaygroup fDeviceDeployRelaygroup = fDeviceDeployRelaygroupService.getById(id);
|
||||||
|
if(fDeviceDeployRelaygroup==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(fDeviceDeployRelaygroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@ApiOperation(value="06. 导出excel", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:exportXls")
|
||||||
|
@GetMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, SurvDeviceDeployRelaygroup fDeviceDeployRelaygroup) {
|
||||||
|
return super.exportXls(request, fDeviceDeployRelaygroup, SurvDeviceDeployRelaygroup.class, "继电器分组");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@ApiOperation(value="07. 导入excel", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:importExcel")
|
||||||
|
@PostMapping(value = "/importExcel")
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, SurvDeviceDeployRelaygroup.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重复校验
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/itemCheck", method = RequestMethod.GET)
|
||||||
|
@ApiOperation("重复校验接口")
|
||||||
|
public Result<Object> itemCheck(SurvDeviceDeployRelaygroup fDeviceDeployRelaygroup, HttpServletRequest request) {
|
||||||
|
// SurvDeviceDeployRelaygroup relayGroup = fDeviceDeployRelaygroupService.getById(fDeviceDeployRelaygroup.getDeployId());
|
||||||
|
// Assert.notNull(relayGroup,"无效分组");
|
||||||
|
|
||||||
|
Long num = Long.valueOf(0);
|
||||||
|
LambdaQueryWrapper<SurvDeviceDeployRelaygroup> queryWrapper = new LambdaQueryWrapper<SurvDeviceDeployRelaygroup>();
|
||||||
|
queryWrapper.eq(SurvDeviceDeployRelaygroup::getGroupName, fDeviceDeployRelaygroup.getGroupName());
|
||||||
|
queryWrapper.eq(SurvDeviceDeployRelaygroup::getDeployId, fDeviceDeployRelaygroup.getDeployId());
|
||||||
|
if (StringUtils.isNotBlank(fDeviceDeployRelaygroup.getId())) {
|
||||||
|
// 编辑页面校验
|
||||||
|
queryWrapper.ne(SurvDeviceDeployRelaygroup::getId, fDeviceDeployRelaygroup.getId());
|
||||||
|
}
|
||||||
|
num = fDeviceDeployRelaygroupService.count(queryWrapper);
|
||||||
|
if (num == 0) {
|
||||||
|
// 该值可用
|
||||||
|
return Result.ok("该值可用!");
|
||||||
|
} else {
|
||||||
|
// 该值不可用
|
||||||
|
log.info("该值不可用,系统中已存在!");
|
||||||
|
return Result.error("该值不可用,系统中已存在!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,158 @@
|
||||||
|
package org.jeecg.modules.appmana.controller;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.entity.SurvIotManufacturerConfig;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.util.JwtUtil;
|
||||||
|
import org.jeecg.modules.appmana.service.ISurvIotManufacturerConfigService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 厂商配置
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-03-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Api(tags="99. 厂商配置 id")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/appmana/survIotManufacturerConfig")
|
||||||
|
@Slf4j
|
||||||
|
public class SurvIotManufacturerConfigController extends JeecgController<SurvIotManufacturerConfig, ISurvIotManufacturerConfigService> {
|
||||||
|
@Autowired
|
||||||
|
private ISurvIotManufacturerConfigService fIotManufacturerConfigService;
|
||||||
|
|
||||||
|
|
||||||
|
//@AutoLog(value = "厂商配置-分页列表查询")
|
||||||
|
@ApiOperation(value="01. 分页查询", notes="")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<SurvIotManufacturerConfig>> queryPageList(SurvIotManufacturerConfig survIotManufacturerConfig,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
QueryWrapper<SurvIotManufacturerConfig> queryWrapper = QueryGenerator.initQueryWrapper(survIotManufacturerConfig, req.getParameterMap());
|
||||||
|
Page<SurvIotManufacturerConfig> page = new Page<SurvIotManufacturerConfig>(pageNo, pageSize);
|
||||||
|
IPage<SurvIotManufacturerConfig> pageList = fIotManufacturerConfigService.page(page, queryWrapper);
|
||||||
|
if (!pageList.getRecords().isEmpty()) {
|
||||||
|
pageList.getRecords().forEach(item -> {
|
||||||
|
if (item.getConfigJson() != null) {
|
||||||
|
item.setConfigJsonStr(JSONUtil.toJsonStr(item.getConfigJson()));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@AutoLog(value = "厂商配置-添加")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@ApiOperation(value="02. 添加", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody SurvIotManufacturerConfig survIotManufacturerConfig, HttpServletRequest request) {
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
survIotManufacturerConfig.setCreateBy(username);
|
||||||
|
survIotManufacturerConfig.setCreateTime(new Date());
|
||||||
|
if (StringUtils.isNotBlank(survIotManufacturerConfig.getConfigJsonStr())) {
|
||||||
|
survIotManufacturerConfig.setConfigJson(JSONUtil.parseObj(survIotManufacturerConfig.getConfigJsonStr()));
|
||||||
|
}
|
||||||
|
fIotManufacturerConfigService.save(survIotManufacturerConfig);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "厂商配置-编辑")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@ApiOperation(value="03. 编辑", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:edit")
|
||||||
|
@PostMapping(value = "/edit")
|
||||||
|
public Result<String> edit(@RequestBody SurvIotManufacturerConfig survIotManufacturerConfig, HttpServletRequest request) {
|
||||||
|
//创建、更新时间不能编辑
|
||||||
|
survIotManufacturerConfig.setCreateTime(null);
|
||||||
|
survIotManufacturerConfig.setUpdateTime(null);
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
survIotManufacturerConfig.setUpdateBy(username);
|
||||||
|
if (StringUtils.isNotBlank(survIotManufacturerConfig.getConfigJsonStr())) {
|
||||||
|
survIotManufacturerConfig.setConfigJson(JSONUtil.parseObj(survIotManufacturerConfig.getConfigJsonStr()));
|
||||||
|
}
|
||||||
|
fIotManufacturerConfigService.updateById(survIotManufacturerConfig);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "厂商配置-通过id删除")
|
||||||
|
@ApiOperation(value="04.通过id删除", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
fIotManufacturerConfigService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@AutoLog(value = "厂商配置-批量删除")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@ApiOperation(value="04. 批量删除", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.fIotManufacturerConfigService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//@AutoLog(value = "厂商配置-通过id查询")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@ApiOperation(value="05. 通过id查询", notes="")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<SurvIotManufacturerConfig> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
SurvIotManufacturerConfig survIotManufacturerConfig = fIotManufacturerConfigService.getById(id);
|
||||||
|
if(survIotManufacturerConfig ==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(survIotManufacturerConfig);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@ApiOperation(value="06. 导出excel", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:exportXls")
|
||||||
|
@GetMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, SurvIotManufacturerConfig survIotManufacturerConfig) {
|
||||||
|
return super.exportXls(request, survIotManufacturerConfig, SurvIotManufacturerConfig.class, "厂商配置");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@ApiOperation(value="07. 导入excel", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:importExcel")
|
||||||
|
@PostMapping(value = "/importExcel")
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, SurvIotManufacturerConfig.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,149 @@
|
||||||
|
package org.jeecg.modules.appmana.controller;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.jeecg.common.entity.SurvIotManufacturerInfo;
|
||||||
|
import org.jeecg.common.system.base.controller.JeecgController;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.util.JwtUtil;
|
||||||
|
|
||||||
|
import org.jeecg.modules.appmana.service.ISurvIotManufacturerInfoService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 厂家信息
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-03-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Api(tags="99. 厂家信息 id")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/appmana/survIotManufacturerInfo")
|
||||||
|
@Slf4j
|
||||||
|
public class SurvIotManufacturerInfoController extends JeecgController<SurvIotManufacturerInfo, ISurvIotManufacturerInfoService> {
|
||||||
|
@Autowired
|
||||||
|
private ISurvIotManufacturerInfoService fIotManufacturerInfoService;
|
||||||
|
|
||||||
|
|
||||||
|
//@AutoLog(value = "厂家信息-分页列表查询")
|
||||||
|
@ApiOperation(value="01. 分页查询", notes="")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<SurvIotManufacturerInfo>> queryPageList(SurvIotManufacturerInfo fIotManufacturerInfo,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
if(StringUtils.isNotBlank(fIotManufacturerInfo.getMaName())){
|
||||||
|
fIotManufacturerInfo.setMaName("*"+fIotManufacturerInfo.getMaName()+"*");
|
||||||
|
}
|
||||||
|
|
||||||
|
QueryWrapper<SurvIotManufacturerInfo> queryWrapper = QueryGenerator.initQueryWrapper(fIotManufacturerInfo, req.getParameterMap());
|
||||||
|
Page<SurvIotManufacturerInfo> page = new Page<SurvIotManufacturerInfo>(pageNo, pageSize);
|
||||||
|
IPage<SurvIotManufacturerInfo> pageList = fIotManufacturerInfoService.page(page, queryWrapper);
|
||||||
|
return Result.OK(pageList);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@AutoLog(value = "厂家信息-添加")
|
||||||
|
@ApiOperationSupport(order = 2)
|
||||||
|
@ApiOperation(value="02. 添加", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody SurvIotManufacturerInfo fIotManufacturerInfo, HttpServletRequest request) {
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
fIotManufacturerInfo.setCreateBy(username);
|
||||||
|
fIotManufacturerInfo.setCreateTime(new Date());
|
||||||
|
fIotManufacturerInfoService.save(fIotManufacturerInfo);
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
@AutoLog(value = "厂家信息-编辑")
|
||||||
|
@ApiOperationSupport(order = 3)
|
||||||
|
@ApiOperation(value="03. 编辑", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:edit")
|
||||||
|
@PostMapping(value = "/edit")
|
||||||
|
public Result<String> edit(@RequestBody SurvIotManufacturerInfo fIotManufacturerInfo, HttpServletRequest request) {
|
||||||
|
//创建、更新时间不能编辑
|
||||||
|
fIotManufacturerInfo.setCreateTime(null);
|
||||||
|
fIotManufacturerInfo.setUpdateTime(null);
|
||||||
|
String username = JwtUtil.getUserNameByToken(request);
|
||||||
|
fIotManufacturerInfo.setUpdateBy(username);
|
||||||
|
fIotManufacturerInfoService.updateById(fIotManufacturerInfo);
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "厂家信息-通过id删除")
|
||||||
|
@ApiOperation(value="04.通过id删除", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
fIotManufacturerInfoService.removeById(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@AutoLog(value = "厂家信息-批量删除")
|
||||||
|
@ApiOperationSupport(order = 4)
|
||||||
|
@ApiOperation(value="04. 批量删除", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.fIotManufacturerInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//@AutoLog(value = "厂家信息-通过id查询")
|
||||||
|
@ApiOperationSupport(order = 5)
|
||||||
|
@ApiOperation(value="05. 通过id查询", notes="")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<SurvIotManufacturerInfo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
SurvIotManufacturerInfo fIotManufacturerInfo = fIotManufacturerInfoService.getById(id);
|
||||||
|
if(fIotManufacturerInfo==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(fIotManufacturerInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperationSupport(order = 6)
|
||||||
|
@ApiOperation(value="06. 导出excel", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:exportXls")
|
||||||
|
@GetMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, SurvIotManufacturerInfo fIotManufacturerInfo) {
|
||||||
|
return super.exportXls(request, fIotManufacturerInfo, SurvIotManufacturerInfo.class, "厂家信息");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperationSupport(order = 7)
|
||||||
|
@ApiOperation(value="07. 导入excel", notes="")
|
||||||
|
@RequiresPermissions("appmana:surv_device_deploy:importExcel")
|
||||||
|
@PostMapping(value = "/importExcel")
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
return super.importExcel(request, response, SurvIotManufacturerInfo.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package org.jeecg.modules.appmana.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.common.entity.SurvDeviceDeployRelay;
|
||||||
|
import org.jeecg.common.iot.common.DeployRelayCountVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 设备继电器
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-12-20
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface SurvDeviceDeployRelayMapper extends BaseMapper<SurvDeviceDeployRelay> {
|
||||||
|
|
||||||
|
List<DeployRelayCountVo> getItemCounts(@Param("depList") List<String> depList);
|
||||||
|
|
||||||
|
List<SurvDeviceDeployRelay> relayList(@Param("deployId") String deployId, @Param("groups") List<String> groups);
|
||||||
|
|
||||||
|
List<SurvDeviceDeployRelay> deployRelayList(@Param("deployId") List<String> deployId, @Param("groups") List<String> groups);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.appmana.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.common.entity.SurvDeviceDeployRelaygroup;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 继电器分组
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-03-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface SurvDeviceDeployRelaygroupMapper extends BaseMapper<SurvDeviceDeployRelaygroup> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.appmana.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.common.entity.SurvIotManufacturerConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 厂商配置
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-03-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface SurvIotManufacturerConfigMapper extends BaseMapper<SurvIotManufacturerConfig> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.appmana.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.jeecg.common.entity.SurvIotManufacturerInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 厂家信息
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-03-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface SurvIotManufacturerInfoMapper extends BaseMapper<SurvIotManufacturerInfo> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -138,4 +138,10 @@
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getDeployInfo" resultType="org.jeecg.common.entity.SurvDeviceDeploy">
|
||||||
|
select *
|
||||||
|
from surv_device_deploy
|
||||||
|
where ID = #{deployId};
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -0,0 +1,102 @@
|
||||||
|
<?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="org.jeecg.modules.appmana.mapper.SurvDeviceDeployRelayMapper">
|
||||||
|
|
||||||
|
<resultMap type="org.jeecg.common.entity.SurvDeviceDeployRelay" id="SurvDeviceDeployRelayMap">
|
||||||
|
<result property="id" column="ID" jdbcType="VARCHAR"/>
|
||||||
|
<result property="deployId" column="DEPLOY_ID" jdbcType="VARCHAR"/>
|
||||||
|
<result property="relayCate" column="RELAY_CATE" jdbcType="INTEGER"/>
|
||||||
|
<result property="relayType" column="RELAY_TYPE" jdbcType="INTEGER"/>
|
||||||
|
<result property="relayKey" column="RELAY_KEY" jdbcType="VARCHAR"/>
|
||||||
|
<result property="relayName" column="RELAY_NAME" jdbcType="VARCHAR"/>
|
||||||
|
<result property="relayNotes" column="RELAY_NOTES" jdbcType="VARCHAR"/>
|
||||||
|
<result property="relayMark" column="RELAY_MARK" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
|
<result property="registerType" column="REGISTER_TYPE" jdbcType="INTEGER"/>
|
||||||
|
<result property="registerNum" column="REGISTER_NUM" jdbcType="INTEGER"/>
|
||||||
|
<result property="registerCmdOn" column="REGISTER_CMD_ON" jdbcType="VARCHAR"/>
|
||||||
|
<result property="registerCmdOff" column="REGISTER_CMD_OFF" jdbcType="VARCHAR"/>
|
||||||
|
<result property="registerCmdStop" column="REGISTER_CMD_STOP" jdbcType="VARCHAR"/>
|
||||||
|
<result property="registerOn" column="REGISTER_ON" jdbcType="VARCHAR"/>
|
||||||
|
<result property="registerOff" column="REGISTER_OFF" jdbcType="VARCHAR"/>
|
||||||
|
<result property="registerStop" column="REGISTER_STOP" jdbcType="VARCHAR"/>
|
||||||
|
<result property="entityField" column="ENTITY_FIELD" jdbcType="VARCHAR"/>
|
||||||
|
|
||||||
|
<result property="isEnable" column="IS_ENABLE" jdbcType="INTEGER"/>
|
||||||
|
<result property="isAbleRemote" column="IS_ABLE_REMOTE" jdbcType="INTEGER"/>
|
||||||
|
|
||||||
|
<result property="groupId" column="GROUP_ID" jdbcType="VARCHAR"/>
|
||||||
|
<result property="groupCode" column="GROUP_CODE" jdbcType="VARCHAR"/>
|
||||||
|
<result property="groupName" column="GROUP_NAME" jdbcType="VARCHAR"/>
|
||||||
|
<result property="sortNo" column="SORT_NO" jdbcType="INTEGER"/>
|
||||||
|
<result property="tenantId" column="TENANT_ID" jdbcType="VARCHAR"/>
|
||||||
|
<result property="reVision" column="RE_VISION" jdbcType="INTEGER"/>
|
||||||
|
<result property="createBy" column="CREATE_BY" jdbcType="VARCHAR"/>
|
||||||
|
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
|
||||||
|
<result property="updateBy" column="UPDATE_BY" jdbcType="VARCHAR"/>
|
||||||
|
<result property="isDel" column="IS_DEL" jdbcType="INTEGER"/>
|
||||||
|
<result property="updateTime" column="UPDATE_TIME" jdbcType="TIMESTAMP"/>
|
||||||
|
<result property="revision" column="REVISION" jdbcType="INTEGER"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="baseSql">
|
||||||
|
ID,DEPLOY_ID,RELAY_CATE,RELAY_TYPE,RELAY_KEY,RELAY_NAME,RELAY_NOTES,RELAY_MARK,REGISTER_TYPE,REGISTER_NUM,REGISTER_CMD_ON,REGISTER_CMD_OFF,REGISTER_CMD_STOP,REGISTER_ON,REGISTER_OFF,REGISTER_STOP,IS_ENABLE,IS_ABLE_REMOTE,GROUP_ID,GROUP_CODE,GROUP_NAME,SORT_NO,TENANT_ID,RE_VISION,CREATE_BY,CREATE_TIME,UPDATE_BY,IS_DEL,UPDATE_TIME,REVISION,ENTITY_FIELD
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<resultMap id="baseResultMap" type="org.jeecg.common.entity.SurvDeviceDeployRelay"
|
||||||
|
extends="SurvDeviceDeployRelayMap">
|
||||||
|
<association property="deploy" javaType="org.jeecg.common.entity.SurvDeviceDeploy"
|
||||||
|
column="{deployId = DEPLOY_ID}"
|
||||||
|
select="org.jeecg.modules.appmana.mapper.SurvDeviceDeployMapper.getDeployInfo"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getItemCounts" resultType="org.jeecg.common.iot.common.DeployRelayCountVo">
|
||||||
|
select DEPLOY_ID as deployId,count(ID) as relayCounts from surv_device_deploy_relay
|
||||||
|
where IS_DEL = 0 AND DEPLOY_ID IN
|
||||||
|
<foreach item="id" collection="depList" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
group by DEPLOY_ID;
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="relayList" resultMap="SurvDeviceDeployRelayMap">
|
||||||
|
select
|
||||||
|
<include refid="baseSql"/>
|
||||||
|
from surv_device_deploy_relay
|
||||||
|
<where>
|
||||||
|
and IS_ENABLE = 1
|
||||||
|
<if test="deployId != null and deployId != ''">
|
||||||
|
and DEPLOY_ID = #{deployId}
|
||||||
|
</if>
|
||||||
|
<if test="groups != null and groups.size()>0">
|
||||||
|
and GROUP_ID in
|
||||||
|
<foreach item="id" collection="groups" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="deployRelayList" resultMap="SurvDeviceDeployRelayMap">
|
||||||
|
select
|
||||||
|
<include refid="baseSql"/>
|
||||||
|
from surv_device_deploy_relay
|
||||||
|
<where>
|
||||||
|
and IS_ENABLE = 1
|
||||||
|
<if test="deployId != null and deployId.size()>0">
|
||||||
|
and DEPLOY_ID in
|
||||||
|
<foreach item="id" collection="deployId" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
<if test="groups != null and groups.size()>0">
|
||||||
|
and GROUP_ID in
|
||||||
|
<foreach item="id" collection="groups" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?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="org.jeecg.modules.appmana.mapper.SurvDeviceDeployRelaygroupMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?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="org.jeecg.modules.appmana.mapper.SurvIotManufacturerConfigMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?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="org.jeecg.modules.appmana.mapper.SurvIotManufacturerInfoMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -10,6 +10,7 @@ import org.springframework.cache.annotation.Cacheable;
|
||||||
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 业务参数配置表
|
* @Description: 业务参数配置表
|
||||||
|
|
@ -32,4 +33,6 @@ public interface ISurvConfigService extends IService<SurvConfig> {
|
||||||
List<DictVo> getDictByCode(String applyConfigType);
|
List<DictVo> getDictByCode(String applyConfigType);
|
||||||
|
|
||||||
IPage<SurvConfig> pages(Page<SurvConfig> page, SurvConfig survConfig);
|
IPage<SurvConfig> pages(Page<SurvConfig> page, SurvConfig survConfig);
|
||||||
|
|
||||||
|
Map<String, String> getDictMapByCode(String dictCode);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package org.jeecg.modules.appmana.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.common.entity.SurvDeviceDeploy;
|
||||||
|
import org.jeecg.common.entity.SurvDeviceDeployRelay;
|
||||||
|
import org.jeecg.common.iot.common.DeployRelayCountVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 设备继电器
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-12-20
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface ISurvDeviceDeployRelayService extends IService<SurvDeviceDeployRelay> {
|
||||||
|
|
||||||
|
boolean syncRelays(List<String> list);
|
||||||
|
|
||||||
|
List<DeployRelayCountVo> getItemCounts(List<String> depIdList);
|
||||||
|
|
||||||
|
/*延迟低版本*/
|
||||||
|
SurvDeviceDeploy addStatus(SurvDeviceDeploy deploy, List<SurvDeviceDeployRelay> relays);
|
||||||
|
|
||||||
|
/*初版1分钟延迟版本*/
|
||||||
|
void addStatus2(SurvDeviceDeploy deploy, List<SurvDeviceDeployRelay> relays);
|
||||||
|
|
||||||
|
List<SurvDeviceDeployRelay> relayList(String deployId, List<String> groups);
|
||||||
|
|
||||||
|
List<SurvDeviceDeployRelay> deployRelayList(List<String> deployId, List<String> groupId);
|
||||||
|
|
||||||
|
void addGroupName(List<SurvDeviceDeployRelay> records);
|
||||||
|
|
||||||
|
void processGroupName(SurvDeviceDeployRelay fDeviceDeployRelay);
|
||||||
|
|
||||||
|
void fills(List<SurvDeviceDeployRelay> list);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package org.jeecg.modules.appmana.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.common.entity.SurvDeviceDeployRelaygroup;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 继电器分组
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-03-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface ISurvDeviceDeployRelaygroupService extends IService<SurvDeviceDeployRelaygroup> {
|
||||||
|
|
||||||
|
void fills(List<SurvDeviceDeployRelaygroup> records);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.appmana.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.common.entity.SurvIotManufacturerConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 厂商配置
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-03-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface ISurvIotManufacturerConfigService extends IService<SurvIotManufacturerConfig> {
|
||||||
|
SurvIotManufacturerConfig getConfigByProtocol(String protocolCode);
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
package org.jeecg.modules.appmana.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.jeecg.common.entity.SurvIotManufacturerInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 厂家信息
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-03-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface ISurvIotManufacturerInfoService extends IService<SurvIotManufacturerInfo> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -17,10 +17,7 @@ import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.*;
|
||||||
import java.util.LinkedHashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -127,4 +124,14 @@ public class SurvConfigServiceImpl extends ServiceImpl<SurvConfigMapper, SurvCon
|
||||||
}
|
}
|
||||||
return pageList;
|
return pageList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, String> getDictMapByCode(String dictCode) {
|
||||||
|
List<DictVo> list = getDictByCode(dictCode);
|
||||||
|
Map<String,String> map = new HashMap<>();
|
||||||
|
if(!list.isEmpty()){
|
||||||
|
list.forEach(item->map.put(item.getValue(),item.getText()));
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,307 @@
|
||||||
|
package org.jeecg.modules.appmana.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.lang.Assert;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import org.jeecg.common.constant.IotConstants;
|
||||||
|
import org.jeecg.common.entity.SurvDeviceDeploy;
|
||||||
|
import org.jeecg.common.entity.SurvDeviceDeployRelay;
|
||||||
|
import org.jeecg.common.entity.SurvDeviceDeployRelaygroup;
|
||||||
|
import org.jeecg.common.iot.common.DeployRelayCountVo;
|
||||||
|
import org.jeecg.common.iot.xph.XphDeviceInfoVo;
|
||||||
|
import org.jeecg.common.iot.xph.XphDeviceNewestDataDetailVo;
|
||||||
|
import org.jeecg.common.iot.xph.XphDeviceNewestDataRelVo;
|
||||||
|
import org.jeecg.common.iot.xph.XphDeviceNewestDataVo;
|
||||||
|
import org.jeecg.modules.appmana.mapper.SurvDeviceDeployRelayMapper;
|
||||||
|
import org.jeecg.modules.appmana.service.ISurvDeviceDeployRelayService;
|
||||||
|
import org.jeecg.modules.appmana.utils.XphUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 设备继电器
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-12-20
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SurvDeviceDeployRelayServiceImpl extends ServiceImpl<SurvDeviceDeployRelayMapper, SurvDeviceDeployRelay> implements ISurvDeviceDeployRelayService {
|
||||||
|
@Autowired
|
||||||
|
@Lazy
|
||||||
|
private SurvDeviceDeployServiceImpl deviceDeployService;
|
||||||
|
@Autowired
|
||||||
|
@Lazy
|
||||||
|
private SurvDeviceDeployRelaygroupServiceImpl relaygroupService;
|
||||||
|
@Autowired
|
||||||
|
@Lazy
|
||||||
|
private XphUtils xphUtils;
|
||||||
|
@Autowired
|
||||||
|
@Lazy
|
||||||
|
private SurvConfigServiceImpl configService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean syncRelays(List<String> list) {
|
||||||
|
if (!list.isEmpty()) {
|
||||||
|
List<SurvDeviceDeploy> deploys = deviceDeployService.listByIds(list);
|
||||||
|
if (!deploys.isEmpty()) {
|
||||||
|
for (SurvDeviceDeploy deploy : deploys) {
|
||||||
|
XphDeviceInfoVo xphDeviceInfoVo = xphUtils.getDeviceInfo(deploy);
|
||||||
|
if (xphDeviceInfoVo != null) {
|
||||||
|
deviceDeployService.updDeployRelay(deploy, xphDeviceInfoVo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<DeployRelayCountVo> getItemCounts(List<String> depList) {
|
||||||
|
return baseMapper.getItemCounts(depList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*延迟低版本*/
|
||||||
|
@Override
|
||||||
|
public SurvDeviceDeploy addStatus(SurvDeviceDeploy deploy, List<SurvDeviceDeployRelay> relays) {
|
||||||
|
if (!relays.isEmpty()) {
|
||||||
|
switch (deploy.getProtocolCode()) {
|
||||||
|
case IotConstants.xph_v2:
|
||||||
|
deploy.setRelayList(processXphRelays(deploy, relays));
|
||||||
|
break;
|
||||||
|
case IotConstants.lhviot_standard:
|
||||||
|
//蓝海http逻辑 todo
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return deploy;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*初版1分钟延迟版本*/
|
||||||
|
@Override
|
||||||
|
public void addStatus2(SurvDeviceDeploy deploy, List<SurvDeviceDeployRelay> relays) {
|
||||||
|
if (!relays.isEmpty()) {
|
||||||
|
XphDeviceNewestDataVo deviceNewestDataVo = xphUtils.getDeviceNewestData(deploy);
|
||||||
|
Map<String, Integer> relayMap = new HashMap<>();
|
||||||
|
Map<String, String> relayDesMap = new HashMap<>();
|
||||||
|
if (deviceNewestDataVo != null) {
|
||||||
|
if (deviceNewestDataVo.getList() != null) {
|
||||||
|
XphDeviceNewestDataDetailVo xphDeviceNewestDataDetailVo = deviceNewestDataVo.getList().get(0);
|
||||||
|
if (xphDeviceNewestDataDetailVo != null) {
|
||||||
|
if (xphDeviceNewestDataDetailVo.getRelLists() != null && !xphDeviceNewestDataDetailVo.getRelLists().isEmpty()) {
|
||||||
|
for (XphDeviceNewestDataRelVo rel : xphDeviceNewestDataDetailVo.getRelLists()) {
|
||||||
|
String relayNum = rel.getKey().replace("j", "");
|
||||||
|
Integer status = null;
|
||||||
|
String statusDes = "";
|
||||||
|
if ("开".equals(rel.getValue())) {
|
||||||
|
status = 1;
|
||||||
|
} else if ("关".equals(rel.getValue())) {
|
||||||
|
status = 0;
|
||||||
|
} else {
|
||||||
|
status = 2;
|
||||||
|
}
|
||||||
|
statusDes = rel.getValue();
|
||||||
|
if (StringUtils.isBlank(statusDes)) {
|
||||||
|
statusDes = "设备异常";
|
||||||
|
}
|
||||||
|
Integer keyNum = Integer.parseInt(relayNum) - 1;
|
||||||
|
relayMap.put(keyNum + "", status);
|
||||||
|
relayDesMap.put(keyNum + "", statusDes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (SurvDeviceDeployRelay relay : relays) {
|
||||||
|
relay.setRelayValue(relayMap.get(relay.getRelayKey()));
|
||||||
|
relay.setRelayValueDes(relayDesMap.get(relay.getRelayKey()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<SurvDeviceDeployRelay> getAllItem(List<String> depIdList) {
|
||||||
|
|
||||||
|
List<SurvDeviceDeployRelay> relays = lambdaQuery()
|
||||||
|
.in(SurvDeviceDeployRelay::getDeployId, depIdList)
|
||||||
|
.eq(SurvDeviceDeployRelay::getIsDel, 0)
|
||||||
|
.orderByAsc(SurvDeviceDeployRelay::getSortNo)
|
||||||
|
.orderByDesc(SurvDeviceDeployRelay::getCreateTime)
|
||||||
|
.list();
|
||||||
|
return relays;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SurvDeviceDeployRelay> getAllItemById(String deployId) {
|
||||||
|
List<SurvDeviceDeployRelay> relays = lambdaQuery()
|
||||||
|
.eq(SurvDeviceDeployRelay::getDeployId, deployId)
|
||||||
|
.eq(SurvDeviceDeployRelay::getIsDel, 0)
|
||||||
|
.orderByAsc(SurvDeviceDeployRelay::getSortNo)
|
||||||
|
.orderByDesc(SurvDeviceDeployRelay::getCreateTime)
|
||||||
|
.list();
|
||||||
|
return relays;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SurvDeviceDeployRelay> relayList(String deployId, List<String> groups) {
|
||||||
|
return baseMapper.relayList(deployId, groups);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SurvDeviceDeployRelay> deployRelayList(List<String> deployId, List<String> groupId) {
|
||||||
|
return baseMapper.deployRelayList(deployId, groupId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addGroupName(List<SurvDeviceDeployRelay> records) {
|
||||||
|
if(!records.isEmpty()){
|
||||||
|
List<String> groupIds = records.stream().map(SurvDeviceDeployRelay::getGroupId).collect(Collectors.toList());
|
||||||
|
if(!groupIds.isEmpty()){
|
||||||
|
List<SurvDeviceDeployRelaygroup> relaygroups = relaygroupService.listByIds(groupIds);
|
||||||
|
if(!relaygroups.isEmpty()){
|
||||||
|
Map<String,String> map = new HashMap<>();
|
||||||
|
relaygroups.forEach(item->{
|
||||||
|
map.put(item.getId(),item.getGroupName());
|
||||||
|
});
|
||||||
|
|
||||||
|
for (SurvDeviceDeployRelay record : records) {
|
||||||
|
record.setGroupNameStr(map.get(record.getGroupId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processGroupName(SurvDeviceDeployRelay fDeviceDeployRelay) {
|
||||||
|
SurvDeviceDeploy deploy = deviceDeployService.getById(fDeviceDeployRelay.getDeployId());
|
||||||
|
Assert.notNull(deploy,"设备已失效");
|
||||||
|
if(StringUtils.isNotBlank(fDeviceDeployRelay.getGroupId())){
|
||||||
|
if(containsChinese(fDeviceDeployRelay.getGroupId())){//如果含有中文,说明为新增
|
||||||
|
String groupId = IdUtil.getSnowflakeNextIdStr();;
|
||||||
|
SurvDeviceDeployRelaygroup fDeviceDeployRelaygroup = new SurvDeviceDeployRelaygroup();
|
||||||
|
fDeviceDeployRelaygroup.setId(groupId);
|
||||||
|
fDeviceDeployRelaygroup.setDeployId(deploy.getId());
|
||||||
|
fDeviceDeployRelaygroup.setGroupName(fDeviceDeployRelay.getGroupId());
|
||||||
|
fDeviceDeployRelaygroup.setGroupType("switch");
|
||||||
|
fDeviceDeployRelaygroup.setGroupNotes("分组_"+fDeviceDeployRelay.getGroupId());
|
||||||
|
fDeviceDeployRelaygroup.setSortNo(fDeviceDeployRelay.getSortNo());//暂时使用继电器的排序
|
||||||
|
fDeviceDeployRelaygroup.setTenantId(deploy.getTenantId());
|
||||||
|
relaygroupService.save(fDeviceDeployRelaygroup);
|
||||||
|
//最终设置分组id
|
||||||
|
fDeviceDeployRelay.setGroupId(groupId);
|
||||||
|
}else{//如果是直接传入分组id
|
||||||
|
//如果更改了分组id,检查是否需要移除当前的空分组
|
||||||
|
if(StringUtils.isNotBlank(fDeviceDeployRelay.getId())){
|
||||||
|
SurvDeviceDeployRelay oldRelay = getById(fDeviceDeployRelay.getId());
|
||||||
|
if(oldRelay.getGroupId()!=null && !oldRelay.getGroupId().equals(fDeviceDeployRelay.getGroupId())){//更换了分组id
|
||||||
|
proceDelGroup(oldRelay.getGroupId(),fDeviceDeployRelay.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
if(StringUtils.isNotBlank(fDeviceDeployRelay.getId())){
|
||||||
|
SurvDeviceDeployRelay oldRelay = getById(fDeviceDeployRelay.getId());
|
||||||
|
if(oldRelay.getGroupId()!=null){//移除了之前的分组,则检查是否清理分组
|
||||||
|
proceDelGroup(oldRelay.getGroupId(),fDeviceDeployRelay.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查是否需要清理分组
|
||||||
|
*/
|
||||||
|
public void proceDelGroup(String groupId,String curRelayId){
|
||||||
|
//检查分组是否已空
|
||||||
|
long counts = lambdaQuery()
|
||||||
|
.eq(SurvDeviceDeployRelay::getGroupId, groupId)
|
||||||
|
.ne(SurvDeviceDeployRelay::getId, curRelayId)
|
||||||
|
.count();
|
||||||
|
if (counts == 0) {
|
||||||
|
relaygroupService.lambdaUpdate().eq(SurvDeviceDeployRelaygroup::getId, groupId).remove();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断字符串是否包含中文字符
|
||||||
|
*
|
||||||
|
* @param input 输入字符串
|
||||||
|
* @return 是否包含中文字符
|
||||||
|
*/
|
||||||
|
public static boolean containsChinese(String input) {
|
||||||
|
String regex = "[\u4e00-\u9fa5]"; // 匹配中文字符的正则表达式
|
||||||
|
Pattern pattern = Pattern.compile(regex);
|
||||||
|
Matcher matcher = pattern.matcher(input);
|
||||||
|
return matcher.find(); // 如果找到中文字符,返回 true
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<SurvDeviceDeployRelay> processXphRelays(SurvDeviceDeploy deploy,List<SurvDeviceDeployRelay> relays){
|
||||||
|
List<String> relayStatusList = xphUtils.getDeviceRelayStatus(deploy);
|
||||||
|
Map<String, Integer> relayMap = new HashMap<>();
|
||||||
|
Map<String, String> relayDesMap = new HashMap<>();
|
||||||
|
if (relayStatusList != null) {
|
||||||
|
int relayNum = 1;
|
||||||
|
for (String re : relayStatusList) {
|
||||||
|
Integer status = null;
|
||||||
|
String statusDes = "";
|
||||||
|
if ("open".equals(re)) {
|
||||||
|
statusDes = "开";
|
||||||
|
status = 1;
|
||||||
|
} else if ("close".equals(re)) {
|
||||||
|
statusDes = "关";
|
||||||
|
status = 0;
|
||||||
|
} else {
|
||||||
|
statusDes = "异常";
|
||||||
|
status = 2;
|
||||||
|
}
|
||||||
|
Integer keyNum = relayNum - 1;
|
||||||
|
relayMap.put(keyNum + "", status);
|
||||||
|
relayDesMap.put(keyNum + "", statusDes);
|
||||||
|
relayNum++;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
for (SurvDeviceDeployRelay relay : relays) {
|
||||||
|
relay.setRelayValue(relayMap.get(relay.getRelayKey()));
|
||||||
|
relay.setRelayValueDes(relayDesMap.get(relay.getRelayKey()));
|
||||||
|
relay.setIsOnline(deploy.getIsOnline());
|
||||||
|
}
|
||||||
|
return relays;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fills(List<SurvDeviceDeployRelay> list) {
|
||||||
|
if(list!=null && !list.isEmpty()){
|
||||||
|
Map<String,String> typeMaps = configService.getDictMapByCode("iot_relay_type");
|
||||||
|
Map<String,String> cateMaps = configService.getDictMapByCode("iot_relay_cate");
|
||||||
|
List<SurvDeviceDeployRelaygroup> relaygroups = relaygroupService.groupList(list.get(0).getDeployId());
|
||||||
|
Map<String,String> groupMaps = new HashMap<>();
|
||||||
|
if(!relaygroups.isEmpty()){
|
||||||
|
relaygroups.forEach(item->groupMaps.put(item.getId(),item.getGroupName()));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (SurvDeviceDeployRelay survDeviceDeployRelay : list) {
|
||||||
|
survDeviceDeployRelay.setRelayCateName(cateMaps.get(survDeviceDeployRelay.getRelayCate()+""));
|
||||||
|
survDeviceDeployRelay.setRelayTypeName(typeMaps.get(survDeviceDeployRelay.getRelayType()+""));
|
||||||
|
survDeviceDeployRelay.setGroupNameStr(groupMaps.get(survDeviceDeployRelay.getGroupId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
package org.jeecg.modules.appmana.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.jeecg.common.entity.SurvDeviceDeployRelaygroup;
|
||||||
|
import org.jeecg.modules.appmana.mapper.SurvDeviceDeployRelaygroupMapper;
|
||||||
|
import org.jeecg.modules.appmana.service.ISurvDeviceDeployRelaygroupService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 继电器分组
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-03-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SurvDeviceDeployRelaygroupServiceImpl extends ServiceImpl<SurvDeviceDeployRelaygroupMapper, SurvDeviceDeployRelaygroup> implements ISurvDeviceDeployRelaygroupService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
@Lazy
|
||||||
|
private SurvConfigServiceImpl configService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fills(List<SurvDeviceDeployRelaygroup> records) {
|
||||||
|
if(records!=null && !records.isEmpty()){
|
||||||
|
Map<String,String> maps = configService.getDictMapByCode("iot_relay_group_type");
|
||||||
|
for (SurvDeviceDeployRelaygroup record : records) {
|
||||||
|
record.setGroupTypeName(maps.get(record.getGroupType()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public List<SurvDeviceDeployRelaygroup> groupList(String deployId) {
|
||||||
|
List<SurvDeviceDeployRelaygroup> list = lambdaQuery()
|
||||||
|
.eq(SurvDeviceDeployRelaygroup::getIsEnable,1)
|
||||||
|
.eq(SurvDeviceDeployRelaygroup::getDeployId,deployId)
|
||||||
|
.list();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
package org.jeecg.modules.appmana.service.impl;
|
package org.jeecg.modules.appmana.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.lang.Assert;
|
import cn.hutool.core.lang.Assert;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -11,10 +13,14 @@ import org.jeecg.common.constant.PollutionConstants;
|
||||||
import org.jeecg.common.constant.enums.DeviceDeployEnum;
|
import org.jeecg.common.constant.enums.DeviceDeployEnum;
|
||||||
import org.jeecg.common.entity.*;
|
import org.jeecg.common.entity.*;
|
||||||
import org.jeecg.common.constant.enums.IotManufacturerEnum;
|
import org.jeecg.common.constant.enums.IotManufacturerEnum;
|
||||||
|
import org.jeecg.common.exception.JeecgBootException;
|
||||||
import org.jeecg.common.iot.renke.DataItem;
|
import org.jeecg.common.iot.renke.DataItem;
|
||||||
import org.jeecg.common.iot.renke.RegisterItem;
|
import org.jeecg.common.iot.renke.RegisterItem;
|
||||||
import org.jeecg.common.iot.renke.RenkeDataRealTimeDetail;
|
import org.jeecg.common.iot.renke.RenkeDataRealTimeDetail;
|
||||||
import org.jeecg.common.iot.renke.RenkeDataRealTimePack;
|
import org.jeecg.common.iot.renke.RenkeDataRealTimePack;
|
||||||
|
import org.jeecg.common.iot.rule.ManufacturerConfigRelayGroupVo;
|
||||||
|
import org.jeecg.common.iot.rule.ManufacturerConfigVo;
|
||||||
|
import org.jeecg.common.iot.xph.XphDeviceInfoVo;
|
||||||
import org.jeecg.common.iot.xph.XphDeviceQueryDataVo;
|
import org.jeecg.common.iot.xph.XphDeviceQueryDataVo;
|
||||||
import org.jeecg.common.iot.xph.XphdeviceQueryDetailVo;
|
import org.jeecg.common.iot.xph.XphdeviceQueryDetailVo;
|
||||||
import org.jeecg.modules.appmana.mapper.SurvDeviceDeployMapper;
|
import org.jeecg.modules.appmana.mapper.SurvDeviceDeployMapper;
|
||||||
|
|
@ -29,10 +35,7 @@ import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
|
@ -65,6 +68,13 @@ public class SurvDeviceDeployServiceImpl extends ServiceImpl<SurvDeviceDeployMap
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISurvStationInfoService stationInfoService;
|
private ISurvStationInfoService stationInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SurvDeviceDeployRelayServiceImpl relayService;
|
||||||
|
@Autowired
|
||||||
|
private SurvIotManufacturerConfigServiceImpl configService;
|
||||||
|
@Autowired
|
||||||
|
private SurvDeviceDeployRelaygroupServiceImpl relaygroupService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<SurvDeviceDeploy> pages(IPage<SurvDeviceDeploy> page, SurvDeviceDeploy survDeviceDeploy) {
|
public IPage<SurvDeviceDeploy> pages(IPage<SurvDeviceDeploy> page, SurvDeviceDeploy survDeviceDeploy) {
|
||||||
|
|
||||||
|
|
@ -452,4 +462,153 @@ public class SurvDeviceDeployServiceImpl extends ServiceImpl<SurvDeviceDeployMap
|
||||||
.last("limit 1"));
|
.last("limit 1"));
|
||||||
return deploy;
|
return deploy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updDeployRelay(SurvDeviceDeploy fDeviceDeploy, XphDeviceInfoVo xphDeviceInfoVo) {
|
||||||
|
if (xphDeviceInfoVo != null) {
|
||||||
|
if (StringUtils.isNotBlank(xphDeviceInfoVo.getRelayName()) && StringUtils.isNotBlank(xphDeviceInfoVo.getRelayNum())) {
|
||||||
|
String finalRelayName = xphDeviceInfoVo.getRelayName();
|
||||||
|
String finalRelayNum = xphDeviceInfoVo.getRelayNum();
|
||||||
|
if (xphDeviceInfoVo.getRelayExtend()!=null && xphDeviceInfoVo.getRelayExtend()) {
|
||||||
|
finalRelayName = finalRelayName + "/" + xphDeviceInfoVo.getRelayExtendName();
|
||||||
|
finalRelayNum = finalRelayNum + "/" + xphDeviceInfoVo.getRelayExtendNum();
|
||||||
|
}
|
||||||
|
// log.warn(finalRelayName + "------------------" + finalRelayNum);
|
||||||
|
|
||||||
|
SurvDeviceDeploy updDeploy = new SurvDeviceDeploy();
|
||||||
|
updDeploy.setId(fDeviceDeploy.getId());
|
||||||
|
updDeploy.setRelayNum(finalRelayNum);
|
||||||
|
updDeploy.setRelayName(finalRelayName);
|
||||||
|
updateById(updDeploy);
|
||||||
|
fDeviceDeploy.setRelayName(finalRelayName);
|
||||||
|
fDeviceDeploy.setRelayNum(finalRelayNum);
|
||||||
|
processRelays(fDeviceDeploy);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void processRelays(SurvDeviceDeploy fDeviceDeploy) {
|
||||||
|
if (StringUtils.isNotBlank(fDeviceDeploy.getRelayName()) && StringUtils.isNotBlank(fDeviceDeploy.getRelayNum())) {
|
||||||
|
//删除旧配置
|
||||||
|
relayService.lambdaUpdate()
|
||||||
|
.eq(SurvDeviceDeployRelay::getDeployId, fDeviceDeploy.getId())
|
||||||
|
.remove();
|
||||||
|
relaygroupService.lambdaUpdate()
|
||||||
|
.eq(SurvDeviceDeployRelaygroup::getDeployId, fDeviceDeploy.getId())
|
||||||
|
.remove();
|
||||||
|
|
||||||
|
String[] names = fDeviceDeploy.getRelayName().split("/");
|
||||||
|
String[] nums = fDeviceDeploy.getRelayNum().split("/");
|
||||||
|
if (names.length != nums.length) {
|
||||||
|
throw new JeecgBootException("继电器名称与编号不匹配");
|
||||||
|
}
|
||||||
|
//厂家配置
|
||||||
|
SurvIotManufacturerConfig config = configService.getConfigByProtocol(fDeviceDeploy.getProtocolCode());
|
||||||
|
ManufacturerConfigVo manufacturerConfigVo = JSONObject.parseObject(JSONObject.toJSONString(config.getConfigJson()), ManufacturerConfigVo.class);
|
||||||
|
List<SurvDeviceDeployRelay> saves = new ArrayList<>();
|
||||||
|
Map<String,String> motorIdMap = new HashMap<>();
|
||||||
|
int groupCount = 0;
|
||||||
|
List<SurvDeviceDeployRelaygroup> relaygroups = new ArrayList<>();
|
||||||
|
for (int i = 0; i < names.length; i++) {
|
||||||
|
String relayName = names[i].trim();
|
||||||
|
String relayNum = nums[i].trim();
|
||||||
|
if (!relayName.isEmpty() && !"-".equals(relayName)) {
|
||||||
|
SurvDeviceDeployRelay fDeviceDeployRelay = new SurvDeviceDeployRelay();
|
||||||
|
fDeviceDeployRelay.setDeployId(fDeviceDeploy.getId());
|
||||||
|
fDeviceDeployRelay.setRelayName(relayName);
|
||||||
|
fDeviceDeployRelay.setRelayKey(i + "");
|
||||||
|
fDeviceDeployRelay.setRelayNotes(relayName);
|
||||||
|
fDeviceDeployRelay.setSortNo(i);
|
||||||
|
fDeviceDeployRelay.setTenantId(fDeviceDeploy.getTenantId());
|
||||||
|
//检查此继电器是否需要id
|
||||||
|
SurvDeviceDeployRelaygroup relaygroup = processRelayGroup(manufacturerConfigVo,fDeviceDeployRelay,motorIdMap,groupCount);
|
||||||
|
if(relaygroup!=null){
|
||||||
|
groupCount = relaygroup.getSortNo();
|
||||||
|
relaygroups.add(relaygroup);
|
||||||
|
}
|
||||||
|
Integer rNum = null;
|
||||||
|
try {
|
||||||
|
rNum = Integer.parseInt(relayNum);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
fDeviceDeployRelay.setRelayType(rNum);
|
||||||
|
saves.add(fDeviceDeployRelay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!saves.isEmpty()) {
|
||||||
|
boolean b = relayService.saveBatch(saves);
|
||||||
|
if(b){
|
||||||
|
if(!relaygroups.isEmpty()){
|
||||||
|
relaygroupService.saveBatch(relaygroups);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private SurvDeviceDeployRelaygroup processRelayGroup(ManufacturerConfigVo manufacturerConfigVo,SurvDeviceDeployRelay relay,Map<String,String> motorIdMap,int groupCount){
|
||||||
|
SurvDeviceDeployRelaygroup fDeviceDeployRelaygroup = null;
|
||||||
|
if(manufacturerConfigVo.getRelayGroup()!=null){
|
||||||
|
if(!manufacturerConfigVo.getRelayGroup().isEmpty()){
|
||||||
|
for (ManufacturerConfigRelayGroupVo manufacturerConfigRelayGroupVo : manufacturerConfigVo.getRelayGroup()) {
|
||||||
|
String[] keys = manufacturerConfigRelayGroupVo.getKeywords().split(",");
|
||||||
|
if(matchKeywords(relay.getRelayName(),manufacturerConfigRelayGroupVo.getPattern())){//如果继电器匹配了正则表达式,如果有多个逻辑则后面的覆盖前面的
|
||||||
|
//替换掉关键侧,剩余分组名称
|
||||||
|
String relayGroupCn = replaceAllInArray(removeNonChinese(relay.getRelayName()),keys,"");
|
||||||
|
String groupId = motorIdMap.get(relayGroupCn);
|
||||||
|
if(StringUtils.isBlank(groupId)){
|
||||||
|
groupId = IdUtil.getSnowflakeNextIdStr();
|
||||||
|
motorIdMap.put(relayGroupCn,groupId);
|
||||||
|
groupCount = groupCount + 1;
|
||||||
|
fDeviceDeployRelaygroup = new SurvDeviceDeployRelaygroup();
|
||||||
|
fDeviceDeployRelaygroup.setId(groupId);
|
||||||
|
fDeviceDeployRelaygroup.setDeployId(relay.getDeployId());
|
||||||
|
fDeviceDeployRelaygroup.setGroupName(relayGroupCn);
|
||||||
|
fDeviceDeployRelaygroup.setGroupType(manufacturerConfigRelayGroupVo.getRelayGroupType());
|
||||||
|
fDeviceDeployRelaygroup.setGroupNotes("分组_"+relayGroupCn);
|
||||||
|
fDeviceDeployRelaygroup.setSortNo(groupCount);
|
||||||
|
fDeviceDeployRelaygroup.setTenantId(relay.getTenantId());
|
||||||
|
}
|
||||||
|
// relay.setGroupName(relayGroupCn);//不再保存分组名,直接使用id获取
|
||||||
|
relay.setGroupId(groupId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fDeviceDeployRelaygroup;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断字符串中是否包含指定的中文关键词
|
||||||
|
*
|
||||||
|
* @param input 输入字符串
|
||||||
|
* @param patternStr 需要匹配的中文关键词
|
||||||
|
* @return 是否包含关键词
|
||||||
|
*/
|
||||||
|
public static boolean matchKeywords(String input, String patternStr) {
|
||||||
|
// 构建正则表达式,匹配关键词
|
||||||
|
Pattern pattern = Pattern.compile(patternStr);
|
||||||
|
Matcher matcher = pattern.matcher(input);
|
||||||
|
return matcher.matches();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String replaceAllInArray(String input, String[] array, String replacement) {
|
||||||
|
for (String item : array) {
|
||||||
|
input = input.replace(item, replacement); // 替换所有匹配项
|
||||||
|
}
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移除所有非中文字符
|
||||||
|
* @param input
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String removeNonChinese(String input) {
|
||||||
|
return input.replaceAll("[^\\u4e00-\\u9fa5]", "");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package org.jeecg.modules.appmana.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.jeecg.common.constant.IotConstants;
|
||||||
|
import org.jeecg.common.entity.SurvIotManufacturerConfig;
|
||||||
|
import org.jeecg.modules.appmana.mapper.SurvIotManufacturerConfigMapper;
|
||||||
|
import org.jeecg.modules.appmana.service.ISurvIotManufacturerConfigService;
|
||||||
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 厂商配置
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-03-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SurvIotManufacturerConfigServiceImpl extends ServiceImpl<SurvIotManufacturerConfigMapper, SurvIotManufacturerConfig> implements ISurvIotManufacturerConfigService {
|
||||||
|
@Override
|
||||||
|
@Cacheable(value = IotConstants.iot_protocol_cache, key = "#protocolCode", unless = "#result == null ")
|
||||||
|
public SurvIotManufacturerConfig getConfigByProtocol(String protocolCode) {
|
||||||
|
SurvIotManufacturerConfig config = lambdaQuery().eq(SurvIotManufacturerConfig::getProtocolCode, protocolCode).last("limit 1").one();
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package org.jeecg.modules.appmana.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.jeecg.common.entity.SurvIotManufacturerInfo;
|
||||||
|
import org.jeecg.modules.appmana.mapper.SurvIotManufacturerInfoMapper;
|
||||||
|
import org.jeecg.modules.appmana.service.ISurvIotManufacturerInfoService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 厂家信息
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-03-06
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SurvIotManufacturerInfoServiceImpl extends ServiceImpl<SurvIotManufacturerInfoMapper, SurvIotManufacturerInfo> implements ISurvIotManufacturerInfoService {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -264,4 +264,20 @@ public interface IotConstants {
|
||||||
*/
|
*/
|
||||||
String Data_Types_Nsp="nsp";
|
String Data_Types_Nsp="nsp";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备关
|
||||||
|
*/
|
||||||
|
String DEVICE_CLOSE="0";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备开
|
||||||
|
*/
|
||||||
|
String DEVICE_ON="1";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备停
|
||||||
|
*/
|
||||||
|
String DEVICE_STOP="2";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -205,6 +205,20 @@ public class SurvDeviceDeploy implements Serializable {
|
||||||
@TableField(typeHandler = JsonTypeHandler.class, jdbcType = JdbcType.VARCHAR, value = "DEVICE_CONFIG")
|
@TableField(typeHandler = JsonTypeHandler.class, jdbcType = JdbcType.VARCHAR, value = "DEVICE_CONFIG")
|
||||||
private cn.hutool.json.JSONObject deviceConfig;
|
private cn.hutool.json.JSONObject deviceConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 继电器名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "继电器名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "继电器名称")
|
||||||
|
private java.lang.String relayName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 继电器编号
|
||||||
|
*/
|
||||||
|
@Excel(name = "继电器编号", width = 15)
|
||||||
|
@ApiModelProperty(value = "继电器编号")
|
||||||
|
private java.lang.String relayNum;
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty("1#球阀状态")
|
@ApiModelProperty("1#球阀状态")
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
|
|
@ -276,6 +290,9 @@ public class SurvDeviceDeploy implements Serializable {
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String configJsonStr;
|
private String configJsonStr;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private List<SurvDeviceDeployRelay> relayList;
|
||||||
|
|
||||||
public String[] getDepCodeArr() {
|
public String[] getDepCodeArr() {
|
||||||
if(StringUtils.isNotBlank(depCodes)) {
|
if(StringUtils.isNotBlank(depCodes)) {
|
||||||
return depCodes.split(",");
|
return depCodes.split(",");
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,304 @@
|
||||||
|
package org.jeecg.common.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 设备继电器
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2024-12-20
|
||||||
|
* @Version: V1.06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("surv_device_deploy_relay")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "设备继电器", description = "设备继电器")
|
||||||
|
public class SurvDeviceDeployRelay implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备ID
|
||||||
|
*/
|
||||||
|
@Excel(name = "设备ID", width = 15)
|
||||||
|
@ApiModelProperty(value = "设备ID")
|
||||||
|
private String deployId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1=常规
|
||||||
|
*/
|
||||||
|
@Excel(name = "继电器类别", width = 15)
|
||||||
|
@ApiModelProperty(value = "继电器类别")
|
||||||
|
private Integer relayCate;
|
||||||
|
|
||||||
|
/*1=风机,2=水泵,3=增氧机,4=湿帘,5=遮阳,6=开窗,7=保温,8=投食机*/
|
||||||
|
@Excel(name = "继电器种类", width = 15)
|
||||||
|
@ApiModelProperty(value = "继电器种类")
|
||||||
|
private Integer relayType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 继电器key/编号
|
||||||
|
*/
|
||||||
|
@Excel(name = "继电器key/编号", width = 15)
|
||||||
|
@ApiModelProperty(value = "继电器key/编号")
|
||||||
|
private String relayKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 继电器名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "继电器名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "继电器名称")
|
||||||
|
private String relayName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 继电器备注
|
||||||
|
*/
|
||||||
|
@Excel(name = "继电器备注", width = 15)
|
||||||
|
@ApiModelProperty(value = "继电器备注")
|
||||||
|
private String relayNotes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 继电器标记
|
||||||
|
*/
|
||||||
|
@Excel(name = "继电器标记", width = 15)
|
||||||
|
@ApiModelProperty(value = "继电器标记")
|
||||||
|
private String relayMark;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 寄存器类型
|
||||||
|
*/
|
||||||
|
@Excel(name = "寄存器类型", width = 15)
|
||||||
|
@ApiModelProperty(value = "寄存器类型")
|
||||||
|
private Integer registerType;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 寄存器序号 通讯地址
|
||||||
|
*/
|
||||||
|
@Excel(name = "寄存器序号(通讯地址)", width = 15)
|
||||||
|
@ApiModelProperty(value = "寄存器序号(通讯地址)")
|
||||||
|
private Integer registerNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开指令
|
||||||
|
*/
|
||||||
|
@Excel(name = "开指令", width = 15)
|
||||||
|
@ApiModelProperty(value = "开指令")
|
||||||
|
private String registerCmdOn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关指令
|
||||||
|
*/
|
||||||
|
@Excel(name = "关指令", width = 15)
|
||||||
|
@ApiModelProperty(value = "关指令")
|
||||||
|
private String registerCmdOff;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停指令
|
||||||
|
*/
|
||||||
|
@Excel(name = "停指令", width = 15)
|
||||||
|
@ApiModelProperty(value = "停指令")
|
||||||
|
private String registerCmdStop;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回执状态开
|
||||||
|
*/
|
||||||
|
@Excel(name = "回执状态开", width = 15)
|
||||||
|
@ApiModelProperty(value = "回执状态开")
|
||||||
|
private String registerOn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回执状态关
|
||||||
|
*/
|
||||||
|
@Excel(name = "回执状态关", width = 15)
|
||||||
|
@ApiModelProperty(value = "回执状态关")
|
||||||
|
private String registerOff;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回执状态停
|
||||||
|
*/
|
||||||
|
@Excel(name = "回执状态停", width = 15)
|
||||||
|
@ApiModelProperty(value = "回执状态停")
|
||||||
|
private String registerStop;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实体对应字段
|
||||||
|
*/
|
||||||
|
@Excel(name = "实体对应字段", width = 15)
|
||||||
|
@ApiModelProperty(value = "实体对应字段")
|
||||||
|
private String entityField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否启用
|
||||||
|
*/
|
||||||
|
@Excel(name = "是否启用", width = 15)
|
||||||
|
@ApiModelProperty(value = "是否启用")
|
||||||
|
private Integer isEnable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否可远程控制
|
||||||
|
*/
|
||||||
|
@Excel(name = "是否可远程控制", width = 15)
|
||||||
|
@ApiModelProperty(value = "是否可远程控制")
|
||||||
|
private Integer isAbleRemote;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组ID
|
||||||
|
*/
|
||||||
|
@Excel(name = "分组ID", width = 15)
|
||||||
|
@ApiModelProperty(value = "分组ID")
|
||||||
|
@TableField(updateStrategy = FieldStrategy.IGNORED)
|
||||||
|
private String groupId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组CODE
|
||||||
|
*/
|
||||||
|
@Excel(name = "分组CODE", width = 15)
|
||||||
|
@ApiModelProperty(value = "分组CODE")
|
||||||
|
private String groupCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组名称
|
||||||
|
*/
|
||||||
|
@Excel(name = "分组名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "分组名称")
|
||||||
|
private String groupName;
|
||||||
|
|
||||||
|
@Excel(name = "排序号", width = 15)
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
private Integer sortNo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户号
|
||||||
|
*/
|
||||||
|
@Excel(name = "租户号", width = 15)
|
||||||
|
@ApiModelProperty(value = "租户号")
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 乐观锁
|
||||||
|
*/
|
||||||
|
@Excel(name = "乐观锁", width = 15)
|
||||||
|
@ApiModelProperty(value = "乐观锁")
|
||||||
|
private Integer reVision;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新人
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑删除
|
||||||
|
*/
|
||||||
|
@Excel(name = "逻辑删除", width = 15)
|
||||||
|
@ApiModelProperty(value = "逻辑删除")
|
||||||
|
private Integer isDel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 乐观锁
|
||||||
|
*/
|
||||||
|
@Excel(name = "乐观锁", width = 15)
|
||||||
|
@ApiModelProperty(value = "乐观锁")
|
||||||
|
private Integer revision;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer relayValue;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String relayValueDes;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer isOnline;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private SurvDeviceDeploy deploy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指令优先级
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Integer priorityLevel;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 指令类别,开关停
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String cmdType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 顶保温等特殊设备反转效果后的备注
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String extLog;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 临时参数
|
||||||
|
*/
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String relayId;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分组名称
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "分组名称")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String groupNameStr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 继电器种类
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "继电器种类")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String relayTypeName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 继电器类别
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "继电器类别")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String relayCateName;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,104 @@
|
||||||
|
package org.jeecg.common.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 继电器分组
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-03-06
|
||||||
|
* @Version: V1.06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("surv_device_deploy_relaygroup")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="继电器分组", description="继电器分组")
|
||||||
|
public class SurvDeviceDeployRelaygroup implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**设备id*/
|
||||||
|
@Excel(name = "设备id", width = 15)
|
||||||
|
@ApiModelProperty(value = "设备id")
|
||||||
|
private String deployId;
|
||||||
|
|
||||||
|
/**分组类型;button=按钮,switch=两开关,shifter=三开关*/
|
||||||
|
@Excel(name = "分组类型;button=按钮,switch=两开关,shifter=三开关", width = 15)
|
||||||
|
@ApiModelProperty(value = "分组类型;button=按钮,switch=两开关,shifter=三开关")
|
||||||
|
private String groupType;
|
||||||
|
|
||||||
|
/**分组名称*/
|
||||||
|
@Excel(name = "分组名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "分组名称")
|
||||||
|
private String groupName;
|
||||||
|
|
||||||
|
/**分组备注*/
|
||||||
|
@Excel(name = "分组备注", width = 15)
|
||||||
|
@ApiModelProperty(value = "分组备注")
|
||||||
|
private String groupNotes;
|
||||||
|
|
||||||
|
/**序号*/
|
||||||
|
@Excel(name = "序号", width = 15)
|
||||||
|
@ApiModelProperty(value = "序号")
|
||||||
|
private Integer sortNo;
|
||||||
|
|
||||||
|
/**是否启用*/
|
||||||
|
@Excel(name = "是否启用", width = 15)
|
||||||
|
@ApiModelProperty(value = "是否启用")
|
||||||
|
private Integer isEnable;
|
||||||
|
|
||||||
|
/**租户号*/
|
||||||
|
@Excel(name = "租户号", width = 15)
|
||||||
|
@ApiModelProperty(value = "租户号")
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
/**乐观锁*/
|
||||||
|
@Excel(name = "乐观锁", width = 15)
|
||||||
|
@ApiModelProperty(value = "乐观锁")
|
||||||
|
private Integer reVision;
|
||||||
|
|
||||||
|
/**创建人*/
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**创建时间*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**更新人*/
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**逻辑删除*/
|
||||||
|
@Excel(name = "逻辑删除", width = 15)
|
||||||
|
@ApiModelProperty(value = "逻辑删除")
|
||||||
|
@TableLogic
|
||||||
|
private Integer isDel;
|
||||||
|
|
||||||
|
/**更新时间*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String groupTypeName;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,99 @@
|
||||||
|
package org.jeecg.common.entity;
|
||||||
|
|
||||||
|
import cn.hutool.json.JSONObject;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.apache.ibatis.type.JdbcType;
|
||||||
|
import org.jeecg.common.mybatis.typehandler.JsonTypeHandler;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
/**
|
||||||
|
* @Description: 厂商配置
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-03-06
|
||||||
|
* @Version: V1.06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("surv_iot_manufacturer_config")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="厂商配置", description="厂商配置")
|
||||||
|
public class SurvIotManufacturerConfig implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**厂家ID*/
|
||||||
|
@Excel(name = "厂家ID", width = 15)
|
||||||
|
@ApiModelProperty(value = "厂家ID")
|
||||||
|
private String maId;
|
||||||
|
|
||||||
|
/**协议编号*/
|
||||||
|
@Excel(name = "协议编号", width = 15)
|
||||||
|
@ApiModelProperty(value = "协议编号")
|
||||||
|
private String protocolCode;
|
||||||
|
|
||||||
|
/**配置类型;1=模型配置,2=其他*/
|
||||||
|
@Excel(name = "配置类型;1=模型配置,2=其他", width = 15)
|
||||||
|
@ApiModelProperty(value = "配置类型;1=模型配置,2=其他")
|
||||||
|
private Integer configType;
|
||||||
|
|
||||||
|
/**配置*/
|
||||||
|
@Excel(name = "配置", width = 15)
|
||||||
|
@ApiModelProperty(value = "配置")
|
||||||
|
@TableField(typeHandler = JsonTypeHandler.class, jdbcType = JdbcType.VARCHAR, value = "CONFIG_JSON")
|
||||||
|
private JSONObject configJson;
|
||||||
|
|
||||||
|
/**租户号*/
|
||||||
|
@Excel(name = "租户号", width = 15)
|
||||||
|
@ApiModelProperty(value = "租户号")
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
/**乐观锁*/
|
||||||
|
@Excel(name = "乐观锁", width = 15)
|
||||||
|
@ApiModelProperty(value = "乐观锁")
|
||||||
|
private Integer reVision;
|
||||||
|
|
||||||
|
/**创建人*/
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**创建时间*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**更新人*/
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**逻辑删除*/
|
||||||
|
@Excel(name = "逻辑删除", width = 15)
|
||||||
|
@ApiModelProperty(value = "逻辑删除")
|
||||||
|
private Integer isDel;
|
||||||
|
|
||||||
|
/**更新时间*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
private Date updateTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String configJsonStr;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,103 @@
|
||||||
|
package org.jeecg.common.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Date;
|
||||||
|
/**
|
||||||
|
* @Description: 厂家信息
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-03-06
|
||||||
|
* @Version: V1.06
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@TableName("f_iot_manufacturer_info")
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value="厂家信息", description="厂家信息")
|
||||||
|
public class SurvIotManufacturerInfo implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ApiModelProperty(value = "主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
/**厂家名称*/
|
||||||
|
@Excel(name = "厂家名称", width = 15)
|
||||||
|
@ApiModelProperty(value = "厂家名称")
|
||||||
|
private String maName;
|
||||||
|
|
||||||
|
/**厂家编号*/
|
||||||
|
@Excel(name = "厂家编号", width = 15)
|
||||||
|
@ApiModelProperty(value = "厂家编号")
|
||||||
|
private String maCode;
|
||||||
|
|
||||||
|
/**厂家名称地址*/
|
||||||
|
@Excel(name = "厂家名称地址", width = 15)
|
||||||
|
@ApiModelProperty(value = "厂家名称地址")
|
||||||
|
private String maAddr;
|
||||||
|
|
||||||
|
/**联系电话*/
|
||||||
|
@Excel(name = "联系电话", width = 15)
|
||||||
|
@ApiModelProperty(value = "联系电话")
|
||||||
|
private String maTel;
|
||||||
|
|
||||||
|
/**备注*/
|
||||||
|
@Excel(name = "备注", width = 15)
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String maNotes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
@Excel(name = "排序", width = 15)
|
||||||
|
@ApiModelProperty(value = "排序")
|
||||||
|
private Integer sortNo;
|
||||||
|
|
||||||
|
/**租户号*/
|
||||||
|
@Excel(name = "租户号", width = 15)
|
||||||
|
@ApiModelProperty(value = "租户号")
|
||||||
|
private String tenantId;
|
||||||
|
|
||||||
|
/**乐观锁*/
|
||||||
|
@Excel(name = "乐观锁", width = 15)
|
||||||
|
@ApiModelProperty(value = "乐观锁")
|
||||||
|
private Integer reVision;
|
||||||
|
|
||||||
|
/**创建人*/
|
||||||
|
@ApiModelProperty(value = "创建人")
|
||||||
|
private String createBy;
|
||||||
|
|
||||||
|
/**创建时间*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private Date createTime;
|
||||||
|
|
||||||
|
/**更新人*/
|
||||||
|
@ApiModelProperty(value = "更新人")
|
||||||
|
private String updateBy;
|
||||||
|
|
||||||
|
/**逻辑删除*/
|
||||||
|
@Excel(name = "逻辑删除", width = 15)
|
||||||
|
@ApiModelProperty(value = "逻辑删除")
|
||||||
|
private Integer isDel;
|
||||||
|
|
||||||
|
/**更新时间*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@ApiModelProperty(value = "更新时间")
|
||||||
|
private Date updateTime;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
package org.jeecg.common.iot.common;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeployRelayCountVo {
|
||||||
|
private String deployId;
|
||||||
|
private Integer relayCounts;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
package org.jeecg.common.iot.common;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeviceRelayTypeVo {
|
||||||
|
private String relayTypeName;
|
||||||
|
private String relayType;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package org.jeecg.common.iot.rule;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ManufacturerConfigCmdVo {
|
||||||
|
/*关键词*/
|
||||||
|
private String keywords;
|
||||||
|
/*条件sql*/
|
||||||
|
private String condition;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package org.jeecg.common.iot.rule;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ManufacturerConfigRelayGroupVo {
|
||||||
|
/*匹配正则表达式*/
|
||||||
|
private String pattern;
|
||||||
|
/*需要替换的关键词*/
|
||||||
|
private String keywords;
|
||||||
|
/*分组类型;button=按钮,switch=两开关,shifter=三开*/
|
||||||
|
private String relayGroupType;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package org.jeecg.common.iot.rule;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ManufacturerConfigRelayVo {
|
||||||
|
/*关键词*/
|
||||||
|
private String keywords;
|
||||||
|
/*继电器标记*/
|
||||||
|
private String relayOperate;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
package org.jeecg.common.iot.rule;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ManufacturerConfigRuleVo {
|
||||||
|
/*关键词*/
|
||||||
|
private String keywords;
|
||||||
|
/*模型字段名*/
|
||||||
|
private String modelSet;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package org.jeecg.common.iot.rule;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ManufacturerConfigVo {
|
||||||
|
/*匹配规则*/
|
||||||
|
private List<ManufacturerConfigRuleVo> matchRule;
|
||||||
|
/*继电器规则*/
|
||||||
|
private List<ManufacturerConfigRelayVo> relayRule;
|
||||||
|
/*前置指令*/
|
||||||
|
private List<ManufacturerConfigCmdVo> preCmd;
|
||||||
|
/*启动指令*/
|
||||||
|
private ManufacturerConfigCmdVo launchCmd;
|
||||||
|
/*继电器分组配置*/
|
||||||
|
private List<ManufacturerConfigRelayGroupVo> relayGroup;
|
||||||
|
}
|
||||||
|
|
@ -4,7 +4,16 @@ import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class DeviceCmdVo {
|
public class DeviceCmdVo {
|
||||||
private String deployCode;
|
/**
|
||||||
private String valveCode;
|
* 设备id
|
||||||
private String os;
|
*/
|
||||||
|
private String deployId;
|
||||||
|
/**
|
||||||
|
* 继电器id
|
||||||
|
*/
|
||||||
|
private String relayId;
|
||||||
|
/**
|
||||||
|
* 指令,0关,1开,2停
|
||||||
|
*/
|
||||||
|
private String ops;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
package org.jeecg.common.vo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class DeviceCmdVo2 {
|
||||||
|
private String deployCode;
|
||||||
|
private String valveCode;
|
||||||
|
private String os;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue