Browse Source

fix: 功能资源导入接口自测完成

huangjy 4 years ago
parent
commit
f8b7a8faac

+ 2 - 2
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/app/AppController.java

@@ -271,10 +271,10 @@ public class AppController {
 
 
 
-    @PostMapping(value = "/import")
+    @PostMapping(value = "/app/import")
     @ApiImplicitParam(name = "fileId", value = "导入文件id")
     @ApiOperation(value = "授权主客体管理_应用资源导入")
-    public Result impExcel(@RequestBody String fileId) {
+    public Result impExcel(@RequestParam("fileId") String fileId) {
         ResponseStatus responseStatus = applyInfoFacade.impExcel(fileId);
         if (!responseStatus.getStatusCode().equals("200")){
             return Result.fail(responseStatus.getStatusCode(), responseStatus.getMessage());

+ 12 - 3
src/main/java/com/dragoninfo/dcuc/authweb/restcontroller/download/DownloadController.java

@@ -68,12 +68,16 @@ public class DownloadController {
      * 客体_功能资源模板
      */
     public final String APP_FUN_TEMPLATE_RLPATH = "/template/appFunTemplate.xls";
+    /**
+     * 主客体_应用资源模板
+     */
+    public final String APPLY_TEMPLATE_RLPATH = "/template/applyTemplate.xls";
 
     private Logger logger = LoggerFactory.getLogger(DownloadController.class);
 
     @ApiOperation(value = "获取xls附件")
-    @ApiImplicitParam(name = "type", value = "附件类型:police 警员,auxiliaryPolice 辅警 " +
-            "externalPersonnel 外部人员 manager 管理员 govUser 政府人员 ", required = true)
+    @ApiImplicitParam(name = "type", value = "附件类型:police 警员,auxiliaryPolice 辅警 " +
+            "externalPersonnel 外部人员 manager 管理员 govUser 政府人员, serviceResource 服务资源,appFun 功能资源, apply  应用资源,org 机构, user 人员 ", required = true)
     @GetMapping(value = "/downTemplate")
     public HttpServletResponse downTemplate(@RequestParam("type") String type,  HttpServletResponse response) {
         ApplicationHome home = new ApplicationHome(getClass());
@@ -97,8 +101,11 @@ public class DownloadController {
             //授权主客体管理_服务资源模板
             response = down(response,  SERVICE_RESOURCE_TEMPLATE_RLPATH);
         }else if (StringUtils.equals(type, "appFun")){
-            //授权主客体管理_服务资源模板
+            //授权主客体管理_功能资源模板
             response = down(response,  APP_FUN_TEMPLATE_RLPATH);
+        }else if (StringUtils.equals(type, "apply")){
+            //授权主客体管理_应用资源模板
+            response = down(response,  APPLY_TEMPLATE_RLPATH);
         }
         return response;
     }
@@ -134,6 +141,8 @@ public class DownloadController {
                 fileName = "客体_服务资源导入.xls";
             }else if ("appFunTemplate.xls".equals( resource.getFilename())) {
                 fileName = "客体_功能资源导入.xls";
+            }else if ("applyTemplate.xls".equals( resource.getFilename())) {
+                fileName = "主客体_应用资源导入.xls";
             }
             response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
             response.addHeader("Content-Length", "" + resource.contentLength());

BIN
src/main/resources/template/applyTemplate.xls