料架搬运任务处理
This commit is contained in:
@@ -2,6 +2,7 @@ package com.ruoyi.pda.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
@@ -24,6 +25,8 @@ import com.ruoyi.check.commit.domain.CheckCommitRecord;
|
||||
import com.ruoyi.check.commit.service.ICheckCommitRecordService;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.MessageUtils;
|
||||
import com.ruoyi.device.agv.domain.AgvContainerTask;
|
||||
import com.ruoyi.device.agv.service.IAgvContainerTaskService;
|
||||
import com.ruoyi.job.mydojob.domain.MydoJob;
|
||||
import com.ruoyi.job.mydojob.service.IMydoJobService;
|
||||
import com.ruoyi.job.mydojobdetail.domain.MydoJobDetail;
|
||||
@@ -106,6 +109,8 @@ public class PdaServiceImp implements PdaService {
|
||||
private IBasContainerService basContainerService;
|
||||
@Autowired
|
||||
private IToWcsService iToWcsService;
|
||||
@Autowired
|
||||
private IAgvContainerTaskService agvContainerTaskService;
|
||||
|
||||
/**
|
||||
* 空托盘入库
|
||||
@@ -299,12 +304,12 @@ public class PdaServiceImp implements PdaService {
|
||||
//修改拣选数量
|
||||
mydoJobDetail.setPickQuantity(mydoJobDetail.getOutQuantity());
|
||||
mydoJobDetailService.updateMydoJobDetail(mydoJobDetail);
|
||||
updateTagTaskStatus(mydoJobDetail,basWarehouse);
|
||||
updateTagTaskStatus(mydoJobDetail, basWarehouse);
|
||||
|
||||
//修改单据实际数量
|
||||
String inOrOutDId = mydoJobDetail.getInOrOutDId();
|
||||
OutStockoutDetail outStockoutDetail = outStockoutDetailService.selectOutStockoutDetailByStockoutDetailId(inOrOutDId);
|
||||
if (ObjUtil.isNotNull(outStockoutDetail)){
|
||||
if (ObjUtil.isNotNull(outStockoutDetail)) {
|
||||
outStockoutDetail.setAssignNum(outStockoutDetail.getAssignNum().add(Convert.toBigDecimal(mydoJobDetail.getPickQuantity())));
|
||||
outStockoutDetailService.updateOutStockoutDetail(outStockoutDetail);
|
||||
}
|
||||
@@ -326,7 +331,7 @@ public class PdaServiceImp implements PdaService {
|
||||
String result = map.get("v_result").toString();
|
||||
if ("10".equals(result)) {
|
||||
//通知wcs 出库确认
|
||||
deleteTagTask(trayCodeMakeSure, basWarehouse,mydoJob);
|
||||
deleteTagTask(trayCodeMakeSure, basWarehouse, mydoJob);
|
||||
return AjaxResult.success(map.get("v_resultmsg").toString());
|
||||
} else {
|
||||
throw new RuntimeException(map.get("v_resultmsg").toString());
|
||||
@@ -383,7 +388,7 @@ public class PdaServiceImp implements PdaService {
|
||||
//修改单据实际数量
|
||||
String inOrOutDId = mydoJobDetail.getInOrOutDId();
|
||||
OutStockoutDetail outStockoutDetail = outStockoutDetailService.selectOutStockoutDetailByStockoutDetailId(inOrOutDId);
|
||||
if (ObjUtil.isNotNull(outStockoutDetail)){
|
||||
if (ObjUtil.isNotNull(outStockoutDetail)) {
|
||||
outStockoutDetail.setAssignNum(outStockoutDetail.getAssignNum().add(Convert.toBigDecimal(mydoJobDetail.getPickQuantity())));
|
||||
outStockoutDetailService.updateOutStockoutDetail(outStockoutDetail);
|
||||
}
|
||||
@@ -400,7 +405,6 @@ public class PdaServiceImp implements PdaService {
|
||||
if (flag) {
|
||||
|
||||
|
||||
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
map.put("v_tray_code", trayCodeMakeSure.getTrayCode());
|
||||
map.put("v_type", "1");
|
||||
@@ -408,7 +412,7 @@ public class PdaServiceImp implements PdaService {
|
||||
iToWcsService.pushInMydoJob();
|
||||
String result = map.get("v_result").toString();
|
||||
if ("10".equals(result)) {
|
||||
deleteTagTask(trayCodeMakeSure, basWarehouse,mydoJob);
|
||||
deleteTagTask(trayCodeMakeSure, basWarehouse, mydoJob);
|
||||
return AjaxResult.success(map.get("v_resultmsg").toString());
|
||||
} else {
|
||||
throw new RuntimeException(map.get("v_resultmsg").toString());
|
||||
@@ -468,6 +472,7 @@ public class PdaServiceImp implements PdaService {
|
||||
|
||||
/**
|
||||
* 修改电子标签数量
|
||||
*
|
||||
* @param mydoJobDetail
|
||||
* @param basWarehouse
|
||||
*/
|
||||
@@ -491,8 +496,8 @@ public class PdaServiceImp implements PdaService {
|
||||
* @param trayCodeMakeSure
|
||||
* @param basWarehouse
|
||||
*/
|
||||
private void deleteTagTask(TrayCodeMakeSure trayCodeMakeSure, BasWarehouse basWarehouse,MydoJob mydoJob) {
|
||||
if ("2".equals(basWarehouse.getWarehouseType())&&"23".equals(mydoJob.getInOrOut())) {
|
||||
private void deleteTagTask(TrayCodeMakeSure trayCodeMakeSure, BasWarehouse basWarehouse, MydoJob mydoJob) {
|
||||
if ("2".equals(basWarehouse.getWarehouseType()) && "23".equals(mydoJob.getInOrOut())) {
|
||||
BasTag basTag = basTagService.selectBasTagByTrayCode(trayCodeMakeSure.getTrayCode());
|
||||
basTag.setTrayCode("");
|
||||
basTagService.updateBasTag(basTag);
|
||||
@@ -505,12 +510,12 @@ public class PdaServiceImp implements PdaService {
|
||||
.map(TagTask::getId)
|
||||
.toArray(Long[]::new));
|
||||
}
|
||||
if (mydoJob.getExitId().startsWith("fluent")){
|
||||
if (mydoJob.getExitId().startsWith("fluent")) {
|
||||
//通知wcs出库确认成功
|
||||
HashMap<String, String> outMydojobMakeSureParam = new HashMap<>();
|
||||
outMydojobMakeSureParam.put("trayCode", trayCodeMakeSure.getTrayCode());
|
||||
AjaxResult ajaxResult = iToWcsService.outMydojobMakeSure(outMydojobMakeSureParam);
|
||||
if (!ajaxResult.isSuccess()){
|
||||
if (!ajaxResult.isSuccess()) {
|
||||
throw new RuntimeException(ajaxResult.toString());
|
||||
}
|
||||
}
|
||||
@@ -627,17 +632,29 @@ public class PdaServiceImp implements PdaService {
|
||||
String startPoint = basContainer1.getPortName();
|
||||
//todo 调用agv搬运接口
|
||||
//使用HttpUtil post请求,参数为startPoint,endPoint,和containerCode
|
||||
String result = HttpUtil.post("http://192.168.1.100:8080/agv/api/receiveAgvMoveJob", "startPoint=" + startPoint + "&endPoint=" + endPoint + "&containerCode=" + basContainer.getContainerId());
|
||||
String taskNo = IdUtil.fastSimpleUUID();
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("startPoint", startPoint);
|
||||
map.put("endPoint", startPoint);
|
||||
map.put("wmsTrayCode", basContainer1.getContainerId());
|
||||
map.put("taskNo", taskNo);
|
||||
String result = HttpUtil.post("http://192.168.1.100:8080/agv/api/receiveAgvMoveJob", JSONUtil.toJsonStr( map));
|
||||
//接口的返回结果为AjaxResult,从result中获取code
|
||||
|
||||
//获取code
|
||||
int code = JSONObject.parseObject(result).getIntValue("code");
|
||||
if(code==200){
|
||||
return AjaxResult.success(result);
|
||||
}else{
|
||||
return AjaxResult.warn(JSONObject.parseObject(result).getString("msg"));
|
||||
}
|
||||
|
||||
//获取code
|
||||
int code = JSONObject.parseObject(result).getIntValue("code");
|
||||
if (code == 200) {
|
||||
AgvContainerTask agvContainerTask = new AgvContainerTask();
|
||||
agvContainerTask.setContainer(basContainer.getContainerId());
|
||||
agvContainerTask.setStartPoint(startPoint);
|
||||
agvContainerTask.setEndPoint(endPoint);
|
||||
agvContainerTask.setStatus("0");
|
||||
agvContainerTask.setTaskNo(taskNo);
|
||||
agvContainerTask.setCreateTime(new Date());
|
||||
agvContainerTaskService.insertAgvContainerTask(agvContainerTask);
|
||||
return AjaxResult.success(result);
|
||||
} else {
|
||||
return AjaxResult.warn(JSONObject.parseObject(result).getString("msg"));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -810,19 +827,19 @@ public class PdaServiceImp implements PdaService {
|
||||
BasContainerDetails basContainerDetails = new BasContainerDetails();
|
||||
basContainerDetails.setContainerId(startPoint);
|
||||
List<BasContainerDetails> basContainerDetails1 = basContainerDetailsService.selectBasContainerDetailsList(basContainerDetails);
|
||||
if(basContainerDetails1.size()==0){
|
||||
if (basContainerDetails1.size() == 0) {
|
||||
return AjaxResult.error("此起点无料架,请检查");
|
||||
}
|
||||
BasContainerDetails basContainer=basContainerDetails1.get(0);
|
||||
BasContainerDetails basContainer = basContainerDetails1.get(0);
|
||||
|
||||
String result = HttpUtil.post("http://192.168.1.100:8080/agv/api/receiveAgvMoveJob", "startPoint=" + startPoint + "&endPoint=" + endPoint + "&containerCode=" + basContainer.getContainerId());
|
||||
//接口的返回结果为AjaxResult,从result中获取code
|
||||
|
||||
//获取code
|
||||
int code = JSONObject.parseObject(result).getIntValue("code");
|
||||
if(code==200){
|
||||
if (code == 200) {
|
||||
return AjaxResult.success(result);
|
||||
}else{
|
||||
} else {
|
||||
return AjaxResult.warn(JSONObject.parseObject(result).getString("msg"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user