add:大屏添加播报时间
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package org.nl.wms.sb.bigscreen.rest;
|
package org.nl.wms.sb.bigscreen.rest;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
@@ -9,6 +10,7 @@ import org.nl.wms.sb.bigscreen.service.DeviceBigScreenService;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
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.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
@@ -76,4 +78,11 @@ public class DeviceBigScreenController {
|
|||||||
public ResponseEntity<Object> getTodayTask(){
|
public ResponseEntity<Object> getTodayTask(){
|
||||||
return new ResponseEntity<>(deviceBigScreenService.getTodayTask(),HttpStatus.OK);
|
return new ResponseEntity<>(deviceBigScreenService.getTodayTask(),HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/updateWarnTime")
|
||||||
|
@Log("当日任务列表")
|
||||||
|
@ApiOperation("当日任务列表")
|
||||||
|
public void getTodayTask(@RequestBody JSONObject json){
|
||||||
|
deviceBigScreenService.updateWarnTime(json);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,4 +51,9 @@ public interface DeviceBigScreenService {
|
|||||||
* @return JSONObject
|
* @return JSONObject
|
||||||
*/
|
*/
|
||||||
JSONObject getTodayTask();
|
JSONObject getTodayTask();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新播报时间
|
||||||
|
*/
|
||||||
|
void updateWarnTime(JSONObject json);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -543,4 +544,20 @@ public class DeviceBigScreenServiceImpl implements DeviceBigScreenService {
|
|||||||
resultJson.put("desc", "查询成功");
|
resultJson.put("desc", "查询成功");
|
||||||
return resultJson;
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -260,6 +260,8 @@
|
|||||||
IF 输入.flag = "4"
|
IF 输入.flag = "4"
|
||||||
QUERY
|
QUERY
|
||||||
SELECT
|
SELECT
|
||||||
|
mst.repair_id as id,
|
||||||
|
false as needCast,
|
||||||
mst.input_time AS input_time,
|
mst.input_time AS input_time,
|
||||||
mst.repair_code AS repair_code,
|
mst.repair_code AS repair_code,
|
||||||
(
|
(
|
||||||
@@ -312,6 +314,8 @@
|
|||||||
UNION
|
UNION
|
||||||
|
|
||||||
SELECT
|
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.create_time AS input_time,
|
||||||
st.request_code AS repair_code,
|
st.request_code AS repair_code,
|
||||||
class.class_name AS maintenancecycle,
|
class.class_name AS maintenancecycle,
|
||||||
@@ -373,6 +377,8 @@
|
|||||||
UNION
|
UNION
|
||||||
|
|
||||||
SELECT
|
SELECT
|
||||||
|
mst.maint_id as id,
|
||||||
|
false as needCast,
|
||||||
mst.input_time AS input_time,
|
mst.input_time AS input_time,
|
||||||
mst.maint_code AS repair_code,
|
mst.maint_code AS repair_code,
|
||||||
(
|
(
|
||||||
|
|||||||
Reference in New Issue
Block a user