diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceExtraServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceExtraServiceImpl.java index a10e60086..b1c1c55f5 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceExtraServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceExtraServiceImpl.java @@ -4,6 +4,7 @@ package org.nl.acs.device.service.impl; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; @@ -20,6 +21,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.math.BigDecimal; +import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java index 70aaa7f98..251b24381 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device/service/impl/DeviceServiceImpl.java @@ -741,7 +741,6 @@ public class DeviceServiceImpl implements DeviceService, ApplicationAutoInitial } else if (device.getDeviceDriver() instanceof StandardInspectSiteDeviceDriver) { standardInspectSiteDeviceDriver = (StandardInspectSiteDeviceDriver) device.getDeviceDriver(); standardInspectSiteDeviceDriver.setDeviceStatus(form); - } else if (device.getDeviceDriver() instanceof SlitTwoManipulatorDeviceDriver) { slitTwoManipulatorDeviceDriver = (SlitTwoManipulatorDeviceDriver) device.getDeviceDriver(); slitTwoManipulatorDeviceDriver.setDeviceStatus(form); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java index cc8a64896..f116b9a93 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/casing_station/CasingStationConveyorDeviceDriver.java @@ -125,7 +125,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i //请求成功标记 Boolean requireSucess = false; - String message = null; + String message = ""; String device_code; String remark = ""; @@ -138,7 +138,6 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i @Override public void execute() { try { - String message = null; device_code = this.getDeviceCode(); heartbeat = this.itemProtocol.getHeartbeat(); mode = this.itemProtocol.getMode(); @@ -150,7 +149,6 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i material1 = this.itemProtocol.getMaterial1(); material2 = this.itemProtocol.getMaterial2(); qty = this.itemProtocol.getQty(); - to_command = this.itemProtocol.getTo_command(); @@ -198,7 +196,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i acsToWmsService.sendDeviceStatus(param); requireSucess = false; logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess); - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); + // logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); } if (move != last_move) { logServer.deviceItemValue(this.device_code, "move", String.valueOf(move)); @@ -228,9 +226,6 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i } else { this.setIsonline(true); this.setIserror(false); - message = ""; - Instruction instruction = null; - List toInstructions; //纸管库申请任务 switch (mode) { case 1: @@ -248,23 +243,22 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i case 5: if (move == 1 && !requireSucess && task > 0 && task1 > 0) { //申请套管校验 -// apply_for_casing_inspection(material1, material2); bushingSucess(); } else if (move != 1) { - remark = "套管工位没有货"; + message = "套管工位没有货"; } else if (task < 1) { - remark = "纸管库的任务号为空"; + message = "纸管库的任务号为空"; } else if (task1 < 1) { - remark = "行架任务为空"; + message = "行架任务为空"; } else { - remark = "requrieSucess 为: " + requireSucess; + message = "requrieSucess 为: " + requireSucess; } break; case 6: if (move == 0 && !requireSucess) { sucess(); - }else if (move != 0){ - remark = "套管工位有货"; + } else if (move != 0) { + message = "套管工位有货"; } default: log.info("未知模式"); @@ -284,26 +278,42 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i last_qty = qty; } - //取货完成 + /** + * 取货完成 + */ private void sucess() { - ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); - Instruction inst1 = instructionService.findByCode(String.valueOf(task)); - String task_code = inst1.getTask_code(); - applyManipulatorActionRequest.setAction("1"); - applyManipulatorActionRequest.setTask_code1(task_code); - logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈套管工位取货完成"); - ApplyManipulatorActionResponse applyManipulatorActionResponse1 = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest); - if (applyManipulatorActionResponse1.getstatus() == 200) { - logServer.deviceExecuteLog(this.device_code, "", "", "套管工位取货请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1)); - Map map = new LinkedHashMap<>(); - map.put("to_command", 6); - this.writing(map); - message = "套管工位取货完成"; - requireSucess = true; + Date date = new Date(); + if (date.getTime() - this.instruction_update_time.getTime() < (long) this.instruction_update_time_out) { + log.trace("触发时间因为小于{}毫秒,而被无视", this.instruction_update_time_out); } else { - requireSucess = false; - message = "套管工位取货失败"; - //logServer.deviceExecuteLog(this.device_code, "", "", "缓存库取货失败,返回参数:" + applyManipulatorActionResponse1); + ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); + Instruction inst1 = instructionService.findByCode(String.valueOf(task1)); + if (ObjectUtil.isNotEmpty(inst1)) { + String task_code = inst1.getTask_code(); + if (Long.parseLong(task_code) < 1) { + message = "任务ACS创建,不反馈LMS取货完成"; + return; + } + applyManipulatorActionRequest.setAction("1"); + applyManipulatorActionRequest.setTask_code1(task_code); + logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈套管工位取货完成"); + ApplyManipulatorActionResponse applyManipulatorActionResponse1 = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest); + if (applyManipulatorActionResponse1.getstatus() == 200) { + logServer.deviceExecuteLog(this.device_code, "", "", "套管工位取货请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1)); + Map map = new LinkedHashMap<>(); + map.put("to_command", 6); + this.writing(map); + message = "套管工位取货完成"; + requireSucess = true; + } else { + requireSucess = false; + message = "套管工位取货失败"; + //logServer.deviceExecuteLog(this.device_code, "", "", "缓存库取货失败,返回参数:" + applyManipulatorActionResponse1); + } + } else { + requireSucess = false; + message = "行架任务号不存在"; + } } } @@ -315,6 +325,10 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i Instruction inst2 = instructionService.findByCode(String.valueOf(task1)); String task_code1 = inst1.getTask_code(); String task_code2 = inst2.getTask_code(); + if (Long.parseLong(task_code1) < 1 && Long.parseLong(task_code2) < 1) { + message = "任务ACS创建,不反馈LMS套轴完成"; + return; + } applyManipulatorActionRequest.setDevice_code(device_code); applyManipulatorActionRequest.setTask_code1(task_code2); applyManipulatorActionRequest.setTask_code2(task_code1); @@ -471,7 +485,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i jo.put("material1", material1); jo.put("material2", material2); jo.put("isOnline", this.getIsonline()); - jo.put("message", ObjectUtil.isNotEmpty(remark) ? "反馈套管失败的原因:" + remark : remark); + jo.put("message", message); return jo; } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java index 1c3baedc4..796ed4278 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/indoor_manipulator/IndoorManipulatorDeviceDriver.java @@ -160,6 +160,8 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple //暂定 0就绪 1请求取货 2取货完成 3请求放货 4放货完成 5取货完成离开 6放货完成离开 7请求进入区域 8请求离开区域 int flag; + //1点对点 6下卷拔轴 7换轴 8 放轴 + String truss_type; String device_code; @@ -172,6 +174,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple String notCreateInstMessage = ""; String feedMessage = ""; + Integer task_count = 0; List getDeviceCodeList = null; @@ -426,18 +429,21 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple inst1.setInstruction_status("1"); inst1.setExecute_device_code(this.device_code); instructionService.update(inst1); + } } } - //反馈尺寸 if (mode == 3 && action == 2) { String task_code = inst1.getTask_code(); + if(Long.parseLong(task_code) < 1){ + message = "任务ACS创建,不反馈LMS尺寸"; + return; + } applyManipulatorActionRequest.setType("2"); applyManipulatorActionRequest.setTask_code1(task_code); applyManipulatorActionRequest.setSize(String.valueOf(inflatable_shaft_size)); - logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈尺寸"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { feedbackSucess = true; @@ -448,17 +454,19 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple this.writing(map); } else { feedbackSucess = false; - message = "完成反馈LMS失败," + String.valueOf(applyManipulatorActionResponse); - //logServer.deviceExecuteLog(this.device_code, "", "", "反馈尺寸成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + message = "反馈LMS尺寸失败"; } } //申请放货点 - if (mode == 3 && action == 3) { + if (mode == 3 && action == 3 ) { String task_code = inst1.getTask_code(); + if(Long.parseLong(task_code) < 1){ + message = "任务ACS创建,不向LMS申请放货点"; + return; + } applyManipulatorActionRequest.setType("3"); applyManipulatorActionRequest.setTask_code1(task_code); - logServer.deviceExecuteLog(this.device_code, "", "", "开始申请放货点"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { logServer.deviceExecuteLog(this.device_code, "", "", "申请放货点请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); @@ -475,17 +483,19 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple message = "申请新取货点成功"; } else { feedbackSucess = false; - message = "申请放货点LMS失败," + String.valueOf(applyManipulatorActionResponse.getMessage()); - //logServer.deviceExecuteLog(this.device_code, "", "", "申请放货点请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); + message = "申请放货点LMS失败"; } } //申请新取货点 if (mode == 3 && action == 4) { String task_code = inst1.getTask_code(); + if(Long.parseLong(task_code) < 1){ + message = "任务ACS创建,不向LMS申请新取货点"; + return; + } applyManipulatorActionRequest.setType("4"); applyManipulatorActionRequest.setTask_code1(task_code); - logServer.deviceExecuteLog(this.device_code, "", "", "开始申请取货点"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { String get_device_code = applyManipulatorActionResponse.getDevice_code(); @@ -494,7 +504,6 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple Map map = new LinkedHashMap<>(); map.put("to_command", 4); map.put("inflatableShaftVersion", applyManipulatorActionResponse.getVersion()); - map.put("to_new_getpoint", Integer.parseInt(to_new_getpoint)); this.writing(map); feedbackSucess = true; @@ -503,16 +512,18 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } else { feedbackSucess = false; message = "申请新取货点失败"; - //logServer.deviceExecuteLog(this.device_code, "", "", "申请新取货点失败,返回参数:" + applyManipulatorActionResponse); } } //申请二次放货点 if (mode == 3 && action == 5) { String task_code = inst1.getTask_code(); + if(Long.parseLong(task_code) < 1){ + message = "任务ACS创建,不反馈LMS"; + return; + } applyManipulatorActionRequest.setType("5"); applyManipulatorActionRequest.setTask_code1(task_code); - logServer.deviceExecuteLog(this.device_code, "", "", "申请二次放货点"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse.getstatus() == 200) { String put_device_code2 = applyManipulatorActionResponse.getDevice_code(); @@ -530,16 +541,18 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } else { feedbackSucess = false; message = "申请二次放货点失败"; - //logServer.deviceExecuteLog(this.device_code, "", "", "申请二次放货点,返回参数:" + applyManipulatorActionResponse); } } //缓存库取货完成 if (mode == 3 && action == 6) { String task_code = inst1.getTask_code(); + if(Long.parseLong(task_code) < 1){ + message = "任务ACS创建,不反馈LMS缓存库取货成功"; + return; + } applyManipulatorActionRequest.setAction("1"); applyManipulatorActionRequest.setTask_code1(task_code); - logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈缓存库取货完成"); ApplyManipulatorActionResponse applyManipulatorActionResponse1 = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse1.getstatus() == 200) { logServer.deviceExecuteLog(this.device_code, "", "", "缓存库取货请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1)); @@ -551,16 +564,18 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } else { feedbackSucess = false; message = "缓存库取货失败"; - //logServer.deviceExecuteLog(this.device_code, "", "", "缓存库取货失败,返回参数:" + applyManipulatorActionResponse1); } } //缓存库放货完成 if (mode == 3 && action == 7) { String task_code = inst1.getTask_code(); + if(Long.parseLong(task_code) < 1){ + message = "任务ACS创建,不反馈LMS缓存库放货完成"; + return; + } applyManipulatorActionRequest.setAction("2"); applyManipulatorActionRequest.setTask_code1(task_code); - logServer.deviceExecuteLog(this.device_code, "", "", "开始反馈缓存库放货完成"); ApplyManipulatorActionResponse applyManipulatorActionResponse1 = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest); if (applyManipulatorActionResponse1.getstatus() == 200) { logServer.deviceExecuteLog(this.device_code, "", "", "缓存库放货完成,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse1)); @@ -572,7 +587,6 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } else { feedbackSucess = false; message = "缓存库放货失败"; - //logServer.deviceExecuteLog(this.device_code, "", "", "缓存库放货完成,返回参数:" + applyManipulatorActionResponse1); } } } @@ -593,31 +607,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } catch (Exception e) { message = "取消任务或指令失败,失败原因"+ e.getMessage(); feedbackSucess = false; - //logServer.deviceExecuteLog(this.device_code, "", "", "取消任务或指令失败,失败原因"+e.getMessage()); } - /*String task_code = inst1.getTask_code(); - applyManipulatorActionRequest.setType("9"); - applyManipulatorActionRequest.setTask_code1(task_code); - logServer.deviceExecuteLog(this.device_code, "", "", "异常反馈"); - applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - if (ObjectUtil.isNotEmpty(applyManipulatorActionResponse) && applyManipulatorActionResponse.getstatus() == 200) { - logServer.deviceExecuteLog(this.device_code, "", "", "异常反馈完成,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); - Map map = new LinkedHashMap<>(); - map.put("to_command", 9); - this.writing(map); - feedbackSucess = true; - message = "缓存库放货成功"; - try { - instructionService.cancel(inst1.getInstruction_id()); - logServer.deviceExecuteLog(this.device_code, "", "", "取消指令完成"); - TaskDto byTaskCode = taskserver.findByTaskCode(inst1.getTask_code()); - taskserver.cancel(byTaskCode.getTask_id()); - logServer.deviceExecuteLog(this.device_code, "", "", "取消任务完成"); - } catch (Exception e) { - message = "取消任务或指令失败,失败原因"+ e.getMessage(); - logServer.deviceExecuteLog(this.device_code, "", "", "取消任务或指令失败,失败原因"+e.getMessage()); - } - }*/ } @@ -626,7 +616,6 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple if (inst1 != null) { try { feedbackSucess = true; - logServer.deviceExecuteLog(this.device_code, "", "", "放货完成"); finish_instruction(inst1); Map map = new LinkedHashMap<>(); map.put("to_command", 8); @@ -763,6 +752,18 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } else if (this.getAction() == 8) { action = "任务完成"; } + String type = ""; + if("1".equals(this.truss_type)){ + type = "点对点任务"; + }else if("6".equals(this.truss_type)){ + type = "下卷拔轴任务"; + }else if("7".equals(this.truss_type)){ + type = "换轴任务"; + }else if("8".equals(this.truss_type)){ + type = "放轴任务"; + }else if("9".equals(this.truss_type)){ + type = "异常气胀轴任务"; + } jo.put("device_name", this.getDevice().getDevice_name()); jo.put("mode", mode); @@ -780,6 +781,8 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple jo.put("inflatable_shaft_size", this.inflatable_shaft_size); jo.put("version", this.inflatableShaftVersion); jo.put("driver_type", "station"); + jo.put("notCreateInstMessage", notCreateInstMessage); + jo.put("truss_type", type); return jo; } @@ -835,6 +838,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple //按照优先级排序 优先级相等按照创建时间排序 taskDtos = this.sortTask(taskDtos); TaskDto taskDto = taskDtos.get(0); + truss_type = taskDto.getTruss_type(); //存在行架->暂存的AGV任务 需要过滤 // 9 行架任务 if (!StrUtil.equals(taskDto.getTask_type(), "9")) { @@ -892,11 +896,11 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple logServer.deviceExecuteLog(this.device_code, "", "", "RGV条件满足,允许创建指令,任务号为:" + task.getTask_code()); break; } else { + message = "任务号为:" + task.getTask_code() + "的RGV条件不满足,不允许允许创建指令"; task = null; - logServer.deviceExecuteLog(this.device_code, "", "", "RGV条件不满足,不允许允许创建指令,任务号为:" + task); + // logServer.deviceExecuteLog(this.device_code, "", "", "RGV条件不满足,不允许允许创建指令,任务号为:" + task); continue; } - } // 9 行架任务 if (ObjectUtil.isNotEmpty(task) && !StrUtil.equals(task.getTask_type(), "9")) { @@ -909,6 +913,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple } } if (!ObjectUtil.isEmpty(task)) { + truss_type = task.getTruss_type(); Device nextdevice = deviceAppService.findDeviceByCode(task.getNext_device_code()); Device startdevice = deviceAppService.findDeviceByCode(task.getStart_device_code()); SiemensConveyorDeviceDriver siemensConveyorDeviceDriver; @@ -1000,6 +1005,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple notCreateTaskMessage = ""; } else { notCreateInstMessage = "未找到关联设备的任务,指令无法创建"; + return false; } return true; } @@ -1024,19 +1030,19 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple rgv2.getMode() + "rgv1的move2" + rgv1.getMove2() + "rgv2的move2" + rgv2.getMove2());*/ return true; } else { - message = "rgv信号不符合"; + notCreateInstMessage = "rgv信号不符合"; //logServer.deviceExecuteLog(device_code, "", "", "rgv信号不符合"); } } else { - message = "关联的站点不是rgv"; + notCreateInstMessage = "关联的站点不是rgv"; //logServer.deviceExecuteLog(device_code, "", "", "关联的站点不是rgv"); } } else { - message = "rgv没有关联站点"; + notCreateInstMessage = "rgv没有关联站点"; //logServer.deviceExecuteLog(device_code, "", "", "rgv没有关联站点"); } } else { - message = "rgv不是普通站点"; + notCreateInstMessage = "rgv不是普通站点"; //logServer.deviceExecuteLog(device_code, "", "", "rgv不是普通站点"); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java index 494afa193..2f19d50a5 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/plugging_unplugging_machine/PluggingUnpluggingMachineDeviceDriver.java @@ -173,6 +173,10 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv ApplyManipulatorActionResponse applyManipulatorActionResponse; Instruction inst1 = instructionService.findByCode(String.valueOf(task1)); String task_code1 = inst1.getTask_code(); + if (Long.parseLong(task_code1) < 1) { + message = "任务ACS创建,不向LMS反馈拔轴状态"; + return; + } applyManipulatorActionRequest.setTask_code1(task_code1); applyManipulatorActionRequest.setType("8"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); @@ -232,6 +236,10 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv Instruction inst1 = instructionService.findByCode(String.valueOf(task1)); // Instruction inst2 = instructionService.findByCode(String.valueOf(task2)); String task_code1 = inst1.getTask_code(); + if (Long.parseLong(task_code1) < 1) { + message = "任务ACS创建,不向LMS申请套轴"; + return; + } // String task_code2 = inst2.getTask_code(); applyManipulatorActionRequest.setDevice_code(device_code); applyManipulatorActionRequest.setTask_code1(task_code1); @@ -264,6 +272,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv } } + public boolean exe_error() { if (this.error == 0) { return true; diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java index b331764ac..72970469e 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/rgv/RgvDeviceDriver.java @@ -288,6 +288,7 @@ public class RgvDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDr jo.put("move2", move2); jo.put("isOnline", this.getIsonline()); jo.put("isError", this.getIserror()); + jo.put("task", this.getTask()); jo.put("qty1", this.getQty1()); jo.put("qty2", this.getQty2()); jo.put("message", this.getMessage()); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java index 16264fe90..a6c827882 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/siemens_conveyor/SiemensConveyorDeviceDriver.java @@ -469,13 +469,13 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme applyManipulatorActionRequest.setTask_code1(inst.getTask_code()); logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,参数:" + applyManipulatorActionRequest); try { - for (int i = 0; i < 20; i++) { + for (int i = 0; i < 5; i++) { ApplyManipulatorActionResponse response = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest); if (response == null || response.getstatus() == 200) { logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,接口返回:" + response.getMessage()); break; } else { - logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS失败" + response.getMessage()); + message = "task变化请求LMS失败: " + response.getMessage(); Thread.sleep(5000); } } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java index efd0adc43..716b49076 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/basedriver/slit_two_manipulator/SlitTwoManipulatorDeviceDriver.java @@ -11,7 +11,9 @@ import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.acs.device.device_driver.standard_inspect.ReadUtil; +import org.nl.acs.device.service.DeviceExtraService; import org.nl.acs.device.service.DeviceService; +import org.nl.acs.device.service.impl.DeviceExtraServiceImpl; import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.FeedLmsRealFailed; import org.nl.acs.device_driver.RouteableDeviceDriver; @@ -62,7 +64,6 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl AcsToWmsService acsToWmsService = SpringContextHolder.getBean("acsToWmsServiceImpl"); @Autowired DeviceAppService deviceAppservice = SpringContextHolder.getBean(DeviceAppServiceImpl.class); - DeviceExecuteLogService logServer = SpringContextHolder.getBean("deviceExecuteLogServiceImpl"); @Autowired DeviceErrorLogService deviceErrorLogService = SpringContextHolder.getBean(DeviceErrorLogServiceImpl.class); @@ -359,9 +360,7 @@ public class SlitTwoManipulatorDeviceDriver extends AbstractOpcDeviceDriver impl //申请任务 if (mode == 2 && move1 == 0 && move2 == 0 && action1 == 0 && action2 == 0 && task1 == 0 && task2 == 0 && !requireSucess) { apply_task(); - } else { - if (!requireSucess) { String remark = ""; if (mode != 2) { diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java index 9bd423925..7bca1d530 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/task/service/impl/TaskServiceImpl.java @@ -344,8 +344,8 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { continue; } if ((task.getStart_device_code().equals(start_device_code) - || task.getStart_device_code2().equals(start_device_code)) - && StrUtil.equals(task.getTask_status(), "0")) { + || (StrUtil.isNotEmpty(task.getStart_device_code2()) && task.getStart_device_code2().equals(start_device_code)) + && StrUtil.equals(task.getTask_status(), "0"))) { list.add(task); } } @@ -458,7 +458,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { continue; } if ((task.getStart_device_code().equals(head_start_device_code) - || task.getStart_device_code2().equals(head_start_device_code)) + || (StrUtil.isNotEmpty(task.getStart_device_code2()) && task.getStart_device_code2().equals(head_start_device_code))) && StrUtil.equals(task.getTask_status(), "1")) { Instruction instruction = instructionService.findByTaskcodeAndStatus(task.getTask_code()); if (ObjectUtil.isNotEmpty(instruction)) { @@ -505,7 +505,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { @Transactional(rollbackFor = Exception.class) public void create(TaskDto dto) throws Exception { dto = foramte(dto); - if(ObjectUtil.isNotEmpty(dto.getPaperArray())){ + if (ObjectUtil.isNotEmpty(dto.getPaperArray())) { dto.setPaper_array(dto.getPaperArray().toJSONString()); } if (!StrUtil.isEmpty(dto.getVehicle_code())) { @@ -578,11 +578,11 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { // tasks.add(dto); // } - try{ + try { tasks.add(dto); - log.warn("任务添加到任务列表:"+dto.toString()); - } catch (Exception e){ - log.warn("任务添加到任务列表异常:"+ dto.toString() +e.getMessage()); + log.warn("任务添加到任务列表:" + dto.toString()); + } catch (Exception e) { + log.warn("任务添加到任务列表异常:" + dto.toString() + e.getMessage()); } } @@ -734,11 +734,11 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { removeByCodeFromCache(entity.getTask_code()); if (StrUtil.equals(dto.getTask_status(), "0") || StrUtil.equals(dto.getTask_status(), "1")) { - try{ + try { tasks.add(dto); - log.warn("任务添加到任务列表:"+dto.toString()); - } catch (Exception e){ - log.warn("任务添加到任务列表异常:"+ dto.toString() +e.getMessage()); + log.warn("任务添加到任务列表:" + dto.toString()); + } catch (Exception e) { + log.warn("任务添加到任务列表异常:" + dto.toString() + e.getMessage()); } } // 判断是否为WMS下发的任务,如果是反馈任务状态给WMS @@ -1203,16 +1203,16 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { @Override public boolean removeByCodeFromCache(String code) { CopyOnWriteArrayList taskDtos = (CopyOnWriteArrayList) this.tasks; - try{ + try { taskDtos.removeIf((task) -> { - if(StrUtil.equals(task.getTask_code(),code)){ - log.warn("任务移除任务列表成功:"+task.toString()); + if (StrUtil.equals(task.getTask_code(), code)) { + log.warn("任务移除任务列表成功:" + task.toString()); } return task.getTask_code().equals(code); }); - } catch (Exception e){ - log.warn("指令移除任务列表异常:"+e.getMessage()); + } catch (Exception e) { + log.warn("指令移除任务列表异常:" + e.getMessage()); } return true; @@ -1238,6 +1238,7 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { /** * 根据任务号查询任务 + * * @param task_code * @return */ @@ -1446,11 +1447,11 @@ public class TaskServiceImpl implements TaskService, ApplicationAutoInitial { @Override public void updateByCodeFromCache(TaskDto dto) { removeByCodeFromCache(dto.getTask_code()); - try{ + try { tasks.add(dto); - log.warn("任务添加到任务列表:"+dto.toString()); - } catch (Exception e){ - log.warn("任务添加到任务列表异常:"+ dto.toString() +e.getMessage()); + log.warn("任务添加到任务列表:" + dto.toString()); + } catch (Exception e) { + log.warn("任务添加到任务列表异常:" + dto.toString() + e.getMessage()); } } diff --git a/acs/nladmin-ui/src/views/acs/task/index.vue b/acs/nladmin-ui/src/views/acs/task/index.vue index ea995c5fa..e97158864 100644 --- a/acs/nladmin-ui/src/views/acs/task/index.vue +++ b/acs/nladmin-ui/src/views/acs/task/index.vue @@ -644,7 +644,6 @@ export default { }) getDicts().then(data => { this.dicts = data - console.log(this.dict.label.task_status[3]) }) }, methods: { diff --git a/acs/nladmin-ui/src/views/system/monitor/device/index.vue b/acs/nladmin-ui/src/views/system/monitor/device/index.vue index a8c168b2f..7533172be 100644 --- a/acs/nladmin-ui/src/views/system/monitor/device/index.vue +++ b/acs/nladmin-ui/src/views/system/monitor/device/index.vue @@ -761,6 +761,9 @@ export default { } else if (val === 'version') { const obj = { name: '轴代数', value: data[val] } this.arr.push(obj) + } else if (val === 'truss_type') { + const obj = { name: '内包间行架任务类型', value: data[val] } + this.arr.push(obj) } } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/AUTOQUERYBILLINFO.wql b/lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/AUTOQUERYBILLINFO.wql index f17cab80e..bb6d2a46f 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/AUTOQUERYBILLINFO.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/manage/AUTOQUERYBILLINFO.wql @@ -66,7 +66,7 @@ LEFT JOIN st_ivt_structattr attr ON attr.struct_id = ivt.struct_id LEFT JOIN pdm_bi_subpackagerelation sub ON ivt.pcsn = sub.container_name WHERE - DATEDIFF( NOW(), sub.date_of_production ) >= SUBSTRING_INDEX(sub.quality_guaran_period,'天',1) + DATEDIFF( NOW(), sub.date_of_production ) > SUBSTRING_INDEX(sub.quality_guaran_period,'天',1) AND ivt.canuse_qty > '0' GROUP BY attr.stor_id @@ -107,7 +107,7 @@ LEFT JOIN pdm_bi_subpackagerelation sub ON sub.package_box_sn = attr.storagevehicle_code AND ivt.pcsn = sub.container_name WHERE - DATEDIFF( NOW(), sub.date_of_production ) < '90' + DATEDIFF( NOW(), sub.date_of_production ) <= '90' AND ivt.canuse_qty > '0' GROUP BY attr.stor_id diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/returns/service/impl/InAndOutRetrunServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/returns/service/impl/InAndOutRetrunServiceImpl.java index 2ed3fb0da..5369ebd76 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/returns/service/impl/InAndOutRetrunServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/returns/service/impl/InAndOutRetrunServiceImpl.java @@ -336,8 +336,16 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService { .map(row -> row.getString("box_no")) .collect(Collectors.joining("','")); + // 所有子卷 List disList = WQLObject.getWQLObject("st_ivt_iostorinvdis").query("box_no in ('" + box_no_in + "') and iostorinv_id = '" + jo_mst.getString("iostorinv_id") + "'").getResultJSONArray(0).toJavaList(JSONObject.class); + // 所有分切计划 +// String pcsn_in = disList.stream() +// .map(row -> row.getString("pcsn")) +// .collect(Collectors.joining("','")); + +// List planList = WQLObject.getWQLObject("pdm_bi_slittingproductionplan").query("container_name in ('" + pcsn_in + "')").getResultJSONArray(0).toJavaList(JSONObject.class); + JSONObject param = new JSONObject(); JSONArray item = new JSONArray(); @@ -359,7 +367,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService { JSONObject jsonObject1 = new JSONObject(); jsonObject1.put("ContainerName", jsonObject.getString("pcsn")); - jsonObject1.put("NetWeight", jsonObject.getString("plan_qty")); + jsonObject1.put("NetWeight",NumberUtil.toStr(jsonObject.getDoubleValue("plan_qty"))); details.add(jsonObject1); } jsonDtl.put("Details", details); @@ -1552,7 +1560,7 @@ public class InAndOutRetrunServiceImpl implements InAndOutReturnService { JSONObject jsonObject1 = new JSONObject(); jsonObject1.put("ContainerName", jsonObject.getString("pcsn")); - jsonObject1.put("NetWeight", jsonObject.getString("plan_qty")); + jsonObject1.put("NetWeight", NumberUtil.toStr(jsonObject.getDoubleValue("plan_qty"))); details.add(jsonObject1); } jsonDtl.put("Details", details); diff --git a/lms/nladmin-ui/src/views/wms/st/inStor/change/index.vue b/lms/nladmin-ui/src/views/wms/st/inStor/change/index.vue index 53db2e117..955ffc2c7 100644 --- a/lms/nladmin-ui/src/views/wms/st/inStor/change/index.vue +++ b/lms/nladmin-ui/src/views/wms/st/inStor/change/index.vue @@ -253,13 +253,25 @@ export default { const end = new Date() const start = new Date() const endYear = end.getFullYear() - const endMonth = end.getMonth() + 1 - const endDay = end.getDate() + var endMonth = end.getMonth() + 1 + if (end.getMonth() + 1 < 10) { + endMonth = '0' + endMonth.toString() + } + var endDay = end.getDate() + if (end.getDate() < 10) { + endDay = '0' + endDay.toString() + } const endDate = endYear + '-' + endMonth + '-' + endDay + ' 23:59:59' start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) const startYear = start.getFullYear() - const startMonth = start.getMonth() + 1 - const startDay = start.getDate() + var startMonth = start.getMonth() + 1 + if (start.getMonth() + 1 < 10) { + startMonth = '0' + startMonth.toString() + } + var startDay = start.getDate() + if (start.getDate() < 10) { + startDay = '0' + startDay.toString() + } const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00' this.$set(this.query, 'createTime', [startDate, endDate]) this.crud.toQuery() diff --git a/lms/nladmin-ui/src/views/wms/st/inStor/check/index.vue b/lms/nladmin-ui/src/views/wms/st/inStor/check/index.vue index 6c76007dc..bb1a258ff 100644 --- a/lms/nladmin-ui/src/views/wms/st/inStor/check/index.vue +++ b/lms/nladmin-ui/src/views/wms/st/inStor/check/index.vue @@ -261,13 +261,25 @@ export default { const end = new Date() const start = new Date() const endYear = end.getFullYear() - const endMonth = end.getMonth() + 1 - const endDay = end.getDate() + var endMonth = end.getMonth() + 1 + if (end.getMonth() + 1 < 10) { + endMonth = '0' + endMonth.toString() + } + var endDay = end.getDate() + if (end.getDate() < 10) { + endDay = '0' + endDay.toString() + } const endDate = endYear + '-' + endMonth + '-' + endDay + ' 23:59:59' start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) const startYear = start.getFullYear() - const startMonth = start.getMonth() + 1 - const startDay = start.getDate() + var startMonth = start.getMonth() + 1 + if (start.getMonth() + 1 < 10) { + startMonth = '0' + startMonth.toString() + } + var startDay = start.getDate() + if (start.getDate() < 10) { + startDay = '0' + startDay.toString() + } const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00' this.$set(this.query, 'createTime', [startDate, endDate]) this.crud.toQuery() diff --git a/lms/nladmin-ui/src/views/wms/st/inbill/index.vue b/lms/nladmin-ui/src/views/wms/st/inbill/index.vue index 012343358..1ded6855f 100644 --- a/lms/nladmin-ui/src/views/wms/st/inbill/index.vue +++ b/lms/nladmin-ui/src/views/wms/st/inbill/index.vue @@ -318,13 +318,25 @@ export default { const end = new Date() const start = new Date() const endYear = end.getFullYear() - const endMonth = end.getMonth() + 1 - const endDay = end.getDate() + var endMonth = end.getMonth() + 1 + if (end.getMonth() + 1 < 10) { + endMonth = '0' + endMonth.toString() + } + var endDay = end.getDate() + if (end.getDate() < 10) { + endDay = '0' + endDay.toString() + } const endDate = endYear + '-' + endMonth + '-' + endDay + ' 23:59:59' start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) const startYear = start.getFullYear() - const startMonth = start.getMonth() + 1 - const startDay = start.getDate() + var startMonth = start.getMonth() + 1 + if (start.getMonth() + 1 < 10) { + startMonth = '0' + startMonth.toString() + } + var startDay = start.getDate() + if (start.getDate() < 10) { + startDay = '0' + startDay.toString() + } const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00' this.$set(this.query, 'createTime', [startDate, endDate]) this.crud.toQuery() diff --git a/lms/nladmin-ui/src/views/wms/st/incharge/index.vue b/lms/nladmin-ui/src/views/wms/st/incharge/index.vue index 8c470df73..e1e969a55 100644 --- a/lms/nladmin-ui/src/views/wms/st/incharge/index.vue +++ b/lms/nladmin-ui/src/views/wms/st/incharge/index.vue @@ -217,13 +217,25 @@ export default { const end = new Date() const start = new Date() const endYear = end.getFullYear() - const endMonth = end.getMonth() + 1 - const endDay = end.getDate() + var endMonth = end.getMonth() + 1 + if (end.getMonth() + 1 < 10) { + endMonth = '0' + endMonth.toString() + } + var endDay = end.getDate() + if (end.getDate() < 10) { + endDay = '0' + endDay.toString() + } const endDate = endYear + '-' + endMonth + '-' + endDay + ' 23:59:59' start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) const startYear = start.getFullYear() - const startMonth = start.getMonth() + 1 - const startDay = start.getDate() + var startMonth = start.getMonth() + 1 + if (start.getMonth() + 1 < 10) { + startMonth = '0' + startMonth.toString() + } + var startDay = start.getDate() + if (start.getDate() < 10) { + startDay = '0' + startDay.toString() + } const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00' this.$set(this.query, 'createTime', [startDate, endDate]) this.crud.toQuery() diff --git a/lms/nladmin-ui/src/views/wms/st/outbill/index.vue b/lms/nladmin-ui/src/views/wms/st/outbill/index.vue index d57961b69..5282bafa4 100644 --- a/lms/nladmin-ui/src/views/wms/st/outbill/index.vue +++ b/lms/nladmin-ui/src/views/wms/st/outbill/index.vue @@ -347,6 +347,8 @@ import { download } from '@/api/data' import { downloadFile } from '@/utils' import crudUserStor from '@/views/wms/basedata/st/userStor/userStor' +const start = new Date() + export default { name: 'Checkoutbill', components: { ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination, DivDialog, TaskDialog, MoneyDialog }, @@ -412,13 +414,25 @@ export default { const end = new Date() const start = new Date() const endYear = end.getFullYear() - const endMonth = end.getMonth() + 1 - const endDay = end.getDate() + var endMonth = end.getMonth() + 1 + if (end.getMonth() + 1 < 10) { + endMonth = '0' + endMonth.toString() + } + var endDay = end.getDate() + if (end.getDate() < 10) { + endDay = '0' + endDay.toString() + } const endDate = endYear + '-' + endMonth + '-' + endDay + ' 23:59:59' start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) const startYear = start.getFullYear() - const startMonth = start.getMonth() + 1 - const startDay = start.getDate() + var startMonth = start.getMonth() + 1 + if (start.getMonth() + 1 < 10) { + startMonth = '0' + startMonth.toString() + } + var startDay = start.getDate() + if (start.getDate() < 10) { + startDay = '0' + startDay.toString() + } const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00' this.$set(this.query, 'createTime', [startDate, endDate]) this.crud.toQuery() @@ -466,7 +480,7 @@ export default { } else { this.confirm_flag = true } - if (current.bill_type === '1006' || current.bill_type === '1003' || current.bill_type === '1004') { + if (current.bill_type === '1006' || current.bill_type === '1003') { this.business_confirm_flag = false } else { this.business_confirm_flag = true diff --git a/lms/nladmin-ui/src/views/wms/st/outcharge/index.vue b/lms/nladmin-ui/src/views/wms/st/outcharge/index.vue index ac6703900..5a74695a9 100644 --- a/lms/nladmin-ui/src/views/wms/st/outcharge/index.vue +++ b/lms/nladmin-ui/src/views/wms/st/outcharge/index.vue @@ -223,13 +223,25 @@ export default { const end = new Date() const start = new Date() const endYear = end.getFullYear() - const endMonth = end.getMonth() + 1 - const endDay = end.getDate() + var endMonth = end.getMonth() + 1 + if (end.getMonth() + 1 < 10) { + endMonth = '0' + endMonth.toString() + } + var endDay = end.getDate() + if (end.getDate() < 10) { + endDay = '0' + endDay.toString() + } const endDate = endYear + '-' + endMonth + '-' + endDay + ' 23:59:59' start.setTime(start.getTime() - 3600 * 1000 * 24 * 7) const startYear = start.getFullYear() - const startMonth = start.getMonth() + 1 - const startDay = start.getDate() + var startMonth = start.getMonth() + 1 + if (start.getMonth() + 1 < 10) { + startMonth = '0' + startMonth.toString() + } + var startDay = start.getDate() + if (start.getDate() < 10) { + startDay = '0' + startDay.toString() + } const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00' this.$set(this.query, 'createTime', [startDate, endDate]) this.crud.toQuery()