rev:空木行出库增加 任务校验

This commit is contained in:
2025-02-27 10:52:35 +08:00
parent e061f75623
commit b614ed0792

View File

@@ -19,6 +19,7 @@ import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.wms.ext.acs.service.WmsToAcsService;
import org.nl.wms.pda.st.service.impl.ProductionOutServiceImpl;
import org.nl.wms.sch.manage.TaskStatusEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -198,6 +199,15 @@ public class ProductOutTwoServiceImpl implements ProductOutTwoService {
@Override
@Transactional(rollbackFor = Exception.class)
public JSONObject boxOut(JSONObject whereJson) {
// 判断当前是否有正在出库的空托盘任务
JSONArray resultJSONArray = WQLObject.getWQLObject("sch_base_task")
.query("task_type = '010706' and task_status < '" + TaskStatusEnum.FINISHED.getCode() + "' and is_delete = '0'")
.getResultJSONArray(0);
if (ObjectUtil.isNotEmpty(resultJSONArray)) {
throw new BadRequestException("当前正在执行空托盘出库任务,请稍后再出库!");
}
List<JSONObject> data = whereJson.getJSONArray("data").toJavaList(JSONObject.class);
outBoxManageService.publicBoxOut(data);