zhangxin преди 1 година
родител
ревизия
b4ae3c3bd2

+ 5 - 2
warewms-ams/src/main/java/com/warewms/ams/ndc/service/impl/AmsTaskServiceImpl.java

@@ -294,7 +294,9 @@ public class AmsTaskServiceImpl extends CrudServiceImpl<AmsTaskMapper, AmsTask,
                 .set(AmsTask::getAciAccept, AmsConstant.ACI_ACCEPT_STATUS.D.getValue())
                 .set(AmsTask::getEvent, AmsConstant.TASK_STS.TASK7.getKey())
                 .set(AmsTask::getSystemStatus, AmsConstant.TASK_STS.TASK7.getValue())
-                .set(AmsTask::getRemark, "任务取消原因为:" + remark)) > 0;
+                .set(AmsTask::getRemark, "任务创建时间为:" + amsTask.getAddtime() + ", 取消原因为:" + remark)
+                .set(AmsTask::getAddtime, DateUtils.getNowDate())
+        ) > 0;
     }
 
     @Override
@@ -321,7 +323,8 @@ public class AmsTaskServiceImpl extends CrudServiceImpl<AmsTaskMapper, AmsTask,
             response = restTemplate.postForObject(AmsConstant.WMS_URL, amsTaskStateFeedbackDTO, Object.class);
             log.info("wms response data is :{}", JSONObject.toJSONString(response));
         } catch (Exception e) {
-            log.error("AMS send request to WMS is on error, pause is :{}", e.getMessage());
+            log.info("AMS send request to WMS is on error, pause is :{}", e.getMessage());
+            throw new BaseException(e.getMessage());
         }
     }
 

+ 7 - 1
warewms-ams/src/main/java/com/warewms/ams/ndc/service/impl/StatusUpdateServiceImpl.java

@@ -24,7 +24,13 @@ public class StatusUpdateServiceImpl implements StatusUpdateService {
         if (ObjectUtil.isNull(amsTask)) {
             return;
         }
-        if (StringUtils.isNotBlank(amsTask.getExt3()) && (state.equals(AmsConstant.TASK_STS.TASK2.getValue()) || state.equals(AmsConstant.TASK_STS.TASK6.getValue()))) {
+        //如果任务为第一段任务 则不下发2 4 6状态至wms
+        if (StringUtils.isNotBlank(amsTask.getExt3()) && (state.equals(AmsConstant.TASK_STS.TASK2.getValue())
+                || state.equals(AmsConstant.TASK_STS.TASK6.getValue()) || state.equals(AmsConstant.TASK_STS.TASK4.getValue()))) {
+            return;
+        }
+        //如果任务为第二段任务 则不下发任务开始状态至wms
+        if (StringUtils.isBlank(amsTask.getExt3()) && state.equals(AmsConstant.TASK_STS.TASK1.getValue())){
             return;
         }
         amsTaskService.amsStateFeedbackToWms(state, String.valueOf(amsTask.getId()), amsTask.getTaskNo(), carNo);