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 8594c266a..0caea7515 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 @@ -295,7 +295,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i map.put("to_command", 5); this.writing(map); requireSucess = true; - logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴完成反馈完成,返回参数:" + applyManipulatorActionResponse); message = "套轴完成成功"; } else { message = applyManipulatorActionResponse.getMessage(); @@ -304,7 +304,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i this.writing(map); requireSucess = true; message = "套轴失败"; - logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴失败,返回参数:" + applyManipulatorActionResponse); } } 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 17c5cf1ba..8608eef02 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 @@ -449,11 +449,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple feedbackSucess = true; message = "反馈尺寸LMS成功..."; logServer.deviceExecuteLog(this.device_code, "", "", "反馈尺寸成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); - String is_bushing = task.getIs_bushing(); - String version = task.getVersion(); - String bushing_num = task.getBushing_num(); Map map = new LinkedHashMap<>(); - map.put("inflatableShaftVersion", Integer.parseInt(version)); map.put("to_command", 2); this.writing(map); } else { @@ -484,7 +480,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple message = "申请新取货点成功"; } else { feedbackSucess = false; - message = "申请放货点LMS失败," + String.valueOf(applyManipulatorActionResponse); + message = "申请放货点LMS失败," + String.valueOf(applyManipulatorActionResponse.getMessage()); logServer.deviceExecuteLog(this.device_code, "", "", "反馈尺寸成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); } } 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 c14bb0013..601affab1 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 @@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject; import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.ObjectUtils; import org.jinterop.dcom.common.JIException; import org.nl.acs.device.service.DeviceService; import org.nl.acs.device_driver.DeviceDriver; @@ -214,7 +215,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv map.put("to_command", 5); this.writing(map); requireSucess = true; - logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴反馈完成,返回参数:" + applyManipulatorActionResponse); message = "套轴完成成功"; }else{ message = applyManipulatorActionResponse.getMessage(); @@ -223,7 +224,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv this.writing(map); requireSucess = true; message = "套轴失败"; - logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴反馈失败,返回参数:" + applyManipulatorActionResponse); } } @@ -240,12 +241,12 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv // applyManipulatorActionRequest.setTask_code2(task_code2); applyManipulatorActionRequest.setType("6"); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - if (applyManipulatorActionResponse.getstatus()==200) { + if (ObjectUtils.isNotEmpty(applyManipulatorActionResponse) && "1".equals(applyManipulatorActionResponse.getIs_bushing())) { Map map = new LinkedHashMap<>(); map.put("to_command", 4); this.writing(map); requireSucess = true; - logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴成功,返回参数:" + applyManipulatorActionResponse); message = "套轴申请成功"; }else { message = applyManipulatorActionResponse.getMessage(); @@ -254,7 +255,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv this.writing(map); requireSucess = true; message = "申请失败"; - logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); + logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴失败,返回参数:" + applyManipulatorActionResponse); } } 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 1b185d01f..63186fb96 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 @@ -39,13 +39,17 @@ import org.nl.acs.route.service.RouteLineService; import org.nl.acs.route.service.dto.RouteLineDto; import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.dto.TaskDto; +import org.nl.config.thread.ThreadPoolExecutorUtil; import org.nl.modules.system.service.ParamService; import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.util.SpringContextHolder; import org.openscada.opc.lib.da.Server; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import java.util.*; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ThreadPoolExecutor; /** * 西门子-输送机驱动 @@ -54,6 +58,7 @@ import java.util.*; @Data @RequiredArgsConstructor public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, FeedLmsRealFailed { + private final static ThreadPoolExecutor EXECUTOR = ThreadPoolExecutorUtil.getPoll(); protected ItemProtocol itemProtocol = new ItemProtocol(this); @Autowired InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); @@ -233,9 +238,9 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme param.put("device_name", this.getDevice().getDevice_name()); param.put("device_type", "1"); param.put("product_area", paramService.findByCode("productArea").getValue()); - acsToWmsService.sendDeviceStatus(param); +// acsToWmsService.sendDeviceStatus(param); + sendDeviceStatus(param); } - logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode + "复位请求标记:" + requireSucess); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode:" + last_mode + "->" + mode); } @@ -252,6 +257,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme last_inst_message = inst_message; if ("true".equals(this.device.getExtraValue().get("ship_device_update"))) { this.requiresShipDeviceUpdate = false; + if(mode>0 ) + { + shipDeviceUpdate(); + } } } logServer.deviceItemValue(this.device_code, "move", String.valueOf(move)); @@ -300,7 +309,6 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme logServer.deviceItemValue(this.device_code, "task", String.valueOf(task)); logServer.deviceExecuteLog(this.device_code, "", "", "信号task:" + last_task + "->" + task); if ("true".equals(this.device.getExtraValue().get("task_update"))) { - taskDeviceUpdate(task); } } @@ -417,33 +425,61 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme last_to_height = to_height; } - private void shipDeviceUpdate() { - JSONObject param = new JSONObject() {{ - put("device_code", device_code); - }}; - logServer.deviceExecuteLog(this.device_code, "", "", "有货变无货请求LMS,参数:" + param); - HttpResponse response = acsToWmsService.shipDeviceUpdate(param); - if (response == null || response.getStatus() == 200) { - logServer.deviceExecuteLog(this.device_code, "", "", "有货变无货请求LMS,接口返回:" + response.body()); - this.requiresShipDeviceUpdate = true; - } + public void shipDeviceUpdate() { + CompletableFuture future = new CompletableFuture<>(); + // 使用线程池执行异步操作 + EXECUTOR.submit(() -> { + try { + JSONObject param = new JSONObject() ; + param.put("device_code", device_code); + logServer.deviceExecuteLog(this.device_code, "", "", "有货变无货请求LMS,参数:" + param); + this.requiresShipDeviceUpdate = true; + HttpResponse response = acsToWmsService.shipDeviceUpdate(param); + if (response == null || response.getStatus() == 200) { + logServer.deviceExecuteLog(this.device_code, "", "", "有货变无货请求LMS,接口返回:" + response.body()); + } + future.complete("Async operation completed"); + } catch (Exception e) { + future.completeExceptionally(e); + } + }); } + public void sendDeviceStatus(JSONObject param) { + CompletableFuture future = new CompletableFuture<>(); + // 使用线程池执行异步操作 + EXECUTOR.submit(() -> { + try { + acsToWmsService.sendDeviceStatus(param); + future.complete("Async operation completed"); + this.requiresShipDeviceUpdate = true; + } catch (Exception e) { + future.completeExceptionally(e); + } + }); + } private void taskDeviceUpdate(int task) { - Instruction inst = instructionService.findByTaskcode(String.valueOf(task)); - + Instruction inst = instructionService.findByInsructionCode(String.valueOf(task)); ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); - applyManipulatorActionRequest.setDevice_code(device_code); applyManipulatorActionRequest.setAction("3"); - applyManipulatorActionRequest.setTask_code1(inst.getTask_code()); - - logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,参数:" + applyManipulatorActionRequest); - ApplyManipulatorActionResponse response = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); - if (response == null || response.getstatus() == 200) { - logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,接口返回:" + response.getMessage()); + if (ObjectUtil.isEmpty(inst)) { + logServer.deviceExecuteLog(this.device_code, "", "", "任务号不存在:" + inst); + return; } + applyManipulatorActionRequest.setTask_code1(inst.getTask_code()); + logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,参数:" + applyManipulatorActionRequest); + try { + ApplyManipulatorActionResponse response = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest); + if (response == null || response.getstatus() == 200) { + logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,接口返回:" + response.getMessage()); + } + }catch (Exception e){ + e.printStackTrace(); + logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS失败" + e.getMessage()); + } + } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/ExecutableDeviceDriver.java b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/ExecutableDeviceDriver.java index 326d18963..28e2c460f 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/ExecutableDeviceDriver.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/device_driver/driver/ExecutableDeviceDriver.java @@ -5,14 +5,14 @@ import org.nl.acs.device_driver.DeviceDriver; public interface ExecutableDeviceDriver extends DeviceDriver { default void executeAuto() { -// try { -// this.execute(); -// } catch (Throwable var6) { -// String message = "线程调用异常:" + var6.getMessage(); -// Log.error(message); -// } finally { -// } + try { this.execute(); + } catch (Throwable var6) { + String message = "线程调用异常:" + var6.getMessage(); + Log.error(message); + } finally { + } +// this.execute(); } diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java index a8b5c7019..364b5c542 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/ext/wms/service/impl/AcsToWmsServiceImpl.java @@ -23,6 +23,7 @@ import org.nl.acs.task.service.dto.TaskDto; import org.nl.modules.system.service.ParamService; import org.slf4j.MDC; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import java.util.concurrent.CompletableFuture; @@ -97,6 +98,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } @Override +// @Async public HttpResponse feedbackTaskStatusToWms(JSONArray data) { try { @@ -619,16 +621,20 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { public HttpResponse shipDeviceUpdate(JSONObject param) { try { MDC.put(log_file_type, log_type); -// log.info("shipDeviceUpdate-----输入参数{}", param); + log.info("shipDeviceUpdate-----输入参数{}", param); if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); AddressDto addressDto = addressService.findByCode("shipDeviceUpdate"); String methods_url = addressDto.getMethods_url(); String url = wmsUrl + methods_url; - return HttpRequest + + HttpResponse resp = HttpRequest .post(url) .body(param.toString()) .execute(); + log.info("shipDeviceUpdate-----返回参数{}", resp.body()); + + return resp; } } catch (Throwable ignored) { @@ -662,6 +668,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } @Override +// @Async public void sendDeviceStatus(JSONObject param) { try { MDC.put(log_file_type, log_type); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java index bfcb31921..de0237145 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/InstructionService.java @@ -86,6 +86,13 @@ public interface InstructionService { */ Instruction findByTaskcode(String code); + /** + * 根据指令号查询 + * @param code + * @return + */ + Instruction findByInsructionCode(String code); + Instruction findByTaskcodeAndStatus(String code); Instruction findByTaskcodeAndStatus(String code,String status); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java index f41d8acad..0a85edbe4 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/instruction/service/impl/InstructionServiceImpl.java @@ -258,6 +258,14 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu return obj; } + @Override + public Instruction findByInsructionCode(String code) { + WQLObject wo = WQLObject.getWQLObject("acs_instruction"); + JSONObject json = wo.query("instruction_code ='" + code + "'","create_time desc").uniqueResult(0); + final Instruction obj = json.toJavaObject(Instruction.class); + return obj; + } + @Override public Instruction findByTaskcodeAndStatus(String code) { Iterator var3 = instructions.iterator(); diff --git a/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java b/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java index c1f568ffa..091031f1d 100644 --- a/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java +++ b/acs/nladmin-system/src/main/java/org/nl/acs/opc/DeviceOpcProtocolRunable.java @@ -419,17 +419,19 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value, sb}); // this.businessLogger.setResource(itemDto.getDevice_code(), itemDto.getDevice_name()).log("信号{}变更从{}->{};信号快照:{}", new Object[]{itemId, his, value, sb}); } else { - if(his instanceof int[]){ - if(!Arrays.equals((long[]) his, (long[]) value)){ - log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value}); - } - } else if(his instanceof String){ - if(!StrUtil.equals((CharSequence) his, (CharSequence) value)){ - log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value}); - } - } else { - log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value}); - } +// if(his instanceof int[]){ +// if(!Arrays.equals((long[]) his, (long[]) value)){ +// log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value}); +// } +// } else if(his instanceof String){ +// if(!StrUtil.equals((CharSequence) his, (CharSequence) value)){ +// log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value}); +// } +// } else { +// log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value}); +// } + + log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value}); // this.businessLogger.setResource(itemDto.getDevice_code(), itemDto.getDevice_name()).log("信号{}变更从{}->{}", new Object[]{itemId, his, value}); } } diff --git a/acs/nladmin-system/src/main/resources/logback-spring.xml b/acs/nladmin-system/src/main/resources/logback-spring.xml index 45c7f529b..d9726de06 100644 --- a/acs/nladmin-system/src/main/resources/logback-spring.xml +++ b/acs/nladmin-system/src/main/resources/logback-spring.xml @@ -82,8 +82,10 @@ https://juejin.cn/post/6844903775631572999 + + - + 1000 ${LOKI_URL}/push @@ -99,6 +101,12 @@ https://juejin.cn/post/6844903775631572999 + + 100 + 500 + + + error diff --git a/acs/nladmin-ui/src/views/acs/task/index.vue b/acs/nladmin-ui/src/views/acs/task/index.vue index 91259cf24..e97158864 100644 --- a/acs/nladmin-ui/src/views/acs/task/index.vue +++ b/acs/nladmin-ui/src/views/acs/task/index.vue @@ -441,6 +441,7 @@ + diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java index 610e86101..3bbafd972 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/CheckOutBillService.java @@ -16,7 +16,7 @@ public interface CheckOutBillService { * @param page 分页参数 * @return Map */ - Map pageQuery(Map whereJson, Pageable page); + Map pageQuery(Map whereJson, Pageable page,String[] stor_id, String[] bill_status, String[] bill_type); /** * 查询数据分页 @@ -294,5 +294,5 @@ public interface CheckOutBillService { * @param response / * @throws IOException / */ - void download(Map map, HttpServletResponse response) throws IOException; + void download(Map map, HttpServletResponse response, String[] stor_id, String[] bill_status, String[] bill_type) throws IOException; } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/OutChargeServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/OutChargeServiceImpl.java index e2d0e0639..390c63f04 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/OutChargeServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/inbill/service/impl/OutChargeServiceImpl.java @@ -48,7 +48,8 @@ public class OutChargeServiceImpl implements OutChargeService { String start_region_code = MapUtil.getStr(whereJson, "start_region_code"); String end_region_code = MapUtil.getStr(whereJson, "end_region_code"); String sap_pcsn = MapUtil.getStr(whereJson, "sap_pcsn"); - + String begin_time = MapUtil.getStr(whereJson, "begin_time"); + String end_time = MapUtil.getStr(whereJson, "end_time"); HashMap map = new HashMap<>(); map.put("flag", "15"); map.put("bill_status", MapUtil.getStr(whereJson, "bill_status")); @@ -89,6 +90,12 @@ public class OutChargeServiceImpl implements OutChargeService { if (ObjectUtil.isNotEmpty(in_stor_id)) { map.put("in_stor_id", in_stor_id); } + if (ObjectUtil.isNotEmpty(begin_time)) { + map.put("begin_time",begin_time); + } + if (ObjectUtil.isNotEmpty(end_time)) { + map.put("end_time",end_time); + } JSONObject json = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "ios.iostorinv_id DESC"); return json; diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/instor/service/impl/CheckServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/instor/service/impl/CheckServiceImpl.java index 8324e1279..5b2a0173d 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/instor/service/impl/CheckServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/instor/service/impl/CheckServiceImpl.java @@ -64,7 +64,9 @@ public class CheckServiceImpl implements CheckService { JSONObject jo = WQL.getWO("QST_IVT_CHECK").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "check_code desc"); JSONArray content = jo.getJSONArray("content"); - + if (content.isEmpty()){ + return jo; + } // 拼接主表id String check_id = content.stream() .map(row -> (JSONObject) row) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java index a4f3f8a61..79c8ab6da 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/rest/CheckOutBillController.java @@ -28,8 +28,8 @@ public class CheckOutBillController { @Log("查询出库单") @ApiOperation("查询出库单") //@PreAuthorize("@el.check('checkoutbill:list')") - public ResponseEntity query(@RequestParam Map whereJson, Pageable page) { - return new ResponseEntity<>(checkOutBillService.pageQuery(whereJson, page), HttpStatus.OK); + public ResponseEntity query(@RequestParam Map whereJson, Pageable page, String[] stor_id, String[] bill_status, String[] bill_type) { + return new ResponseEntity<>(checkOutBillService.pageQuery(whereJson, page,stor_id , bill_status, bill_type), HttpStatus.OK); } @GetMapping("/addDtl") @@ -311,7 +311,7 @@ public class CheckOutBillController { @Log("导出数据") @ApiOperation("导出数据") @GetMapping(value = "/download") - public void download(@RequestParam Map map, HttpServletResponse response) throws IOException { - checkOutBillService.download(map, response); + public void download(@RequestParam Map map, HttpServletResponse response,String[] stor_id, String[] bill_status, String[] bill_type) throws IOException { + checkOutBillService.download(map, response, stor_id, bill_status, bill_type); } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java index 958e46da6..b9fa5a7c6 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java @@ -60,7 +60,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { private final HandMoveStorAcsTask moveStorAcsTask; @Override - public Map pageQuery(Map whereJson, Pageable page) { + public Map pageQuery(Map whereJson, Pageable page, String[] stor_id, String[] bill_status, String[] bill_type) { HashMap map = new HashMap<>(whereJson); map.put("flag", "1"); @@ -105,6 +105,41 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { if (ObjectUtil.isNotEmpty(in_stor_id)) { map.put("in_stor_id", in_stor_id); } + if (ObjectUtil.isNotEmpty(stor_id)) { + String storIds = "("; + for (int i = 0; i < stor_id.length; i++) { + if (i != stor_id.length - 1) { + storIds += "'" + stor_id[i] + "',"; + } else { + storIds += "'" + stor_id[i] + "')"; + } + } + map.put("storIds", storIds); + } + + if (ObjectUtil.isNotEmpty(bill_status)) { + String billStatuses = "("; + for (int i = 0; i < bill_status.length; i++) { + if (i != bill_status.length - 1) { + billStatuses += "'" + bill_status[i] + "',"; + } else { + billStatuses += "'" + bill_status[i] + "')"; + } + } + map.put("billStatuses", billStatuses); + } + + if (ObjectUtil.isNotEmpty(bill_type)) { + String billTypes = "("; + for (int i = 0; i < bill_type.length; i++) { + if (i != bill_type.length - 1) { + billTypes += "'" + bill_type[i] + "',"; + } else { + billTypes += "'" + bill_type[i] + "')"; + } + } + map.put("billTypes", billTypes); + } JSONObject jo = WQL.getWO("QST_IVT_CHECKOUTBILL").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "iostorinv_id desc"); return jo; @@ -682,7 +717,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { } @Override - public void download(Map whereJson, HttpServletResponse response) throws IOException { + public void download(Map whereJson, HttpServletResponse response, String[] stor_id, String[] bill_status, String[] bill_type) throws IOException { HashMap map = new HashMap<>(whereJson); map.put("flag", "111"); @@ -719,6 +754,41 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { if (StrUtil.isNotEmpty(map.get("cust_code"))) { map.put("cust_code", "%" + map.get("cust_code") + "%"); } + if (ObjectUtil.isNotEmpty(stor_id)) { + String storIds = "("; + for (int i = 0; i < stor_id.length; i++) { + if (i != stor_id.length - 1) { + storIds += "'" + stor_id[i] + "',"; + } else { + storIds += "'" + stor_id[i] + "')"; + } + } + map.put("storIds", storIds); + } + + if (ObjectUtil.isNotEmpty(bill_status)) { + String billStatuses = "("; + for (int i = 0; i < bill_status.length; i++) { + if (i != bill_status.length - 1) { + billStatuses += "'" + bill_status[i] + "',"; + } else { + billStatuses += "'" + bill_status[i] + "')"; + } + } + map.put("billStatuses", billStatuses); + } + + if (ObjectUtil.isNotEmpty(bill_type)) { + String billTypes = "("; + for (int i = 0; i < bill_type.length; i++) { + if (i != bill_type.length - 1) { + billTypes += "'" + bill_type[i] + "',"; + } else { + billTypes += "'" + bill_type[i] + "')"; + } + } + map.put("billTypes", billTypes); + } JSONArray resultJSONArray = WQL.getWO("QST_IVT_CHECKOUTBILL").addParamMap(map).process().getResultJSONArray(0); @@ -748,8 +818,19 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { if (StrUtil.equals(jsonObject.getString("bill_type"), "1009")) { mp.put("业务类型", "手工出库"); } + //计划重量、实际重量、实际毛重、车号、箱数、收货地址(调拨显示到货仓库)、单据状态 mp.put("业务日期", jsonObject.getString("biz_date")); - mp.put("总重量", jsonObject.getString("qty")); + mp.put("计划重量", jsonObject.getString("qty")); + mp.put("实际重量", jsonObject.getString("plan_qty")); + mp.put("实际毛重", jsonObject.getString("box_weight")); + mp.put("车号", jsonObject.getString("carno")); + mp.put("箱数", jsonObject.getString("box_count")); + if (StrUtil.equals(jsonObject.getString("bill_type"), "1004")){ + mp.put("收货地址", jsonObject.getString("stor_name")); + }else { + mp.put("收货地址", jsonObject.getString("receiptaddress")); + } + mp.put("单据状态", jsonObject.getString("bill_status")); mp.put("客户编码", jsonObject.getString("cust_code")); mp.put("客户名称", jsonObject.getString("cust_name")); mp.put("交货单号", jsonObject.getString("vbeln")); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql index b431c7bbd..337fcb122 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql @@ -58,6 +58,9 @@ 输入.task_group_id TYPEAS s_string 输入.in_stor_id TYPEAS f_string 输入.struct_codes TYPEAS f_string + 输入.storIds TYPEAS f_string + 输入.billStatuses TYPEAS f_string + 输入.billTypes TYPEAS f_string [临时表] --这边列出来的临时表就会在运行期动态创建 @@ -87,7 +90,8 @@ cu.shd_dtl_num, cu.cust_name, IFNULL(dtl.vbeln,'') as vbeln, - cu.cust_simple_name + cu.cust_simple_name, + dtl.plan_qty FROM ST_IVT_IOStorInv ios LEFT JOIN md_cs_customerbase cu ON ios.cust_code = cu.cust_code @@ -132,20 +136,20 @@ dtl.width like 输入.width ENDOPTION - OPTION 输入.bill_type <> "" - ios.bill_type = 输入.bill_type + OPTION 输入.billTypes <> "" + ios.bill_type in 输入.billTypes ENDOPTION - OPTION 输入.stor_id <> "" - ios.stor_id = 输入.stor_id + OPTION 输入.storIds <> "" + ios.stor_id in 输入.storIds ENDOPTION OPTION 输入.create_mode <> "" ios.create_mode = 输入.create_mode ENDOPTION - OPTION 输入.bill_status <> "" - ios.bill_status = 输入.bill_status + OPTION 输入.billStatuses <> "" + ios.bill_status in 输入.billStatuses ENDOPTION OPTION 输入.begin_time <> "" @@ -174,7 +178,13 @@ sub.sale_order_name, CONCAT( sub.thickness_request, '*', sub.width_standard ) AS spec, MAX(tr.cust_name) AS wl_cust_name, - MAX(ios.estimated_freight) AS estimated_freight + MAX(ios.estimated_freight) AS estimated_freight, + MAX(dtl.plan_qty) AS plan_qty, + MAX(sub.box_weight) AS box_weight, + MAX(ios.carno) AS carno, + MAX(ios.receiptaddress) AS receiptaddress, + MAX( sd.label ) AS bill_status, + count(DISTINCT(dis.box_no)) as box_count FROM st_ivt_iostorinvdis dis LEFT JOIN st_ivt_iostorinvdtl dtl ON dis.iostorinvdtl_id = dtl.iostorinvdtl_id @@ -182,6 +192,7 @@ LEFT JOIN md_cs_customerbase cu ON ios.cust_code = cu.cust_code LEFT JOIN md_cs_transportationbase tr ON ios.trans_code = tr.cust_code LEFT JOIN pdm_bi_subpackagerelationrecord sub ON sub.package_box_sn = dis.box_no AND dis.pcsn = sub.container_name AND dis.iostorinv_id = sub.bill_id + LEFT JOIN sys_dict sd on ios.bill_status = sd.`value` and sd.`code` = 'io_bill_status' WHERE ios.io_type = '1' AND ios.is_delete = '0' @@ -219,20 +230,20 @@ dtl.width like 输入.width ENDOPTION - OPTION 输入.bill_type <> "" - ios.bill_type = 输入.bill_type + OPTION 输入.billTypes <> "" + ios.bill_type in 输入.billTypes ENDOPTION - OPTION 输入.stor_id <> "" - ios.stor_id = 输入.stor_id + OPTION 输入.storIds <> "" + ios.stor_id in 输入.storIds ENDOPTION OPTION 输入.create_mode <> "" ios.create_mode = 输入.create_mode ENDOPTION - OPTION 输入.bill_status <> "" - ios.bill_status = 输入.bill_status + OPTION 输入.billStatuses <> "" + ios.bill_status in 输入.billStatuses ENDOPTION OPTION 输入.begin_time <> "" diff --git a/lms/nladmin-ui/src/views/wms/st/inAndOutReturn/index.vue b/lms/nladmin-ui/src/views/wms/st/inAndOutReturn/index.vue index ce0a11ed0..9b7aca0ec 100644 --- a/lms/nladmin-ui/src/views/wms/st/inAndOutReturn/index.vue +++ b/lms/nladmin-ui/src/views/wms/st/inAndOutReturn/index.vue @@ -237,7 +237,7 @@ @selection-change="crud.selectionChangeHandler" > - + @@ -247,7 +247,7 @@ - + @@ -300,7 +300,8 @@ export default { reset: true, download: false }, - query: { io_type: '0', bill_status: '99' } + query: { io_type: '0', bill_status: '99' }, + queryOnPresenterCreated: false }) }, mixins: [presenter(), header(), crud()], @@ -328,13 +329,20 @@ export default { crudUserStor.getUserStor().then(res => { this.storlist = res }) - debugger - this.billtypelist = this.dict.ST_INV_IN_TYPE + // debugger + this.billtypelist = this.dict.ST_INV_OUT_TYPE + this.initQuery() }, methods: { - [CRUD.HOOK.beforeRefresh]() { - return true + /* 搜索框出入类型 默认出库*/ + initQuery() { + this.query.io_type = '1' + this.query.is_upload = '0' + this.crud.toQuery() }, + // [CRUD.HOOK.beforeRefresh]() { + // return true + // }, querytable() { this.onSelectAll() this.crud.toQuery() 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 071a2a2af..53db2e117 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 @@ -91,7 +91,7 @@ - - + {{ scope.row.bill_code }} - - - - - - - - - - + + + + + + + + + + @@ -213,7 +213,9 @@ export default { del: false, reset: true, download: false - }}) + }, + queryOnPresenterCreated: false + }) }, mixins: [presenter(), header(), crud()], // 数据字典 @@ -243,8 +245,25 @@ export default { crudUserStor.getUserStor().then(res => { this.storlist = res }) + this.initQuery() }, methods: { + /* 搜索框创建时间默认最近一周*/ + initQuery() { + const end = new Date() + const start = new Date() + const endYear = end.getFullYear() + const endMonth = end.getMonth() + 1 + const endDay = end.getDate() + 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() + const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00' + this.$set(this.query, 'createTime', [startDate, endDate]) + this.crud.toQuery() + }, canUd(row) { return row.bill_status !== '10' }, @@ -268,7 +287,7 @@ export default { this.buttonChange(row) } else if (val.length === 1) { this.buttonChange(row) - }else{ + } else { this.handleCurrentChange(null) } }, 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 3f2dd0e06..6c76007dc 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 @@ -38,7 +38,7 @@ - + { this.storlist = res }) + this.initQuery() }, methods: { + /* 搜索框创建时间默认最近一周*/ + initQuery() { + const end = new Date() + const start = new Date() + const endYear = end.getFullYear() + const endMonth = end.getMonth() + 1 + const endDay = end.getDate() + 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() + const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00' + this.$set(this.query, 'createTime', [startDate, endDate]) + this.crud.toQuery() + }, canUd(row) { return row.status !== '1' }, 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 dc4275ecb..012343358 100644 --- a/lms/nladmin-ui/src/views/wms/st/inbill/index.vue +++ b/lms/nladmin-ui/src/views/wms/st/inbill/index.vue @@ -38,7 +38,7 @@ - + { this.storlist = res }) + this.initQuery() }, methods: { + /* 搜索框创建时间默认最近一周*/ + initQuery() { + const end = new Date() + const start = new Date() + const endYear = end.getFullYear() + const endMonth = end.getMonth() + 1 + const endDay = end.getDate() + 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() + const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00' + this.$set(this.query, 'createTime', [startDate, endDate]) + this.crud.toQuery() + }, fun(val) { return Number(val).toFixed(3) }, 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 6c4575a24..8c470df73 100644 --- a/lms/nladmin-ui/src/views/wms/st/incharge/index.vue +++ b/lms/nladmin-ui/src/views/wms/st/incharge/index.vue @@ -38,7 +38,7 @@ - + @@ -189,7 +189,8 @@ export default { del: false, download: false, reset: false - } + }, + queryOnPresenterCreated: false }) }, mixins: [presenter(), header(), crud()], @@ -208,11 +209,28 @@ export default { crudUserStor.getUserStor().then(res => { this.storlist = res }) + this.initQuery() }, methods: { - [CRUD.HOOK.beforeRefresh]() { - return true + /* 搜索框创建时间默认最近一周*/ + initQuery() { + const end = new Date() + const start = new Date() + const endYear = end.getFullYear() + const endMonth = end.getMonth() + 1 + const endDay = end.getDate() + 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() + const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00' + this.$set(this.query, 'createTime', [startDate, endDate]) + this.crud.toQuery() }, + // [CRUD.HOOK.beforeRefresh]() { + // return false + // }, toView(index, row) { this.mstrow = row this.viewShow = true 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 ce20f55c5..ac16a7b30 100644 --- a/lms/nladmin-ui/src/views/wms/st/outbill/index.vue +++ b/lms/nladmin-ui/src/views/wms/st/outbill/index.vue @@ -23,11 +23,12 @@ - + - + + + + + @@ -349,7 +358,9 @@ export default { del: false, reset: true, download: false - }}) + }, + queryOnPresenterCreated: false + }) }, mixins: [presenter(), header(), crud()], // 数据字典 @@ -393,8 +404,25 @@ export default { crudUserStor.getUserStor().then(res => { this.storlist = res }) + this.initQuery() }, methods: { + /* 搜索框创建时间默认最近一周*/ + initQuery() { + const end = new Date() + const start = new Date() + const endYear = end.getFullYear() + const endMonth = end.getMonth() + 1 + const endDay = end.getDate() + 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() + const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00' + this.$set(this.query, 'createTime', [startDate, endDate]) + this.crud.toQuery() + }, canUd(row) { return row.bill_status !== '10' }, 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 a148bdf45..ac6703900 100644 --- a/lms/nladmin-ui/src/views/wms/st/outcharge/index.vue +++ b/lms/nladmin-ui/src/views/wms/st/outcharge/index.vue @@ -38,7 +38,7 @@ - + @@ -191,7 +191,8 @@ export default { del: false, download: false, reset: false - } + }, + queryOnPresenterCreated: false }) }, mixins: [presenter(), header(), crud()], @@ -214,11 +215,28 @@ export default { crudUserStor.getUserStor().then(res => { this.storlist = res }) + this.initQuery() }, methods: { - [CRUD.HOOK.beforeRefresh]() { - return true + /* 搜索框创建时间默认最近一周*/ + initQuery() { + const end = new Date() + const start = new Date() + const endYear = end.getFullYear() + const endMonth = end.getMonth() + 1 + const endDay = end.getDate() + 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() + const startDate = startYear + '-' + startMonth + '-' + startDay + ' 00:00:00' + this.$set(this.query, 'createTime', [startDate, endDate]) + this.crud.toQuery() }, + // [CRUD.HOOK.beforeRefresh]() { + // return false + // }, toView(index, row) { this.mstrow = row this.viewShow = true