优化逻辑
This commit is contained in:
parent
3085903b88
commit
0afb07f36f
@ -1,9 +1,17 @@
|
||||
package com.yfd.platform.modules.algorithm.controller;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.yfd.platform.config.ResponseResult;
|
||||
import com.yfd.platform.modules.algorithm.domain.AlgorithmClass;
|
||||
import com.yfd.platform.modules.algorithm.service.IAlgorithmClassService;
|
||||
import com.yfd.platform.modules.auxcontrol.domain.DeviceSignal;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -18,4 +26,47 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping("/algorithm/algorithm-class")
|
||||
public class AlgorithmClassController {
|
||||
|
||||
@Resource
|
||||
private IAlgorithmClassService algorithmClassService;
|
||||
|
||||
@GetMapping("/getAlgorithmClassList")
|
||||
@ApiOperation("查询算法分类")
|
||||
public ResponseResult getAlgorithmClassList() {
|
||||
List<AlgorithmClass> list =
|
||||
algorithmClassService.list(new LambdaQueryWrapper<AlgorithmClass>().orderByAsc(AlgorithmClass::getAlgorithmClassCode));
|
||||
return ResponseResult.successData(list);
|
||||
}
|
||||
|
||||
@PostMapping("/addAlgorithmClass")
|
||||
@ApiOperation("新增算法分类")
|
||||
public ResponseResult addAlgorithmClass(@RequestBody AlgorithmClass algorithmClass) {
|
||||
boolean isOK = algorithmClassService.addAlgorithmClass(algorithmClass);
|
||||
if (isOK) {
|
||||
return ResponseResult.success();
|
||||
} else {
|
||||
return ResponseResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/updateAlgorithmClass")
|
||||
@ApiOperation("新增算法分类")
|
||||
public ResponseResult updateAlgorithmClass(@RequestBody AlgorithmClass algorithmClass) {
|
||||
boolean isOK = algorithmClassService.updateAlgorithmClass(algorithmClass);
|
||||
if (isOK) {
|
||||
return ResponseResult.success();
|
||||
} else {
|
||||
return ResponseResult.error();
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/deleteAlgorithmClass")
|
||||
@ApiOperation("新增算法分类")
|
||||
public ResponseResult deleteAlgorithmClass(String id) {
|
||||
boolean isOK = algorithmClassService.deleteAlgorithmClass(id);
|
||||
if (isOK) {
|
||||
return ResponseResult.success();
|
||||
} else {
|
||||
return ResponseResult.error();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ public class AlgorithmDevice implements Serializable {
|
||||
/**
|
||||
* 算法分类id
|
||||
*/
|
||||
private String dictionaryId;
|
||||
private String algorithm_id;
|
||||
|
||||
/**
|
||||
* 参数id
|
||||
|
@ -13,4 +13,26 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface IAlgorithmClassService extends IService<AlgorithmClass> {
|
||||
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 新增算法分类
|
||||
* 参数说明 algorithmClass 算法分类对象
|
||||
* 返回值说明: boolean 是否成功
|
||||
***********************************/
|
||||
boolean addAlgorithmClass(AlgorithmClass algorithmClass);
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 修改算法分类
|
||||
* 参数说明 algorithmClass 算法分类对象
|
||||
* 返回值说明: boolean 是否成功
|
||||
***********************************/
|
||||
boolean updateAlgorithmClass(AlgorithmClass algorithmClass);
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 新增算法分类
|
||||
* 参数说明 id 算法分类Id
|
||||
* 返回值说明: boolean 是否成功
|
||||
***********************************/
|
||||
boolean deleteAlgorithmClass(String id);
|
||||
|
||||
}
|
||||
|
@ -17,4 +17,33 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class AlgorithmClassServiceImpl extends ServiceImpl<AlgorithmClassMapper, AlgorithmClass> implements IAlgorithmClassService {
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 新增算法分类
|
||||
* 参数说明 algorithmClass
|
||||
* 返回值说明: boolean是否成功
|
||||
***********************************/
|
||||
@Override
|
||||
public boolean addAlgorithmClass(AlgorithmClass algorithmClass) {
|
||||
return this.saveOrUpdate(algorithmClass);
|
||||
}
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 修改算法分类
|
||||
* 参数说明 algorithmClass 算法分类对象
|
||||
* 返回值说明: boolean 是否成功
|
||||
***********************************/
|
||||
@Override
|
||||
public boolean updateAlgorithmClass(AlgorithmClass algorithmClass) {
|
||||
return this.saveOrUpdate(algorithmClass);
|
||||
}
|
||||
|
||||
/**********************************
|
||||
* 用途说明: 新增算法分类
|
||||
* 参数说明 id 算法分类Id
|
||||
* 返回值说明: boolean 是否成功
|
||||
***********************************/
|
||||
@Override
|
||||
public boolean deleteAlgorithmClass(String id) {
|
||||
return this.removeById(id);
|
||||
}
|
||||
}
|
||||
|
@ -47,6 +47,7 @@ public class DeviceWorkDataController {
|
||||
return ResponseResult.successData(deviceWorkDataPage);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getDeviceWorkData")
|
||||
@ApiOperation("查询变电站设备运行数据")
|
||||
public ResponseResult getDeviceWorkData(String stationId) {
|
||||
@ -54,6 +55,8 @@ public class DeviceWorkDataController {
|
||||
return ResponseResult.successData(map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public Map<String, Object> processDeviceData(List<DeviceWorkData> deviceWorkDataList, String signalId) {
|
||||
// 生成过去60分钟的分钟时间槽
|
||||
LocalDateTime now = LocalDateTime.now().truncatedTo(ChronoUnit.MINUTES);
|
||||
|
@ -245,7 +245,10 @@ public class SubstationDevice implements Serializable {
|
||||
*/
|
||||
private String effectiveArea;
|
||||
|
||||
|
||||
/**
|
||||
* 声纹装置的录制时长,当前点位选中声纹装置时,需要维护该字段,单位:秒
|
||||
*/
|
||||
private String duration;
|
||||
/**
|
||||
* 声纹设备缺陷类型,声纹缺陷list集合,采用","分隔
|
||||
*/
|
||||
|
@ -125,7 +125,7 @@ public interface TaskResultMapper extends BaseMapper<TaskResult> {
|
||||
"file_type, file_path, value_type, value, unit, " +
|
||||
"`desc`, `conf`, `time`, defect_file_path, rectangle, flag, valid," +
|
||||
"revise_value,revise_unit,revise_valid,is_alarm,datastatus,lastmodifier,lastmodifydate," +
|
||||
"station_code,custom1,custom2,custom3,robot_code,robot_result)" +
|
||||
"station_code,custom1,custom2,custom3,robot_code,robot_result,phase,voice_analysis_type_list)" +
|
||||
"values " +
|
||||
"<foreach collection='taskList' index='index' item='item' separator=','> " +
|
||||
"(#{item.resultId}, #{item.taskTodoId}, #{item.orderNum}, #{item.patroldeviceCode}, #{item" +
|
||||
@ -138,7 +138,7 @@ public interface TaskResultMapper extends BaseMapper<TaskResult> {
|
||||
"#{item.time}, #{item.defectFilePath},#{item.rectangle}, #{item.flag}," +
|
||||
"#{item.valid}, #{item.reviseValue}, #{item.reviseUnit}," +
|
||||
"#{item.reviseValid},#{item.isAlarm}, #{item.datastatus}, #{item.lastmodifier}," +
|
||||
"#{item.lastmodifydate},#{item.stationCode}, #{item.custom1}, #{item.custom2}, #{item.custom3}, #{item.robotCode}, #{item.robotResult}) " +
|
||||
"#{item.lastmodifydate},#{item.stationCode}, #{item.custom1}, #{item.custom2}, #{item.custom3}, #{item.robotCode}, #{item.robotResult},#{item.phase},#{item.voiceAnalysisTypeList}) " +
|
||||
"</foreach> " +
|
||||
"ON DUPLICATE KEY UPDATE " +
|
||||
"task_todo_id=VALUES(task_todo_id), " +
|
||||
@ -189,10 +189,11 @@ public interface TaskResultMapper extends BaseMapper<TaskResult> {
|
||||
"custom2=VALUES(custom2), " +
|
||||
"custom3=VALUES(custom3), " +
|
||||
"robot_code=VALUES(robot_code), " +
|
||||
"robot_result=VALUES(robot_result) " +
|
||||
"robot_result=VALUES(robot_result), " +
|
||||
"phase=VALUES(phase)," +
|
||||
"voice_analysis_type_list=VALUES(voice_analysis_type_list) " +
|
||||
"</script>")
|
||||
void batchAdd(List<TaskResult> taskList);
|
||||
|
||||
List<Map<String, Object>> getPatrolDeviceInspectionStat();
|
||||
|
||||
List<Map<String, Object>> getNonHomologousAnalysis(String stationCode, String taskName, String mainDeviceId, String componentId, String bayId, String startFormat, String endFormat);
|
||||
|
@ -559,7 +559,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements IT
|
||||
//相机参数[{"patroldevice_name":"1","patroldevice_code":"","patroldevice_channelcode":"","patroldevice_pos":"","pos_name":"","baseimage":"","effective_region":[{"x1":"","y1":""},{"x2":"","y2":""}]}]
|
||||
taskResult.setPatroldeviceName(jobj.getStr("patroldevice_name"));
|
||||
taskResult.setPatroldeviceCode(jobj.getStr("patroldevice_code"));
|
||||
taskResult.setPatroldeviceChannelcode(jobj.getStr("patroldevice_channelcode"));
|
||||
String patroldeviceChannelcode = jobj.getStr("patroldevice_channelcode");
|
||||
if (StrUtil.isBlank(patroldeviceChannelcode)) {
|
||||
patroldeviceChannelcode = taskResult.getPatroldeviceCode();
|
||||
}
|
||||
taskResult.setPatroldeviceChannelcode(patroldeviceChannelcode);
|
||||
taskResult.setPatroldevicePos(jobj.getStr("patroldevice_pos"));
|
||||
taskResult.setPatroldeviceBaseimage(jobj.getStr("device_baseimage"));
|
||||
taskResult.setPatroldeviceEffectiveregion(jobj.getStr("effective_region"));
|
||||
|
Loading…
Reference in New Issue
Block a user