Commit b3fcc2ad authored by wdy's avatar wdy

Merge branch 'dev' into 'master'

dev - master  31

See merge request !382
parents faa1c2f8 3f776bfc
...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId; ...@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -87,4 +88,8 @@ public class ReviewEnterpriseArchive implements Serializable { ...@@ -87,4 +88,8 @@ public class ReviewEnterpriseArchive implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime; private Date createTime;
@ApiModelProperty("附件")
@TableField(exist = false)
private String[] url;
} }
\ No newline at end of file
...@@ -45,4 +45,9 @@ public interface ReviewEnterpriseArchiveService extends IService<ReviewEnterpris ...@@ -45,4 +45,9 @@ public interface ReviewEnterpriseArchiveService extends IService<ReviewEnterpris
// 导入车企文件 // 导入车企文件
void importEnterprise(List<EnterpriseImportFileVO> list, Long taskId,HttpServletResponse response); void importEnterprise(List<EnterpriseImportFileVO> list, Long taskId,HttpServletResponse response);
/**
* 编辑车企文件
* @param reviewEnterpriseArchive
*/
void editEnterpriseArchive(ReviewEnterpriseArchive reviewEnterpriseArchive);
} }
...@@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.model.LoginUser; ...@@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.domain.ReviewEnterpriseArchive; import com.ruoyi.domain.ReviewEnterpriseArchive;
import com.ruoyi.domain.Task; import com.ruoyi.domain.Task;
import com.ruoyi.domain.vo.EnterpriseImportFileVO; import com.ruoyi.domain.vo.EnterpriseImportFileVO;
...@@ -149,13 +150,20 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp ...@@ -149,13 +150,20 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
if (sum >0 ) { if (sum >0 ) {
throw new ServiceException("新增文件名称重复,请检查", HttpStatus.ERROR); throw new ServiceException("新增文件名称重复,请检查", HttpStatus.ERROR);
} else { } else {
// 将附件地址存入photo字段中
if (reviewEnterpriseArchive.getUrl() != null && reviewEnterpriseArchive.getUrl().length != 0) {
String joinUrl = StringUtils.join(reviewEnterpriseArchive.getUrl(),",");
reviewEnterpriseArchive.setPhoto(joinUrl);
}
reviewEnterpriseArchiveService.save(reviewEnterpriseArchive); reviewEnterpriseArchiveService.save(reviewEnterpriseArchive);
ReviewEnterpriseArchiveFindByTaskIdRequest request = new ReviewEnterpriseArchiveFindByTaskIdRequest(); ReviewEnterpriseArchiveFindByTaskIdRequest request = new ReviewEnterpriseArchiveFindByTaskIdRequest();
request.setTaskId(reviewEnterpriseArchive.getTaskId()); request.setTaskId(reviewEnterpriseArchive.getTaskId());
// 根据任务id查询任务底下的所有车企文件
List<ReviewEnterpriseArchive> list = reviewEnterpriseArchiveMapper.findEnterpriseArchiveByTaskId(request); List<ReviewEnterpriseArchive> list = reviewEnterpriseArchiveMapper.findEnterpriseArchiveByTaskId(request);
if (list != null && list.size() != 0) { if (list != null && list.size() != 0) {
for (ReviewEnterpriseArchive archive : list) { for (ReviewEnterpriseArchive archive : list) {
// 如果库里的企业名称不是新增时传入的企业名称则修改
if (!Objects.equals(archive.getEnterpriseName(), reviewEnterpriseArchive.getEnterpriseName())) { if (!Objects.equals(archive.getEnterpriseName(), reviewEnterpriseArchive.getEnterpriseName())) {
archive.setEnterpriseName(reviewEnterpriseArchive.getEnterpriseName()); archive.setEnterpriseName(reviewEnterpriseArchive.getEnterpriseName());
} }
...@@ -176,7 +184,9 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp ...@@ -176,7 +184,9 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
@Override @Override
public ReviewEnterpriseArchive getInfo(ReviewEnterpriseArchiveGetInfoRequest request) { public ReviewEnterpriseArchive getInfo(ReviewEnterpriseArchiveGetInfoRequest request) {
return reviewEnterpriseArchiveMapper.selectById(request.getId()); ReviewEnterpriseArchive reviewEnterpriseArchive = reviewEnterpriseArchiveMapper.selectById(request.getId());
reviewEnterpriseArchive.setUrl(reviewEnterpriseArchive.getPhoto().split(","));
return reviewEnterpriseArchive;
} }
...@@ -237,6 +247,16 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp ...@@ -237,6 +247,16 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
} }
reviewEnterpriseArchiveMapper.insertEnterprise(list); reviewEnterpriseArchiveMapper.insertEnterprise(list);
} }
@Override
public void editEnterpriseArchive(ReviewEnterpriseArchive reviewEnterpriseArchive) {
// 将附件地址存入photo字段中
if (reviewEnterpriseArchive.getUrl() != null && reviewEnterpriseArchive.getUrl().length != 0) {
String joinUrl = StringUtils.join(reviewEnterpriseArchive.getUrl(),",");
reviewEnterpriseArchive.setPhoto(joinUrl);
}
reviewEnterpriseArchiveService.updateById(reviewEnterpriseArchive);
}
} }
......
...@@ -9,7 +9,11 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -9,7 +9,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
@Transactional @Transactional
...@@ -21,6 +25,23 @@ public class StandardInspectionItemRelationServiceImpl extends ServiceImpl<Stand ...@@ -21,6 +25,23 @@ public class StandardInspectionItemRelationServiceImpl extends ServiceImpl<Stand
@Override @Override
public List<DictDataVO> getByStandardId(Long standardId) { public List<DictDataVO> getByStandardId(Long standardId) {
return standardInspectionItemRelationMapper.getListByStandardId(standardId); List<DictDataVO> list = standardInspectionItemRelationMapper.getListByStandardId(standardId);
// 定义期望的排序关键字
List<String> desiredOrder = Arrays.asList("sraif", "grfis", "trfis");
// 使用流API对list进行排序
List<DictDataVO> sortedList = new ArrayList<>();
// 首先,创建一个映射表,键为dictValue,值为DictDataVO对象
Map<String, DictDataVO> map = list.stream().collect(Collectors.toMap(DictDataVO::getDictValue, vo -> vo));
// 然后,根据desiredOrder中的顺序从映射表中提取元素
for (String order : desiredOrder) {
if (map.containsKey(order)) {
sortedList.add(map.get(order));
}
}
return sortedList;
} }
} }
...@@ -83,7 +83,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR ...@@ -83,7 +83,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
testRecords.setUsecase(caseResultVO.getName()); testRecords.setUsecase(caseResultVO.getName());
testRecords.setUsecaseId(caseResultVO.getId()); testRecords.setUsecaseId(caseResultVO.getId());
testRecords.setDescription(caseResultVO.getDescription()); testRecords.setDescription(caseResultVO.getDescription());
testRecords.setRiskLevel(caseResultVO.getRisk_level()); testRecords.setRiskLevel(caseResultVO.getRisk_level() + " risk");
testRecords.setTestResult(caseResultVO.getStatus()); testRecords.setTestResult(caseResultVO.getStatus());
testRecords.setRemediation(caseResultVO.getRemediation()); testRecords.setRemediation(caseResultVO.getRemediation());
testRecords.setUsecaseNo(caseResultVO.getSerial_number()); testRecords.setUsecaseNo(caseResultVO.getSerial_number());
...@@ -169,7 +169,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR ...@@ -169,7 +169,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
testRecords.setUsecase(caseResultVO.getName()); testRecords.setUsecase(caseResultVO.getName());
testRecords.setUsecaseId(caseResultVO.getId()); testRecords.setUsecaseId(caseResultVO.getId());
testRecords.setDescription(caseResultVO.getDescription()); testRecords.setDescription(caseResultVO.getDescription());
testRecords.setRiskLevel(caseResultVO.getRisk_level()); testRecords.setRiskLevel(caseResultVO.getRisk_level() + " risk");
testRecords.setTestResult(caseResultVO.getStatus()); testRecords.setTestResult(caseResultVO.getStatus());
testRecords.setRemediation(caseResultVO.getRemediation()); testRecords.setRemediation(caseResultVO.getRemediation());
testRecords.setUsecaseNo(caseResultVO.getSerial_number()); testRecords.setUsecaseNo(caseResultVO.getSerial_number());
......
...@@ -93,7 +93,7 @@ public class ReviewEnterpriseArchiveController extends BaseController { ...@@ -93,7 +93,7 @@ public class ReviewEnterpriseArchiveController extends BaseController {
@Log(title = "编辑车企文件", businessType = BusinessType.UPDATE) @Log(title = "编辑车企文件", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/edit") @RequestMapping(method = RequestMethod.POST, value = "/edit")
public R<String> editEnterpriseArchive(@Validated @RequestBody ReviewEnterpriseArchive reviewEnterpriseArchive) { public R<String> editEnterpriseArchive(@Validated @RequestBody ReviewEnterpriseArchive reviewEnterpriseArchive) {
reviewEnterpriseArchiveService.updateById(reviewEnterpriseArchive); reviewEnterpriseArchiveService.editEnterpriseArchive(reviewEnterpriseArchive);
return R.ok(); return R.ok();
} }
......
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