Merge branch 'develop' into feature/JDK11
All checks were successful
IntegryManagementSystem_Multi/pipeline/head This commit looks good

This commit is contained in:
jenkins
2025-02-25 17:29:02 +01:00
3 changed files with 43 additions and 16 deletions

View File

@@ -0,0 +1,16 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Tomcat9 #1 (DBServer)" type="Remote" folderName="Lamonarca">
<module name="ems-engine" />
<option name="USE_SOCKET_TRANSPORT" value="true" />
<option name="SERVER_MODE" value="false" />
<option name="SHMEM_ADDRESS" />
<option name="HOST" value="192.168.1.7" />
<option name="PORT" value="8001" />
<option name="AUTO_RESTART" value="false" />
<RunnerSettings RunnerId="Debug">
<option name="DEBUG_PORT" value="8001" />
<option name="LOCAL" value="false" />
</RunnerSettings>
<method v="2" />
</configuration>
</component>

View File

@@ -49,6 +49,7 @@ pipeline {
echo "Updating Tomcat9 from ${WORKSPACE}"
powershell returnStdout: true, script: "build\\update_tomcat.ps1 -serviceName \"Tomcat9Backup\" -httpPort \"8082\" -updatedArtifactPath \"${WORKSPACE}\\ems-engine\\target\\ems-api.war\""
bat 'curl -k https://devservices.studioml.it/ems-api/updateWMSApp'
bat 'curl -k https://devservices.studioml.it/ems-api/updateWMSApp?suffix=beta'
}
}
}
@@ -86,6 +87,7 @@ sudo /usr/bin/systemctl start tomcat9backup
sleep 10''', execTimeout: 120000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '/tomcat9backup/webapps', remoteDirectorySDF: false, removePrefix: 'ems-engine/target/', sourceFiles: 'ems-engine/target/*.war*')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)])
bat 'curl -k https://services.studioml.it/ems-api/updateWMSApp'
bat 'curl -k https://services.studioml.it/ems-api/updateWMSApp?suffix=beta'
}
}
}

View File

@@ -102,24 +102,34 @@ public class WMSGenericController {
return ServiceRestResponse.createPositiveResponse(wmsGenericService.getPickingListFromBarcodeOrdine(codBarreBancale));
}
@RequestMapping(value = "updateWMSApp", method = RequestMethod.GET)
public ServiceRestResponse updateWMSApp() throws Exception {
@GetMapping(value = "updateWMSApp")
public ServiceRestResponse updateWMSApp(@RequestParam(required = false) String suffix) throws Exception {
String baseDownloadUrl = "https://jnxuo98bbuecrmbkciijvpkg.file.core.windows.net/storage-ci/wms/";
String azureToken = "?sv=2022-11-02&ss=bf&srt=sco&sp=r&se=2030-11-04T17:45:57Z&st=2024-11-04T09:45:57Z&spr=https&sig=CGxbbC08xuvAz%2B6k2C6HDq6e9UGitb0lnbbsWeRG%2FiU%3D";
String androidAppFilePath = Paths.get(UtilityDirs.getWebAppPath(), "wms", "android-release.apk").toString();
HttpRestWrapper.downloadFile(baseDownloadUrl + "android-release.apk" + azureToken, androidAppFilePath);
if (UtilityString.isNullOrEmpty(suffix))
suffix = "";
else
suffix = "-" + suffix;
String androidAppVersionFilePath = Paths.get(UtilityDirs.getWebAppPath(), "wms", "version.txt").toString();
HttpRestWrapper.downloadFile(baseDownloadUrl + "version.txt" + azureToken, androidAppVersionFilePath);
String androidAppFilePath = Paths.get(UtilityDirs.getWebAppPath(), "wms", "android-release" + suffix + ".apk").toString();
HttpRestWrapper.downloadFile(baseDownloadUrl + "android-release" + suffix + ".apk" + azureToken, androidAppFilePath);
String androidAppVersionFilePath = Paths.get(UtilityDirs.getWebAppPath(), "wms", "version" + suffix + ".txt").toString();
HttpRestWrapper.downloadFile(baseDownloadUrl + "version" + suffix + ".txt" + azureToken, androidAppVersionFilePath);
return ServiceRestResponse.createPositiveResponse();
}
@GetMapping(value = EmsRestConstants.PATH_CHECK_LATEST_WMS_VERSION_JSON)
public WMSVersionDTO checkWMSLatestVersionJSON(HttpServletResponse response) throws Exception {
String wmsVersionFile = Paths.get(UtilityDirs.getWebAppPath(), "wms", "version.txt").toString();
public WMSVersionDTO checkWMSLatestVersionJSON(HttpServletResponse response, @RequestParam(required = false) String suffix) throws Exception {
if (UtilityString.isNullOrEmpty(suffix))
suffix = "";
else
suffix = "-" + suffix;
String wmsVersionFile = Paths.get(UtilityDirs.getWebAppPath(), "wms", "version" + suffix + ".txt").toString();
if (new File(wmsVersionFile).exists()) {
List<String> lines = UtilityString.splitStringToMultipleLine(IoUtils.readFileAsString(new File(wmsVersionFile)));
@@ -138,14 +148,13 @@ public class WMSGenericController {
WMSVersionDTO wmsVersionDTO = new WMSVersionDTO()
.setLatestVersion(versionString)
.setLatestVersionCode(versionCode)
.setUrl("/wms/android-release.apk");
.setUrl("/wms/android-release" + suffix + ".apk");
if(lines.size() > 2) {
if (lines.size() > 2) {
String forcedLine = lines.get(2);
if(forcedLine.startsWith("forced=")) {
if (forcedLine.startsWith("forced=")) {
String forcedValue = forcedLine.replace("forced=", "").trim();
boolean forced = Boolean.parseBoolean(forcedValue);
wmsVersionDTO.setForced(forced);
@@ -155,8 +164,8 @@ public class WMSGenericController {
return wmsVersionDTO;
} else {
logger.warn("File version.txt non trovato");
response.sendError(404, "File version.txt non trovato");
logger.warn("File version" + suffix + ".txt non trovato");
response.sendError(404, "File version" + suffix + ".txt non trovato");
return null;
}
}
@@ -629,7 +638,7 @@ public class WMSGenericController {
@RequestMapping(value = "wms/rientroMerce", method = RequestMethod.POST)
public @ResponseBody
ServiceRestResponse rientroMerce(@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
@RequestBody RientroMerceRequestDTO rientroMerceRequestDTO) throws Exception {
@RequestBody RientroMerceRequestDTO rientroMerceRequestDTO) throws Exception {
wmsGenericService.rientroMerce(rientroMerceRequestDTO);
return ServiceRestResponse.createPositiveResponse();
@@ -638,7 +647,7 @@ public class WMSGenericController {
@RequestMapping(value = "wms/updateTipoUL", method = RequestMethod.POST)
public @ResponseBody
ServiceRestResponse updateTipoUL(@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
@RequestBody UpdateTipoULRequestDTO updateTipoULRequest) throws Exception {
@RequestBody UpdateTipoULRequestDTO updateTipoULRequest) throws Exception {
wmsGenericService.cambiaTipoUL(updateTipoULRequest);
return ServiceRestResponse.createPositiveResponse();