Browse Source

手持原材料出库:申请任务时校验是否存在该载具的工单信息,点位上是否存在载具

master
zds 5 months ago
parent
commit
c0aaa825fc
  1. 26
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java
  2. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/IWorkorderService.java
  3. 19
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/impl/WorkorderServiceImpl.java

26
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/task_manage/AbstractTask.java

@ -6,11 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.nl.common.exception.BadRequestException; import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import org.nl.wms.database.material.service.IMdBaseMaterialService;
import org.nl.wms.database.material.service.dao.MdBaseMaterial;
import org.nl.wms.ext.service.dto.to.BaseResponse; import org.nl.wms.ext.service.dto.to.BaseResponse;
import org.nl.wms.pdm.service.IPdmBdWorkorderService;
import org.nl.wms.pdm.service.dao.PdmBdWorkorder;
import org.nl.wms.sch.point.service.ISchBasePointService; import org.nl.wms.sch.point.service.ISchBasePointService;
import org.nl.wms.sch.point.service.dao.SchBasePoint; import org.nl.wms.sch.point.service.dao.SchBasePoint;
import org.nl.wms.sch.task.service.ISchBaseTaskService; import org.nl.wms.sch.task.service.ISchBaseTaskService;
@ -18,17 +14,16 @@ import org.nl.wms.sch.task.service.ISchBaseTaskconfigService;
import org.nl.wms.sch.task.service.dao.SchBaseTask; import org.nl.wms.sch.task.service.dao.SchBaseTask;
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig; import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
import org.nl.wms.sch.task_manage.enums.TaskDirectionEnum; import org.nl.wms.sch.task_manage.enums.TaskDirectionEnum;
import org.nl.wms.sch.task_manage.enums.WorkOrderStatusEnum;
import org.nl.wms.sch.task_manage.task.AcsUtil; import org.nl.wms.sch.task_manage.task.AcsUtil;
import org.nl.wms.sch.task_manage.task.core.TaskStatus; import org.nl.wms.sch.task_manage.task.core.TaskStatus;
import org.nl.wms.sch.workorder.service.IWorkorderService; import org.nl.wms.sch.workorder.service.IWorkorderService;
import org.nl.wms.sch.workorder.service.dao.Workorder;
import org.nl.wms.sch.workorder.service.dao.mapper.WorkorderMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @author ldjun * @author ldjun
@ -47,7 +42,7 @@ public abstract class AbstractTask {
@Autowired @Autowired
private IWorkorderService workorderService; private IWorkorderService workorderService;
@Autowired @Autowired
private IMdBaseMaterialService materialService; private WorkorderMapper workorderMapper;
/** /**
* 任务创建 * 任务创建
@ -191,15 +186,26 @@ public abstract class AbstractTask {
// 判断是否校验工单 // 判断是否校验工单
if (taskConfig.getIs_check_workorder()) { if (taskConfig.getIs_check_workorder()) {
//如果点位上没货 //如果点位上没货
if(ObjectUtil.isNotEmpty(pointObj.getVehicle_code2())) { if(ObjectUtil.isEmpty(pointObj)) {
throw new BadRequestException(apply_point_code+"点位信息异常,请检查输入的点位!" );
}
//如果点位上没货
if(ObjectUtil.isEmpty(pointObj.getVehicle_code2())) {
throw new BadRequestException("点位:" + apply_point_code+ "上无托盘信息!"); throw new BadRequestException("点位:" + apply_point_code+ "上无托盘信息!");
} }
List<Workorder> works = workorderMapper.selectList(new LambdaQueryWrapper<Workorder>()
.eq(Workorder::getPalletSN, pointObj.getVehicle_code2())
.le(Workorder::getStatus, 1));
if(works.size()<=0){
throw new BadRequestException("点位:" + apply_point_code+ "上托盘:"+pointObj.getVehicle_code2()+"无可出库工单信息!");
}
//设置载具信息 //设置载具信息
param.put("vehicle_code2",pointObj.getVehicle_code2()); param.put("vehicle_code2",pointObj.getVehicle_code2());
param.put("vehicle_code",pointObj.getVehicle_code()); param.put("vehicle_code",pointObj.getVehicle_code());
//更新对应载具工单状态为已生成任务,不可在工单页面取消 //更新对应载具工单状态为已生成任务,不可在工单页面取消
//pdm_bd_workorder_two任务生成时,status改为2 //pdm_bd_workorder_two任务生成时,status改为2
workorderService.update(pointObj.getVehicle_code2(),"2"); workorderService.updateByPda(pointObj.getVehicle_code2(),"2",param.getString("mode"));
// 校验工单 // 校验工单
// 根据对接位的父点位编码(设备)找到工单设备 // 根据对接位的父点位编码(设备)找到工单设备
/*SchBasePoint one = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>() /*SchBasePoint one = pointService.getOne(new LambdaQueryWrapper<SchBasePoint>()

7
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/IWorkorderService.java

@ -33,6 +33,13 @@ public interface IWorkorderService extends IService<Workorder> {
*/ */
public void update(String palletSN,String status); public void update(String palletSN,String status);
/**
*
* @param palletSN
* @param status
* @param mode
*/
public void updateByPda(String palletSN,String status,String mode);
/** /**
* 多选删除 * 多选删除

19
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/workorder/service/impl/WorkorderServiceImpl.java

@ -1,6 +1,5 @@
package org.nl.wms.sch.workorder.service.impl; package org.nl.wms.sch.workorder.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert; import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
@ -12,7 +11,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.common.domain.query.PageQuery; import org.nl.common.domain.query.PageQuery;
import org.nl.common.utils.SecurityUtils;
import org.nl.wms.pda.service.PdaService; import org.nl.wms.pda.service.PdaService;
import org.nl.wms.pdm.service.dao.PointDetailAdd; import org.nl.wms.pdm.service.dao.PointDetailAdd;
import org.nl.wms.sch.report.service.dto.YCLKCDto; import org.nl.wms.sch.report.service.dto.YCLKCDto;
@ -20,7 +18,6 @@ import org.nl.wms.sch.task.service.ISchBaseTaskService;
import org.nl.wms.sch.task.service.ISchBaseTaskconfigService; import org.nl.wms.sch.task.service.ISchBaseTaskconfigService;
import org.nl.wms.sch.task.service.dao.SchBaseTask; import org.nl.wms.sch.task.service.dao.SchBaseTask;
import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig; import org.nl.wms.sch.task.service.dao.SchBaseTaskconfig;
import org.nl.wms.sch.task_manage.enums.WorkOrderTwoStatusEnum;
import org.nl.wms.sch.workorder.service.IWorkorderService; import org.nl.wms.sch.workorder.service.IWorkorderService;
import org.nl.wms.sch.workorder.service.dao.Workorder; import org.nl.wms.sch.workorder.service.dao.Workorder;
import org.nl.wms.sch.workorder.service.dao.mapper.WorkorderMapper; import org.nl.wms.sch.workorder.service.dao.mapper.WorkorderMapper;
@ -73,11 +70,27 @@ public class WorkorderServiceImpl extends ServiceImpl<WorkorderMapper, Workorder
//更新已生成任务后的工单状态 //更新已生成任务后的工单状态
UpdateWrapper<Workorder> updateWrapper = new UpdateWrapper<>(); UpdateWrapper<Workorder> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("palletSN",palletSN); updateWrapper.eq("palletSN",palletSN);
//更新大于等于1的记录
updateWrapper.ge("status","1"); updateWrapper.ge("status","1");
updateWrapper.set("status",status); updateWrapper.set("status",status);
workorderMapper.update(null,updateWrapper); workorderMapper.update(null,updateWrapper);
} }
} }
@Override
public void updateByPda(String palletSN,String status,String mode){
if(ObjectUtil.isNotEmpty(palletSN)){
//更新已生成任务后的工单状态
UpdateWrapper<Workorder> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("palletSN",palletSN);
//更新小于等于1的记录
updateWrapper.le("status","1");
updateWrapper.set("status",status);
updateWrapper.set("mode",mode);
workorderMapper.update(null,updateWrapper);
}
}
@Override @Override
public void deleteAll(Set<String> ids) { public void deleteAll(Set<String> ids) {
// 真删除 // 真删除

Loading…
Cancel
Save