opt: 看板更新不在查询电气报错信号
This commit is contained in:
@@ -4,7 +4,6 @@ import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.b_lms.sch.tasks.slitter.constant.SlitterEnum;
|
||||
import org.nl.b_lms.sch.tasks.slitter.service.SlitterService;
|
||||
import org.nl.b_lms.sch.tasks.slitter.util.SlitterTaskUtil;
|
||||
import org.nl.modules.common.utils.RedisUtils;
|
||||
@@ -43,61 +42,44 @@ public class SlitterController {
|
||||
@PostMapping("/calPaperNum")
|
||||
@Log("扣除纸管库存")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> calPaperNum(@RequestBody JSONObject entity){
|
||||
public ResponseEntity<Object> calPaperNum(@RequestBody JSONObject entity) {
|
||||
return new ResponseEntity<>(slitterService.acsToReduceTube(entity), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PostMapping("/tzInfo")
|
||||
@Log("套轴BCP透明链路")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> tzInfo(@RequestBody JSONObject entity){
|
||||
public ResponseEntity<Object> tzInfo(@RequestBody JSONObject entity) {
|
||||
return new ResponseEntity<>(redisUtils.get("INFO" + entity.getString("device_code")), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PostMapping("/v2/tzInfo")
|
||||
@Log("套轴BCP透明链路2")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> tzInfo2(@RequestBody JSONObject entity){
|
||||
public ResponseEntity<Object> tzInfo2(@RequestBody JSONObject entity) {
|
||||
List<String> list = SlitterTaskUtil.objectToList(redisUtils.get("ERROR" + entity.getString("device_code")));
|
||||
try {
|
||||
// 获取字典数据
|
||||
List<Dict> bcbjError = dictService.getDictByName("CBJ_ERROR");
|
||||
// 判断气胀轴是否有轴
|
||||
JSONArray device_rows = new JSONArray();
|
||||
JSONObject device_obj = new JSONObject();
|
||||
device_rows.add(device_obj);
|
||||
device_obj.put("device_code", entity.getString("device_code"));
|
||||
// todo: 暂时都是B1
|
||||
device_obj.put("product_area", "B1");
|
||||
JSONObject pointStatus = wmsToAcsService.getPointStatus(device_rows);
|
||||
JSONObject data = pointStatus.getJSONArray("data").getJSONObject(0);
|
||||
Dict error = bcbjError.stream()
|
||||
.filter(p -> p.getValue().equals(data.getString("error")))
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
list.add(">>>实时获取电气上报异常信息:" + (error != null
|
||||
? error.getLabel()
|
||||
: (data.getString("error") + "对应异常信息未定义")));
|
||||
} catch (Exception e) {
|
||||
list.add(">>>获取电气上报异常信息失败(此记录不影响流程)...");
|
||||
}
|
||||
return new ResponseEntity<>(list, HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PostMapping("/v2/tzTaskINfo")
|
||||
@Log("套轴BCP透明链路2")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> tzTaskINfo(@RequestBody JSONObject entity){
|
||||
public ResponseEntity<Object> tzTaskINfo(@RequestBody JSONObject entity) {
|
||||
return new ResponseEntity<>(slitterService.tzTaskINfo(entity), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/recover")
|
||||
@Log("恢复计划")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> recover(@RequestBody JSONObject entity){
|
||||
public ResponseEntity<Object> recover(@RequestBody JSONObject entity) {
|
||||
slitterService.recover(entity);
|
||||
return new ResponseEntity<>( HttpStatus.OK);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/callShaft")
|
||||
@Log("呼叫空轴")
|
||||
@SaIgnore
|
||||
public ResponseEntity<Object> callShaft(@RequestBody JSONObject entity){
|
||||
public ResponseEntity<Object> callShaft(@RequestBody JSONObject entity) {
|
||||
return new ResponseEntity<>(slitterService.callShaft(entity), HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user