图片上传修改

master
赵嘉伟 3 years ago
parent d1e0b7e9a9
commit fc9a83b310

@ -8,6 +8,7 @@ import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDisposeDto;
import com.foreverwin.mesnac.anomaly.dto.AbnormalBillDto;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalBillDisposeMapper;
import com.foreverwin.mesnac.anomaly.mapper.AbnormalBillMapper;
import com.foreverwin.mesnac.anomaly.mapper.UploadPicturesMapper;
import com.foreverwin.mesnac.anomaly.model.AbnormalBill;
import com.foreverwin.mesnac.anomaly.model.AbnormalBillDispose;
import com.foreverwin.mesnac.anomaly.model.AbnormalNcCode;
@ -181,6 +182,9 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
@Autowired
private WorkCenterMapper workCenterMapper;
@Autowired
private UploadPicturesMapper uploadPicturesMapper;
@Override
public IPage<AbnormalBill> selectPage(FrontPage<AbnormalBill> frontPage, AbnormalBill abnormalBill) {
@ -614,8 +618,10 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
if(!StringUtil.isBlank(abnormalBill.getFileName())){
//放置图片,新建状态
this.fileUpload(abnormalBill);
}else{
uploadPicturesMapper.deleteById("UploadPicturesBO:"+abnormalBill.getSite()+","+abnormalBill.getAbnormalNo()+","+"N");
//UploadPicturesBO:"+abnormalBill.getSite()+","+abnormalBill.getAbnormalNo()+","+status
}
// this.anomalyCreatedAndSendMessage(abnormalBill,abnormalBillDispose);
//保存到异常计划表
if(Constants.ABNORMAL_QUALITY.equals(abnormalBill.getType())){
@ -624,7 +630,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
this.saveOrUpdate(abnormalBill);
abnormalBillDisposeService.saveOrUpdate(abnormalBillDispose);
}
@ -853,10 +858,11 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
String user = CommonMethods.getUser();
LocalDateTime now = LocalDateTime.now();
String site = CommonMethods.getSite();
String status = "N".equals(abnormalBill.getStatus()) ? "N" : "G";
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.setHandle("UploadPicturesBO:"+site+","+abnormalBill.getAbnormalNo()+","+status);
uploadPictures.setSite(site);
uploadPictures.setPicturePath(abnormalBill.getFilePath());
StringBuilder pictureAddress = new StringBuilder();
@ -867,11 +873,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
pictureAddress.append(abnormalBill.getFilePath()).append("/").append(name.get(i));
}
}
if("N".equals(abnormalBill.getStatus())){
uploadPictures.setStatus(abnormalBill.getStatus());
}else{
uploadPictures.setStatus("G");
}
uploadPictures.setStatus(abnormalBill.getStatus());
uploadPictures.setPictureAddress(pictureAddress.toString());
uploadPictures.setObjectBo(abnormalBill.getHandle());
uploadPictures.setNum(abnormalBill.getFileNum());

Loading…
Cancel
Save