Browse Source

更新

master
gengby 2 years ago
parent
commit
b5e822a8ab
  1. 7
      acs/nladmin-system/src/main/java/org/nl/acs/hand/amb/rest/AMHandController.java
  2. 13
      acs/nladmin-system/src/main/java/org/nl/acs/hand/amb/service/impl/AMHandServiceImpl.java
  3. 41
      acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java

7
acs/nladmin-system/src/main/java/org/nl/acs/hand/amb/rest/AMHandController.java

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

13
acs/nladmin-system/src/main/java/org/nl/acs/hand/amb/service/impl/AMHandServiceImpl.java

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

41
acs/nladmin-system/src/main/java/org/nl/modules/quartz/task/AutoCreateInst.java

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

Loading…
Cancel
Save