feat: materiel sync defaults

This commit is contained in:
tsiji 2026-05-20 17:28:41 +08:00
parent f595fc7eef
commit 7c3e7cacfd
4 changed files with 64 additions and 8 deletions

4
Dockerfile Normal file
View File

@ -0,0 +1,4 @@
FROM eclipse-temurin:8-jre-focal
WORKDIR /app
COPY int-app/target/iep-int.jar /app/iep-int.jar
CMD ["sh", "-c", "java ${_JAVA_OPTIONS} -Dserver.port=${PORT:-5000} -jar /app/iep-int.jar"]

52
deploy/deploy-dev.sh Executable file
View File

@ -0,0 +1,52 @@
#!/bin/bash
set -e
HARBOR="10.10.11.40:5000"
HARBOR_USER="admin"
HARBOR_PASS="Harbor@2026"
SERVICE="imes-custom-nalinv-int531"
IMAGE_REPO="${HARBOR}/dev/${SERVICE}"
GITEA_REPO="http://chengzhaofeng:Init1234@10.10.11.66:3000/chengzhaofeng/k8s-manifests.git"
MANIFEST="dev/${SERVICE}.yaml"
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
# 1. 构建 JAR
echo "==> [1/4] 构建 JAR..."
mvn clean package -DskipTests -pl int-app -am -q
echo " 完成: int-app/target/iep-int.jar ($(du -sh int-app/target/iep-int.jar | cut -f1))"
# 2. 构建 Docker 镜像
TAG=$(date +%Y%m%d%H%M%S)
IMAGE="${IMAGE_REPO}:${TAG}"
echo "==> [2/4] 构建镜像 $IMAGE ..."
docker buildx build --platform linux/amd64 -t "$IMAGE" --load .
echo " 镜像构建完成"
# 3. 推送到 Harbor
echo "==> [3/4] 推送到 Harbor..."
echo "$HARBOR_PASS" | docker login "$HARBOR" -u "$HARBOR_USER" --password-stdin
docker push "$IMAGE"
echo " 推送完成"
# 4. 更新 k8s-manifests 触发 ArgoCD
echo "==> [4/4] 更新 k8s-manifests..."
TMPDIR=$(mktemp -d)
git clone "$GITEA_REPO" "$TMPDIR" -q
cd "$TMPDIR"
git config user.email "deploy@mes.local"
git config user.name "deploy-local"
sed -i '' "s|${IMAGE_REPO}:[^ ]*|${IMAGE}|" "$MANIFEST" 2>/dev/null || \
sed -i "s|${IMAGE_REPO}:[^ ]*|${IMAGE}|" "$MANIFEST"
git add "$MANIFEST"
git commit -m "deploy: ${SERVICE} -> ${TAG}"
git push -q
cd "$ROOT"
rm -rf "$TMPDIR"
echo " 已提交,ArgoCD 将在数秒内同步"
echo ""
echo "✅ 部署完成: $IMAGE"
echo " ArgoCD: http://10.10.11.40 (dev-services)"
echo " Gitea: http://10.10.11.66:3000/chengzhaofeng/k8s-manifests"

View File

@ -37,6 +37,8 @@ public class IntegrationSrv {
public static final String CCD_GET_RESULT = "CCD_GET_RESULT";
public static final String CCD_GET_PRODUCT = "CCD_GET_PRODUCT";
public static final String DN_AUTO_PRINTING = "DN_AUTO_PRINTING";
}

View File

@ -81,18 +81,16 @@ public class SapMaterielReceiveForWorkJob {
inputJsonObject.put("WERKS", site);
inputJsonObject.put("VKORG", "");
inputJsonObject.put("VTWEG", "");
inputJsonObject.put("ERSDAS", "0000-00-00");
inputJsonObject.put("ERSDAE", "0000-00-00");
inputJsonObject.put("ERSDAS", nowLocalDateTime.getYear() + "-01-01");
inputJsonObject.put("ERSDAE", nowLocalDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")));
if (StrUtil.isBlank(startDate)) {
inputJsonObject.put("LAEDAS", "0000-00-00");
} else {
inputJsonObject.put("LAEDAS", startDate);
startDate = nowLocalDateTime.minusDays(30).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
}
if (StrUtil.isBlank(endDate)) {
inputJsonObject.put("LAEDAE", "0000-00-00");
} else {
inputJsonObject.put("LAEDAE", endDate);
endDate = nowLocalDateTime.plusDays(1).format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
}
inputJsonObject.put("LAEDAS", startDate);
inputJsonObject.put("LAEDAE", endDate);
bodyJsonObject.put("IS_INPUT", inputJsonObject);
jsonObject.put("REQUEST_BODY", bodyJsonObject);
// messageContent内容