模板数据、设备信息初始化至内存

This commit is contained in:
xy
2024-10-16 18:53:19 +08:00
parent 5169669b2b
commit 78b9a98ab8
11 changed files with 312 additions and 13 deletions

View File

@@ -0,0 +1,118 @@
package com.njcn.csdevice.pojo.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 初始化模板实体
* @author xy
*/
@Data
public class CsDevModelDto implements Serializable {
@ApiModelProperty("模板id")
private String id;
@ApiModelProperty("版本号")
private String versionNo;
@TableField("版本日期")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private Date versionDate;
@ApiModelProperty("模板名称")
private String name;
@ApiModelProperty("设备类型名称")
private String devTypeName;
@ApiModelProperty("模板存储路径")
private String filePath;
@ApiModelProperty("模板类型(0:治理类型 1:电能质量类型)")
private Integer type;
@ApiModelProperty("数据集")
private List<CsDataSet> dataSets;
@Data
public static class CsDataSet implements Serializable {
@ApiModelProperty("数据集id")
private String id;
@ApiModelProperty("模板id")
private String pid;
@ApiModelProperty("数据集名称")
private String name;
@ApiModelProperty("数据集别名")
private String anotherName;
@ApiModelProperty("数据集编号")
private Integer idx;
@ApiModelProperty("数据集类型")
private String dataType;
@ApiModelProperty("统计周期")
private Integer period;
@ApiModelProperty("是否存储 0:不存储 1:存储")
private Integer storeFlag;
@ApiModelProperty("逻辑子设备")
private Integer clDev;
@ApiModelProperty("数据集类型(0:主设备 1:子模块 2:监测设备)")
private Integer type;
@ApiModelProperty("数据类型(Primary:一次值 Secondary:二次值)")
private String dataLevel;
@ApiModelProperty("数据类型")
private List<CsDataArray> dataArrays;
}
@Data
public static class CsDataArray implements Serializable {
@ApiModelProperty("指标id")
private String id;
@ApiModelProperty("数据集id")
private String pid;
@ApiModelProperty("字典表id")
private String dataId;
@ApiModelProperty("数据集名称")
private String name;
@ApiModelProperty("数据集别名")
private String anotherName;
@ApiModelProperty("数据集编号")
private Integer idx;
@ApiModelProperty("数据统计方法(max、min、avg、cp95)")
private String statMethod;
@ApiModelProperty("数据类型")
private String dataType;
@ApiModelProperty("相别")
private String phase;
@ApiModelProperty("排序")
private Integer sort;
}
}

View File

@@ -1,9 +1,12 @@
package com.njcn.csdevice.pojo.param; package com.njcn.csdevice.pojo.param;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
import java.util.Date;
/** /**
* *
@@ -36,8 +39,9 @@ public class CsDevModelAddParm {
/** /**
* 版本日期 * 版本日期
*/ */
@ApiModelProperty(value = "版本日期") @TableField(value = "version_date")
private String time; @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
private Date versionDate;
/** /**
* 装置模板文件路径 * 装置模板文件路径

View File

@@ -0,0 +1,28 @@
package com.njcn.csdevice.init;
import com.njcn.csdevice.service.CsDevModelService;
import com.njcn.csdevice.service.CsEquipmentDeliveryService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;
/**
* 项目初始化缓存设备池,后续从缓存中获取设备数据
* @author xy
*/
@Slf4j
@Component
@AllArgsConstructor
public class InitData implements CommandLineRunner {
private final CsEquipmentDeliveryService csEquipmentDeliveryService;
private final CsDevModelService csDevModelService;
@Override
public void run(String... args) {
csEquipmentDeliveryService.refreshDeviceDataCache();
csDevModelService.refreshDevModelCache();
}
}

View File

@@ -20,6 +20,12 @@ import com.njcn.csdevice.pojo.vo.CsDevModelPageVO;
*/ */
public interface CsDevModelService extends IService<CsDevModelPO>{ public interface CsDevModelService extends IService<CsDevModelPO>{
/**
* 初始化缓存模板信息
* 想缓存模板,发现数据量太大,先按照之前的逻辑处理
*/
void refreshDevModelCache();
/** /**
* @Description: addDevModel * @Description: addDevModel
* @Param: [csDevModelAddParm] * @Param: [csDevModelAddParm]

View File

@@ -27,6 +27,11 @@ import java.util.List;
*/ */
public interface CsEquipmentDeliveryService extends IService<CsEquipmentDeliveryPO>{ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDeliveryPO>{
/**
* 初始化缓存设备池
*/
void refreshDeviceDataCache();
/** /**
* @Description: save * @Description: save
* @Param: [csEquipmentDeliveryAddParm] * @Param: [csEquipmentDeliveryAddParm]

View File

@@ -50,4 +50,9 @@ public interface ICsDataArrayService extends IService<CsDataArray> {
* @return * @return
*/ */
List<CsDataArray> findListByParam(DataArrayParam param); List<CsDataArray> findListByParam(DataArrayParam param);
/**
* 根据数据集id获取指标数据
*/
List<CsDataArray> getDataArrayByDataSetIds(List<String> dataSetIds);
} }

View File

@@ -64,4 +64,9 @@ public interface ICsDataSetService extends IService<CsDataSet> {
* @return * @return
*/ */
CsDataSet getDataSetByIdx(String modelId, Integer idx); CsDataSet getDataSetByIdx(String modelId, Integer idx);
/**
* 根据模板id获取所有数据集
*/
List<CsDataSet> getDataSetByModelId(List<String> modelList);
} }

View File

@@ -6,6 +6,7 @@ import com.njcn.csdevice.mapper.CsDataArrayMapper;
import com.njcn.csdevice.pojo.dto.DataArrayDTO; import com.njcn.csdevice.pojo.dto.DataArrayDTO;
import com.njcn.csdevice.pojo.param.DataArrayParam; import com.njcn.csdevice.pojo.param.DataArrayParam;
import com.njcn.csdevice.pojo.po.CsDataArray; import com.njcn.csdevice.pojo.po.CsDataArray;
import com.njcn.csdevice.pojo.po.CsDataSet;
import com.njcn.csdevice.pojo.vo.DataArrayTreeVO; import com.njcn.csdevice.pojo.vo.DataArrayTreeVO;
import com.njcn.csdevice.pojo.vo.DeviceManagerDetailVO; import com.njcn.csdevice.pojo.vo.DeviceManagerDetailVO;
import com.njcn.csdevice.service.ICsDataArrayService; import com.njcn.csdevice.service.ICsDataArrayService;
@@ -174,4 +175,11 @@ public class CsDataArrayServiceImpl extends ServiceImpl<CsDataArrayMapper, CsDat
public List<CsDataArray> findListByParam(DataArrayParam param) { public List<CsDataArray> findListByParam(DataArrayParam param) {
return this.baseMapper.findListByParam(param); return this.baseMapper.findListByParam(param);
} }
@Override
public List<CsDataArray> getDataArrayByDataSetIds(List<String> dataSetIds) {
return this.lambdaQuery()
.in(CsDataArray::getPid,dataSetIds)
.list();
}
} }

View File

@@ -9,6 +9,7 @@ import com.njcn.csdevice.service.ICsDataSetService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.List; import java.util.List;
@@ -93,4 +94,11 @@ public class CsDataSetServiceImpl extends ServiceImpl<CsDataSetMapper, CsDataSet
.one(); .one();
} }
@Override
public List<CsDataSet> getDataSetByModelId(List<String> modelList) {
return this.lambdaQuery()
.in(CsDataSet::getPid,modelList)
.list();
}
} }

View File

@@ -1,22 +1,37 @@
package com.njcn.csdevice.service.impl; package com.njcn.csdevice.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.nacos.shaded.com.google.gson.Gson;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.csdevice.mapper.CsDevModelMapper; import com.njcn.csdevice.mapper.CsDevModelMapper;
import com.njcn.csdevice.pojo.dto.CsDevModelDto;
import com.njcn.csdevice.pojo.param.CsDevModelAddParm; import com.njcn.csdevice.pojo.param.CsDevModelAddParm;
import com.njcn.csdevice.pojo.param.CsDevModelAuditParm; import com.njcn.csdevice.pojo.param.CsDevModelAuditParm;
import com.njcn.csdevice.pojo.param.CsDevModelQueryListParm; import com.njcn.csdevice.pojo.param.CsDevModelQueryListParm;
import com.njcn.csdevice.pojo.param.CsDevModelQueryParm; import com.njcn.csdevice.pojo.param.CsDevModelQueryParm;
import com.njcn.csdevice.pojo.po.CsDataArray;
import com.njcn.csdevice.pojo.po.CsDataSet;
import com.njcn.csdevice.pojo.po.CsDevModelPO; import com.njcn.csdevice.pojo.po.CsDevModelPO;
import com.njcn.csdevice.pojo.vo.CsDevModelPageVO; import com.njcn.csdevice.pojo.vo.CsDevModelPageVO;
import com.njcn.csdevice.service.CsDevModelService; import com.njcn.csdevice.service.CsDevModelService;
import com.njcn.csdevice.service.ICsDataArrayService;
import com.njcn.csdevice.service.ICsDataSetService;
import com.njcn.redis.pojo.enums.AppRedisKey;
import com.njcn.redis.utils.RedisUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.sql.Date; import java.sql.Date;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/** /**
* *
@@ -27,16 +42,77 @@ import java.sql.Date;
* @author clam * @author clam
* @version V1.0.0 * @version V1.0.0
*/ */
@Slf4j
@Service @Service
@RequiredArgsConstructor
public class CsDevModelServiceImpl extends ServiceImpl<CsDevModelMapper, CsDevModelPO> implements CsDevModelService{ public class CsDevModelServiceImpl extends ServiceImpl<CsDevModelMapper, CsDevModelPO> implements CsDevModelService{
private final ICsDataSetService csDataSetService;
private final ICsDataArrayService csDataArrayService;
private final RedisUtil redisUtil;
@Override
public void refreshDevModelCache() {
// List<CsDevModelDto> csDevModelDtoList = new ArrayList<>();
// List<CsDevModelDto.CsDataSet> csDataSetList = new ArrayList<>();
// List<CsDevModelDto.CsDataArray> csDataArrayList = new ArrayList<>();
// //获取系统所有模板
// LambdaQueryWrapper<CsDevModelPO> queryWrapper = new LambdaQueryWrapper<>();
// queryWrapper.eq(CsDevModelPO::getStatus,1);
// List<CsDevModelPO> list = this.list(queryWrapper);
// //根据模板ids获取数据集
// if (CollUtil.isNotEmpty(list)) {
// List<String> modelIds = list.stream().map(CsDevModelPO::getId).collect(Collectors.toList());
// List<CsDataSet> csDataSets = csDataSetService.getDataSetByModelId(modelIds);
// //根据数据集获取具体指标
// List<String> dataSetList = csDataSets.stream().map(CsDataSet::getId).collect(Collectors.toList());
// List<CsDataArray> csDataArrays = csDataArrayService.getDataArrayByDataSetIds(dataSetList);
//
// list.forEach(item->{
// CsDevModelDto dto = new CsDevModelDto();
// BeanUtils.copyProperties(item,dto);
// csDevModelDtoList.add(dto);
// });
// csDataSets.forEach(item->{
// CsDevModelDto.CsDataSet dto = new CsDevModelDto.CsDataSet();
// BeanUtils.copyProperties(item,dto);
// csDataSetList.add(dto);
// });
// csDataArrays.forEach(item->{
// CsDevModelDto.CsDataArray dto = new CsDevModelDto.CsDataArray();
// BeanUtils.copyProperties(item,dto);
// csDataArrayList.add(dto);
// });
//
// for (CsDevModelDto.CsDataSet item1 : csDataSetList) {
// List<CsDevModelDto.CsDataArray> list1 = new ArrayList<>();
// for (CsDevModelDto.CsDataArray item2 : csDataArrayList) {
// if (Objects.equals(item1.getId(),item2.getPid())) {
// list1.add(item2);
// }
// }
// item1.setDataArrays(list1);
// }
//
// for (CsDevModelDto item1 : csDevModelDtoList) {
// List<CsDevModelDto.CsDataSet> list1 = new ArrayList<>();
// for (CsDevModelDto.CsDataSet item2 : csDataSetList) {
// if (Objects.equals(item1.getId(),item2.getPid())) {
// list1.add(item2);
// }
// }
// item1.setDataSets(list1);
// redisUtil.saveByKey(AppRedisKey.DEV_MODEL.concat(item1.getId()),item1);
// }
// }
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public CsDevModelPO addDevModel(CsDevModelAddParm csDevModelAddParm) { public CsDevModelPO addDevModel(CsDevModelAddParm csDevModelAddParm) {
CsDevModelPO csDevModelPO = new CsDevModelPO (); CsDevModelPO csDevModelPO = new CsDevModelPO ();
BeanUtils.copyProperties (csDevModelAddParm, csDevModelPO); BeanUtils.copyProperties (csDevModelAddParm, csDevModelPO);
csDevModelPO.setStatus ("1"); csDevModelPO.setStatus ("1");
csDevModelPO.setVersionDate(Date.valueOf(csDevModelAddParm.getTime()));
this.save (csDevModelPO); this.save (csDevModelPO);
return csDevModelPO; return csDevModelPO;
} }
@@ -46,8 +122,7 @@ public class CsDevModelServiceImpl extends ServiceImpl<CsDevModelMapper, CsDevMo
public Boolean AuditDevModel(CsDevModelAuditParm csDevModelAuditParm) { public Boolean AuditDevModel(CsDevModelAuditParm csDevModelAuditParm) {
CsDevModelPO csDevModelPO = new CsDevModelPO (); CsDevModelPO csDevModelPO = new CsDevModelPO ();
BeanUtils.copyProperties (csDevModelAuditParm, csDevModelPO); BeanUtils.copyProperties (csDevModelAuditParm, csDevModelPO);
boolean b = this.updateById (csDevModelPO); return this.updateById (csDevModelPO);
return b;
} }
@Override @Override
@@ -61,8 +136,7 @@ public class CsDevModelServiceImpl extends ServiceImpl<CsDevModelMapper, CsDevMo
@Override @Override
public CsDevModelPageVO queryDevModelOne(CsDevModelQueryListParm csDevModelQueryListParm) { public CsDevModelPageVO queryDevModelOne(CsDevModelQueryListParm csDevModelQueryListParm) {
CsDevModelPageVO result = this.getBaseMapper ().queryOne(csDevModelQueryListParm); return this.getBaseMapper ().queryOne(csDevModelQueryListParm);
return result;
} }
@Override @Override

View File

@@ -90,9 +90,18 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
private final RedisUtil redisUtil; private final RedisUtil redisUtil;
private final CsSoftInfoMapper csSoftInfoMapper; private final CsSoftInfoMapper csSoftInfoMapper;
@Override
public void refreshDeviceDataCache() {
LambdaQueryWrapper<CsEquipmentDeliveryPO> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.ne(CsEquipmentDeliveryPO::getRunStatus,0);
List<CsEquipmentDeliveryPO> deliveryPOS = this.list(queryWrapper);
redisUtil.saveByKey(AppRedisKey.DEVICE_LIST,deliveryPOS);
}
@Override @Override
@Transactional(rollbackFor = {Exception.class}) @Transactional(rollbackFor = {Exception.class})
public Boolean save(CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm) { public Boolean save(CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm) {
boolean result;
CsEquipmentDeliveryPO po = this.queryEquipmentPOByndid (csEquipmentDeliveryAddParm.getNdid()); CsEquipmentDeliveryPO po = this.queryEquipmentPOByndid (csEquipmentDeliveryAddParm.getNdid());
if(!Objects.isNull (po)){ if(!Objects.isNull (po)){
throw new BusinessException (AlgorithmResponseEnum.NDID_ERROR); throw new BusinessException (AlgorithmResponseEnum.NDID_ERROR);
@@ -121,7 +130,11 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
csEquipmentProcess.setStatus (1); csEquipmentProcess.setStatus (1);
csEquipmentProcessPOService.save(csEquipmentProcess); csEquipmentProcessPOService.save(csEquipmentProcess);
return this.save (csEquipmentDeliveryPo); result = this.save (csEquipmentDeliveryPo);
if (result) {
refreshDeviceDataCache();
}
return result;
} }
@Override @Override
@@ -161,6 +174,9 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
csDevModelRelationService.lambdaUpdate().eq(CsDevModelRelationPO::getDevId,id).set(CsDevModelRelationPO::getStatus,0).update(); csDevModelRelationService.lambdaUpdate().eq(CsDevModelRelationPO::getDevId,id).set(CsDevModelRelationPO::getStatus,0).update();
if (update) {
refreshDeviceDataCache();
}
return update; return update;
} }
@@ -199,6 +215,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
@Override @Override
public Boolean updateEquipmentDelivery(CsEquipmentDeliveryAuditParm csEquipmentDeliveryAuditParm) { public Boolean updateEquipmentDelivery(CsEquipmentDeliveryAuditParm csEquipmentDeliveryAuditParm) {
boolean result;
LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<CsEquipmentDeliveryPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getNdid,csEquipmentDeliveryAuditParm.getNdid()) lambdaQueryWrapper.eq(CsEquipmentDeliveryPO::getNdid,csEquipmentDeliveryAuditParm.getNdid())
.in(CsEquipmentDeliveryPO::getStatus,Arrays.asList(1,2,3)) .in(CsEquipmentDeliveryPO::getStatus,Arrays.asList(1,2,3))
@@ -210,14 +227,22 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
} }
CsEquipmentDeliveryPO csEquipmentDeliveryPo = new CsEquipmentDeliveryPO(); CsEquipmentDeliveryPO csEquipmentDeliveryPo = new CsEquipmentDeliveryPO();
BeanUtils.copyProperties (csEquipmentDeliveryAuditParm, csEquipmentDeliveryPo); BeanUtils.copyProperties (csEquipmentDeliveryAuditParm, csEquipmentDeliveryPo);
return this.updateById (csEquipmentDeliveryPo); result = this.updateById(csEquipmentDeliveryPo);
if (result) {
refreshDeviceDataCache();
}
return result;
} }
@Override @Override
public void updateStatusBynDid(String nDId,Integer status) { public void updateStatusBynDid(String nDId,Integer status) {
boolean result;
LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.set(CsEquipmentDeliveryPO::getStatus,status).eq(CsEquipmentDeliveryPO::getNdid,nDId); lambdaUpdateWrapper.set(CsEquipmentDeliveryPO::getStatus,status).eq(CsEquipmentDeliveryPO::getNdid,nDId);
this.update(lambdaUpdateWrapper); result = this.update(lambdaUpdateWrapper);
if (result) {
refreshDeviceDataCache();
}
} }
@Override @Override
@@ -391,9 +416,13 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
@Override @Override
public void updateSoftInfoBynDid(String nDid, String id, Integer module) { public void updateSoftInfoBynDid(String nDid, String id, Integer module) {
boolean result;
LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.set(CsEquipmentDeliveryPO::getSoftinfoId,id).set(CsEquipmentDeliveryPO::getModuleNumber,module).eq(CsEquipmentDeliveryPO::getNdid,nDid); lambdaUpdateWrapper.set(CsEquipmentDeliveryPO::getSoftinfoId,id).set(CsEquipmentDeliveryPO::getModuleNumber,module).eq(CsEquipmentDeliveryPO::getNdid,nDid);
this.update(lambdaUpdateWrapper); result = this.update(lambdaUpdateWrapper);
if (result) {
refreshDeviceDataCache();
}
} }
@Override @Override
@@ -541,6 +570,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
appLineTopologyDiagramPOQueryWrapper.in("line_id",collect); appLineTopologyDiagramPOQueryWrapper.in("line_id",collect);
appLineTopologyDiagramService.remove(appLineTopologyDiagramPOQueryWrapper); appLineTopologyDiagramService.remove(appLineTopologyDiagramPOQueryWrapper);
} }
refreshDeviceDataCache();
} }
@Override @Override
@@ -585,20 +615,28 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
@Override @Override
public void updateSoftInfo(String nDid, String id) { public void updateSoftInfo(String nDid, String id) {
boolean result;
LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.eq(CsEquipmentDeliveryPO::getNdid,nDid) lambdaUpdateWrapper.eq(CsEquipmentDeliveryPO::getNdid,nDid)
.ne(CsEquipmentDeliveryPO::getRunStatus,0) .ne(CsEquipmentDeliveryPO::getRunStatus,0)
.set(CsEquipmentDeliveryPO::getSoftinfoId,id); .set(CsEquipmentDeliveryPO::getSoftinfoId,id);
this.update(lambdaUpdateWrapper); result = this.update(lambdaUpdateWrapper);
if (result) {
refreshDeviceDataCache();
}
} }
@Override @Override
public void updateModuleNumber(String nDid, Integer number) { public void updateModuleNumber(String nDid, Integer number) {
boolean result;
LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<CsEquipmentDeliveryPO> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.eq(CsEquipmentDeliveryPO::getNdid,nDid) lambdaUpdateWrapper.eq(CsEquipmentDeliveryPO::getNdid,nDid)
.ne(CsEquipmentDeliveryPO::getRunStatus,0) .ne(CsEquipmentDeliveryPO::getRunStatus,0)
.set(CsEquipmentDeliveryPO::getModuleNumber,number); .set(CsEquipmentDeliveryPO::getModuleNumber,number);
this.update(lambdaUpdateWrapper); result = this.update(lambdaUpdateWrapper);
if (result) {
refreshDeviceDataCache();
}
} }
@Override @Override