出厂设备表新增字段-设备运行状态

This commit is contained in:
2023-07-11 10:12:30 +08:00
parent d092cbeff4
commit 2dbb67cb69
6 changed files with 25 additions and 32 deletions

View File

@@ -111,4 +111,10 @@ public class CsEquipmentDeliveryAuditParm {
@TableField(value = "status") @TableField(value = "status")
private Integer status; private Integer status;
/**
* 运行状态
*/
@TableField(value = "run_status")
private Integer runStatus;
} }

View File

@@ -28,7 +28,10 @@ public class CsEquipmentDeliveryQueryParm extends BaseParam {
@ApiModelProperty("装置接入方式(mqtt、cloud)") @ApiModelProperty("装置接入方式(mqtt、cloud)")
private String devAccessMethod; private String devAccessMethod;
@ApiModelProperty("状态 1:未注册 2:注册 3:接入") @ApiModelProperty("接入状态 1:未注册 2:注册 3:接入")
private Integer status; private Integer status;
@ApiModelProperty("运行状态 1:离线 2:在线")
private Integer runStatus;
} }

View File

@@ -115,10 +115,16 @@ public class CsEquipmentDeliveryPO extends BaseEntity {
private String salesManager; private String salesManager;
/** /**
* 状态(0:删除 1:未注册 2:注册 3:接入) * 接入状态(1:未注册 2:注册 3:接入)
*/ */
@TableField(value = "status") @TableField(value = "status")
private String status; private String status;
/**
* 设备状态(0:删除 1:离线 2:在线)
*/
@TableField(value = "run_status")
private Integer runStatus;
} }

View File

@@ -107,7 +107,7 @@ public class EquipmentDeliveryController extends BaseController {
@OperateInfo(info = LogEnum.BUSINESS_COMMON) @OperateInfo(info = LogEnum.BUSINESS_COMMON)
@PostMapping("/updateStatusBynDid") @PostMapping("/updateStatusBynDid")
@ApiOperation("根据网关id调整设备状态") @ApiOperation("根据网关id调整设备接入状态")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "nDId", value = "网关id", required = true), @ApiImplicitParam(name = "nDId", value = "网关id", required = true),
@ApiImplicitParam(name = "status", value = "状态", required = true) @ApiImplicitParam(name = "status", value = "状态", required = true)

View File

@@ -1,27 +0,0 @@
package com.njcn.csdevice.controller.equipment;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 前端控制器
* </p>
*
* @author xuyang
* @since 2023-06-29
*/
@RestController
@RequestMapping("/mqttUser")
@AllArgsConstructor
@Slf4j
@Api(tags = "MqttUser录入")
public class MqttUserController extends BaseController {
}

View File

@@ -62,7 +62,6 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
private final ICsLedgerService csLedgerService; private final ICsLedgerService csLedgerService;
private final IMqttUserService mqttUserService;
private final RoleEngineerDevService roleEngineerDevService; private final RoleEngineerDevService roleEngineerDevService;
@Override @Override
@@ -75,6 +74,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
CsEquipmentDeliveryPO csEquipmentDeliveryPo = new CsEquipmentDeliveryPO(); CsEquipmentDeliveryPO csEquipmentDeliveryPo = new CsEquipmentDeliveryPO();
BeanUtils.copyProperties (csEquipmentDeliveryAddParm,csEquipmentDeliveryPo); BeanUtils.copyProperties (csEquipmentDeliveryAddParm,csEquipmentDeliveryPo);
csEquipmentDeliveryPo.setStatus ("1"); csEquipmentDeliveryPo.setStatus ("1");
csEquipmentDeliveryPo.setRunStatus(1);
return this.save (csEquipmentDeliveryPo); return this.save (csEquipmentDeliveryPo);
} }
@@ -83,7 +83,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
public Boolean AuditEquipmentDelivery(String id) { public Boolean AuditEquipmentDelivery(String id) {
UpdateWrapper<CsEquipmentDeliveryPO> wrapper = new UpdateWrapper(); UpdateWrapper<CsEquipmentDeliveryPO> wrapper = new UpdateWrapper();
wrapper.eq ("id", id); wrapper.eq ("id", id);
wrapper.set ("status", "0"); wrapper.set ("run_status", "0");
boolean update = this.update (wrapper); boolean update = this.update (wrapper);
return update; return update;
} }
@@ -175,6 +175,11 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
} else { } else {
queryWrapper.in("cs_equipment_delivery.status", Arrays.asList(1,2,3)); queryWrapper.in("cs_equipment_delivery.status", Arrays.asList(1,2,3));
} }
if (!Objects.isNull(queryParam.getRunStatus())){
queryWrapper.eq("cs_equipment_delivery.run_status", queryParam.getRunStatus());
} else {
queryWrapper.in("cs_equipment_delivery.run_status", Arrays.asList(1,2));
}
return this.baseMapper.page(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), queryWrapper); return this.baseMapper.page(new Page<>(PageFactory.getPageNum(queryParam), PageFactory.getPageSize(queryParam)), queryWrapper);
} }