指定货位出库

main
judy 1 year ago
parent 2b5cd3f13d
commit dc1d47ada7
  1. 2
      shkj-wms/src/main/java/com/shkj/wms/controller/business/BaseBarcodesController.java
  2. 18
      shkj-wms/src/main/java/com/shkj/wms/controller/business/BusinBillOutController.java
  3. 12
      shkj-wms/src/main/java/com/shkj/wms/enums/TaskTypeEnum.java
  4. 55
      shkj-wms/src/main/java/com/shkj/wms/scheduled/ScheduledTasks.java
  5. 4
      shkj-wms/src/main/java/com/shkj/wms/service/IBaseBarcodesOutService.java
  6. 9
      shkj-wms/src/main/java/com/shkj/wms/service/IBusinDataTaskService.java
  7. 3
      shkj-wms/src/main/java/com/shkj/wms/service/ISysStockService.java
  8. 107
      shkj-wms/src/main/java/com/shkj/wms/service/impl/BusinDataTaskServiceImpl.java
  9. 4
      shkj-wms/src/main/java/com/shkj/wms/service/impl/PutInOutStorageServiceImpl.java

@ -150,7 +150,7 @@ public class BaseBarcodesController extends BaseController {
} }
/** /**
* * 手动下发出库任务
* @param vin * @param vin
* @param status * @param status
* @return * @return

@ -17,10 +17,7 @@ import com.shkj.wms.third.ykl.ThirdYklResult;
import com.shkj.wms.vo.BusinBillHeadPlanOutVo; import com.shkj.wms.vo.BusinBillHeadPlanOutVo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.ArrayList; import java.util.ArrayList;
@ -58,6 +55,19 @@ public class BusinBillOutController extends BaseController {
} }
/**
* 指定货位出库
* @param locationCode
* @return
*/
@Log(title = "指定货位出库",businessType = BusinessType.UPDATE)
@PostMapping("/namedLoctionOutput")
@RepeatSubmit
public Result<Boolean> namedLoctionOutput(@Valid @RequestParam String locationCode){
return businDataTaskService.insertBusinTask(locationCode);
}
@Log(title = "紧急出库确认出库-方式2",businessType = BusinessType.UPDATE) @Log(title = "紧急出库确认出库-方式2",businessType = BusinessType.UPDATE)

@ -107,7 +107,17 @@ public enum TaskTypeEnum {
/** /**
* 20.下挂空治具入库 * 20.下挂空治具入库
*/ */
empty_in("20","下挂空治具入库"); empty_in("20","下挂空治具入库"),
/**
* 21 待冲孔出立库
*/
punching_out("21","待冲孔出立库冲孔去"),
/**
* 指定货位出库
*/
named_loc("22","指定货位出库");
private String value; private String value;

@ -229,6 +229,10 @@ public class ScheduledTasks {
taskQueryBo.setTaskType("21"); taskQueryBo.setTaskType("21");
List<BusinDataTaskVo> businDataTaskVo21 = iBusinDataTaskService.selectBusinDataTask1(taskQueryBo); List<BusinDataTaskVo> businDataTaskVo21 = iBusinDataTaskService.selectBusinDataTask1(taskQueryBo);
businDataTaskVos.addAll(businDataTaskVo21); businDataTaskVos.addAll(businDataTaskVo21);
taskQueryBo.setTaskType("22");
List<BusinDataTaskVo> businDataTaskVo22 = iBusinDataTaskService.selectBusinDataTask1(taskQueryBo);
businDataTaskVos.addAll(businDataTaskVo22);
for (BusinDataTaskVo businDataTaskVo : businDataTaskVos) { for (BusinDataTaskVo businDataTaskVo : businDataTaskVos) {
doTask(businDataTaskVo); doTask(businDataTaskVo);
} }
@ -536,7 +540,8 @@ public class ScheduledTasks {
businDataTaskVo.setDpsNoTwo(stkPlcId); businDataTaskVo.setDpsNoTwo(stkPlcId);
iBusinDataTaskService.updateById(BeanUtil.toBean(businDataTaskVo, BusinDataTask.class)); iBusinDataTaskService.updateById(BeanUtil.toBean(businDataTaskVo, BusinDataTask.class));
} else if (taskType.equals("2")) { }
else if (taskType.equals("2")) {
Long plcId = 0L; Long plcId = 0L;
Long stkPlcId = 0L; Long stkPlcId = 0L;
Boolean NUMBER = true; Boolean NUMBER = true;
@ -698,7 +703,8 @@ public class ScheduledTasks {
businDataTaskVo.setDpsNoOne(plcId); businDataTaskVo.setDpsNoOne(plcId);
businDataTaskVo.setDpsNoTwo(stkPlcId); businDataTaskVo.setDpsNoTwo(stkPlcId);
} else if (taskType.equals("1")) { }
else if (taskType.equals("1")) {
Long plcId = 0L; Long plcId = 0L;
Long stkPlcId = 0L; Long stkPlcId = 0L;
Boolean NUMBER = true; Boolean NUMBER = true;
@ -881,7 +887,8 @@ public class ScheduledTasks {
businDataTaskVo.setDpsNoOne(plcId); businDataTaskVo.setDpsNoOne(plcId);
businDataTaskVo.setDpsNoTwo(stkPlcId); businDataTaskVo.setDpsNoTwo(stkPlcId);
} else if (taskType.equals("3")) { }
else if (taskType.equals("3")) {
Long plcId = 0L; Long plcId = 0L;
Long stkPlcId = 0L; Long stkPlcId = 0L;
Boolean NUMBER = true; Boolean NUMBER = true;
@ -1033,14 +1040,15 @@ public class ScheduledTasks {
// } // }
businDataTaskVo.setDpsNoOne(plcId); businDataTaskVo.setDpsNoOne(plcId);
businDataTaskVo.setDpsNoTwo(stkPlcId); businDataTaskVo.setDpsNoTwo(stkPlcId);
} else if (taskType.equals("4") || taskType.equals("5")) { }
else if (taskType.equals("4") || taskType.equals("5")) {
String randome = null; String randome = null;
//出库任务(正常出库、紧急出库) //出库任务(正常出库、紧急出库)
//获取要出库的物料信息 //获取要出库的物料信息
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.getTaskGoodsByTaskCodeForOut(businDataTaskVo.getId()); List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.getTaskGoodsByTaskCodeForOut(businDataTaskVo.getId());
//拿到按比例分配的库区 //拿到按比例分配的库区
// randome = allocationTasksUtils.randomeout(); // randome = allocationTasksUtils.randomeout();
//测试时使用 //测试时使用
randome = "P01"; randome = "P01";
//TODO 测试注释 要到开 //TODO 测试注释 要到开
@ -1176,7 +1184,8 @@ public class ScheduledTasks {
// } // }
} }
} else if (taskType.equals("11") || taskType.equals("12")) { }
else if (taskType.equals("11") || taskType.equals("12")) {
String agvno = ""; String agvno = "";
int AgvType = 0; int AgvType = 0;
//空治具流向呼叫agv失败后再次呼叫agv //空治具流向呼叫agv失败后再次呼叫agv
@ -1247,7 +1256,8 @@ public class ScheduledTasks {
// } // }
} }
} }
} else if (taskType.equals("10")) { }
else if (taskType.equals("10")) {
//先判断补货入库是否是一套,如果是入存货区,否则入异常区 //先判断补货入库是否是一套,如果是入存货区,否则入异常区
List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.getTaskGoodsByTaskCodeForOut(businDataTaskVo.getId()); List<BusinDataTaskGoodsVo> businDataTaskGoodsVos = iBusinDataTaskGoodsService.getTaskGoodsByTaskCodeForOut(businDataTaskVo.getId());
Result<BaseLocationVo> baseLocationVoResult = iBaseLocationService.queryById(businDataTaskVo.getLocationId()); Result<BaseLocationVo> baseLocationVoResult = iBaseLocationService.queryById(businDataTaskVo.getLocationId());
@ -1268,7 +1278,8 @@ public class ScheduledTasks {
businDataTaskVo.setExceptionMsg("下发堆垛机指令失败"); businDataTaskVo.setExceptionMsg("下发堆垛机指令失败");
businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue()); businDataTaskVo.setTaskStatus(TaskStatusEnum.err.getValue());
} }
} else if (taskType.equals(TaskTypeEnum.abnormal_delivery.getValue())) { }
else if (taskType.equals(TaskTypeEnum.abnormal_delivery.getValue())) {
//异常出库 //异常出库
//异常区货位 //异常区货位
Long abnormalArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.abnormal_area)); Long abnormalArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.abnormal_area));
@ -1390,9 +1401,9 @@ public class ScheduledTasks {
boolean b = iBusinDataTaskGoodsService.saveOrUpdateBatch(goods); boolean b = iBusinDataTaskGoodsService.saveOrUpdateBatch(goods);
} else if (taskType.equals(TaskTypeEnum.punching_delivery.getValue())) { }
else if (taskType.equals(TaskTypeEnum.punching_delivery.getValue())) {}
} else if (taskType.equals(TaskTypeEnum.replenished_in.getValue())) { else if (taskType.equals(TaskTypeEnum.replenished_in.getValue())) {
String agvno = null; String agvno = null;
if (businDataTaskVo.getTaskPath().contains("manMade")) { if (businDataTaskVo.getTaskPath().contains("manMade")) {
List agvtaskType = new ArrayList(); List agvtaskType = new ArrayList();
@ -1418,7 +1429,8 @@ public class ScheduledTasks {
iBusinDataTaskService.runReplenishIn(businDataTaskVo, agvno); iBusinDataTaskService.runReplenishIn(businDataTaskVo, agvno);
Result<Boolean> booleanResult = iPutInOutStorageService.reduceInventory(taskId, goodsNoStr); Result<Boolean> booleanResult = iPutInOutStorageService.reduceInventory(taskId, goodsNoStr);
} else if (taskType.equals("21")) { }
else if (taskType.equals("21")) {
// 冲孔出库 // 冲孔出库
//待冲孔区货位 //待冲孔区货位
Long abnormalArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.punching_area)); Long abnormalArea = Long.valueOf(sysParameterService.selectConfigByKey(ParameterConstants.ParameterSystem.punching_area));
@ -1542,6 +1554,25 @@ public class ScheduledTasks {
businDataTaskVo.setTaskStatus("-3"); businDataTaskVo.setTaskStatus("-3");
} }
} }
else if (taskType.equals("22")){
BusinDataTask businDataTask = iBusinDataTaskService.getById(businDataTaskVo.getId());
Result<Boolean> taskResult = outTask(businDataTask);
if (Result.isOk(taskResult)) {
businDataTask.setTaskStatus(TaskStatusEnum.wait_callback.getValue());
if (ObjectUtils.isEmpty(redisTemplate.opsForValue().get("outbound:" + businDataTask.getId()))) {
redisTemplate.opsForValue().set("outbound:" + businDataTask.getId(), businDataTask.toString());
}
} else {
if (ObjectUtils.isEmpty(redisTemplate.opsForValue().get("outbound:" + businDataTask.getId()))) {
businDataTask.setExceptionMsg("下发堆垛机失败");
businDataTask.setTaskStatus(TaskStatusEnum.err.getValue());
} else {
businDataTask.setExceptionMsg("已经下发堆垛机");
businDataTask.setTaskStatus("-3");
}
}
}
log.info("任务号" + businDataTaskVo.getId() + "任务状态" + businDataTaskVo.getTaskStatus() + "点位信息" + businDataTaskVo.getPoints()); log.info("任务号" + businDataTaskVo.getId() + "任务状态" + businDataTaskVo.getTaskStatus() + "点位信息" + businDataTaskVo.getPoints());
//统一提交任务数据 //统一提交任务数据
iBusinDataTaskService.saveOrUpdate(BeanUtil.toBean(businDataTaskVo, BusinDataTask.class)); iBusinDataTaskService.saveOrUpdate(BeanUtil.toBean(businDataTaskVo, BusinDataTask.class));

@ -79,7 +79,7 @@ public interface IBaseBarcodesOutService extends IService<BaseBarcodesOut> {
Result<Boolean> handMoveOutboundInfoTask(BaseBarcodesOutQueryBo bo); Result<Boolean> handMoveOutboundInfoTask(BaseBarcodesOutQueryBo bo);
/** /**
* * 手动下发出库任务
* @author Comair * @author Comair
* @date 2023/7/27 11:14 * @date 2023/7/27 11:14
* @param vin * @param vin
@ -113,7 +113,7 @@ public interface IBaseBarcodesOutService extends IService<BaseBarcodesOut> {
Result<Boolean> handMoveOutboundInfoTaskForCancel(BaseBarcodesOutQueryBo bo); Result<Boolean> handMoveOutboundInfoTaskForCancel(BaseBarcodesOutQueryBo bo);
/** /**
* *
* @author Comair * @author Comair
* @date 2023/8/29 15:19 * @date 2023/8/29 15:19
* @return java.util.List<java.util.Map<java.lang.String,java.lang.String>> * @return java.util.List<java.util.Map<java.lang.String,java.lang.String>>

@ -37,6 +37,13 @@ public interface IBusinDataTaskService extends IService<BusinDataTask> {
*/ */
Result<Boolean> insertBusinTaskByDervie(List<BaseGoodsDervieBo> baseGoodsDervieBos); Result<Boolean> insertBusinTaskByDervie(List<BaseGoodsDervieBo> baseGoodsDervieBos);
/**
* 指定货位出库
* @param locationCode
* @return
*/
Result<Boolean> insertBusinTask(String locationCode);
/** /**
*人工入库点位 *人工入库点位
*/ */
@ -155,7 +162,7 @@ public interface IBusinDataTaskService extends IService<BusinDataTask> {
/** /**
* 可视化大屏统计出入任务数量 * 可视化大屏统计出入任务数量
* @param bo * @param
* @return * @return
*/ */
List<DataScreeTaskqtyVo> getCurDateTaskQty(); List<DataScreeTaskqtyVo> getCurDateTaskQty();

@ -106,4 +106,7 @@ public interface ISysStockService extends IService<SysStock> {
Map<String, List<SysStockVehicheVo>> getVehicheStockList(); Map<String, List<SysStockVehicheVo>> getVehicheStockList();
List<SysStockNumDetailVo> queryStockDetailList(SysStockNumQueryBo bo);
} }

@ -498,7 +498,114 @@ public class BusinDataTaskServiceImpl extends ServiceImpl<BusinDataTaskMapper, B
return iBusinDataTaskGoodsService.saveBatch(taskGoodsList)?Result.ok():Result.err().msg("紧急出库确认失败"); return iBusinDataTaskGoodsService.saveBatch(taskGoodsList)?Result.ok():Result.err().msg("紧急出库确认失败");
} }
/**
* 指定货位出库
* @param locationCode
* @return
*/
@Override
@Transactional(rollbackFor = Exception.class )
public Result<Boolean> insertBusinTask(String locationCode){
/**
* 1.查询当前货位是不是有库存
* 2查询当前货位是不是双深位如果是则查询单深位是否有货如果有货则提示不可出库
* 3.生成相关任务预占出库库存
* 4.
*/
BaseLocationVo baseLocationVo = iBaseLocationService.queryLocationByCode(locationCode);
if (baseLocationVo == null){
return Result.err().msg("未查询到货位信息,请确认!"+locationCode);
}
if (baseLocationVo.getLocationStatus().equals("4") || baseLocationVo.getLocationStatus().equals("0")){
return Result.err().msg("此货位出库中或已出库,请确认!"+locationCode+" 库位状态:"+baseLocationVo.getLocationStatus());
}
List<SysStockDetailVo> sysStockDetailVoList =null;
//查询指定出库的货位是不是双深位,如果是,则查询但深位是否有库存
if (baseLocationVo.getIsDeep().equals("2")){
String locationRow = baseLocationVo.getLocationRow();
String locationColumn = baseLocationVo.getLocationColumn();
String layer = baseLocationVo.getLayer();
if (locationRow.equals("1")){
locationRow="2";
}else if (locationRow.equals("4")){
locationRow="3";
}else if (locationRow.equals("16")){
locationRow="15";
}
BaseLocation one = iBaseLocationService.getOne(new LambdaQueryWrapper<BaseLocation>()
.eq(BaseLocation::getLocationRow, locationRow)
.eq(BaseLocation::getLocationColumn, locationColumn)
.eq(BaseLocation::getLayer, layer));
Result<List<SysStockDetailVo>> stockListResult = iSysStockDetailService.queryByLocation(one.getId());
if (Result.isOk(stockListResult)){
sysStockDetailVoList = stockListResult.getData();
if (sysStockDetailVoList != null && sysStockDetailVoList.size() !=0 ){
return Result.err().msg("指定出库货位是双深位,单深位有货,不可出库"+locationCode);
}
}
}
//确认出库的货位是否有库存信息
Result<List<SysStockDetailVo>> stockListResult = iSysStockDetailService.queryByLocation(baseLocationVo.getId());
if (Result.isOk(stockListResult)){
sysStockDetailVoList = stockListResult.getData();
if (sysStockDetailVoList == null && sysStockDetailVoList.size() ==0 ){
return Result.err().msg("此货位未查询到保险杠信息,请确认!"+locationCode);
}
}
//预占库存
baseLocationVo.setLocationStatus("4");
BaseLocation baseLocation = BeanUtil.toBean(baseLocationVo, BaseLocation.class);
iBaseLocationService.updateById(baseLocation);
//需要搬运到的码头信息
String taskPath ="KW30";
//生成作业任务
int index=0;
List<BusinDataTaskGoods> taskGoodsList = new ArrayList<>();
List<SysStockDetail> sysStockDetails = new ArrayList<>();
for (SysStockDetailVo sysStockDetailVo : sysStockDetailVoList) {
Long taskId=0L;
if(index ==0) {
BusinDataTask task = new BusinDataTask();
task.setTaskType(TaskTypeEnum.named_loc.getValue());
task.setPriority("2");
task.setIsTop("0");
task.setBatch(sysStockDetailVo.getBatch());
task.setTaskStatus(TaskStatusEnum.wait_put.getValue());
task.setIsUrgent("0");
task.setCreateTime(DateUtils.getNowDate());
task.setTaskPath(taskPath);
task.setDistinction("1");
task.setContainerId(sysStockDetailVo.getContainerCode());
task.setFromRow(baseLocationVo.getLocationRow());
task.setFromLayer(baseLocationVo.getLayer());
task.setFromColumn(baseLocationVo.getLocationColumn());
task.setTunnel(baseLocationVo.getTunnel());
businDataTaskMapper.insertBusinDataTask(task);
taskId = task.getId();
index++;
}
//保险杠信息
BusinDataTaskGoods taskGoods = new BusinDataTaskGoods();
taskGoods.setGoodsNo(sysStockDetailVo.getGoodsNo());
taskGoods.setTaskCode(taskId);
taskGoods.setIsPunching(sysStockDetailVo.getIsPuch());
taskGoods.setBranchId(SecurityUtils.getCurrentBranchId());
taskGoodsList.add(taskGoods);
//出库预占
sysStockDetailVo.setOutQty(sysStockDetailVo.getQty().intValue());
SysStockDetail sysStockDetail = BeanUtil.toBean(sysStockDetailVo, SysStockDetail.class);
sysStockDetail.setOutTime(DateUtils.getNowDate());
sysStockDetails.add(sysStockDetail);
}
iSysStockDetailService.updateBatchById(sysStockDetails);
return iBusinDataTaskGoodsService.saveBatch(taskGoodsList)?Result.ok():Result.err().msg("指定货位出库失败");
}
@Override @Override
public Result<BasePointDeviceVo> getManualWarehousingPoint() { public Result<BasePointDeviceVo> getManualWarehousingPoint() {

@ -1053,6 +1053,8 @@ public class PutInOutStorageServiceImpl extends ServiceImpl<BasePointDeviceMappe
sysStockDetail.setTunnel(baseLocation.getTunnel()); sysStockDetail.setTunnel(baseLocation.getTunnel());
sysStockDetail.setContainerCode(businDataTask.getContainerId()); sysStockDetail.setContainerCode(businDataTask.getContainerId());
sysStockDetail.setBatch(businDataTask.getBatch()); sysStockDetail.setBatch(businDataTask.getBatch());
sysStockDetail.setInTime(DateUtils.getNowDate());
sysStockDetail.setCreateTime(DateUtils.getNowDate());
//更改任务状态 //更改任务状态
businDataTask.setTaskStatus("2"); businDataTask.setTaskStatus("2");
iBaseLocationService.updateById(baseLocation); iBaseLocationService.updateById(baseLocation);
@ -1075,6 +1077,8 @@ public class PutInOutStorageServiceImpl extends ServiceImpl<BasePointDeviceMappe
sysStockDetail.setTunnel(baseLocation.getTunnel()); sysStockDetail.setTunnel(baseLocation.getTunnel());
sysStockDetail.setContainerCode(businDataTask.getContainerId()); sysStockDetail.setContainerCode(businDataTask.getContainerId());
sysStockDetail.setBatch(businDataTask.getBatch()); sysStockDetail.setBatch(businDataTask.getBatch());
sysStockDetail.setInTime(DateUtils.getNowDate());
sysStockDetail.setCreateTime(DateUtils.getNowDate());
iBaseLocationService.updateById(baseLocation); iBaseLocationService.updateById(baseLocation);
iSysStockDetailService.save(sysStockDetail); iSysStockDetailService.save(sysStockDetail);
return businDataTaskMapper.updateById(businDataTask)>0?Result.ok():Result.err(); return businDataTaskMapper.updateById(businDataTask)>0?Result.ok():Result.err();

Loading…
Cancel
Save