| | |
| | | import com.dy.pmsGlobal.pojoOth.OthFile; |
| | | import com.dy.pmsGlobal.pojoPlt.PltProduct; |
| | | import com.dy.pmsGlobal.pojoPlt.PltProductFile; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.dubbo.common.utils.PojoUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | if(param.id !=null){ |
| | | paramDao.updateByPrimaryKeySelective(param); |
| | | }else{ |
| | | param.deleted=false; |
| | | paramDao.insert(param); |
| | | } |
| | | }); |
| | | saveRel(p, p.processDocuments, "01"); |
| | | saveRel(p, p.userManual, "02"); |
| | | saveRel(p, p.materials, "03"); |
| | | saveRel(p, p.proFiles); |
| | | } |
| | | |
| | | private void saveRel(PltProduct p, List<PltProductFile> docs, String fileType) { |
| | | private void saveRel(PltProduct p, List<PltProductFile> docs) { |
| | | docs.forEach(doc -> { |
| | | doc.proId = p.id; |
| | | doc.fileType = fileType; |
| | | pfDao.insert(doc); |
| | | if(doc.id == null){ |
| | | doc.proId = p.id; |
| | | pfDao.insertSelective(doc); |
| | | } |
| | | }); |
| | | } |
| | | |
| | |
| | | pro.imageWebPathZip = fileOperate.getImgFileZipPath(filePathWithWebUrl); |
| | | } |
| | | |
| | | Stream.concat( |
| | | pro.userManual.stream(), |
| | | Stream.concat(pro.processDocuments.stream(), pro.materials.stream()) |
| | | ) |
| | | .forEach(doc -> { |
| | | String webUrl = getFilePathWithWebUrl(doc.fileId); |
| | | doc.webUrl = webUrl; |
| | | pro.proFiles.stream().forEach(doc -> { |
| | | OthFile file = othFileMapper.selectByPrimaryKey(doc.fileId); |
| | | FileRestVo fileRestVo = fileOperate.parseHashcode(fmUrl, file.hash); |
| | | |
| | | doc.webUrl = fileRestVo.fileWebUrl + file.filePath; |
| | | doc.orgName = file.orgName; |
| | | doc.extName = file.extName; |
| | | }); |
| | | } |
| | | return pro; |
| | |
| | | } |
| | | |
| | | |
| | | public void downloadDoc(HttpServletResponse response) { |
| | | PltProduct pro=dao.selectByPrimaryKey(Long.valueOf(1)); |
| | | } |
| | | } |