Merge remote-tracking branch 'origin/master'

This commit is contained in:
2024-03-28 09:54:56 +08:00
17 changed files with 169 additions and 74 deletions

View File

@@ -357,6 +357,38 @@ public class XianGongAgvServiceImpl implements XianGongAgvService {
jo.put("script_args", script_args);
ja.add(jo);
}
JSONObject jo3 = new JSONObject();
//动作块id
jo3.put("blockId", IdUtil.simpleUUID());
//目的地名称
jo3.put("location", pointCode + "INGET");
jo3.put("id", pointCode + "INGET");
//执行脚本
jo3.put("operation", "expand");
//通信脚本,动作前后与现场设备交互的场景
jo3.put("script_name", "Fork-expand.py");
JSONObject script_args = new JSONObject();
script_args.put("expandWidth", 0.2);
script_args.put("operation", "expand");
jo3.put("script_args", script_args);
ja.add(jo3);
JSONObject jo4 = new JSONObject();
//动作块id
jo4.put("blockId", IdUtil.simpleUUID());
//目的地名称
jo4.put("location", pointCode + "INGET");
jo4.put("id", pointCode + "INGET");
//执行脚本
jo4.put("operation", "stretch");
//通信脚本,动作前后与现场设备交互的场景
jo4.put("script_name", "Fork-expand.py");
JSONObject script_args1 = new JSONObject();
script_args1.put("expandWidth", 0.2);
script_args1.put("operation", "stretch");
jo4.put("script_args", script_args1);
ja.add(jo4);
//将货物顶起来,机器识别提升高度
JSONObject jo1 = new JSONObject();
jo1.put("blockId", IdUtil.simpleUUID());

View File

@@ -86,7 +86,7 @@ public class TwoNDCSocketConnectionAutoRun extends AbstractAutoRunnable {
DeviceExecuteLogService logServer = SpringContextHolder.getBean(DeviceExecuteLogService.class);
try {
System.out.println("2楼1区域AGV系统链接开始");
log.info("2楼1区域AGV系统链接开始");
ip = paramService.findByCode(AcsConfig.AGVURL).getValue();
port = Integer.parseInt(paramService.findByCode(AcsConfig.AGVPORT).getValue());
// byte[] b = new byte[1024];

View File

@@ -84,7 +84,11 @@ public class StandardAutodoorDeviceDriver extends AbstractOpcDeviceDriver implem
Map<String, Object> itemMap = new HashMap<String, Object>();
itemMap.put(to_param, Integer.parseInt(value));
this.control(itemMap);
try {
this.checkcontrol(itemMap);
} catch (Exception e) {
e.printStackTrace();
}
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号设备号:" + device_code + ",下发电气:" + to_param + ",下发电气值:" + value);
}

View File

@@ -236,7 +236,6 @@ public class BeltConveyorDeviceDriver extends AbstractOpcDeviceDriver implements
if (mode != last_mode) {
requireSucess = false;
}

View File

@@ -22,6 +22,7 @@ import org.nl.acs.device_driver.FeedLmsRealFailed;
import org.nl.acs.device_driver.RouteableDeviceDriver;
import org.nl.acs.device_driver.driver.AbstractOpcDeviceDriver;
import org.nl.acs.device_driver.driver.ExecutableDeviceDriver;
import org.nl.acs.device_driver.led.led_screen.LedScreenDeviceDriver;
import org.nl.acs.enums.StorageTypeEnum;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.history.ErrorUtil;
@@ -41,6 +42,8 @@ import org.nl.acs.task.enums.TaskStatusEnum;
import org.nl.acs.task.enums.TaskTypeEnum;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.acs.taskscreen.service.TaskScreenService;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
import org.nl.config.SpringContextHolder;
import org.nl.config.language.LangProcess;
@@ -80,6 +83,8 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogService.class);
ISysParamService paramService = SpringContextHolder.getBean(ISysParamService.class);
TaskScreenService taskScreenService = SpringContextHolder.getBean(TaskScreenService.class);
//工作模式
int mode = 0;
int last_mode = 0;
@@ -227,8 +232,24 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
}
if(move !=last_move){
if (ObjectUtil.isNotEmpty(inst)){
Thread.sleep(10000);
led_message = clearMessage();
if (move==0){
Thread.sleep(10000);
led_message = clearMessage();
List<String> deviceCodes = this.getExtraDeviceCodes("link_device_code");
String device = null;
if (ObjectUtil.isNotEmpty(deviceCodes)) {
for (String deviceCode : deviceCodes) {
Device linkDevice = deviceAppService.findDeviceByCode(deviceCode);
if (ObjectUtil.isEmpty(linkDevice)) {
throw new BadRequestException("设备:" + device_code + "关联设备->" + deviceCode + "为空!");
}
if (linkDevice.getDeviceDriver() instanceof LedScreenDeviceDriver){
device = deviceCode;
}
}
}
taskScreenService.getLedMessage(device);
}
}
requireSucess = false;
}
@@ -499,6 +520,20 @@ public class ConveyorWithScannerWeightDeviceDriver extends AbstractOpcDeviceDriv
list.add(map3);
this.writing(list);
led_message = getLedMessage(instdto);
List<String> deviceCodes = this.getExtraDeviceCodes("link_device_code");
String device = null;
if (ObjectUtil.isNotEmpty(deviceCodes)) {
for (String deviceCode : deviceCodes) {
Device linkDevice = deviceAppService.findDeviceByCode(deviceCode);
if (ObjectUtil.isEmpty(linkDevice)) {
throw new BadRequestException("设备:" + device_code + "关联设备->" + deviceCode + "为空!");
}
if (linkDevice.getDeviceDriver() instanceof LedScreenDeviceDriver){
device = deviceCode;
}
}
}
taskScreenService.getLedMessage(device);
requireSucess = true;
while (!StrUtil.equals(this.getOpcValueAccessor().getValue(this.getOpcServer() + "." + this.getOpcPlc() + "." + this.getDevice_code() + ".task").toString()
, instdto.getInstruction_code())) {

View File

@@ -414,23 +414,23 @@ public class ItemProtocol {
list.add(new ItemDto(item_heartbeat, "心跳", "DB101.BO"));
list.add(new ItemDto(item_deviceCode, "堆垛机号", "DB101.B1"));
list.add(new ItemDto(item_mode, "工作模式", "DB101.B2"));
list.add(new ItemDto(item_command, "作业状态", "DB101.B3"));
list.add(new ItemDto(item_task, "任务号", "DB101.D4"));
list.add(new ItemDto(item_error, "Y轴报警(载货台)", "DB101.B8"));
list.add(new ItemDto(item_z, "行走排号", "DB101.B9"));
list.add(new ItemDto(item_x, "行走列号", "DB101.B10"));
list.add(new ItemDto(item_y, "行走层号", "DB101.B11"));
list.add(new ItemDto(item_move, "行走开关信号", "DB101.B12"));
list.add(new ItemDto(item_cargoMove, "载货台开关信号", "DB101.B13"));
list.add(new ItemDto(item_action, "行走动作信号", "DB101.B14"));
list.add(new ItemDto(item_command, "作业状态", "DB101.B31"));
list.add(new ItemDto(item_task, "任务号", "DB101.D32"));
list.add(new ItemDto(item_error, "Y轴报警(载货台)", "DB101.B36"));
list.add(new ItemDto(item_z, "行走排号", "DB101.B38"));
list.add(new ItemDto(item_x, "行走列号", "DB101.B39"));
list.add(new ItemDto(item_y, "行走层号", "DB101.B40"));
list.add(new ItemDto(item_move, "行走开关信号", "DB101.B4"));
list.add(new ItemDto(item_cargoMove, "载货台开关信号", "DB101.B41"));
list.add(new ItemDto(item_action, "行走动作信号", "DB101.B5"));
list.add(new ItemDto(item_distancex, "行走激光数值", "DB101.D16"));
list.add(new ItemDto(item_distancey, "起升激光数值", "DB101.D20"));
list.add(new ItemDto(item_cargoError, "载货台超限信号", "DB101.B24"));
list.add(new ItemDto(item_forkCargo, "货叉探货信号", "DB101.B25"));
list.add(new ItemDto(item_forkLocation, "货叉位置信号", "DB101.B26"));
list.add(new ItemDto(item_forkAction, "货叉动作信号", "DB101.B27"));
list.add(new ItemDto(item_special1, "特殊开关量1", "DB101.B28"));
list.add(new ItemDto(item_special2, "特殊开关量2", "DB101.B29"));
list.add(new ItemDto(item_distancey, "起升激光数值", "DB101.D44"));
list.add(new ItemDto(item_cargoError, "载货台超限信号", "DB101.B43"));
list.add(new ItemDto(item_forkCargo, "货叉探货信号", "DB101.B48"));
list.add(new ItemDto(item_forkLocation, "货叉位置信号", "DB101.B49"));
list.add(new ItemDto(item_forkAction, "货叉动作信号", "DB101.B50"));
list.add(new ItemDto(item_special1, "特殊开关量1", "DB101.B10"));
list.add(new ItemDto(item_special2, "特殊开关量2", "DB101.B11"));
list.add(new ItemDto(item_trayCode, "托盘条码", "DB101.B30.20"));
list.add(new ItemDto(item_storage_cache, "水箱和消防缓存位有无货", "DB101.B50"));
list.add(new ItemDto(item_stacker_rpm, "速度(转/分钟)", "DB101.W52"));
@@ -454,10 +454,10 @@ public class ItemProtocol {
list.add(new ItemDto(item_to_device_code, "堆垛机号", "DB100.B1"));
list.add(new ItemDto(item_to_command, "作业命令", "DB100.B2"));
list.add(new ItemDto(item_to_type, "物料类型", "DB100.B3"));
list.add(new ItemDto(item_to_task, "任务号", "DB100.D4"));
list.add(new ItemDto(item_to_z, "作业排", "DB100.B8"));
list.add(new ItemDto(item_to_x, "作业列", "DB100.B9"));
list.add(new ItemDto(item_to_y, "作业层", "DB100.B10"));
list.add(new ItemDto(item_to_task, "任务号", "DB100.D10"));
list.add(new ItemDto(item_to_z, "作业排", "DB100.B6"));
list.add(new ItemDto(item_to_x, "作业列", "DB100.B7"));
list.add(new ItemDto(item_to_y, "作业层", "DB100.B8"));
list.add(new ItemDto(item_to_trayCode, "托盘号", "DB100.B11.20"));
return list;
}

View File

@@ -322,6 +322,10 @@ public class StandardStackerDeviceDriver extends AbstractOpcDeviceDriver impleme
trayCode = this.itemProtocol.getItem_trayCode();
storage_cache = this.itemProtocol.getItem_storage_cache();
if (!command.equals(last_command)){
requireSucess=false;
}
// 更新指令状态
if (mode == 3 && task > 0) {

View File

@@ -43,7 +43,7 @@ public class HongXiangConveyorDefination implements OpcDeviceDriverDefination {
@Override
public List<DeviceType> getFitDeviceTypes() {
List<DeviceType> types = new LinkedList();
types.add(DeviceType.station);
types.add(DeviceType.conveyor);
return types;
}

View File

@@ -407,15 +407,22 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
luceneExecuteLogService.deviceExecuteLog(logDto);
List list = new ArrayList<>();
Map map = new HashMap();
map.put("to_onset", start_addr);
map.put("to_target", next_addr);
map.put("to_task", instruction.getInstruction_code());
map.put("to_command", "1");
try {
this.writing(map);
} catch (Exception e) {
e.printStackTrace();
}
map.put("code", "to_onset");
map.put("value", StrUtil.isNotBlank(start_addr) ? start_addr : "0");
Map map1 = new HashMap();
map1.put("code", "to_target");
map1.put("value", StrUtil.isNotBlank(next_addr) ? next_addr : "0");
Map map2 = new HashMap();
map2.put("code", "to_task");
map2.put("value", instruction.getInstruction_code());
Map map3 = new HashMap();
map3.put("code", "to_command");
map3.put("value", "1");
list.add(map);
list.add(map1);
list.add(map2);
list.add(map3);
this.writing(list);
if (startdevice.getDeviceDriver() instanceof HongXiangConveyorDeviceDriver) {
hongXiangConveyorDeviceDriver = (HongXiangConveyorDeviceDriver) startdevice.getDeviceDriver();
hongXiangConveyorDeviceDriver.writing("to_open_door", "1");
@@ -777,6 +784,7 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
} else {
this.instruction_update_time = date;
ArrayList list = new ArrayList();
Map map = new HashMap();
//更改任务状态
if (task > 0) {
@@ -807,8 +815,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
int move = hongXiangConveyorDeviceDriver.getMove();
if (mode == 1 && door == 1 && action == 1 && error1 == 0 && move == 1) {
if (this.getNow_steps_type() == 2) {
ArrayList list = new ArrayList();
map.put("to_command", "2");
map.put("code", "to_command");
map.put("value", "2");
list.add(map);
this.writing(list);
this.setNow_steps_type(3);
@@ -835,8 +843,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
} else {
if (this.getNow_steps_type() == 2) {
ArrayList list = new ArrayList();
map.put("to_command", "2");
map.put("code", "to_command");
map.put("value", "2");
list.add(map);
this.writing(list);
this.setNow_steps_type(3);
@@ -874,8 +882,8 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
hongXiangConveyorDeviceDriver.writing(map);
}
if (this.getNow_steps_type() == 3) {
ArrayList list = new ArrayList();
map.put("to_command", "3");
map.put("code", "to_command");
map.put("value", "3");
list.add(map);
this.writing(list);
this.setNow_steps_type(4);
@@ -915,8 +923,10 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
int move = hongXiangConveyorDeviceDriver.getMove();
if (mode == 1 && door == 1 && action == 1 && error1 == 0 && move == 0) {
if (this.getNow_steps_type() == 4) {
map.put("to_command", "4");
this.writing(map);
map.put("code", "to_command");
map.put("value", "4");
list.add(map);
this.writing(list);
this.setNow_steps_type(5);
} else {
feedMessage = "未反馈电气信号原因:当前步骤不为允许放货now_steps_type=4";
@@ -943,8 +953,10 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
} else {
if (this.getNow_steps_type() == 4) {
map.put("to_command", "4");
this.writing(map);
map.put("code", "to_command");
map.put("value", "4");
list.add(map);
this.writing(list);
this.setNow_steps_type(5);
}
}
@@ -1013,8 +1025,10 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
}
}
map.put("to_command", "5");
this.writing(map);
map.put("code", "to_command");
map.put("value", "5");
list.add(map);
this.writing(list);
this.setNow_steps_type(6);
this.setNow_steps_type(0);
try {
@@ -1152,6 +1166,11 @@ public class OvenGantryManipulatorDeviceDriver extends AbstractOpcDeviceDriver i
itemMap.put(to_param, json.getString("value"));
}
}
LuceneLogDto logDto = LuceneLogDto.builder()
.device_code(device_code)
.content("下发电气信号:" + itemMap)
.build();
luceneExecuteLogService.deviceExecuteLog(logDto);
logServer.deviceExecuteLog(device_code, "", "", "下发电气信号:" + itemMap);
try {
this.checkcontrol(itemMap);

View File

@@ -360,15 +360,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String type = "";
if (result2.getStatus() == 200) {
if (ObjectUtil.isNotEmpty(result2) && result2.getStatus() == 200) {
type = "info";
JSONObject jo = JSONObject.parseObject(result2.body());
log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString());
return result2;
} else {
type = "error";
}
JSONObject jo = JSONObject.parseObject(result2.body());
log.info("feedbackTaskStatusToWms-----输出参数{}", jo.toString());
return result2;
return null;
} finally {
MDC.remove(log_file_type);
}

View File

@@ -46,11 +46,15 @@ public class TaskScreenServiceImpl extends CommonServiceImpl<TaskScreenMapper, D
private final DeviceService deviceService;
@Override
public void autoInitial() throws Exception {
}
@Override
public JSONArray selectLedList() {
List<Device> list = new LambdaQueryChainWrapper<Device>(deviceMapper)
@@ -90,7 +94,7 @@ public class TaskScreenServiceImpl extends CommonServiceImpl<TaskScreenMapper, D
if (device.getDeviceDriver() instanceof ConveyorWithScannerWeightDeviceDriver) {
conveyorWithScannerWeightDeviceDriver = (ConveyorWithScannerWeightDeviceDriver) device.getDeviceDriver();
if (ObjectUtil.isNotEmpty(conveyorWithScannerWeightDeviceDriver.getLed_message())) {
json = conveyorWithScannerWeightDeviceDriver.getLed_message();
json = conveyorWithScannerWeightDeviceDriver.getLed_message();
}
}
return json;

View File

@@ -27,20 +27,11 @@ public class SecurityUtils {
JSONObject json = (JSONObject) StpUtil.getExtra("loginInfo");
if (ObjectUtil.isNotEmpty(json)) {
return json.toBean(CurrentUser.class);
} else {
CurrentUser currentUser = new CurrentUser();
currentUser.setId("2");
currentUser.setPresonName("LMS系统用户");
currentUser.setUsername("LMS");
return currentUser;
}
} catch (Exception e) {
CurrentUser currentUser = new CurrentUser();
currentUser.setId("2");
currentUser.setPresonName("LMS系统用户");
currentUser.setUsername("LMS");
return currentUser;
return new CurrentUser();
}
return null;
}
/**

View File

@@ -50,7 +50,6 @@ public class AutoCreateInst {
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class);
RouteLineService routeLineService = SpringContextHolder.getBean(RouteLineService.class);
DeviceAppService appService = SpringContextHolder.getBean(DeviceAppServiceImpl.class);
LimitRegionalService limitRegionalService = SpringContextHolder.getBean(LimitRegionalService.class);
LuceneExecuteLogService luceneExecuteLogService = SpringContextHolder.getBean(LuceneExecuteLogServiceImpl.class);
List<TaskDto> list = taskserver.queryAllByStatus("0");
for (int i = 0; i < list.size(); i++) {
@@ -101,7 +100,7 @@ public class AutoCreateInst {
continue;
}
if (!StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE) && !StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.TWO)) {
if (!StrUtil.equals(shortPathsList.get(0).getType(), CommonFinalParam.ONE)) {
continue;
}

View File

@@ -152,7 +152,8 @@ export default {
// 定时器
const timer = setInterval(() => {
this.settime()// 你所加载数据的方法
}, 1000)
this.getMessage()
}, 10000)
// 销毁定时器
this.$once('hook:beforeDestroy', () => {
clearInterval(timer)
@@ -183,6 +184,11 @@ export default {
this.initStatus()
}, 10000)
},
getMessage() {
deviceCrud.getLedMessage(this.device).then(data => {
this.form = data
})
},
settime() {
const _this = this
const yy = new Date().getFullYear()

View File

@@ -5432,12 +5432,14 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
// 判断单据是否是完成状态:只回传完成状态的单据
if (jsonMst.getString("bill_status").equals("99")) {
JSONArray jsonArr = new JSONArray();
jsonArr.add(jsonMst);
if (!jsonMst.getString("upload_sap").equals("1")) {
JSONArray jsonArr = new JSONArray();
jsonArr.add(jsonMst);
JSONObject param = new JSONObject();
param.put("rows", jsonArr);
inAndOutReturnService.uploadSAP(param);
JSONObject param = new JSONObject();
param.put("rows", jsonArr);
inAndOutReturnService.uploadSAP(param);
}
}
}

View File

@@ -179,7 +179,7 @@
<el-form-item prop="checked">
<el-checkbox v-model="checked">是否异常出库</el-checkbox>
</el-form-item>
<el-form-item label="超期发货('否'为正常库发货):" prop="is_overdue">
<el-form-item label="超期发货('否'为正常库发货):" prop="is_overdue">
<el-radio v-model="rowmst.is_overdue" label="1" :disabled="rowmst.bill_status === '40'" @change="updataIsOverdue"></el-radio>
<el-radio v-model="rowmst.is_overdue" label="0" :disabled="rowmst.bill_status === '40'" @change="updataIsOverdue"></el-radio>
</el-form-item>

View File

@@ -319,7 +319,7 @@
<el-table-column show-overflow-tooltip label="交货单号" align="center" prop="vbeln" width="100" />
<el-table-column show-overflow-tooltip label="是否回传" align="center" prop="is_upload" width="80" :formatter="formatIsUpload" />
<el-table-column show-overflow-tooltip :formatter="create_modeFormat" prop="create_mode" label="生成方式" width="100" />
<el-table-column show-overflow-tooltip :formatter="isOverdue" prop="is_overdue" label="是否超期发货('否'为正常库发货)" width="120" />
<el-table-column show-overflow-tooltip :formatter="isOverdue" prop="is_overdue" label="是否超期发货('否'为正常库发货)" width="220" />
<el-table-column show-overflow-tooltip label="备注" align="center" prop="remark" width="100" />
<el-table-column show-overflow-tooltip label="制单人" align="center" prop="input_optname" />
<el-table-column show-overflow-tooltip label="制单时间" align="center" prop="input_time" width="140" />