|
@@ -1,10 +1,12 @@
|
|
|
package com.rongwei.bscommon.sys.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.rongwei.bscommon.sys.service.SynchronizationDataService;
|
|
|
import com.rongwei.bscommon.sys.strategy.*;
|
|
|
import com.rongwei.bscommon.sys.utils.AttendanceAssessmentSdk;
|
|
|
import com.rongwei.bsentity.dto.ApiCallDto;
|
|
|
import com.rongwei.rwcommon.base.R;
|
|
|
+import com.rongwei.rwcommon.base.exception.CustomException;
|
|
|
import com.rongwei.rwcommonentity.commonservers.domain.SysFileItemDo;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -198,13 +200,26 @@ public class SynchronizationDataServiceImpl implements SynchronizationDataServic
|
|
|
public R uploadFile(String fileId) {
|
|
|
log.info("文件上传开始,本系统文件ID:{}", fileId);
|
|
|
SysFileItemDo sysFileItemDo = sysFileItemServiceImpl.getById(fileId);
|
|
|
+ if (ObjectUtil.isEmpty(sysFileItemDo)) {
|
|
|
+ throw new CustomException("未找到指定文件:" + fileId);
|
|
|
+ }
|
|
|
+ if (ObjectUtil.isNotEmpty(sysFileItemDo.getExtends3())) {
|
|
|
+ return R.ok().putData(sysFileItemDo.getExtends3());
|
|
|
+ }
|
|
|
File newFile = new File(sysFileItemDo.getFullpath());
|
|
|
|
|
|
ApiCallDto<Object> req = new ApiCallDto<>();
|
|
|
req.setApiCode("fileUpload");
|
|
|
req.setData(newFile);
|
|
|
+ String extends3 = attendanceAssessmentSdk.fileUploadApiCall(req);
|
|
|
+
|
|
|
+ //反写文件对接ID
|
|
|
+ SysFileItemDo needUpdateFile = new SysFileItemDo();
|
|
|
+ needUpdateFile.setId(fileId);
|
|
|
+ needUpdateFile.setExtends3(extends3);
|
|
|
+ sysFileItemServiceImpl.updateById(needUpdateFile);
|
|
|
|
|
|
- return R.ok().putData(attendanceAssessmentSdk.fileUploadApiCall(req));
|
|
|
+ return R.ok().putData(extends3);
|
|
|
}
|
|
|
|
|
|
|