opt:任务优先级

This commit is contained in:
zhangzhiqiang
2023-08-16 11:51:08 +08:00
parent 17fe0e6447
commit f23bb88d63
12 changed files with 112 additions and 54 deletions

View File

@@ -33,6 +33,11 @@ public class MpsSaleOrderIcExt implements Serializable {
*/
private String sale_id;
/**
* 销售单编号
*/
private String sale_code;
/**
* 明细序号
*/

View File

@@ -19,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
/**
@@ -46,6 +47,15 @@ public class MpsSaleOrderIcExtController {
return new ResponseEntity<>(HttpStatus.OK);
}
@PostMapping("/getQuery")
@Log("新增订单扩展表")
//("新增订单扩展表")
public ResponseEntity<Object> query(@RequestBody JSONObject whereJson) {
MpsSaleOrderIcExt one = extService.getOne(new QueryWrapper<MpsSaleOrderIcExt>()
.eq("sale_id", whereJson.getString("sale_id")).eq("material_code", whereJson.getString("material_code")));
return new ResponseEntity<>(one,HttpStatus.OK);
}
@PostMapping("/getExtList")
@Log("根据工单获取条码")
//("根据工单获取条码")
@@ -62,13 +72,14 @@ public class MpsSaleOrderIcExtController {
}else {
print_no = one.getPrint_no();
}
List<String> barCodes = new ArrayList<>();
LinkedList<String> barCodes = new LinkedList<>();
for (int i =0;i<whereJson.getInteger("print_num");i++){
String bar_code = whereJson.getString("workorder_code") + whereJson.getString("is_flip") + whereJson.getString("target_roadway") + String.format("%05d", print_no + i+1);
barCodes.add(bar_code);
}
one.setPrint_no(print_no+whereJson.getInteger("print_num"));
one.setBar_code(barCodes.getLast());
if (one.getOrderext_id() == null){
one.setOrderext_id(IdUtil.getStringId());
extService.save(one);
@@ -78,13 +89,5 @@ public class MpsSaleOrderIcExtController {
return new ResponseEntity<>(barCodes,HttpStatus.OK);
}
public static void main(String[] args) {
int print_no = 0;
for (int i =0;i<5;i++){
String bar_code = String.format("%05d", print_no + i+1);
System.out.println(bar_code);
}
System.out.println(print_no + 5);
}
}

View File

@@ -120,7 +120,7 @@ public class EngraveSendEmpTask extends AbstractAcsTask {
task.put("is_send", true);
task.put("create_name", SecurityUtils.getCurrentNickName());
task.put("create_time", DateUtil.now());
task.put("priority", "1");
task.put("priority", "7");
task.put("finished_type", "1");
task.put("agv_system_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode());
SchBaseTask schBaseTask = task.toJavaObject(SchBaseTask.class);

View File

@@ -167,7 +167,7 @@ public class PlotterCallEmptyTask extends AbstractAcsTask {
task.put("update_name", SecurityUtils.getCurrentNickName());
task.put("create_time", DateUtil.now());
task.put("update_time", DateUtil.now());
task.put("priority", "1");
task.put("priority", "7");
task.put("agv_system_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode());
task.put("table_fk_id", fk);
return task;

View File

@@ -146,7 +146,7 @@ public class PlotterSendMaterialTask extends AbstractAcsTask {
task.put("is_send", true);
task.put("create_name", SecurityUtils.getCurrentNickName());
task.put("create_time", DateUtil.now());
task.put("priority", "1");
task.put("priority", "7");
task.put("finished_type", "1");
task.put("agv_system_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode());
task.put("table_fk_id",order.getWorkorder_code());

View File

@@ -168,7 +168,7 @@ public class WashCallEmptyTask extends AbstractAcsTask {
task.put("update_name", SecurityUtils.getCurrentNickName());
task.put("create_time", DateUtil.now());
task.put("update_time", DateUtil.now());
task.put("priority", "1");
task.put("priority", "8");
task.put("agv_system_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode());
return task;
}

View File

@@ -137,7 +137,7 @@ public class WashMachineryTask extends AbstractAcsTask {
task.put("create_name", SecurityUtils.getCurrentNickName());
task.put("create_time", DateUtil.now());
task.put("is_auto_issue", false);
task.put("priority", "1");
task.put("priority", "8");
task.put("task_step", 1);
task.put("material_id",devices.get(0).getMaterial_id());
task.put("material_qty",devices.stream().mapToInt(a->a.getDeviceinstor_weight().intValue()).sum());

View File

@@ -133,7 +133,7 @@ public class WashSendMaterialQZTask extends AbstractAcsTask {
task.put("create_time", DateUtil.now());
task.put("is_send",true);
task.put("is_auto_issue",false);
task.put("priority", "1");
task.put("priority", "8");
task.put("finished_type", "1");
task.put("agv_system_type", AcsTaskEnum.AGV_SYSTEM_XC.getCode());
task.put("table_fk_id",washTask!=null?washTask.getTask_id():"");

View File

@@ -478,6 +478,7 @@ public class StIvtIostorinvBcpOutServiceImpl extends ServiceImpl<StIvtIostorinvB
SchBaseTask taskDao = iSchBaseTaskService.getById(task_id);
JSONArray param = new JSONArray();
taskDao.setPriority("7");
param.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao)));
// 1.下发任务
WmsToAcsService bean = SpringContextHolder.getBean(WmsToAcsService.class);

View File

@@ -448,6 +448,7 @@ public class StIvtIostorinvBcpServiceImpl extends ServiceImpl<StIvtIostorinvBcpM
SchBaseTask taskDao = iSchBaseTaskService.getById(task_id);
JSONArray param = new JSONArray();
taskDao.setPriority("8");
param.add(JSON.parseObject(JSONUtil.toJsonStr(taskDao)));
// 1.下发任务