|
|
@@ -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
|
|