add:大屏添加播报时间

This commit is contained in:
zhangzhiqiang
2022-11-22 11:15:15 +08:00
parent aa691e7107
commit 97b5fa68f3
4 changed files with 37 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
package org.nl.wms.sb.bigscreen.rest;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@@ -9,6 +10,7 @@ import org.nl.wms.sb.bigscreen.service.DeviceBigScreenService;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -76,4 +78,11 @@ public class DeviceBigScreenController {
public ResponseEntity<Object> getTodayTask(){
return new ResponseEntity<>(deviceBigScreenService.getTodayTask(),HttpStatus.OK);
}
@PostMapping("/updateWarnTime")
@Log("当日任务列表")
@ApiOperation("当日任务列表")
public void getTodayTask(@RequestBody JSONObject json){
deviceBigScreenService.updateWarnTime(json);
}
}

View File

@@ -51,4 +51,9 @@ public interface DeviceBigScreenService {
* @return JSONObject
*/
JSONObject getTodayTask();
/**
* 更新播报时间
*/
void updateWarnTime(JSONObject json);
}

View File

@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.HashMap;
import java.util.stream.Collectors;
@Service
@RequiredArgsConstructor
@@ -543,4 +544,20 @@ public class DeviceBigScreenServiceImpl implements DeviceBigScreenService {
resultJson.put("desc", "查询成功");
return resultJson;
}
@Override
public void updateWarnTime(JSONObject json) {
if (ObjectUtil.isNotEmpty(json)){
try {
JSONArray ids = json.getJSONArray("ids");
String requestId = ids.stream().map(o -> (String) o).collect(Collectors.joining("','"));
JSONObject param = new JSONObject();
param.put("WARN_TIME", DateUtil.now());
WQLObject deviceRepairRequest = WQLObject.getWQLObject("EM_BI_DeviceRepairRequest");
deviceRepairRequest.update(param,"request_id in (\'"+requestId+"\')");
}catch (Exception ex){
log.error("updateWarnTime error:{}",ex.getMessage());
}
}
}
}

View File

@@ -260,6 +260,8 @@
IF 输入.flag = "4"
QUERY
SELECT
mst.repair_id as id,
false as needCast,
mst.input_time AS input_time,
mst.repair_code AS repair_code,
(
@@ -312,6 +314,8 @@
UNION
SELECT
st.request_id AS id,
IF(process_id IS NULL AND IF(warn_time IS NULL,CURDATE(),warn_time)<SUBTIME(NOW(),'0:10:0'),TRUE,FALSE) AS needCast,
st.create_time AS input_time,
st.request_code AS repair_code,
class.class_name AS maintenancecycle,
@@ -373,6 +377,8 @@
UNION
SELECT
mst.maint_id as id,
false as needCast,
mst.input_time AS input_time,
mst.maint_code AS repair_code,
(