|
@@ -4,13 +4,18 @@ package com.ruoyi.ams.xuankuang.service;
|
|
|
import cn.hutool.core.util.NumberUtil;
|
|
|
import com.ruoyi.ams.order.domain.WmsDocOrderHeader;
|
|
|
import com.ruoyi.ams.order.mapper.WmsDocOrderHeaderMapper;
|
|
|
+import com.ruoyi.ams.task.domain.WcsTask;
|
|
|
+import com.ruoyi.ams.task.service.IWcsTaskService;
|
|
|
import com.ruoyi.ams.xuankuang.domain.dto.SkuAgitatedTankAttrDTO;
|
|
|
+import com.ruoyi.base.constant.Constant;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import com.ruoyi.hard.xuankang.StirringTankClient;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -23,10 +28,13 @@ import static com.ruoyi.hard.xuankang.StirringTankClient.STIR_TANK_COMMAND.*;
|
|
|
* @version 1.0
|
|
|
* @date 2023/4/24 15:31
|
|
|
*/
|
|
|
+@Slf4j
|
|
|
@Service
|
|
|
public class StirringTankClientService {
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IWcsTaskService wcsTaskService;
|
|
|
@Autowired
|
|
|
StirringTankClient stirringTankClient;
|
|
|
@Autowired
|
|
@@ -601,7 +609,20 @@ public class StirringTankClientService {
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 清除未完成和未下发成功的任务
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public void delTask() {
|
|
|
+
|
|
|
+ List<WcsTask> wcsTaskList = wcsTaskService.selectWcsByState(Constant.WAREHOUSE_ID);
|
|
|
+ if (wcsTaskList == null || wcsTaskList.size() < 1) { log.info("当前暂无需要处理的任务!"+ new Date());}
|
|
|
+
|
|
|
+ for (WcsTask wcsTask : wcsTaskList) {
|
|
|
|
|
|
+ wcsTaskService.callBack(wcsTask.getTaskNo(), 7, null);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|