图片上传

master
赵嘉伟 3 years ago
parent 3bf40f9fbc
commit f878dcf66d

@ -13,8 +13,8 @@ import java.util.List;
/**
*
* @author
* @since 2021-07-11
* @author zjw
* @since 2021-09-09
*/
@RestController
@RequestMapping("/Z-UPLOAD-PICTURES")
@ -74,6 +74,7 @@ public class UploadPicturesController {
.or().like(UploadPictures::getType, frontPage.getGlobalQuery())
.or().like(UploadPictures::getCreatedUser, frontPage.getGlobalQuery())
.or().like(UploadPictures::getModifiedUser, frontPage.getGlobalQuery())
.or().like(UploadPictures::getStatus, frontPage.getGlobalQuery())
);
}
result = uploadPicturesService.page(frontPage.getPagePlus(), queryWrapper);

@ -609,6 +609,13 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
abnormalBillDispose.setClosedUser(user);
abnormalBillDispose.setClosedDateTime(now);
//上传照片
if(!StringUtil.isBlank(abnormalBill.getFileName())){
//放置图片,新建状态
this.fileUpload(abnormalBill);
}
// this.anomalyCreatedAndSendMessage(abnormalBill,abnormalBillDispose);
//保存到异常计划表
if(Constants.ABNORMAL_QUALITY.equals(abnormalBill.getType())){
@ -845,11 +852,12 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
public void fileUpload(AbnormalBill abnormalBill){
String user = CommonMethods.getUser();
LocalDateTime now = LocalDateTime.now();
String site = CommonMethods.getSite();
List<String> name = Arrays.asList(abnormalBill.getFileName().split(","));
if(name.size() != 0){
UploadPictures uploadPictures = new UploadPictures();
uploadPictures.setHandle("UploadPicturesBO:"+abnormalBill.getSite()+","+abnormalBill.getAbnormalNo()+","+abnormalBill.getStatus());
uploadPictures.setSite(abnormalBill.getSite());
uploadPictures.setSite(site);
uploadPictures.setPicturePath(abnormalBill.getFilePath());
StringBuilder pictureAddress = new StringBuilder();
for (int i = 0; i <= name.size() -1; i++) {
@ -859,7 +867,11 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
pictureAddress.append(abnormalBill.getFilePath()).append("/").append(name.get(i));
}
}
uploadPictures.setStatus(abnormalBill.getStatus());
if("N".equals(abnormalBill.getStatus())){
uploadPictures.setStatus(abnormalBill.getStatus());
}else{
uploadPictures.setStatus("G");
}
uploadPictures.setPictureAddress(pictureAddress.toString());
uploadPictures.setObjectBo(abnormalBill.getHandle());
uploadPictures.setNum(abnormalBill.getFileNum());

Loading…
Cancel
Save