|
@ -8,6 +8,7 @@ import com.alibaba.fastjson.JSONArray; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.RequiredArgsConstructor; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.nl.modules.common.exception.BadRequestException; |
|
|
import org.nl.modules.common.exception.BadRequestException; |
|
|
import org.nl.modules.common.utils.SecurityUtils; |
|
|
import org.nl.modules.common.utils.SecurityUtils; |
|
|
import org.nl.modules.system.util.CodeUtil; |
|
|
import org.nl.modules.system.util.CodeUtil; |
|
@ -20,8 +21,9 @@ import org.nl.wms.sch.tasks.AcsTaskDto; |
|
|
import org.nl.wms.util.IdUtil; |
|
|
import org.nl.wms.util.IdUtil; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
import java.util.*; |
|
|
import java.util.List; |
|
|
import java.util.function.BiConsumer; |
|
|
|
|
|
import java.util.function.Predicate; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @author: lyd |
|
|
* @author: lyd |
|
@ -33,6 +35,8 @@ import java.util.List; |
|
|
@Slf4j |
|
|
@Slf4j |
|
|
public class YzjCallMaterialTask extends AbstractAcsTask { |
|
|
public class YzjCallMaterialTask extends AbstractAcsTask { |
|
|
private final String THIS_CLASS = YzjCallMaterialTask.class.getName(); |
|
|
private final String THIS_CLASS = YzjCallMaterialTask.class.getName(); |
|
|
|
|
|
//start point,[endpoint1,endpoin2]
|
|
|
|
|
|
public static Map<String,String> YZJ_OLD_POINT = new HashMap<>(); |
|
|
/** |
|
|
/** |
|
|
* 添加任务进行下发 |
|
|
* 添加任务进行下发 |
|
|
* |
|
|
* |
|
@ -175,7 +179,10 @@ public class YzjCallMaterialTask extends AbstractAcsTask { |
|
|
String device_code = pointTab.query("point_code = '" + point_code2 + "'").uniqueResult(0).getString("device_code"); |
|
|
String device_code = pointTab.query("point_code = '" + point_code2 + "'").uniqueResult(0).getString("device_code"); |
|
|
JSONObject workOrderObj = workOrderTab.query("device_code = '" + device_code + "' and order_status = '3' and is_delete ='0'").uniqueResult(0); |
|
|
JSONObject workOrderObj = workOrderTab.query("device_code = '" + device_code + "' and order_status = '3' and is_delete ='0'").uniqueResult(0); |
|
|
if (ObjectUtil.isEmpty(workOrderObj)) throw new BadRequestException("该设备当前未生产或者已删除"); |
|
|
if (ObjectUtil.isEmpty(workOrderObj)) throw new BadRequestException("该设备当前未生产或者已删除"); |
|
|
|
|
|
String oldMatSendPoint = YZJ_OLD_POINT.get(point_code2);//旧料盅终点
|
|
|
|
|
|
if (StringUtils.isNotEmpty(oldMatSendPoint)){ |
|
|
|
|
|
point_code2=oldMatSendPoint; |
|
|
|
|
|
} |
|
|
SchTaskDto dto = SchTaskDto.builder() |
|
|
SchTaskDto dto = SchTaskDto.builder() |
|
|
.task_id(IdUtil.getLongId()) |
|
|
.task_id(IdUtil.getLongId()) |
|
|
.task_code(CodeUtil.getNewCode("TASK_CODE")) |
|
|
.task_code(CodeUtil.getNewCode("TASK_CODE")) |
|
|