Prechádzať zdrojové kódy

feat:文件上传修改

fangxinjian 3 rokov pred
rodič
commit
d6b6532ba8

+ 5 - 2
abi-cloud-qr-platform-server/src/main/java/com/abi/qms/platform/service/impl/QrBoxMappingServiceImpl.java

@@ -34,6 +34,7 @@ import com.abi.qms.platform.infrastructure.util.PageUtil;
 import com.abi.qms.platform.infrastructure.util.UserUtil;
 import com.abi.qms.platform.service.QrBoxMappingService;
 import com.abi.task.common.api.exception.BusinessException;
+import com.abi.task.common.api.exception.ErrorCodeEnum;
 import com.abi.task.common.tablestore.TableStorePlusUtils;
 import com.abi.task.common.utils.PojoConverterUtils;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -146,10 +147,12 @@ public class QrBoxMappingServiceImpl implements QrBoxMappingService {
                 resultMap.put(o.getKey(), new UploadFileRes(SUCCESS, "上传箱码合一文件成功!"));
             } catch (BusinessException e) {
                 log.info("文件上传失败");
-                resultMap.put(o.getKey(), new UploadFileRes(FAIL, e.getMessage()));
+                throw new BusinessException(ErrorCodeEnum.FAIL.getCode(),"文件上传失败");
+//                resultMap.put(o.getKey(), new UploadFileRes(FAIL, e.getMessage()));
             } catch (Exception e) {
                 log.info("文件上传异常", e);
-                resultMap.put(o.getKey(), new UploadFileRes(FAIL, e.getMessage()));
+                throw new BusinessException(ErrorCodeEnum.SERVICE_EXCEPTION.getCode(),"文件上传异常");
+//                resultMap.put(o.getKey(), new UploadFileRes(FAIL, e.getMessage()));
             }
         });