Commit 00980cc9 authored by 宋源硕's avatar 宋源硕

Merge branch 'songyuanshuo' into 'dev'

1.车型审查service层的setDetailsResult方法,如果reviewDetailsResult.getReviewEnterpriseArchiveId()为空,那么返回一个空数组 2.体系审查service层的setDetailsResult方法,如果reviewDetailsResult.getReviewEnterpriseArchiveId()为空,那么返回一个空数组 3.修改体系审查service层的doView(Pending)的代码如果没有整装样品返回为""

See merge request !453
parents e9b2e3c6 6e024c4d
...@@ -214,9 +214,13 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init ...@@ -214,9 +214,13 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
standard.setPassed(null); standard.setPassed(null);
} }
if(reviewDetailsResult != null && reviewDetailsResult.getReviewEnterpriseArchiveId() != null) { if(reviewDetailsResult != null && reviewDetailsResult.getReviewEnterpriseArchiveId() != null) {
if (reviewDetailsResult.getReviewEnterpriseArchiveId().isEmpty()){
reviewDetailsResult.setFileList(new ArrayList<>());
}else {
reviewDetailsResult.setFileList(setFileList(reviewDetailsResult)); reviewDetailsResult.setFileList(setFileList(reviewDetailsResult));
} }
}
details.setResult(reviewDetailsResult); details.setResult(reviewDetailsResult);
} }
} }
......
...@@ -11,6 +11,7 @@ import com.ruoyi.service.*; ...@@ -11,6 +11,7 @@ import com.ruoyi.service.*;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.response.SystemReviewTaskViewResponse; import com.ruoyi.web.response.SystemReviewTaskViewResponse;
import com.ruoyi.web.response.UserNameResponse; import com.ruoyi.web.response.UserNameResponse;
import org.apache.commons.math3.analysis.solvers.MullerSolver;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
...@@ -163,11 +164,14 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask ...@@ -163,11 +164,14 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
// 获取第一个整车样品对应的生产企业 // 获取第一个整车样品对应的生产企业
TaskSampleRelation taskSampleRelation = sampleRelations.get(0); TaskSampleRelation taskSampleRelation = sampleRelations.get(0);
if (!Objects.isNull(taskSampleRelation.getSampleId())){
Sample sample = sampleManagementMapper.selectSampleManagementById(taskSampleRelation.getSampleId()); Sample sample = sampleManagementMapper.selectSampleManagementById(taskSampleRelation.getSampleId());
AutomobileEnterprise automobileEnterprise = automobileEnterpriseMapper.selectAutomobileEnterpriseById(sample.getManufacturingEnterpriseId()); AutomobileEnterprise automobileEnterprise = automobileEnterpriseMapper.selectAutomobileEnterpriseById(sample.getManufacturingEnterpriseId());
systemReviewTask.setEnterpriseName(automobileEnterprise.getEnterpriseName()); systemReviewTask.setEnterpriseName(automobileEnterprise.getEnterpriseName());
}else {
systemReviewTask.setEnterpriseName("");
}
// 构建返回结果 // 构建返回结果
SystemReviewTaskViewResponse response = new SystemReviewTaskViewResponse(); SystemReviewTaskViewResponse response = new SystemReviewTaskViewResponse();
response.setSystemReviewTask(systemReviewTask); response.setSystemReviewTask(systemReviewTask);
...@@ -211,9 +215,12 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask ...@@ -211,9 +215,12 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
standard.setPassed(null); standard.setPassed(null);
} }
if(reviewDetailsResult != null && reviewDetailsResult.getReviewEnterpriseArchiveId() != null) { if(reviewDetailsResult != null && reviewDetailsResult.getReviewEnterpriseArchiveId() != null) {
if (reviewDetailsResult.getReviewEnterpriseArchiveId().isEmpty()){
reviewDetailsResult.setFileList(new ArrayList<>());
}else {
reviewDetailsResult.setFileList(setFileList(reviewDetailsResult)); reviewDetailsResult.setFileList(setFileList(reviewDetailsResult));
} }
}
details.setResult(reviewDetailsResult); details.setResult(reviewDetailsResult);
} }
} }
......
...@@ -17,6 +17,7 @@ import com.ruoyi.web.request.*; ...@@ -17,6 +17,7 @@ import com.ruoyi.web.request.*;
import com.ruoyi.web.response.*; import com.ruoyi.web.response.*;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.poi.openxml4j.util.ZipSecureFile;
import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.skywalking.apm.toolkit.trace.Tag; import org.apache.skywalking.apm.toolkit.trace.Tag;
...@@ -197,6 +198,7 @@ public class TaskController extends BaseController { ...@@ -197,6 +198,7 @@ public class TaskController extends BaseController {
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")}) @Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@PostMapping("/uploadExcel") @PostMapping("/uploadExcel")
public R<Map<String, Object>> uploadExcel(@RequestParam("file") MultipartFile file) throws IOException { public R<Map<String, Object>> uploadExcel(@RequestParam("file") MultipartFile file) throws IOException {
ZipSecureFile.setMinInflateRatio(0.00001);
// 确保文件类型是Excel // 确保文件类型是Excel
if (!file.getOriginalFilename().endsWith(".xlsx") && !file.getOriginalFilename().endsWith(".xls")) { if (!file.getOriginalFilename().endsWith(".xlsx") && !file.getOriginalFilename().endsWith(".xls")) {
throw new IllegalArgumentException("Please upload an Excel file."); throw new IllegalArgumentException("Please upload an Excel file.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment