Commit bc92a558 authored by 宋源硕's avatar 宋源硕

Merge branch 'dev' into 'master'

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

See merge request !454
parents d0ddca7c 00980cc9
......@@ -214,8 +214,12 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
standard.setPassed(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);
}
......
......@@ -11,6 +11,7 @@ import com.ruoyi.service.*;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.response.SystemReviewTaskViewResponse;
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.annotation.Autowired;
import org.springframework.context.ApplicationContext;
......@@ -163,11 +164,14 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
// 获取第一个整车样品对应的生产企业
TaskSampleRelation taskSampleRelation = sampleRelations.get(0);
Sample sample = sampleManagementMapper.selectSampleManagementById(taskSampleRelation.getSampleId());
AutomobileEnterprise automobileEnterprise = automobileEnterpriseMapper.selectAutomobileEnterpriseById(sample.getManufacturingEnterpriseId());
systemReviewTask.setEnterpriseName(automobileEnterprise.getEnterpriseName());
if (!Objects.isNull(taskSampleRelation.getSampleId())){
Sample sample = sampleManagementMapper.selectSampleManagementById(taskSampleRelation.getSampleId());
AutomobileEnterprise automobileEnterprise = automobileEnterpriseMapper.selectAutomobileEnterpriseById(sample.getManufacturingEnterpriseId());
systemReviewTask.setEnterpriseName(automobileEnterprise.getEnterpriseName());
}else {
systemReviewTask.setEnterpriseName("");
}
// 构建返回结果
SystemReviewTaskViewResponse response = new SystemReviewTaskViewResponse();
response.setSystemReviewTask(systemReviewTask);
......@@ -211,8 +215,11 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
standard.setPassed(null);
}
if(reviewDetailsResult != null && reviewDetailsResult.getReviewEnterpriseArchiveId() != null) {
reviewDetailsResult.setFileList(setFileList(reviewDetailsResult));
if (reviewDetailsResult.getReviewEnterpriseArchiveId().isEmpty()){
reviewDetailsResult.setFileList(new ArrayList<>());
}else {
reviewDetailsResult.setFileList(setFileList(reviewDetailsResult));
}
}
details.setResult(reviewDetailsResult);
}
......
......@@ -17,6 +17,7 @@ import com.ruoyi.web.request.*;
import com.ruoyi.web.response.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.openxml4j.util.ZipSecureFile;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.skywalking.apm.toolkit.trace.Tag;
......@@ -197,6 +198,7 @@ public class TaskController extends BaseController {
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@PostMapping("/uploadExcel")
public R<Map<String, Object>> uploadExcel(@RequestParam("file") MultipartFile file) throws IOException {
ZipSecureFile.setMinInflateRatio(0.00001);
// 确保文件类型是Excel
if (!file.getOriginalFilename().endsWith(".xlsx") && !file.getOriginalFilename().endsWith(".xls")) {
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