From 05f33095546632ea39b65179cb85afc36b1b7122 Mon Sep 17 00:00:00 2001 From: tuqiang <437016993@qq.com> Date: Wed, 15 Jan 2025 13:14:03 +0800 Subject: [PATCH] =?UTF-8?q?rev:=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../run/TwoNDCSocketConnectionAutoRun.java | 4 +- .../acs/ext/wms/rest/SpxToAcsController.java | 4 +- .../wms/service/impl/SpxToAcsServiceImpl.java | 12 +++--- .../org/nl/acs/order/mapper/OrderMapper.xml | 3 +- .../sch/task/controller/WorkController.java | 8 ++++ .../nl/acs/sch/task/service/WorkService.java | 2 + .../task/service/dao/mapper/WorkMapper.xml | 2 +- .../task/service/impl/WorkServiceImpl.java | 16 ++++++++ .../sch/task_manage/task/core/TaskStatus.java | 4 +- .../java/org/nl/acs/task/domain/Task.java | 5 +++ .../org/nl/acs/task/service/TaskService.java | 2 + .../org/nl/acs/task/service/dto/TaskDto.java | 5 +++ .../task/service/impl/TaskServiceImpl.java | 11 +++++ .../nl/hand/controller/HandController.java | 2 +- .../org/nl/hand/controller/PdaController.java | 15 +++++-- .../java/org/nl/hand/service/PdaService.java | 7 +++- .../nl/hand/service/dao/mapper/PdaMapper.java | 5 ++- .../nl/hand/service/dao/mapper/PdaMapper.xml | 35 +++++++++++++++- .../nl/hand/service/impl/HandServiceImpl.java | 2 +- .../nl/hand/service/impl/PdaServiceImpl.java | 41 ++++++++++++++----- .../java/org/nl/hand/service/vo/OrderVo.java | 3 +- .../java/org/nl/hand/service/vo/WorkVo.java | 1 + .../main/resources/config/application-dev.yml | 2 +- .../src/views/acs/order/AddDialog.vue | 4 +- acs/nladmin-ui/src/views/acs/order/index.vue | 2 - acs/nladmin-ui/src/views/acs/work/index.vue | 20 ++++++++- acs/nladmin-ui/src/views/acs/work/work.js | 10 ++++- 27 files changed, 186 insertions(+), 41 deletions(-) diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java index a94f235..0d626ef 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/auto/run/TwoNDCSocketConnectionAutoRun.java @@ -251,7 +251,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { if (ObjectUtil.isNotEmpty(device)) { if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); - String link_three_lamp = device.getExtraValue().get("link_three_lamp").toString(); + String link_three_lamp = (String) device.getExtraValue().get("link_three_lamp"); if (StrUtil.isNotEmpty(link_three_lamp)) { Device code = deviceAppService.findDeviceByCode(link_three_lamp); if (code.getDeviceDriver() instanceof LampThreecolorDeviceDriver) { @@ -300,7 +300,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable { if (ObjectUtil.isNotEmpty(device)) { if (device.getDeviceDriver() instanceof StandardAutodoorDeviceDriver) { standardAutodoorDeviceDriver = (StandardAutodoorDeviceDriver) device.getDeviceDriver(); - String link_three_lamp = device.getExtraValue().get("link_three_lamp").toString(); + String link_three_lamp = (String) device.getExtraValue().get("link_three_lamp"); if (StrUtil.isNotEmpty(link_three_lamp)) { Device code = deviceAppService.findDeviceByCode(link_three_lamp); if (code.getDeviceDriver() instanceof LampThreecolorDeviceDriver) { diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/SpxToAcsController.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/SpxToAcsController.java index 02c63eb..f03f887 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/SpxToAcsController.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/rest/SpxToAcsController.java @@ -21,10 +21,10 @@ public class SpxToAcsController { @Autowired private SpxToAcsService spxToAcsService; - @PostMapping("/task") + @PostMapping("/order") @Log(value = "ACS接收SPX任务") @SaIgnore - public ResponseEntity createFromWms(@RequestBody String whereJson) { + public ResponseEntity createFromSPX(@RequestBody String whereJson) { return new ResponseEntity<>(spxToAcsService.crateTask(whereJson), HttpStatus.OK); } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/SpxToAcsServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/SpxToAcsServiceImpl.java index 4863d42..9a7f09a 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/SpxToAcsServiceImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/ext/wms/service/impl/SpxToAcsServiceImpl.java @@ -60,8 +60,8 @@ public class SpxToAcsServiceImpl implements SpxToAcsService { // 记录异常日志 log.error("创建工单时发生异常: ", e); JSONObject resultJson = new JSONObject(); - resultJson.put("status", HttpStatus.BAD_REQUEST.value()); - resultJson.put("message", "操作失败"); + resultJson.put("MSG_CODE", HttpStatus.BAD_REQUEST.value()); + resultJson.put("MSG", "操作失败"); return resultJson; } } @@ -133,11 +133,11 @@ public class SpxToAcsServiceImpl implements SpxToAcsService { private JSONObject buildResultJson(JSONArray errArr) { JSONObject resultJson = new JSONObject(); if (ObjectUtil.isEmpty(errArr)) { - resultJson.put("status", HttpStatus.OK.value()); - resultJson.put("message", "操作成功"); + resultJson.put("MSG_CODE", HttpStatus.OK.value()); + resultJson.put("MSG", "操作成功"); } else { - resultJson.put("status", HttpStatus.BAD_REQUEST.value()); - resultJson.put("message", "操作失败"); + resultJson.put("MSG_CODE", HttpStatus.BAD_REQUEST.value()); + resultJson.put("MSG", "操作失败"); if (ObjectUtil.isNotEmpty(errArr)) { resultJson.put("errArr", errArr); } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/order/mapper/OrderMapper.xml b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/order/mapper/OrderMapper.xml index e9bc9e4..512ddcc 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/order/mapper/OrderMapper.xml +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/order/mapper/OrderMapper.xml @@ -37,7 +37,8 @@ and create_time = #{query.begin_time} and is_delete = '0' + and status in ('0','1') - order by create_time DESC + order by realstart_time ASC diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task/controller/WorkController.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task/controller/WorkController.java index 4db875c..9563c36 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task/controller/WorkController.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task/controller/WorkController.java @@ -1,5 +1,6 @@ package org.nl.acs.sch.task.controller; +import com.alibaba.fastjson.JSONObject; import lombok.extern.slf4j.Slf4j; import org.nl.acs.sch.task.service.WorkService; import org.nl.acs.sch.task.service.dao.SchBaseTask; @@ -83,4 +84,11 @@ public class WorkController { workService.confirm(id); return new ResponseEntity<>(HttpStatus.OK); } + + @Log("暂停配料作业") + @PostMapping(value = "/pause/{id}") + public ResponseEntity pause(@RequestBody String id) { + workService.pause(id); + return new ResponseEntity<>(HttpStatus.OK); + } } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task/service/WorkService.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task/service/WorkService.java index 602debe..71e0941 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task/service/WorkService.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task/service/WorkService.java @@ -49,4 +49,6 @@ public interface WorkService extends IService { void confirm(String id); Work findByCode(String work_code); + + void pause(String id); } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task/service/dao/mapper/WorkMapper.xml b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task/service/dao/mapper/WorkMapper.xml index 733f57d..d7eb4c1 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task/service/dao/mapper/WorkMapper.xml +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task/service/dao/mapper/WorkMapper.xml @@ -28,6 +28,6 @@ AND wo.status != '2' - ORDER BY work.seq_no asc + ORDER BY work.mfg_order_name asc ,work.seq_no asc diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task/service/impl/WorkServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task/service/impl/WorkServiceImpl.java index c06a5d7..ca4dc85 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task/service/impl/WorkServiceImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task/service/impl/WorkServiceImpl.java @@ -1,5 +1,6 @@ package org.nl.acs.sch.task.service.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; @@ -162,6 +163,7 @@ public class WorkServiceImpl extends ServiceImpl implements Wo taskDto.setNext_device_code(resource_name); taskDto.setTask_type(CommonFinalParam.TYPE_THREE); taskDto.setAgv_system_type(CommonFinalParam.TWO); + taskDto.setWork_id(id); AcsPoint point = acsPointService.findByCode("T1"); if (ObjectUtil.isEmpty(point)) { throw new BadRequestException("不存在T1点位"); @@ -196,4 +198,18 @@ public class WorkServiceImpl extends ServiceImpl implements Wo .eq(Work::getWork_code, work_code); return workMapper.selectOne(wrapper); } + + @Override + public void pause(String id) { + Work work = workMapper.selectById(id); + if (ObjectUtil.isEmpty(work)) { + throw new BadRequestException("不存在该配料任务"); + } + List list = taskService.findByWorkId(id); + if (CollUtil.isNotEmpty(list)){ + throw new BadRequestException("存在正在执行中的agv任务"); + } + work.setStatus(TaskStatus.PAUSE.getCode()); + workMapper.updateById(work); + } } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task_manage/task/core/TaskStatus.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task_manage/task/core/TaskStatus.java index bec495a..21fdd2b 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task_manage/task/core/TaskStatus.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/sch/task_manage/task/core/TaskStatus.java @@ -28,7 +28,9 @@ public enum TaskStatus { /** * 未完成 */ - UNFINISHED("7", "未完成", "未完成"); + UNFINISHED("7", "未完成", "未完成"), + + PAUSE("4", "暂停", "暂停"); TaskStatus(String code, String name, String desc) { diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/domain/Task.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/domain/Task.java index c1e76c9..93eb3d9 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/domain/Task.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/domain/Task.java @@ -41,6 +41,11 @@ public class Task extends CommonModel implements Serializable { private String ext_task_id; + /** + * 配料作业任务标识 + */ + private String work_id; + @NotBlank private String task_code; diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/TaskService.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/TaskService.java index 3964823..710ce7e 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/TaskService.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/TaskService.java @@ -567,4 +567,6 @@ public interface TaskService extends CommonService { TaskDto findByTaskCode(String task_code); List queryAllHJReadyTask(); + + List findByWorkId(String id); } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/dto/TaskDto.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/dto/TaskDto.java index 8a77885..4998647 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/dto/TaskDto.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/dto/TaskDto.java @@ -24,6 +24,11 @@ public class TaskDto implements Serializable { */ private String ext_task_id; + /** + * 配料作业任务标识 + */ + private String work_id; + /** * 任务号 */ diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index 74730f0..55f95e0 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -1604,6 +1604,17 @@ public class TaskServiceImpl extends CommonServiceImpl impleme .collect(Collectors.toList()); } + @Override + public List findByWorkId(String id) { + return Optional + .ofNullable(this.tasks) + .orElse(new CopyOnWriteArrayList<>()) + .stream() + .filter(taskDto -> StrUtil.equals(taskDto.getWork_id(), id) + && StrUtil.equals(taskDto.getTask_status(), TaskStatusEnum.BUSY.getIndex())) + .collect(Collectors.toList()); + } + /** * 把多个字符串拼接的inst_nextDevice_code解析成集合 diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/controller/HandController.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/controller/HandController.java index fd307b9..894ac0c 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/controller/HandController.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/controller/HandController.java @@ -28,7 +28,7 @@ public class HandController { @Autowired private HandService handService; - @PostMapping + @PostMapping("/queryWorks") @Log("配料作业查询") public ResponseEntity query() { return new ResponseEntity<>(handService.query(), HttpStatus.OK); diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/controller/PdaController.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/controller/PdaController.java index 11704b8..2eff228 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/controller/PdaController.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/controller/PdaController.java @@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.RestController; */ @Slf4j @RestController - @RequestMapping("/api/pda") @SaIgnore public class PdaController { @@ -35,13 +34,15 @@ public class PdaController { return new ResponseEntity<>(pdaService.queryOrders(), HttpStatus.OK); } + + @PostMapping("/queryWorks") @Log("配料作业查询") - public ResponseEntity queryWorks() { - return new ResponseEntity<>(pdaService.queryWorks(), HttpStatus.OK); + public ResponseEntity queryWorks(@RequestBody JSONObject whereJson) { + return new ResponseEntity<>(pdaService.queryWorks(whereJson), HttpStatus.OK); } - @PostMapping("/queryAllPoints") + @PostMapping("/queryDevices") @Log("查询所有点位") @ApiOperation("查询所有点位") @SaIgnore @@ -82,6 +83,12 @@ public class PdaController { return new ResponseEntity<>(pdaService.finishWork(whereJson),HttpStatus.OK); } + @Log("暂停配料作业") + @PostMapping(value = "/pause") + public ResponseEntity pause(@RequestBody JSONObject whereJson) { + return new ResponseEntity<>(pdaService.pause(whereJson),HttpStatus.OK); + } + @PostMapping("/callTask") @Log("生成退桶任务") @ApiOperation("生成退桶任务") diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/PdaService.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/PdaService.java index 15da096..30ffb61 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/PdaService.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/PdaService.java @@ -23,7 +23,9 @@ public interface PdaService { PdaResponseVo forceFinish(JSONObject whereJson); - List queryWorks(); + List queryWorks(JSONObject whereJson); + + List getExcWorks(); PdaResponseVo sendWork(JSONObject whereJson); @@ -34,4 +36,7 @@ public interface PdaService { JSONArray queryAllPoints(); Map callTask(PdaDto dto); + + PdaResponseVo pause(JSONObject whereJson); + } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/dao/mapper/PdaMapper.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/dao/mapper/PdaMapper.java index 2f2cfc1..fcffccb 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/dao/mapper/PdaMapper.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/dao/mapper/PdaMapper.java @@ -1,5 +1,6 @@ package org.nl.hand.service.dao.mapper; +import org.apache.ibatis.annotations.Param; import org.nl.hand.service.vo.OrderVo; import org.nl.hand.service.vo.WorkVo; @@ -9,5 +10,7 @@ public interface PdaMapper { List getOrders(); - List getWorks(); + List getWorks(@Param("mfg_order_name") String mfg_order_name); + + List getExcWorks(); } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/dao/mapper/PdaMapper.xml b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/dao/mapper/PdaMapper.xml index 0e0b42e..7768072 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/dao/mapper/PdaMapper.xml +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/dao/mapper/PdaMapper.xml @@ -6,30 +6,61 @@ product_name, description, resource_name, + point_code, total_qty, Case status WHEN '0' THEN '就绪' WHEN '1' THEN '执行中' ELSE '' END AS status, - create_name + realstart_time, + create_time FROM acs_workorder WHERE status != '2' + order by realstart_time ASC + diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java index b82e0f2..caaf785 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/HandServiceImpl.java @@ -24,7 +24,7 @@ public class HandServiceImpl implements HandService { @Override public List query() { - return pdaService.queryWorks(); + return pdaService.getExcWorks(); } @Override diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/PdaServiceImpl.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/PdaServiceImpl.java index 95d5af6..2ea79ed 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/PdaServiceImpl.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/impl/PdaServiceImpl.java @@ -82,8 +82,16 @@ public class PdaServiceImpl implements PdaService { } @Override - public List queryWorks() { - return pdaMapper.getWorks(); + public List queryWorks(JSONObject whereJson) { + if (StrUtil.isEmpty(whereJson.getString("mfg_order_name"))){ + throw new BadRequestException("工单号为空!"); + } + return pdaMapper.getWorks(whereJson.getString("mfg_order_name")); + } + + @Override + public List getExcWorks() { + return pdaMapper.getExcWorks(); } @Override @@ -100,12 +108,19 @@ public class PdaServiceImpl implements PdaService { @Override public PdaResponseVo reSendWork(JSONObject whereJson) { String work_code = whereJson.getString("work_code"); + String require_num = whereJson.getString("require_num"); + if (StrUtil.isEmpty(require_num)){ + return PdaResponseVo.pdaResultOk("补发数量为空"); + } + if (StrUtil.isEmpty(work_code)){ + return PdaResponseVo.pdaResultOk("补发作业号为空"); + } Work work = workService.findByCode(work_code); if (work == null) { return PdaResponseVo.pdaResultOk("配料作业不存在"); } - work.setRemain_num(work.getRemain_num() + whereJson.getIntValue("count")); - work.setRequire_num(work.getRequire_num() + whereJson.getIntValue("count")); + work.setRemain_num(work.getRemain_num() + whereJson.getIntValue("require_num")); + work.setRequire_num(work.getRequire_num() + whereJson.getIntValue("require_num")); workService.updateById(work); return PdaResponseVo.pdaResultOk("补发成功"); } @@ -147,7 +162,6 @@ public class PdaServiceImpl implements PdaService { JSONArray errArr = new JSONArray(); String start_device_code = dto.getStart_device_code(); String next_device_code = dto.getNext_device_code(); - String task_type = dto.getTask_type(); if (StrUtil.isEmpty(start_device_code)) { throw new BadRequestException("起点不能为空"); @@ -155,22 +169,18 @@ public class PdaServiceImpl implements PdaService { if (StrUtil.isEmpty(next_device_code)) { throw new BadRequestException("终点不能为空"); } - if (StrUtil.isEmpty(task_type)) { - throw new BadRequestException("任务类型不能为空"); - } JSONObject jo = new JSONObject(); jo.put("start_device_code", start_device_code); jo.put("next_device_code", next_device_code); jo.put("start_point_code", start_device_code); jo.put("next_point_code", next_device_code); - jo.put("task_type", task_type); + jo.put("task_type", "1"); jo.put("priority", "1"); TaskDto task_dto = jo.toJavaObject(TaskDto.class); try { taskserver.create(task_dto); } catch (Exception e) { -// e.printStackTrace(); JSONObject json = new JSONObject(); json.put("message", e.getMessage()); errArr.add(json); @@ -187,4 +197,15 @@ public class PdaServiceImpl implements PdaService { } return resultJson; } + + @Override + public PdaResponseVo pause(JSONObject whereJson) { + String work_code = whereJson.getString("work_code"); + Work work = workService.findByCode(work_code); + if (work == null) { + return PdaResponseVo.pdaResultOk("配料作业不存在"); + } + workService.pause(work.getWork_id()); + return PdaResponseVo.pdaResultOk("暂停成功"); + } } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/vo/OrderVo.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/vo/OrderVo.java index 3034ff1..f27f003 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/vo/OrderVo.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/vo/OrderVo.java @@ -16,5 +16,6 @@ public class OrderVo { private String resource_name; private float total_qty; private String status; - private String create_name; + private String create_time; + private String realstart_time; } diff --git a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/vo/WorkVo.java b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/vo/WorkVo.java index d522450..a490704 100644 --- a/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/vo/WorkVo.java +++ b/acs/nladmin-system/nlsso-server/src/main/java/org/nl/hand/service/vo/WorkVo.java @@ -12,6 +12,7 @@ public class WorkVo { private int seq_no; private String work_code; private String mfg_order_name; + private String material_code; private String material_name; private float qty; private String resource_name; diff --git a/acs/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml b/acs/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml index 3bd0328..bbdebf7 100644 --- a/acs/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml +++ b/acs/nladmin-system/nlsso-server/src/main/resources/config/application-dev.yml @@ -10,7 +10,7 @@ spring: driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy # url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:stand_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true # url: jdbc:log4jdbc:mysql://${DB_HOST:47.111.78.178}:${DB_PORT:3306}/${DB_NAME:lzhl_two_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true - url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:niudixiya_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true + url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:niudixiya_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true username: ${DB_USER:root} # password: ${DB_PWD:Root.123456} diff --git a/acs/nladmin-ui/src/views/acs/order/AddDialog.vue b/acs/nladmin-ui/src/views/acs/order/AddDialog.vue index 89a412e..f5d101d 100644 --- a/acs/nladmin-ui/src/views/acs/order/AddDialog.vue +++ b/acs/nladmin-ui/src/views/acs/order/AddDialog.vue @@ -188,9 +188,9 @@ diff --git a/acs/nladmin-ui/src/views/acs/order/index.vue b/acs/nladmin-ui/src/views/acs/order/index.vue index fb4827f..9874b78 100644 --- a/acs/nladmin-ui/src/views/acs/order/index.vue +++ b/acs/nladmin-ui/src/views/acs/order/index.vue @@ -185,8 +185,6 @@ diff --git a/acs/nladmin-ui/src/views/acs/work/index.vue b/acs/nladmin-ui/src/views/acs/work/index.vue index df2a944..9e3ba68 100644 --- a/acs/nladmin-ui/src/views/acs/work/index.vue +++ b/acs/nladmin-ui/src/views/acs/work/index.vue @@ -98,7 +98,7 @@ - + @@ -258,6 +265,14 @@ export default { this.crud.toQuery() }) }, + pause(index, row) { + crudWork.pause(row.work_id).then(res => { + this.crud.toQuery() + this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS) + }).catch(err => { + console.log(err.response.data.message) + }) + }, confirm(index, row) { crudWork.confirm(row.work_id).then(res => { this.crud.toQuery() @@ -306,6 +321,9 @@ export default { case 'd':// 确认 this.confirm('4', row) break + case 'e':// 暂停 + this.pause('5', row) + break } }, showButton(point_status) { diff --git a/acs/nladmin-ui/src/views/acs/work/work.js b/acs/nladmin-ui/src/views/acs/work/work.js index 00f4073..ec70e14 100644 --- a/acs/nladmin-ui/src/views/acs/work/work.js +++ b/acs/nladmin-ui/src/views/acs/work/work.js @@ -80,4 +80,12 @@ export function confirm(work_id) { }) } -export default { add, edit, del, changeUsed, getWorkList, changeLock, reSend, send, finish, confirm } +export function pause(work_id) { + return request({ + url: 'api/work/pause/' + work_id, + method: 'post', + data: work_id + }) +} + +export default { add, edit, del, changeUsed, getWorkList, changeLock, reSend, send, finish, confirm, pause }