Browse Source

fix:压制机叫料

master
zhangzhiqiang 2 years ago
parent
commit
628be284f5
  1. 13
      lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/callMaterial/YzjCallMaterialTask.java
  2. 2
      lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/callMaterial/wql/QSCH_yzjCallMaterial_01.wql

13
lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/callMaterial/YzjCallMaterialTask.java

@ -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"))

2
lms/nladmin-system/src/main/java/org/nl/wms/sch/tasks/callMaterial/wql/QSCH_yzjCallMaterial_01.wql

@ -53,6 +53,8 @@
SCH_BASE_Point p SCH_BASE_Point p
WHERE WHERE
p.is_used = '1' p.is_used = '1'
AND standing_time is not null
AND now()> DATE_ADD(standing_time,INTERVAL s_datetime MINUTE)
AND is_delete = '0' AND is_delete = '0'
AND lock_type='1' AND lock_type='1'
AND point_status = '3' AND point_status = '3'

Loading…
Cancel
Save