| | |
| | | package org.springblade.mdm.program.service; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import io.netty.util.internal.StringUtil; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | */ |
| | | public List<DncSendBackData> dncSendBackUpload(MultipartFile file) { |
| | | List<DncSendBackData> list; |
| | | if(file == null || file.isEmpty()){ |
| | | throw new ServiceException("文件为空"); |
| | | } |
| | | |
| | | if(!StringUtils.endsWith(file.getOriginalFilename(),".zip")){ |
| | | throw new ServiceException("文件必须为zip包 "); |
| | | } |
| | | try { |
| | | BladeFile bfile = ossTemplate.putFile(file);//上传,供后续入库使用 |
| | | //设置一个缓存,2小时过期 |
| | |
| | | NcNode programPackageNode = ncNodeService.getLastEditionTryingProgramPackage(packageName); |
| | | NcNode curedProgramPkg = ncNodeService.getLastEditionCuredProgramPackage(packageName); |
| | | |
| | | if(programPackageNode!=null && curedProgramPkg != null) {//无固化程序,才放入列表 |
| | | if(programPackageNode!=null && curedProgramPkg == null) {//无固化程序,才放入列表 |
| | | //NcNode programPackageNode = pkgList.get(0); |
| | | progData.setId(programPackageNode.getId()); |
| | | progData.setProgramName(packageName); |