Browse Source

Merge remote-tracking branch 'origin/develop' into develop

develop
wangsixiang 9 months ago
parent
commit
69c4c2094f
  1. 9
      zc-business/src/main/java/com/zc/business/controller/DcOperLogController.java
  2. 6
      zc-business/src/main/java/com/zc/business/service/IDcOperLogService.java
  3. 47
      zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java
  4. 21
      zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java
  5. 13
      zc-business/src/main/java/com/zc/business/service/impl/DcOperLogServiceImpl.java

9
zc-business/src/main/java/com/zc/business/controller/DcOperLogController.java

@ -31,6 +31,15 @@ public class DcOperLogController extends BaseController {
//*********************************调用功能记录增删改查******************************************
/**
* 查询设备的调用次数根据设备类型分组
*/
@ApiOperation("查询设备的调用次数根据设备类型分组")
@GetMapping("count/deviceType")
public AjaxResult countByDeviceType() {
return AjaxResult.success(dcOperLogService.countByDeviceType());
}
/**
* 分页查询列表
*

6
zc-business/src/main/java/com/zc/business/service/IDcOperLogService.java

@ -6,6 +6,7 @@ import com.zc.business.domain.DcOperLog;
import java.util.List;
import java.util.Date;
import java.util.Map;
/**
* 调用功能记录Service接口
@ -49,4 +50,9 @@ public interface IDcOperLogService extends IService<DcOperLog> {
*/
List<DcOperLog> listDcOperLog(DcOperLog dcOperLog,Date endTime,Date startTime);
/**
* 查询设备的调用次数根据设备类型分组
*/
List<Map<String,Object>> countByDeviceType();
}

47
zc-business/src/main/java/com/zc/business/service/impl/DcEmergencyPlansServiceImpl.java

@ -798,40 +798,28 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
if (device.getDeviceType().equals(DeviceTypeConstants.DRIVING_GUIDANCE.toString())) {
// 行车诱导
functionId = DeviceFunctionIdConstants.DRIVING_GUIDANCE;
// 控制模式 1-手动 2-自动 3-万年历
// 控制模式 00-手动 01-自动 02-万年历
String controlModel = otherConfig.get("controlModel").toString();
props.put("onWorkStatus", otherConfig.get("state").toString());
props.put("inWorkStatus", otherConfig.get("state").toString());
props.put("mode", controlModel);
JSONObject result = new JSONObject();
String state = "";
// 01常亮02流水03闪烁04关闭
if (otherConfig.get("state").toString().equals("01")) {
state = "常量";
} else if (otherConfig.get("state").toString().equals("02")) {
state = "流水";
} else if (otherConfig.get("state").toString().equals("03")) {
state = "闪烁";
}else {
state = "关闭";
}
String stateName = otherConfig.get("name").toString();
if (controlModel.equals("01")) {
String startTime = otherConfig.get("startTime").toString();
String endTime = otherConfig.get("endTime").toString();
props.put("mode", "01");
props.put("startDisplayTime", startTime);
props.put("endDisplayTime", endTime);
result.put("content","时间自动:"+state+";"+startTime+"-"+endTime);
result.put("content","自动:"+stateName+";时间范围:"+startTime+"-"+endTime);
} else if (controlModel.equals("00")) {
result.put("content","手动:"+state);
result.put("content","手动:"+stateName);
}else {
result.put("content","万年历:"+state);
result.put("content","万年历:"+stateName);
}
AjaxResult ajaxResult = dcDeviceController.invokedFunction(iotDeviceId, functionId, props);
// 将调用结果存入到 resultArray(操作结果) 中
result.put("device", device.getId());
result.put("deviceName",device.getDeviceName());
AjaxResult ajaxResult = dcDeviceController.invokedFunction(iotDeviceId, functionId, props);
// 将调用结果存入到 resultArray(操作结果) 中
result.put("result", ajaxResult);
resultArray.add(result);
@ -919,14 +907,13 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
}
else if (device.getDeviceType().equals(DeviceTypeConstants.LASER_FATIGUE_AWAKENING.toString())) {
// 激光疲劳唤醒
functionId = otherConfig.get("state").toString();
AjaxResult ajaxResultState = dcDeviceController.invokedFunction(iotDeviceId, functionId, new HashMap<>());
JSONObject result = new JSONObject();
result.put("device", device.getId());
result.put("deviceName",device.getDeviceName());
result.put("result", ajaxResultState);
resultArray.add(result);
HashMap<String,Object> map = new HashMap<>();
map.put("SET",otherConfig.get("operationType").toString());
JSONObject resultTime = new JSONObject();
resultTime.put("device", device.getId());
resultTime.put("deviceName",device.getDeviceName());
AjaxResult ajaxResultState = dcDeviceController.invokedFunction(iotDeviceId, "SETMD", map);
resultTime.put("resultState", ajaxResultState);
// 操作时长
String operationDuration = "SETTM" + otherConfig.get("operationDuration").toString();
@ -934,12 +921,8 @@ public class DcEmergencyPlansServiceImpl implements DcEmergencyPlansService {
HashMap<String, Object> propsTime = new HashMap<>();
propsTime.put("SET", operationDuration);
functionId = DeviceFunctionIdConstants.VARIABLE_INFORMATION_FLAG_SETTM;
resultTime.put("content","状态:"+name+";操作时长"+otherConfig.get("operationDuration")+"分钟");
AjaxResult ajaxResult = dcDeviceController.invokedFunction(iotDeviceId, functionId, propsTime);
JSONObject resultTime = new JSONObject();
resultTime.put("device", device.getId());
resultTime.put("deviceName",device.getDeviceName());
resultTime.put("content","状态:"+name+"操作时长"+otherConfig.get("operationDuration"));
resultTime.put("result", ajaxResult);
resultArray.add(resultTime);

21
zc-business/src/main/java/com/zc/business/service/impl/DcEventServiceImpl.java

@ -143,10 +143,7 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
public int insertDcEvent(DcEvent dcEvent) {
String dcEventId = dcEvent.getId();
//桩号校验
if (!com.ruoyi.common.utils.StakeMarkUtils.checkStakeMark(dcEvent.getStakeMark())){
return -1;
}
//获取事件类型
int eventType = Math.toIntExact(dcEvent.getEventType());
@ -199,7 +196,10 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
String facilityId = String.valueOf(dcEvent.getDcEventServiceArea().getFacilityId());
dcEvent.setStakeMark(extracted(facilityId));
}
//桩号校验
if (!com.ruoyi.common.utils.StakeMarkUtils.checkStakeMark(dcEvent.getStakeMark())){
return -1;
}
int i7 = dcEventMapper.insertDcEvent(dcEvent);
@ -435,6 +435,17 @@ public class DcEventServiceImpl extends ServiceImpl<DcEventMapper, DcEvent> impl
break;
//其他事件
case 11:
if (dcEventId != null) {//首页进入
DcEvent dcEvent1 = new DcEvent();
dcEvent1.setId(dcEventId);//事件id
dcEvent1.setEventNature(1l);//首发事件
dcEvent1.setLinkId(uuid);//关联管制事件id
dcEventMapper.updateDcEventLinkId(dcEvent1);//修改事件性质
dcEvent.setEventNature(2l);
dcEventMapper.updateDcEventLinkId(dcEvent);//修改 新添加的 事件性质
}
break;
//
default:

13
zc-business/src/main/java/com/zc/business/service/impl/DcOperLogServiceImpl.java

@ -1,6 +1,7 @@
package com.zc.business.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.PageUtils;
import com.zc.business.domain.*;
@ -46,6 +47,18 @@ public class DcOperLogServiceImpl extends ServiceImpl<DcOperLogMapper, DcOperLog
return list(getDcOperLogLambdaQueryWrapper(dcOperLog, endTime, startTime));
}
/**
* 查询设备的调用次数根据设备类型分组
*/
@Override
public List<Map<String, Object>> countByDeviceType() {
QueryWrapper<DcOperLog> queryWrapper = new QueryWrapper<>();
queryWrapper.select("COUNT(dc_device_type) as deviceCount", "dc_device_type")
.ne("dc_device_type", "")
.groupBy("dc_device_type");
return listMaps(queryWrapper);
}
private static LambdaQueryWrapper<DcOperLog> getDcOperLogLambdaQueryWrapper(DcOperLog dcOperLog, Date endTime, Date startTime) {
LambdaQueryWrapper<DcOperLog> lambdaQueryWrapper = new LambdaQueryWrapper<>();
if (dcOperLog.getId() != null) {

Loading…
Cancel
Save