Bläddra i källkod

Merge branch 'hjb' of SH-Arbitrate/Arbitrate-Backend into dev

hejinbo 2 år sedan
förälder
incheckning
b979d8a4eb

+ 1
- 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/wisdomarbitrate/DeptIdentifyController.java Visa fil

@@ -138,7 +138,7 @@ public class DeptIdentifyController extends BaseController {
138 138
      * @return
139 139
      */
140 140
     @PostMapping("/updateTemplate")
141
-    public AjaxResult updateTemplate(@RequestBody TemplateManage templateManage,@RequestParam("file") MultipartFile file){
141
+    public AjaxResult updateTemplate(TemplateManage templateManage,@RequestParam("file") MultipartFile file){
142 142
         return deptIdentifyService.updateTemplate(templateManage,file);
143 143
     }
144 144
 

+ 4
- 0
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/domain/TemplateManage.java Visa fil

@@ -42,4 +42,8 @@ public class TemplateManage extends BaseEntity {
42 42
      * 删除标志(0代表存在 2代表删除)
43 43
      */
44 44
     private Integer delFlag;
45
+    /**
46
+     * 机构关联id
47
+     */
48
+    private String identifyName;
45 49
 }

+ 25
- 10
ruoyi-system/src/main/java/com/ruoyi/wisdomarbitrate/service/impl/DeptIdentifyServiceImpl.java Visa fil

@@ -412,16 +412,18 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
412 412
             return AjaxResult.error();
413 413
         }
414 414
         try {
415
-            String filePath = RuoYiConfig.getUploadPath();
416
-            // 上传
417
-            String fileName = FileUploadUtils.upload(filePath, file);
418
-            String prefix = "/profile";
419
-            int startIndex = fileName.indexOf(prefix);
420
-            startIndex += prefix.length();
421
-            String annexPath = "home/ruoyi/uploadPath" + fileName.substring(startIndex);
422
-            templateManage.setTemOrigPath(annexPath);
423
-            String format = getFileExtension(fileName);
424
-            templateManage.setTemFormat(format);
415
+            if (file != null && file.getSize() > 0) {
416
+                String filePath = RuoYiConfig.getUploadPath();
417
+                // 上传
418
+                String fileName = FileUploadUtils.upload(filePath, file);
419
+                String prefix = "/profile";
420
+                int startIndex = fileName.indexOf(prefix);
421
+                startIndex += prefix.length();
422
+                String annexPath = "home/ruoyi/uploadPath" + fileName.substring(startIndex);
423
+                templateManage.setTemOrigPath(annexPath);
424
+                String format = getFileExtension(fileName);
425
+                templateManage.setTemFormat(format);
426
+            }
425 427
             templateManage.setUpdateBy(getUsername());
426 428
             int i = templateManageMapper.updateTemplateManage(templateManage);
427 429
             if (i > 0) {
@@ -450,6 +452,19 @@ public class DeptIdentifyServiceImpl implements IDeptIdentifyService {
450 452
         TemplateManage templateManage = new TemplateManage();
451 453
         templateManage.setIdentifyId(deptIdentify.getId());
452 454
         List<TemplateManage> templateManages = templateManageMapper.selectTemplateList(templateManage);
455
+        if (templateManages != null && templateManages.size() > 0) {
456
+            for (TemplateManage manage : templateManages) {
457
+                //根据机构id查询机构名称
458
+                Long identifyId = manage.getIdentifyId();
459
+                if (identifyId != null) {
460
+                    deptIdentify.setId(identifyId);
461
+                    List<DeptIdentify> deptIdentifies = deptIdentifyMapper.selectDeptIdentify(deptIdentify);
462
+                    if (deptIdentifies != null && deptIdentifies.size() > 0) {
463
+                        manage.setIdentifyName(deptIdentifies.get(0).getIdentifyName());
464
+                    }
465
+                }
466
+            }
467
+        }
453 468
         return templateManages;
454 469
     }
455 470