Sfoglia il codice sorgente

平台档案接口

jlutt@163.com 2 anni fa
parent
commit
479ed2370b

+ 1 - 1
conf/script/1000/business/BE_PlateForm_CodeList.groovy

@@ -36,7 +36,7 @@ class BE_PlateForm_CodeList implements BusinessExecutor<InvokeCallParams, Invoke
         def platformCodeJsonFile = new File(appHome + File.separator +
                 "conf" + File.separator +
                 "script" + File.separator +
-                "1000" + File.separator +
+                supplierCode + File.separator +
                 "scriptFiles" + File.separator +
                 "platformCode.json")
         platformCodeArray = jsonSlurper.parse(platformCodeJsonFile)

+ 4 - 5
ddWebCore/src/main/java/com/dderp/webcore/rest/PlatformRest.java

@@ -51,11 +51,12 @@ public class PlatformRest extends BaseService {
     @WebApiBean(result = true, type = PlatformInfo.class)
     public CompletableFuture<RMap> getPlatformInfo(
             @RestParam(name = "idPlatform", comment = "平台档案id") long idPlatform,
+            @RestParam(name = "withDetail", comment = "是否返回属性明细") boolean withDetail,
             @RestHeader(name = ERPHeader.HTTPHEADER_DATASOURCE) String dataSourceId,
             @RestHeader(name = ERPHeader.HTTPHEADER_SUPPLIER) String supplierCode) {
         return CompletableFuture.supplyAsync(
                 () -> {
-                    PlatformInfo platformInfo = platformService.getPlatformInfo(idPlatform, false, Long.parseLong(supplierCode));
+                    PlatformInfo platformInfo = platformService.getPlatformInfo(idPlatform, withDetail, Long.parseLong(supplierCode));
                     if (platformInfo == null) return RMapUtils.error(HttpCode.BAD_REQUEST.value(), "平台档案不存在");
                     return RMapUtils.successV2(platformInfo, null, null);
                 }, getExecutor()
@@ -80,7 +81,6 @@ public class PlatformRest extends BaseService {
 
 
     @RestMapping(name = "updatePlatformInfo", auth = true, sort = 4, comment = "修改平台档案", methods = {"POST"})
-    @WebApiBean(result = true, type = PlatformInfo.class)
     public CompletableFuture<RMap> updatePlatformInfo(
             @RestParam(name = "platformInfo", comment = "平台档案") PlatformInfo platformInfo,
             @RestParam(name = "&", comment = "当前用户,不需要传入") ERPTokenUser currentUser,
@@ -90,13 +90,12 @@ public class PlatformRest extends BaseService {
                 () -> {
                     RetResult<PlatformInfo> result = platformService.updatePlatformInfo(platformInfo, currentUser, dataSourceId, Long.parseLong(supplierCode));
                     if (!result.isSuccess()) return RMapUtils.error(HttpCode.BAD_REQUEST.value(), result.getRetinfo());
-                    return RMapUtils.successV2(result.getResult(), null, null);
+                    return RMapUtils.success();
                 }, getExecutor()
         );
     }
 
     @RestMapping(name = "voidPlatformInfo", auth = true, sort = 5, comment = "禁用平台档案", methods = {"POST"})
-    @WebApiBean(result = true, type = PlatformInfo.class)
     public CompletableFuture<RMap> voidPlatformInfo(
             @RestParam(name = "platformInfo", comment = "平台档案") PlatformInfo platformInfo,
             @RestParam(name = "&", comment = "当前用户,不需要传入") ERPTokenUser currentUser,
@@ -106,7 +105,7 @@ public class PlatformRest extends BaseService {
                 () -> {
                     RetResult<PlatformInfo> result = platformService.voidPlatformInfo(platformInfo, currentUser, dataSourceId, Long.parseLong(supplierCode));
                     if (!result.isSuccess()) return RMapUtils.error(HttpCode.BAD_REQUEST.value(), result.getRetinfo());
-                    return RMapUtils.successV2(result.getResult(), null, null);
+                    return RMapUtils.success();
                 }, getExecutor()
         );
     }