no message

main
HUOJIN\92525 2025-02-18 14:50:53 +08:00
parent 57e8dd1149
commit 7d778fa2a2
10 changed files with 84 additions and 40 deletions

View File

@ -13,7 +13,7 @@ public class TransTask {
String createTime;
@ApiModelProperty(value ="点位",required = true,example = "点位")
String pointCode;
@ApiModelProperty(value ="任务类型",required = true,example = "任务类型Cp_Off_Up成品上线、Cp_Off_Line成品下线、Fx_Off_Line返修下线、Fx_Back返修载具送回")
@ApiModelProperty(value ="任务类型",required = true,example = "任务类型Cp_Off_Up成品上线、Cp_Off_Line成品下线、Fx_Off_Line返修下线、Fx_Back返修载具送回、JL_Back叫料返空")
String taskType;
}

View File

@ -194,15 +194,15 @@ public class BydAppServiceImpl implements BydAppService {
returnTaskVo.setItemName(task.getItem().getName());
returnTaskVo.setSrcPointCode(task.getSrcPointCode());
returnTaskVo.setDstPointCode(task.getDstPointCode());
returnTaskVo.setPlanQty(task.getPlanQty()-task.getMoveQty());
returnTaskVo.setPlanQty(task.getPlanQty() - task.getMoveQty());
return returnTaskVo;
}
@Override
@Transactional(rollbackFor = Exception.class)
public void fbPicking(Long taskId, String orderNumber, String dstStockCode,Double moveQty) {
public void fbPicking(Long taskId, String orderNumber, String dstStockCode, Double moveQty) {
//验证任务
Task task = validateTask(taskId, orderNumber,moveQty);
Task task = validateTask(taskId, orderNumber, moveQty);
//工单
Pick pick = task.getPickDetail().getPick();
@ -220,8 +220,6 @@ public class BydAppServiceImpl implements BydAppService {
if (BaseStatus.GD_TYPE_CT.equals(pick.getOrderType())) {
this.returnFBAgvTask(task);
}
}
@Override
@ -392,12 +390,12 @@ public class BydAppServiceImpl implements BydAppService {
* @param taskId Id
* @param orderNumber
*/
private Task validateTask(Long taskId, String orderNumber,Double moveQty) {
private Task validateTask(Long taskId, String orderNumber, Double moveQty) {
Task task = taskService.findById(taskId);
if (task == null) {
throw new BadRequestException("未找到相应任务记录!");
}
if(moveQty>task.getPlanQty()-task.getMoveQty()){
if (moveQty > task.getPlanQty() - task.getMoveQty()) {
throw new BadRequestException("实际拣货数量不能大于待拣货数量!");
}
if (orderNumber.equals(task.getItemKey().getOrderNumber())) {
@ -437,10 +435,13 @@ public class BydAppServiceImpl implements BydAppService {
if (!inventoryList.isEmpty()) {
throw new BadRequestException(dstStock + "目标托盘已绑定其他出库单,请更换其它的托盘!");
}
pick.setStock(dstStock);
pick.setStock(dstStock.getCode());
pickService.update(pick);
} else if (!dstStockCode.equals(pick.getStock().getCode())) {
throw new BadRequestException(pick.getGdCode() + "工单只能放入同一个货架! 请放入" + pick.getStock().getCode() + "货架!");
}
if (BizStatus.XJ.equals(task.getItemKey().getItem().getGoodType())) {
if (!dstStockCode.equals(pick.getStock())) {
throw new BadRequestException(pick.getGdCode() + "工单只能放入同一个货架! 请放入" + pick.getCode() + "货架!");
}
}
return dstStock;
}

View File

@ -86,7 +86,7 @@ public class Item extends BaseEntity implements Serializable {
private String centerClass;
@Column(name = "`small_class`")
@ApiModelProperty(value = "小类")
@ApiModelProperty(value = "旧物料代码")
private String smallClass;
@Column(name = "`good_type`")

View File

@ -94,10 +94,9 @@ public class Pick extends BaseEntity implements Serializable {
@ApiModelProperty(value = "单据类型")
private String orderType;
@OneToOne
@JoinColumn(name = "`stock_id`")
@Column(name = "`stock_id`")
@ApiModelProperty(value = "容器")
private Stock stock;
private String stock;
@Column(name = "`source_id`")
@ApiModelProperty(value = "回传状态")

View File

@ -85,9 +85,7 @@ public interface TaskRepository extends JpaRepository<Task, Long>, JpaSpecificat
* @param taskStatus
* @param srcStockCode
*/
@Query(value = " from Task t WHERE t.srcStock.code=:srcStockCode " +
" and (:taskType is null or t.taskType=:taskType) " +
" and (:taskStatus is null or t.taskStatus=:taskStatus) order by t.itemKey.orderNumber ")
@Query(value = " (SELECT * FROM data_task t WHERE t.src_stock_code=:srcStockCode AND t.task_type=:taskType AND t.task_status =:taskStatus) UNION ALL (SELECT * FROM data_task t WHERE t.dst_point_code=:srcStockCode AND t.task_type=:taskType AND t.task_status =:taskStatus) ", nativeQuery = true)
List<Task> findTaskByContains(String taskType, String taskStatus, String srcStockCode);
/**

View File

@ -92,7 +92,7 @@ public class PickDto implements Serializable {
/**
*
*/
private Stock stock;
private String stock;
/**
*

View File

@ -144,14 +144,14 @@ public class MesServiceImpl implements MesService {
}
pick.setIsCall(true);
if (pick.getCallPoint()==null || pick.getCallPoint().length()<=0) {
if (pick.getCallPoint() == null || pick.getCallPoint().length() <= 0) {
pick.setCallPoint(pointCode);
}else if(!pointCode.equals(pick.getCallPoint())){
pick.setCallPoint(pick.getCallPoint()+","+pointCode);
} else if (!pointCode.equals(pick.getCallPoint())) {
pick.setCallPoint(pick.getCallPoint() + "," + pointCode);
}
pickRepository.save(pick);
taskService.callEmptyStock(point);
taskService.callJlTask(pick);
}
@Override
@ -173,14 +173,15 @@ public class MesServiceImpl implements MesService {
pick.setIsCall(true);
if (pick.getCallPoint()==null || pick.getCallPoint().length()<=0) {
if (pick.getCallPoint() == null || pick.getCallPoint().length() <= 0) {
pick.setCallPoint(pointCode);
}else if(!pointCode.equals(pick.getCallPoint())){
pick.setCallPoint(pick.getCallPoint()+","+pointCode);
} else if (!pointCode.equals(pick.getCallPoint())) {
pick.setCallPoint(pick.getCallPoint() + "," + pointCode);
}
pickRepository.save(pick);
taskService.callEmptyStock(point);
taskService.callJlTask(pick);
}
@Override
@ -199,6 +200,9 @@ public class MesServiceImpl implements MesService {
case BizStatus.Fx_Back:
moveFxBack(transTask);//返修载具送回
break;
case BizStatus.JL_Back:
moveJLBack(transTask);//叫料返空
break;
default:
throw new BadRequestException("任务类型错误!");
}
@ -409,4 +413,27 @@ public class MesServiceImpl implements MesService {
//任务放行
kmReService.sendAgvTaskToContainer(UrlApi.operationFeedback(), kmReService.operationFeedbackJson(agvTask));
}
private void moveJLBack(TransTask transTask) {
//起点
Point srcPoint = pointService.validatePoint(transTask.getPointCode());
String dstAreaCode = AreaNameDic.XJJLQ.equals(srcPoint.getArea().getName()) ? AreaNameDic.XJFBCQ : AreaNameDic.DJFBCQ;
List<Point> endPointList = pointService.queryPoints(null, BaseStatus.FREE, BaseStatus.BOX, dstAreaCode);
if (endPointList.isEmpty()) {
throw new BadRequestException(dstAreaCode.equals(AreaNameDic.XJFBCQ) ? "小件翻包存储区" : "大件翻包存储区" + "没有空闲点位!");
}
Point endPoint = endPointList.get(0);
// 验证终点是否有任务
if (!agvTaskService.findByEndSlotCode(endPoint.getCode(), BizStatus.CALL_RETURN, "RACK_MOVE")) {
throw new BadRequestException(endPoint.getCode() + "点位有任务,请稍后再试!");
}
// 生成任务
AgvTask agvTask = agvTaskService.createAgvTask(BizStatus.CALL_RETURN, null, srcPoint.getCode(), endPoint.getCode(), "RACK_MOVE");
}
}

View File

@ -307,17 +307,23 @@ public class TaskServiceImpl implements TaskService {
if (pick.getCallPoint() == null) {
throw new BadRequestException(pick.getGdCode() + "工单没有叫料请求!");
}
//绑定任务
List<Task> taskList = this.findByPickAllTask(pick.getId());
if (taskList.isEmpty()) {
throw new BadRequestException(pick.getGdCode() + "没有翻包拣货任务!");
}
//起点
Point srcPoint = pick.getStock().getPoint();
String[] stocks = pick.getStock().split(",");
String stockCode = stocks[stocks.length - 1];
Stock stock = stockService.validateStock(stockCode);
Point srcPoint = stock.getPoint();
//终点
String[] points = pick.getCallPoint().split(",");
String endPointCode = points[points.length - 1];
Point endPoint = pointService.queryPoint(endPointCode, null, null, null);
//容器
Stock stock = pick.getStock();
//创建任务
if (!agvTaskService.findByEndSlotCode(endPoint.getCode(), BizStatus.CALL_PICK, "RACK_MOVE")) {
throw new BadRequestException(endPoint.getCode() + "点位有任务,请稍后再试!");
@ -326,8 +332,6 @@ public class TaskServiceImpl implements TaskService {
agvTask.setLineSlotCode(pick.getCode());
agvTaskService.update(agvTask);
//绑定任务
List<Task> taskList = this.findByPickAllTask(pick.getId());
for (Task task : taskList) {
task.setCallAgvTaskId(agvTask.getId());
@ -339,11 +343,6 @@ public class TaskServiceImpl implements TaskService {
//终点占用
pointService.usedPoint(endPoint);
//更新出库单状态为叫料中
pick.setStatus(BizStatus.SHIP_PART);
pickService.update(pick);
}
@Override
@ -596,6 +595,15 @@ public class TaskServiceImpl implements TaskService {
pickDetail.setPickedQty(pickDetail.getPickedQty() + moveQty);
pickDetailService.update(pickDetail);
Pick pick = pickDetail.getPick();
if (pick.getStock() == null || pick.getStock().length() <= 0) {
pick.setStock(dstStock.getCode());
} else if (dstStock.getCode().equals(pick.getStock())) {
pick.setStock(pick.getStock() + "," + dstStock.getCode());
}
pickService.update(pick);
//容器占用
stockService.usedStock(dstStock, dstStock.getPoint(), BaseStatus.USED);

View File

@ -72,7 +72,10 @@ public class pickTask {
throw new BadRequestException("无已分配的出库单,下发任务失败!");
}
for (Pick pick : pickList) {
taskService.materialPick(pick);
synchronized (pick) {
taskService.materialPick(pick);
}
}
}
@ -87,7 +90,10 @@ public class pickTask {
throw new BadRequestException("无拣货完成的出库单或出库单未叫料!");
}
for (Pick pick : pickList) {
taskService.callJlTask(pick);
synchronized (pick) {
taskService.callJlTask(pick);
}
}
}

View File

@ -141,6 +141,11 @@ public interface BizStatus {
*/
String Fx_Back = "Fx_Back";
/**
* -
*/
String JL_Back = "JL_Back";
/**
* -
*/