no message
parent
700b8cace2
commit
7c7eac0587
|
|
@ -628,16 +628,19 @@ public class StockServiceImpl implements StockService {
|
||||||
throw new RuntimeException(pick.getGdCode() + "请翻包拣货!");
|
throw new RuntimeException(pick.getGdCode() + "请翻包拣货!");
|
||||||
}
|
}
|
||||||
if (pick.getCallPoint() == null) {
|
if (pick.getCallPoint() == null) {
|
||||||
throw new RuntimeException(pick.getGdCode() + "叫料点位不能为空!");
|
throw new RuntimeException(pick.getGdCode() + "工单没有叫料请求!");
|
||||||
}
|
}
|
||||||
Point srcPoint = pick.getStock().getPoint();
|
Point srcPoint = pick.getStock().getPoint();
|
||||||
Point endPoint = pick.getCallPoint();
|
Point endPoint = pick.getCallPoint();
|
||||||
Stock stock = pick.getStock();
|
Stock stock = pick.getStock();
|
||||||
endPoint.setStatus(BaseStatus.USED);
|
|
||||||
pointRepository.save(endPoint);
|
|
||||||
AgvTask agvTask = new AgvTask(BizStatus.CALL_PICK, stock.getCode(), srcPoint.getCode(), endPoint.getCode(), BizStatus.OPEN, "RACK_MOVE");
|
AgvTask agvTask = new AgvTask(BizStatus.CALL_PICK, stock.getCode(), srcPoint.getCode(), endPoint.getCode(), BizStatus.OPEN, "RACK_MOVE");
|
||||||
|
agvTask.setLineSlotCode(pick.getCode());
|
||||||
agvTaskService.create(agvTask);
|
agvTaskService.create(agvTask);
|
||||||
agvTaskService.sendAgvTaskHJImpl(agvTask);
|
agvTaskService.sendAgvTaskHJImpl(agvTask);
|
||||||
|
srcPoint.setStatus(BaseStatus.USED);
|
||||||
|
pointRepository.save(srcPoint);
|
||||||
|
endPoint.setStatus(BaseStatus.USED);
|
||||||
|
pointRepository.save(endPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -705,6 +708,8 @@ public class StockServiceImpl implements StockService {
|
||||||
if (inventory.getQuantity() <= 0) {
|
if (inventory.getQuantity() <= 0) {
|
||||||
inventoryRepository.delete(inventory);
|
inventoryRepository.delete(inventory);
|
||||||
}
|
}
|
||||||
|
dstStock.setStatus(BaseStatus.USED);
|
||||||
|
stockRepository.save(dstStock);
|
||||||
//库存日志
|
//库存日志
|
||||||
inventoryLogService.storeInventoryLog(BizStatus.MOVE, BizStatus.ADD, task.getPickDetail().getPo(), task.getItemKey(), task.getDstPoint(), dstStock.getPoint(), task.getSrcStock(), dstStock, 0d, moveQty, BizStatus.PICK, task.getId(), newInventory.getId(), "");
|
inventoryLogService.storeInventoryLog(BizStatus.MOVE, BizStatus.ADD, task.getPickDetail().getPo(), task.getItemKey(), task.getDstPoint(), dstStock.getPoint(), task.getSrcStock(), dstStock, 0d, moveQty, BizStatus.PICK, task.getId(), newInventory.getId(), "");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ public class AgvTask extends BaseEntity implements Serializable {
|
||||||
private Integer beScan=0;
|
private Integer beScan=0;
|
||||||
|
|
||||||
@Column(name = "`line_slot_code`")
|
@Column(name = "`line_slot_code`")
|
||||||
@ApiModelProperty(value = "小件线边点位")
|
@ApiModelProperty(value = "出库单号")
|
||||||
private String lineSlotCode;
|
private String lineSlotCode;
|
||||||
|
|
||||||
@Column(name = "`job_message_time`")
|
@Column(name = "`job_message_time`")
|
||||||
|
|
|
||||||
|
|
@ -41,4 +41,7 @@ public interface PickRepository extends JpaRepository<Pick, Long>, JpaSpecificat
|
||||||
|
|
||||||
@Query(value = " from PickDetail pd WHERE pd.pick.id=:pickId ")
|
@Query(value = " from PickDetail pd WHERE pd.pick.id=:pickId ")
|
||||||
List<PickDetail> queryPickDetail(Long pickId);
|
List<PickDetail> queryPickDetail(Long pickId);
|
||||||
|
|
||||||
|
@Query(value = " from Pick p WHERE p.code=:code ")
|
||||||
|
Pick findByPickCode(String code);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,9 @@ public class AgvTaskDto implements Serializable {
|
||||||
/** 是否扫描 */
|
/** 是否扫描 */
|
||||||
private Integer beScan=0;
|
private Integer beScan=0;
|
||||||
|
|
||||||
|
/** 出库单号 */
|
||||||
|
private String lineSlotCode;
|
||||||
|
|
||||||
/** 变动时间 */
|
/** 变动时间 */
|
||||||
private Timestamp jobMessageTime;
|
private Timestamp jobMessageTime;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import com.youchain.basicdata.repository.StockRepository;
|
||||||
import com.youchain.basicdata.service.PointService;
|
import com.youchain.basicdata.service.PointService;
|
||||||
import com.youchain.businessdata.domain.*;
|
import com.youchain.businessdata.domain.*;
|
||||||
import com.youchain.businessdata.repository.InventoryRepository;
|
import com.youchain.businessdata.repository.InventoryRepository;
|
||||||
|
import com.youchain.businessdata.repository.PickRepository;
|
||||||
import com.youchain.businessdata.repository.TaskRepository;
|
import com.youchain.businessdata.repository.TaskRepository;
|
||||||
import com.youchain.businessdata.service.*;
|
import com.youchain.businessdata.service.*;
|
||||||
import com.youchain.modules.quartz.utils.TimeNumberUtils;
|
import com.youchain.modules.quartz.utils.TimeNumberUtils;
|
||||||
|
|
@ -66,7 +67,7 @@ public class AgvTaskServiceImpl implements AgvTaskService {
|
||||||
private final PointService pointService;
|
private final PointService pointService;
|
||||||
private final AsnDetailService asnDetailService;
|
private final AsnDetailService asnDetailService;
|
||||||
private final StockRepository stockRepository;
|
private final StockRepository stockRepository;
|
||||||
|
private final PickRepository pickRepository;
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> queryAll(AgvTaskQueryCriteria criteria, Pageable pageable) {
|
public Map<String, Object> queryAll(AgvTaskQueryCriteria criteria, Pageable pageable) {
|
||||||
Page<AgvTask> page = agvTaskRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable);
|
Page<AgvTask> page = agvTaskRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable);
|
||||||
|
|
@ -440,7 +441,7 @@ public class AgvTaskServiceImpl implements AgvTaskService {
|
||||||
handleFBQ(taskList, stock, endPoint);//备料完成
|
handleFBQ(taskList, stock, endPoint);//备料完成
|
||||||
break;
|
break;
|
||||||
case AreaNameDic.JLQ:
|
case AreaNameDic.JLQ:
|
||||||
handleJL(stock, endPoint);//叫料完成
|
handleJL(stock, endPoint,agvTask);//叫料完成
|
||||||
break;
|
break;
|
||||||
case AreaNameDic.CPXXQ:
|
case AreaNameDic.CPXXQ:
|
||||||
case AreaNameDic.CPRKQ:
|
case AreaNameDic.CPRKQ:
|
||||||
|
|
@ -490,6 +491,7 @@ public class AgvTaskServiceImpl implements AgvTaskService {
|
||||||
newAgvTask.setType(agvTask.getType());
|
newAgvTask.setType(agvTask.getType());
|
||||||
newAgvTask.setJobType(agvTask.getJobType());
|
newAgvTask.setJobType(agvTask.getJobType());
|
||||||
newAgvTask.setJobPriority(1);
|
newAgvTask.setJobPriority(1);
|
||||||
|
newAgvTask.setLineSlotCode(agvTask.getLineSlotCode());
|
||||||
agvTaskRepository.save(newAgvTask);
|
agvTaskRepository.save(newAgvTask);
|
||||||
|
|
||||||
//重新发送任务
|
//重新发送任务
|
||||||
|
|
@ -583,7 +585,7 @@ public class AgvTaskServiceImpl implements AgvTaskService {
|
||||||
*
|
*
|
||||||
* @param stock
|
* @param stock
|
||||||
*/
|
*/
|
||||||
private void handleJL(Stock stock, Point endPoint) {
|
private void handleJL(Stock stock, Point endPoint,AgvTask agvTask) {
|
||||||
List<Inventory> inventoryList = inventoryService.queryInventory(stock);
|
List<Inventory> inventoryList = inventoryService.queryInventory(stock);
|
||||||
if (!inventoryList.isEmpty()) {
|
if (!inventoryList.isEmpty()) {
|
||||||
inventoryService.deleteAll(inventoryList.stream().map(Inventory::getId).toArray(Long[]::new));
|
inventoryService.deleteAll(inventoryList.stream().map(Inventory::getId).toArray(Long[]::new));
|
||||||
|
|
@ -592,6 +594,16 @@ public class AgvTaskServiceImpl implements AgvTaskService {
|
||||||
stockRepository.save(stock);
|
stockRepository.save(stock);
|
||||||
endPoint.setStatus(BaseStatus.USED);
|
endPoint.setStatus(BaseStatus.USED);
|
||||||
pointService.update(endPoint);
|
pointService.update(endPoint);
|
||||||
|
|
||||||
|
Pick pick=pickRepository.findByPickCode(agvTask.getLineSlotCode());
|
||||||
|
if(pick!=null){
|
||||||
|
pick.setStatus(BizStatus.CLOSE);
|
||||||
|
pickRepository.save(pick);
|
||||||
|
}
|
||||||
|
|
||||||
|
//回传MES
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue