后续问题提交
This commit is contained in:
@@ -18,8 +18,9 @@ public class PressureUtil {
|
||||
int qty = (int) whereJson.get("qty");
|
||||
String record_id = "";
|
||||
//根据设备查询当前设备以及排产单号
|
||||
JSONObject joo = WQL.getWO("QSTRUCT_RULE").addParam("flag", "1").addParam("point_code", device_code).process().uniqueResult(0);
|
||||
JSONObject joo = WQL.getWO("QSTRUCT_RULE").addParam("flag", "12").addParam("point_code", device_code).process().uniqueResult(0);
|
||||
String producetask_id = joo.getString("producetask_id");
|
||||
String device_id = joo.getString("device_id");
|
||||
if (StrUtil.isEmpty(producetask_id)) {
|
||||
throw new BadRequestException("为找到生产任务!");
|
||||
}
|
||||
|
||||
@@ -53,6 +53,10 @@ public class StructFindUtil {
|
||||
if (StrUtil.isEmpty(workprocedure_id)) {
|
||||
throw new BadRequestException("工序不能为空!");
|
||||
}
|
||||
//is_full 传过来的参数如果是2 ,则代表半托,满托都可以出
|
||||
if (StrUtil.equals(is_full, "2")) {
|
||||
is_full = "";
|
||||
}
|
||||
JSONObject result = WQL.getWO("QSTRUCT_RULE").addParam("flag", "3")
|
||||
.addParam("material_id", material_id).addParam("area_type", area_type)
|
||||
.addParam("is_full", is_full).addParam("workprocedure_id", workprocedure_id)
|
||||
|
||||
@@ -114,8 +114,8 @@ public class AcsToWmsController {
|
||||
@PostMapping("/agv")
|
||||
@Log("ACS给WMS反馈任务状态")
|
||||
@ApiOperation("ACS给WMS反馈任务状态")
|
||||
public ResponseEntity<Object> receiveAgvStatus(@RequestBody Map whereJson ) {
|
||||
return new ResponseEntity<>(acsToWmsService.receiveAgvStatus( whereJson), HttpStatus.OK);
|
||||
public ResponseEntity<Object> receiveAgvStatus(@RequestBody JSONArray arr ) {
|
||||
return new ResponseEntity<>(acsToWmsService.receiveAgvStatus( arr), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryCribbingInfo")
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.nl.wms.ext.acs.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface AcsToWmsService {
|
||||
@@ -108,7 +110,7 @@ public interface AcsToWmsService {
|
||||
* @param string 条件 物料条码
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> receiveAgvStatus(Map jsonObject);
|
||||
Map<String, Object> receiveAgvStatus(JSONArray arr);
|
||||
/**
|
||||
* 获取垛形参数
|
||||
* @return Map<String, Object>
|
||||
|
||||
@@ -142,26 +142,30 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
sendMaterialTask.createTask((JSONObject) JSON.toJSON(jsonObject));
|
||||
//假如是压制下料的几个位置 需要记录不合格数量
|
||||
if (StrUtil.equals(area_type, AreaEnum.YZQY.getCode())) {
|
||||
/* JSONObject joo = new JSONObject();
|
||||
joo.put("qty", "qty");
|
||||
JSONObject joo = new JSONObject();
|
||||
joo.put("qty", jsonObject.get("unqualified_qty"));
|
||||
joo.put("device_code", device_code);
|
||||
joo.put("reason", "reason");
|
||||
String record_id = PressureUtil.record(joo);
|
||||
//回传不合格记录
|
||||
WmsToJnServiceImpl wmsToJnService = new WmsToJnServiceImpl();
|
||||
wmsToJnService.feedBackQualityInfo(record_id);*/
|
||||
wmsToJnService.feedBackQualityInfo(record_id);
|
||||
}
|
||||
break;
|
||||
case "2":
|
||||
//叫料出库
|
||||
jsonObject.put("next_point_code", device_code);
|
||||
jsonObject.put("create_mode", "01");
|
||||
//机械手1 is_full给1 ,机械手3is_full给空,半托,跟满托都可以出
|
||||
if(StrUtil.equals(device_code,"FJJXSSLW101")||StrUtil.equals(device_code,"FJJXSSLW102")){
|
||||
is_full ="1";
|
||||
}
|
||||
if (StrUtil.equals(device_code,"FJJXSSLW301")||StrUtil.equals(device_code,"FJJXSSLW302")){
|
||||
is_full ="2";
|
||||
}
|
||||
jsonObject.put("is_full", is_full);
|
||||
produceInfoByCode = this.getProduceInfoByCode(device_code);
|
||||
//批次 物料,客户要从排产单里面去取
|
||||
jsonObject.put("pcsn", "pcsn");
|
||||
jsonObject.put("material_id", "1515940603542769664");
|
||||
jsonObject.put("cust_id", "1516368197694132224");
|
||||
jsonObject.put("material_id", produceInfoByCode.getString("material_id"));
|
||||
callMaterialTask.createTask((JSONObject) JSON.toJSON(jsonObject));
|
||||
break;
|
||||
|
||||
@@ -261,6 +265,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
throw new BadRequestException("设备点位不能为空!");
|
||||
}
|
||||
JSONObject produceInfoByCode = new JSONObject();
|
||||
String is_full = (String)jsonObject.get("is_full");
|
||||
String vehicle_code = (String) jsonObject.get("vehicle_code");
|
||||
String qty = String.valueOf(jsonObject.get("qty"));
|
||||
//String material_code = (String) jsonObject.get("material_code");
|
||||
@@ -340,6 +345,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
groubObj.put("create_id", SecurityUtils.getCurrentUserId());
|
||||
groubObj.put("create_name", SecurityUtils.getNickName());
|
||||
groubObj.put("create_time", DateUtil.now());
|
||||
groubObj.put("is_full", is_full);
|
||||
//去自动码垛还是人工码垛从物料信息里面去取
|
||||
groubObj.put("is_autopackage", materialObj.getString("is_auto_package"));
|
||||
//假如是分拣机械手,并且托盘为空,则托盘从点位上取
|
||||
@@ -712,14 +718,35 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> receiveAgvStatus(Map jsonObject) {
|
||||
public Map<String, Object> receiveAgvStatus(JSONArray arr) {
|
||||
WQLObject deviceStatus_table = WQLObject.getWQLObject("st_buss_deviceStatus");
|
||||
String agv_no = (String) jsonObject.get("agv_no");
|
||||
String status = (String) jsonObject.get("status");
|
||||
JSONObject statsObj = deviceStatus_table.query("device_type ='1' and device_code ='" + agv_no + "'").uniqueResult(0);
|
||||
statsObj.put("device_status", status);
|
||||
statsObj.put("update_time", DateUtil.now());
|
||||
deviceStatus_table.update(statsObj);
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject jo = arr.getJSONObject(i);
|
||||
String agv_no = jo.getString("device_code");
|
||||
String status = jo.getString("status");
|
||||
String device_status = "";
|
||||
// 1-搬运中 2-充电 3-等待 4-故障 5-停用
|
||||
if (StrUtil.equals(status, "EXECUTING")) {
|
||||
device_status = "1";
|
||||
}
|
||||
if (StrUtil.equals(status, "CHARGING")) {
|
||||
device_status = "2";
|
||||
}
|
||||
if (StrUtil.equals(status, "IDLE")) {
|
||||
device_status = "3";
|
||||
}
|
||||
if (StrUtil.equals(status, "ERROR")) {
|
||||
device_status = "4";
|
||||
}
|
||||
if (StrUtil.equals(status, "UNKNOWN") || StrUtil.equals("UNAVAILABLE", status)) {
|
||||
device_status = "5";
|
||||
}
|
||||
JSONObject statsObj = deviceStatus_table.query("device_type ='1' and device_code ='" + agv_no + "'").uniqueResult(0);
|
||||
statsObj.put("device_status", device_status);
|
||||
statsObj.put("update_time", DateUtil.now());
|
||||
deviceStatus_table.update(statsObj);
|
||||
}
|
||||
|
||||
JSONObject result = new JSONObject();
|
||||
result.put("status", HttpStatus.OK.value());
|
||||
result.put("message", "任务状态反馈成功!");
|
||||
@@ -746,15 +773,11 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
//从组盘表里面去获取
|
||||
result = group_table.query("vehicle_code = '" + vehicle_code + "'").uniqueResult(0);
|
||||
}
|
||||
JSONObject returnjo = new JSONObject();
|
||||
returnjo.put("status", HttpStatus.OK.value());
|
||||
returnjo.put("message", "任务状态反馈成功!");
|
||||
returnjo.put("data", result);
|
||||
return returnjo;
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
private JSONObject getProduceInfoByCode(String code) {
|
||||
public static JSONObject getProduceInfoByCode(String code) {
|
||||
//根据 设备点位去找生产任务信息
|
||||
//1 根据点位去找设备,去找对应的设备信息
|
||||
JSONObject pointObj = WQLObject.getWQLObject("sch_base_point").query("point_code ='" + code + "'").uniqueResult(0);
|
||||
|
||||
@@ -24,8 +24,8 @@ import java.util.Map;
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "手持托盘入窑贵州")
|
||||
@RequestMapping("/api/pda/ruleSetting")
|
||||
@Api(tags = "手持人工出库")
|
||||
@RequestMapping("/api/pda/outStruct")
|
||||
@Slf4j
|
||||
public class CheckOutController {
|
||||
|
||||
|
||||
@@ -433,3 +433,18 @@ IF 输入.flag = "17"
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "18"
|
||||
QUERY
|
||||
SELECT
|
||||
vehiclegroup.is_full,
|
||||
vehiclegroup.vehicle_code
|
||||
FROM
|
||||
st_buss_vehiclegroup vehiclegroup
|
||||
WHERE
|
||||
1 =1
|
||||
OPTION 输入.vehicle_code <> ""
|
||||
st_buss_vehiclegroup.vehicle_code = 输入.vehicle_code
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
|
||||
package org.nl.wms.pda.vehicleStatus.rest;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.annotation.Log;
|
||||
import org.nl.wms.pda.vehicleStatus.service.VehicleStatusService;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author ldjun
|
||||
* @date 2021-07-26
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "手")
|
||||
@RequestMapping("/api/pda/vehicleStatus")
|
||||
@Slf4j
|
||||
public class VehicleStatusController {
|
||||
|
||||
private final VehicleStatusService vehicleStatusService;
|
||||
|
||||
@PostMapping("/queryInfoBycode")
|
||||
@Log("根据托盘号查询是否满托")
|
||||
@ApiOperation("根据托盘号查询是否满托")
|
||||
public ResponseEntity<Object> queryInfoBycode(@RequestBody Map<String, String> param) {
|
||||
return new ResponseEntity<>(vehicleStatusService.queryInfoBycode(param), HttpStatus.OK);
|
||||
}
|
||||
@PostMapping("/confirm")
|
||||
@Log("状态修改确定")
|
||||
@ApiOperation("状态修改确定")
|
||||
public ResponseEntity<Object> Confirm(@RequestBody JSONObject param) {
|
||||
return new ResponseEntity<>(vehicleStatusService.Confirm(param), HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package org.nl.wms.pda.vehicleStatus.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface VehicleStatusService {
|
||||
Map<String, Object> queryInfoBycode(Map<String,String> jsonObject);
|
||||
/**
|
||||
* 盘点单确认
|
||||
* @param param 条件
|
||||
* @return Map<String,Object>
|
||||
*
|
||||
*/
|
||||
Map<String, Object> Confirm( JSONObject param);
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package org.nl.wms.pda.vehicleStatus.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.wms.WorkProcedureEnum;
|
||||
import org.nl.wms.pda.vehicleStatus.service.VehicleStatusService;
|
||||
import org.nl.wms.sch.manage.AreaEnum;
|
||||
import org.nl.wms.sch.manage.BillTypeEnum;
|
||||
import org.nl.wms.st.ivt.IvtChangeTypeEnum;
|
||||
import org.nl.wms.st.ivt.StoreIvtServiceImpl;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class VehicleStatusServiceImpl implements VehicleStatusService {
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryInfoBycode(Map<String, String> jsonObject) {
|
||||
String vehicle_code = jsonObject.get("vehicle_code");
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("托盘号不能为空!");
|
||||
}
|
||||
JSONObject resutl = WQL.getWO("QPADSERVICE").addParam("flag", "18").process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(resutl)) {
|
||||
throw new BadRequestException("未找到托盘编码为'" + vehicle_code + "'的托盘信息!");
|
||||
}
|
||||
JSONObject returnjo = new JSONObject();
|
||||
returnjo.put("code", "1");
|
||||
returnjo.put("desc", "查询成功!");
|
||||
returnjo.put("result", resutl);
|
||||
return returnjo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> Confirm(JSONObject param) {
|
||||
String vehicle_code = param.getString("vehicle_code");
|
||||
String is_full = param.getString("is_full");
|
||||
if (StrUtil.isEmpty(vehicle_code)) {
|
||||
throw new BadRequestException("托盘号不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(is_full)) {
|
||||
throw new BadRequestException("是否满托不能为空!");
|
||||
}
|
||||
JSONObject ivtObj = WQLObject.getWQLObject("st_ivt_structivt").query("vehicle_code ='" + vehicle_code + "'").uniqueResult(0);
|
||||
JSONObject groupObj = WQLObject.getWQLObject("st_buss_vehiclegroup").query("vehicle_code ='" + vehicle_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(ivtObj)) {
|
||||
ivtObj.put("is_full", is_full);
|
||||
WQLObject.getWQLObject("st_ivt_structivt").update(ivtObj);
|
||||
}
|
||||
if (ObjectUtil.isEmpty(groupObj)) {
|
||||
groupObj.put("is_full", is_full);
|
||||
WQLObject.getWQLObject("st_buss_vehiclegroup").update(groupObj);
|
||||
}
|
||||
JSONObject returnjo = new JSONObject();
|
||||
returnjo.put("code", "1");
|
||||
returnjo.put("desc", "操作成功!");
|
||||
return returnjo;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -204,7 +204,6 @@ public class CallMaterialTask extends AbstractAcsTask {
|
||||
String vehicle_code = form.getString("vehicle_code");
|
||||
String task_status = TaskStatusEnum.SURE_START.getCode();
|
||||
String material_id = form.getString("material_id");
|
||||
String cust_id = form.getString("cust_id");
|
||||
String create_mode = form.getString("create_mode");
|
||||
String pcsn = form.getString("pcsn");
|
||||
String is_full = form.getString("is_full");
|
||||
@@ -343,7 +342,6 @@ public class CallMaterialTask extends AbstractAcsTask {
|
||||
iosObj.put("end_point_code", next_point_code);
|
||||
iosObj.put("start_area", startArea_type);
|
||||
iosObj.put("end_area", nextPoint.getArea_type());
|
||||
iosObj.put("cust_id", cust_id);
|
||||
iosObj.put("create_mode", create_mode);
|
||||
iosObj.put("task_id", task_id);
|
||||
iosObj.put("pcsn", pcsn);
|
||||
|
||||
@@ -8,6 +8,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.ext.acs.service.impl.WmsToAcsServiceImpl;
|
||||
import org.nl.wms.ext.acs.service.impl.WmsToJnServiceImpl;
|
||||
import org.nl.wms.sch.manage.buss.CallMaterialTask;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
@@ -31,6 +32,7 @@ public class AutoSynchronDeviceStausTask {
|
||||
//1 同步压机设备状态
|
||||
this.SynchronDevice();
|
||||
//2 反馈给嘉耐
|
||||
this.feedBackStatustojn();
|
||||
}
|
||||
|
||||
private void SynchronDevice() {
|
||||
@@ -43,27 +45,30 @@ public class AutoSynchronDeviceStausTask {
|
||||
JSONObject devicejo = pointarr.getJSONObject(i);
|
||||
String point_code = devicejo.getString("device_code");
|
||||
//根据点位去找设备
|
||||
String device_code = WQL.getWO("ACSTOMES_001").addParam("flag", "6").addParam("point_code",point_code).process().uniqueResult(0).getString("device_code");
|
||||
String device_code = WQL.getWO("ACSTOMES_001").addParam("flag", "6").addParam("point_code", point_code).process().uniqueResult(0).getString("device_code");
|
||||
JSONObject recordObj = recordTabele.query("device_code='" + device_code + "'").uniqueResult(0);
|
||||
int mode = devicejo.getIntValue("mode");
|
||||
int error = devicejo.getIntValue("error");
|
||||
String device_status = "";
|
||||
//2空闲,3工作中,4等待搬运 5缺料请求
|
||||
if (mode==2){
|
||||
device_status="3";
|
||||
//2空闲,3工作中,4等待搬运 5缺料请求 0 关机()
|
||||
if (mode == 2) {
|
||||
device_status = "3";
|
||||
}
|
||||
if (mode==3){
|
||||
device_status="1";
|
||||
if (mode == 3) {
|
||||
device_status = "1";
|
||||
}
|
||||
if (mode==4){
|
||||
device_status="2";
|
||||
if (mode == 4) {
|
||||
device_status = "2";
|
||||
}
|
||||
if (mode==5){
|
||||
device_status="5";
|
||||
if (mode == 5) {
|
||||
device_status = "5";
|
||||
}
|
||||
if (mode == 0) {
|
||||
device_status = "6";
|
||||
}
|
||||
|
||||
if (error >0){
|
||||
device_status="4";
|
||||
if (error > 0) {
|
||||
device_status = "4";
|
||||
}
|
||||
recordObj.put("device_status", device_status);
|
||||
recordObj.put("update_time", DateUtil.now());
|
||||
@@ -73,6 +78,11 @@ public class AutoSynchronDeviceStausTask {
|
||||
|
||||
}
|
||||
|
||||
private void feedBackStatustojn() {
|
||||
WmsToJnServiceImpl wmsToJnService = new WmsToJnServiceImpl();
|
||||
wmsToJnService.feedBackStatus(new JSONObject());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user