whycxzp
2022-09-16 ba4df2d373ffd0a1a3536af9a5c44c7af6ef7e48
src/main/java/com/whyc/service/SoftwareService.java
@@ -9,7 +9,6 @@
import com.whyc.dto.FileDirPath;
import com.whyc.dto.Response;
import com.whyc.mapper.SoftwareMapper;
import com.whyc.pojo.AttachLock;
import com.whyc.pojo.DocUser;
import com.whyc.pojo.Software;
import com.whyc.util.ActionUtil;
@@ -81,7 +80,15 @@
        common.setBasedVersion(sheet.getRow(5).getCell(4).getStringCellValue());
        common.setOwner(sheet.getRow(6).getCell(2).getStringCellValue());
        common.setFilingDate(sheet.getRow(6).getCell(4).getStringCellValue());
        Cell cellFilingDate = sheet.getRow(6).getCell(4);
        if(cellFilingDate.getCellType() == Cell.CELL_TYPE_NUMERIC){
            Date dateCellValue = cellFilingDate.getDateCellValue();
            common.setFilingDate(DateUtil.YYYY_MM_DD.format(dateCellValue));
            System.out.println(dateCellValue);
        }else {
            cellFilingDate.setCellType(Cell.CELL_TYPE_STRING);
            common.setFilingDate(cellFilingDate.getStringCellValue());
        }
        //最后一行,取发布说明
        common.setReleaseNotes(sheet.getRow(lastRowNum).getCell(2).getStringCellValue());
@@ -155,7 +162,7 @@
        logService.recordOperationLog(docUser.getId(),docUser.getName(), UserOperation.TYPE_DOWNLOAD.getType(),new Date(),terminalIp,opreationMsg,operationDetail);
    }
    public Response upload(MultipartFile file1, MultipartFile file2, List<Software> softwareList) throws IOException {
    public Response upload(MultipartFile file1, MultipartFile file2, String fontUpdateTime, List<Software> softwareList) throws IOException {
        String file1Name = file1.getOriginalFilename();
        String file2Name = file2.getOriginalFilename();
        Software software = softwareList.get(0);
@@ -183,6 +190,7 @@
        file2.transferTo(new File(softwareDir+File.separator+file2Name));
        //设置路径
        for (Software software1:softwareList){
            software1.setFontUpdateTime(fontUpdateTime);
            software1.setFileUrl(softwareHttpUrl+File.separator+file1Name);
            software1.setExcelUrl(softwareHttpUrl+File.separator+file2Name);
            software1.setCreateTime(date);