fix:分切上料AGV也添加允许放货动作

This commit is contained in:
zhouz
2024-07-31 12:34:26 +08:00
parent cf91b0f94d
commit 66d23ee832
4 changed files with 46 additions and 1 deletions

View File

@@ -202,7 +202,7 @@ public class InBoxManageServiceImpl implements InBoxManageService {
BstIvtBoxinfo boxinfo = iBstIvtBoxinfoService.getOne( BstIvtBoxinfo boxinfo = iBstIvtBoxinfoService.getOne(
new QueryWrapper<BstIvtBoxinfo>().lambda() new QueryWrapper<BstIvtBoxinfo>().lambda()
.eq(BstIvtBoxinfo::getBox_no, boxNo)); .eq(BstIvtBoxinfo::getBox_no, boxNo));
if (ObjectUtil.isEmpty(boxinfo.getBox_weight()) || Integer.parseInt(boxinfo.getBox_weight()) == 0) { if (ObjectUtil.isEmpty(boxinfo.getBox_weight()) || Double.parseDouble(boxinfo.getBox_weight()) == 0) {
throw new BadRequestException("请先维护木箱重量后进行入库!"); throw new BadRequestException("请先维护木箱重量后进行入库!");
} }
if (StrUtil.isEmpty(boxType)) { if (StrUtil.isEmpty(boxType)) {

View File

@@ -59,4 +59,11 @@ public class FeedingController {
public ResponseEntity<Object> vehicleReturn(@RequestBody JSONObject whereJson) { public ResponseEntity<Object> vehicleReturn(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(feedingService.vehicleReturn(whereJson), HttpStatus.OK); return new ResponseEntity<>(feedingService.vehicleReturn(whereJson), HttpStatus.OK);
} }
@PostMapping("/AGVPass")
@Log("AGV放行")
public ResponseEntity<Object> AGVPass(@RequestBody JSONObject whereJson) {
return new ResponseEntity<>(feedingService.AGVPass(whereJson), HttpStatus.OK);
}
} }

View File

@@ -45,4 +45,7 @@ public interface FeedingService {
*/ */
JSONObject vehicleReturn(JSONObject whereJson); JSONObject vehicleReturn(JSONObject whereJson);
JSONObject AGVPass(JSONObject whereJson);
} }

View File

@@ -15,6 +15,7 @@ import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.core.content.HttpContext; import org.nl.modules.wql.core.content.HttpContext;
import org.nl.wms.basedata.st.service.impl.UserAreaServiceImpl; import org.nl.wms.basedata.st.service.impl.UserAreaServiceImpl;
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
import org.nl.wms.ext.mes.service.LmsToMesService; import org.nl.wms.ext.mes.service.LmsToMesService;
import org.nl.wms.pda.mps.eum.RegionTypeEnum; import org.nl.wms.pda.mps.eum.RegionTypeEnum;
import org.nl.wms.pda.mps.service.FeedingService; import org.nl.wms.pda.mps.service.FeedingService;
@@ -565,4 +566,38 @@ public class FeedingServiceImpl implements FeedingService {
result.put("message", "操作成功!"); result.put("message", "操作成功!");
return result; return result;
} }
@Override
public JSONObject AGVPass(JSONObject whereJson) {
String point_code = whereJson.getString("point_code");
if (ObjectUtil.isEmpty(point_code)) {
throw new BadRequestException("输入设备点位编码不能为空!");
}
JSONObject cut_jo = WQLObject.getWQLObject("st_ivt_cutpointivt").query("full_point_code = '" + point_code + "'").uniqueResult(0);
//查询该母卷号对应的任务
JSONObject task_jo = WQLObject.getWQLObject("SCH_BASE_Task").query("(point_code2 = '" + point_code + "' OR point_code1 = '" + point_code + "') and task_status <> '07' AND is_delete = '0'").uniqueResult(0);
if (ObjectUtil.isEmpty(task_jo)) {
throw new BadRequestException("输入设备点位编码不能为空!");
}
//下发ACS执行取满放空的AGV动作
JSONArray paramArr = new JSONArray();
JSONObject param = new JSONObject();
param.put("device_code", cut_jo.getString("point_code"));
param.put("task_code", task_jo.getString("task_code"));
param.put("product_area", cut_jo.getString("product_area"));
param.put("option", "1");
paramArr.add(param);
WmsToAcsServiceImpl wmsToAcsService = new WmsToAcsServiceImpl();
JSONObject result = wmsToAcsService.updateTask(paramArr);
if (!StrUtil.equals(result.getString("status"), "200")) {
throw new BadRequestException("操作失败:" + result.getString("message "));
}
JSONObject jo = new JSONObject();
jo.put("message", "操作成功!");
return jo;
}
} }