| | |
| | | package com.whyc.service; |
| | | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.SopDto; |
| | | import com.whyc.mapper.SOPMapper; |
| | | import com.whyc.pojo.SOP; |
| | | import com.whyc.pojo.SOPFileType; |
| | | import com.whyc.pojo.SOPProduct; |
| | | import com.whyc.pojo.Software; |
| | | import com.whyc.util.ActionUtil; |
| | | import com.whyc.util.CommonUtil; |
| | | import com.whyc.util.DateUtil; |
| | | import com.whyc.util.FileUtil; |
| | | import com.whyc.util.*; |
| | | import org.apache.poi.openxml4j.exceptions.InvalidFormatException; |
| | | import org.apache.poi.ss.usermodel.Cell; |
| | | import org.apache.poi.ss.usermodel.Sheet; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.FileCopyUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.text.ParseException; |
| | |
| | | sop.setReleaseNotes(releaseNotes); |
| | | |
| | | //第10行开始,倒数第2行截止 |
| | | int currentFlag=0; //通用表示(0:非通用,1:通用) |
| | | for (int i = fileSuitableProductIndex+1; i < lastRowNum; i++) { |
| | | SOPProduct product = new SOPProduct(); |
| | | //取第3列,第5列 |
| | |
| | | }else{ |
| | | product.setModel(model); |
| | | } |
| | | |
| | | if((!code.equals("") && !model.equals(""))){ |
| | | currentFlag+=1; |
| | | } |
| | | sopProductList.add(product); |
| | | } |
| | | |
| | | sop.setCurrentFlag(currentFlag>0?0:1);//通用 |
| | | //存储excel文件,/sop_submit/xxx_202306250506.xlsx(改,不存粗excel了) |
| | | /*String originalFilename = multipartFile.getOriginalFilename(); |
| | | String[] fileNameSplit = originalFilename.split("\\."); |
| | |
| | | } |
| | | |
| | | //查询sop信息 |
| | | public Response getSopInfo(List<SopDto> sqlList, String code, String model) { |
| | | public Response getSopInfo(List<SopDto> sqlList, String code, String model,int pageCurr,int pageSize) { |
| | | String sqlStr=" "; |
| | | if(sqlList!=null&&sqlList.size()>0){ |
| | | for (SopDto dto:sqlList) { |
| | |
| | | } |
| | | } |
| | | List<SOP> list=mapper.getSopInfo(sqlStr,code,model); |
| | | return new Response().setII(1,list.size()>0,list,"查询sop信息"); |
| | | PageInfo pageInfo= PageInfoUtils.list2PageInfo(list,pageCurr,pageSize); |
| | | |
| | | return new Response().setII(1,list.size()>0,pageInfo,"查询sop信息"); |
| | | } |
| | | |
| | | //更新sop说明(不含锁信息) |
| | | @Transactional |
| | | public Response updateSop(SOP sop) { |