diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java index a641d68..36d2f56 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/AcsToWmsService.java @@ -28,4 +28,12 @@ public interface AcsToWmsService { */ ApplyTaskResponse applyPutEmptyVehicle(JSONObject param); + /** + * 任务反馈 + * + * @param param + * @return + */ + BaseResponse feedbackTaskStatus(JSONObject param); + } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index fe72eb0..af7af13 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -11,12 +11,17 @@ import org.nl.system.service.notice.ISysNoticeService; import org.nl.wms.ext.acs.service.AcsToWmsService; import org.nl.wms.ext.acs.service.dto.to.BaseResponse; import org.nl.wms.ext.acs.service.dto.to.acs.ApplyTaskResponse; +import org.nl.wms.ext.acs.service.dto.to.wms.FeedBackTaskStatusRequest; import org.nl.wms.ext.record.service.ISysInteractRecordService; import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.task.service.ISchBaseTaskService; +import org.nl.wms.sch.task.service.dao.SchBaseTask; +import org.nl.wms.sch.task_manage.AbstractTask; import org.nl.wms.sch.task_manage.GeneralDefinition; import org.nl.wms.sch.task_manage.enums.NoticeTypeEnum; +import org.nl.wms.sch.task_manage.task.TaskFactory; +import org.nl.wms.sch.task_manage.task.core.TaskStatus; import org.redisson.api.RLock; import org.redisson.api.RedissonClient; import org.springframework.beans.factory.annotation.Autowired; @@ -51,6 +56,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { private RedissonClient redissonClient; @Autowired private ISchBaseTaskService taskService; + @Autowired + private TaskFactory taskFactory; // 初始化反射方法 @PostConstruct @@ -129,4 +136,48 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { return ApplyTaskResponse.responseOk(requestNo); } + + @Override + public BaseResponse feedbackTaskStatus(JSONObject param) { + String requestNo = param.getString("requestNo"); + FeedBackTaskStatusRequest taskStatusRequest = param.toJavaObject(FeedBackTaskStatusRequest.class); + String taskCode = taskStatusRequest.getTask_code(); + if (ObjectUtil.isEmpty(taskCode)) { + throw new BadRequestException("任务编码不能为空!"); + } + SchBaseTask taskObj = taskService.getByCode(taskCode); + if (ObjectUtil.isEmpty(taskObj)) { + throw new BadRequestException("未找到任务编码为 [" + taskCode + "] 的任务"); + } + // 任务处理类 + String processingClass = taskObj.getConfig_code(); + //1:执行中,2:完成 ,3:acs取消 + String acsTaskStatus = param.getString("task_status"); + String message = ""; + TaskStatus status = TaskStatus.APPLY; + switch (acsTaskStatus) { + case "1": + status = TaskStatus.EXECUTING; + break; + case "2": + status = TaskStatus.FINISHED; + break; + case "3": + status = TaskStatus.CANCELED; + break; + default: + break; + } + // 根据配置去工厂类获得类对象 + AbstractTask abstractTask = taskFactory.getTask(processingClass); + // 更新任务 + try { + abstractTask.updateTaskStatus(taskCode, status); + } catch (Exception e) { + log.error("任务状态更新失败: {}", e.getMessage()); + return BaseResponse.responseError(requestNo, "任务:[" + taskCode + "]状态更新失败," + message); + } + return BaseResponse.responseOk(requestNo, "任务状态反馈成功!"); + } + } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java index 4d27a69..be6e163 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/controller/PdaController.java @@ -86,7 +86,7 @@ public class PdaController { @PostMapping("/group/printf") @Log("打印标签") - public ResponseEntity printf(@Validated @RequestBody CommonPointQueryDto requestParam) { + public ResponseEntity printf(@Validated @RequestBody CommonVehicleInfoDto requestParam) { return new ResponseEntity<>(pdaService.printf(requestParam), HttpStatus.OK); } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/PdaService.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/PdaService.java index d4d90dc..430cf49 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/PdaService.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/PdaService.java @@ -69,7 +69,7 @@ public interface PdaService { * @param requestParam * @return */ - PrintTagVo printf(CommonPointQueryDto requestParam); + PrintTagVo printf(CommonVehicleInfoDto requestParam); /** * 呼叫空托 diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/CommonVehicleInfoDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/CommonVehicleInfoDto.java new file mode 100644 index 0000000..46bc269 --- /dev/null +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/CommonVehicleInfoDto.java @@ -0,0 +1,13 @@ +package org.nl.wms.pda.service.dao.dto; + +import lombok.Data; + +/** + * @Author: lyd + * @Description: 通用实体 + * @Date: 2023/10/16 + */ +@Data +public class CommonVehicleInfoDto { + private String vehicle_code; +} diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ManualGroupDto.java b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ManualGroupDto.java index f9486a6..39ade58 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ManualGroupDto.java +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/dto/ManualGroupDto.java @@ -17,5 +17,5 @@ public class ManualGroupDto { private String material_id; private String material_code; private String material_qty; - private boolean is_link; + private Boolean is_link; } diff --git a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.xml b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.xml index 5b4a0c8..513b894 100644 --- a/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.xml +++ b/lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/pda/service/dao/mapper/PdaMapper.xml @@ -24,13 +24,17 @@