This commit is contained in:
2023-12-22 14:49:53 +08:00
24 changed files with 416 additions and 121 deletions

View File

@@ -295,7 +295,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
map.put("to_command", 5); map.put("to_command", 5);
this.writing(map); this.writing(map);
requireSucess = true; requireSucess = true;
logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴完成反馈完成,返回参数:" + applyManipulatorActionResponse);
message = "套轴完成成功"; message = "套轴完成成功";
} else { } else {
message = applyManipulatorActionResponse.getMessage(); message = applyManipulatorActionResponse.getMessage();
@@ -304,7 +304,7 @@ public class CasingStationConveyorDeviceDriver extends AbstractOpcDeviceDriver i
this.writing(map); this.writing(map);
requireSucess = true; requireSucess = true;
message = "套轴失败"; message = "套轴失败";
logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴失败,返回参数:" + applyManipulatorActionResponse);
} }
} }

View File

@@ -449,11 +449,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
feedbackSucess = true; feedbackSucess = true;
message = "反馈尺寸LMS成功..."; message = "反馈尺寸LMS成功...";
logServer.deviceExecuteLog(this.device_code, "", "", "反馈尺寸成请求成功,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); 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<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("inflatableShaftVersion", Integer.parseInt(version));
map.put("to_command", 2); map.put("to_command", 2);
this.writing(map); this.writing(map);
} else { } else {
@@ -484,7 +480,7 @@ public class IndoorManipulatorDeviceDriver extends AbstractOpcDeviceDriver imple
message = "申请新取货点成功"; message = "申请新取货点成功";
} else { } else {
feedbackSucess = false; feedbackSucess = false;
message = "申请放货点LMS失败" + String.valueOf(applyManipulatorActionResponse); message = "申请放货点LMS失败" + String.valueOf(applyManipulatorActionResponse.getMessage());
logServer.deviceExecuteLog(this.device_code, "", "", "反馈尺寸成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse)); logServer.deviceExecuteLog(this.device_code, "", "", "反馈尺寸成请求失败,响应参数:" + JSON.toJSONString(applyManipulatorActionResponse));
} }
} }

View File

@@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
import lombok.Data; import lombok.Data;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils;
import org.jinterop.dcom.common.JIException; import org.jinterop.dcom.common.JIException;
import org.nl.acs.device.service.DeviceService; import org.nl.acs.device.service.DeviceService;
import org.nl.acs.device_driver.DeviceDriver; import org.nl.acs.device_driver.DeviceDriver;
@@ -214,7 +215,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
map.put("to_command", 5); map.put("to_command", 5);
this.writing(map); this.writing(map);
requireSucess = true; requireSucess = true;
logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴反馈完成,返回参数:" + applyManipulatorActionResponse);
message = "套轴完成成功"; message = "套轴完成成功";
}else{ }else{
message = applyManipulatorActionResponse.getMessage(); message = applyManipulatorActionResponse.getMessage();
@@ -223,7 +224,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
this.writing(map); this.writing(map);
requireSucess = true; requireSucess = true;
message = "套轴失败"; 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.setTask_code2(task_code2);
applyManipulatorActionRequest.setType("6"); applyManipulatorActionRequest.setType("6");
applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); applyManipulatorActionResponse = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest);
if (applyManipulatorActionResponse.getstatus()==200) { if (ObjectUtils.isNotEmpty(applyManipulatorActionResponse) && "1".equals(applyManipulatorActionResponse.getIs_bushing())) {
Map<String, Object> map = new LinkedHashMap<>(); Map<String, Object> map = new LinkedHashMap<>();
map.put("to_command", 4); map.put("to_command", 4);
this.writing(map); this.writing(map);
requireSucess = true; requireSucess = true;
logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴成功,返回参数:" + applyManipulatorActionResponse);
message = "套轴申请成功"; message = "套轴申请成功";
}else { }else {
message = applyManipulatorActionResponse.getMessage(); message = applyManipulatorActionResponse.getMessage();
@@ -254,7 +255,7 @@ public class PluggingUnpluggingMachineDeviceDriver extends AbstractOpcDeviceDriv
this.writing(map); this.writing(map);
requireSucess = true; requireSucess = true;
message = "申请失败"; message = "申请失败";
logServer.deviceExecuteLog(this.device_code, "", "", "申请出纸管,返回参数:" + applyManipulatorActionResponse); logServer.deviceExecuteLog(this.device_code, "", "", "申请套轴失败,返回参数:" + applyManipulatorActionResponse);
} }
} }

View File

@@ -39,13 +39,17 @@ import org.nl.acs.route.service.RouteLineService;
import org.nl.acs.route.service.dto.RouteLineDto; import org.nl.acs.route.service.dto.RouteLineDto;
import org.nl.acs.task.service.TaskService; import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto; 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.system.service.ParamService;
import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder; import org.nl.modules.wql.util.SpringContextHolder;
import org.openscada.opc.lib.da.Server; import org.openscada.opc.lib.da.Server;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import java.util.*; import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ThreadPoolExecutor;
/** /**
* 西门子-输送机驱动 * 西门子-输送机驱动
@@ -54,6 +58,7 @@ import java.util.*;
@Data @Data
@RequiredArgsConstructor @RequiredArgsConstructor
public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, FeedLmsRealFailed { public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver implements DeviceDriver, ExecutableDeviceDriver, RouteableDeviceDriver, DeviceStageMonitor, FeedLmsRealFailed {
private final static ThreadPoolExecutor EXECUTOR = ThreadPoolExecutorUtil.getPoll();
protected ItemProtocol itemProtocol = new ItemProtocol(this); protected ItemProtocol itemProtocol = new ItemProtocol(this);
@Autowired @Autowired
InstructionService instructionService = SpringContextHolder.getBean(InstructionService.class); 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_name", this.getDevice().getDevice_name());
param.put("device_type", "1"); param.put("device_type", "1");
param.put("product_area", paramService.findByCode("productArea").getValue()); 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 + "复位请求标记:" + requireSucess);
logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode); logServer.deviceExecuteLog(this.device_code, "", "", "信号mode" + last_mode + "->" + mode);
} }
@@ -252,6 +257,10 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
last_inst_message = inst_message; last_inst_message = inst_message;
if ("true".equals(this.device.getExtraValue().get("ship_device_update"))) { if ("true".equals(this.device.getExtraValue().get("ship_device_update"))) {
this.requiresShipDeviceUpdate = false; this.requiresShipDeviceUpdate = false;
if(mode>0 )
{
shipDeviceUpdate();
}
} }
} }
logServer.deviceItemValue(this.device_code, "move", String.valueOf(move)); 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.deviceItemValue(this.device_code, "task", String.valueOf(task));
logServer.deviceExecuteLog(this.device_code, "", "", "信号task" + last_task + "->" + task); logServer.deviceExecuteLog(this.device_code, "", "", "信号task" + last_task + "->" + task);
if ("true".equals(this.device.getExtraValue().get("task_update"))) { if ("true".equals(this.device.getExtraValue().get("task_update"))) {
taskDeviceUpdate(task); taskDeviceUpdate(task);
} }
} }
@@ -417,33 +425,61 @@ public class SiemensConveyorDeviceDriver extends AbstractOpcDeviceDriver impleme
last_to_height = to_height; last_to_height = to_height;
} }
private void shipDeviceUpdate() { public void shipDeviceUpdate() {
JSONObject param = new JSONObject() {{ CompletableFuture<String> future = new CompletableFuture<>();
put("device_code", device_code); // 使用线程池执行异步操作
}}; EXECUTOR.submit(() -> {
try {
JSONObject param = new JSONObject() ;
param.put("device_code", device_code);
logServer.deviceExecuteLog(this.device_code, "", "", "有货变无货请求LMS,参数:" + param); logServer.deviceExecuteLog(this.device_code, "", "", "有货变无货请求LMS,参数:" + param);
this.requiresShipDeviceUpdate = true;
HttpResponse response = acsToWmsService.shipDeviceUpdate(param); HttpResponse response = acsToWmsService.shipDeviceUpdate(param);
if (response == null || response.getStatus() == 200) { if (response == null || response.getStatus() == 200) {
logServer.deviceExecuteLog(this.device_code, "", "", "有货变无货请求LMS,接口返回:" + response.body()); logServer.deviceExecuteLog(this.device_code, "", "", "有货变无货请求LMS,接口返回:" + response.body());
this.requiresShipDeviceUpdate = true;
} }
future.complete("Async operation completed");
} catch (Exception e) {
future.completeExceptionally(e);
}
});
} }
public void sendDeviceStatus(JSONObject param) {
CompletableFuture<String> 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) { private void taskDeviceUpdate(int task) {
Instruction inst = instructionService.findByTaskcode(String.valueOf(task)); Instruction inst = instructionService.findByInsructionCode(String.valueOf(task));
ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest(); ApplyManipulatorActionRequest applyManipulatorActionRequest = new ApplyManipulatorActionRequest();
applyManipulatorActionRequest.setDevice_code(device_code); applyManipulatorActionRequest.setDevice_code(device_code);
applyManipulatorActionRequest.setAction("3"); applyManipulatorActionRequest.setAction("3");
if (ObjectUtil.isEmpty(inst)) {
logServer.deviceExecuteLog(this.device_code, "", "", "任务号不存在:" + inst);
return;
}
applyManipulatorActionRequest.setTask_code1(inst.getTask_code()); applyManipulatorActionRequest.setTask_code1(inst.getTask_code());
logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,参数:" + applyManipulatorActionRequest); logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,参数:" + applyManipulatorActionRequest);
ApplyManipulatorActionResponse response = acsToWmsService.applyManipulatorActionRequest(applyManipulatorActionRequest); try {
ApplyManipulatorActionResponse response = acsToWmsService.actionFinishRequest(applyManipulatorActionRequest);
if (response == null || response.getstatus() == 200) { if (response == null || response.getstatus() == 200) {
logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,接口返回:" + response.getMessage()); logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS,接口返回:" + response.getMessage());
} }
}catch (Exception e){
e.printStackTrace();
logServer.deviceExecuteLog(this.device_code, "", "", "task变化请求LMS失败" + e.getMessage());
}
} }

View File

@@ -5,14 +5,14 @@ import org.nl.acs.device_driver.DeviceDriver;
public interface ExecutableDeviceDriver extends DeviceDriver { public interface ExecutableDeviceDriver extends DeviceDriver {
default void executeAuto() { default void executeAuto() {
// try { try {
// this.execute();
// } catch (Throwable var6) {
// String message = "线程调用异常:" + var6.getMessage();
// Log.error(message);
// } finally {
// }
this.execute(); this.execute();
} catch (Throwable var6) {
String message = "线程调用异常:" + var6.getMessage();
Log.error(message);
} finally {
}
// this.execute();
} }

View File

@@ -23,6 +23,7 @@ import org.nl.acs.task.service.dto.TaskDto;
import org.nl.modules.system.service.ParamService; import org.nl.modules.system.service.ParamService;
import org.slf4j.MDC; import org.slf4j.MDC;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
@@ -97,6 +98,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} }
@Override @Override
// @Async
public HttpResponse feedbackTaskStatusToWms(JSONArray data) { public HttpResponse feedbackTaskStatusToWms(JSONArray data) {
try { try {
@@ -619,16 +621,20 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
public HttpResponse shipDeviceUpdate(JSONObject param) { public HttpResponse shipDeviceUpdate(JSONObject param) {
try { try {
MDC.put(log_file_type, log_type); MDC.put(log_file_type, log_type);
// log.info("shipDeviceUpdate-----输入参数{}", param); log.info("shipDeviceUpdate-----输入参数{}", param);
if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) { if (StrUtil.equals(paramService.findByCode(AcsConfig.HASWMS).getValue(), "1")) {
String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue(); String wmsUrl = paramService.findByCode(AcsConfig.WMSURL).getValue();
AddressDto addressDto = addressService.findByCode("shipDeviceUpdate"); AddressDto addressDto = addressService.findByCode("shipDeviceUpdate");
String methods_url = addressDto.getMethods_url(); String methods_url = addressDto.getMethods_url();
String url = wmsUrl + methods_url; String url = wmsUrl + methods_url;
return HttpRequest
HttpResponse resp = HttpRequest
.post(url) .post(url)
.body(param.toString()) .body(param.toString())
.execute(); .execute();
log.info("shipDeviceUpdate-----返回参数{}", resp.body());
return resp;
} }
} catch (Throwable ignored) { } catch (Throwable ignored) {
@@ -662,6 +668,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
} }
@Override @Override
// @Async
public void sendDeviceStatus(JSONObject param) { public void sendDeviceStatus(JSONObject param) {
try { try {
MDC.put(log_file_type, log_type); MDC.put(log_file_type, log_type);

View File

@@ -86,6 +86,13 @@ public interface InstructionService {
*/ */
Instruction findByTaskcode(String code); Instruction findByTaskcode(String code);
/**
* 根据指令号查询
* @param code
* @return
*/
Instruction findByInsructionCode(String code);
Instruction findByTaskcodeAndStatus(String code); Instruction findByTaskcodeAndStatus(String code);
Instruction findByTaskcodeAndStatus(String code,String status); Instruction findByTaskcodeAndStatus(String code,String status);

View File

@@ -258,6 +258,14 @@ public class InstructionServiceImpl implements InstructionService, ApplicationAu
return obj; 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 @Override
public Instruction findByTaskcodeAndStatus(String code) { public Instruction findByTaskcodeAndStatus(String code) {
Iterator var3 = instructions.iterator(); Iterator var3 = instructions.iterator();

View File

@@ -419,17 +419,19 @@ public class DeviceOpcProtocolRunable implements Runnable, DataCallback, ServerC
log.warn("设备:{}信号{}变更从{}->{};信号快照:{}", new Object[]{itemDto.getDevice_code(), itemId, his, value, sb}); 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}); // this.businessLogger.setResource(itemDto.getDevice_code(), itemDto.getDevice_name()).log("信号{}变更从{}->{};信号快照:{}", new Object[]{itemId, his, value, sb});
} else { } else {
if(his instanceof int[]){ // if(his instanceof int[]){
if(!Arrays.equals((long[]) his, (long[]) value)){ // 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}); 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});
}
// this.businessLogger.setResource(itemDto.getDevice_code(), itemDto.getDevice_name()).log("信号{}变更从{}->{}", new Object[]{itemId, his, value}); // this.businessLogger.setResource(itemDto.getDevice_code(), itemDto.getDevice_name()).log("信号{}变更从{}->{}", new Object[]{itemId, his, value});
} }
} }

View File

@@ -82,8 +82,10 @@ https://juejin.cn/post/6844903775631572999
<appender-ref ref="FILE"/> <appender-ref ref="FILE"/>
</appender> </appender>
<!--添加loki--> <!--添加loki-->
<appender name="lokiAppender" class="com.github.loki4j.logback.Loki4jAppender"> <appender name="newlokiAppender" class="com.github.loki4j.logback.Loki4jAppender">
<batchTimeoutMs>1000</batchTimeoutMs> <batchTimeoutMs>1000</batchTimeoutMs>
<http class="com.github.loki4j.logback.ApacheHttpSender"> <http class="com.github.loki4j.logback.ApacheHttpSender">
<url>${LOKI_URL}/push</url> <url>${LOKI_URL}/push</url>
@@ -99,6 +101,12 @@ https://juejin.cn/post/6844903775631572999
</format> </format>
</appender> </appender>
<appender name="lokiAppender" class="ch.qos.logback.classic.AsyncAppender">
<discardingThreshold>100</discardingThreshold>
<queueSize>500</queueSize>
<appender-ref ref="newlokiAppender"/>
</appender>
<appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender"> <appender name="ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>error</level> <level>error</level>

View File

@@ -441,6 +441,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="start_height" label="取货高度" /> <el-table-column prop="start_height" label="取货高度" />
<el-table-column prop="next_height" label="放货高度" /> <el-table-column prop="next_height" label="放货高度" />
<el-table-column prop="truss_type" label="内包间行架任务类型" />
<el-table-column prop="remark" label="备注" /> <el-table-column prop="remark" label="备注" />
<el-table-column prop="create_by" label="创建者" /> <el-table-column prop="create_by" label="创建者" />
<el-table-column prop="create_time" label="创建时间" width="135" /> <el-table-column prop="create_time" label="创建时间" width="135" />

View File

@@ -16,7 +16,7 @@ public interface CheckOutBillService {
* @param page 分页参数 * @param page 分页参数
* @return Map<String, Object> * @return Map<String, Object>
*/ */
Map<String, Object> pageQuery(Map whereJson, Pageable page); Map<String, Object> pageQuery(Map whereJson, Pageable page,String[] stor_id, String[] bill_status, String[] bill_type);
/** /**
* 查询数据分页 * 查询数据分页
@@ -294,5 +294,5 @@ public interface CheckOutBillService {
* @param response / * @param response /
* @throws IOException / * @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;
} }

View File

@@ -48,7 +48,8 @@ public class OutChargeServiceImpl implements OutChargeService {
String start_region_code = MapUtil.getStr(whereJson, "start_region_code"); String start_region_code = MapUtil.getStr(whereJson, "start_region_code");
String end_region_code = MapUtil.getStr(whereJson, "end_region_code"); String end_region_code = MapUtil.getStr(whereJson, "end_region_code");
String sap_pcsn = MapUtil.getStr(whereJson, "sap_pcsn"); 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<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
map.put("flag", "15"); map.put("flag", "15");
map.put("bill_status", MapUtil.getStr(whereJson, "bill_status")); map.put("bill_status", MapUtil.getStr(whereJson, "bill_status"));
@@ -89,6 +90,12 @@ public class OutChargeServiceImpl implements OutChargeService {
if (ObjectUtil.isNotEmpty(in_stor_id)) { if (ObjectUtil.isNotEmpty(in_stor_id)) {
map.put("in_stor_id", 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"); JSONObject json = WQL.getWO("QST_IVT_RAWASSISTISTOR").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "ios.iostorinv_id DESC");
return json; return json;

View File

@@ -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"); JSONObject jo = WQL.getWO("QST_IVT_CHECK").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "check_code desc");
JSONArray content = jo.getJSONArray("content"); JSONArray content = jo.getJSONArray("content");
if (content.isEmpty()){
return jo;
}
// 拼接主表id // 拼接主表id
String check_id = content.stream() String check_id = content.stream()
.map(row -> (JSONObject) row) .map(row -> (JSONObject) row)

View File

@@ -28,8 +28,8 @@ public class CheckOutBillController {
@Log("查询出库单") @Log("查询出库单")
@ApiOperation("查询出库单") @ApiOperation("查询出库单")
//@PreAuthorize("@el.check('checkoutbill:list')") //@PreAuthorize("@el.check('checkoutbill:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) { public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page, String[] stor_id, String[] bill_status, String[] bill_type) {
return new ResponseEntity<>(checkOutBillService.pageQuery(whereJson, page), HttpStatus.OK); return new ResponseEntity<>(checkOutBillService.pageQuery(whereJson, page,stor_id , bill_status, bill_type), HttpStatus.OK);
} }
@GetMapping("/addDtl") @GetMapping("/addDtl")
@@ -311,7 +311,7 @@ public class CheckOutBillController {
@Log("导出数据") @Log("导出数据")
@ApiOperation("导出数据") @ApiOperation("导出数据")
@GetMapping(value = "/download") @GetMapping(value = "/download")
public void download(@RequestParam Map map, HttpServletResponse response) throws IOException { public void download(@RequestParam Map map, HttpServletResponse response,String[] stor_id, String[] bill_status, String[] bill_type) throws IOException {
checkOutBillService.download(map, response); checkOutBillService.download(map, response, stor_id, bill_status, bill_type);
} }
} }

View File

@@ -60,7 +60,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
private final HandMoveStorAcsTask moveStorAcsTask; private final HandMoveStorAcsTask moveStorAcsTask;
@Override @Override
public Map<String, Object> pageQuery(Map whereJson, Pageable page) { public Map<String, Object> pageQuery(Map whereJson, Pageable page, String[] stor_id, String[] bill_status, String[] bill_type) {
HashMap<String, String> map = new HashMap<>(whereJson); HashMap<String, String> map = new HashMap<>(whereJson);
map.put("flag", "1"); map.put("flag", "1");
@@ -105,6 +105,41 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
if (ObjectUtil.isNotEmpty(in_stor_id)) { if (ObjectUtil.isNotEmpty(in_stor_id)) {
map.put("in_stor_id", 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"); JSONObject jo = WQL.getWO("QST_IVT_CHECKOUTBILL").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "iostorinv_id desc");
return jo; return jo;
@@ -682,7 +717,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
} }
@Override @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<String, String> map = new HashMap<>(whereJson); HashMap<String, String> map = new HashMap<>(whereJson);
map.put("flag", "111"); map.put("flag", "111");
@@ -719,6 +754,41 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
if (StrUtil.isNotEmpty(map.get("cust_code"))) { if (StrUtil.isNotEmpty(map.get("cust_code"))) {
map.put("cust_code", "%" + 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); 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")) { if (StrUtil.equals(jsonObject.getString("bill_type"), "1009")) {
mp.put("业务类型", "手工出库"); mp.put("业务类型", "手工出库");
} }
//计划重量、实际重量、实际毛重、车号、箱数、收货地址(调拨显示到货仓库)、单据状态
mp.put("业务日期", jsonObject.getString("biz_date")); 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_code"));
mp.put("客户名称", jsonObject.getString("cust_name")); mp.put("客户名称", jsonObject.getString("cust_name"));
mp.put("交货单号", jsonObject.getString("vbeln")); mp.put("交货单号", jsonObject.getString("vbeln"));

View File

@@ -58,6 +58,9 @@
输入.task_group_id TYPEAS s_string 输入.task_group_id TYPEAS s_string
输入.in_stor_id TYPEAS f_string 输入.in_stor_id TYPEAS f_string
输入.struct_codes 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.shd_dtl_num,
cu.cust_name, cu.cust_name,
IFNULL(dtl.vbeln,'') as vbeln, IFNULL(dtl.vbeln,'') as vbeln,
cu.cust_simple_name cu.cust_simple_name,
dtl.plan_qty
FROM FROM
ST_IVT_IOStorInv ios ST_IVT_IOStorInv ios
LEFT JOIN md_cs_customerbase cu ON ios.cust_code = cu.cust_code LEFT JOIN md_cs_customerbase cu ON ios.cust_code = cu.cust_code
@@ -132,20 +136,20 @@
dtl.width like 输入.width dtl.width like 输入.width
ENDOPTION ENDOPTION
OPTION 输入.bill_type <> "" OPTION 输入.billTypes <> ""
ios.bill_type = 输入.bill_type ios.bill_type in 输入.billTypes
ENDOPTION ENDOPTION
OPTION 输入.stor_id <> "" OPTION 输入.storIds <> ""
ios.stor_id = 输入.stor_id ios.stor_id in 输入.storIds
ENDOPTION ENDOPTION
OPTION 输入.create_mode <> "" OPTION 输入.create_mode <> ""
ios.create_mode = 输入.create_mode ios.create_mode = 输入.create_mode
ENDOPTION ENDOPTION
OPTION 输入.bill_status <> "" OPTION 输入.billStatuses <> ""
ios.bill_status = 输入.bill_status ios.bill_status in 输入.billStatuses
ENDOPTION ENDOPTION
OPTION 输入.begin_time <> "" OPTION 输入.begin_time <> ""
@@ -174,7 +178,13 @@
sub.sale_order_name, sub.sale_order_name,
CONCAT( sub.thickness_request, '*', sub.width_standard ) AS spec, CONCAT( sub.thickness_request, '*', sub.width_standard ) AS spec,
MAX(tr.cust_name) AS wl_cust_name, 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 FROM
st_ivt_iostorinvdis dis st_ivt_iostorinvdis dis
LEFT JOIN st_ivt_iostorinvdtl dtl ON dis.iostorinvdtl_id = dtl.iostorinvdtl_id 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_customerbase cu ON ios.cust_code = cu.cust_code
LEFT JOIN md_cs_transportationbase tr ON ios.trans_code = tr.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 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 WHERE
ios.io_type = '1' ios.io_type = '1'
AND ios.is_delete = '0' AND ios.is_delete = '0'
@@ -219,20 +230,20 @@
dtl.width like 输入.width dtl.width like 输入.width
ENDOPTION ENDOPTION
OPTION 输入.bill_type <> "" OPTION 输入.billTypes <> ""
ios.bill_type = 输入.bill_type ios.bill_type in 输入.billTypes
ENDOPTION ENDOPTION
OPTION 输入.stor_id <> "" OPTION 输入.storIds <> ""
ios.stor_id = 输入.stor_id ios.stor_id in 输入.storIds
ENDOPTION ENDOPTION
OPTION 输入.create_mode <> "" OPTION 输入.create_mode <> ""
ios.create_mode = 输入.create_mode ios.create_mode = 输入.create_mode
ENDOPTION ENDOPTION
OPTION 输入.bill_status <> "" OPTION 输入.billStatuses <> ""
ios.bill_status = 输入.bill_status ios.bill_status in 输入.billStatuses
ENDOPTION ENDOPTION
OPTION 输入.begin_time <> "" OPTION 输入.begin_time <> ""

View File

@@ -300,7 +300,8 @@ export default {
reset: true, reset: true,
download: false download: false
}, },
query: { io_type: '0', bill_status: '99' } query: { io_type: '0', bill_status: '99' },
queryOnPresenterCreated: false
}) })
}, },
mixins: [presenter(), header(), crud()], mixins: [presenter(), header(), crud()],
@@ -328,13 +329,20 @@ export default {
crudUserStor.getUserStor().then(res => { crudUserStor.getUserStor().then(res => {
this.storlist = res this.storlist = res
}) })
debugger // debugger
this.billtypelist = this.dict.ST_INV_IN_TYPE this.billtypelist = this.dict.ST_INV_OUT_TYPE
this.initQuery()
}, },
methods: { 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() { querytable() {
this.onSelectAll() this.onSelectAll()
this.crud.toQuery() this.crud.toQuery()

View File

@@ -109,7 +109,7 @@
/> />
</el-select> </el-select>
</el-form-item>--> </el-form-item>-->
<el-form-item label="创建时间"> <el-form-item label="创建时间" prop="createTime">
<el-date-picker <el-date-picker
v-model="query.createTime" v-model="query.createTime"
type="daterange" type="daterange"
@@ -213,7 +213,9 @@ export default {
del: false, del: false,
reset: true, reset: true,
download: false download: false
}}) },
queryOnPresenterCreated: false
})
}, },
mixins: [presenter(), header(), crud()], mixins: [presenter(), header(), crud()],
// 数据字典 // 数据字典
@@ -243,8 +245,25 @@ export default {
crudUserStor.getUserStor().then(res => { crudUserStor.getUserStor().then(res => {
this.storlist = res this.storlist = res
}) })
this.initQuery()
}, },
methods: { 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) { canUd(row) {
return row.bill_status !== '10' return row.bill_status !== '10'
}, },

View File

@@ -38,7 +38,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="创建时间" prop="createTime">
<el-date-picker <el-date-picker
v-model="query.createTime" v-model="query.createTime"
type="daterange" type="daterange"
@@ -219,7 +219,9 @@ export default {
del: false, del: false,
reset: true, reset: true,
download: false download: false
}}) },
queryOnPresenterCreated: false
})
}, },
mixins: [presenter(), header(), crud()], mixins: [presenter(), header(), crud()],
// 数据字典 // 数据字典
@@ -251,8 +253,25 @@ export default {
crudUserStor.getUserStor().then(res => { crudUserStor.getUserStor().then(res => {
this.storlist = res this.storlist = res
}) })
this.initQuery()
}, },
methods: { 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) { canUd(row) {
return row.status !== '1' return row.status !== '1'
}, },

View File

@@ -38,7 +38,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="创建时间" prop="createTime">
<el-date-picker <el-date-picker
v-model="query.createTime" v-model="query.createTime"
type="daterange" type="daterange"
@@ -262,7 +262,8 @@ export default {
optShow: { add: true, reset: true }, optShow: { add: true, reset: true },
idField: 'iostorinv_id', idField: 'iostorinv_id',
url: '/api/in/rawAssist', url: '/api/in/rawAssist',
crudMethod: { ...rawAssist } crudMethod: { ...rawAssist },
queryOnPresenterCreated: false
}) })
}, },
mixins: [presenter(), header(), crud()], mixins: [presenter(), header(), crud()],
@@ -309,8 +310,25 @@ export default {
crudUserStor.getUserStor().then(res => { crudUserStor.getUserStor().then(res => {
this.storlist = res this.storlist = res
}) })
this.initQuery()
}, },
methods: { 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) { fun(val) {
return Number(val).toFixed(3) return Number(val).toFixed(3)
}, },

View File

@@ -38,7 +38,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="创建时间" prop="createTime">
<el-date-picker <el-date-picker
v-model="query.createTime" v-model="query.createTime"
type="daterange" type="daterange"
@@ -79,8 +79,8 @@
> >
<el-option <el-option
v-for="item in dict.ST_INV_IN_TYPE" v-for="item in dict.ST_INV_IN_TYPE"
:disabled="item.value !== '0002'"
:key="item.value" :key="item.value"
:disabled="item.value !== '0002'"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
/> />
@@ -189,7 +189,8 @@ export default {
del: false, del: false,
download: false, download: false,
reset: false reset: false
} },
queryOnPresenterCreated: false
}) })
}, },
mixins: [presenter(), header(), crud()], mixins: [presenter(), header(), crud()],
@@ -208,11 +209,28 @@ export default {
crudUserStor.getUserStor().then(res => { crudUserStor.getUserStor().then(res => {
this.storlist = res this.storlist = res
}) })
this.initQuery()
}, },
methods: { 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) { toView(index, row) {
this.mstrow = row this.mstrow = row
this.viewShow = true this.viewShow = true

View File

@@ -23,11 +23,12 @@
<el-form-item label="所属仓库"> <el-form-item label="所属仓库">
<el-select <el-select
v-model="query.stor_id" v-model="query.stor_id"
multiple
collapse-tags
clearable clearable
size="mini" size="mini"
placeholder="全部" placeholder="全部"
class="filter-item" class="filter-item"
@change="crud.toQuery"
> >
<el-option <el-option
v-for="item in storlist" v-for="item in storlist"
@@ -59,11 +60,12 @@
<el-form-item label="单据状态"> <el-form-item label="单据状态">
<el-select <el-select
v-model="query.bill_status" v-model="query.bill_status"
multiple
collapse-tags
clearable clearable
size="mini" size="mini"
placeholder="单据状态" placeholder="单据状态"
class="filter-item" class="filter-item"
@change="crud.toQuery"
> >
<el-option <el-option
v-for="item in dict.io_bill_status" v-for="item in dict.io_bill_status"
@@ -77,12 +79,13 @@
<el-form-item label="业务类型"> <el-form-item label="业务类型">
<el-select <el-select
v-model="query.bill_type" v-model="query.bill_type"
multiple
collapse-tags
clearable clearable
filterable filterable
size="mini" size="mini"
placeholder="业务类型" placeholder="业务类型"
class="filter-item" class="filter-item"
@change="crud.toQuery"
> >
<el-option <el-option
v-for="item in dict.ST_INV_OUT_TYPE" v-for="item in dict.ST_INV_OUT_TYPE"
@@ -154,7 +157,7 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="创建时间" prop="createTime">
<el-date-picker <el-date-picker
v-model="query.createTime" v-model="query.createTime"
type="daterange" type="daterange"
@@ -295,7 +298,13 @@
<el-table-column show-overflow-tooltip prop="bill_type" :formatter="bill_typeFormat" label="业务类型" /> <el-table-column show-overflow-tooltip prop="bill_type" :formatter="bill_typeFormat" label="业务类型" />
<el-table-column show-overflow-tooltip width="100" prop="biz_date" label="业务日期" /> <el-table-column show-overflow-tooltip width="100" prop="biz_date" label="业务日期" />
<el-table-column show-overflow-tooltip label="明细数" align="center" prop="detail_count" width="60" /> <el-table-column show-overflow-tooltip label="明细数" align="center" prop="detail_count" width="60" />
<el-table-column show-overflow-tooltip label="重量" align="center" prop="total_qty" width="100" /> <el-table-column show-overflow-tooltip label="计划重量" align="center" prop="total_qty" width="100" />
<el-table-column show-overflow-tooltip label="实际重量" align="center" prop="plan_qty" width="100" />
<el-table-column show-overflow-tooltip label="收货地址" align="center" prop="total_qty" width="100">
<template slot-scope="scope">
{{ scope.row.bill_type === '1004' ? scope.row.stor_name : scope.row.receiptaddress }}
</template>
</el-table-column>
<el-table-column show-overflow-tooltip label="客户" align="center" prop="cust_simple_name" width="100" /> <el-table-column show-overflow-tooltip label="客户" align="center" prop="cust_simple_name" width="100" />
<el-table-column show-overflow-tooltip label="客户编码" align="center" prop="cust_code" width="100" /> <el-table-column show-overflow-tooltip label="客户编码" align="center" prop="cust_code" width="100" />
<el-table-column show-overflow-tooltip label="交货单号" align="center" prop="vbeln" width="100" /> <el-table-column show-overflow-tooltip label="交货单号" align="center" prop="vbeln" width="100" />
@@ -349,7 +358,9 @@ export default {
del: false, del: false,
reset: true, reset: true,
download: false download: false
}}) },
queryOnPresenterCreated: false
})
}, },
mixins: [presenter(), header(), crud()], mixins: [presenter(), header(), crud()],
// 数据字典 // 数据字典
@@ -393,8 +404,25 @@ export default {
crudUserStor.getUserStor().then(res => { crudUserStor.getUserStor().then(res => {
this.storlist = res this.storlist = res
}) })
this.initQuery()
}, },
methods: { 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) { canUd(row) {
return row.bill_status !== '10' return row.bill_status !== '10'
}, },

View File

@@ -38,7 +38,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="创建时间"> <el-form-item label="创建时间" prop="createTime">
<el-date-picker <el-date-picker
v-model="query.createTime" v-model="query.createTime"
type="daterange" type="daterange"
@@ -78,8 +78,8 @@
> >
<el-option <el-option
v-for="item in dict.ST_INV_OUT_TYPE" v-for="item in dict.ST_INV_OUT_TYPE"
:disabled="item.value !== '1001' && item.value !== '1009'"
:key="item.value" :key="item.value"
:disabled="item.value !== '1001' && item.value !== '1009'"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
/> />
@@ -191,7 +191,8 @@ export default {
del: false, del: false,
download: false, download: false,
reset: false reset: false
} },
queryOnPresenterCreated: false
}) })
}, },
mixins: [presenter(), header(), crud()], mixins: [presenter(), header(), crud()],
@@ -214,11 +215,28 @@ export default {
crudUserStor.getUserStor().then(res => { crudUserStor.getUserStor().then(res => {
this.storlist = res this.storlist = res
}) })
this.initQuery()
}, },
methods: { 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) { toView(index, row) {
this.mstrow = row this.mstrow = row
this.viewShow = true this.viewShow = true