1.治理App版本信息添加

2.准实时数据接口调整
3.设备登记调整
4.设备接入调整
This commit is contained in:
xy
2024-11-28 08:43:54 +08:00
parent d0c7edff8a
commit b6c2675311
27 changed files with 790 additions and 55 deletions

View File

@@ -38,6 +38,7 @@ import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@@ -66,10 +67,10 @@ public class EquipmentDeliveryController extends BaseController {
@ApiOperation("新增出厂设备")
@ApiImplicitParam(name = "csEquipmentDeliveryAddParm", value = "新增项目参数", required = true)
@DeviceLog(operateType = DeviceOperate.ADD)
public HttpResult<Boolean> addEquipmentDelivery(@RequestBody @Validated CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm){
public HttpResult<CsEquipmentDeliveryPO> addEquipmentDelivery(@RequestBody @Validated CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm){
String methodDescribe = getMethodDescribe("addEquipmentDelivery");
Boolean flag = csEquipmentDeliveryService.save(csEquipmentDeliveryAddParm);
if (flag){
CsEquipmentDeliveryPO po = csEquipmentDeliveryService.save(csEquipmentDeliveryAddParm);
if (Objects.nonNull(po)){
//查询mqtt用户名和密码是否存在
boolean result = mqttUserService.findMqttUser(csEquipmentDeliveryAddParm.getNdid());
if (result){
@@ -77,7 +78,7 @@ public class EquipmentDeliveryController extends BaseController {
mqttUserService.insertMqttUser(csEquipmentDeliveryAddParm.getNdid());
}
}
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, po, methodDescribe);
}

View File

@@ -168,6 +168,20 @@ public class WlRecordController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
/**
* 删除装置测试项
*/
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.UPDATE)
@PostMapping("/deleteItem")
@ApiOperation("删除装置测试项")
@ApiImplicitParam(name = "id", value = "装置测试项Id", required = true)
public HttpResult<Boolean> deleteItem(@RequestParam @Validated String id) {
String methodDescribe = getMethodDescribe("deleteItem");
LogUtil.njcnDebug(log, "{}装置测试项Id为{}", methodDescribe, id);
wlRecordService.deleteItem(id);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
}
/**
* 查询测试项时间段实时数据
*/
@@ -195,6 +209,19 @@ public class WlRecordController extends BaseController {
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, record, methodDescribe);
}
/**
* 根据监测点id查询装置基础数据
*/
@OperateInfo(info = LogEnum.SYSTEM_COMMON, operateType = OperateType.QUERY)
@PostMapping("/findDevBaseDataByLineId")
@ApiOperation("根据监测点id查询装置基础数据")
@ApiImplicitParam(name = "param", value = "查询条件", required = true)
public HttpResult<List<RecordVo>> findDevBaseDataByLineId(@RequestBody @Validated WlRecordParam.lineRecord param) {
String methodDescribe = getMethodDescribe("findDevBaseDataByLineId");
LogUtil.njcnDebug(log, "{},查询对象为:{}", methodDescribe, param);
List<RecordVo> record = wlRecordService.findDevBaseDataByLineId(param);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, record, methodDescribe);
}
/**

View File

@@ -39,7 +39,7 @@ public interface CsEquipmentDeliveryService extends IService<CsEquipmentDelivery
* @Author: clam
* @Date: 2023/3/31
*/
Boolean save(CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm);
CsEquipmentDeliveryPO save(CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm);
/**
* @Description: AuditEquipmentDelivery
* @Param: [id]

View File

@@ -102,6 +102,7 @@ public interface IWlRecordService extends IService<WlRecord> {
*/
WlRecord findDevBaseData(WlRecordParam.Record param);
List<RecordVo> findDevBaseDataByLineId(WlRecordParam.lineRecord param);
/**
* 每日处理没有结束时间的测试基础数据
@@ -110,4 +111,5 @@ public interface IWlRecordService extends IService<WlRecord> {
List<WlRecord> getWlAssByWlId(String wlId);
void deleteItem(String id);
}

View File

@@ -40,6 +40,7 @@ import com.njcn.system.api.DicDataFeignClient;
import com.njcn.system.api.DictTreeFeignClient;
import com.njcn.system.enums.DicDataEnum;
import com.njcn.system.enums.DicTreeEnum;
import com.njcn.system.pojo.po.SysDicTreePO;
import com.njcn.system.pojo.vo.DictTreeVO;
import com.njcn.web.factory.PageFactory;
import com.njcn.web.utils.RequestUtil;
@@ -101,7 +102,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
@Override
@Transactional(rollbackFor = {Exception.class})
public Boolean save(CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm) {
public CsEquipmentDeliveryPO save(CsEquipmentDeliveryAddParm csEquipmentDeliveryAddParm) {
boolean result;
CsEquipmentDeliveryPO po = this.queryEquipmentPOByndid (csEquipmentDeliveryAddParm.getNdid());
if(!Objects.isNull (po)){
@@ -111,6 +112,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
BeanUtils.copyProperties (csEquipmentDeliveryAddParm,csEquipmentDeliveryPo);
csEquipmentDeliveryPo.setStatus (1);
csEquipmentDeliveryPo.setRunStatus(1);
csEquipmentDeliveryPo.setUsageStatus(1);
String code = dictTreeFeignClient.queryById(csEquipmentDeliveryAddParm.getDevType()).getData().getCode();
if (Objects.equals(DicDataEnum.PORTABLE.getCode(),code)) {
csEquipmentDeliveryPo.setProcess(4);
@@ -135,7 +137,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
if (result) {
refreshDeviceDataCache();
}
return result;
return csEquipmentDeliveryPo;
}
@Override
@@ -370,6 +372,7 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
BeanUtils.copyProperties(csEquipmentDeliveryPo, deviceManagerVo);
if (CollUtil.isNotEmpty(dataSet)) {
for (CsDataSet item : dataSet) {
//准实时数据
DeviceManagerVO.DataSetVO dataSetVO = new DeviceManagerVO.DataSetVO();
dataSetVO.setId(item.getId());
dataSetVO.setName("history".equals(type) ? "准实时数据":item.getAnotherName());
@@ -384,14 +387,14 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
dataSetVo2.setType("history");
dataSetList.add(dataSetVo2);
deviceManagerVo.setDataLevel(item.getDataLevel());
//趋势数据tab
DeviceManagerVO.DataSetVO dataSetVo3 = new DeviceManagerVO.DataSetVO();
dataSetVo3.setId(item.getId());
dataSetVo3.setName("历史趋势");
dataSetVo3.setType("trenddata");
dataSetList.add(dataSetVo3);
//下面这些tab仅仅只限于设备监控的便携式设备才会有
if(DataParam.portableDevType.equals(csEquipmentDeliveryPo.getDevType())){
//趋势数据tab
DeviceManagerVO.DataSetVO dataSetVo3 = new DeviceManagerVO.DataSetVO();
dataSetVo3.setId(item.getId());
dataSetVo3.setName("历史趋势");
dataSetVo3.setType("trenddata");
dataSetList.add(dataSetVo3);
//实时数据tab
DeviceManagerVO.DataSetVO dataSetVo4 = new DeviceManagerVO.DataSetVO();
dataSetVo4.setId(item.getId());
@@ -404,6 +407,12 @@ public class CsEquipmentDeliveryServiceImpl extends ServiceImpl<CsEquipmentDeliv
dataSetVo5.setName("暂态事件");
dataSetVo5.setType("event");
dataSetList.add(dataSetVo5);
//测试项tab
DeviceManagerVO.DataSetVO dataSetVo6 = new DeviceManagerVO.DataSetVO();
dataSetVo6.setId(item.getId());
dataSetVo6.setName("测试项记录");
dataSetVo6.setType("items");
dataSetList.add(dataSetVo6);
}
}
}

View File

@@ -90,7 +90,17 @@ public class CsLedgerServiceImpl extends ServiceImpl<CsLedgerMapper, CsLedger> i
List<CsLedgerVO> finalLineList = allList.stream()
.filter(item -> item.getLevel().equals(LineBaseEnum.LINE_LEVEL.getCode()))
.sorted(Comparator.comparing(CsLedgerVO::getSort))
.peek(item -> item.setType("line"))
.peek(
item -> {
item.setType("line");
String index = item.getId().substring(item.getId().length()-1);
if (Objects.equals(index,"0")) {
item.setLineType(0);
} else {
item.setLineType(1);
}
}
)
.collect(Collectors.toList());
checkDevSetData(deviceList);
deviceList.forEach(dev -> dev.setChildren(getChildren(dev, finalLineList)));

View File

@@ -522,6 +522,25 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
return this.getOne(lambdaQueryWrapper);
}
@Override
public List<RecordVo> findDevBaseDataByLineId(WlRecordParam.lineRecord param) {
List<RecordVo> result = new ArrayList<>();
LambdaQueryWrapper<WlRecord> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(WlRecord::getLineId,param.getLineId())
.between(WlRecord::getStartTime,param.getItemStartTime(),param.getItemEndTime())
.eq(WlRecord::getType,1)
.eq(WlRecord::getState,1).orderByDesc(WlRecord::getStartTime);
List<WlRecord> list = this.list(lambdaQueryWrapper);
if (CollUtil.isNotEmpty(list)) {
list.forEach(item->{
RecordVo vo = new RecordVo();
BeanUtils.copyProperties(item,vo);
result.add(vo);
});
}
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void dayDealNoEndTimeEvent(String date) {
@@ -620,6 +639,13 @@ public class WlRecordServiceImpl extends ServiceImpl<WlRecordMapper, WlRecord> i
return this.baseMapper.getDataRecordByTestId(wlId,0);
}
@Override
public void deleteItem(String id) {
LambdaUpdateWrapper<WlRecord> lambdaUpdateWrapper = new LambdaUpdateWrapper<>();
lambdaUpdateWrapper.eq(WlRecord::getId,id).set(WlRecord::getState,0);
this.update(lambdaUpdateWrapper);
}
/**
* 数据项内的时间进行覆盖:解决多个数据项的startTime及endTime之间存在时间冲突
* @param data 数据项