成品接口提交
parent
811d96064b
commit
9239862d6c
13
.classpath
13
.classpath
|
|
@ -24,8 +24,6 @@
|
|||
<classpathentry kind="var" path="MAVEN_REPO/springframework/jars/spring-2m.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/springframework/jars/spring-mock-2.0-rc3.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/jta/jars/jta-1.0.1.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/javamail/jars/mail-1.3.2.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/jaf/jars/activation-1.0.2.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/gwt/jars/gwt-user-1.5.3.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/gwt/jars/gwt-servlet-1.5.3.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/commons-codec/jars/commons-codec-1.3.jar"/>
|
||||
|
|
@ -75,11 +73,11 @@
|
|||
<classpathentry kind="var" path="MAVEN_REPO/pdfbox/jars/pdfbox-2.0.12.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/json/jars/ezmorph-1.0.3.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/json/jars/json-1.1.1.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/json/jars/fastjson-1.2.7.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/json/jars/json-lib-2.1-jdk15.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/gson/jars/gson-2.8.5.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/pinyin/jars/pinyin4j-2.5.0.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/sqlserver/jars/sqljdbc4-2.0.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/json/jars/fastjson-1.2.7.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/gson/jars/gson-2.8.5.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/javax/axis2/axiom-api-1.2.20.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/javax/axis2/axiom-dom-1.2.20.jar"/>
|
||||
<classpathentry kind="var" path="MAVEN_REPO/javax/axis2/axiom-impl-1.2.20.jar"/>
|
||||
|
|
@ -123,5 +121,12 @@
|
|||
<classpathentry kind="lib" path="D:/maven-1.0.2/repository/commons-el/jars/commons-el.jar"/>
|
||||
<classpathentry kind="lib" path="D:/maven-1.0.2/repository/jstl/jars/jstl.jar"/>
|
||||
<classpathentry kind="lib" path="D:/maven-1.0.2/repository/jstl/jars/standard.jar"/>
|
||||
<classpathentry kind="lib" path="D:/maven-1.0.2/repository/mq/jars/amqp-client-5.13.1.jar"/>
|
||||
<classpathentry kind="lib" path="D:/maven-1.0.2/repository/jjwt/jar/jjwt-api-0.11.5.jar"/>
|
||||
<classpathentry kind="lib" path="D:/maven-1.0.2/repository/jjwt/jar/jjwt-impl-0.11.5.jar"/>
|
||||
<classpathentry kind="lib" path="D:/maven-1.0.2/repository/jjwt/jar/jjwt-jackson-0.11.5.jar"/>
|
||||
<classpathentry kind="lib" path="D:/maven-1.0.2/repository/jjwt/jar/jackson-annotations-2.12.1.jar"/>
|
||||
<classpathentry kind="lib" path="D:/maven-1.0.2/repository/jjwt/jar/jackson-core-2.12.1.jar"/>
|
||||
<classpathentry kind="lib" path="D:/maven-1.0.2/repository/jjwt/jar/jackson-databind-2.12.1.jar"/>
|
||||
<classpathentry kind="output" path="target/zwwms/WEB-INF/classes"/>
|
||||
</classpath>
|
||||
|
|
|
|||
56
project.xml
56
project.xml
|
|
@ -753,8 +753,60 @@
|
|||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>3.16</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<!-- JWT (如果使用JWT生成) -->
|
||||
<!-- JWT依赖 -->
|
||||
<!-- <dependency> -->
|
||||
<!-- <groupId>io.jsonwebtoken</groupId> -->
|
||||
<!-- <artifactId>jjwt</artifactId> -->
|
||||
<!-- <version>0.9.1</version> -->
|
||||
<!-- </dependency> -->
|
||||
<!-- JJWT for JWT token generation -->
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-api</artifactId>
|
||||
<version>0.11.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-impl</artifactId>
|
||||
<version>0.11.5</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-jackson</artifactId>
|
||||
<version>0.11.5</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.rabbitmq</groupId>
|
||||
<artifactId>amqp-client</artifactId>
|
||||
<version>5.13.1</version>
|
||||
</dependency>
|
||||
<!-- 示例:在pom.xml中引入Spring 5.3.27模块 -->
|
||||
<properties>
|
||||
<spring.version>5.3.27</spring.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-beans</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import java.time.DayOfWeek;
|
|||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
|
@ -65,26 +66,31 @@ public class PostTest {
|
|||
// logger.info("date---"+date);
|
||||
// logger.info("month---"+month);
|
||||
// logger.info("year---"+year);
|
||||
|
||||
// 获取当前日期
|
||||
LocalDate today = LocalDate.now();
|
||||
|
||||
// 获取当前是周几
|
||||
DayOfWeek dayOfWeek = today.getDayOfWeek();
|
||||
|
||||
System.out.println("今天是: " + today);
|
||||
System.out.println("今天是周: " + dayOfWeek);
|
||||
|
||||
// 检查是否为工作日(周一到周五)
|
||||
if (dayOfWeek != DayOfWeek.SATURDAY && dayOfWeek != DayOfWeek.SUNDAY) {
|
||||
System.out.println("今天是工作日,执行任务...");
|
||||
// 这里放置需要在工作日执行的代码
|
||||
|
||||
} else {
|
||||
System.out.println("今天是周末,不执行任务。");
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// // 获取当前日期
|
||||
// LocalDate today = LocalDate.now();
|
||||
//
|
||||
// // 获取当前是周几
|
||||
// DayOfWeek dayOfWeek = today.getDayOfWeek();
|
||||
//
|
||||
// System.out.println("今天是: " + today);
|
||||
// System.out.println("今天是周: " + dayOfWeek);
|
||||
//
|
||||
// // 检查是否为工作日(周一到周五)
|
||||
// if (dayOfWeek != DayOfWeek.SATURDAY && dayOfWeek != DayOfWeek.SUNDAY) {
|
||||
// System.out.println("今天是工作日,执行任务...");
|
||||
// // 这里放置需要在工作日执行的代码
|
||||
//
|
||||
// } else {
|
||||
// System.out.println("今天是周末,不执行任务。");
|
||||
// }
|
||||
//
|
||||
//# 假设这是你的JWT令牌
|
||||
String encodedStr = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJYR0FURUFNRUMiLCJpc3MiOiIgYW1lY3Rlc3QiLCJuYW1lIjoiY3VzdG9tYXBwIiwidCI6ImVkNzBhY2QwLXNvZmEtMjJlOS05NjBmLTQxYjIwMzNkZGUxOSIsImlhdCI6MTUxNjIzOTAyMiwiZXhwIjoxNzM4MzA5NDk2fQ.OU30Rh_3g564gfv0Qfho7CNSf-13UY1SLKgVep5Dvp0";
|
||||
//Base64编码"的Base64形式
|
||||
byte[] decodedBytes = Base64.getDecoder().decode(encodedStr);
|
||||
String originalStr = new String(decodedBytes);
|
||||
System.out.println("解码后: " + originalStr);
|
||||
|
||||
// String ts="10-11-02";
|
||||
// logger.info(ts.substring(6, 2));
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
<!-- 下发agv任务 -->
|
||||
<!-- <ref bean="autoAutoBigTaskTrigger"/> -->
|
||||
<!-- 定时播种墙各种下发任务 -->
|
||||
<ref bean="createSeedWallTrigger"/>
|
||||
<!-- <ref bean="createSeedWallTrigger"/> -->
|
||||
<!-- 货架区返库 -->
|
||||
<!-- <ref bean="autoReturnHjTrigger"/> -->
|
||||
<!-- 立库任务下发 出库-->
|
||||
|
|
|
|||
|
|
@ -0,0 +1,379 @@
|
|||
package com.dev.swms.client;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.*;
|
||||
|
||||
/**
|
||||
* 完整的Token客户端 - 支持X-Authorization头
|
||||
*/
|
||||
public class GatewayTokenClient {
|
||||
|
||||
private String token;
|
||||
private String baseUrl;
|
||||
|
||||
// OAuth2配置参数
|
||||
private final String clientId = "AMEC_WMS";
|
||||
private final String clientSecret = "ed4fbb4c6f6c";
|
||||
private final String tenant = "603b299d29924b9d04147526";
|
||||
|
||||
// Gateway鉴权token(如果需要)
|
||||
private String gatewayToken;
|
||||
|
||||
public GatewayTokenClient(String baseUrl) {
|
||||
this.baseUrl = baseUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置Gateway鉴权token
|
||||
*/
|
||||
public void setGatewayToken(String gatewayToken) {
|
||||
this.gatewayToken = gatewayToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取访问令牌 - OAuth2客户端凭证模式
|
||||
*/
|
||||
public boolean getAccessToken() {
|
||||
try {
|
||||
String tokenUrl = baseUrl + "/oauth/token";
|
||||
|
||||
// 构建表单参数
|
||||
String formData = "grant_type=client_credentials" +
|
||||
"&client_id=" + clientId +
|
||||
"&client_secret=" + clientSecret +
|
||||
"&tenant=" + tenant;
|
||||
|
||||
// 发送请求 - 添加X-Authorization头
|
||||
String response = sendFormPostRequest(tokenUrl, formData, true);
|
||||
|
||||
// 使用JSON解析工具提取token
|
||||
if (response != null) {
|
||||
String extractedToken = extractTokenFromResponse(response);
|
||||
if (extractedToken != null) {
|
||||
this.token = extractedToken;
|
||||
System.out.println("Token获取成功");
|
||||
return true;
|
||||
} else {
|
||||
String error = extractErrorFromResponse(response);
|
||||
System.out.println("Token获取失败: " + error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("获取token异常: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送表单POST请求
|
||||
* @param includeGatewayAuth 是否包含X-Authorization头
|
||||
*/
|
||||
private String sendFormPostRequest(String urlStr, String formData, boolean includeGatewayAuth) throws IOException {
|
||||
URL url = new URL(urlStr);
|
||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
|
||||
try {
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||
connection.setRequestProperty("Accept", "application/json");
|
||||
|
||||
// Basic认证头 (client_id:client_secret)
|
||||
String auth = clientId + ":" + clientSecret;
|
||||
String encodedAuth = base64Encode(auth);
|
||||
connection.setRequestProperty("Authorization", "Basic " + encodedAuth);
|
||||
|
||||
// 添加X-Authorization头(如果提供了gatewayToken且需要包含)
|
||||
if (includeGatewayAuth && gatewayToken != null && !gatewayToken.isEmpty()) {
|
||||
connection.setRequestProperty("X-Authorization", gatewayToken);
|
||||
System.out.println("已添加X-Authorization头: " + gatewayToken);
|
||||
}
|
||||
|
||||
connection.setDoOutput(true);
|
||||
connection.setConnectTimeout(10000);
|
||||
connection.setReadTimeout(15000);
|
||||
|
||||
// 发送表单数据
|
||||
try (OutputStream os = connection.getOutputStream();
|
||||
OutputStreamWriter osw = new OutputStreamWriter(os, "UTF-8")) {
|
||||
osw.write(formData);
|
||||
osw.flush();
|
||||
}
|
||||
|
||||
// 读取响应
|
||||
int status = connection.getResponseCode();
|
||||
System.out.println("HTTP状态码: " + status);
|
||||
|
||||
InputStream inputStream = status < 400 ? connection.getInputStream() : connection.getErrorStream();
|
||||
|
||||
if (inputStream == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"))) {
|
||||
StringBuilder response = new StringBuilder();
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
response.append(line);
|
||||
}
|
||||
return response.toString();
|
||||
}
|
||||
|
||||
} finally {
|
||||
connection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用需要token的API
|
||||
*/
|
||||
public String callApi(String apiPath, String requestBody) {
|
||||
return callApi(apiPath, requestBody, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用需要token的API(可控制是否包含X-Authorization)
|
||||
*/
|
||||
public String callApi(String apiPath, String requestBody, boolean includeGatewayAuth) {
|
||||
if (token == null) {
|
||||
throw new IllegalStateException("请先调用getAccessToken方法获取token");
|
||||
}
|
||||
|
||||
try {
|
||||
String apiUrl = baseUrl + apiPath;
|
||||
return sendJsonPostRequest(apiUrl, requestBody, includeGatewayAuth);
|
||||
} catch (Exception e) {
|
||||
System.err.println("调用API异常: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送JSON POST请求(带token认证和X-Authorization)
|
||||
*/
|
||||
private String sendJsonPostRequest(String urlStr, String jsonBody, boolean includeGatewayAuth) throws IOException {
|
||||
URL url = new URL(urlStr);
|
||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
|
||||
try {
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
|
||||
connection.setRequestProperty("Accept", "application/json");
|
||||
connection.setRequestProperty("Authorization", "Bearer " + token);
|
||||
connection.setRequestProperty("X-Tenant-ID", tenant);
|
||||
|
||||
// 添加X-Authorization头
|
||||
if (includeGatewayAuth && gatewayToken != null && !gatewayToken.isEmpty()) {
|
||||
connection.setRequestProperty("X-Authorization", gatewayToken);
|
||||
System.out.println("已添加X-Authorization头: " + gatewayToken);
|
||||
}
|
||||
|
||||
connection.setDoOutput(true);
|
||||
connection.setConnectTimeout(10000);
|
||||
connection.setReadTimeout(15000);
|
||||
|
||||
// 发送JSON数据
|
||||
if (jsonBody != null && !jsonBody.isEmpty()) {
|
||||
try (OutputStream os = connection.getOutputStream();
|
||||
OutputStreamWriter osw = new OutputStreamWriter(os, "UTF-8")) {
|
||||
osw.write(jsonBody);
|
||||
osw.flush();
|
||||
}
|
||||
}
|
||||
|
||||
// 读取响应
|
||||
int status = connection.getResponseCode();
|
||||
System.out.println("API调用HTTP状态码: " + status);
|
||||
|
||||
InputStream inputStream = status < 400 ? connection.getInputStream() : connection.getErrorStream();
|
||||
|
||||
if (inputStream == null) {
|
||||
return "{\"error\":\"No response body, status: " + status + "\"}";
|
||||
}
|
||||
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"))) {
|
||||
StringBuilder response = new StringBuilder();
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
response.append(line);
|
||||
}
|
||||
return response.toString();
|
||||
}
|
||||
|
||||
} finally {
|
||||
connection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 简单的Base64编码
|
||||
*/
|
||||
private String base64Encode(String str) {
|
||||
try {
|
||||
// 使用sun.misc.BASE64Encoder(老JDK中有)
|
||||
sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
|
||||
return encoder.encode(str.getBytes("UTF-8"));
|
||||
} catch (Exception e) {
|
||||
// 备用方案:手动实现简单的base64
|
||||
return manualBase64Encode(str);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动Base64编码(备用方案)
|
||||
*/
|
||||
private String manualBase64Encode(String str) {
|
||||
try {
|
||||
byte[] bytes = str.getBytes("UTF-8");
|
||||
StringBuilder result = new StringBuilder();
|
||||
char[] base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray();
|
||||
|
||||
int i = 0;
|
||||
while (i < bytes.length) {
|
||||
int byte1 = bytes[i++] & 0xFF;
|
||||
int byte2 = i < bytes.length ? bytes[i++] & 0xFF : 0;
|
||||
int byte3 = i < bytes.length ? bytes[i++] & 0xFF : 0;
|
||||
|
||||
int triple = (byte1 << 16) | (byte2 << 8) | byte3;
|
||||
|
||||
result.append(base64Chars[(triple >> 18) & 0x3F]);
|
||||
result.append(base64Chars[(triple >> 12) & 0x3F]);
|
||||
result.append(i > bytes.length + 1 ? '=' : base64Chars[(triple >> 6) & 0x3F]);
|
||||
result.append(i > bytes.length ? '=' : base64Chars[triple & 0x3F]);
|
||||
}
|
||||
return result.toString();
|
||||
} catch (Exception e) {
|
||||
return str; // 如果编码失败,返回原字符串
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从JSON响应中提取token
|
||||
*/
|
||||
private String extractTokenFromResponse(String jsonResponse) {
|
||||
if (jsonResponse == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 简单模式匹配提取access_token
|
||||
Pattern pattern = Pattern.compile("\"access_token\"\\s*:\\s*\"([^\"]+)\"");
|
||||
Matcher matcher = pattern.matcher(jsonResponse);
|
||||
|
||||
if (matcher.find()) {
|
||||
return matcher.group(1);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从JSON响应中提取错误信息
|
||||
*/
|
||||
private String extractErrorFromResponse(String jsonResponse) {
|
||||
if (jsonResponse == null) {
|
||||
return "Empty response";
|
||||
}
|
||||
|
||||
Pattern pattern = Pattern.compile("\"error\"\\s*:\\s*\"([^\"]+)\"");
|
||||
Matcher matcher = pattern.matcher(jsonResponse);
|
||||
|
||||
if (matcher.find()) {
|
||||
return matcher.group(1);
|
||||
}
|
||||
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动构建简单JSON(替代Jackson)
|
||||
*/
|
||||
public String buildSimpleJson(Map<String, Object> params) {
|
||||
StringBuilder json = new StringBuilder();
|
||||
json.append("{");
|
||||
boolean first = true;
|
||||
for (Map.Entry<String, Object> entry : params.entrySet()) {
|
||||
if (!first) {
|
||||
json.append(",");
|
||||
}
|
||||
json.append("\"").append(entry.getKey()).append("\":");
|
||||
Object value = entry.getValue();
|
||||
if (value instanceof String) {
|
||||
json.append("\"").append(escapeJsonString(value.toString())).append("\"");
|
||||
} else if (value instanceof Number) {
|
||||
json.append(value);
|
||||
} else if (value instanceof Boolean) {
|
||||
json.append(value);
|
||||
} else {
|
||||
json.append("\"").append(escapeJsonString(value.toString())).append("\"");
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
json.append("}");
|
||||
return json.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 转义JSON字符串中的特殊字符
|
||||
*/
|
||||
private String escapeJsonString(String str) {
|
||||
return str.replace("\\", "\\\\")
|
||||
.replace("\"", "\\\"")
|
||||
.replace("\b", "\\b")
|
||||
.replace("\f", "\\f")
|
||||
.replace("\n", "\\n")
|
||||
.replace("\r", "\\r")
|
||||
.replace("\t", "\\t");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前token
|
||||
*/
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
/**
|
||||
* 完整的示例使用方法
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// 替换为实际的认证服务器地址
|
||||
GatewayTokenClient client = new GatewayTokenClient("http://your-auth-server");
|
||||
|
||||
// 设置Gateway鉴权token(根据实际情况设置)
|
||||
client.setGatewayToken("your-gateway-token-here");
|
||||
|
||||
// 1. 获取token(会包含X-Authorization头)
|
||||
if (client.getAccessToken()) {
|
||||
System.out.println("成功获取token: " + client.getToken());
|
||||
|
||||
// 2. 构建请求数据
|
||||
Map<String, Object> requestData = new HashMap<String, Object>();
|
||||
requestData.put("skuCode", "SKU001");
|
||||
requestData.put("warehouseCode", "WH001");
|
||||
requestData.put("quantity", 100);
|
||||
requestData.put("action", "query");
|
||||
|
||||
// 3. 构建JSON请求
|
||||
String jsonRequest = client.buildSimpleJson(requestData);
|
||||
System.out.println("请求JSON: " + jsonRequest);
|
||||
|
||||
// 4. 调用API(默认会包含X-Authorization头)
|
||||
String response = client.callApi("/api/inventory/query", jsonRequest);
|
||||
|
||||
System.out.println("API响应: " + response);
|
||||
|
||||
// 5. 也可以调用不需要X-Authorization的API
|
||||
// String response2 = client.callApi("/api/public/data", jsonRequest, false);
|
||||
} else {
|
||||
System.out.println("获取token失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
package com.dev.swms.client;
|
||||
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import io.jsonwebtoken.SignatureAlgorithm;
|
||||
import io.jsonwebtoken.security.Keys;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.crypto.SecretKey;
|
||||
|
||||
public class JwtTokenGenerator {
|
||||
|
||||
/**
|
||||
* 生成JWT Token
|
||||
*
|
||||
* @param secret 密钥字符串
|
||||
* @param iss 签发机构
|
||||
* @param name 用户名
|
||||
* @param t 参数t的值
|
||||
* @return JWT Token字符串
|
||||
*/
|
||||
public static String generateToken(String secret, String iss, String name, String t) {
|
||||
// 获取当前时间和过期时间(当前时间 + 10分钟)
|
||||
Date now = new Date();
|
||||
Date expiration = new Date(now.getTime() + 10 * 60 * 1000); // 10分钟
|
||||
|
||||
// 创建payload claims
|
||||
Map<String, Object> claims = new HashMap<>();
|
||||
claims.put("sub", "XGATEAMEC");
|
||||
claims.put("iss", iss);
|
||||
claims.put("name", name);
|
||||
claims.put("t", t);
|
||||
claims.put("iat", now.getTime() / 1000); // JWT标准使用秒级时间戳
|
||||
claims.put("exp", expiration.getTime() / 1000);
|
||||
|
||||
// 生成密钥
|
||||
SecretKey key = Keys.hmacShaKeyFor(secret.getBytes());
|
||||
|
||||
// 生成JWT Token
|
||||
return Jwts.builder()
|
||||
.setClaims(claims)
|
||||
.signWith(key, SignatureAlgorithm.HS256)
|
||||
.compact();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成JWT Token(使用自定义过期时间)
|
||||
*
|
||||
* @param secret 密钥字符串
|
||||
* @param iss 签发机构
|
||||
* @param name 用户名
|
||||
* @param t 参数t的值
|
||||
* @param expirationMinutes 过期时间(分钟)
|
||||
* @return JWT Token字符串
|
||||
*/
|
||||
public static String generateToken(String secret, String iss, String name, String t, int expirationMinutes) {
|
||||
Date now = new Date();
|
||||
Date expiration = new Date(now.getTime() + expirationMinutes * 60 * 1000);
|
||||
|
||||
Map<String, Object> claims = new HashMap<>();
|
||||
claims.put("sub", "XGATEAMEC");
|
||||
claims.put("iss", iss);
|
||||
claims.put("name", name);
|
||||
claims.put("admin", t);
|
||||
claims.put("iat", now.getTime() / 1000);
|
||||
claims.put("exp", expiration.getTime() / 1000);
|
||||
|
||||
SecretKey key = Keys.hmacShaKeyFor(secret.getBytes());
|
||||
|
||||
return Jwts.builder()
|
||||
.setClaims(claims)
|
||||
.signWith(key, SignatureAlgorithm.HS256)
|
||||
.compact();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,154 @@
|
|||
package com.dev.swms.client;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 简化版Gateway客户端 - 直接使用X-Authorization token
|
||||
*/
|
||||
public class SimpleGatewayClient {
|
||||
|
||||
private String baseUrl;
|
||||
private String gatewayToken;
|
||||
|
||||
public SimpleGatewayClient(String baseUrl, String gatewayToken) {
|
||||
this.baseUrl = baseUrl;
|
||||
this.gatewayToken = gatewayToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* 调用Gateway保护的API
|
||||
*/
|
||||
public String callGatewayApi(String apiPath, String requestBody) {
|
||||
try {
|
||||
String apiUrl = baseUrl + apiPath;
|
||||
return sendJsonPostRequest(apiUrl, requestBody);
|
||||
} catch (Exception e) {
|
||||
System.err.println("调用Gateway API异常: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送JSON POST请求(只使用X-Authorization)
|
||||
*/
|
||||
private String sendJsonPostRequest(String urlStr, String jsonBody) throws IOException {
|
||||
URL url = new URL(urlStr);
|
||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
|
||||
try {
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
|
||||
connection.setRequestProperty("Accept", "application/json");
|
||||
|
||||
// 只使用X-Authorization头进行Gateway鉴权
|
||||
if (gatewayToken != null && !gatewayToken.isEmpty()) {
|
||||
connection.setRequestProperty("X-Authorization", gatewayToken);
|
||||
System.out.println("已添加X-Authorization头: " + gatewayToken);
|
||||
}
|
||||
|
||||
connection.setDoOutput(true);
|
||||
connection.setConnectTimeout(10000);
|
||||
connection.setReadTimeout(15000);
|
||||
|
||||
// 发送JSON数据
|
||||
if (jsonBody != null && !jsonBody.isEmpty()) {
|
||||
try (OutputStream os = connection.getOutputStream();
|
||||
OutputStreamWriter osw = new OutputStreamWriter(os, "UTF-8")) {
|
||||
osw.write(jsonBody);
|
||||
osw.flush();
|
||||
}
|
||||
}
|
||||
|
||||
// 读取响应
|
||||
int status = connection.getResponseCode();
|
||||
System.out.println("Gateway API调用HTTP状态码: " + status);
|
||||
|
||||
InputStream inputStream = status < 400 ? connection.getInputStream() : connection.getErrorStream();
|
||||
|
||||
if (inputStream == null) {
|
||||
return "{\"error\":\"No response body, status: " + status + "\"}";
|
||||
}
|
||||
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"))) {
|
||||
StringBuilder response = new StringBuilder();
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
response.append(line);
|
||||
}
|
||||
return response.toString();
|
||||
}
|
||||
|
||||
} finally {
|
||||
connection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动构建简单JSON
|
||||
*/
|
||||
public String buildSimpleJson(Map<String, Object> params) {
|
||||
StringBuilder json = new StringBuilder();
|
||||
json.append("{");
|
||||
boolean first = true;
|
||||
for (Map.Entry<String, Object> entry : params.entrySet()) {
|
||||
if (!first) {
|
||||
json.append(",");
|
||||
}
|
||||
json.append("\"").append(entry.getKey()).append("\":");
|
||||
Object value = entry.getValue();
|
||||
if (value instanceof String) {
|
||||
json.append("\"").append(escapeJsonString(value.toString())).append("\"");
|
||||
} else if (value instanceof Number) {
|
||||
json.append(value);
|
||||
} else if (value instanceof Boolean) {
|
||||
json.append(value);
|
||||
} else {
|
||||
json.append("\"").append(escapeJsonString(value.toString())).append("\"");
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
json.append("}");
|
||||
return json.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 转义JSON字符串中的特殊字符
|
||||
*/
|
||||
private String escapeJsonString(String str) {
|
||||
return str.replace("\\", "\\\\")
|
||||
.replace("\"", "\\\"")
|
||||
.replace("\b", "\\b")
|
||||
.replace("\f", "\\f")
|
||||
.replace("\n", "\\n")
|
||||
.replace("\r", "\\r")
|
||||
.replace("\t", "\\t");
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用示例
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// 创建Gateway客户端
|
||||
SimpleGatewayClient client = new SimpleGatewayClient(
|
||||
"http://your-gateway-server",
|
||||
"your-gateway-token-here"
|
||||
);
|
||||
|
||||
// 构建请求数据
|
||||
Map<String, Object> requestData = new HashMap<String, Object>();
|
||||
requestData.put("action", "queryInventory");
|
||||
requestData.put("warehouse", "WH001");
|
||||
requestData.put("sku", "SKU12345");
|
||||
|
||||
// 调用API
|
||||
String jsonRequest = client.buildSimpleJson(requestData);
|
||||
String response = client.callGatewayApi("/api/wms/inventory", jsonRequest);
|
||||
|
||||
System.out.println("Gateway API响应: " + response);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,156 @@
|
|||
package com.dev.swms.client;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 简化的Token获取测试类
|
||||
*/
|
||||
public class SimpleTokenTest {
|
||||
|
||||
private final String TOKEN_URL = "https://apintodev.amecnsh.com/AMEC4/wms/oauth/token";
|
||||
|
||||
public static void main(String[] args) {
|
||||
SimpleTokenTest test = new SimpleTokenTest();
|
||||
test.testGetToken();
|
||||
}
|
||||
|
||||
public void testGetToken() {
|
||||
try {
|
||||
// 构建表单数据
|
||||
String formData = "grant_type=client_credentials" +
|
||||
"&client_id=AMEC_WMS" +
|
||||
"&client_secret=ed4fbb4c6f6c" +
|
||||
"&tenant=603b299d29924b9d04147526";
|
||||
|
||||
// 生成简单的X-Authorization JWT(使用固定值)
|
||||
String xAuthToken = generateSimpleJwt();
|
||||
|
||||
// 发送请求
|
||||
String response = sendPostRequest(TOKEN_URL, formData, xAuthToken);
|
||||
|
||||
System.out.println("=== Token获取测试结果 ===");
|
||||
System.out.println("响应: " + response);
|
||||
|
||||
// 解析token
|
||||
if (response != null && response.contains("access_token")) {
|
||||
int start = response.indexOf("access_token") + 15;
|
||||
int end = response.indexOf("\"", start);
|
||||
String token = response.substring(start, end);
|
||||
System.out.println("提取的Token: " + token);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("测试异常: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成简单的JWT(用于测试)
|
||||
*/
|
||||
private String generateSimpleJwt() {
|
||||
try {
|
||||
// 使用固定的header和payload进行测试
|
||||
String header = "{\"alg\":\"HS256\",\"typ\":\"JWT\"}";
|
||||
String payload = "{\"sub\":\"XGATEAMEC\",\"iss\":\"amectest\",\"name\":\"customapp\",\"t\":\"ed70acd0-sofa-22e9-960f-41b2033dde19\",\"iat\":1616269022,\"exp\":1767052800}";
|
||||
|
||||
sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
|
||||
String encodedHeader = encoder.encode(header.getBytes("UTF-8"))
|
||||
.replace('+', '-').replace('/', '_').replace("=", "");
|
||||
String encodedPayload = encoder.encode(payload.getBytes("UTF-8"))
|
||||
.replace('+', '-').replace('/', '_').replace("=", "");
|
||||
|
||||
// 简化签名
|
||||
String signature = "test_signature_for_demo";
|
||||
|
||||
return encodedHeader + "." + encodedPayload + "." + signature;
|
||||
|
||||
} catch (Exception e) {
|
||||
return "test.jwt.token";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送POST请求
|
||||
*/
|
||||
private String sendPostRequest(String urlStr, String formData, String xAuthToken) throws IOException {
|
||||
URL url = new URL(urlStr);
|
||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
|
||||
try {
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||
connection.setRequestProperty("Accept", "application/json");
|
||||
connection.setRequestProperty("X-Authorization", xAuthToken);
|
||||
|
||||
connection.setDoOutput(true);
|
||||
connection.setConnectTimeout(15000);
|
||||
connection.setReadTimeout(15000);
|
||||
|
||||
// SSL设置
|
||||
trustAllCertificates();
|
||||
|
||||
// 发送数据
|
||||
try (OutputStream os = connection.getOutputStream();
|
||||
OutputStreamWriter osw = new OutputStreamWriter(os, "UTF-8")) {
|
||||
osw.write(formData);
|
||||
osw.flush();
|
||||
}
|
||||
|
||||
// 读取响应
|
||||
int status = connection.getResponseCode();
|
||||
System.out.println("HTTP状态码: " + status);
|
||||
|
||||
InputStream inputStream = status < 400 ? connection.getInputStream() : connection.getErrorStream();
|
||||
|
||||
if (inputStream == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"))) {
|
||||
StringBuilder response = new StringBuilder();
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
response.append(line);
|
||||
}
|
||||
return response.toString();
|
||||
}
|
||||
|
||||
} finally {
|
||||
connection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SSL证书信任设置
|
||||
*/
|
||||
private void trustAllCertificates() {
|
||||
try {
|
||||
javax.net.ssl.TrustManager[] trustAllCerts = new javax.net.ssl.TrustManager[] {
|
||||
new javax.net.ssl.X509TrustManager() {
|
||||
public java.security.cert.X509Certificate[] getAcceptedIssuers() { return null; }
|
||||
public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {}
|
||||
public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {}
|
||||
}
|
||||
};
|
||||
|
||||
javax.net.ssl.SSLContext sc = javax.net.ssl.SSLContext.getInstance("SSL");
|
||||
sc.init(null, trustAllCerts, new java.security.SecureRandom());
|
||||
javax.net.ssl.HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
|
||||
|
||||
javax.net.ssl.HostnameVerifier allHostsValid = new javax.net.ssl.HostnameVerifier() {
|
||||
public boolean verify(String hostname, javax.net.ssl.SSLSession session) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("SSL设置异常: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,603 @@
|
|||
package com.dev.swms.client;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Base64;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.regex.*;
|
||||
|
||||
import javax.crypto.Mac;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import io.jsonwebtoken.SignatureAlgorithm;
|
||||
|
||||
/**
|
||||
* WMS-MES认证Token获取客户端 - 基于老框架实现
|
||||
*/
|
||||
public class WmsTokenClient {
|
||||
|
||||
// 接口配置
|
||||
private final String TOKEN_URL = "https://apintodev.amecnsh.com/AMEC4/wms/oauth/token";
|
||||
// OAuth2客户端凭证
|
||||
private final String CLIENT_ID = "AMEC_WMS";
|
||||
private final String CLIENT_SECRET = "ed4fbb4c6f6c";
|
||||
private final String TENANT = "603b299d29924b9d04147526";
|
||||
private final String GRANT_TYPE = "client_credentials";
|
||||
|
||||
// JWT配置(用于生成X-Authorization)
|
||||
private final String JWT_SECRET = "c72a280d-3c49-49d7-b35f-28ccd2ae98eb"; // 需要替换为实际的secret
|
||||
private final String JWT_ISS = "wms";
|
||||
private final String JWT_NAME = "wms";
|
||||
private final String JWT_T = "";
|
||||
|
||||
private String accessToken; // 存储获取到的访问token
|
||||
private String xAuthToken;//存储获取的鉴定token
|
||||
|
||||
public WmsTokenClient() {
|
||||
// 默认构造函数
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 计算字符串的SHA256哈希值
|
||||
*
|
||||
* @param input 输入字符串
|
||||
* @return SHA256哈希的十六进制字符串(小写)
|
||||
* @throws NoSuchAlgorithmException 如果SHA256算法不可用
|
||||
*/
|
||||
private String sha256(String input) throws NoSuchAlgorithmException {
|
||||
MessageDigest digest = MessageDigest.getInstance("SHA-256");
|
||||
byte[] hash = digest.digest(input.getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
// 转为十六进制字符串
|
||||
StringBuilder hexString = new StringBuilder();
|
||||
for (byte b : hash) {
|
||||
String hex = Integer.toHexString(0xff & b);
|
||||
if (hex.length() == 1) {
|
||||
hexString.append('0');
|
||||
}
|
||||
hexString.append(hex);
|
||||
}
|
||||
return hexString.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成JWT Token(用于测试)
|
||||
* @throws UnsupportedEncodingException
|
||||
*/
|
||||
public String generateToken(String subject, String issuer, String name) throws UnsupportedEncodingException {
|
||||
return Jwts.builder()
|
||||
.setSubject(subject)
|
||||
.setIssuer(issuer)
|
||||
.claim("name", name)
|
||||
.claim("admin", "true")
|
||||
.setIssuedAt(new Date())
|
||||
.setExpiration(new Date(System.currentTimeMillis() + 3600000)) // 1小时
|
||||
.signWith(SignatureAlgorithm.HS256, JWT_SECRET.getBytes("UTF-8"))
|
||||
.compact();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 生成JWT Token用于X-Authorization头
|
||||
*/
|
||||
private String generateJwtToken() {
|
||||
try {
|
||||
// 获取当前时间戳(秒)
|
||||
long currentTime = System.currentTimeMillis() / 1000;
|
||||
// 过期时间:当前时间 + 10分钟
|
||||
long expireTime = currentTime + (10 * 60);
|
||||
|
||||
// 构建JWT Header
|
||||
String header = "{\"alg\":\"HS256\",\"typ\":\"JWT\"}";
|
||||
String encodedHeader =base64UrlEncode(header.getBytes("UTF-8"));
|
||||
|
||||
// 构建JWT Payload
|
||||
// String payload = String.format(
|
||||
// "{\"sub\":\"XGATEAMEC\",\"iss\":\"%s\",\"name\":\"%s\",\"t\":\"%s\",\"iat\":%d,\"exp\":%d}",
|
||||
// JWT_ISS, JWT_NAME, JWT_T, currentTime, expireTime
|
||||
// );
|
||||
String payload = String.format(
|
||||
"{\"sub\":\"XGATEAMEC\",\"admin\":\"true\",\"iss\":\"%s\",\"name\":\"%s\",\"iat\":%d,\"exp\":%d}",
|
||||
JWT_ISS, JWT_NAME, currentTime, expireTime
|
||||
);
|
||||
String encodedPayload =base64UrlEncode(payload.getBytes("UTF-8"));
|
||||
|
||||
// 构建签名(简化版本,实际应该使用真正的HMAC-SHA256)
|
||||
String signingInput = encodedHeader + "." + encodedPayload;
|
||||
//sha256(signingInput+JWT_SECRET);
|
||||
String signature =hmacSha256(signingInput, JWT_SECRET);
|
||||
|
||||
// 组合JWT
|
||||
String jwtToken = signingInput + "." + signature;
|
||||
System.out.println("生成的X-Authorization JWT: " + jwtToken);
|
||||
|
||||
return jwtToken;
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("生成JWT Token异常: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Base64 URL安全编码
|
||||
*/
|
||||
private String base64UrlEncode(byte[] data) {
|
||||
try {
|
||||
sun.misc.BASE64Encoder encoder = new sun.misc.BASE64Encoder();
|
||||
|
||||
String base64 = encoder.encode(data);
|
||||
|
||||
// 转换为URL安全的Base64
|
||||
base64 = base64.replace('+', '-')
|
||||
.replace('/', '_')
|
||||
.replace("=", "")
|
||||
.replaceAll("\\s", "");
|
||||
|
||||
return base64;
|
||||
} catch (Exception e) {
|
||||
return manualBase64UrlEncode(data);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动Base64 URL安全编码
|
||||
*/
|
||||
private String manualBase64UrlEncode(byte[] data) {
|
||||
try {
|
||||
String base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
StringBuilder result = new StringBuilder();
|
||||
|
||||
int i = 0;
|
||||
while (i < data.length) {
|
||||
int byte1 = data[i++] & 0xFF;
|
||||
int byte2 = i < data.length ? data[i++] & 0xFF : 0;
|
||||
int byte3 = i < data.length ? data[i++] & 0xFF : 0;
|
||||
|
||||
int triple = (byte1 << 16) | (byte2 << 8) | byte3;
|
||||
|
||||
result.append(base64Chars.charAt((triple >> 18) & 0x3F));
|
||||
result.append(base64Chars.charAt((triple >> 12) & 0x3F));
|
||||
result.append(i > data.length + 1 ? "" : base64Chars.charAt((triple >> 6) & 0x3F));
|
||||
result.append(i > data.length ? "" : base64Chars.charAt(triple & 0x3F));
|
||||
}
|
||||
|
||||
// 转换为URL安全
|
||||
String base64 = result.toString();
|
||||
base64 = base64.replace('+', '-')
|
||||
.replace('/', '_');
|
||||
|
||||
return base64;
|
||||
} catch (Exception e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 简化的HMAC-SHA256(用于演示,生产环境需要真正的实现)
|
||||
*/
|
||||
private String simpleHmacSha256(String data, String secret) {
|
||||
try {
|
||||
// 简化处理:实际应该使用真正的HMAC-SHA256
|
||||
// 这里使用Base64编码模拟签名过程
|
||||
String signingInput = data + secret;
|
||||
byte[] signatureBytes = signingInput.getBytes("UTF-8");
|
||||
|
||||
return base64UrlEncode(signatureBytes).substring(0, 43);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("HMAC-SHA256签名异常: " + e.getMessage());
|
||||
return "simulated_signature_for_demo";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 真正的HMAC-SHA256实现
|
||||
*/
|
||||
private String hmacSha256(String data, String secret) {
|
||||
try {
|
||||
javax.crypto.Mac mac = javax.crypto.Mac.getInstance("HmacSHA256");
|
||||
javax.crypto.spec.SecretKeySpec secretKey =
|
||||
new javax.crypto.spec.SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA256");
|
||||
mac.init(secretKey);
|
||||
byte[] hmacData = mac.doFinal(data.getBytes("UTF-8"));
|
||||
return base64UrlEncode(hmacData);
|
||||
} catch (Exception e) {
|
||||
System.err.println("HMAC-SHA256签名异常: " + e.getMessage());
|
||||
return "error_signature";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取访问Token
|
||||
*/
|
||||
public boolean getAccessToken() {
|
||||
try {
|
||||
System.out.println("----------------getAccessToken111----------");
|
||||
|
||||
// 1. 生成X-Authorization JWT
|
||||
xAuthToken = generateJwtToken();
|
||||
if (xAuthToken == null) {
|
||||
System.err.println("X-Authorization JWT生成失败");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 2. 构建表单数据
|
||||
String formData = "grant_type=" + GRANT_TYPE +
|
||||
"&client_id=" + CLIENT_ID +
|
||||
"&client_secret=" + CLIENT_SECRET +
|
||||
"&tenant=" + TENANT;
|
||||
System.out.println("----------------getAccessToken112----------");
|
||||
// 3. 发送POST请求
|
||||
String response = sendFormPostRequest(TOKEN_URL, formData, xAuthToken);
|
||||
|
||||
// 4. 解析响应获取访问token
|
||||
if (response != null) {
|
||||
String extractedToken = extractAccessTokenFromResponse(response);
|
||||
if (extractedToken != null) {
|
||||
this.accessToken = extractedToken;
|
||||
System.out.println("访问Token获取成功: " + accessToken);
|
||||
|
||||
// 提取token有效期
|
||||
Long expiresIn = extractExpiresInFromResponse(response);
|
||||
if (expiresIn != null) {
|
||||
System.out.println("Token有效期: " + expiresIn + "秒");
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
String error = extractErrorFromResponse(response);
|
||||
System.out.println("访问Token获取失败: " + error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("获取访问Token异常: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送表单POST请求
|
||||
*/
|
||||
private String sendFormPostRequest(String urlStr, String formData, String xAuthToken) throws IOException {
|
||||
URL url = new URL(urlStr);
|
||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
|
||||
try {
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
|
||||
connection.setRequestProperty("Accept", "application/json");
|
||||
|
||||
// 添加X-Authorization头
|
||||
if (xAuthToken != null && !xAuthToken.isEmpty()) {
|
||||
connection.setRequestProperty("X-Authorization", xAuthToken);
|
||||
System.out.println("已添加X-Authorization头");
|
||||
}
|
||||
|
||||
connection.setDoOutput(true);
|
||||
connection.setConnectTimeout(15000);
|
||||
connection.setReadTimeout(15000);
|
||||
|
||||
// 启用SSL(HTTPS)
|
||||
// if (urlStr.startsWith("https")) {
|
||||
// trustAllCertificates();
|
||||
// }
|
||||
|
||||
// 发送表单数据
|
||||
try (OutputStream os = connection.getOutputStream();
|
||||
OutputStreamWriter osw = new OutputStreamWriter(os, "UTF-8")) {
|
||||
osw.write(formData);
|
||||
osw.flush();
|
||||
}
|
||||
|
||||
// 读取响应
|
||||
int status = connection.getResponseCode();
|
||||
System.out.println("HTTP状态码: " + status);
|
||||
|
||||
InputStream inputStream = status < 400 ? connection.getInputStream() : connection.getErrorStream();
|
||||
|
||||
if (inputStream == null) {
|
||||
return "{\"error\":\"No response body, status: " + status + "\"}";
|
||||
}
|
||||
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"))) {
|
||||
StringBuilder response = new StringBuilder();
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
response.append(line);
|
||||
}
|
||||
System.out.println("原始响应: " + response.toString());
|
||||
return response.toString();
|
||||
}
|
||||
|
||||
} finally {
|
||||
connection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SSL证书信任设置(用于测试环境)
|
||||
*/
|
||||
private void trustAllCertificates() {
|
||||
try {
|
||||
// 信任所有SSL证书(仅测试环境使用)
|
||||
javax.net.ssl.TrustManager[] trustAllCerts = new javax.net.ssl.TrustManager[] {
|
||||
new javax.net.ssl.X509TrustManager() {
|
||||
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
|
||||
return null;
|
||||
}
|
||||
public void checkClientTrusted(java.security.cert.X509Certificate[] certs, String authType) {
|
||||
}
|
||||
public void checkServerTrusted(java.security.cert.X509Certificate[] certs, String authType) {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
javax.net.ssl.SSLContext sc = javax.net.ssl.SSLContext.getInstance("SSL");
|
||||
sc.init(null, trustAllCerts, new java.security.SecureRandom());
|
||||
javax.net.ssl.HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
|
||||
|
||||
// 信任所有主机名
|
||||
javax.net.ssl.HostnameVerifier allHostsValid = new javax.net.ssl.HostnameVerifier() {
|
||||
public boolean verify(String hostname, javax.net.ssl.SSLSession session) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
javax.net.ssl.HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("SSL证书信任设置异常: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 从响应中提取访问token
|
||||
*/
|
||||
private String extractAccessTokenFromResponse(String jsonResponse) {
|
||||
if (jsonResponse == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// 尝试多种可能的token字段名称
|
||||
String[] tokenFields = {"access_token", "token", "accessToken"};
|
||||
|
||||
for (String field : tokenFields) {
|
||||
Pattern pattern = Pattern.compile("\"" + field + "\"\\s*:\\s*\"([^\"]+)\"");
|
||||
Matcher matcher = pattern.matcher(jsonResponse);
|
||||
if (matcher.find()) {
|
||||
return matcher.group(1);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从响应中提取token有效期
|
||||
*/
|
||||
private Long extractExpiresInFromResponse(String jsonResponse) {
|
||||
if (jsonResponse == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Pattern pattern = Pattern.compile("\"expires_in\"\\s*:\\s*(\\d+)");
|
||||
Matcher matcher = pattern.matcher(jsonResponse);
|
||||
if (matcher.find()) {
|
||||
return Long.parseLong(matcher.group(1));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从响应中提取错误信息
|
||||
*/
|
||||
private String extractErrorFromResponse(String jsonResponse) {
|
||||
if (jsonResponse == null) {
|
||||
return "Empty response";
|
||||
}
|
||||
|
||||
// 尝试提取error字段
|
||||
Pattern pattern = Pattern.compile("\"error\"\\s*:\\s*\"([^\"]+)\"");
|
||||
Matcher matcher = pattern.matcher(jsonResponse);
|
||||
if (matcher.find()) {
|
||||
return matcher.group(1);
|
||||
}
|
||||
|
||||
// 尝试提取error_description字段
|
||||
Pattern pattern2 = Pattern.compile("\"error_description\"\\s*:\\s*\"([^\"]+)\"");
|
||||
Matcher matcher2 = pattern2.matcher(jsonResponse);
|
||||
if (matcher2.find()) {
|
||||
return matcher2.group(1);
|
||||
}
|
||||
|
||||
// 尝试提取message字段
|
||||
Pattern pattern3 = Pattern.compile("\"message\"\\s*:\\s*\"([^\"]+)\"");
|
||||
Matcher matcher3 = pattern3.matcher(jsonResponse);
|
||||
if (matcher3.find()) {
|
||||
return matcher3.group(1);
|
||||
}
|
||||
|
||||
return jsonResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前访问token
|
||||
*/
|
||||
public String getAccessTokenValue() {
|
||||
return accessToken;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用访问token调用业务API
|
||||
*/
|
||||
public String callBusinessApi(String apiUrl, String requestBody) {
|
||||
if (accessToken == null) {
|
||||
throw new IllegalStateException("请先调用getAccessToken方法获取访问token");
|
||||
}
|
||||
|
||||
try {
|
||||
return sendJsonPostRequest(apiUrl, requestBody, accessToken,xAuthToken);
|
||||
} catch (Exception e) {
|
||||
System.err.println("调用业务API异常: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送JSON POST请求(使用访问token)
|
||||
*/
|
||||
private String sendJsonPostRequest(String urlStr, String jsonBody, String accessToken,String xAuthToken) throws IOException {
|
||||
URL url = new URL(urlStr);
|
||||
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
|
||||
|
||||
try {
|
||||
connection.setRequestMethod("POST");
|
||||
connection.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
|
||||
connection.setRequestProperty("Accept", "application/json");
|
||||
|
||||
// 使用访问token作为Authorization头
|
||||
if (accessToken != null && !accessToken.isEmpty()) {
|
||||
connection.setRequestProperty("Authorization", "Bearer " + accessToken);
|
||||
System.out.println("已添加Authorization头(Bearer Token)");
|
||||
}
|
||||
// 添加X-Authorization头
|
||||
if (xAuthToken != null && !xAuthToken.isEmpty()) {
|
||||
connection.setRequestProperty("X-Authorization", xAuthToken);
|
||||
System.out.println("已添加X-Authorization头");
|
||||
}
|
||||
connection.setDoOutput(true);
|
||||
connection.setConnectTimeout(15000);
|
||||
connection.setReadTimeout(15000);
|
||||
|
||||
// 启用SSL(如果是HTTPS)
|
||||
// if (urlStr.startsWith("https")) {
|
||||
// trustAllCertificates();
|
||||
// }
|
||||
|
||||
// 发送JSON数据
|
||||
if (jsonBody != null && !jsonBody.isEmpty()) {
|
||||
try (OutputStream os = connection.getOutputStream();
|
||||
OutputStreamWriter osw = new OutputStreamWriter(os, "UTF-8")) {
|
||||
osw.write(jsonBody);
|
||||
osw.flush();
|
||||
}
|
||||
}
|
||||
|
||||
// 读取响应
|
||||
int status = connection.getResponseCode();
|
||||
System.out.println("业务API HTTP状态码: " + status);
|
||||
|
||||
InputStream inputStream = status < 400 ? connection.getInputStream() : connection.getErrorStream();
|
||||
|
||||
if (inputStream == null) {
|
||||
return "{\"error\":\"No response body, status: " + status + "\"}";
|
||||
}
|
||||
|
||||
try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream, "UTF-8"))) {
|
||||
StringBuilder response = new StringBuilder();
|
||||
String line;
|
||||
while ((line = br.readLine()) != null) {
|
||||
response.append(line);
|
||||
}
|
||||
return response.toString();
|
||||
}
|
||||
|
||||
} finally {
|
||||
connection.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动构建简单JSON
|
||||
*/
|
||||
public String buildSimpleJson(Map<String, Object> params) {
|
||||
StringBuilder json = new StringBuilder();
|
||||
json.append("{");
|
||||
boolean first = true;
|
||||
for (Map.Entry<String, Object> entry : params.entrySet()) {
|
||||
if (!first) {
|
||||
json.append(",");
|
||||
}
|
||||
json.append("\"").append(entry.getKey()).append("\":");
|
||||
Object value = entry.getValue();
|
||||
if (value instanceof String) {
|
||||
json.append("\"").append(escapeJsonString(value.toString())).append("\"");
|
||||
} else if (value instanceof Number) {
|
||||
json.append(value);
|
||||
} else if (value instanceof Boolean) {
|
||||
json.append(value);
|
||||
} else {
|
||||
json.append("\"").append(escapeJsonString(value.toString())).append("\"");
|
||||
}
|
||||
first = false;
|
||||
}
|
||||
json.append("}");
|
||||
return json.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 转义JSON字符串中的特殊字符
|
||||
*/
|
||||
private String escapeJsonString(String str) {
|
||||
return str.replace("\\", "\\\\")
|
||||
.replace("\"", "\\\"")
|
||||
.replace("\b", "\\b")
|
||||
.replace("\f", "\\f")
|
||||
.replace("\n", "\\n")
|
||||
.replace("\r", "\\r")
|
||||
.replace("\t", "\\t");
|
||||
}
|
||||
|
||||
/**
|
||||
* 完整的示例使用方法
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
// 创建Token客户端
|
||||
WmsTokenClient client = new WmsTokenClient();
|
||||
// 1. 获取访问Token
|
||||
if (client.getAccessToken()) {
|
||||
System.out.println("成功获取访问Token: " + client.getAccessTokenValue());
|
||||
|
||||
// 2. 构建业务请求数据(示例)
|
||||
Map<String, Object> requestData = new HashMap<String, Object>();
|
||||
requestData.put("warehouseCode", "WH001");
|
||||
requestData.put("skuCode", "SKU12345");
|
||||
requestData.put("action", "queryInventory");
|
||||
requestData.put("timestamp", System.currentTimeMillis());
|
||||
|
||||
// 3. 构建JSON请求
|
||||
String jsonRequest = client.buildSimpleJson(requestData);
|
||||
System.out.println("业务请求JSON: " + jsonRequest);
|
||||
|
||||
// 4. 调用业务API(使用访问Token)
|
||||
// 注意:需要替换为实际的业务API URL
|
||||
String businessApiUrl = "https://apintodev.amecnsh.com/AMEC4/wms/api/business";
|
||||
String response = client.callBusinessApi(businessApiUrl, jsonRequest);
|
||||
|
||||
System.out.println("业务API响应: " + response);
|
||||
} else {
|
||||
System.out.println("获取访问Token失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -235,7 +235,7 @@ public class ItemJobLauncher implements ApplicationListener {
|
|||
int e=0;
|
||||
switch (a) {
|
||||
case 1:
|
||||
logger.info("1---------");
|
||||
logger.info(" --zidongfanku----1---------");
|
||||
if (true) {
|
||||
List<AgvTask> agvTasks = commonDao.findByQuery(" from AgvTask agvTask "
|
||||
+ " where 1=1 " //agvTask.beIssue=true
|
||||
|
|
@ -244,16 +244,16 @@ public class ItemJobLauncher implements ApplicationListener {
|
|||
// + " and substring(agvTask.targetArea,0,4) not in ('204','203') "
|
||||
// + " and substring(agvTask.targetArea,0,4) in ('201') "
|
||||
+ " and substring(agvTask.targetArea,0,4) in ('203','204','205','206','207',"
|
||||
+ "'208','209','210','211','212','213') "
|
||||
+ "'208','209','210','211','212','213','214','215','201','202') "
|
||||
);
|
||||
for (AgvTask agvTask : agvTasks) {
|
||||
long time = agvTask.getLeaveTime().getTime();
|
||||
long time1= (new Date()).getTime();
|
||||
logger.info(time+"------1-----------"+time1);
|
||||
if (time1-time>=35000) {
|
||||
logger.info(time+"-----zidongfanku----1-----------"+time1);
|
||||
if (time1-time>=30000) {
|
||||
agvTaskManager.wcsNextPT(agvTask.getRobotJobId(), agvTask.getContainerCode(),
|
||||
WcsCSDCode.getWcsCSDCode(agvTask.getTargetAreaCode()));
|
||||
logger.info("1-----------");
|
||||
logger.info("--zidongfanku-1-----------");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,10 +27,10 @@ public class Item extends Entity {
|
|||
private String unit;
|
||||
private String goodType;//产品分类 待测量数据 大小件
|
||||
|
||||
private double length=0;//长--
|
||||
private double width=0;//宽
|
||||
private double height=0;//高
|
||||
private double weight=0;//规格重量
|
||||
private double length=0;//长--LENGTH
|
||||
private double width=0;//宽WIDTH
|
||||
private double height=0;//高LENGTH
|
||||
private double weight=0;//规格重量WEIGHT
|
||||
private double volume=0;//体积
|
||||
private int packNumber=0;//规格数量
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public class ASNDetail extends Entity {
|
|||
private double expectedQuantity;
|
||||
private boolean bequality=false;//是否质检
|
||||
private String strBill2;//序列号
|
||||
private String strBill1;//PO行项目号
|
||||
private String strBill1;//PO行号\成品箱号
|
||||
/** 商品属性 */
|
||||
private LotInfo lotInfo;
|
||||
private String strBill3;//已入库质检标记
|
||||
|
|
@ -122,7 +122,7 @@ public class ASNDetail extends Entity {
|
|||
private String relatedBill5;//预入库操作人
|
||||
private String strBill4;//-转作业-原特殊标记
|
||||
private String strBill5;//转作业-原供应商代码
|
||||
private String strBill6;//SCC号
|
||||
private String strBill6;//SCC号 箱号
|
||||
private String strBill7;//task凭证号(收货凭证号)
|
||||
private String strBill8;//凭证行号
|
||||
private String strBill9;//发货LOC
|
||||
|
|
@ -135,8 +135,36 @@ public class ASNDetail extends Entity {
|
|||
private String zxmx;//新物料标识(是否新料)
|
||||
|
||||
private boolean beMarkWeight=false;//是否序列号
|
||||
|
||||
|
||||
private double length=0;//长--LENGTH
|
||||
private double width=0;//宽WIDTH
|
||||
private double height=0;//高LENGTH
|
||||
|
||||
|
||||
public double getLength() {
|
||||
return length;
|
||||
}
|
||||
|
||||
public void setLength(double length) {
|
||||
this.length = length;
|
||||
}
|
||||
|
||||
public double getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public void setWidth(double width) {
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public double getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(double height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public boolean isBeMarkWeight() {
|
||||
return beMarkWeight;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,6 +167,9 @@
|
|||
<property name="strBill12" type="string" length="100" column="strBill12" />
|
||||
<property name="strBill13" type="string" length="100" column="strBill13" />
|
||||
<property name="beMarkWeight" column="be_Mark_Weight" type="boolean" />
|
||||
<property name="length" type="double" column="length" />
|
||||
<property name="width" type="double" column="width" />
|
||||
<property name="height" type="double" column="height" />
|
||||
</class>
|
||||
<query name="getASNDetailsCountByItemID">
|
||||
<![CDATA[SELECT COUNT(detail) FROM ASNDetail detail WHERE detail.item.id = :itemId]]>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.dev.swms.server.model.shipping;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.dev.energy.server.model.Entity;
|
||||
|
||||
public class AutomaticWaveDoc extends Entity{
|
||||
|
|
@ -15,30 +17,194 @@ public class AutomaticWaveDoc extends Entity{
|
|||
private int hour2=0;//小时
|
||||
private int minute2=0;//分钟
|
||||
private Boolean beEnabled2=false;//是否下发CRS
|
||||
private int hour3=0;//小时
|
||||
private int minute3=0;//分钟
|
||||
private Boolean beEnabled3=false;//是否启用
|
||||
private int hour4=0;//小时
|
||||
private int minute4=0;//分钟
|
||||
private Boolean beEnabled4=false;//是否启用
|
||||
private int hour5=0;//小时
|
||||
private int minute5=0;//分钟
|
||||
private Boolean beEnabled5=false;//是否启用
|
||||
private int hour6=0;//小时
|
||||
private int minute6=0;//分钟
|
||||
private Boolean beEnabled6=false;//是否启用
|
||||
private int hour7=0;//小时
|
||||
private int minute7=0;//分钟
|
||||
private Boolean beEnabled7=false;//是否启用
|
||||
private int hour8=0;//小时
|
||||
private int minute8=0;//分钟
|
||||
private Boolean beEnabled8=false;//是否启用
|
||||
private int hour9=0;//小时
|
||||
private int minute9=0;//分钟
|
||||
private Boolean beEnabled9=false;//是否启用
|
||||
private int hour10=0;//小时
|
||||
private int minute10=0;//分钟
|
||||
private Boolean beEnabled10=false;//是否启用
|
||||
private int hour3=0;//波次小时
|
||||
private int minute3=0;//料箱工作站个数
|
||||
private int hour4=0;//最大拆分行数
|
||||
private int minute4=0;//货架工作站个数
|
||||
private int hour5=0;//
|
||||
private int minute5=0;//堆垛工作站个数
|
||||
private int hour6=0;//
|
||||
private int minute6=0;//
|
||||
private int hour7=0;//
|
||||
private int minute7=0;//
|
||||
private int hour8=0;//
|
||||
private int minute8=0;//
|
||||
private int hour9=0;//
|
||||
private int minute9=0;//
|
||||
private Boolean beEnabled3=false;//地堆区是否发当天料
|
||||
private Boolean beEnabled4=false;//货架区工作站1-7
|
||||
private Boolean beEnabled5=false;//
|
||||
private Boolean beEnabled6=false;//
|
||||
private Boolean beEnabled7=false;//
|
||||
private Boolean beEnabled8=false;//
|
||||
private Boolean beEnabled9=false;//
|
||||
private Boolean beEnabled10=false;//
|
||||
private Boolean lx1=false;//料箱工作站1-15
|
||||
private Boolean lx2=false;//
|
||||
private Boolean lx3=false;//
|
||||
private Boolean lx4=false;//
|
||||
private Boolean lx5=false;//
|
||||
private Boolean lx6=false;//
|
||||
private Boolean lx7=false;//
|
||||
private Boolean lx8=false;//
|
||||
private Boolean lx9=false;//
|
||||
private Boolean lx10=false;//
|
||||
private Boolean lx11=false;//
|
||||
private Boolean lx12=false;//
|
||||
private Boolean lx13=false;//
|
||||
private Boolean lx14=false;//
|
||||
private Boolean lx15=false;//
|
||||
private Boolean lk1=false;//立库工作站1-5
|
||||
private Boolean lk2=false;//
|
||||
private Boolean lk3=false;//
|
||||
private Boolean lk4=false;//
|
||||
private Boolean lk5=false;//
|
||||
|
||||
private int hour10=0;//
|
||||
private int minute10=0;//
|
||||
|
||||
|
||||
/** 波次规则的开始时间 */
|
||||
private Date startDate;
|
||||
|
||||
/** 波次规则的结束时间 */
|
||||
private Date endDate;
|
||||
|
||||
|
||||
|
||||
|
||||
public Boolean getLx1() {
|
||||
return lx1;
|
||||
}
|
||||
public void setLx1(Boolean lx1) {
|
||||
this.lx1 = lx1;
|
||||
}
|
||||
public Boolean getLx2() {
|
||||
return lx2;
|
||||
}
|
||||
public void setLx2(Boolean lx2) {
|
||||
this.lx2 = lx2;
|
||||
}
|
||||
public Boolean getLx3() {
|
||||
return lx3;
|
||||
}
|
||||
public void setLx3(Boolean lx3) {
|
||||
this.lx3 = lx3;
|
||||
}
|
||||
public Boolean getLx4() {
|
||||
return lx4;
|
||||
}
|
||||
public void setLx4(Boolean lx4) {
|
||||
this.lx4 = lx4;
|
||||
}
|
||||
public Boolean getLx5() {
|
||||
return lx5;
|
||||
}
|
||||
public void setLx5(Boolean lx5) {
|
||||
this.lx5 = lx5;
|
||||
}
|
||||
public Boolean getLx6() {
|
||||
return lx6;
|
||||
}
|
||||
public void setLx6(Boolean lx6) {
|
||||
this.lx6 = lx6;
|
||||
}
|
||||
public Boolean getLx7() {
|
||||
return lx7;
|
||||
}
|
||||
public void setLx7(Boolean lx7) {
|
||||
this.lx7 = lx7;
|
||||
}
|
||||
public Boolean getLx8() {
|
||||
return lx8;
|
||||
}
|
||||
public void setLx8(Boolean lx8) {
|
||||
this.lx8 = lx8;
|
||||
}
|
||||
public Boolean getLx9() {
|
||||
return lx9;
|
||||
}
|
||||
public void setLx9(Boolean lx9) {
|
||||
this.lx9 = lx9;
|
||||
}
|
||||
public Boolean getLx10() {
|
||||
return lx10;
|
||||
}
|
||||
public void setLx10(Boolean lx10) {
|
||||
this.lx10 = lx10;
|
||||
}
|
||||
public Boolean getLx11() {
|
||||
return lx11;
|
||||
}
|
||||
public void setLx11(Boolean lx11) {
|
||||
this.lx11 = lx11;
|
||||
}
|
||||
public Boolean getLx12() {
|
||||
return lx12;
|
||||
}
|
||||
public void setLx12(Boolean lx12) {
|
||||
this.lx12 = lx12;
|
||||
}
|
||||
public Boolean getLx13() {
|
||||
return lx13;
|
||||
}
|
||||
public void setLx13(Boolean lx13) {
|
||||
this.lx13 = lx13;
|
||||
}
|
||||
public Boolean getLx14() {
|
||||
return lx14;
|
||||
}
|
||||
public void setLx14(Boolean lx14) {
|
||||
this.lx14 = lx14;
|
||||
}
|
||||
public Boolean getLx15() {
|
||||
return lx15;
|
||||
}
|
||||
public void setLx15(Boolean lx15) {
|
||||
this.lx15 = lx15;
|
||||
}
|
||||
public Boolean getLk1() {
|
||||
return lk1;
|
||||
}
|
||||
public void setLk1(Boolean lk1) {
|
||||
this.lk1 = lk1;
|
||||
}
|
||||
public Boolean getLk2() {
|
||||
return lk2;
|
||||
}
|
||||
public void setLk2(Boolean lk2) {
|
||||
this.lk2 = lk2;
|
||||
}
|
||||
public Boolean getLk3() {
|
||||
return lk3;
|
||||
}
|
||||
public void setLk3(Boolean lk3) {
|
||||
this.lk3 = lk3;
|
||||
}
|
||||
public Boolean getLk4() {
|
||||
return lk4;
|
||||
}
|
||||
public void setLk4(Boolean lk4) {
|
||||
this.lk4 = lk4;
|
||||
}
|
||||
public Boolean getLk5() {
|
||||
return lk5;
|
||||
}
|
||||
public void setLk5(Boolean lk5) {
|
||||
this.lk5 = lk5;
|
||||
}
|
||||
public Date getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
public void setStartDate(Date startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
public int getHour1() {
|
||||
return hour1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,9 +68,9 @@ public class PickTicket extends AbstractMoveDoc {
|
|||
|
||||
private String workerName4;//需求人
|
||||
|
||||
private String relatedBill1;//预留号
|
||||
private String relatedBill1;//预留号//
|
||||
/** */
|
||||
private String relatedBill2;//工单号
|
||||
private String relatedBill2;//工单号//
|
||||
/** */
|
||||
private String relatedBill3;//头物料
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class PickTicketDetail extends AbstractMoveDocDetail {
|
|||
private String description;//明细备注
|
||||
|
||||
/** 行号*/
|
||||
private String lineNumber;
|
||||
private String lineNumber;//成品箱号
|
||||
|
||||
private WaveDocDetail waveDocDetail;//波次明细
|
||||
|
||||
|
|
@ -88,8 +88,8 @@ public class PickTicketDetail extends AbstractMoveDocDetail {
|
|||
private String strBill7;//预留号
|
||||
private String strBill8;//是否出WMS仓
|
||||
private String strBill9;//接收工厂
|
||||
private String strBill10;//采购订单号
|
||||
private String strBill11;//外协供应商编号
|
||||
private String strBill10;//采购订单号 -成品新箱号
|
||||
private String strBill11;//外协供应商编号 -成品新料号
|
||||
private String strBill12;//机台号
|
||||
private String strBill13; //receiver
|
||||
private String strBill14; //SAP指定序列号值
|
||||
|
|
|
|||
|
|
@ -40,6 +40,28 @@
|
|||
<property name="hour10" type="int" column="hour10" />
|
||||
<property name="minute10" type="int" column="minute10" />
|
||||
<property name="beEnabled10" type="boolean" column="be_Enabled10" />
|
||||
<property name="startDate" column="START_DATE" type="timestamp" />
|
||||
<property name="endDate" column="END_DATE" type="timestamp" />
|
||||
<property name="lx1" type="boolean" column="be_lx1" />
|
||||
<property name="lx2" type="boolean" column="be_lx2" />
|
||||
<property name="lx3" type="boolean" column="be_lx3" />
|
||||
<property name="lx4" type="boolean" column="be_lx4" />
|
||||
<property name="lx5" type="boolean" column="be_lx5" />
|
||||
<property name="lx6" type="boolean" column="be_lx6" />
|
||||
<property name="lx7" type="boolean" column="be_lx7" />
|
||||
<property name="lx8" type="boolean" column="be_lx8" />
|
||||
<property name="lx9" type="boolean" column="be_lx9" />
|
||||
<property name="lx10" type="boolean" column="be_lx10" />
|
||||
<property name="lx11" type="boolean" column="be_lx11" />
|
||||
<property name="lx12" type="boolean" column="be_lx12" />
|
||||
<property name="lx13" type="boolean" column="be_lx13" />
|
||||
<property name="lx14" type="boolean" column="be_lx14" />
|
||||
<property name="lx15" type="boolean" column="be_lx15" />
|
||||
<property name="lk1" type="boolean" column="be_lk1" />
|
||||
<property name="lk2" type="boolean" column="be_lk2" />
|
||||
<property name="lk3" type="boolean" column="be_lk3" />
|
||||
<property name="lk4" type="boolean" column="be_lk4" />
|
||||
<property name="lk5" type="boolean" column="be_lk5" />
|
||||
</class>
|
||||
|
||||
</hibernate-mapping>
|
||||
|
|
@ -170,4 +170,6 @@ public interface LocationManager extends BaseManager {
|
|||
@Transactional
|
||||
void importReceivingInventory(File file);
|
||||
|
||||
@Transactional
|
||||
void huoquMesToken(List<Long> ids);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,9 +4,11 @@ import hhwms.MyThread;
|
|||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
|
@ -15,6 +17,8 @@ import net.sf.json.JSONArray;
|
|||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.dev.swms.client.JwtTokenGenerator;
|
||||
import com.dev.swms.client.WmsTokenClient;
|
||||
import com.dev.swms.client.ui.page.CustomEntity;
|
||||
import com.dev.swms.server.model.base.BillType;
|
||||
import com.dev.swms.server.model.base.GoodsShelves;
|
||||
|
|
@ -1562,6 +1566,8 @@ public class DefaultLocationManager extends DefaultBaseManager implements
|
|||
String loc = sheet.getCell(3, i).getContents().trim();// LOC
|
||||
String qty = sheet.getCell(4, i).getContents().trim();// 数量
|
||||
String NCR = sheet.getCell(5, i).getContents().trim();// NCR
|
||||
String XN = sheet.getCell(6, i).getContents().trim();// 序列号
|
||||
String date = sheet.getCell(7, i).getContents().trim();// 入库日期
|
||||
if(itemcode==null||lc==null||plan==null||loc==null||qty==null||NCR==null) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -1579,6 +1585,10 @@ public class DefaultLocationManager extends DefaultBaseManager implements
|
|||
}else {
|
||||
throw new BusinessException("第"+(i+1)+"行料号"+itemcode+"不存在");
|
||||
}
|
||||
Date asndate=new Date();
|
||||
if(date!=null&&date.length()>0) {
|
||||
asndate=DateUtil.formatStrToDateYMD02(date);
|
||||
}
|
||||
LotInfo lotInfo=new LotInfo();
|
||||
lotInfo.setPropC9(plan);//批次号
|
||||
lotInfo.setPropC3("");//特殊标记
|
||||
|
|
@ -1604,6 +1614,10 @@ public class DefaultLocationManager extends DefaultBaseManager implements
|
|||
r.setReceivedQuantity(Integer.parseInt(qty));
|
||||
r.setReceivedQuantityMU(r.getReceivedQuantity());
|
||||
r.setStrBill1(NCR);
|
||||
r.setReceiveDate(asndate);
|
||||
if(XN!=null&&XN.length()>0) {
|
||||
r.setBarCode(XN);
|
||||
}
|
||||
commonDao.store(r);
|
||||
logger.info(i);
|
||||
}
|
||||
|
|
@ -1616,4 +1630,35 @@ public class DefaultLocationManager extends DefaultBaseManager implements
|
|||
}
|
||||
}
|
||||
|
||||
public void huoquMesToken(List<Long> ids) {
|
||||
|
||||
// 创建Token客户端
|
||||
WmsTokenClient client = new WmsTokenClient();
|
||||
|
||||
// 1. 获取访问Token
|
||||
if (client.getAccessToken()) {
|
||||
System.out.println("成功获取访问Token: " + client.getAccessTokenValue());
|
||||
|
||||
// 2. 构建业务请求数据(示例)
|
||||
Map<String, Object> requestData = new HashMap<String, Object>();
|
||||
requestData.put("warehouseCode", "WH001");
|
||||
requestData.put("skuCode", "SKU12345");
|
||||
requestData.put("action", "queryInventory");
|
||||
requestData.put("timestamp", System.currentTimeMillis());
|
||||
|
||||
// 3. 构建JSON请求
|
||||
String jsonRequest = client.buildSimpleJson(requestData);
|
||||
System.out.println("业务请求JSON: " + jsonRequest);
|
||||
|
||||
// 4. 调用业务API(使用访问Token)
|
||||
// 注意:需要替换为实际的业务API URL
|
||||
String businessApiUrl = "https://apintodev.amecnsh.com/AMEC4/wms/api/business";
|
||||
String response = client.callBusinessApi(businessApiUrl, jsonRequest);
|
||||
|
||||
System.out.println("业务API响应: " + response);
|
||||
} else {
|
||||
System.out.println("获取访问Token失败");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2327,6 +2327,8 @@ public class DefaultCountPlanManager extends DefaultBaseManager implements
|
|||
List<Long> cpts=commonDao.findByQuery("select c.id from CountRecord c where c.needCount=0 "
|
||||
+ " and c.countPlan.id="+countRecord.getCountPlan().getId());
|
||||
if(cpts.size()==0) {
|
||||
cp.setFinishNo(cp.getCountQty());
|
||||
commonDao.store(cp);
|
||||
adjustment(countRecord.getCountPlan().getId(),userId);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,6 +50,22 @@ public class ApiURL {
|
|||
public static String returnOA = "";
|
||||
// 测试地址 WMS——SAP 回传接口******http://happdev.amecnsh.com:8000/sap/zrest
|
||||
public static String doWmsReqSap = "";
|
||||
|
||||
// 测试地址 WMS——MES 回传接口******
|
||||
//入库反馈https://apintodev.amecnsh.com/AMEC4/wms/postAppApi?m=dev&apiCode=WMS_MES_ENTRY_FEEDBACK
|
||||
//出库退回https://apintodev.amecnsh.com/AMEC4/wms/postAppApi?m=dev&apiCode=WMS_MES_RETURN_FEEDBACK
|
||||
//移位更新库区https://apintodev.amecnsh.com/AMEC4/wms/postAppApi?m=dev&apiCode=WMS_MES_TRANSFER_UPDATE
|
||||
//成品出库https://apintodev.amecnsh.com/AMEC4/wms/postAppApi?m=dev&apiCode=WMS_MES_PRODUCT_OUT
|
||||
//更新料号https://apintodev.amecnsh.com/AMEC4/wms/postAppApi?m=dev&apiCode=WMS_MES_UPDATE_MATE_FEEDBACK
|
||||
|
||||
public static String returnMESIN = "/AMEC4/wms/postAppApi?m=dev&apiCode=WMS_MES_ENTRY_FEEDBACK";
|
||||
public static String returnMESRETURN = "/AMEC4/wms/postAppApi?m=dev&apiCode=WMS_MES_RETURN_FEEDBACK";
|
||||
public static String returnMESTRANSFER = "/AMEC4/wms/postAppApi?m=dev&apiCode=WMS_MES_TRANSFER_UPDATE";
|
||||
public static String returnMESPRODUCT = "/AMEC4/wms/postAppApi?m=dev&apiCode=WMS_MES_PRODUCT_OUT";
|
||||
public static String returnMESUPDATE = "/AMEC4/wms/postAppApi?m=dev&apiCode=WMS_MES_UPDATE_MATE_FEEDBACK";
|
||||
|
||||
// 测试地址 WMS——MES 回传接口******https://apintodev.amecnsh.com/AMEC4/wms/oauth/token
|
||||
public static String returnMesToken = "/AMEC4/wms/oauth/token";
|
||||
|
||||
// OA生产地址
|
||||
// public static String returnOA = "https://10.1.112.7/api/zwbdt/e9/oa4sap/confirmRequest";
|
||||
|
|
|
|||
|
|
@ -29,7 +29,14 @@ public interface InterfaceReqManager extends BaseManager{
|
|||
*/
|
||||
@Transactional
|
||||
String doWmsReqSap(String URL, String xmlInfo,String type);
|
||||
|
||||
/**
|
||||
* wms req MES
|
||||
* @param URL 接口地址
|
||||
* @param xmlInfo 发送参数
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
String doWmsReqMes(String URL, String xmlInfo,String type);
|
||||
//WCS接口
|
||||
boolean doWmsReqWcs(String URL, String xmlInfo,String taskcode);
|
||||
//OA接口
|
||||
|
|
@ -144,6 +151,13 @@ public interface InterfaceReqManager extends BaseManager{
|
|||
*/
|
||||
@Transactional
|
||||
void returnoutAsn(List<Long> ids);
|
||||
|
||||
/**
|
||||
* wms入库回传MES关闭状态
|
||||
* @param ReceivedRecord ids
|
||||
*/
|
||||
@Transactional
|
||||
void returnoutAsnMes(List<Long> ids);
|
||||
|
||||
/**
|
||||
* WMS-SAP 发料回传
|
||||
|
|
@ -151,6 +165,22 @@ public interface InterfaceReqManager extends BaseManager{
|
|||
*/
|
||||
@Transactional
|
||||
boolean wmsSapFaliaohuichuang(List<Long> ids);
|
||||
|
||||
/**
|
||||
* WMS-MES 发料回传
|
||||
* @param ids 拣货任务 id
|
||||
*/
|
||||
@Transactional
|
||||
boolean wmsMesFaliao(List<Long> ids,String type);
|
||||
/**
|
||||
* WMS-MES 移位回传
|
||||
* @param ids 库存id
|
||||
* type=4
|
||||
*/
|
||||
@Transactional
|
||||
boolean wmsMesInventory(List<Long> ids,String type);
|
||||
|
||||
|
||||
/**
|
||||
* WMS-SAP 跳过任务,发料回传
|
||||
* @param ids 拣货任务 id
|
||||
|
|
|
|||
|
|
@ -39,10 +39,19 @@ public interface InterfaceRespManager extends BaseManager{
|
|||
JSONObject storeCPUTPTCsap(DataInterfaceLog log,String data);
|
||||
//SAP-WMS:成品出库任务信息接口
|
||||
JSONObject storeZPUTPTCsap(DataInterfaceLog log,String data);
|
||||
//SAP-WMS:成品出库任务信息接口
|
||||
JSONObject storeZPUTPTCmes(DataInterfaceLog log,String data);
|
||||
|
||||
//SAP-WMS:成品变更出库任务信息接口
|
||||
JSONObject storeZPUTUPDATEmes(DataInterfaceLog log,String data);
|
||||
|
||||
//SAP-WMS:其它移动类型(非采购)出库任务信息接口
|
||||
JSONObject storeQPUTPTCsap(DataInterfaceLog log,String data);
|
||||
//SAP-WMS:成品收货入库任务接口
|
||||
JSONObject storeASNZPUTASN(DataInterfaceLog log,String data);
|
||||
//MES-WMS:成品收货入库任务接口
|
||||
JSONObject storeMESZPUTASN(DataInterfaceLog log,String data);
|
||||
|
||||
//SAP-WMS:采购收货入库任务接口
|
||||
@Transactional
|
||||
JSONObject storeASNCPUTASN(DataInterfaceLog log,String data);
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Base64;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import library.doLibrary;
|
||||
|
|
@ -36,6 +38,7 @@ import com.dev.energy.server.exception.BusinessException;
|
|||
import com.dev.energy.server.model.EntityFactory;
|
||||
import com.dev.energy.server.model.exception.ExceptionLog;
|
||||
import com.dev.energy.server.service.pojo.DefaultBaseManager;
|
||||
import com.dev.swms.client.WmsTokenClient;
|
||||
import com.dev.swms.server.model.base.BillType;
|
||||
import com.dev.swms.server.model.base.Item;
|
||||
import com.dev.swms.server.model.base.ItemKey;
|
||||
|
|
@ -164,7 +167,122 @@ public class DefaultInterfaceReqManager extends DefaultBaseManager implements In
|
|||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String doWmsReqMes(String URL, String xmlInfo,String type) {
|
||||
boolean bool = false;
|
||||
DataInterfaceLog interfaceLog = interfaceManager.storeDataInterfaceLog("WMS-MES", type, "WMS", "SAP", URL,
|
||||
xmlInfo);
|
||||
String str = "";
|
||||
InputStream instr = null;
|
||||
java.io.ByteArrayOutputStream out = null;
|
||||
String ResponseString = "";
|
||||
int i = 0;
|
||||
|
||||
boolean flag = true;
|
||||
// while (flag) {
|
||||
logger.info("wms-MES发起的数据:" + xmlInfo);
|
||||
try {
|
||||
HttpClient httpClient = new HttpClient();
|
||||
// 设置超时时间
|
||||
// httpClient.getHttpConnectionManager().getParams().setConnectionTimeout(5000);
|
||||
// httpClient.getHttpConnectionManager().getParams().setSoTimeout(5000);
|
||||
PostMethod postMethod = new PostMethod(URL);
|
||||
// 设置请求头 Content-Type
|
||||
postMethod.setRequestHeader("Content-Type", "application/json");
|
||||
//X-Authorization
|
||||
postMethod.setRequestHeader("Authorization", "Basic "
|
||||
+ Base64.getUrlEncoder().encodeToString(("AMECBGADMIN" + ":" + "Amec@BgAdmin@888").getBytes()));
|
||||
RequestEntity requestEntity = new StringRequestEntity(xmlInfo, "application/json", "UTF-8");
|
||||
postMethod.setRequestEntity(requestEntity);
|
||||
httpClient.executeMethod(postMethod);// 执行请求
|
||||
// httpClient.setTimeout(5000);
|
||||
instr = postMethod.getResponseBodyAsStream();// 获取返回的流
|
||||
BufferedReader br = null;
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
// 将返回的输入流转换成字符串
|
||||
br = new BufferedReader(new InputStreamReader(instr, Charset.forName("UTF-8")));
|
||||
String temp;
|
||||
while ((temp = br.readLine()) != null) {
|
||||
buffer.append(temp);
|
||||
}
|
||||
logger.info(xmlInfo + "wms-sap响应报文:" + buffer);
|
||||
str = buffer + "";
|
||||
if(str==null||str.equals("")) {
|
||||
|
||||
}else {
|
||||
bool = true;
|
||||
}
|
||||
|
||||
flag = false;
|
||||
} catch (Exception e) {
|
||||
/*
|
||||
* i++;
|
||||
* if (i>3) {
|
||||
* flag=false;
|
||||
* }
|
||||
* try {
|
||||
* Thread.sleep(180000);
|
||||
* } catch (InterruptedException e1) {
|
||||
* // TODO 自动生成的 catch 块
|
||||
* e1.printStackTrace();
|
||||
* }
|
||||
* e.printStackTrace();
|
||||
*/}
|
||||
// }
|
||||
// 接口回传日志
|
||||
interfaceManager.updateDataInterfaceLog(interfaceLog, "", str);
|
||||
|
||||
try {
|
||||
if (out != null) {
|
||||
out.close();
|
||||
}
|
||||
if (instr != null) {
|
||||
instr.close();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
public String doWmsReqMes1(String URL, String xmlInfo,String type) {
|
||||
|
||||
DataInterfaceLog interfaceLog = interfaceManager.storeDataInterfaceLog("WMS-MES", type, "WMS", "MES", URL,
|
||||
xmlInfo);
|
||||
// 创建Token客户端
|
||||
WmsTokenClient client = new WmsTokenClient();
|
||||
String response ="";
|
||||
// 1. 获取访问Token
|
||||
if (client.getAccessToken()) {
|
||||
System.out.println("成功获取访问Token: " + client.getAccessTokenValue());
|
||||
|
||||
// 2. 构建业务请求数据(示例)
|
||||
Map<String, Object> requestData = new HashMap<String, Object>();
|
||||
requestData.put("warehouseCode", "WH001");
|
||||
requestData.put("skuCode", "SKU12345");
|
||||
requestData.put("action", "queryInventory");
|
||||
requestData.put("timestamp", System.currentTimeMillis());
|
||||
|
||||
// 3. 构建JSON请求
|
||||
String jsonRequest = client.buildSimpleJson(requestData);
|
||||
System.out.println("业务请求JSON: " + jsonRequest);
|
||||
|
||||
// 4. 调用业务API(使用访问Token)
|
||||
// 注意:需要替换为实际的业务API URL
|
||||
String businessApiUrl = "https://apintodev.amecnsh.com/AMEC4/wms/api/business";
|
||||
response = client.callBusinessApi(URL, xmlInfo);
|
||||
System.out.println("业务API响应: " + response);
|
||||
} else {
|
||||
System.out.println("获取访问Token失败");
|
||||
}
|
||||
// 接口回传日志
|
||||
interfaceManager.updateDataInterfaceLog(interfaceLog, "", response);
|
||||
return response;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject getJsonSapHead(String name) {
|
||||
JSONObject jsonobj1 = new JSONObject();
|
||||
|
|
@ -1034,7 +1152,7 @@ public class DefaultInterfaceReqManager extends DefaultBaseManager implements In
|
|||
|
||||
@Override
|
||||
public boolean wmsSapFaliaohuichuang(List<Long> ids) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-HH-dd");
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
|
||||
JSONObject jsonobj = new JSONObject();
|
||||
JSONObject jsonobj2 = new JSONObject();
|
||||
|
|
@ -1249,8 +1367,171 @@ public class DefaultInterfaceReqManager extends DefaultBaseManager implements In
|
|||
return sapStatus;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//WMS回传mes
|
||||
@Override
|
||||
public boolean wmsMesFaliao(List<Long> ids,String type) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
|
||||
JSONObject jsonobj = new JSONObject();
|
||||
JSONObject jsonobj2 = new JSONObject();
|
||||
JSONArray array = new JSONArray();
|
||||
PickTicket pickTicket=null;
|
||||
boolean sapStatus=false;
|
||||
// TODO 自动生成的方法存根
|
||||
for (Long id : ids) {
|
||||
JSONObject jsonobj1 = new JSONObject();
|
||||
Task task = this.load(Task.class, id);
|
||||
|
||||
ItemKey itemKey = this.load(ItemKey.class, task.getItemKey().getId());
|
||||
Item item = this.load(Item.class, itemKey.getItem().getId());
|
||||
PickTicketDetail ptd = this.load(PickTicketDetail.class, task.getPickTicketDetail().getId());
|
||||
if(pickTicket==null) {
|
||||
pickTicket= this.load(PickTicket.class, ptd.getPickTicket().getId());
|
||||
}
|
||||
// WarehouseArea warehouseArea = this.load(WarehouseArea.class, task.getWarehouseArea().getId());
|
||||
BillType billType = this.load(BillType.class, pickTicket.getBillType().getId());
|
||||
// WMS2SAP-成品发货出库反馈接口
|
||||
String str=task.getItemKey().getLotInfo().getPropC9();
|
||||
String str1=task.getItemKey().getLotInfo().getPropC2();
|
||||
if (type.equals("2")||type.equals("5")) {
|
||||
// jsonobj.put("HEAD", getJsonSapHead("SD003"));
|
||||
jsonobj2.put("TAALS", pickTicket.getCode() == null ? "" : pickTicket.getCode());
|
||||
jsonobj2.put("SERNR", pickTicket.getRelatedBill1() == null ? "" : pickTicket.getRelatedBill1());
|
||||
jsonobj2.put("MATNR1", item.getCode());
|
||||
jsonobj2.put("WERKS", str==null?"":str);
|
||||
// jsonobj2.put("LGORT", str1==null?"":str1);
|
||||
jsonobj2.put("CASENUMBER", ptd.getLineNumber() + "");
|
||||
jsonobj2.put("ZACGIQTY", task.getMovedQuantityMU() + "");
|
||||
jsonobj2.put("TASAT", type);
|
||||
jsonobj2.put("TASPD", dateFormat.format(task.getOperateTime()));
|
||||
} else if(type.equals("3")) {
|
||||
// jsonobj.put("HEAD", getJsonSapHead("SD003"));
|
||||
jsonobj2.put("TAALS", pickTicket.getCode() == null ? "" : pickTicket.getCode());
|
||||
jsonobj2.put("SERNR", pickTicket.getRelatedBill1() == null ? "" : pickTicket.getRelatedBill1());
|
||||
jsonobj2.put("MATNR1", item.getCode());
|
||||
jsonobj2.put("WERKS", str==null?"":str);
|
||||
// jsonobj2.put("LGORT", str1==null?"":str1);
|
||||
jsonobj2.put("CASENUMBER", ptd.getLineNumber() + "");
|
||||
jsonobj2.put("ZACGIQTY", task.getMovedQuantityMU() + "");
|
||||
jsonobj2.put("TASAT", type);
|
||||
jsonobj2.put("NEWSERNR", pickTicket.getRelatedBill2() == null ? "" : pickTicket.getRelatedBill2());
|
||||
jsonobj2.put("NEWCASENUMBER", ptd.getStrBill10());//新箱号
|
||||
jsonobj2.put("NEWMATNR1", ptd.getStrBill11());//新料号
|
||||
jsonobj2.put("TASPD", dateFormat.format(task.getOperateTime()));
|
||||
jsonobj2.put("TACTI", timeFormat.format(task.getOperateTime()));
|
||||
|
||||
}else if(type.equals("4")) {
|
||||
|
||||
// jsonobj.put("HEAD", getJsonSapHead("SD003"));
|
||||
jsonobj2.put("TAALS", pickTicket.getCode() == null ? "" : pickTicket.getCode());
|
||||
jsonobj2.put("SERNR", pickTicket.getRelatedBill1() == null ? "" : pickTicket.getRelatedBill1());
|
||||
jsonobj2.put("MATNR1", item.getCode());
|
||||
jsonobj2.put("WERKS", str==null?"":str);
|
||||
jsonobj2.put("MANUAL", "");//库区
|
||||
jsonobj2.put("CASENUMBER", ptd.getLineNumber() + "");
|
||||
jsonobj2.put("ZACGIQTY", task.getMovedQuantityMU() + "");
|
||||
jsonobj2.put("TASAT", type);
|
||||
|
||||
jsonobj2.put("TASPD", dateFormat.format(task.getOperateTime()));
|
||||
jsonobj2.put("TACTI", timeFormat.format(task.getOperateTime()));
|
||||
}
|
||||
array.add(jsonobj2);
|
||||
}
|
||||
jsonobj.put("requestBody", array);
|
||||
if(pickTicket!=null&&pickTicket.getCode().indexOf("CP")==-1
|
||||
&&((pickTicket.getSourceId()!=null&&pickTicket.getSourceId().indexOf("OT")== -1)
|
||||
|| pickTicket.getSourceId()==null )) {
|
||||
if(type.equals("2")) {
|
||||
//退回出库
|
||||
String bs=doWmsReqMes1(getPropertiesParm("ldxt.MES")+ApiURL.returnMESRETURN, jsonobj.toString(),"MES数据"+pickTicket.getCode());
|
||||
}else if(type.equals("3")) {
|
||||
//变更出库
|
||||
String bs=doWmsReqMes1(getPropertiesParm("ldxt.MES")+ApiURL.returnMESUPDATE, jsonobj.toString(),"MES数据"+pickTicket.getCode());
|
||||
}else if(type.equals("4")) {
|
||||
//移库
|
||||
String bs=doWmsReqMes1(getPropertiesParm("ldxt.MES")+ApiURL.returnMESTRANSFER, jsonobj.toString(),"MES数据"+pickTicket.getCode());
|
||||
}else if(type.equals("5")) {
|
||||
//成品出库
|
||||
String bs=doWmsReqMes1(getPropertiesParm("ldxt.MES")+ApiURL.returnMESPRODUCT, jsonobj.toString(),"MES数据"+pickTicket.getCode());
|
||||
}
|
||||
|
||||
|
||||
// if(bs!=null&&!bs.equals("")&&OUTPUT(bs)) {
|
||||
// sapStatus=true;//回传是否成功
|
||||
// }else {
|
||||
// try {
|
||||
// ExceptionLog log=EntityFactory.getEntity(ExceptionLog.class);
|
||||
// log.setType("PICK");
|
||||
// log.setOperUserId(pickTicket.getId());
|
||||
// log.setOperDate(new Date());
|
||||
// log.setOperException(bs);
|
||||
// log.setOperExceptionMess(jsonobj.toString());
|
||||
// log.setOperPageName("数据");
|
||||
// commonDao.store(log);
|
||||
// }catch (Exception e) {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
}
|
||||
return sapStatus;
|
||||
}
|
||||
//WMS回传mes
|
||||
@Override
|
||||
public boolean wmsMesInventory(List<Long> ids,String type) {
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
|
||||
JSONObject jsonobj = new JSONObject();
|
||||
JSONObject jsonobj2 = new JSONObject();
|
||||
JSONArray array = new JSONArray();
|
||||
boolean sapStatus=false;
|
||||
// TODO 自动生成的方法存根
|
||||
for (Long id : ids) {
|
||||
Inventory inv = this.load(Inventory.class, id);
|
||||
Location loc=commonDao.load(Location.class, inv.getLocation().getId());
|
||||
ItemKey itemKey = this.load(ItemKey.class, inv.getItemKey().getId());
|
||||
Item item = this.load(Item.class, itemKey.getItem().getId());
|
||||
|
||||
WarehouseArea warehouseArea = this.load(WarehouseArea.class, loc.getZone().getId());
|
||||
// WMS2SAP-成品发货出库反馈接口
|
||||
String str=itemKey.getLotInfo().getPropC9();
|
||||
String str1=itemKey.getLotInfo().getPropC2();
|
||||
String itemCode=item.getCode();
|
||||
if(type.equals("4")) {
|
||||
String[] fruits = itemCode.split("#");
|
||||
Date dt=new Date();
|
||||
String code2="MV"+dt.getTime();
|
||||
// jsonobj.put("HEAD", getJsonSapHead("SD003"));
|
||||
jsonobj2.put("TAALS", code2);
|
||||
int index = itemCode.lastIndexOf("#");
|
||||
itemCode.substring(0, index);
|
||||
jsonobj2.put("SERNR", fruits[0]);
|
||||
jsonobj2.put("MATNR1", itemCode);
|
||||
jsonobj2.put("WERKS", str==null?"":str);
|
||||
jsonobj2.put("MANUAL", warehouseArea.getName());//库区
|
||||
jsonobj2.put("CASENUMBER", fruits[1]);
|
||||
jsonobj2.put("ZACGIQTY", inv.getQuantity());
|
||||
jsonobj2.put("TASAT", type);
|
||||
jsonobj2.put("TASPD", dateFormat.format(dt));
|
||||
jsonobj2.put("TACTI", timeFormat.format(dt));
|
||||
}
|
||||
array.add(jsonobj2);
|
||||
}
|
||||
jsonobj.put("requestBody", array);
|
||||
if(type.equals("2")) {
|
||||
String bs=doWmsReqMes1(getPropertiesParm("ldxt.MES")+ApiURL.returnMESRETURN, jsonobj.toString(),"MES数据");
|
||||
}else if(type.equals("3")) {
|
||||
String bs=doWmsReqMes1(getPropertiesParm("ldxt.MES")+ApiURL.returnMESUPDATE, jsonobj.toString(),"MES数据");
|
||||
}else if(type.equals("4")) {
|
||||
String bs=doWmsReqMes1(getPropertiesParm("ldxt.MES")+ApiURL.returnMESTRANSFER, jsonobj.toString(),"MES数据");
|
||||
}else if(type.equals("5")) {
|
||||
String bs=doWmsReqMes1(getPropertiesParm("ldxt.MES")+ApiURL.returnMESPRODUCT, jsonobj.toString(),"MES数据");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return sapStatus;
|
||||
}
|
||||
|
||||
|
||||
//返回截取
|
||||
|
|
@ -2518,5 +2799,62 @@ public class DefaultInterfaceReqManager extends DefaultBaseManager implements In
|
|||
return sapStatus;
|
||||
}
|
||||
|
||||
|
||||
public void returnoutAsnMes(List<Long> ids) {
|
||||
|
||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss");
|
||||
JSONObject jsonobj = new JSONObject();
|
||||
String becode="";
|
||||
for (Long id : ids) {
|
||||
ReceivedRecord receivedRecord = commonDao.load(ReceivedRecord.class, id);
|
||||
ASNDetail asnDetail = commonDao.load(ASNDetail.class, receivedRecord.getAsnDetail().getId());
|
||||
ASN asn = commonDao.load(ASN.class, receivedRecord.getAsn().getId());
|
||||
WarehouseArea warehouseArea = commonDao.load(WarehouseArea.class,
|
||||
receivedRecord.getWarehouseArea().getId());
|
||||
Item item = this.load(Item.class, asnDetail.getItem().getId());
|
||||
BillType billType = this.load(BillType.class, asn.getBillType().getId());
|
||||
JSONArray array = new JSONArray();
|
||||
JSONObject jsonobj2 = new JSONObject();
|
||||
becode=asn.getCode();
|
||||
if ((billType.getCode().equals("ZPUTASN"))) {// WMS2SAP-成品收货入库反馈接口
|
||||
// jsonobj.put("HEAD", getJsonSapHead("SD002"));
|
||||
jsonobj2.put("TAALS", asn.getCode() + "");//任务号
|
||||
jsonobj2.put("SERNR", asn.getRelatedBill2() + "");//项目ID
|
||||
jsonobj2.put("MATNR1", item.getCode() + "");//物料号
|
||||
jsonobj2.put("CASENUMBER", asnDetail.getStrBill1()+ "");//箱号
|
||||
jsonobj2.put("WERKS", asnDetail.getLotInfo().getPropC9() + "");//工厂
|
||||
jsonobj2.put("LGORT", asnDetail.getLotInfo().getPropC2() + "");//库存地
|
||||
jsonobj2.put("TAAGR", receivedRecord.getReceivedQuantity());//实际收货数量
|
||||
jsonobj2.put("MANUAL", warehouseArea.getName());//库区
|
||||
jsonobj2.put("TASBD", dateFormat.format(receivedRecord.getOccurTime()));//收货任务回传日期
|
||||
jsonobj2.put("TASBT", timeFormat.format(receivedRecord.getOccurTime()));//收货任务回传时间
|
||||
//成品收货状态0-未处理;1-处理中;2-处理完成
|
||||
// if(asn.getReceivedQuantity()>0&&asn.getReceivedQuantity()==asn.getPutawayQuantity()){
|
||||
// jsonobj2.put("TASAT", "2");
|
||||
// }else {
|
||||
// jsonobj2.put("TASAT", "1");
|
||||
// }
|
||||
// jsonobj2.put("MANUAL", "");
|
||||
}
|
||||
array.add(jsonobj2);
|
||||
jsonobj.put("requestBody", array);
|
||||
logger.info(jsonobj);
|
||||
if(asn.getCode().indexOf("RP")==-1&&(billType.getCode().equals("CPUTASN")||billType.getCode().equals("ZPUTASN")||billType.getCode().equals("QPUTASN"))
|
||||
&&asn.getCode().indexOf("OT")==-1) {
|
||||
if(getPropertiesParm("ldxt.bz").equals("1")) {
|
||||
|
||||
String flag = doWmsReqMes1(getPropertiesParm("ldxt.MES")+ApiURL.returnMESIN, jsonobj.toString(),"入库"+billType.getCode()+becode);
|
||||
|
||||
if (flag!=null) {
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1019,7 +1019,291 @@ public class DefaultInterfaceRespManager extends DefaultBaseManager implements I
|
|||
return json11;
|
||||
}
|
||||
|
||||
|
||||
//SAP-WMS:成品退回出库任务接口
|
||||
@Override
|
||||
public JSONObject storeZPUTPTCmes(DataInterfaceLog log, String data) {
|
||||
JSONObject json0 = new JSONObject();
|
||||
JSONArray resultInfo = new JSONArray();
|
||||
BillType billType=null;
|
||||
List<BillType> BillTypes = commonDao.findByQuery(" from BillType bt where bt.code=:code",
|
||||
new String[] { "code"},new Object[] {"ZPUTPTC"});
|
||||
// TODO 自动生成的方法存根
|
||||
String msg="";
|
||||
JSONArray arrayItem=new JSONArray();
|
||||
JSONObject json = jsonDataPT(data);
|
||||
JSONArray pickTickets=new JSONArray();
|
||||
try {
|
||||
pickTickets=json.getJSONArray("header");
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
}
|
||||
|
||||
|
||||
String billTypess="ZPUTPTC";//单据类型
|
||||
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
List<BillType> billTypes=commonDao.findByQuery(" from BillType bt where bt.code='"+billTypess+"'");//单据类型查询
|
||||
for(int j=0;j<pickTickets.size();j++){
|
||||
JSONObject pickTicket=pickTickets.getJSONObject(j);
|
||||
|
||||
String RQORD=pickTicket.has("TAALS") ? pickTicket.getString("TAALS") : ""; //工单号(任务号)
|
||||
String relatedBill1=pickTicket.has("SERNR") ? pickTicket.getString("SERNR") : ""; //(项目ID)(机台号)
|
||||
String strBill3=pickTicket.has("CASENUMBER") ? pickTicket.getString("CASENUMBER") : ""; //箱号号
|
||||
String MATNR=pickTicket.has("MATNR1") ? pickTicket.getString("MATNR1") : ""; //物料号(销售订单物料号)
|
||||
String WERKS=pickTicket.has("WERKS") ? pickTicket.getString("WERKS") : ""; //工厂
|
||||
String LGORT=pickTicket.has("LGORT") ? pickTicket.getString("LGORT") : ""; //库存地点
|
||||
String BWART=pickTicket.has("BWART") ? pickTicket.getString("BWART") : ""; //移动类型
|
||||
String QTY=pickTicket.has("QTY") ? pickTicket.getString("QTY") : "0"; //数量(成品发货套数)
|
||||
String MEINS=pickTicket.has("MEINS") ? pickTicket.getString("MEINS") : ""; //计量单位
|
||||
String NEEDDATE=pickTicket.has("NEEDDATE") ? pickTicket.getString("NEEDDATE") : ""; //需求日期
|
||||
String TACDA=pickTicket.has("TACDA") ? pickTicket.getString("TACDA") : "2021-12-31"; //下发日期 年-月-日
|
||||
String TACTI=pickTicket.has("TACTI") ? pickTicket.getString("TACTI") : "00:00:00"; //时间 时:分:秒
|
||||
|
||||
Warehouse warehouse=this.load(Warehouse.class, 1L);
|
||||
Item item=null;
|
||||
List<Item> Items = commonDao.findByQuery(" from Item item where item.code=:code",
|
||||
new String[] { "code"},new Object[] {MATNR});
|
||||
if (Items.size()<=0) {
|
||||
JSONObject objectItem=new JSONObject();
|
||||
objectItem.put("TAALS", RQORD);
|
||||
objectItem.put("MATNR", MATNR);
|
||||
objectItem.put("errorcode", "205");
|
||||
objectItem.put("errordescr", "料号不存在!");
|
||||
resultInfo.add(objectItem);
|
||||
continue;
|
||||
}else{
|
||||
item=Items.get(0);
|
||||
}
|
||||
|
||||
if(msg==null || msg.length()<=0){
|
||||
if (BillTypes.size()>0) {
|
||||
billType=BillTypes.get(0);
|
||||
}else{
|
||||
billType=this.load(BillType.class, 1020L);
|
||||
}
|
||||
|
||||
PickTicket pTicket=null;
|
||||
List<PickTicket> pTickets = commonDao.findByQuery(" from PickTicket pt where pt.code=:RQORD",
|
||||
new String[] { "RQORD"},new Object[] {RQORD});
|
||||
if (pTickets.size()>0) {
|
||||
pTicket=pTickets.get(0);
|
||||
}else {
|
||||
pTicket=EntityFactory.getEntity(PickTicket.class);
|
||||
}
|
||||
pTicket.setCode(RQORD);
|
||||
pTicket.setBillType(billType);
|
||||
pTicket.setRelatedBill1(relatedBill1);
|
||||
// pTicket.setRelatedBill2(RECORDN);
|
||||
|
||||
if(NEEDDATE!=null&&!NEEDDATE.equals("")) {
|
||||
try {
|
||||
|
||||
pTicket.setShipDate(sdf.parse(NEEDDATE));
|
||||
pTicket.setUpdateTime(sf.parse(TACDA+" "+TACTI));
|
||||
} catch (ParseException e) {
|
||||
// TODO 自动生成的 catch 块
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}else {
|
||||
pTicket.setOrderDate(new Date());
|
||||
}
|
||||
|
||||
pTicket.setShipDate(new Date());
|
||||
pTicket.setWarehouse(warehouse);
|
||||
Structure company=this.load(Structure.class, 1L);
|
||||
pTicket.setCompany(company);
|
||||
pTicket.setStatus(PickTicketStatus.OPEN);
|
||||
if(BWART!=null&&BWART.length()>0) {
|
||||
pTicket.setSourceType(BWART);//成品出库
|
||||
}else {
|
||||
pTicket.setSourceType("ZPUTPTC");//成品出库
|
||||
}
|
||||
pTicket.setOrderDate(pTicket.getOrderDate());//订单日期
|
||||
// pTicket.setCode(this.bussinessCodeManager.getCodeForYm("PT",5));//自动生成出库单号
|
||||
pTicket.setBillType(billTypes.get(0));//单据类型
|
||||
pTicket.setStatus(PickTicketStatus.OPEN);//状态
|
||||
pTicket.setOrderQuantity(1);//出库数量
|
||||
pTicket.setOrderDate(new Date());//创建日期
|
||||
commonDao.store(pTicket);
|
||||
PickTicketDetail ptd =null;
|
||||
List<PickTicketDetail> PickTicketDetails = commonDao.findByQuery(" from PickTicketDetail ptd where "
|
||||
+ " ptd.pickTicket.id=:id and ptd.item.id=:sourceId ",
|
||||
new String[] { "id","sourceId"},new Object[] {pTicket.getId(),item.getId()});
|
||||
if (PickTicketDetails.size()>0) {
|
||||
ptd=PickTicketDetails.get(0);
|
||||
}else{
|
||||
ptd=EntityFactory.getEntity(PickTicketDetail.class);
|
||||
}
|
||||
ptd.setSourceId(RQORD);
|
||||
ptd.setItem(item);
|
||||
ptd.setOrderQuantity(1);//出库数量
|
||||
ptd.setLineNumber(strBill3);
|
||||
ptd.setLocationName(LGORT);
|
||||
ptd.setOrderQuantity(Double.parseDouble(QTY));
|
||||
ptd.setOrderQtyOfMasterUnit(ptd.getOrderQuantity());
|
||||
NewLotInfo newLotInfo=new NewLotInfo();
|
||||
newLotInfo.setPropC9(WERKS);
|
||||
newLotInfo.setPropC2(LGORT);
|
||||
ptd.setNewLotInfo(newLotInfo);
|
||||
ptd.setPickTicket(pTicket);
|
||||
commonDao.store(ptd);
|
||||
pickTicketManager.refreshOrderQuantity(pTicket);
|
||||
}
|
||||
}
|
||||
json0.accumulate("returnCode", "200");
|
||||
json0.accumulate("returnFlag", "1");
|
||||
json0.accumulate("returnDesc", "成功");
|
||||
json0.accumulate("resultInfo", resultInfo);
|
||||
JSONObject json1 = new JSONObject();
|
||||
json1.put("return", json0);
|
||||
JSONObject json11 = new JSONObject();
|
||||
json11.put("Response", json1);
|
||||
interfaceManager.updateDataInterfaceLog(log, null,json11.toString());
|
||||
return json11;
|
||||
}
|
||||
//SAP-WMS:成品变更出库任务接口
|
||||
@Override
|
||||
public JSONObject storeZPUTUPDATEmes(DataInterfaceLog log, String data) {
|
||||
JSONObject json0 = new JSONObject();
|
||||
JSONArray resultInfo = new JSONArray();
|
||||
BillType billType=null;
|
||||
List<BillType> BillTypes = commonDao.findByQuery(" from BillType bt where bt.code=:code",
|
||||
new String[] { "code"},new Object[] {"ZPUTMV"});
|
||||
// TODO 自动生成的方法存根
|
||||
String msg="";
|
||||
JSONArray arrayItem=new JSONArray();
|
||||
JSONObject json = jsonDataPT(data);
|
||||
JSONArray pickTickets=json.getJSONArray("header");
|
||||
String billTypess="ZPUTMV";//单据类型
|
||||
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
List<BillType> billTypes=commonDao.findByQuery(" from BillType bt where bt.code='"+billTypess+"'");//单据类型查询
|
||||
for(int j=0;j<pickTickets.size();j++){
|
||||
JSONObject pickTicket=pickTickets.getJSONObject(j);
|
||||
|
||||
String RQORD=pickTicket.has("TAALS") ? pickTicket.getString("TAALS") : ""; //工单号(任务号)
|
||||
String relatedBill1=pickTicket.has("SERNR") ? pickTicket.getString("SERNR") : ""; //(项目ID)(机台号)
|
||||
String strBill3=pickTicket.has("CASENUMBER") ? pickTicket.getString("CASENUMBER") : ""; //箱号号
|
||||
String MATNR=pickTicket.has("MATNR1") ? pickTicket.getString("MATNR1") : ""; //物料号(销售订单物料号)
|
||||
String WERKS=pickTicket.has("WERKS") ? pickTicket.getString("WERKS") : ""; //工厂
|
||||
String LGORT=pickTicket.has("LGORT") ? pickTicket.getString("LGORT") : ""; //库存地点
|
||||
String BWART=pickTicket.has("BWART") ? pickTicket.getString("BWART") : ""; //移动类型
|
||||
String QTY=pickTicket.has("QTY") ? pickTicket.getString("QTY") : "0"; //数量(成品发货套数)
|
||||
String MEINS=pickTicket.has("MEINS") ? pickTicket.getString("MEINS") : ""; //计量单位
|
||||
String NEEDDATE=pickTicket.has("NEEDDATE") ? pickTicket.getString("NEEDDATE") : ""; //需求日期
|
||||
String TACDA=pickTicket.has("TACDA") ? pickTicket.getString("TACDA") : "2021-12-31"; //下发日期 年-月-日
|
||||
String TACTI=pickTicket.has("TACTI") ? pickTicket.getString("TACTI") : "00:00:00"; //时间 时:分:秒
|
||||
String relatedBill2=pickTicket.has("NEWSERNR") ? pickTicket.getString("NEWSERNR") : ""; //(项目ID)(机台号)
|
||||
String NEWCASENUMBER=pickTicket.has("NEWCASENUMBER") ? pickTicket.getString("NEWCASENUMBER") : ""; //箱号号
|
||||
String NEWMATNR1=pickTicket.has("NEWMATNR1") ? pickTicket.getString("NEWMATNR1") : ""; //物料号(销售订单物料号)
|
||||
|
||||
|
||||
Warehouse warehouse=this.load(Warehouse.class, 1L);
|
||||
Item item=null;
|
||||
List<Item> Items = commonDao.findByQuery(" from Item item where item.code=:code",
|
||||
new String[] { "code"},new Object[] {MATNR});
|
||||
if (Items.size()<=0) {
|
||||
JSONObject objectItem=new JSONObject();
|
||||
objectItem.put("TAALS", RQORD);
|
||||
objectItem.put("MATNR", MATNR);
|
||||
objectItem.put("errorcode", "205");
|
||||
objectItem.put("errordescr", "料号不存在!");
|
||||
resultInfo.add(objectItem);
|
||||
continue;
|
||||
}else{
|
||||
item=Items.get(0);
|
||||
}
|
||||
|
||||
if(msg==null || msg.length()<=0){
|
||||
if (BillTypes.size()>0) {
|
||||
billType=BillTypes.get(0);
|
||||
}else{
|
||||
billType=this.load(BillType.class, 1020L);
|
||||
}
|
||||
|
||||
PickTicket pTicket=null;
|
||||
List<PickTicket> pTickets = commonDao.findByQuery(" from PickTicket pt where pt.code=:RQORD",
|
||||
new String[] { "RQORD"},new Object[] {RQORD});
|
||||
if (pTickets.size()>0) {
|
||||
pTicket=pTickets.get(0);
|
||||
}else {
|
||||
pTicket=EntityFactory.getEntity(PickTicket.class);
|
||||
}
|
||||
pTicket.setCode(RQORD);
|
||||
pTicket.setBillType(billType);
|
||||
pTicket.setRelatedBill1(relatedBill1);
|
||||
pTicket.setRelatedBill2(relatedBill2);
|
||||
if(NEEDDATE!=null&&!NEEDDATE.equals("")) {
|
||||
try {
|
||||
pTicket.setShipDate(sdf.parse(NEEDDATE));
|
||||
pTicket.setUpdateTime(sf.parse(TACDA+" "+TACTI));
|
||||
} catch (ParseException e) {
|
||||
// TODO 自动生成的 catch 块
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}else {
|
||||
pTicket.setOrderDate(new Date());
|
||||
}
|
||||
pTicket.setShipDate(new Date());
|
||||
pTicket.setWarehouse(warehouse);
|
||||
Structure company=this.load(Structure.class, 1L);
|
||||
pTicket.setCompany(company);
|
||||
pTicket.setStatus(PickTicketStatus.OPEN);
|
||||
if(BWART!=null&&BWART.length()>0) {
|
||||
pTicket.setSourceType(BWART);//成品出库
|
||||
}else {
|
||||
pTicket.setSourceType("ZPUTPTC");//成品出库
|
||||
}
|
||||
pTicket.setOrderDate(pTicket.getOrderDate());//订单日期
|
||||
// pTicket.setCode(this.bussinessCodeManager.getCodeForYm("PT",5));//自动生成出库单号
|
||||
pTicket.setBillType(billTypes.get(0));//单据类型
|
||||
pTicket.setStatus(PickTicketStatus.OPEN);//状态
|
||||
pTicket.setOrderQuantity(1);//出库数量
|
||||
pTicket.setOrderDate(new Date());//创建日期
|
||||
commonDao.store(pTicket);
|
||||
PickTicketDetail ptd =null;
|
||||
List<PickTicketDetail> PickTicketDetails = commonDao.findByQuery(" from PickTicketDetail ptd where "
|
||||
+ " ptd.pickTicket.id=:id and ptd.item.id=:sourceId ",
|
||||
new String[] { "id","sourceId"},new Object[] {pTicket.getId(),item.getId()});
|
||||
if (PickTicketDetails.size()>0) {
|
||||
ptd=PickTicketDetails.get(0);
|
||||
}else{
|
||||
ptd=EntityFactory.getEntity(PickTicketDetail.class);
|
||||
}
|
||||
ptd.setSourceId(RQORD);
|
||||
ptd.setItem(item);
|
||||
ptd.setOrderQuantity(1);//出库数量
|
||||
ptd.setLineNumber(strBill3);
|
||||
ptd.setLocationName(LGORT);
|
||||
ptd.setOrderQuantity(Double.parseDouble(QTY));
|
||||
ptd.setOrderQtyOfMasterUnit(ptd.getOrderQuantity());
|
||||
NewLotInfo newLotInfo=new NewLotInfo();
|
||||
newLotInfo.setPropC9(WERKS);
|
||||
newLotInfo.setPropC2(LGORT);
|
||||
ptd.setNewLotInfo(newLotInfo);
|
||||
ptd.setPickTicket(pTicket);
|
||||
ptd.setStrBill10(NEWCASENUMBER);//新箱号
|
||||
ptd.setStrBill11(NEWMATNR1);//新料号
|
||||
commonDao.store(ptd);
|
||||
pickTicketManager.refreshOrderQuantity(pTicket);
|
||||
}
|
||||
}
|
||||
json0.accumulate("returnCode", "200");
|
||||
json0.accumulate("returnFlag", "1");
|
||||
json0.accumulate("returnDesc", "成功");
|
||||
json0.accumulate("resultInfo", resultInfo);
|
||||
JSONObject json1 = new JSONObject();
|
||||
json1.put("return", json0);
|
||||
JSONObject json11 = new JSONObject();
|
||||
json11.put("Response", json1);
|
||||
interfaceManager.updateDataInterfaceLog(log, null,json11.toString());
|
||||
return json11;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public JSONObject storeQPUTPTCsap(DataInterfaceLog log, String data) {
|
||||
JSONObject json0 = new JSONObject();
|
||||
|
|
@ -1343,7 +1627,145 @@ public class DefaultInterfaceRespManager extends DefaultBaseManager implements I
|
|||
interfaceManager.updateDataInterfaceLog(log, null,json11.toString());
|
||||
return json11;
|
||||
}
|
||||
|
||||
//mes成品入库
|
||||
public JSONObject storeMESZPUTASN(DataInterfaceLog log, String data) {
|
||||
JSONObject json0 = new JSONObject();
|
||||
JSONArray resultInfo = new JSONArray();
|
||||
String returnCode="205";
|
||||
String returnDesc="0";
|
||||
String returnFlag="";
|
||||
JSONArray jsonArray = jsonData(data);//解析报文数据
|
||||
String billType="ZPUTASN";
|
||||
List<BillType> billTypes=commonDao.findByQuery(" from BillType bt where bt.code='"+billType+"'");//单据类型查询
|
||||
//循环报文数据
|
||||
for(int j=0;j<jsonArray.size();j++){
|
||||
JSONObject asn=JSONObject.fromObject(jsonArray.get(j));//根据报文获取数据赋值给asn
|
||||
System.out.println(asn);//输出数据
|
||||
String PO=asn.has("TAALS") ? asn.getString("TAALS") : ""; //入库序号(任务号)
|
||||
log.setFunction(PO);
|
||||
// String strBill7=asn.has("MBLNR") ? asn.getString("MBLNR") : ""; //凭证号
|
||||
String strBill7=bussinessCodeManager.getCodeForYm("RP",5);//凭证号
|
||||
String SERNR=asn.has("SERNR") ? asn.getString("SERNR") : ""; //(机台号)
|
||||
String itemCode=asn.has("MATNR1") ? asn.getString("MATNR1") : "";//物料号
|
||||
String propC9=asn.has("WERKS") ? asn.getString("WERKS") : "";//工厂
|
||||
String propC2=asn.has("LGORT") ? asn.getString("LGORT") : "";//库存地
|
||||
String casenumber=asn.has("CASENUMBER") ? asn.getString("CASENUMBER") : "";//箱号
|
||||
String sourceType=asn.has("BWART") ? asn.getString("BWART") : "";//移动类型
|
||||
String meins=asn.has("MEINS") ? asn.getString("MEINS") : "";//单位
|
||||
double zqty1=asn.has("QTY") ? asn.getDouble("QTY") : 0;//收货数量
|
||||
// double zqty=asn.has("BOX") ? asn.getDouble("BOX") : 0;//计划箱数
|
||||
String SERIAL=asn.has("SERIAL") ? asn.getString("SERIAL") : "";//序列号
|
||||
double weight=asn.has("BRGEW") ? asn.getDouble("BRGEW") : 0;//重量
|
||||
double length=asn.has("LENGTH") ? asn.getDouble("LENGTH") : 0;//长
|
||||
double width=asn.has("WIDTH") ? asn.getDouble("WIDTH") : 0;//宽
|
||||
double height=asn.has("HEIGHT") ? asn.getDouble("HEIGHT") : 0;//高
|
||||
String TACDA=asn.has("TACDA") ? asn.getString("TACDA") : ""; //日期 年-月-日
|
||||
String TACTI=asn.has("TACTI") ? asn.getString("TACTI") : ""; //时间 时:分:秒
|
||||
String productLine=asn.has("productLine") ? asn.getString("productLine") : "";
|
||||
|
||||
// String Recordn=asn.has("RECORDN") ? asn.getString("RECORDN") : "";//成品记录流水号record number
|
||||
// String Returned=asn.has("RETURNED") ? asn.getString("RETURNED") : "";//退货标识
|
||||
|
||||
Date orderDate=null;
|
||||
try {
|
||||
orderDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(TACDA+" "+TACTI);
|
||||
} catch (ParseException e1) {
|
||||
// TODO 自动生成的 catch 块
|
||||
e1.printStackTrace();
|
||||
}
|
||||
List<ASN> asns = commonDao.findByQuery(" from ASN asn where asn.code=:code ",
|
||||
new String[] { "code"},new Object[] {PO});
|
||||
ASN asndb=EntityFactory.getEntity(ASN.class);
|
||||
if (asns.size()>0) {//查询收货表是否有数据
|
||||
asndb=asns.get(0);//如果有数据就显示查询到的数据
|
||||
}else {//如果没有数据 上面获取的数据就放到 asndb里面去
|
||||
asndb.setCode(PO);
|
||||
asndb.setOrderDate(orderDate);
|
||||
asndb.setStatus(ASNStatus.OPEN);
|
||||
}
|
||||
asndb.setUserName("HANDABAP");
|
||||
asndb.setCompany(commonDao.load(Structure.class, 1L));//默认客户
|
||||
asndb.setCode(PO);//接口任务号
|
||||
asndb.setRelatedBill1(strBill7);//自动生成收货凭证号
|
||||
asndb.setRelatedBill2(SERNR);//项目号
|
||||
asndb.setWarehouse(this.load(Warehouse.class, 1L));//默认仓库
|
||||
asndb.setOrderDate(asndb.getOrderDate());//收货日期
|
||||
asndb.setStatus(ASNStatus.OPEN);//状态
|
||||
asndb.setBillType(billTypes.get(0));//单据类型
|
||||
asndb.setOrderDate(orderDate);
|
||||
asndb.setSourceType(sourceType);//移位类型
|
||||
// asndb.setExpectedQuantity(1);//订单数量
|
||||
asndb.setChejian(productLine);//产品线
|
||||
commonDao.store(asndb);
|
||||
ASNDetail asnDetail=EntityFactory.getEntity(ASNDetail.class);
|
||||
List<ASNDetail> asnDetails = commonDao.findByQuery(" from ASNDetail ad where ad.item.code=:itemCode and ad.asn.id=:id",
|
||||
new String[] { "itemCode","id"},new Object[] {itemCode,asndb.getId()});
|
||||
if (asnDetails.size()>0) {
|
||||
asnDetail=asnDetails.get(0);
|
||||
}
|
||||
asnDetail.setExpectedQuantity(1);
|
||||
asnDetail.setSourceId(PO);
|
||||
Item item=null;
|
||||
List<Item> items=this.commonDao.findByQuery("from Item it where it.code='"+itemCode+"' ");
|
||||
if (items.size()>0) {
|
||||
item=items.get(0);
|
||||
}else{
|
||||
item=EntityFactory.getEntity(Item.class);
|
||||
item.setCode(itemCode);
|
||||
item.setName(itemCode);
|
||||
item.setSpecs("");
|
||||
item.setShipRules("");
|
||||
item.setUnit(meins);
|
||||
item.setGoodType("");
|
||||
// item.setWeight(weight);
|
||||
// item.setLength(length);
|
||||
// item.setWidth(width);
|
||||
// item.setHeight(height);
|
||||
item.setFeeType("MES");
|
||||
// List<WarehouseArea> warehouseAreas=this.commonDao.findByQuery("from WarehouseArea wa where wa.id="+1763l+"");
|
||||
// if (warehouseAreas.size()>0) {
|
||||
// item.setWarehouseArea(warehouseAreas.get(0));
|
||||
// }
|
||||
commonDao.store(item);
|
||||
}
|
||||
LotInfo lotInfo=new LotInfo();
|
||||
lotInfo.setPropC2(propC2);
|
||||
lotInfo.setPropC9(propC9);
|
||||
asnDetail.setLotInfo(lotInfo);
|
||||
asnDetail.setCreateDate(new Date());
|
||||
// asnDetail.setSourceId(new Date().getTime()+"");
|
||||
asnDetail.setItem(item);//物料描述(货品)(物料料号)
|
||||
// asnDetail.setStrBill3(zfggr);//
|
||||
asnDetail.setStrBill1(casenumber);//箱号
|
||||
// asnDetail.setStrBill6();
|
||||
asnDetail.setStrBill7(strBill7);
|
||||
// asnDetail.setStrBill8(strBill1);
|
||||
// asnDetail.setRelatedBill2(Recordn);
|
||||
// asnDetail.setRelatedBill3(Returned);
|
||||
asnDetail.setAsn(asndb);//把收货单(收货表数据)存到收货明细中去
|
||||
asnDetail.setWeight(weight);//重量
|
||||
asnDetail.setLength(length);
|
||||
asnDetail.setWidth(width);
|
||||
asnDetail.setHeight(height);
|
||||
commonDao.store(asnDetail);
|
||||
asnManager.addASNDetail(asndb.getId(),asnDetail);
|
||||
returnCode="200";
|
||||
returnFlag="1";
|
||||
returnDesc="成功";
|
||||
}
|
||||
|
||||
json0.accumulate("returnCode", returnCode);
|
||||
json0.accumulate("returnFlag", returnFlag);
|
||||
json0.accumulate("returnDesc", returnDesc);
|
||||
json0.accumulate("resultInfo", resultInfo);
|
||||
|
||||
JSONObject json1 = new JSONObject();
|
||||
json1.put("return", json0);
|
||||
JSONObject json11 = new JSONObject();
|
||||
json11.put("Response", json1);
|
||||
interfaceManager.updateDataInterfaceLog(log, null,json11.toString());
|
||||
return json11;
|
||||
}
|
||||
//OA下发:无PO、无料号的收货
|
||||
@Override
|
||||
public JSONObject storeOAPUTASNoa(DataInterfaceLog log, String data) {
|
||||
|
|
|
|||
|
|
@ -3134,8 +3134,14 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
|
|||
// }
|
||||
String belcos="否";
|
||||
if(ik.getLotInfo()!=null&&ik.getLotInfo().getPropC2()!=null
|
||||
&&ik.getLotInfo().getPropC2().equals("SL19")) {
|
||||
belcos="是";
|
||||
) {
|
||||
String lco=ik.getLotInfo().getPropC2();
|
||||
List<Long> list=commonDao.findByQuery("select pl.id from PlantLocation as pl "
|
||||
+ "where pl.code='"+lco+"' and pl.beRegister=1 ");
|
||||
if(list.size()>0) {
|
||||
belcos="是";
|
||||
}
|
||||
|
||||
}
|
||||
String beMarkWeight="";
|
||||
if(ik.isBeMarkWeight()){
|
||||
|
|
@ -10002,7 +10008,7 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
|
|||
try {
|
||||
if (workerId > 0) {
|
||||
if (wId > 0) {
|
||||
|
||||
|
||||
String hql="select p.id,z.LEVELS,p.CODE," +
|
||||
" STUFF((SELECT ','+CONVERT(nvarchar(10),a.id) FROM TASK a\r\n" +
|
||||
" left join PICK_TICKET_DETAIL pt1 on pt1.id=a.PICK_TICKET_DETAIL_ID\r\n" +
|
||||
|
|
@ -10024,7 +10030,8 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
|
|||
" left join zone z on z.id=loc.ZONE_ID \r\n" +
|
||||
" left join LOCATION lc on lc.ID=t.DST_LOC_ID \r\n" +
|
||||
" where t.INVENTORY_STATUS='合单完成' and t.PLAN_QUANTITY_MU>0 "
|
||||
+ " and t.LEAVE_TIME is null and lc.zone_id<>1787 and t.MOVED_QUANTITY_MU>0\r\n" ;
|
||||
+ " and t.LEAVE_TIME is null and lc.zone_id<>1787 "
|
||||
+ "and t.MOVED_QUANTITY_MU>0\r\n" ;
|
||||
|
||||
if(billcode!=null&&!billcode.equals("")) {
|
||||
if(billcode.equals("3")) {
|
||||
|
|
@ -10050,6 +10057,84 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
|
|||
}
|
||||
hql+= " group by p.id,p.CODE,z.LEVELS "
|
||||
+ " order by max(p.equated_Quantity) desc,max(t.operator_Date),p.CODE,p.id,z.LEVELS ";
|
||||
|
||||
|
||||
/**
|
||||
String hql=" WITH TaskData AS (\r\n" +
|
||||
" SELECT \r\n" +
|
||||
" t.id AS task_id,\r\n" +
|
||||
" p.id AS pick_ticket_id,\r\n" +
|
||||
" p.CODE,\r\n" +
|
||||
" z.LEVELS,\r\n" +
|
||||
" p.equated_Quantity,\r\n" +
|
||||
" t.BILLCODE,\r\n" +
|
||||
" t.WORKER2_ID,\r\n" +
|
||||
" t.operator_Date,\r\n" +
|
||||
" lc.code AS lc_code\r\n" +
|
||||
" FROM TASK t \r\n" +
|
||||
" INNER JOIN PICK_TICKET_DETAIL pt ON pt.id = t.PICK_TICKET_DETAIL_ID \r\n" +
|
||||
" INNER JOIN PICK_TICKET p ON p.id = pt.PICK_TICKET_ID \r\n" +
|
||||
" INNER JOIN LOCATION loc ON loc.ID = t.SRC_LOC_ID\r\n" +
|
||||
" INNER JOIN ZONE z ON z.id = loc.ZONE_ID \r\n" +
|
||||
" INNER JOIN LOCATION lc ON lc.ID = t.DST_LOC_ID \r\n" +
|
||||
" WHERE t.INVENTORY_STATUS = '合单完成' \r\n" +
|
||||
" AND t.PLAN_QUANTITY_MU > 0 \r\n" +
|
||||
" AND t.MOVED_QUANTITY_MU > 0\r\n" +
|
||||
" AND t.LEAVE_TIME IS NULL \r\n" +
|
||||
" AND lc.zone_id <> 1787\r\n" ;
|
||||
|
||||
if(billcode!=null&&!billcode.equals("")) {
|
||||
if(billcode.equals("3")) {
|
||||
hql+=" and z.LEVELS=3 ";
|
||||
}else if(billcode.equals("7")){
|
||||
hql+=" and z.LEVELS=7 ";
|
||||
}
|
||||
}else {
|
||||
hql+=" and z.LEVELS in(3,7) ";
|
||||
}
|
||||
if(p_code!=null&&!p_code.equals("")) {
|
||||
String str []= p_code.split("/");
|
||||
if(str.length>2) {
|
||||
p_code=str[1];
|
||||
}
|
||||
String[] stringArray= p_code.split("-");
|
||||
if(stringArray.length>0) {
|
||||
p_code=stringArray[0].toString();
|
||||
}
|
||||
hql+=" and p.CODE='"+p_code+"'";
|
||||
}
|
||||
|
||||
hql=hql+"), " +
|
||||
"AggregatedTasks AS ( \r\n" +
|
||||
" SELECT \r\n" +
|
||||
" pick_ticket_id,\r\n" +
|
||||
" CODE,\r\n" +
|
||||
" LEVELS,\r\n" +
|
||||
" STRING_AGG(CONVERT(nvarchar(10), task_id), ',') AS tids,\r\n" +
|
||||
" MAX(equated_Quantity) AS soi,\r\n" +
|
||||
" COUNT(DISTINCT BILLCODE) AS BILLCODE,\r\n" +
|
||||
" MAX(CASE WHEN WORKER2_ID IS NULL THEN 1 ELSE 0 END) AS wor,\r\n" +
|
||||
" MAX(lc_code) AS lc_code,\r\n" +
|
||||
" MAX(operator_Date) AS last_operator_date\r\n" +
|
||||
" FROM TaskData\r\n" +
|
||||
" GROUP BY pick_ticket_id, CODE, LEVELS\r\n" +
|
||||
")\r\n" +
|
||||
"SELECT \r\n" +
|
||||
" pick_ticket_id AS id,\r\n" +
|
||||
" LEVELS,\r\n" +
|
||||
" CODE,\r\n" +
|
||||
" tids,\r\n" +
|
||||
" soi,\r\n" +
|
||||
" BILLCODE,\r\n" +
|
||||
" wor,\r\n" +
|
||||
" lc_code,\r\n" +
|
||||
" DATEDIFF(minute, last_operator_date, GETDATE()) AS hsh\r\n" +
|
||||
" FROM AggregatedTasks\r\n" +
|
||||
" ORDER BY soi DESC, last_operator_date, CODE, pick_ticket_id, LEVELS";
|
||||
System.out.println(hql);
|
||||
*/
|
||||
|
||||
|
||||
Query query = session.createSQLQuery(hql.toString());
|
||||
List<Object[]> list= (List<Object[]>)query.list();
|
||||
if (list.size() > 0) {
|
||||
|
|
@ -10236,8 +10321,9 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
|
|||
"left join LOCATION loc1 on loc1.ID=a.SRC_LOC_ID\r\n" +
|
||||
"left join zone z1 on z1.id=loc1.ZONE_ID\r\n" +
|
||||
"left join LOCATION lc1 on lc1.ID=a.DST_LOC_ID\r\n" +
|
||||
"where a.INVENTORY_STATUS='合单完成' and lc1.ZONE_ID<>1787 and " +
|
||||
" a.PLAN_QUANTITY_MU>0 and a.MOVED_QUANTITY_MU>0 and a.LEAVE_TIME is not null \r\n" +
|
||||
"where a.INVENTORY_STATUS='合单完成' and lc1.ZONE_ID<>1787 " +
|
||||
" and a.WORKER3_ID="+workerId+
|
||||
" and a.PLAN_QUANTITY_MU>0 and a.MOVED_QUANTITY_MU>0 and a.LEAVE_TIME is not null \r\n" +
|
||||
" and p.id=p1.id and z.LEVELS=z1.LEVELS for xml Path('')),1,1,'') as tids,"
|
||||
+ "max(p.equated_Quantity) soi,\r\n" +
|
||||
" max(p.code) p_code ,z.LEVELS ,count(distinct(t.BILLCODE)),"
|
||||
|
|
@ -10248,9 +10334,10 @@ public class DefaultQueryAppManager extends DefaultBaseManager implements QueryA
|
|||
"left join LOCATION loc on loc.ID=t.SRC_LOC_ID " +
|
||||
"left join LOCATION lc on lc.ID=t.DST_LOC_ID " +
|
||||
"left join zone z on z.id=loc.ZONE_ID\r\n" +
|
||||
" where t.INVENTORY_STATUS='合单完成' and t.PLAN_QUANTITY_MU>0 and t.MOVED_QUANTITY_MU>0\r\n" +
|
||||
" and t.LEAVE_TIME is not null and lc.ZONE_ID<>1787 " +
|
||||
" and t.WORKER3_ID="+workerId;
|
||||
" where t.INVENTORY_STATUS='合单完成' and t.PLAN_QUANTITY_MU>0 "
|
||||
+ "and t.MOVED_QUANTITY_MU>0 \r\n" + " and t.WORKER3_ID="+workerId
|
||||
+ " and t.LEAVE_TIME is not null and lc.ZONE_ID<>1787 " ;
|
||||
|
||||
if(billcode!=null&&billcode.length()>0) {
|
||||
String str []= billcode.split("/");
|
||||
if(str.length>2) {
|
||||
|
|
|
|||
|
|
@ -3198,7 +3198,8 @@ public class DefaultInventoryManager extends DefaultBaseManager implements Inven
|
|||
String description) {
|
||||
Inventory inv=this.load(Inventory.class, inventoryId);
|
||||
this.addInventoryLog(InventoryLogType.INVENTORY_ADJUST, -1, inv.getSOI(), inv.getLocation(), null, inv.getItemKey(),
|
||||
inv.getStorageDate(), inv.getSOI(), inv.getQuantity(), null, inv.getStatus(), inv.getId(), "调整库存"+description, null,0,
|
||||
inv.getStorageDate(), inv.getSOI(), inv.getQuantity(), null, inv.getStatus(), inv.getId(),
|
||||
"调整库存,备注:"+description+" ,调整数量:"+packQty+"", null,0,
|
||||
inv.getBarCode(),null,null,null);
|
||||
|
||||
inv.setQueuedQuantity(packQty1);//占用数量
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ public void addASNDetail(Long id,ASNDetail asnDetail) {
|
|||
ASN asn=this.load(ASN.class, id);
|
||||
if(asnDetail.isNew()){
|
||||
asnDetail.setSourceId(asnDetail.getSourceId());
|
||||
Integer lineNo=getlineNo(asn);
|
||||
// Integer lineNo=getlineNo(asn);
|
||||
/*if(lineNo==0){
|
||||
asnDetail.setLineNo(1);
|
||||
}else{
|
||||
|
|
@ -309,7 +309,8 @@ public void addASNDetail(Long id,ASNDetail asnDetail) {
|
|||
ASN a = commonDao.load(ASN.class, id);
|
||||
|
||||
List<Object[]> objs = commonDao.findByQuery(
|
||||
"select COALESCE(sum(o.weight),0),COALESCE(sum(o.volume),0),COALESCE(sum(o.expectedQuantity),0),COALESCE(sum(o.receivedQuantity),0),count(*) from ASNDetail o where o.asn.id=:id ",
|
||||
"select COALESCE(sum(o.weight),0),COALESCE(sum(o.volume),0),COALESCE(sum(o.expectedQuantity),0),"
|
||||
+ "COALESCE(sum(o.receivedQuantity),0),count(*) from ASNDetail o where o.asn.id=:id ",
|
||||
new String[] { "id" }, new Object[] { id });
|
||||
if (objs.size() > 0) {
|
||||
Object[] obj = objs.get(0);
|
||||
|
|
@ -4467,7 +4468,7 @@ public void addASNDetail(Long id,ASNDetail asnDetail) {
|
|||
throw new BusinessException("请维护收货月台!");
|
||||
}
|
||||
// if(asnDetail.getExpectedQuantity()>asnDetail.getReceivedQuantity()){
|
||||
asnDetail.setStrBill2(propC3);
|
||||
asnDetail.setStrBill2(propC3);//序列号
|
||||
asnDetail.setDock(dock);
|
||||
|
||||
boolean xhh=updateBeMarkWeight(asnDetail);
|
||||
|
|
|
|||
|
|
@ -852,5 +852,8 @@ public interface PickTicketManager extends BaseManager {
|
|||
String printLocationCodePick(String code, Long workerId,Long wid);
|
||||
|
||||
JSONObject checkCountRecordItem(String crIds ,String propD2,String barCodes,String propC1,String countQuantity,long userId,long warehouseId,CommonDao commonDao);
|
||||
//WMS回传MES
|
||||
@Transactional
|
||||
void wmsMesFaliaohuichuang(List<Long> taskids);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import java.text.SimpleDateFormat;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
|
@ -22,6 +23,7 @@ import java.util.Map;
|
|||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import jxl.Sheet;
|
||||
|
|
@ -224,6 +226,10 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
|
|||
pickTicket.setUserTracking1();
|
||||
pickTicket.setUpdateTime(new Date());
|
||||
pickTicket.setCollectNo(pickTicket.getCode());
|
||||
if(pickTicket.getBillType().getCode().equals("ZPUTPTC")) {
|
||||
String str=DateUtil.formatDateYMD02ToStr(pickTicket.getUpdateTime());
|
||||
pickTicket.setRelatedBill1(str+pickTicket.getUpdateTime().getTime());
|
||||
}
|
||||
this.commonDao.store(pickTicket);
|
||||
} else {
|
||||
PickTicket pt = this.load(PickTicket.class, pickTicket.getId());
|
||||
|
|
@ -4464,7 +4470,6 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
|
|||
if(qty>=pickQty) {
|
||||
r.setShippedQuantity(r.getShippedQuantity()+pickQty);
|
||||
r.setPickDate(new Date());
|
||||
|
||||
commonDao.store(r);
|
||||
pickQty=0;
|
||||
}else {
|
||||
|
|
@ -10842,5 +10847,394 @@ public class DefaultPickTicketManager extends DefaultBaseManager implements Pick
|
|||
}
|
||||
|
||||
|
||||
//以下代码为Deepseek
|
||||
/**
|
||||
* 交单确认方法 - 优化版
|
||||
*/
|
||||
public String presentationConfirmFour(String zone, String invIds, long locId, long userId, long warehouseId) {
|
||||
// 1. 参数校验
|
||||
String validationResult = validateParameters(zone, invIds, locId);
|
||||
if (validationResult != null) {
|
||||
return validationResult;
|
||||
}
|
||||
|
||||
// 2. 执行业务逻辑
|
||||
return executeBusinessLogic(zone, invIds, locId, userId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 参数校验
|
||||
*/
|
||||
private String validateParameters(String zone, String invIds, long locId) {
|
||||
if (zone == null || zone.trim().isEmpty()) {
|
||||
return "zone参数错误或为null!";
|
||||
}
|
||||
if (invIds == null || invIds.trim().isEmpty()) {
|
||||
return "invIds参数错误或为null!";
|
||||
}
|
||||
if (locId <= 0) {
|
||||
return "请扫描库位码!";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 执行业务逻辑
|
||||
*/
|
||||
private String executeBusinessLogic(String zone, String invIds, long locId, long userId) {
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
|
||||
Session session = null;
|
||||
try {
|
||||
session = ((HibernateDaoSupport) this.commonDao).getSessionFactory().openSession();
|
||||
|
||||
Location dstLoc = commonDao.load(Location.class, locId);
|
||||
|
||||
// 检查是否在交单区
|
||||
if (!isInPresentationZone(dstLoc)) {
|
||||
return "非交单区操作!";
|
||||
}
|
||||
|
||||
// 处理交单逻辑
|
||||
PresentationResult result = processPresentation(session, invIds, dstLoc, userId);
|
||||
|
||||
if (result.hasFailures()) {
|
||||
failureMsg.append(result.getFailureMessage());
|
||||
}
|
||||
if (result.hasSuccesses()) {
|
||||
successMsg.append(result.getSuccessMessage());
|
||||
}
|
||||
|
||||
} catch (BusinessException e) {
|
||||
failureMsg.append(e.getMessage());
|
||||
} catch (Exception e) {
|
||||
failureMsg.append("系统异常: ").append(e.getMessage());
|
||||
logger.error("交单确认异常", e);
|
||||
} finally {
|
||||
if (session != null) {
|
||||
session.close();
|
||||
}
|
||||
}
|
||||
|
||||
return failureMsg.length() > 0 ? failureMsg.toString() : successMsg.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理交单逻辑
|
||||
*/
|
||||
private PresentationResult processPresentation(Session session, String invIds,
|
||||
Location dstLoc, long userId) {
|
||||
PresentationResult result = new PresentationResult();
|
||||
|
||||
try {
|
||||
// 1. 验证容器是否完成合单
|
||||
validateContainerCompletion(session, invIds);
|
||||
|
||||
// 2. 查询所有任务
|
||||
List<Task> tasks = queryTasksByIds(invIds);
|
||||
if (tasks.isEmpty()) {
|
||||
throw new BusinessException("未找到对应的任务");
|
||||
}
|
||||
|
||||
// 3. 验证任务状态和权限
|
||||
validateTasks(tasks, dstLoc);
|
||||
|
||||
// 4. 按容器分组处理任务
|
||||
Map<String, List<Long>> containerTasksMap = groupTasksByContainer(tasks);
|
||||
List<Long> noContainerTasks = getTasksWithoutContainer(tasks);
|
||||
|
||||
Worker worker = commonDao.load(Worker.class, userId);
|
||||
Set<Long> pickTicketIds = extractPickTicketIds(tasks);
|
||||
List<Long> pickTicketList = new ArrayList<>(pickTicketIds);
|
||||
// 5. 处理有容器的任务
|
||||
processContainerTasks(session, containerTasksMap, dstLoc, worker, result);
|
||||
|
||||
// 6. 处理无容器的任务
|
||||
processNonContainerTasks(session, noContainerTasks, dstLoc, worker, result);
|
||||
|
||||
// 7. 刷新工单状态
|
||||
// refreshPickHandOrder(pickTicketIds);
|
||||
refPickHandOrder(pickTicketList);
|
||||
} catch (BusinessException e) {
|
||||
result.addFailure(e.getMessage());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证容器完成状态
|
||||
*/
|
||||
private void validateContainerCompletion(Session session, String invIds) {
|
||||
String cleanInvIds = invIds.replace(" ", "");
|
||||
String sql = "SELECT s.LP FROM task t " +
|
||||
"LEFT JOIN LOCATION lc ON lc.id = t.SRC_LOC_ID " +
|
||||
"LEFT JOIN ZONE z ON z.id = lc.ZONE_ID " +
|
||||
"LEFT JOIN STOCK s ON s.id = t.DST_LP " +
|
||||
"WHERE t.strBill5 IS NULL AND z.LEVELS IN (3,7) " +
|
||||
"AND t.id IN (" + cleanInvIds + ") " +
|
||||
"GROUP BY s.LP";
|
||||
|
||||
List<String> unfinishedContainers = session.createSQLQuery(sql).list();
|
||||
|
||||
if (!unfinishedContainers.isEmpty()) {
|
||||
throw new BusinessException("容器" + unfinishedContainers + "未做合单任务");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询任务列表
|
||||
*/
|
||||
private List<Task> queryTasksByIds(String invIds) {
|
||||
String cleanInvIds = invIds.replace(" ", "");
|
||||
String hql = "FROM Task t WHERE t.id IN (" + cleanInvIds + ")";
|
||||
return commonDao.findByQuery(hql);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证任务状态和权限
|
||||
*/
|
||||
private void validateTasks(List<Task> tasks, Location dstLoc) {
|
||||
boolean hasUncompletedTasks = checkTaskCompletionStatus(tasks);
|
||||
if (hasUncompletedTasks) {
|
||||
throw new BusinessException("该地标上任务未合单完成");
|
||||
}
|
||||
|
||||
for (Task task : tasks) {
|
||||
validateTaskPermissions(task, dstLoc);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查任务完成状态
|
||||
*/
|
||||
private boolean checkTaskCompletionStatus(List<Task> tasks) {
|
||||
String taskIds = tasks.stream()
|
||||
.map(t -> t.getId().toString())
|
||||
.collect(Collectors.joining(","));
|
||||
|
||||
String hql = "SELECT t.id FROM Task t WHERE t.id IN (" + taskIds + ") " +
|
||||
"AND t.inventoryStatus = '合单完成'";
|
||||
|
||||
List<Long> completedTasks = commonDao.findByQuery(hql);
|
||||
return completedTasks.size() < tasks.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证任务权限
|
||||
*/
|
||||
private void validateTaskPermissions(Task task, Location dstLoc) {
|
||||
PickTicketDetail ptd = commonDao.load(PickTicketDetail.class,
|
||||
task.getPickTicketDetail().getId());
|
||||
|
||||
// 检查加急交接点权限
|
||||
if (ptd.getSOI() != null &&
|
||||
("U".equals(ptd.getSOI()) || "X".equals(ptd.getSOI())) &&
|
||||
!dstLoc.isBeUrgent()) {
|
||||
throw new BusinessException("该地位不是加急交接点");
|
||||
}
|
||||
|
||||
// 检查加急交单位置限制
|
||||
Location stloc = commonDao.load(Location.class, task.getDstLoc().getId());
|
||||
if (dstLoc.isBeUrgent() && stloc.getZone().getId() == 1785L &&
|
||||
(stloc.getCode().startsWith("2") || stloc.getCode().startsWith("1"))) {
|
||||
throw new BusinessException("加急交单位不能放货架");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 按容器分组任务
|
||||
*/
|
||||
private Map<String, List<Long>> groupTasksByContainer(List<Task> tasks) {
|
||||
Map<String, List<Long>> containerMap = new HashMap<>();
|
||||
|
||||
for (Task task : tasks) {
|
||||
if (task.getDstLP() != null) {
|
||||
String containerId = task.getDstLP().getId().toString();
|
||||
containerMap.computeIfAbsent(containerId, k -> new ArrayList<>())
|
||||
.add(task.getId());
|
||||
}
|
||||
}
|
||||
|
||||
return containerMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取无容器任务
|
||||
*/
|
||||
private List<Long> getTasksWithoutContainer(List<Task> tasks) {
|
||||
return tasks.stream()
|
||||
.filter(t -> t.getDstLP() == null &&
|
||||
(t.getPositionStatus() == null || "0".equals(t.getPositionStatus())))
|
||||
.map(Task::getId)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 提取工单ID
|
||||
*/
|
||||
private Set<Long> extractPickTicketIds(List<Task> tasks) {
|
||||
return tasks.stream()
|
||||
.map(t -> t.getPickTicketDetail().getPickTicket().getId())
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理有容器任务
|
||||
*/
|
||||
private void processContainerTasks(Session session, Map<String, List<Long>> containerTasksMap,
|
||||
Location dstLoc, Worker worker, PresentationResult result) {
|
||||
for (Map.Entry<String, List<Long>> entry : containerTasksMap.entrySet()) {
|
||||
String containerId = entry.getKey();
|
||||
List<Long> taskIds = entry.getValue();
|
||||
|
||||
try {
|
||||
// 检查容器是否有其他任务
|
||||
checkOtherTasksInContainer(session, containerId, taskIds);
|
||||
|
||||
// 执行位置回传
|
||||
processPositionCallback(session, taskIds, dstLoc, worker, result, "X");
|
||||
|
||||
} catch (BusinessException e) {
|
||||
result.addFailure("容器" + containerId + "处理失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查容器其他任务
|
||||
*/
|
||||
private void checkOtherTasksInContainer(Session session, String containerId,
|
||||
List<Long> currentTaskIds) {
|
||||
String currentIds = currentTaskIds.stream()
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.joining(","));
|
||||
|
||||
String sql = "SELECT s.LP FROM Task t " +
|
||||
"LEFT JOIN LOCATION lc ON lc.id = t.DST_LOC_ID " +
|
||||
"LEFT JOIN ZONE z ON z.id = lc.ZONE_ID " +
|
||||
"LEFT JOIN STOCK s ON s.id = t.DST_LP " +
|
||||
"WHERE t.inventory_Status IN ('已出库','已合单','合单完成') " +
|
||||
"AND t.plan_Quantity > 0 AND z.id <> 1787 " +
|
||||
"AND s.id = " + containerId + " AND t.id NOT IN (" + currentIds + ")";
|
||||
|
||||
List<String> otherTasks = session.createSQLQuery(sql).list();
|
||||
if (!otherTasks.isEmpty()) {
|
||||
throw new BusinessException(otherTasks.get(0) + "容器有其它任务");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理无容器任务
|
||||
*/
|
||||
private void processNonContainerTasks(Session session, List<Long> taskIds,
|
||||
Location dstLoc, Worker worker, PresentationResult result) {
|
||||
for (Long taskId : taskIds) {
|
||||
try {
|
||||
List<Long> singleTaskList = Collections.singletonList(taskId);
|
||||
processPositionCallback(session, singleTaskList, dstLoc, worker, result, "X");
|
||||
} catch (Exception e) {
|
||||
result.addFailure("任务" + taskId + "处理失败: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理位置回传
|
||||
*/
|
||||
private void processPositionCallback(Session session, List<Long> taskIds,
|
||||
Location dstLoc, Worker worker,
|
||||
PresentationResult result, String completionFlag) {
|
||||
try {
|
||||
String fromAddress = getTaskSourceAddress(taskIds.get(0));
|
||||
|
||||
JSONObject callbackResult = wmsSapWeizhihuichuang(taskIds, fromAddress,
|
||||
dstLoc.getCode(), completionFlag);
|
||||
|
||||
String processResult = WmsSapposition(callbackResult, taskIds, dstLoc, worker);
|
||||
|
||||
if ("true".equals(callbackResult.get("ZCODE"))) {
|
||||
result.addSuccess(processResult);
|
||||
} else {
|
||||
result.addFailure(processResult);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
// 重试一次
|
||||
try {
|
||||
JSONObject callbackResult = wmsSapWeizhihuichuang(taskIds,
|
||||
getTaskSourceAddress(taskIds.get(0)),
|
||||
dstLoc.getCode(), completionFlag);
|
||||
String processResult = WmsSapposition(callbackResult, taskIds, dstLoc, worker);
|
||||
|
||||
if ("true".equals(callbackResult.get("ZCODE"))) {
|
||||
result.addSuccess(processResult);
|
||||
} else {
|
||||
result.addFailure(processResult);
|
||||
}
|
||||
} catch (Exception retryException) {
|
||||
result.addFailure("任务处理失败: " + retryException.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务源地址
|
||||
*/
|
||||
private String getTaskSourceAddress(Long taskId) {
|
||||
Task task = commonDao.load(Task.class, taskId);
|
||||
Location sourceLoc = commonDao.load(Location.class, task.getDstLoc().getId());
|
||||
return sourceLoc.getCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查是否在交单区
|
||||
*/
|
||||
private boolean isInPresentationZone(Location location) {
|
||||
return location.getZone() != null && location.getZone().getId() == 1787L;
|
||||
}
|
||||
|
||||
/**
|
||||
* 结果封装类
|
||||
*/
|
||||
private static class PresentationResult {
|
||||
private final StringBuilder successes = new StringBuilder();
|
||||
private final StringBuilder failures = new StringBuilder();
|
||||
|
||||
public void addSuccess(String message) {
|
||||
if (successes.length() > 0) successes.append("; ");
|
||||
successes.append(message);
|
||||
}
|
||||
|
||||
public void addFailure(String message) {
|
||||
if (failures.length() > 0) failures.append("; ");
|
||||
failures.append(message);
|
||||
}
|
||||
|
||||
public boolean hasSuccesses() {
|
||||
return successes.length() > 0;
|
||||
}
|
||||
|
||||
public boolean hasFailures() {
|
||||
return failures.length() > 0;
|
||||
}
|
||||
|
||||
public String getSuccessMessage() {
|
||||
return successes.toString();
|
||||
}
|
||||
|
||||
public String getFailureMessage() {
|
||||
return failures.toString();
|
||||
}
|
||||
}
|
||||
|
||||
public void wmsMesFaliaohuichuang(List<Long> taskids) {
|
||||
interfaceReqManager.wmsMesFaliao(taskids, "2");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -4257,23 +4257,23 @@ public class DefaultWaveDocManager extends DefaultBaseManager implements
|
|||
if(tasklist.size()<=300) {
|
||||
// 格式化时间
|
||||
SimpleDateFormat yms = new SimpleDateFormat("yyyy-MM-dd");
|
||||
Date date1=new Date();
|
||||
Date date2= new Date();
|
||||
try {
|
||||
date1 = yms.parse("2025-01-01");
|
||||
date2=yms.parse("2025-12-31");
|
||||
} catch (ParseException e) {
|
||||
// TODO 自动生成的 catch 块
|
||||
e.printStackTrace();
|
||||
}
|
||||
Date date1=aw.getStartDate();
|
||||
Date date2=aw.getEndDate();
|
||||
|
||||
Integer lxqQty=10;
|
||||
Integer longtiem=2;
|
||||
Integer hjqQty=2;
|
||||
Integer lkqQty=1;
|
||||
Integer taskqty=30;
|
||||
// try {
|
||||
// date1 = yms.parse("2025-01-01");
|
||||
// date2=yms.parse("2025-12-31");
|
||||
// } catch (ParseException e) {
|
||||
// // TODO 自动生成的 catch 块
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
Integer longtiem=aw.getHour3();//2;
|
||||
Integer lxqQty=aw.getMinute3();//10;料箱工作站
|
||||
Integer hjqQty=aw.getMinute4();//2;
|
||||
Integer lkqQty=aw.getMinute5();//1;
|
||||
Integer taskqty=aw.getHour4();//30;
|
||||
//创建波次
|
||||
hotWaveDoc( date1, date2 , lxqQty, longtiem, hjqQty, lkqQty,true,null
|
||||
hotWaveDoc( date1, date2 , longtiem, lxqQty, hjqQty, lkqQty,true,null
|
||||
,true,true,true,true,true,true,true,true,true, taskqty,false);
|
||||
String wahql="select id from WaveDoc w where w.status='OPEN' "
|
||||
+ " and w.userName='自动' order by id desc ";
|
||||
|
|
@ -4282,19 +4282,20 @@ public class DefaultWaveDocManager extends DefaultBaseManager implements
|
|||
List<Long> wids= commonDao.findByQuery(wahql);
|
||||
if(wids.size()>0) {
|
||||
long waveDocId=wids.get(0);
|
||||
boolean lx1=false;boolean lx2=true;
|
||||
boolean lx3=true;boolean lx4=true;
|
||||
boolean lx5=true;boolean lx6=true;
|
||||
boolean lx7=true;boolean lx8=true;
|
||||
boolean lx9=true;boolean lx10=true;
|
||||
boolean lx11=true;
|
||||
boolean lx12=true;boolean lx13=false;
|
||||
boolean lx14=false;boolean lx15=false;
|
||||
boolean hj1=false;boolean hj2=false;
|
||||
boolean hj3=true; boolean hj4=true;
|
||||
boolean hj5=false;boolean hj6=false;boolean hj7=false;
|
||||
boolean lk1=false;boolean lk2=true;boolean lk3=false;
|
||||
boolean lk4=false;boolean lk5=false;
|
||||
boolean lx1=aw.getLx1();boolean lx2=aw.getLx2();
|
||||
boolean lx3=aw.getLx3();boolean lx4=aw.getLk4();
|
||||
boolean lx5=aw.getLx5();boolean lx6=aw.getLx6();
|
||||
boolean lx7=aw.getLx7();boolean lx8=aw.getLx8();
|
||||
boolean lx9=aw.getLx9();boolean lx10=aw.getLx10();
|
||||
boolean lx11=aw.getLx11();
|
||||
boolean lx12=aw.getLx12();boolean lx13=aw.getLx13();
|
||||
boolean lx14=aw.getLx14();boolean lx15=aw.getLx15();
|
||||
boolean hj1=aw.getBeEnabled4();boolean hj2=aw.getBeEnabled5();
|
||||
boolean hj3=aw.getBeEnabled6(); boolean hj4=aw.getBeEnabled7();
|
||||
boolean hj5=aw.getBeEnabled8();boolean hj6=aw.getBeEnabled9();
|
||||
boolean hj7=aw.getBeEnabled10();
|
||||
boolean lk1=aw.getLk1();boolean lk2=aw.getLk2();boolean lk3=aw.getLk3();
|
||||
boolean lk4=aw.getLk4();boolean lk5=aw.getLk5();
|
||||
logger.info("------自动创建波次4---------------------");
|
||||
//是否下发CRS
|
||||
if(aw.getBeEnabled2()) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package com.dev.swms.server.utils;
|
||||
import org.hibernate.dialect.SQLServerDialect;
|
||||
import java.sql.Types;
|
||||
|
||||
public class CustomSQLServerDialect extends SQLServerDialect {
|
||||
public CustomSQLServerDialect() {
|
||||
super();
|
||||
// 注册 JDBC 类型 -16 (NVARCHAR(max), 长文本) 映射到 String 类型
|
||||
registerHibernateType(Types.LONGNVARCHAR, "string"); // JDBC类型-16
|
||||
registerHibernateType(Types.NVARCHAR, "string"); // JDBC类型-9
|
||||
registerHibernateType(Types.NCHAR, "string"); // JDBC类型-15
|
||||
// 如果还有其他类型问题,可以一并注册
|
||||
// registerHibernateType(Types.NCLOB, "clob");
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -202,6 +202,15 @@ public class DateUtil {
|
|||
|
||||
}
|
||||
|
||||
public static Date formatStrToDateYMD02(String str){
|
||||
try{
|
||||
return ymd_1.parse(str);
|
||||
} catch(Exception e){
|
||||
log.debug("DateUtil.formatDateYMDToStr():" + e.getMessage());
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 传入格式为日期的字符,
|
||||
* 格式为:yyyy-MM-dd HH:mm:ss 的日期字符串形式返回
|
||||
|
|
|
|||
|
|
@ -830,7 +830,7 @@ public class ASNReceiveServlet extends HttpServlet {
|
|||
String locCode =json.has("locCode")?json.getString("locCode"):"";
|
||||
resultJson=app.scancCpLoc(locCode, workerId, wId);
|
||||
}else if("cpGrounde".equals(methodType)){
|
||||
//上架
|
||||
//成品上架
|
||||
long rrId = json.has("rrId")?Long.parseLong(json.getString("rrId").equals("")?"0":json.getString("rrId")):0;
|
||||
long locationId = json.has("locationId")?Long.parseLong(json.getString("locationId").equals("")?"0":json.getString("locationId")):0;
|
||||
resultJson=cpGrounde(rrId, locationId, workerId);
|
||||
|
|
|
|||
|
|
@ -108,9 +108,12 @@ public class zwSapServlet extends HttpServlet {
|
|||
}else if ("ADJPROFIT".equals(method)) {//SAP-WMS:盘盈、盘亏数量调整信息接口
|
||||
resultJson=apps.storeADJPROFITsap(log,data);
|
||||
}else if ("ZPUTASN".equals(method)) {//SAP-WMS:成品收货入库任务接口
|
||||
resultJson=apps.storeASNZPUTASN(log,data);
|
||||
}else if ("ZPUTPTC".equals(method) ) {//SAP-WMS:成品发货出库任务接口
|
||||
resultJson=apps.storeZPUTPTCsap(log,data);
|
||||
// resultJson=apps.storeASNZPUTASN(log,data);
|
||||
resultJson=apps.storeMESZPUTASN(log,data);
|
||||
}else if ("ZPUTPTC".equals(method) ) {//SAP-WMS:成品退回出库任务接口
|
||||
resultJson=apps.storeZPUTPTCmes(log,data);
|
||||
}else if ("ZPUTUPDATE".equals(method) ) {//SAP-WMS:成品变更出库任务接口
|
||||
resultJson=apps.storeZPUTUPDATEmes(log,data);
|
||||
}else if ("GPUTPTC".equals(method)) {//SAP-WMS:工单任务下发 接口
|
||||
resultJson=apps.storeGPUTPTCsap(log,data);
|
||||
}else if ("PUTSKUKC".equals(method)) {//SAP-WMS:物料基础数据接口
|
||||
|
|
|
|||
|
|
@ -619,6 +619,282 @@ GO
|
|||
ALTER TABLE [dbo].[Automatic_Wave_Doc] SET (LOCK_ESCALATION = TABLE)
|
||||
|
||||
|
||||
----2025-10-15
|
||||
|
||||
ALTER TABLE ASN_DETAIL add length float NULL;
|
||||
GO
|
||||
ALTER TABLE ASN_DETAIL add width float NULL;
|
||||
GO
|
||||
ALTER TABLE ASN_DETAIL add height float NULL;
|
||||
GO
|
||||
UPDATE ASN_DETAIL SET length=0 WHERE length IS NULL;
|
||||
go
|
||||
UPDATE ASN_DETAIL SET width=0 WHERE width IS NULL;
|
||||
go
|
||||
UPDATE ASN_DETAIL SET height=0 WHERE height IS NULL;
|
||||
go
|
||||
|
||||
ALTER TABLE Automatic_Wave_Doc add START_DATE datetime NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add END_DATE datetime NULL;
|
||||
GO
|
||||
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lx1 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lx2 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lx3 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lx4 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lx5 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lx6 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lx7 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lx8 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lx9 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lx10 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lx11 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lx12 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lx13 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lx14 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lx15 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lk1 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lk2 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lk3 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lk4 tinyint NULL;
|
||||
GO
|
||||
ALTER TABLE Automatic_Wave_Doc add be_lk5 tinyint NULL;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lx1=0 where be_lx1 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lx2=0 where be_lx2 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lx3=0 where be_lx3 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lx4=0 where be_lx4 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lx5=0 where be_lx5 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lx6=0 where be_lx6 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lx7=0 where be_lx7 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lx8=0 where be_lx8 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lx9=0 where be_lx9 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lx10=0 where be_lx10 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lx11=0 where be_lx11 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lx12=0 where be_lx12 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lx13=0 where be_lx13 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lx14=0 where be_lx14 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lx15=0 where be_lx15 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lx1=0 where be_lx1 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lk1=0 where be_lk1 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lk2=0 where be_lk2 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lk3=0 where be_lk3 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lk4=0 where be_lk4 is null;
|
||||
GO
|
||||
update Automatic_Wave_Doc set be_lk5=0 where be_lk5 is null;
|
||||
GO
|
||||
|
||||
|
||||
---------------------原库存视图
|
||||
select
|
||||
max(inv.id) as id,
|
||||
max(loc.code) as locCode,
|
||||
item.id as item_id,
|
||||
max(item.code) as itemCode,
|
||||
max(item.name) as itemName,
|
||||
max(inv.BAR_CODE) as barCode,
|
||||
max(inv.STATUS) as status,
|
||||
max(inv.LOCATION_ID) as LOCATION_ID,
|
||||
max(inv.ITEM_KEY_ID) as ITEM_KEY_ID,
|
||||
sum(inv.QUANTITY) as quantity,
|
||||
sum(inv.QUEUED_QUANTITY) as queuedQuantity,
|
||||
max(ik.PROP_C1) as propC1,
|
||||
max(ik.PROP_C2) as propC2,
|
||||
max(ik.PROP_C3) as propC3,
|
||||
max(ik.PROP_C4) as propC4,
|
||||
max(ik.PROP_C5) as propC5,
|
||||
max(ik.PROP_C6) as propC6,
|
||||
max(ik.PROP_C7) as propC7,
|
||||
max(ik.PROP_C8) as propC8,
|
||||
max(ik.PROP_C9) as propC9,
|
||||
max(ik.PROP_LC1) as PROP_LC1,
|
||||
max(ik.PROP_LC2) as PROP_LC2,
|
||||
max(ik.PROP_LC3) as PROP_LC3,
|
||||
max(ik.PROP_LC4) as PROP_LC4,
|
||||
max(ik.PROP_LC5) as PROP_LC5,
|
||||
max(inv.SOI) as soi,
|
||||
max(ik.PROP_D1) as propD1,
|
||||
max(ik.PROP_D2) as propD2,
|
||||
max(ik.PROP_D3) as propD3,
|
||||
max(z.name) as kqName,
|
||||
max(z.ID) as ZONE_ID,
|
||||
|
||||
case
|
||||
when max(inv.coun_Plan) is null then 0
|
||||
else 1
|
||||
end as lock,
|
||||
case
|
||||
when max(z.id) in(1766,1763,1765)
|
||||
then max(ls1.name) else max(ls.name) end as LSname,
|
||||
max(item.Be_SAP_Item) Be_SAP_Item,
|
||||
max(item.VOLUME) VOLUME,
|
||||
max(item.BE_WEIGHT) BE_WEIGHT,
|
||||
max(item.SHIP_RULES) SHIP_RULES,
|
||||
max(item.FEE_TYPE) FEE_TYPE,
|
||||
max(item.SINGLE_ITEM) SINGLE_ITEM,
|
||||
max(item.BE_MARK_WEIGHT) BE_MARK_WEIGHT,
|
||||
max(item.UNIT) UNIT,
|
||||
max(item.STR_EXTEND1) STR_EXTEND1,
|
||||
max(item.STR_EXTEND2) STR_EXTEND2,
|
||||
max(item.STR_EXTEND3) STR_EXTEND3,
|
||||
max(item.STR_EXTEND4) STR_EXTEND4,
|
||||
ISNULL(stock1.agvFlag, 0) agvFlag,
|
||||
loc.id locId,
|
||||
max(lts.NAME) as lts_name,
|
||||
item.ISBOM validity,
|
||||
CONVERT(varchar(100), min(inv.STORAGE_DATE), 20) as storageDate,
|
||||
max(inv.moveStatus) moveStatus,
|
||||
inv.statuss,
|
||||
max(z1.NAME) as z1_name,
|
||||
max(inv.description) as invDes,
|
||||
MAX(stock1.WEIGHT) as WEIGHT
|
||||
|
||||
from INVENTORY inv
|
||||
left join ZONE kq on kq.id=inv.warehouse_Area_ID
|
||||
left join LOCATION loc on loc.id=inv.LOCATION_ID
|
||||
left join LOCATIONS lts on lts.id=loc.LOCATIONS_ID
|
||||
left join STOCK stock1 on stock1.id=loc.stock
|
||||
left join LOCATION_STORAGE ls1 on ls1.ID=stock1.locationStorage_ID
|
||||
left join ZONE z on z.ID =loc.ZONE_ID
|
||||
left join ITEM_KEY ik on ik.id=inv.ITEM_KEY_ID
|
||||
left join ITEM item on item.id=ik.ITEM_ID
|
||||
left join STOCK stock on stock.ID=inv.LP
|
||||
left join LOCATION_STORAGE ls on ls.ID=stock.locationStorage_ID
|
||||
left join ZONE z1 on z1.id=item.default_Warehouse_Area_ID
|
||||
where 1=1
|
||||
and inv.QUANTITY>0
|
||||
group by item.id,loc.id,ik.PROP_C1,ik.PROP_C2,ik.PROP_C3,
|
||||
ik.PROP_C5,ik.PROP_C9,ik.PROP_D2,inv.STATUS,
|
||||
item.isBOM,inv.statuss,stock1.agvFlag
|
||||
|
||||
|
||||
----------------新视图
|
||||
WITH InventoryAgg AS (
|
||||
SELECT
|
||||
ITEM_KEY_ID,
|
||||
LOCATION_ID,
|
||||
MAX(id) as max_id,
|
||||
MAX(BAR_CODE) as barCode,
|
||||
MAX(STATUS) as status,
|
||||
SUM(QUANTITY) as quantity,
|
||||
SUM(QUEUED_QUANTITY) as queuedQuantity,
|
||||
MAX(SOI) as soi,
|
||||
MAX(coun_Plan) as coun_Plan,
|
||||
MAX(moveStatus) as moveStatus,
|
||||
MAX(statuss) as inv_statuss,
|
||||
MAX(description) as description,
|
||||
MIN(STORAGE_DATE) as storageDate,
|
||||
MAX(warehouse_Area_ID) as warehouse_Area_ID,
|
||||
MAX(LP) as LP
|
||||
FROM INVENTORY
|
||||
WHERE QUANTITY > 0
|
||||
GROUP BY ITEM_KEY_ID, LOCATION_ID,status,statuss
|
||||
)
|
||||
SELECT
|
||||
inv.max_id as id,
|
||||
loc.code as locCode,
|
||||
item.id as item_id,
|
||||
item.code as itemCode,
|
||||
item.name as itemName,
|
||||
inv.barCode,
|
||||
inv.status,
|
||||
inv.LOCATION_ID,
|
||||
inv.ITEM_KEY_ID,
|
||||
inv.quantity,
|
||||
inv.queuedQuantity,
|
||||
ik.PROP_C1 as propC1,
|
||||
ik.PROP_C2 as propC2,
|
||||
ik.PROP_C3 as propC3,
|
||||
ik.PROP_C4 as propC4,
|
||||
ik.PROP_C5 as propC5,
|
||||
ik.PROP_C6 as propC6,
|
||||
ik.PROP_C7 as propC7,
|
||||
ik.PROP_C8 as propC8,
|
||||
ik.PROP_C9 as propC9,
|
||||
ik.PROP_LC1 as PROP_LC1,
|
||||
ik.PROP_LC2 as PROP_LC2,
|
||||
ik.PROP_LC3 as PROP_LC3,
|
||||
ik.PROP_LC4 as PROP_LC4,
|
||||
ik.PROP_LC5 as PROP_LC5,
|
||||
inv.soi,
|
||||
ik.PROP_D1 as propD1,
|
||||
ik.PROP_D2 as propD2,
|
||||
ik.PROP_D3 as propD3,
|
||||
z.name as kqName,
|
||||
z.ID as ZONE_ID,
|
||||
CASE WHEN inv.coun_Plan IS NULL THEN 0 ELSE 1 END as lock,
|
||||
CASE WHEN z.id IN (1766,1763,1765) THEN ls1.name ELSE ls.name END as LSname,
|
||||
item.Be_SAP_Item,
|
||||
item.VOLUME,
|
||||
item.BE_WEIGHT,
|
||||
item.SHIP_RULES,
|
||||
item.FEE_TYPE,
|
||||
item.SINGLE_ITEM,
|
||||
item.BE_MARK_WEIGHT,
|
||||
item.UNIT,
|
||||
item.STR_EXTEND1,
|
||||
item.STR_EXTEND2,
|
||||
item.STR_EXTEND3,
|
||||
item.STR_EXTEND4,
|
||||
ISNULL(stock1.agvFlag, 0) as agvFlag,
|
||||
loc.id as locId,
|
||||
lts.NAME as lts_name,
|
||||
item.ISBOM as validity,
|
||||
CONVERT(varchar(100), inv.storageDate, 20) as storageDate,
|
||||
inv.moveStatus,
|
||||
inv.inv_statuss as statuss,
|
||||
z1.NAME as z1_name,
|
||||
inv.description as invDes,
|
||||
stock1.WEIGHT as WEIGHT
|
||||
FROM InventoryAgg inv
|
||||
INNER JOIN ITEM_KEY ik ON ik.id = inv.ITEM_KEY_ID
|
||||
INNER JOIN ITEM item ON item.id = ik.ITEM_ID
|
||||
INNER JOIN LOCATION loc ON loc.id = inv.LOCATION_ID
|
||||
LEFT JOIN ZONE kq ON kq.id = inv.warehouse_Area_ID
|
||||
LEFT JOIN LOCATIONS lts ON lts.id = loc.LOCATIONS_ID
|
||||
LEFT JOIN STOCK stock1 ON stock1.id = loc.stock
|
||||
LEFT JOIN LOCATION_STORAGE ls1 ON ls1.ID = stock1.locationStorage_ID
|
||||
LEFT JOIN ZONE z ON z.ID = loc.ZONE_ID
|
||||
LEFT JOIN STOCK stock ON stock.ID = inv.LP
|
||||
LEFT JOIN LOCATION_STORAGE ls ON ls.ID = stock.locationStorage_ID
|
||||
LEFT JOIN ZONE z1 ON z1.id = item.default_Warehouse_Area_ID;
|
||||
|
||||
|
||||
|
||||
|
|
@ -2,93 +2,103 @@
|
|||
|
||||
<pages>
|
||||
<editPage id="editAutomaticWaveDocPage" title="波次执行时间"
|
||||
entityClass="com.dev.swms.server.model.shipping.AutomaticWaveDoc" width="500"
|
||||
entityClass="com.dev.swms.server.model.shipping.AutomaticWaveDoc" width="800"
|
||||
height="310">
|
||||
<inputUIs>
|
||||
<hidden id="aw.id" reserve="false" />
|
||||
<text id="aw.hour1" title="时间(时)" row="1" col="1" width="73"
|
||||
<text id="aw.hour1" title="时间(时)" row="1" col="1" width="73" span="2"
|
||||
readOnly="false" required="true" reserve="false" forceOverride="false"
|
||||
inVisible="false" length="100" trimSpace="true" isPrecision="true" />
|
||||
<text id="aw.minute1" title="时间(分)" row="1" col="2" width="73"
|
||||
<text id="aw.minute1" title="时间(分)" row="1" col="2" width="73" span="2"
|
||||
readOnly="false" required="true" reserve="false" forceOverride="false"
|
||||
inVisible="false" length="100" trimSpace="true" isPrecision="true" />
|
||||
<checkbox id="aw.beEnabled1" title="是否开启" row="1" col="3" defaultValue="false"
|
||||
span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" />
|
||||
<checkbox id="aw.beEnabled2" title="是否下发RCS" row="1" col="3" defaultValue="false"
|
||||
span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" />
|
||||
<!-- <text id="aw.hour2" title="时间(时)" row="2" col="1" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <text id="aw.minute2" title="时间(分)" row="2" col="2" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <checkbox id="aw.beEnabled2" title="是否开启" row="2" col="3" defaultValue="false" -->
|
||||
<!-- span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" /> -->
|
||||
<!-- <text id="aw.hour3" title="时间(时)" row="3" col="1" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <text id="aw.minute3" title="时间(分)" row="3" col="2" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <checkbox id="aw.beEnabled3" title="是否开启" row="3" col="3" defaultValue="false" -->
|
||||
<!-- span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" /> -->
|
||||
<!-- <text id="aw.hour4" title="时间(时)" row="4" col="1" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <text id="aw.minute4" title="时间(分)" row="4" col="2" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <checkbox id="aw.beEnabled4" title="是否开启" row="4" col="3" defaultValue="false" -->
|
||||
<!-- span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" /> -->
|
||||
<!-- <text id="aw.hour5" title="时间(时)" row="5" col="1" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <text id="aw.minute5" title="时间(分)" row="5" col="2" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <checkbox id="aw.beEnabled5" title="是否开启" row="5" col="3" defaultValue="false" -->
|
||||
<!-- span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" /> -->
|
||||
<!-- <text id="aw.hour6" title="时间(时)" row="6" col="1" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <text id="aw.minute6" title="时间(分)" row="6" col="2" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <checkbox id="aw.beEnabled6" title="是否开启" row="6" col="3" defaultValue="false" -->
|
||||
<!-- span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" /> -->
|
||||
<!-- <text id="aw.hour7" title="时间(时)" row="7" col="1" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <text id="aw.minute7" title="时间(分)" row="7" col="2" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <checkbox id="aw.beEnabled7" title="是否开启" row="7" col="3" defaultValue="false" -->
|
||||
<!-- span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" /> -->
|
||||
<!-- <text id="aw.hour8" title="时间(时)" row="8" col="1" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <text id="aw.minute8" title="时间(分)" row="8" col="2" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <checkbox id="aw.beEnabled8" title="是否开启" row="8" col="3" defaultValue="false" -->
|
||||
<!-- span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" /> -->
|
||||
<!-- <text id="aw.hour9" title="时间(时)" row="9" col="1" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <text id="aw.minute9" title="时间(分)" row="9" col="2" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <checkbox id="aw.beEnabled9" title="是否开启" row="9" col="3" defaultValue="false" -->
|
||||
<!-- span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" /> -->
|
||||
<!-- <text id="aw.hour10" title="时间(时)" row="10" col="1" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <text id="aw.minute10" title="时间(分)" row="10" col="2" width="173" -->
|
||||
<!-- readOnly="false" required="true" reserve="false" forceOverride="false" -->
|
||||
<!-- inVisible="false" length="100" trimSpace="true" isPrecision="true" /> -->
|
||||
<!-- <checkbox id="aw.beEnabled10" title="是否开启" row="10" col="3" defaultValue="false" -->
|
||||
<!-- span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" /> -->
|
||||
|
||||
span="2" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" />
|
||||
<checkbox id="aw.beEnabled2" title="是否下发RCS" row="1" col="4" defaultValue="false"
|
||||
span="2" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" />
|
||||
<date id="aw.startDate" title="开始日期" row="2" col="1" span="2" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" showTime="false" manualEditable="true" defaultCurrentDate="false"/>
|
||||
<date id="aw.endDate" title="结束日期" row="2" col="2" span="2" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" showTime="false" manualEditable="true" defaultCurrentDate="false"/>
|
||||
<numberText id="aw.hour3" title="时长(小时)" row="2" col="3" width="120" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" returnType="Integer" defaultValue="0"/>
|
||||
<numberText id="aw.minute3" title="料箱工作站个数" row="3" col="1" width="100" span="2" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" returnType="Integer" defaultValue="0"/>
|
||||
<numberText id="aw.minute4" title="货架工作站个数" row="3" col="2" width="100" span="2" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" returnType="Integer" defaultValue="0"/>
|
||||
<numberText id="aw.minute5" title="堆垛工作站个数" row="3" col="3" width="100" span="2" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" returnType="Integer" defaultValue="0"/>
|
||||
<numberText id="aw.hour4" title="最大拆分行数" row="4" col="1" width="100" span="2" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" returnType="Integer" defaultValue="15"/>
|
||||
<checkbox id="aw.beEnabled3" title="地堆区是否发当天料" row="4" col="2" defaultValue="false"
|
||||
span="2" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false" />
|
||||
|
||||
<checkbox id="lxq" title="料箱区工作站" row="5" col="1" defaultValue="false" span="2" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false">
|
||||
<eventListeners>
|
||||
<eventListener id="aw.lx1" refreshUI="false" />
|
||||
<eventListener id="aw.lx2" refreshUI="false" />
|
||||
<eventListener id="aw.lx3" refreshUI="false" />
|
||||
<eventListener id="aw.lx4" refreshUI="false" />
|
||||
<eventListener id="aw.lx5" refreshUI="false" />
|
||||
<eventListener id="aw.lx6" refreshUI="false" />
|
||||
<eventListener id="aw.lx7" refreshUI="false" />
|
||||
<eventListener id="aw.lx8" refreshUI="false" />
|
||||
<eventListener id="aw.lx9" refreshUI="false" />
|
||||
<eventListener id="aw.lx10" refreshUI="false" />
|
||||
<eventListener id="aw.lx11" refreshUI="false" />
|
||||
<eventListener id="aw.lx12" refreshUI="false" />
|
||||
<eventListener id="aw.lx13" refreshUI="false" />
|
||||
<eventListener id="aw.lx14" refreshUI="false" />
|
||||
<eventListener id="aw.lx15" refreshUI="false" />
|
||||
</eventListeners>
|
||||
</checkbox>
|
||||
|
||||
<checkbox id="aw.lx1" title="201" row="6" col="1" width="120" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.lx2" title="202" row="6" col="2" width="120" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.lx3" title="203" row="6" col="3" width="120" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.lx4" title="204" row="6" col="4" width="120" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.lx5" title="205" row="6" col="5" width="120" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.lx6" title="206" row="7" col="1" width="120" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.lx7" title="207" row="7" col="2" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.lx8" title="208" row="7" col="3" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.lx9" title="209" row="7" col="4" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.lx10" title="210" row="7" col="5" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.lx11" title="211" row="8" col="1" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.lx12" title="212" row="8" col="2" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.lx13" title="213" row="8" col="3" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.lx14" title="214" row="8" col="4" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.lx15" title="215" row="8" col="5" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
|
||||
<separator id="s1" row="9" width="400"/>
|
||||
|
||||
<checkbox id="hjq" title="货架区工作站" row="10" col="1" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false">
|
||||
<eventListeners>
|
||||
<eventListener id="aw.beEnabled4" refreshUI="false" />
|
||||
<eventListener id="aw.beEnabled5" refreshUI="false" />
|
||||
<eventListener id="aw.beEnabled6" refreshUI="false" />
|
||||
<eventListener id="aw.beEnabled7" refreshUI="false" />
|
||||
<eventListener id="aw.beEnabled8" refreshUI="false" />
|
||||
<eventListener id="aw.beEnabled9" refreshUI="false" />
|
||||
<eventListener id="aw.beEnabled10" refreshUI="false" />
|
||||
</eventListeners>
|
||||
</checkbox>
|
||||
<checkbox id="aw.beEnabled4" title="101" row="11" col="1" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.beEnabled5" title="102" row="11" col="2" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.beEnabled6" title="103" row="11" col="3" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.beEnabled7" title="104" row="11" col="4" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.beEnabled8" title="105" row="11" col="5" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.beEnabled9" title="106" row="12" col="1" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.beEnabled10" title="107" row="12" col="2" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<separator id="s2" row="13" width="400"/>
|
||||
<checkbox id="lkq" title="立库区工作站" row="14" col="1" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false">
|
||||
<eventListeners>
|
||||
<!-- <eventListener id="lk1" refreshUI="false" /> -->
|
||||
<eventListener id="aw.lk2" refreshUI="false" />
|
||||
<!-- <eventListener id="lk3" refreshUI="false" /> -->
|
||||
<eventListener id="aw.lk4" refreshUI="false" />
|
||||
<!-- <eventListener id="lk5" refreshUI="false" /> -->
|
||||
</eventListeners>
|
||||
</checkbox>
|
||||
<checkbox id="aw.lk1" title="601" row="15" col="1" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="true"/>
|
||||
<checkbox id="aw.lk2" title="602/603" row="15" col="2" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.lk3" title="603" row="15" col="3" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="true"/>
|
||||
<checkbox id="aw.lk4" title="604/605" row="15" col="4" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="aw.lk5" title="605" row="15" col="5" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="true"/>
|
||||
|
||||
|
||||
</inputUIs>
|
||||
<buttons>
|
||||
<commit id="save" title="save" enableType="none" invisible="false">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<pages>
|
||||
<editPage id="editTaskMESPage" title="MES回传"
|
||||
entityClass="com.dev.swms.server.model.inventory.Task" width="200"
|
||||
height="220">
|
||||
<inputUIs>
|
||||
<hidden id="task.id" reserve="false" />
|
||||
|
||||
<text id="aaa" title="类型" row="1" col="2"/>
|
||||
|
||||
</inputUIs>
|
||||
<buttons>
|
||||
<commit id="pick2123" title="MES回传"
|
||||
enableType="none" invisible="false">
|
||||
<mappings>
|
||||
<mapping id="parentIds" className="list" />
|
||||
<mapping id="aaa" className="string" />
|
||||
</mappings>
|
||||
<actions>
|
||||
<action managerName="interfaceReqManager" methodName="wmsMesFaliao"
|
||||
parameter="parentIds,aaa" />
|
||||
</actions>
|
||||
<forwards>
|
||||
<forward name="refreshParent" newEnabled="true"
|
||||
editEnabled="true" />
|
||||
<forward name="closeWindow" newEnabled="true" editEnabled="true" />
|
||||
</forwards>
|
||||
</commit>
|
||||
</buttons>
|
||||
</editPage>
|
||||
</pages>
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<pages>
|
||||
<editPage id="editTaskMesMvInventoryPage" title="MES回传"
|
||||
entityClass="com.dev.swms.server.model.inventory.Task" width="200"
|
||||
height="220">
|
||||
<inputUIs>
|
||||
<hidden id="task.id" reserve="false" />
|
||||
|
||||
<text id="aaa" title="类型" row="1" col="2"/>
|
||||
|
||||
</inputUIs>
|
||||
<buttons>
|
||||
<commit id="pickinv2123212" title="MES回传"
|
||||
enableType="none" invisible="false">
|
||||
<mappings>
|
||||
<mapping id="parentIds" className="list" />
|
||||
<mapping id="aaa" className="string" />
|
||||
</mappings>
|
||||
<actions>
|
||||
<action managerName="interfaceReqManager" methodName="wmsMesInventory"
|
||||
parameter="parentIds,aaa" />
|
||||
</actions>
|
||||
<forwards>
|
||||
<forward name="refreshParent" newEnabled="true"
|
||||
editEnabled="true" />
|
||||
<forward name="closeWindow" newEnabled="true" editEnabled="true" />
|
||||
</forwards>
|
||||
</commit>
|
||||
</buttons>
|
||||
</editPage>
|
||||
</pages>
|
||||
|
|
@ -15,8 +15,42 @@
|
|||
aw.hour1,
|
||||
aw.minute1,
|
||||
aw.beEnabled1,
|
||||
aw.beEnabled2
|
||||
|
||||
aw.beEnabled2,
|
||||
aw.startDate,
|
||||
aw.endDate,
|
||||
aw.hour3,
|
||||
aw.minute3,
|
||||
aw.hour4,
|
||||
aw.minute4,
|
||||
aw.minute5,
|
||||
aw.beEnabled3,
|
||||
aw.lx1,
|
||||
aw.lx2,
|
||||
aw.lx3,
|
||||
aw.lx4,
|
||||
aw.lx5,
|
||||
aw.lx6,
|
||||
aw.lx7,
|
||||
aw.lx8,
|
||||
aw.lx9,
|
||||
aw.lx10,
|
||||
aw.lx11,
|
||||
aw.lx12,
|
||||
aw.lx13,
|
||||
aw.lx14,
|
||||
aw.lx15,
|
||||
aw.beEnabled4,
|
||||
aw.beEnabled5,
|
||||
aw.beEnabled6,
|
||||
aw.beEnabled7,
|
||||
aw.beEnabled8,
|
||||
aw.beEnabled9,
|
||||
aw.beEnabled10,
|
||||
aw.lk1,
|
||||
aw.lk2,
|
||||
aw.lk3,
|
||||
aw.lk4,
|
||||
aw.lk5
|
||||
FROM AutomaticWaveDoc aw
|
||||
where 1=1
|
||||
/~shixiao.warehouseArea.id: and warehouseArea.id = {shixiao.warehouseArea.id} ~/
|
||||
|
|
@ -38,69 +72,77 @@
|
|||
<column id="aw.beEnabled2" title="是否下发RCS" visible="true"
|
||||
width="80" horizonAlign="center" verticalAlign="middle"
|
||||
format="booleanFormat" formatParam="disabled" />
|
||||
<!-- <column id="aw.hour2" title="2阶段时间(时)" visible="true" width="70" -->
|
||||
<!-- horizonAlign="center" /> -->
|
||||
<!-- <column id="aw.minute2" title="2阶段时间(分)" visible="true" width="80" -->
|
||||
<!-- horizonAlign="center" verticalAlign="middle" /> -->
|
||||
<!-- <column id="aw.beEnabled2" title="2阶是否开启" visible="true" -->
|
||||
<!-- width="80" horizonAlign="center" verticalAlign="middle" -->
|
||||
<!-- format="booleanFormat" formatParam="disabled" /> -->
|
||||
<!-- <column id="aw.hour3" title="3阶段时间(时)" visible="true" width="70" -->
|
||||
<!-- horizonAlign="center" /> -->
|
||||
<!-- <column id="aw.minute3" title="3阶段时间(分)" visible="true" width="80" -->
|
||||
<!-- horizonAlign="center" verticalAlign="middle" /> -->
|
||||
<!-- <column id="aw.beEnabled3" title="3阶是否开启" visible="true" -->
|
||||
<!-- width="80" horizonAlign="center" verticalAlign="middle" -->
|
||||
<!-- format="booleanFormat" formatParam="disabled" /> -->
|
||||
<!-- <column id="aw.hour4" title="4阶段时间(时)" visible="true" width="70" -->
|
||||
<!-- horizonAlign="center" /> -->
|
||||
<!-- <column id="aw.minute4" title="4阶段时间(分)" visible="true" width="80" -->
|
||||
<!-- horizonAlign="center" verticalAlign="middle" /> -->
|
||||
<!-- <column id="aw.beEnabled4" title="4阶是否开启" visible="true" -->
|
||||
<!-- width="80" horizonAlign="center" verticalAlign="middle" -->
|
||||
<!-- format="booleanFormat" formatParam="disabled" /> -->
|
||||
<!-- <column id="aw.hour5" title="5阶段时间(时)" visible="true" width="70" -->
|
||||
<!-- horizonAlign="center" /> -->
|
||||
<!-- <column id="aw.minute5" title="5阶段时间(分)" visible="true" width="80" -->
|
||||
<!-- horizonAlign="center" verticalAlign="middle" /> -->
|
||||
<!-- <column id="aw.beEnabled5" title="5阶是否开启" visible="true" -->
|
||||
<!-- width="80" horizonAlign="center" verticalAlign="middle" -->
|
||||
<!-- format="booleanFormat" formatParam="disabled" /> -->
|
||||
<!-- <column id="aw.hour6" title="6阶段时间(时)" visible="true" width="70" -->
|
||||
<!-- horizonAlign="center" /> -->
|
||||
<!-- <column id="aw.minute6" title="6阶段时间(分)" visible="true" width="80" -->
|
||||
<!-- horizonAlign="center" verticalAlign="middle" /> -->
|
||||
<!-- <column id="aw.beEnabled6" title="6阶是否开启" visible="true" -->
|
||||
<!-- width="80" horizonAlign="center" verticalAlign="middle" -->
|
||||
<!-- format="booleanFormat" formatParam="disabled" /> -->
|
||||
<!-- <column id="aw.hour7" title="7阶段时间(时)" visible="true" width="70" -->
|
||||
<!-- horizonAlign="center" /> -->
|
||||
<!-- <column id="aw.minute7" title="7阶段时间(分)" visible="true" width="80" -->
|
||||
<!-- horizonAlign="center" verticalAlign="middle" /> -->
|
||||
<!-- <column id="aw.beEnabled7" title="7阶是否开启" visible="true" -->
|
||||
<!-- width="80" horizonAlign="center" verticalAlign="middle" -->
|
||||
<!-- format="booleanFormat" formatParam="disabled" /> -->
|
||||
<!-- <column id="aw.hour8" title="8阶段时间(时)" visible="true" width="70" -->
|
||||
<!-- horizonAlign="center" /> -->
|
||||
<!-- <column id="aw.minute8" title="8阶段时间(分)" visible="true" width="80" -->
|
||||
<!-- horizonAlign="center" verticalAlign="middle" /> -->
|
||||
<!-- <column id="aw.beEnabled8" title="8阶是否开启" visible="true" -->
|
||||
<!-- width="80" horizonAlign="center" verticalAlign="middle" -->
|
||||
<!-- format="booleanFormat" formatParam="disabled" /> -->
|
||||
<!-- <column id="aw.hour9" title="98阶段时间(时)" visible="true" width="70" -->
|
||||
<!-- horizonAlign="center" /> -->
|
||||
<!-- <column id="aw.minute9" title="9阶段时间(分)" visible="true" width="80" -->
|
||||
<!-- horizonAlign="center" verticalAlign="middle" /> -->
|
||||
<!-- <column id="aw.beEnabled9" title="9阶是否开启" visible="true" -->
|
||||
<!-- width="80" horizonAlign="center" verticalAlign="middle" -->
|
||||
<!-- format="booleanFormat" formatParam="disabled" /> -->
|
||||
<!-- <column id="aw.hour10" title="10阶段时间(时)" visible="true" width="70" -->
|
||||
<!-- horizonAlign="center" /> -->
|
||||
<!-- <column id="aw.minute10" title="10阶段时间(分)" visible="true" width="80" -->
|
||||
<!-- horizonAlign="center" verticalAlign="middle" /> -->
|
||||
<!-- <column id="aw.beEnabled10" title="10阶是否开启" visible="true" -->
|
||||
<!-- width="80" horizonAlign="center" verticalAlign="middle" -->
|
||||
<!-- format="booleanFormat" formatParam="disabled" /> -->
|
||||
<column id="aw.startDate" title="开始日期" visible="true" width="70"
|
||||
horizonAlign="center" format="dateFormatter"/>
|
||||
<column id="aw.endDate" title="结束日期" visible="true" width="70"
|
||||
horizonAlign="center" format="dateFormatter"/>
|
||||
<column id="aw.hour3" title="波次时长" visible="true" width="70"
|
||||
horizonAlign="center" />
|
||||
<column id="aw.minute3" title="料箱工作站个数" visible="true" width="70"
|
||||
horizonAlign="center" />
|
||||
<column id="aw.hour4" title="最大拆分行数" visible="true" width="70"
|
||||
horizonAlign="center" />
|
||||
<column id="aw.minute4" title="架工作站个数" visible="true" width="70"
|
||||
horizonAlign="center" />
|
||||
<column id="aw.minute5" title="堆垛工作站个数" visible="true" width="70"
|
||||
horizonAlign="center" />
|
||||
<column id="aw.beEnabled3" title="地堆区是否发当天料" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lx1" title="201工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lx2" title="202工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lx3" title="203工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lx4" title="204工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lx5" title="205工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lx6" title="206工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lx7" title="207工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lx8" title="208工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lx9" title="209工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lx10" title="210工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lx11" title="211工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lx12" title="212工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lx13" title="213工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lx14" title="214工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lx15" title="215工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.beEnabled4" title="101工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.beEnabled5" title="102工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.beEnabled6" title="103工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.beEnabled7" title="104工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.beEnabled8" title="105工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.beEnabled9" title="106工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.beEnabled10" title="107工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lk1" title="601工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lk2" title="602工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lk3" title="603工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lk4" title="604工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
<column id="aw.lk5" title="605工作站" visible="true" width="70"
|
||||
horizonAlign="center" format="booleanFormat" formatParam="disabled" />
|
||||
|
||||
</columns>
|
||||
|
||||
<buttons>
|
||||
|
|
|
|||
|
|
@ -109,6 +109,22 @@ where 1=1and zone.warehouse = #{SESSION_WAREHOUSE}]]></hql>
|
|||
editEnabled="true" />
|
||||
</forwards>
|
||||
</commit>
|
||||
<commit id="acteaasda" title="获取token"
|
||||
enableType="multi" invisible="false">
|
||||
<mappings>
|
||||
<mapping id="ids" className="list" />
|
||||
</mappings>
|
||||
<actions>
|
||||
<action managerName="locationManager" methodName="huoquMesToken"
|
||||
parameter="ids" />
|
||||
</actions>
|
||||
<forwards>
|
||||
<forward name="refreshWindow" newEnabled="true"
|
||||
editEnabled="true" />
|
||||
</forwards>
|
||||
</commit>
|
||||
|
||||
|
||||
</buttons>
|
||||
</maintainPage>
|
||||
</pages>
|
||||
|
|
|
|||
|
|
@ -161,8 +161,8 @@
|
|||
/~LOC: AND inventoryLog.itemKey.lotInfo.propC2 LIKE {LOC}~/
|
||||
/~operator: AND inventoryLog.operator LIKE {operator}~/
|
||||
/~wname: AND inventoryLog.operator = {wname}~/
|
||||
/~beginDate: AND inventoryLog.occurTime >= {beginDate} ~/
|
||||
/~endDate: AND inventoryLog.occurTime <= {endDate} ~/
|
||||
/~beginDate: AND CONVERT(varchar(100), inventoryLog.occurTime, 23) >= {beginDate} ~/
|
||||
/~endDate: AND CONVERT(varchar(100), inventoryLog.occurTime, 23) <= {endDate} ~/
|
||||
ORDER BY inventoryLog.id DESC]]></datasource>
|
||||
<columns>
|
||||
<column id="inventoryLog.id" width="60" title="inventoryLog.id"
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@
|
|||
inventory.location.id
|
||||
FROM InventoryView inventory
|
||||
WHERE 1=1
|
||||
and inventory.quantity>0 and inventory.beSAPItem=true
|
||||
and inventory.quantity>0
|
||||
and inventory.lts_name in('存货','不良品','数据虚拟库')
|
||||
and inventory.status not in('待上架','已出库','已合单','合单完成')
|
||||
/~location.code: AND inventory.locCode like {location.code}~/
|
||||
|
|
@ -164,7 +164,7 @@
|
|||
/~beginDate: and CONVERT(varchar(100), inventory.storageDate, 23) >= {beginDate} ~/
|
||||
/~endDate: or CONVERT(varchar(100), inventory.storageDate, 23)>= {beginDate} and CONVERT(varchar(100), inventory.storageDate, 23)<= {endDate} ~/
|
||||
)
|
||||
order by inventory.locCode,inventory.id,inventory.propC1
|
||||
order by inventory.locCode,inventory.id
|
||||
]]></datasource>
|
||||
<columns>
|
||||
<column id="inventory.id" title="ID" visible="true" width="60"/>
|
||||
|
|
@ -276,6 +276,8 @@
|
|||
editEnabled="true" />
|
||||
</forwards>
|
||||
</commit>
|
||||
<popup id="hui2chuanm213231es" title="重新回传mes" enableType="multi" invisible="false" containId="true" pageId="editTaskMesMvInventoryPage"/>
|
||||
|
||||
</buttons>
|
||||
</maintainPage>
|
||||
</pages>
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@
|
|||
<column id="pickTicketDetail.strBill11" title="外协供应商" visible="true" horizonAlign="center" />
|
||||
<column id="pickTicketDetail.strBill12" title="机台号" visible="true" horizonAlign="center" />
|
||||
<column id="pickTicketDetail.strBill13" title="receiver" visible="true" horizonAlign="center" />
|
||||
<column id="pickTicketDetail.strExtend1" title="备注打印" visible="true" horizonAlign="center"/>
|
||||
<column id="pickTicketDetail.strExtend1" title="Doc.Header Text" visible="true" width="160" horizonAlign="center"/>
|
||||
<column id="pickTicketDetail.strExtend2" title="去K" visible="true" horizonAlign="center"/> <!-- format="booleanFormat" -->
|
||||
<column id="pickTicketDetail.longExtend2" title="预留号项次号" visible="true" horizonAlign="center" />
|
||||
<column id="pickTicketDetail.description" title="备注" visible="true" horizonAlign="center" />
|
||||
|
|
@ -104,9 +104,15 @@
|
|||
<column id="pickTicketDetail.strBill15" title="强制" visible="true" horizonAlign="center" />
|
||||
<column id="pickTicketDetail.strBill16" title="交接位置" visible="true" horizonAlign="center" />
|
||||
<column id="pickTicketDetail.strBill17" title="SAP备注" visible="true" horizonAlign="center" />
|
||||
<column id="pickTicketDetail.strBill18" title="申请人" visible="true" horizonAlign="center" />
|
||||
<column id="pickTicketDetail.strBill18" title="申请人邮箱" visible="true" width="130" horizonAlign="center" />
|
||||
<column id="pickTicketDetail.strBill19" title="申请号" visible="true" horizonAlign="center" />
|
||||
</columns>
|
||||
<buttons>
|
||||
<popup id="modifyDetail" title="modifyDetail" enableType="single"
|
||||
invisible="false" containId="true" pageId="editPickTicketDetailUpdatePage">
|
||||
<!-- <enableExpression><![CDATA[${pickTicket.status} == 'OPEN'||${pickTicket.status} == 'PREALLOCATE'||${pickTicket.status} == 'ACTIVE']]></enableExpression> -->
|
||||
</popup>
|
||||
</buttons>
|
||||
</detail>
|
||||
</modifyDetailPage>
|
||||
</pages>
|
||||
|
|
|
|||
|
|
@ -276,6 +276,22 @@
|
|||
editEnabled="true" />
|
||||
</forwards>
|
||||
</commit>
|
||||
<commit id="MESruk" title="wms2mes-反馈接口" enableType="multi" invisible="false" confirmMessage="确认是否回传?">
|
||||
<!-- <enableExpression><![CDATA[(${rd.qualityQty}==0)]]></enableExpression> -->
|
||||
<mappings>
|
||||
<mapping id="ids" className="list" />
|
||||
</mappings>
|
||||
<actions>
|
||||
<action managerName="interfaceReqManager" methodName="returnoutAsnMes"
|
||||
parameter="ids" />
|
||||
</actions>
|
||||
<forwards>
|
||||
<forward name="refreshWindow" newEnabled="true"
|
||||
editEnabled="true" />
|
||||
</forwards>
|
||||
</commit>
|
||||
|
||||
|
||||
</buttons>
|
||||
</maintainPage>
|
||||
</pages>
|
||||
|
|
|
|||
|
|
@ -10,18 +10,18 @@
|
|||
<eventListener id="102" refreshUI="false" />
|
||||
<eventListener id="103" refreshUI="false" />
|
||||
<eventListener id="104" refreshUI="false" />
|
||||
<eventListener id="105" refreshUI="false" />
|
||||
<eventListener id="106" refreshUI="false" />
|
||||
<eventListener id="107" refreshUI="false" />
|
||||
<!-- <eventListener id="105" refreshUI="false" /> -->
|
||||
<!-- <eventListener id="106" refreshUI="false" /> -->
|
||||
<!-- <eventListener id="107" refreshUI="false" /> -->
|
||||
</eventListeners>
|
||||
</checkbox>
|
||||
<checkbox id="101" title="101" row="6" col="1" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="102" title="102" row="6" col="2" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="103" title="103" row="6" col="3" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="104" title="104" row="6" col="4" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="105" title="105" row="6" col="5" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="106" title="106" row="7" col="1" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="107" title="107" row="7" col="2" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="105" title="105" row="6" col="5" defaultValue="false" span="1" readOnly="true" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="106" title="106" row="7" col="1" defaultValue="false" span="1" readOnly="true" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="107" title="107" row="7" col="2" defaultValue="false" span="1" readOnly="true" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
|
||||
<separator id="s2" row="8"/>
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
readOnly="false" required="false" reserve="false" forceOverride="false"
|
||||
inVisible="false" trimSpace="true" isPrecision="true" />
|
||||
<text id="pickTicketDetail.newLotInfo.propC2" title="LOC" row="4" col="1"
|
||||
readOnly="false" required="true" reserve="false" forceOverride="false"
|
||||
readOnly="false" required="false" reserve="false" forceOverride="false"
|
||||
inVisible="false" trimSpace="true" isPrecision="true" />
|
||||
<text id="pickTicketDetail.newLotInfo.propC9" title="工厂" row="5" col="1"
|
||||
readOnly="false" required="true" reserve="false" forceOverride="false"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,38 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<pages>
|
||||
<editPage id="editPickTicketDetailUpdatePage" title="editPickTicketDetailUpdatePage"
|
||||
entityClass="com.dev.swms.server.model.shipping.PickTicketDetail"
|
||||
width="300" height="200">
|
||||
<inputUIs>
|
||||
<hidden id="pickTicketDetail.id" reserve="false" />
|
||||
<text id="pickTicketDetail.strBill8" title="是否出WMS仓" row="10" col="1"
|
||||
readOnly="false" required="false" reserve="false" forceOverride="false"
|
||||
inVisible="false" trimSpace="true" isPrecision="true" />
|
||||
<text id="pickTicketDetail.strBill14" title="指定序列号" row="12" col="1"
|
||||
readOnly="false" required="false" reserve="false" forceOverride="false"
|
||||
inVisible="false" trimSpace="true" isPrecision="true" />
|
||||
<text id="pickTicketDetail.strBill15" title="强制" row="13" col="1"
|
||||
readOnly="false" required="false" reserve="false" forceOverride="false"
|
||||
inVisible="false" trimSpace="true" isPrecision="true" />
|
||||
</inputUIs>
|
||||
<buttons>
|
||||
<commit id="save" title="save" enableType="none" invisible="false">
|
||||
<mappings>
|
||||
<mapping id="pickTicket.id" className="long" />
|
||||
<mapping id="pickTicketDetail"
|
||||
className="com.dev.swms.server.model.shipping.PickTicketDetail" />
|
||||
</mappings>
|
||||
<actions>
|
||||
<action managerName="pickTicketManager" methodName="addPickTicketDetail"
|
||||
parameter="pickTicket.id,pickTicketDetail" />
|
||||
</actions>
|
||||
<forwards>
|
||||
<forward name="refreshParent" newEnabled="true"
|
||||
editEnabled="true" />
|
||||
<forward name="resetWindow" newEnabled="true" editEnabled="false" />
|
||||
</forwards>
|
||||
</commit>
|
||||
</buttons>
|
||||
</editPage>
|
||||
</pages>
|
||||
|
|
@ -47,18 +47,18 @@
|
|||
<eventListener id="hj2" refreshUI="false" />
|
||||
<eventListener id="hj3" refreshUI="false" />
|
||||
<eventListener id="hj4" refreshUI="false" />
|
||||
<eventListener id="hj5" refreshUI="false" />
|
||||
<eventListener id="hj6" refreshUI="false" />
|
||||
<eventListener id="hj7" refreshUI="false" />
|
||||
<!-- <eventListener id="hj5" refreshUI="false" /> -->
|
||||
<!-- <eventListener id="hj6" refreshUI="false" /> -->
|
||||
<!-- <eventListener id="hj7" refreshUI="false" /> -->
|
||||
</eventListeners>
|
||||
</checkbox>
|
||||
<checkbox id="hj1" title="101" row="11" col="1" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj2" title="102" row="11" col="2" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj3" title="103" row="11" col="3" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj4" title="104" row="11" col="4" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj5" title="105" row="11" col="5" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj6" title="106" row="12" col="1" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj7" title="107" row="12" col="2" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj5" title="105" row="11" col="5" width="60" defaultValue="false" span="1" readOnly="true" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj6" title="106" row="12" col="1" width="60" defaultValue="false" span="1" readOnly="true" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj7" title="107" row="12" col="2" width="60" defaultValue="false" span="1" readOnly="true" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<separator id="s2" row="13" width="400"/>
|
||||
<checkbox id="lkq" title="立库区工作站" row="14" col="1" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false">
|
||||
<eventListeners>
|
||||
|
|
|
|||
|
|
@ -47,18 +47,18 @@
|
|||
<eventListener id="hj2" refreshUI="false" />
|
||||
<eventListener id="hj3" refreshUI="false" />
|
||||
<eventListener id="hj4" refreshUI="false" />
|
||||
<eventListener id="hj5" refreshUI="false" />
|
||||
<eventListener id="hj6" refreshUI="false" />
|
||||
<eventListener id="hj7" refreshUI="false" />
|
||||
<!-- <eventListener id="hj5" refreshUI="false" /> -->
|
||||
<!-- <eventListener id="hj6" refreshUI="false" /> -->
|
||||
<!-- <eventListener id="hj7" refreshUI="false" /> -->
|
||||
</eventListeners>
|
||||
</checkbox>
|
||||
<checkbox id="hj1" title="101" row="11" col="1" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj2" title="102" row="11" col="2" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj3" title="103" row="11" col="3" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj4" title="104" row="11" col="4" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj5" title="105" row="11" col="5" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj6" title="106" row="12" col="1" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj7" title="107" row="12" col="2" width="60" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj5" title="105" row="11" col="5" width="60" defaultValue="false" span="1" readOnly="true" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj6" title="106" row="12" col="1" width="60" defaultValue="false" span="1" readOnly="true" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<checkbox id="hj7" title="107" row="12" col="2" width="60" defaultValue="false" span="1" readOnly="true" required="false" reserve="false" forceOverride="true" inVisible="false"/>
|
||||
<separator id="s2" row="13" width="400"/>
|
||||
<checkbox id="lkq" title="立库区工作站" row="14" col="1" defaultValue="false" span="1" readOnly="false" required="false" reserve="false" forceOverride="true" inVisible="false">
|
||||
<eventListeners>
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@
|
|||
pickTicket.driverName
|
||||
from PickTicket pickTicket
|
||||
where 1=1
|
||||
and pickTicket.billType.code='ZPUTPTC'
|
||||
and pickTicket.billType.code in('ZPUTPTC','ZPUTMV','ZPUTRETURN')
|
||||
and ( pickTicket.status not in('CLOSE') or ( /~ordersAll: {ordersAll} = true~/ ))
|
||||
/~pickTicket.code: AND (pickTicket.code) like ({pickTicket.code}) ~/
|
||||
/~pickTicket.relatedBill1: AND (pickTicket.relatedBill1) like ({pickTicket.relatedBill1}) ~/
|
||||
|
|
@ -179,7 +179,19 @@
|
|||
editEnabled="true" />
|
||||
</forwards>
|
||||
</commit>
|
||||
|
||||
<commit id="wmsMeshuichuang" title="WMS-MES数据回传" enableType="multi" invisible="false" confirmMessage="确认是否回传?">
|
||||
<mappings>
|
||||
<mapping id="ids" className="list" />
|
||||
</mappings>
|
||||
<actions>
|
||||
<action managerName="pickTicketManager" methodName="wmsMesFaliaohuichuang"
|
||||
parameter="ids" />
|
||||
</actions>
|
||||
<forwards>
|
||||
<forward name="refreshWindow" newEnabled="true"
|
||||
editEnabled="true" />
|
||||
</forwards>
|
||||
</commit>
|
||||
</buttons>
|
||||
</maintainPage>
|
||||
</pages>
|
||||
|
|
|
|||
|
|
@ -68,7 +68,8 @@
|
|||
left join pickTicket.waveDoc
|
||||
left join pickTicket.billType
|
||||
where 1=1
|
||||
and (pickTicket.billType.name like '%其它出库%' or pickTicket.billType.code in( 'QPUTPTC','YINVENTORY','CPUTPTC'))
|
||||
and (pickTicket.billType.name like '%其它出库%' or pickTicket.billType.code
|
||||
in( 'QPUTPTC','YINVENTORY','CPUTPTC','ZPUTMV','ZPUTPTC'))
|
||||
and ( pickTicket.status not in('CLOSE','JIAODAN') or (pickTicket.billType.name like '%移位单%' and pickTicket.billType.code='YINVENTORY' and pickTicket.type is null)
|
||||
or ( /~ordersAll: {ordersAll} = true~/ ))
|
||||
and ( (pickTicket.sourceType <>'411' and pickTicket.status not in('CLOSE','JIAODAN') or (pickTicket.sourceType ='411' and pickTicket.status not in('PICK_ALL','CLOSE','JIAODAN')))
|
||||
|
|
@ -246,6 +247,21 @@
|
|||
editEnabled="true" />
|
||||
</forwards>
|
||||
</commit>
|
||||
|
||||
<commit id="wmsMeshuichuang" title="WMS-MES数据回传" enableType="multi" invisible="false" confirmMessage="确认是否回传?">
|
||||
<mappings>
|
||||
<mapping id="ids" className="list" />
|
||||
</mappings>
|
||||
<actions>
|
||||
<action managerName="pickTicketManager" methodName="wmsMesFaliaohuichuang"
|
||||
parameter="ids" />
|
||||
</actions>
|
||||
<forwards>
|
||||
<forward name="refreshWindow" newEnabled="true"
|
||||
editEnabled="true" />
|
||||
</forwards>
|
||||
</commit>
|
||||
|
||||
<!-- <commit id="wmsSapZhuantaihuichuang" title="WMS-SAP状态回传" enableType="multi" invisible="false" confirmMessage="确认是否回传?"> -->
|
||||
<!-- <mappings> -->
|
||||
<!-- <mapping id="ids" className="list" /> -->
|
||||
|
|
|
|||
|
|
@ -517,6 +517,20 @@
|
|||
editEnabled="true" />
|
||||
</forwards>
|
||||
</commit>
|
||||
<commit id="wmsMeshuichuang11" title="WMS-MES数据回传" enableType="multi" invisible="false" confirmMessage="确认是否回传?">
|
||||
<mappings>
|
||||
<mapping id="ids" className="list" />
|
||||
</mappings>
|
||||
<actions>
|
||||
<action managerName="pickTicketManager" methodName="wmsMesFaliaohuichuang"
|
||||
parameter="ids" />
|
||||
</actions>
|
||||
<forwards>
|
||||
<forward name="refreshWindow" newEnabled="true"
|
||||
editEnabled="true" />
|
||||
</forwards>
|
||||
</commit>
|
||||
<popup id="huichuanmes" title="重新回传mes" enableType="multi" invisible="false" containId="true" pageId="editTaskMESPage"/>
|
||||
</buttons>
|
||||
</maintainPage>
|
||||
</pages>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,8 @@
|
|||
|
||||
# (only applied with "dataSourceContext-hibernate.xml")
|
||||
#hibernate.dialect=com.dev.swms.server.utils.ZJCMySQLDialect
|
||||
hibernate.dialect=com.dev.swms.server.utils.MSSQLDialect
|
||||
#hibernate.dialect=com.dev.swms.server.utils.MSSQLDialect
|
||||
hibernate.dialect=com.dev.swms.server.utils.CustomSQLServerDialect
|
||||
|
||||
#hibernate.dialect=org.hibernate.dialect.OracleDialect
|
||||
#hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
|
||||
|
|
@ -47,4 +48,5 @@ ldxt.SAP=http://happdev.amecnsh.com:8000/sap/zrest
|
|||
ldxt.7WCS=http://gmowcs.amecnsh.com:9000
|
||||
ldxt.3WCS=http://10.1.112.5
|
||||
ldxt.RCS=http://10.1.96.110
|
||||
ldxt.OA=http://10.1.112.6:8080/api/zwbdt/e9/oa4sap/confirmRequest
|
||||
ldxt.OA=http://10.1.112.6:8080/api/zwbdt/e9/oa4sap/confirmRequest
|
||||
ldxt.MES=https://apintodev.amecnsh.com
|
||||
Loading…
Reference in New Issue