From 2aa1ad4f2e8e1d627b776c4f55543afb694f23ca Mon Sep 17 00:00:00 2001 From: zhaoxiaolin Date: Thu, 9 Nov 2023 11:35:59 +0800 Subject: [PATCH] =?UTF-8?q?bat=E6=8D=A2jdk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- op-auth/push-auth.bat | 3 +- op-gateway/push-gate.bat | 3 +- op-modules/op-device/push-device.bat | 3 +- op-modules/op-job/push-job.bat | 41 +++++++++++++++++++ op-modules/op-mes/push-mes.bat | 3 +- op-modules/op-plan/push-plan.bat | 3 +- .../service/impl/ProOrderServiceImpl.java | 13 ++++-- op-modules/op-quality/push-quality.bat | 3 +- op-modules/op-scada/push-scada.bat | 3 +- op-modules/op-system/push-system.bat | 41 +++++++++++++++++++ op-modules/op-wms/push-wms.bat | 3 +- 11 files changed, 108 insertions(+), 11 deletions(-) create mode 100644 op-modules/op-job/push-job.bat create mode 100644 op-modules/op-system/push-system.bat diff --git a/op-auth/push-auth.bat b/op-auth/push-auth.bat index 9ff3fa50..0795d265 100644 --- a/op-auth/push-auth.bat +++ b/op-auth/push-auth.bat @@ -26,7 +26,8 @@ if exist %df% ( del /f /s /q .\Dockerfile ) echo --------------------------------创建Dockerfile-------------------------------- -echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile echo COPY %jarName% /application.jar >> Dockerfile echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile diff --git a/op-gateway/push-gate.bat b/op-gateway/push-gate.bat index f7efe0d6..82f33186 100644 --- a/op-gateway/push-gate.bat +++ b/op-gateway/push-gate.bat @@ -26,7 +26,8 @@ if exist %df% ( del /f /s /q .\Dockerfile ) echo --------------------------------创建Dockerfile-------------------------------- -echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile echo COPY %jarName% /application.jar >> Dockerfile echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile diff --git a/op-modules/op-device/push-device.bat b/op-modules/op-device/push-device.bat index 20d4d5b7..e96795b1 100644 --- a/op-modules/op-device/push-device.bat +++ b/op-modules/op-device/push-device.bat @@ -26,7 +26,8 @@ if exist %df% ( del /f /s /q .\Dockerfile ) echo --------------------------------创建Dockerfile-------------------------------- -echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile echo COPY %jarName% /application.jar >> Dockerfile echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile diff --git a/op-modules/op-job/push-job.bat b/op-modules/op-job/push-job.bat new file mode 100644 index 00000000..8d786148 --- /dev/null +++ b/op-modules/op-job/push-job.bat @@ -0,0 +1,41 @@ +@echo off +echo --------------------------------自定义参数,启动前先修改-------------------------------------- +set jarName=op-modules-job.jar +set profile=dev +set imageURI=192.168.202.36:30002/op-lanju/op-job +rem echo 获取当前日期字符串 +for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c +rem echo 获取当前时间字符串 +for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b +rem echo 如当前小时小于10,将空格替换为0 +set T=%T: =0% +rem echo 显示输出日期时间字符串 +set imageVersion=%D%%T% +::输出发版信息 +echo jar包名称:%jarName% +echo 启动环境:%profile% +echo 镜像库地址:%imageURI% +echo 镜像版本:%imageVersion% + +echo --------------------------------mvn package...-------------------------------- +::call mvn clean package -Dmaven.test.skip=true + +cd .\target +SET df=Dockerfile +if exist %df% ( + del /f /s /q .\Dockerfile +) +echo --------------------------------创建Dockerfile-------------------------------- +::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile +echo COPY %jarName% /application.jar >> Dockerfile +echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile +echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile +dir +echo --------------------------------docker login...------------------------------- +docker login 192.168.202.36:30002 -u deploy -p Deploy@2023 +echo --------------------------------docker build...------------------------------- +docker build -t %imageURI%:%imageVersion% . +echo --------------------------------docker push...-------------------------------- +docker push %imageURI%:%imageVersion% +@pause \ No newline at end of file diff --git a/op-modules/op-mes/push-mes.bat b/op-modules/op-mes/push-mes.bat index e95aae00..9fe496e1 100644 --- a/op-modules/op-mes/push-mes.bat +++ b/op-modules/op-mes/push-mes.bat @@ -26,7 +26,8 @@ if exist %df% ( del /f /s /q .\Dockerfile ) echo --------------------------------创建Dockerfile-------------------------------- -echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile echo RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig echo COPY %jarName% /application.jar >> Dockerfile echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile diff --git a/op-modules/op-plan/push-plan.bat b/op-modules/op-plan/push-plan.bat index 645c2921..8fb7d0cf 100644 --- a/op-modules/op-plan/push-plan.bat +++ b/op-modules/op-plan/push-plan.bat @@ -26,7 +26,8 @@ if exist %df% ( del /f /s /q .\Dockerfile ) echo --------------------------------创建Dockerfile-------------------------------- -echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile echo RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig echo COPY %jarName% /application.jar >> Dockerfile echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile diff --git a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java index e4ad8417..ab3704ed 100644 --- a/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java +++ b/op-modules/op-plan/src/main/java/com/op/plan/service/impl/ProOrderServiceImpl.java @@ -448,8 +448,14 @@ public class ProOrderServiceImpl implements IProOrderService { public String syncImportFunc(List newOrders){ String failOrder = ""; for (ProOrder proOrder:newOrders) { - proOrder.setProdType("white");//鍙湁鐧藉澂鏈夊鍏 - failOrder += syncFunc(proOrder)+","; + //prodType->@Excel(name = "浜у搧绫诲瀷", readConverterExp = "white=鐧藉澂,prod=鎴愬搧") + proOrder.setCreateBy(SecurityUtils.getUsername()); + proOrder.setSyncUser("import"); + proOrder.setPlanFactoryCode(proOrder.getFactoryCode()); + String msg = syncFunc(proOrder); + if(StringUtils.isNotBlank(msg)){ + failOrder += msg+","; + } } return failOrder; } @@ -987,7 +993,7 @@ public class ProOrderServiceImpl implements IProOrderService { // 寰幆閬嶅巻鏍¢獙鏁版嵁鏄惁涓虹┖ for (ProOrder proOrder : orderList) { // 璁″垝宸ュ巶 - if (proOrder.getPlanFactoryCode().isEmpty() || proOrder.getPlanFactoryCode() == null) { + if (proOrder.getFactoryCode().isEmpty() || proOrder.getFactoryCode() == null) { return error(500, "璁″垝宸ュ巶淇℃伅涓嶈兘涓虹┖锛佷俊鎭鍏ュけ璐ワ紒"); } // 璁㈠崟鍙 @@ -1026,6 +1032,7 @@ public class ProOrderServiceImpl implements IProOrderService { if (proOrder.getPlanComplete() == null || StringUtils.isNull(proOrder.getPlanComplete())) { return error(500, "璁″垝瀹屾垚鏃ユ湡涓嶈兘涓虹┖锛佷俊鎭鍏ュけ璐ワ紒"); } + } return success(); } diff --git a/op-modules/op-quality/push-quality.bat b/op-modules/op-quality/push-quality.bat index e53c0253..d690a541 100644 --- a/op-modules/op-quality/push-quality.bat +++ b/op-modules/op-quality/push-quality.bat @@ -26,7 +26,8 @@ if exist %df% ( del /f /s /q .\Dockerfile ) echo --------------------------------创建Dockerfile-------------------------------- -echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile echo COPY %jarName% /application.jar >> Dockerfile echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile diff --git a/op-modules/op-scada/push-scada.bat b/op-modules/op-scada/push-scada.bat index 41643686..f0e9c133 100644 --- a/op-modules/op-scada/push-scada.bat +++ b/op-modules/op-scada/push-scada.bat @@ -26,7 +26,8 @@ if exist %df% ( del /f /s /q .\Dockerfile ) echo --------------------------------创建Dockerfile-------------------------------- -echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile echo RUN apk add --update font-adobe-100dpi ttf-dejavu fontconfig echo COPY %jarName% /application.jar >> Dockerfile echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile diff --git a/op-modules/op-system/push-system.bat b/op-modules/op-system/push-system.bat new file mode 100644 index 00000000..9f041629 --- /dev/null +++ b/op-modules/op-system/push-system.bat @@ -0,0 +1,41 @@ +@echo off +echo --------------------------------自定义参数,启动前先修改-------------------------------------- +set jarName=op-modules-system.jar +set profile=dev +set imageURI=192.168.202.36:30002/op-lanju/op-system +rem echo 获取当前日期字符串 +for /f "tokens=1,2,3 delims=/- " %%a in ("%date%") do @set D=%%a%%b%%c +rem echo 获取当前时间字符串 +for /f "tokens=1,2 delims=:." %%a in ("%time%") do @set T=%%a%%b +rem echo 如当前小时小于10,将空格替换为0 +set T=%T: =0% +rem echo 显示输出日期时间字符串 +set imageVersion=%D%%T% +::输出发版信息 +echo jar包名称:%jarName% +echo 启动环境:%profile% +echo 镜像库地址:%imageURI% +echo 镜像版本:%imageVersion% + +echo --------------------------------mvn package...-------------------------------- +::call mvn clean package -Dmaven.test.skip=true + +cd .\target +SET df=Dockerfile +if exist %df% ( + del /f /s /q .\Dockerfile +) +echo --------------------------------创建Dockerfile-------------------------------- +::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile +echo COPY %jarName% /application.jar >> Dockerfile +echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile +echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile +dir +echo --------------------------------docker login...------------------------------- +docker login 192.168.202.36:30002 -u deploy -p Deploy@2023 +echo --------------------------------docker build...------------------------------- +docker build -t %imageURI%:%imageVersion% . +echo --------------------------------docker push...-------------------------------- +docker push %imageURI%:%imageVersion% +@pause \ No newline at end of file diff --git a/op-modules/op-wms/push-wms.bat b/op-modules/op-wms/push-wms.bat index 080ce1b8..8e87e6d4 100644 --- a/op-modules/op-wms/push-wms.bat +++ b/op-modules/op-wms/push-wms.bat @@ -26,7 +26,8 @@ if exist %df% ( del /f /s /q .\Dockerfile ) echo --------------------------------创建Dockerfile-------------------------------- -echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +::echo FROM 192.168.202.36:30002/library/openjdk:8u131-jdk-alpine >> Dockerfile +echo FROM 192.168.202.36:30002/library/openjdk:8-sw66>> Dockerfile echo COPY %jarName% /application.jar >> Dockerfile echo RUN echo "Asia/Shanghai" ^> /etc/timezone >> Dockerfile echo CMD ["java", "-jar", "-Dspring.profiles.active=%profile%", "application.jar"] >> Dockerfile