This commit is contained in:
2023-01-28 09:40:06 +08:00
parent 18461c31aa
commit b5e822a8ab
3 changed files with 32 additions and 29 deletions

View File

@@ -37,12 +37,13 @@ public class AMHandController {
return new ResponseEntity<>(HandService.queryArea(null), HttpStatus.OK);
}
@PostMapping("/queryPointByArea/{areaCode}")
@PostMapping("/queryPointByArea")
@Log("根据区域查询点位")
@ApiOperation("根据区域查询点位")
@SaIgnore
//@PreAuthorize("@el.check('sect:list')")
public ResponseEntity<Object> queryPointByArea(@PathVariable String areaCode) {
public ResponseEntity<Object> queryPointByArea(@RequestBody JSONObject jsonObject) {
String areaCode = jsonObject.getString("areaCode");
return new ResponseEntity<>(HandService.queryPointByArea(areaCode), HttpStatus.OK);
}
@@ -55,7 +56,7 @@ public class AMHandController {
return new ResponseEntity<>(HandService.queryMaterial(), HttpStatus.OK);
}
@PostMapping("/bindPoint")
@PostMapping("/bindpoint")
@Log("点位绑定")
@ApiOperation("点位绑定")
@SaIgnore

View File

@@ -650,7 +650,7 @@ public class AMHandServiceImpl implements AMHandService {
String device_code = MapUtil.getStr(reqParam, "device_code");
String material_type = MapUtil.getStr(reqParam, "material_type");
String type = MapUtil.getStr(reqParam, "type");
String status = MapUtil.getStr(reqParam, "status");
String status = "0";
JSONObject jo = new JSONObject();
if (StrUtil.isEmpty(type)) {
jo.put("code", "0");
@@ -662,15 +662,14 @@ public class AMHandServiceImpl implements AMHandService {
jo.put("desc", "失败,设备号不能为空!");
return jo;
}
if (StrUtil.isNotEmpty(material_type) && StrUtil.equals(status, "0")) {
if (StrUtil.isEmpty(material_type)) {
jo.put("code", "0");
jo.put("desc", "失败,点位带有物料信息与无货状态不符合!");
return jo;
} else if (StrUtil.isEmpty(material_type) && !StrUtil.equals(status, "0")) {
jo.put("code", "0");
jo.put("desc", "失败,点位无物料信息与有货状态不符合!");
jo.put("desc", "失败,当前物料不能为空!");
return jo;
}
if (StrUtil.equals(material_type, "1")) {
status = "1";
}
JSONObject map = new JSONObject();
if (StrUtil.equals(type, "0")) {
map.put("material_type", "");

View File

@@ -2,6 +2,7 @@ package org.nl.modules.quartz.task;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
@@ -40,26 +41,28 @@ public class AutoCreateInst {
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
List<TaskDto> list = taskserver.queryAll("task_status = '0'");
Collections.sort(list, new Comparator<TaskDto>() {
@Override
public int compare(TaskDto t1, TaskDto t2) {
String start_device_code1 = t1.getStart_device_code();
String start_device_code2 = t2.getStart_device_code();
Integer start_1 = Integer.parseInt(start_device_code1.split("_")[0]);
Integer start_2 = Integer.parseInt(start_device_code2.split("_")[0]);
if (start_1 > start_2){
if (ObjectUtil.isNotEmpty(list))
Collections.sort(list, new Comparator<TaskDto>() {
@Override
public int compare(TaskDto t1, TaskDto t2) {
String start_device_code1 = t1.getStart_device_code();
String start_device_code2 = t2.getStart_device_code();
Integer start_1 = Integer.parseInt(start_device_code1.split("_")[0]);
Integer start_2 = Integer.parseInt(start_device_code2.split("_")[0]);
if (start_1 == start_2) {
int end_i = Integer.parseInt(start_device_code1.split("_")[start_device_code1.split("_").length - 1]);
int end_j = Integer.parseInt(start_device_code2.split("_")[start_device_code2.split("_").length - 1]);
if (end_i > end_j) {
return 1;
} else if (end_i < end_j) {
return -1;
}
return 0;
} else {
return 1;
}
}
int end_i = Integer.parseInt(start_device_code1.split("_")[start_device_code1.split("_").length - 1]);
int end_j = Integer.parseInt(start_device_code2.split("_")[start_device_code2.split("_").length - 1]);
if (end_i > end_j) {
return 1;
} else if (end_i < end_j) {
return -1;
}
return 0;
}
});
});
for (int i = 0; i < list.size(); i++) {
TaskDto acsTask = list.get(i);
String taskid = acsTask.getTask_id();