营业执照文件上传逻辑优化
This commit is contained in:
parent
225f2b56ef
commit
e91fa001db
|
|
@ -1,14 +1,12 @@
|
|||
package com.bonus.material.ma.domain;
|
||||
|
||||
import com.bonus.common.core.annotation.Excel;
|
||||
import com.bonus.system.api.domain.SysFile;
|
||||
import com.bonus.material.basic.domain.BmFileInfo;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -79,6 +77,6 @@ public class SupplierInfo extends BaseEntity {
|
|||
* 营业执照文件列表
|
||||
*/
|
||||
@ApiModelProperty(value = "营业执照文件列表")
|
||||
List<SysFile> businessLicenseFileList;
|
||||
List<BmFileInfo> businessLicenseFileList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,14 +73,14 @@ public class SupplierInfoServiceImpl implements ISupplierInfoService {
|
|||
return AjaxResult.success("新增任务成功,无营业执照附件");
|
||||
}
|
||||
AtomicBoolean addFileInfoResult = new AtomicBoolean(false);
|
||||
supplierInfo.getBusinessLicenseFileList().forEach(file -> {
|
||||
BmFileInfo bmFileInfo = new BmFileInfo();
|
||||
if (file.getName() != null) {
|
||||
bmFileInfo.setFileName(file.getName());
|
||||
}
|
||||
bmFileInfo.setFileUrl(file.getUrl());
|
||||
// TODO: 此处需要修改为字典表中定义的Model模块id
|
||||
bmFileInfo.setModelId(MODEL_ID);
|
||||
supplierInfo.getBusinessLicenseFileList().forEach(bmFileInfo -> {
|
||||
// BmFileInfo bmFileInfo = new BmFileInfo();
|
||||
// if (file.getName() != null) {
|
||||
// bmFileInfo.setFileName(file.getName());
|
||||
// }
|
||||
// bmFileInfo.setFileUrl(file.getUrl());
|
||||
// bmFileInfo.setModelId(MODEL_ID);
|
||||
bmFileInfo.setModelId(supplierInfo.getSupplierId());
|
||||
addFileInfoResult.set(bmFileInfoMapper.insertBmFileInfo(bmFileInfo) > 0);
|
||||
});
|
||||
return addFileInfoResult.get() ? AjaxResult.success("新增任务成功") : AjaxResult.error("新增任务失败,附件表插入0条");
|
||||
|
|
|
|||
Loading…
Reference in New Issue