Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -124,6 +124,9 @@ public class LiKuToAcsServiceImpl implements LiKuToAcsService {
|
||||
if(StrUtil.equals(task.getTask_type(),"7") && StrUtil.equals(task.getStorage_task_type(),"4")){
|
||||
inst.setInstruction_status("2");
|
||||
instructionService.finish(inst.getInstruction_id());
|
||||
} else {
|
||||
inst.setRemark("立库已反馈完成,待输送上报任务号");
|
||||
instructionService.update(inst);
|
||||
}
|
||||
|
||||
} else if(StrUtil.equals(status,"4")){
|
||||
|
||||
@@ -5,27 +5,25 @@ 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 cn.hutool.http.HttpResponse;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.nl.acs.AcsConfig;
|
||||
import org.nl.acs.agv.server.*;
|
||||
import org.nl.acs.agv.server.MagicAgvService;
|
||||
import org.nl.acs.agv.server.NDCAgvService;
|
||||
import org.nl.acs.agv.server.XianGongAgvService;
|
||||
import org.nl.acs.auto.initial.ApplicationAutoInitial;
|
||||
import org.nl.acs.device.service.DeviceService;
|
||||
import org.nl.acs.device.service.impl.DeviceServiceImpl;
|
||||
import org.nl.acs.device_driver.DeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.cargo_lift_conveyor.CargoLiftConveyorDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.hongxiang_device.HongXiangConveyorDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.siemens_conveyor.SiemensConveyorDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.standard_conveyor_control_with_scanner.StandardCoveyorControlWithScannerDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.standard_inspect_site.StandardInspectSiteDeviceDriver;
|
||||
import org.nl.acs.device_driver.basedriver.standard_storage.StandardStorageDeviceDriver;
|
||||
import org.nl.acs.ext.wms.liKuData.*;
|
||||
import org.nl.acs.ext.wms.service.AcsToLiKuService;
|
||||
import org.nl.acs.ext.wms.service.AcsToWmsService;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.instruction.service.dto.Instruction;
|
||||
import org.nl.acs.opc.Device;
|
||||
@@ -84,7 +82,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
@Override
|
||||
public synchronized void reload() {
|
||||
Class var1 = TaskInstructionLock.class;
|
||||
synchronized (TaskInstructionLock.class) {
|
||||
this.instructions = this.queryAll("instruction_status <2 and is_delete =0");
|
||||
}
|
||||
@@ -92,10 +89,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
|
||||
/*WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||
ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "instruction_status < 2 and is_delete =0 ", "update_time desc");
|
||||
*/
|
||||
// this.reload();
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "1");
|
||||
String code = (String) whereJson.get("code");
|
||||
@@ -214,7 +207,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
@Override
|
||||
public List queryAll(String whereJson) {
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||
JSONArray arr = wo.query(whereJson).getResultJSONArray(0);
|
||||
JSONArray arr = wo.query(whereJson, "create_time").getResultJSONArray(0);
|
||||
List<Instruction> list = arr.toJavaList(Instruction.class);
|
||||
return list;
|
||||
}
|
||||
@@ -251,7 +244,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
@Override
|
||||
public Instruction findByTaskcodeAndStatus(String code) {
|
||||
synchronized (InstructionServiceImpl.class){
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
Iterator var3 = instructions.iterator();
|
||||
while (var3.hasNext()) {
|
||||
Instruction instruction = (Instruction) var3.next();
|
||||
@@ -262,7 +255,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -280,13 +272,10 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
@Override
|
||||
public void create(Instruction dto) {
|
||||
Class var2 = TaskInstructionLock.class;
|
||||
synchronized (TaskInstructionLock.class) {
|
||||
dto = foramte(dto);
|
||||
String task_code = dto.getTask_code();
|
||||
TaskDto task = taskService.findByCodeFromCache(task_code);
|
||||
|
||||
WQLObject instwo = WQLObject.getWQLObject("acs_instruction");
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String now = DateUtil.now();
|
||||
if (StrUtil.isEmpty(dto.getRoute_plan_code())) {
|
||||
@@ -345,14 +334,12 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||
Device startdevice = appService.findDeviceByCode(dto.getStart_device_code());
|
||||
Device nextdevice = appService.findDeviceByCode(dto.getNext_device_code());
|
||||
|
||||
HongXiangConveyorDeviceDriver hongXiangConveyorDeviceDriver;
|
||||
StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver;
|
||||
|
||||
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||
hongXiangConveyorDeviceDriver =
|
||||
(HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
|
||||
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
|
||||
hongXiangConveyorDeviceDriver.writing(3, Integer.valueOf(dto.getInstruction_code()));
|
||||
}
|
||||
|
||||
@@ -361,8 +348,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
String next_device_code = dto.getNext_device_code();
|
||||
String route_plan_code = task.getRoute_plan_code();
|
||||
List<RouteLineDto> shortPathsList =
|
||||
routeLineService.getShortPathLines(
|
||||
start_device_code, next_device_code, route_plan_code);
|
||||
routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
|
||||
RouteLineDto route = null;
|
||||
for (int i = 0; i < shortPathsList.size(); i++) {
|
||||
RouteLineDto routeLineDto = shortPathsList.get(i);
|
||||
@@ -405,12 +391,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
wo.insert(json);
|
||||
instructions.add(dto);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void create2(Instruction dto) throws Exception {
|
||||
Class var2 = TaskInstructionLock.class;
|
||||
synchronized (TaskInstructionLock.class) {
|
||||
dto = foramte(dto);
|
||||
String task_code = dto.getTask_code();
|
||||
TaskDto task = taskService.findByCodeFromCache(task_code);
|
||||
@@ -472,8 +455,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
StandardCoveyorControlWithScannerDeviceDriver standardCoveyorControlWithScannerDeviceDriver;
|
||||
|
||||
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
|
||||
hongXiangConveyorDeviceDriver =
|
||||
(HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
|
||||
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
|
||||
hongXiangConveyorDeviceDriver.writing(3, Integer.valueOf(dto.getInstruction_code()));
|
||||
}
|
||||
|
||||
@@ -482,8 +464,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
String next_device_code = dto.getNext_device_code();
|
||||
String route_plan_code = task.getRoute_plan_code();
|
||||
List<RouteLineDto> shortPathsList =
|
||||
routeLineService.getShortPathLines(
|
||||
start_device_code, next_device_code, route_plan_code);
|
||||
routeLineService.getShortPathLines(start_device_code, next_device_code, route_plan_code);
|
||||
RouteLineDto route = null;
|
||||
for (int i = 0; i < shortPathsList.size(); i++) {
|
||||
RouteLineDto routeLineDto = shortPathsList.get(i);
|
||||
@@ -519,12 +500,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
wo.insert(json);
|
||||
instructions.add(dto);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createAgain(Instruction dto) throws Exception {
|
||||
Class var2 = TaskInstructionLock.class;
|
||||
synchronized (TaskInstructionLock.class) {
|
||||
String task_code = dto.getTask_code();
|
||||
TaskDto task = taskService.findByCodeFromCache(task_code);
|
||||
WQLObject instwo = WQLObject.getWQLObject("acs_instruction");
|
||||
@@ -608,12 +586,10 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
// }
|
||||
instructions.add(dto);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(Instruction dto) {
|
||||
synchronized (TaskInstructionLock.class) {
|
||||
String currentUsername = SecurityUtils.getCurrentUsername();
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
@@ -625,7 +601,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
this.reload();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -762,8 +737,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void finish(Instruction dto) {
|
||||
Class var2 = TaskInstructionLock.class;
|
||||
synchronized (TaskInstructionLock.class) {
|
||||
String now = DateUtil.now();
|
||||
dto.setInstruction_status("2");
|
||||
WQLObject wo = WQLObject.getWQLObject("acs_instruction");
|
||||
@@ -817,7 +790,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
removeByCodeFromCache(dto.getInstruction_code());
|
||||
// this.reload();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -901,8 +873,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
@Override
|
||||
public void cancel(String id) throws Exception {
|
||||
Class var2 = TaskInstructionLock.class;
|
||||
synchronized (TaskInstructionLock.class) {
|
||||
// flag= true时取消指令
|
||||
boolean flag = false;
|
||||
Instruction entity = this.findById(id);
|
||||
@@ -930,8 +900,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
} else if (StrUtil.equals(paramService.findByCode(AcsConfig.AGVTYPE).getValue(), "3")
|
||||
&& !StrUtil.equals(entity.getSend_status(), "2")) {
|
||||
XianGongAgvService xianGongAgvService =
|
||||
SpringContextHolder.getBean(XianGongAgvService.class);
|
||||
XianGongAgvService xianGongAgvService = SpringContextHolder.getBean(XianGongAgvService.class);
|
||||
xianGongAgvService.deleteXZAgvInst(entity.getInstruction_code());
|
||||
flag = true;
|
||||
} else {
|
||||
@@ -1008,12 +977,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
this.reload();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void forceCancel(String id) throws Exception {
|
||||
Class var2 = TaskInstructionLock.class;
|
||||
synchronized (TaskInstructionLock.class) {
|
||||
// flag= true时取消指令
|
||||
boolean flag = false;
|
||||
Instruction entity = this.findById(id);
|
||||
@@ -1066,12 +1032,9 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
removeByCodeFromCache(entity.getInstruction_code());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelNOSendAgv(String id) throws Exception {
|
||||
Class var2 = TaskInstructionLock.class;
|
||||
synchronized (TaskInstructionLock.class) {
|
||||
// flag= true时取消指令
|
||||
Instruction entity = this.findById(id);
|
||||
if (entity == null) {
|
||||
@@ -1126,7 +1089,6 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
removeByCodeFromCache(entity.getInstruction_code());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Instruction findByLinkNumSend(String code) {
|
||||
@@ -1145,7 +1107,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
@Override
|
||||
public List<Instruction> findByLinkNum(String code) {
|
||||
synchronized (InstructionServiceImpl.class){
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
List<Instruction> list = new ArrayList<>();
|
||||
Iterator<Instruction> it = instructions.iterator();
|
||||
while (it.hasNext()) {
|
||||
@@ -1156,13 +1118,11 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Instruction findByLinkNumNoSend(String code) {
|
||||
synchronized (InstructionServiceImpl.class){
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
Iterator<Instruction> it = instructions.iterator();
|
||||
while (it.hasNext()) {
|
||||
Instruction inst = it.next();
|
||||
@@ -1173,12 +1133,11 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Instruction findByCodeFromCache(String code) {
|
||||
synchronized (InstructionServiceImpl.class){
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
Iterator<Instruction> it = instructions.iterator();
|
||||
while (it.hasNext()) {
|
||||
Instruction inst = it.next();
|
||||
@@ -1188,13 +1147,11 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Instruction findByBarcodeFromCache(String barcode) {
|
||||
synchronized (InstructionServiceImpl.class){
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
Iterator<Instruction> it = instructions.iterator();
|
||||
while (it.hasNext()) {
|
||||
Instruction inst = it.next();
|
||||
@@ -1208,7 +1165,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
@Override
|
||||
public Instruction findByIdFromCache(String id) {
|
||||
synchronized (InstructionServiceImpl.class){
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
Iterator<Instruction> it = instructions.iterator();
|
||||
while (it.hasNext()) {
|
||||
Instruction inst = it.next();
|
||||
@@ -1344,7 +1301,7 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
|
||||
@Override
|
||||
public Integer querySameInstType(String inst_type) {
|
||||
synchronized (InstructionServiceImpl.class){
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
int num = 0;
|
||||
Iterator<Instruction> it = instructions.iterator();
|
||||
while (it.hasNext()) {
|
||||
@@ -1355,12 +1312,11 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer querySameOriginInst(String devicecode) {
|
||||
synchronized (InstructionServiceImpl.class){
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
int num = 0;
|
||||
Iterator<Instruction> it = instructions.iterator();
|
||||
while (it.hasNext()) {
|
||||
@@ -1376,13 +1332,11 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeByCodeFromCache(String code) {
|
||||
synchronized (InstructionServiceImpl.class){
|
||||
synchronized (InstructionServiceImpl.class) {
|
||||
Iterator<Instruction> iterator = instructions.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Instruction instruction = iterator.next();
|
||||
@@ -1392,10 +1346,8 @@ synchronized (InstructionServiceImpl.class){
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean createLkInst(String type, Instruction dto) {
|
||||
|
||||
@@ -202,8 +202,10 @@ public class DeviceOpcProtocolRunable implements Runnable {
|
||||
}
|
||||
}
|
||||
} catch (Exception var30) {
|
||||
|
||||
if (group != null) {
|
||||
try {
|
||||
group.getServer().dispose();
|
||||
group.clear();
|
||||
group.remove();
|
||||
} catch (Exception var6) {
|
||||
|
||||
@@ -138,7 +138,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAllByCache(Map whereJson, Pageable page) {
|
||||
synchronized (TaskServiceImpl.class){
|
||||
|
||||
|
||||
|
||||
this.reload();
|
||||
@@ -151,6 +151,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
String task_type = (String) whereJson.get("task_type");
|
||||
List<TaskDto> taskList = new ArrayList();
|
||||
|
||||
synchronized (TaskServiceImpl.class){
|
||||
Iterator<TaskDto> it = tasks.iterator();
|
||||
while (it.hasNext()) {
|
||||
TaskDto task = it.next();
|
||||
@@ -193,6 +194,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
DateUtil.parse(task2.getCreate_time())))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
}
|
||||
|
||||
Integer currentPageNumber = page.getPageNumber() + 1;
|
||||
Integer pageMaxSize = page.getPageSize();
|
||||
List<TaskDto> taskDtoList =
|
||||
@@ -204,7 +207,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
jo.put("content", taskDtoList);
|
||||
jo.put("totalElements", taskList.size());
|
||||
return jo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -653,7 +656,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TaskDto dto) {
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
|
||||
TaskDto entity = this.findById(dto.getTask_id());
|
||||
if (entity == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
@@ -669,6 +672,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
|
||||
wo.update(json);
|
||||
|
||||
synchronized (TaskServiceImpl.class) {
|
||||
Iterator<TaskDto> iterator = tasks.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
TaskDto task = iterator.next();
|
||||
@@ -679,6 +683,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
if (StrUtil.equals(dto.getTask_status(), "0") || StrUtil.equals(dto.getTask_status(), "1")) {
|
||||
tasks.add(dto);
|
||||
}
|
||||
}
|
||||
// 判断是否为WMS下发的任务,如果是反馈任务状态给WMS
|
||||
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
||||
if (!StrUtil.startWith(dto.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
|
||||
@@ -767,7 +772,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -916,7 +921,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
JSONObject json = (JSONObject) JSONObject.toJSON(entity);
|
||||
wo.update(json);
|
||||
|
||||
try {
|
||||
synchronized (TaskServiceImpl.class){
|
||||
Iterator<TaskDto> it = tasks.iterator();
|
||||
// 清理缓存
|
||||
while (it.hasNext()) {
|
||||
@@ -924,10 +929,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
if (taskDto.getTask_id().equals(id)) {
|
||||
tasks.remove(taskDto);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}}
|
||||
|
||||
// 判断是否为WMS下发的任务,如果是反馈任务状态给WMS
|
||||
String hasWms = paramService.findByCode(AcsConfig.HASWMS).getValue();
|
||||
if (!StrUtil.startWith(entity.getTask_code(), "-") && StrUtil.equals(hasWms, "1")) {
|
||||
@@ -1089,7 +1092,6 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial {
|
||||
if (acsTask == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
ParamService paramService = SpringContextHolder.getBean(ParamService.class);
|
||||
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
|
||||
InstructionService instructionservice = SpringContextHolder.getBean("instructionServiceImpl");
|
||||
InstructionDto inst = instructionservice.findByTaskid(ids, "instruction_status < 2 ");
|
||||
|
||||
@@ -157,8 +157,8 @@
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column prop="compound_inst_data" width="200" label="复合路线" />-->
|
||||
<el-table-column prop="matarial" label="物料" />
|
||||
<el-table-column prop="quantity" label="数量" />
|
||||
<!-- <el-table-column prop="matarial" label="物料" />-->
|
||||
<!-- <el-table-column prop="quantity" label="数量" />-->
|
||||
<el-table-column prop="remark" label="描述" />
|
||||
<el-table-column prop="create_by" label="创建者" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="135" />
|
||||
|
||||
@@ -353,8 +353,8 @@
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column prop="compound_task_data" width="200" label="复合路线" />-->
|
||||
<el-table-column prop="matarial" label="物料" />
|
||||
<el-table-column prop="quantity" label="数量" />
|
||||
<!-- <el-table-column prop="matarial" label="物料" />-->
|
||||
<!-- <el-table-column prop="quantity" label="数量" />-->
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
<el-table-column prop="create_by" label="创建者" />
|
||||
<el-table-column prop="create_time" label="创建时间" width="135" />
|
||||
|
||||
@@ -849,20 +849,28 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
// 双通
|
||||
// 先倒序找到第一个木箱、判断上一个是否有货位
|
||||
JSONObject jsonDescBox = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq DESC").uniqueResult(0);
|
||||
|
||||
JSONObject jsonDescStruct = new JSONObject();
|
||||
if (ObjectUtil.isNotEmpty(jsonDescBox)) {
|
||||
String out_order_seq = jsonDescBox.getString("out_order_seq");
|
||||
// 上一个货位顺序号
|
||||
String out_order_seq_desc = String.valueOf(NumberUtil.add(out_order_seq, "1"));
|
||||
JSONObject jsonDescStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq = '" + out_order_seq_desc + "'").uniqueResult(0);
|
||||
jsonDescStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq = '" + out_order_seq_desc + "'").uniqueResult(0);
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonDescStruct)) {
|
||||
struct_jo = jsonDescStruct;
|
||||
} else {
|
||||
// 没有就正序找到第一个物料、判断上一个是否有货位
|
||||
JSONObject jsonAscBox = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') <> '' order by out_order_seq ASC").uniqueResult(0);
|
||||
|
||||
JSONObject jsonAscStruct = new JSONObject();
|
||||
if (ObjectUtil.isNotEmpty(jsonAscBox)) {
|
||||
String out_order_seq2 = jsonAscBox.getString("out_order_seq");
|
||||
// 上一个货位顺序号
|
||||
String out_order_seq_asc = String.valueOf(NumberUtil.sub(out_order_seq2, "1"));
|
||||
JSONObject jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq = '"+out_order_seq_asc+"'").uniqueResult(0);
|
||||
jsonAscStruct = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num + "'AND placement_type = '" + placement_type + "' AND row_num = '" + row_num + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' and out_order_seq = '"+out_order_seq_asc+"'").uniqueResult(0);
|
||||
}
|
||||
|
||||
if (ObjectUtil.isNotEmpty(jsonAscStruct)) {
|
||||
struct_jo = jsonAscStruct;
|
||||
@@ -980,6 +988,67 @@ public class RawAssistIStorServiceImpl implements RawAssistIStorService {
|
||||
return struct_jo;
|
||||
}
|
||||
|
||||
public JSONObject queryEmpStruct(JSONObject whereJson) {
|
||||
JSONObject struct_jo = new JSONObject();
|
||||
String sect_id = whereJson.getString("sect_id");
|
||||
String placement_type = whereJson.getString("placement_type");
|
||||
String material_code = whereJson.getString("material_code");
|
||||
String sale_order_name = whereJson.getString("sale_order_name");
|
||||
|
||||
//根据分切计划查询该订单物料大概还有多少未入
|
||||
JSONObject row_map = new JSONObject();
|
||||
row_map.put("material_code", material_code);
|
||||
row_map.put("sale_order_name", sale_order_name);
|
||||
row_map.put("sect_id", sect_id);
|
||||
row_map.put("flag", "12");
|
||||
JSONArray plan_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(row_map).process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(plan_rows)) {
|
||||
plan_rows = new JSONArray();
|
||||
}
|
||||
//查询该销售订单及行号有多少个生成状态的箱子
|
||||
row_map.put("flag", "27");
|
||||
JSONArray box_rows = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(row_map).process().getResultJSONArray(0);
|
||||
if (ObjectUtil.isEmpty(box_rows)) {
|
||||
box_rows = new JSONArray();
|
||||
}
|
||||
int box_num = (int) Math.ceil(plan_rows.size() / 2) + box_rows.size();
|
||||
|
||||
//查询数量与订单物料箱子数量相近的一排
|
||||
JSONObject empty_row = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("sect_id", sect_id).addParam("flag", "13").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num),block_num,row_num").process().uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(empty_row)) {
|
||||
String block_num2 = empty_row.getString("block_num");
|
||||
String row_num2 = empty_row.getString("row_num");
|
||||
String placement_type2 = empty_row.getString("placement_type");
|
||||
|
||||
if (placement_type.equals("02")) {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num2 + "' AND row_num = '" + row_num2 + "' AND placement_type = '" + placement_type2 + "' AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq ASC").uniqueResult(0);
|
||||
} else {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num2 + "' AND row_num = '" + row_num2 + "' AND placement_type = '" + placement_type2 + "'AND is_delete = '0' AND is_used = '1' AND lock_type = '1' order by out_order_seq DESC").uniqueResult(0);
|
||||
}
|
||||
} else {
|
||||
|
||||
//如果查询不到空的一排,则查询有空位双通的一排
|
||||
JSONObject have_row = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParam("sect_id", sect_id).addParam("flag", "14").addParam("sql_str", " ORDER BY abs(" + box_num + "-a.struct_num)").process().uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isNotEmpty(have_row)) {
|
||||
String block_num3 = have_row.getString("block_num");
|
||||
String row_num3 = have_row.getString("row_num");
|
||||
|
||||
//判断该排是左边为空,还是右边为空
|
||||
JSONObject right_str = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' order by out_order_seq").uniqueResult(0);
|
||||
JSONObject left_str = WQLObject.getWQLObject("st_ivt_structattr").query("block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' order by out_order_seq desc").uniqueResult(0);
|
||||
if (StrUtil.isNotEmpty(right_str.getString("storagevehicle_code")) || !right_str.getString("lock_type").equals("1")) {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq").uniqueResult(0);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(left_str.getString("storagevehicle_code")) || !left_str.getString("lock_type").equals("1")) {
|
||||
struct_jo = WQLObject.getWQLObject("st_ivt_structattr").query("lock_type = '1' AND block_num = '" + block_num3 + "' AND row_num = '" + row_num3 + "' AND is_delete = '0' AND is_used = '1' AND IFNULL(storagevehicle_code,'') = '' order by out_order_seq desc").uniqueResult(0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return struct_jo;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updateTask(Map whereJson) {
|
||||
|
||||
Reference in New Issue
Block a user