Commit 1a28f043 authored by wdy's avatar wdy

Merge branch 'dev' into 'master'

dev - master 11

See merge request !326
parents b66748d5 06c02c5c
package com.ruoyi.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
@ApiModel(value = "StandardInspectionItemRelation", description = "标准-检验项关系")
@TableName(value ="t_standard_inspection_item_relation", autoResultMap = true)
@Accessors(chain = true)
@Data
public class StandardInspectionItemRelation {
@ApiModelProperty("主键")
@TableId(type = IdType.ASSIGN_ID)
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
/**
* 标准id
*/
@ApiModelProperty("标准id")
private Long standardId;
/**
* 检验项id
*/
@ApiModelProperty("检验项id")
private Long dictCode;
}
package com.ruoyi.domain.vo;
import lombok.Data;
@Data
public class DictDataVO {
private Long dictCode;
}
package com.ruoyi.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.domain.StandardInspectionItemRelation;
import com.ruoyi.domain.vo.DictDataVO;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface StandardInspectionItemRelationMapper extends BaseMapper<StandardInspectionItemRelation> {
List<DictDataVO> getListByStandardId(Long standardId);
/**
* 根据标准id获取列表
* @param standardId
* @return
*/
List<StandardInspectionItemRelation> getListByStandard(Long standardId);
}
package com.ruoyi.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.StandardInspectionItemRelation;
import com.ruoyi.domain.vo.DictDataVO;
import java.util.List;
public interface StandardInspectionItemRelationService extends IService<StandardInspectionItemRelation> {
List<DictDataVO> getByStandardId(Long standardId);
}
...@@ -5,6 +5,7 @@ import com.ruoyi.domain.Standard; ...@@ -5,6 +5,7 @@ import com.ruoyi.domain.Standard;
import com.ruoyi.web.request.StandardEditRequest; import com.ruoyi.web.request.StandardEditRequest;
import com.ruoyi.web.request.StandardGetInfoRequest; import com.ruoyi.web.request.StandardGetInfoRequest;
import com.ruoyi.web.request.StandardListRequest; import com.ruoyi.web.request.StandardListRequest;
import com.ruoyi.web.response.StandardResponse;
import java.util.List; import java.util.List;
...@@ -21,5 +22,5 @@ public interface StandardService extends IService<Standard> { ...@@ -21,5 +22,5 @@ public interface StandardService extends IService<Standard> {
void editStandard(StandardEditRequest request); void editStandard(StandardEditRequest request);
Standard getInfo(StandardGetInfoRequest request); StandardResponse getInfo(StandardGetInfoRequest request);
} }
...@@ -3,6 +3,7 @@ package com.ruoyi.service; ...@@ -3,6 +3,7 @@ package com.ruoyi.service;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.domain.TestUseCase; import com.ruoyi.domain.TestUseCase;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.vo.UseCaseUrlVO;
import com.ruoyi.web.request.TestUseCaseByScenarioRequest; import com.ruoyi.web.request.TestUseCaseByScenarioRequest;
import com.ruoyi.web.request.TestUseCaseIdListRequest; import com.ruoyi.web.request.TestUseCaseIdListRequest;
import com.ruoyi.web.request.TestUserCaseRequest; import com.ruoyi.web.request.TestUserCaseRequest;
...@@ -64,4 +65,12 @@ public interface TestUseCaseService extends IService<TestUseCase> { ...@@ -64,4 +65,12 @@ public interface TestUseCaseService extends IService<TestUseCase> {
* @throws IOException * @throws IOException
*/ */
UseCaseResponse getUseCaseMsg(String request) throws IOException; UseCaseResponse getUseCaseMsg(String request) throws IOException;
/**
* 科恩根据章节查询用例列表
* @param request
* @return
* @throws IOException
*/
List<UseCaseUrlVO> getUseCaseByChapter(String request) throws IOException;
} }
...@@ -359,28 +359,30 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe ...@@ -359,28 +359,30 @@ public class PdfTemplateManagementServiceImpl implements PdfTemplateManagementSe
PdfPTable pictureTable = new PdfPTable(new float[]{25, 25, 25, 25}); PdfPTable pictureTable = new PdfPTable(new float[]{25, 25, 25, 25});
pictureTable.setWidthPercentage(90); pictureTable.setWidthPercentage(90);
pictureTable.setSpacingBefore(10); pictureTable.setSpacingBefore(10);
List<String> pictureList = Arrays.stream(samplePhoto.split(",")).filter(StringUtils::isNotBlank).collect(Collectors.toList()); if (samplePhoto != null) {
int result = pictureList.size(); List<String> pictureList = Arrays.stream(samplePhoto.split(",")).filter(StringUtils::isNotBlank).collect(Collectors.toList());
while (result % 4 != 0) { int result = pictureList.size();
result++; while (result % 4 != 0) {
} result++;
for (int i = 0; i < result; i++) { }
PdfPCell cell = new PdfPCell(); for (int i = 0; i < result; i++) {
cell.setBorder(Rectangle.NO_BORDER); PdfPCell cell = new PdfPCell();
Optional<String> optionalElement = i < pictureList.size() cell.setBorder(Rectangle.NO_BORDER);
? Optional.of(pictureList.get(i)) Optional<String> optionalElement = i < pictureList.size()
: Optional.empty(); ? Optional.of(pictureList.get(i))
if (optionalElement.isPresent() && StrUtil.isNotEmpty(optionalElement.get())) { : Optional.empty();
Image image = Image.getInstance(new URL((minioEndpoint + optionalElement.get()).replace(" ", "%20"))); if (optionalElement.isPresent() && StrUtil.isNotEmpty(optionalElement.get())) {
image.scaleAbsolute(100, 100); Image image = Image.getInstance(new URL((minioEndpoint + optionalElement.get()).replace(" ", "%20")));
cell.addElement(image); image.scaleAbsolute(100, 100);
} else { cell.addElement(image);
Paragraph paragraph = new Paragraph(); } else {
cell.addElement(paragraph); Paragraph paragraph = new Paragraph();
cell.addElement(paragraph);
}
pictureTable.addCell(cell);
} }
pictureTable.addCell(cell); document.addContent(pictureTable);
} }
document.addContent(pictureTable);
} }
/** /**
......
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.domain.StandardInspectionItemRelation;
import com.ruoyi.domain.vo.DictDataVO;
import com.ruoyi.mapper.StandardInspectionItemRelationMapper;
import com.ruoyi.service.StandardInspectionItemRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Transactional
@Service
public class StandardInspectionItemRelationServiceImpl extends ServiceImpl<StandardInspectionItemRelationMapper, StandardInspectionItemRelation> implements StandardInspectionItemRelationService {
@Autowired
private StandardInspectionItemRelationMapper standardInspectionItemRelationMapper;
@Override
public List<DictDataVO> getByStandardId(Long standardId) {
return standardInspectionItemRelationMapper.getListByStandardId(standardId);
}
}
...@@ -3,14 +3,20 @@ package com.ruoyi.service.impl; ...@@ -3,14 +3,20 @@ package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.domain.Standard; import com.ruoyi.domain.Standard;
import com.ruoyi.domain.StandardInspectionItemRelation;
import com.ruoyi.domain.vo.DictDataVO;
import com.ruoyi.mapper.StandardInspectionItemRelationMapper;
import com.ruoyi.mapper.StandardMapper; import com.ruoyi.mapper.StandardMapper;
import com.ruoyi.service.StandardInspectionItemRelationService;
import com.ruoyi.service.StandardService; import com.ruoyi.service.StandardService;
import com.ruoyi.web.request.StandardEditRequest; import com.ruoyi.web.request.StandardEditRequest;
import com.ruoyi.web.request.StandardGetInfoRequest; import com.ruoyi.web.request.StandardGetInfoRequest;
import com.ruoyi.web.request.StandardListRequest; import com.ruoyi.web.request.StandardListRequest;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.web.response.StandardResponse;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Service @Service
...@@ -22,6 +28,12 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i ...@@ -22,6 +28,12 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
@Autowired @Autowired
private StandardService standardService; private StandardService standardService;
@Autowired
private StandardInspectionItemRelationMapper standardInspectionItemRelationMapper;
@Autowired
private StandardInspectionItemRelationService standardInspectionItemRelationService;
/** /**
* 分页查询 * 分页查询
* @param * @param
...@@ -47,11 +59,36 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i ...@@ -47,11 +59,36 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
Standard standard = new Standard(); Standard standard = new Standard();
BeanUtils.copyBeanProp(standard, request); BeanUtils.copyBeanProp(standard, request);
List<StandardInspectionItemRelation> list = standardInspectionItemRelationMapper.getListByStandard(request.getId());
if (list != null && list.size() != 0) {
standardInspectionItemRelationService.removeBatchByIds(list);
}
List<DictDataVO> relations = request.getDictList();
List<StandardInspectionItemRelation> relationList = new ArrayList<>();
if (relations != null && relations.size() != 0) {
for (DictDataVO vo : relations) {
StandardInspectionItemRelation relation = new StandardInspectionItemRelation();
relation.setStandardId(request.getId());
relation.setDictCode(vo.getDictCode());
relationList.add(relation);
}
standardInspectionItemRelationService.saveBatch(relationList);
}
standardService.updateById(standard); standardService.updateById(standard);
} }
@Override @Override
public Standard getInfo(StandardGetInfoRequest request) { public StandardResponse getInfo(StandardGetInfoRequest request) {
return standardMapper.selectById(request.getId()); StandardResponse response = new StandardResponse();
Standard standard = standardMapper.selectById(request.getId());
List<DictDataVO> list = standardInspectionItemRelationMapper.getListByStandardId(request.getId());
BeanUtils.copyBeanProp(response, standard);
response.setDictList(list);
return response;
} }
} }
...@@ -2,11 +2,13 @@ package com.ruoyi.service.impl; ...@@ -2,11 +2,13 @@ package com.ruoyi.service.impl;
import com.ruoyi.common.DataStatisticsUtils; import com.ruoyi.common.DataStatisticsUtils;
import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.domain.*; import com.ruoyi.domain.*;
import com.ruoyi.domain.vo.ReviewEnterpriseArchiveFileVO; import com.ruoyi.domain.vo.ReviewEnterpriseArchiveFileVO;
import com.ruoyi.mapper.*; import com.ruoyi.mapper.*;
import com.ruoyi.service.*; import com.ruoyi.service.*;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.response.CarReviewTaskViewResponse; import com.ruoyi.web.response.CarReviewTaskViewResponse;
import com.ruoyi.web.response.UserNameResponse; import com.ruoyi.web.response.UserNameResponse;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
...@@ -79,6 +81,9 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init ...@@ -79,6 +81,9 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
@Autowired @Autowired
private AutomobileEnterpriseMapper automobileEnterpriseMapper; private AutomobileEnterpriseMapper automobileEnterpriseMapper;
@Autowired
private ISysUserService sysUserService;
// PENDING状态下 // PENDING状态下
// 1.standard字段查询当前最新问卷 // 1.standard字段查询当前最新问卷
// 2.查询场景变更任务 // 2.查询场景变更任务
...@@ -145,12 +150,17 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init ...@@ -145,12 +150,17 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
// 4. 修改任务状态为 SIGNED 待签字 // 4. 修改任务状态为 SIGNED 待签字
carReviewTask.setTaskStatus(CarReviewTask.TASK_STATUS_SIGNED); carReviewTask.setTaskStatus(CarReviewTask.TASK_STATUS_SIGNED);
// 7. 设置问卷结果 // 5. 设置问卷结果
if (reviewDetailsResultMapper.findNotPass(carReviewTask.getId()) > 0) { if (reviewDetailsResultMapper.findNotPass(carReviewTask.getId()) > 0) {
carReviewTask.setTaskResult("REJECT"); carReviewTask.setTaskResult("REJECT");
} else { } else {
carReviewTask.setTaskResult("PASS"); carReviewTask.setTaskResult("PASS");
} }
// 6. 设置签字图片
SysUser sysUser = sysUserService.selectUserById(carReviewTask.getLeaderId());
carReviewTask.setImagesUrl(sysUser.getSignaturePicture());
carReviewTaskMapper.updateById(carReviewTask); carReviewTaskMapper.updateById(carReviewTask);
} }
} }
......
...@@ -202,8 +202,10 @@ public class StrategyModelTestTaskNew implements StrategyModelTestTask, Initiali ...@@ -202,8 +202,10 @@ public class StrategyModelTestTaskNew implements StrategyModelTestTask, Initiali
} }
// 测试通过率 // 测试通过率
BigDecimal num = new BigDecimal(((double) response.getTestPassNum() / response.getUseCaseNum()) * 100); if (response.getTestPassNum() != null) {
response.setTestPass(num.setScale(1,BigDecimal.ROUND_UP).doubleValue()); BigDecimal num = new BigDecimal(((double) response.getTestPassNum() / response.getUseCaseNum()) * 100);
response.setTestPass(num.setScale(1,BigDecimal.ROUND_UP).doubleValue());
}
} }
......
...@@ -4,11 +4,13 @@ import cn.hutool.core.collection.CollUtil; ...@@ -4,11 +4,13 @@ import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.domain.ModelTestTask; import com.ruoyi.domain.ModelTestTask;
import com.ruoyi.mapper.ModelTestTaskMapper; import com.ruoyi.mapper.ModelTestTaskMapper;
import com.ruoyi.service.StrategyModelTestTask; import com.ruoyi.service.StrategyModelTestTask;
import com.ruoyi.service.TestUseCaseService; import com.ruoyi.service.TestUseCaseService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.response.ModelTestResponse; import com.ruoyi.web.response.ModelTestResponse;
import com.ruoyi.web.response.ModelTestUrlResponse; import com.ruoyi.web.response.ModelTestUrlResponse;
import lombok.Data; import lombok.Data;
...@@ -42,6 +44,9 @@ public class StrategyModelTestTaskPending implements StrategyModelTestTask, Init ...@@ -42,6 +44,9 @@ public class StrategyModelTestTaskPending implements StrategyModelTestTask, Init
@Autowired @Autowired
private TestUseCaseService testUseCaseService; private TestUseCaseService testUseCaseService;
@Autowired
private ISysUserService sysUserService;
private static String url = "https://10.12.48.78:8090/DescribeProjectTestResult"; private static String url = "https://10.12.48.78:8090/DescribeProjectTestResult";
@Override @Override
...@@ -78,12 +83,15 @@ public class StrategyModelTestTaskPending implements StrategyModelTestTask, Init ...@@ -78,12 +83,15 @@ public class StrategyModelTestTaskPending implements StrategyModelTestTask, Init
} }
// 进行中的任务, 点击返回后, 判断当前用例完成程度, 用例都完成后状态改为待签字 // 进行中的任务, 点击返回后, 判断当前用例完成程度, 用例都完成后状态改为待签字
if (sumCount.equals(currentCount.get())) { if (sumCount.equals(currentCount.get())) {
SysUser sysUser = sysUserService.selectUserById(modelTestTask.getLeaderId());
modelTestTaskMapper.update(new ModelTestTask(), modelTestTaskMapper.update(new ModelTestTask(),
new LambdaUpdateWrapper<ModelTestTask>() new LambdaUpdateWrapper<ModelTestTask>()
.set(ModelTestTask::getTaskEndTime, new Date()) .set(ModelTestTask::getTaskEndTime, new Date())
.set(ModelTestTask::getTaskStatus, ModelTestTask.TASK_STATUS_SIGNED) .set(ModelTestTask::getTaskStatus, ModelTestTask.TASK_STATUS_SIGNED)
.set(failedCount.get() > 0, ModelTestTask::getTaskResult, ModelTestTask.TASK_STATUS_REJECT) .set(failedCount.get() > 0, ModelTestTask::getTaskResult, ModelTestTask.TASK_STATUS_REJECT)
.set(failedCount.get().equals(0), ModelTestTask::getTaskResult, ModelTestTask.TASK_STATUS_PASS) .set(failedCount.get().equals(0), ModelTestTask::getTaskResult, ModelTestTask.TASK_STATUS_PASS)
.set(ModelTestTask::getImagesUrl,sysUser.getSignaturePicture())
.eq(ModelTestTask::getId, modelTestTask.getId())); .eq(ModelTestTask::getId, modelTestTask.getId()));
} }
} }
......
...@@ -65,26 +65,21 @@ public class StrategyModelTestTaskSigned implements StrategyModelTestTask, Initi ...@@ -65,26 +65,21 @@ public class StrategyModelTestTaskSigned implements StrategyModelTestTask, Initi
@Override @Override
public void doSubmitTest(ModelTestTask modelTestTask, List<String> imagesUrl) { public void doSubmitTest(ModelTestTask modelTestTask, List<String> imagesUrl) {
SysUser user = SecurityUtils.getLoginUser().getUser(); SysUser user = SecurityUtils.getLoginUser().getUser();
if (imagesUrl != null && imagesUrl.size() != 0) { modelTestTaskMapper.update(new ModelTestTask(),
modelTestTaskMapper.update(new ModelTestTask(), new LambdaUpdateWrapper<ModelTestTask>()
new LambdaUpdateWrapper<ModelTestTask>() .set(ModelTestTask::getTaskStatus, ModelTestTask.TASK_STATUS_FINISH)
.set(ModelTestTask::getTaskStatus, ModelTestTask.TASK_STATUS_FINISH) .set(ModelTestTask::getTaskEndTime, new Date())
.set(ModelTestTask::getTaskEndTime, new Date()) .set(ModelTestTask::getSubmitId, user.getUserId())
.set(ModelTestTask::getSubmitId, user.getUserId()) .set(ModelTestTask::getSubmitName, user.getNickName())
.set(ModelTestTask::getSubmitName, user.getNickName()) .set(ModelTestTask::getImagesUrl, StringUtils.join(imagesUrl, ","))
.set(ModelTestTask::getImagesUrl, StringUtils.join(imagesUrl, ",")) .eq(ModelTestTask::getId, modelTestTask.getId()));
.eq(ModelTestTask::getId, modelTestTask.getId())); // 改总任务状态
// 改总任务状态 // 通过modelId查询总任务ID
// 通过modelId查询总任务ID List<Task> taskList = taskMapper.selectList(new QueryWrapper<Task>().eq("model_test_task_id", modelTestTask.getId()));
List<Task> taskList = taskMapper.selectList(new QueryWrapper<Task>().eq("model_test_task_id", modelTestTask.getId())); if (CollUtil.isNotEmpty(taskList)) {
if (CollUtil.isNotEmpty(taskList)) { Task task = taskList.get(0);
Task task = taskList.get(0); taskStateFacade.doSubmit(task);
taskStateFacade.doSubmit(task);
}
} else {
throw new ServiceException("请提交签字图片", HttpStatus.ERROR);
} }
} }
@Override @Override
......
...@@ -2,11 +2,13 @@ package com.ruoyi.service.impl; ...@@ -2,11 +2,13 @@ package com.ruoyi.service.impl;
import com.ruoyi.common.DataStatisticsUtils; import com.ruoyi.common.DataStatisticsUtils;
import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.domain.*; import com.ruoyi.domain.*;
import com.ruoyi.domain.vo.ReviewEnterpriseArchiveFileVO; import com.ruoyi.domain.vo.ReviewEnterpriseArchiveFileVO;
import com.ruoyi.mapper.*; import com.ruoyi.mapper.*;
import com.ruoyi.service.*; import com.ruoyi.service.*;
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.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
...@@ -68,6 +70,9 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask ...@@ -68,6 +70,9 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
@Autowired @Autowired
private AutomobileEnterpriseMapper automobileEnterpriseMapper; private AutomobileEnterpriseMapper automobileEnterpriseMapper;
@Autowired
private ISysUserService sysUserService;
@Override @Override
public void doStart(SystemReviewTask systemReviewTask) { public void doStart(SystemReviewTask systemReviewTask) {
throw new ServiceException("不能开始一个已经开始的任务", HttpStatus.ERROR); throw new ServiceException("不能开始一个已经开始的任务", HttpStatus.ERROR);
...@@ -114,6 +119,11 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask ...@@ -114,6 +119,11 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
} else { } else {
systemReviewTask.setTaskResult("PASS"); systemReviewTask.setTaskResult("PASS");
} }
// 6. 设置签字图片
SysUser sysUser = sysUserService.selectUserById(systemReviewTask.getLeaderId());
systemReviewTask.setImagesUrl(sysUser.getSignaturePicture());
systemReviewTaskMapper.updateById(systemReviewTask); systemReviewTaskMapper.updateById(systemReviewTask);
} }
} }
......
...@@ -108,7 +108,7 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU ...@@ -108,7 +108,7 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
MediaType mediaType = MediaType.parse("application/json"); MediaType mediaType = MediaType.parse("application/json");
// 创建请求体 // 创建请求体
RequestBody body = RequestBody.create(mediaType, "{\"query\":\"query useCases($offset:OffsetConnectionInput$orderBy:OrderByInput$filter:Map$search:String){useCases(offset:$offset orderBy:$orderBy filterFields:$filter search:$search){nodes{id displayID class name description remediation requirements riskLevel method{name}scenario{name}}totalCount}}\",\"variables\":"+ request +"}"); RequestBody body = RequestBody.create(mediaType, "{\"query\":\"query useCases($offset:OffsetConnectionInput$orderBy:OrderByInput$filter:Map$search:String$searchFields:Map){useCases(offset:$offset orderBy:$orderBy filterFields:$filter search:$search searchFields:$searchFields){nodes{id displayID class name description remediation requirements riskLevel method{name}scenario{name}}totalCount}}\",\"variables\":"+ request +"}");
Request requestKE = new Request.Builder() Request requestKE = new Request.Builder()
.url("http://10.12.48.80:8089/api/query") .url("http://10.12.48.80:8089/api/query")
...@@ -185,6 +185,45 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU ...@@ -185,6 +185,45 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
return caseResponse; return caseResponse;
} }
/**
* 科恩根据章节查询用例列表
* @param request
* @return
* @throws IOException
*/
@Override
public List<UseCaseUrlVO> getUseCaseByChapter(String request) throws IOException {
OkHttpClient client = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"query\":\"query regulationItemDetail($regulationItemID:ID!){node(id:$regulationItemID){...on RegulationItem{id serialNumber testMethod requirements useCases{id displayID name description scenario{name}method{name}}}}}\",\"variables\":"+request+"}");
Request requestKE = new Request.Builder()
.url("http://10.12.48.80:8089/api/query")
.method("POST", body)
.addHeader("Content-Type", "application/json")
// TODO 连接
// .addHeader("Host", "10.12.48.80:8089")
// .addHeader("Origin", "http://10.12.48.80:8089")
// .addHeader("Referer", "http://10.12.48.80:8089/api/graphql/playground")
// .addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36")
.build();
Response response = client.newCall(requestKE).execute();
String string = response.body().string();
JSONObject jsonObject = JSONObject.parseObject(string);
// 获取测试用例
List<UseCaseUrlVO> list = new ArrayList<>();
if (jsonObject.getJSONObject("data").getJSONObject("node") != null) {
list = jsonObject.getJSONObject("data").getJSONObject("node").getList("useCases", UseCaseUrlVO.class);
}
return list;
}
} }
......
...@@ -7,10 +7,11 @@ import com.ruoyi.common.core.domain.R; ...@@ -7,10 +7,11 @@ import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.domain.Standard; import com.ruoyi.domain.Standard;
import com.ruoyi.domain.vo.DictDataVO;
import com.ruoyi.service.StandardInspectionItemRelationService;
import com.ruoyi.service.StandardService; import com.ruoyi.service.StandardService;
import com.ruoyi.web.request.*; import com.ruoyi.web.request.*;
import com.ruoyi.web.response.ReviewSceneChangeTaskResponse; import com.ruoyi.web.response.StandardResponse;
import com.ruoyi.web.response.TaskGetInfoResponse;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.skywalking.apm.toolkit.trace.Tag; import org.apache.skywalking.apm.toolkit.trace.Tag;
...@@ -31,6 +32,9 @@ public class StandardController extends BaseController { ...@@ -31,6 +32,9 @@ public class StandardController extends BaseController {
@Autowired @Autowired
private StandardService standardService; private StandardService standardService;
@Autowired
private StandardInspectionItemRelationService standardInspectionItemRelationService;
/** /**
* 分页查询 * 分页查询
* @return * @return
...@@ -58,9 +62,18 @@ public class StandardController extends BaseController { ...@@ -58,9 +62,18 @@ public class StandardController extends BaseController {
@Trace @Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")}) @Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getById") @RequestMapping(method = RequestMethod.POST, value = "/getById")
public R<Standard> getInfo(@Validated @RequestBody StandardGetInfoRequest request) { public R<StandardResponse> getInfo(@Validated @RequestBody StandardGetInfoRequest request) {
StandardResponse response = standardService.getInfo(request);
return R.ok(response);
}
@ApiOperation("根据标准查询检验项")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getByStandardId")
public TableDataInfo<DictDataVO> getByStandardId(@Validated @RequestBody StandardGetInfoRequest request) {
Standard standard = standardService.getInfo(request); return getDataTable(standardInspectionItemRelationService.getByStandardId(request.getId()));
return R.ok(standard);
} }
} }
...@@ -3,6 +3,7 @@ import com.ruoyi.common.core.controller.BaseController; ...@@ -3,6 +3,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.domain.TestUseCase; import com.ruoyi.domain.TestUseCase;
import com.ruoyi.domain.vo.UseCaseUrlVO;
import com.ruoyi.service.TestUseCaseService; import com.ruoyi.service.TestUseCaseService;
import com.ruoyi.web.request.TestUseCaseByScenarioRequest; import com.ruoyi.web.request.TestUseCaseByScenarioRequest;
import com.ruoyi.web.request.TestUseCaseIdListRequest; import com.ruoyi.web.request.TestUseCaseIdListRequest;
...@@ -94,4 +95,21 @@ public class TestUserCaseController extends BaseController{ ...@@ -94,4 +95,21 @@ public class TestUserCaseController extends BaseController{
} }
/**
* 科恩根据章节查询用例列表
* @param request
* @return
* @throws IOException
*/
@ApiOperation("科恩根据章节查询用例列表")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getUseCaseByChapter", produces="application/json;charset=UTF-8")
public TableDataInfo<UseCaseUrlVO> getUseCaseByChapter(@Validated @RequestBody String request) throws IOException {
List<UseCaseUrlVO> list = testUseCaseService.getUseCaseByChapter(request);
return getDataTable(list);
}
} }
package com.ruoyi.web.request; package com.ruoyi.web.request;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.page.PageDomain; import com.ruoyi.domain.StandardInspectionItemRelation;
import com.ruoyi.domain.vo.DictDataVO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import java.util.List;
@ApiModel(value = "StandardEditRequest", description = "编辑标准") @ApiModel(value = "StandardEditRequest", description = "编辑标准")
@Data @Data
...@@ -36,4 +38,7 @@ public class StandardEditRequest { ...@@ -36,4 +38,7 @@ public class StandardEditRequest {
@ApiModelProperty("实施日期") @ApiModelProperty("实施日期")
private Date implementationDate; private Date implementationDate;
@ApiModelProperty("检验项id")
List<DictDataVO> dictList;
} }
...@@ -9,6 +9,17 @@ import lombok.Data; ...@@ -9,6 +9,17 @@ import lombok.Data;
@Data @Data
public class StandardListRequest extends PageDomain { public class StandardListRequest extends PageDomain {
@ApiModelProperty("关键字") @ApiModelProperty("标准号")
private String keyWord; private String standardNo;
@ApiModelProperty("标准名称")
private String name;
@ApiModelProperty("标准分类")
private String standardType;
@ApiModelProperty("标准状态")
private String standardStatus;
} }
package com.ruoyi.web.response;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.domain.vo.DictDataVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@ApiModel(value = "StandardResponse", description = "标准库详情")
@Data
public class StandardResponse {
@ApiModelProperty("主键")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
@ApiModelProperty("标准名称")
private String name;
@ApiModelProperty("标准号")
private String standardNo;
@ApiModelProperty("文件路径")
private String file;
@ApiModelProperty("标准分类")
private String standardType;
@ApiModelProperty("标准状态")
private String standardStatus;
@ApiModelProperty("发布日期")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date releaseDate;
@ApiModelProperty("实施日期")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date implementationDate;
@ApiModelProperty("检验项")
private List<DictDataVO> dictList;
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.mapper.StandardInspectionItemRelationMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.domain.StandardInspectionItemRelation">
<result property="id" column="id" jdbcType="BIGINT"/>
<result property="standardId" column="standard_id" jdbcType="BIGINT"/>
<result property="dictCode" column="dict_code" jdbcType="BIGINT"/>
</resultMap>
<select id="getListByStandardId" resultType="com.ruoyi.domain.vo.DictDataVO">
SELECT dict_code FROM t_standard_inspection_item_relation
WHERE standard_id = #{standardId}
</select>
<select id="getListByStandard" resultType="com.ruoyi.domain.StandardInspectionItemRelation">
SELECT id, standard_id, dict_code FROM t_standard_inspection_item_relation
WHERE standard_id = #{standardId}
</select>
</mapper>
...@@ -19,8 +19,17 @@ ...@@ -19,8 +19,17 @@
SELECT id, name, standard_no, file,standard_type,standard_status,release_date,implementation_date SELECT id, name, standard_no, file,standard_type,standard_status,release_date,implementation_date
FROM t_standard FROM t_standard
<where> <where>
<if test="keyWord != null and keyWord != ''"> <if test="standardType != null and standardType != ''">
name like concat('%',#{keyWord},'%') OR standard_no like concat('%',#{keyWord},'%') standard_type = #{standardType}
</if>
<if test="standardNo != null and standardNo != ''">
and standard_no like concat('%', #{standardNo}, '%')
</if>
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="standardStatus != null and standardStatus != ''">
and standard_status = #{standardStatus}
</if> </if>
</where> </where>
</select> </select>
......
...@@ -28,12 +28,13 @@ ...@@ -28,12 +28,13 @@
<select id="selectStandardCategoryStatistics" resultType="com.ruoyi.domain.vo.StandardCategoryStatisticsVO"> <select id="selectStandardCategoryStatistics" resultType="com.ruoyi.domain.vo.StandardCategoryStatisticsVO">
SELECT SELECT
count( id ) AS value, count( ta.id ) AS value,
standard_type AS name st.standard_type AS name
FROM FROM
t_standard t_task ta
LEFT JOIN t_standard st ON ta.standard_id = st.id
GROUP BY GROUP BY
standard_type st.standard_type
</select> </select>
<select id="selectConfidentialityLevelStatistics" resultType="com.ruoyi.domain.vo.ConfidentialityLevelProportionVO"> <select id="selectConfidentialityLevelStatistics" resultType="com.ruoyi.domain.vo.ConfidentialityLevelProportionVO">
......
...@@ -65,6 +65,7 @@ public class SysProfileController extends BaseController ...@@ -65,6 +65,7 @@ public class SysProfileController extends BaseController
currentUser.setEmail(user.getEmail()); currentUser.setEmail(user.getEmail());
currentUser.setPhonenumber(user.getPhonenumber()); currentUser.setPhonenumber(user.getPhonenumber());
currentUser.setSex(user.getSex()); currentUser.setSex(user.getSex());
currentUser.setSignaturePicture(user.getSignaturePicture());
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
{ {
return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在"); return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在");
......
...@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.service.*;
import com.ruoyi.web.request.UserByRoleRequest; import com.ruoyi.web.request.UserByRoleRequest;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -36,10 +37,6 @@ import com.ruoyi.common.enums.BusinessType; ...@@ -36,10 +37,6 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysPostService;
import com.ruoyi.system.service.ISysRoleService;
import com.ruoyi.system.service.ISysUserService;
/** /**
* 用户信息 * 用户信息
......
...@@ -169,6 +169,10 @@ ...@@ -169,6 +169,10 @@
<artifactId>itext-asian</artifactId> <artifactId>itext-asian</artifactId>
<version>5.2.0</version> <version>5.2.0</version>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -3,6 +3,7 @@ package com.ruoyi.common.core.domain.entity; ...@@ -3,6 +3,7 @@ package com.ruoyi.common.core.domain.entity;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import javax.validation.constraints.*; import javax.validation.constraints.*;
import com.baomidou.mybatisplus.annotation.TableField;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
...@@ -89,6 +90,9 @@ public class SysUser extends BaseEntity ...@@ -89,6 +90,9 @@ public class SysUser extends BaseEntity
/** 角色ID */ /** 角色ID */
private Long roleId; private Long roleId;
/** 用户签字图片 */
private String signaturePicture;
public SysUser() public SysUser()
{ {
...@@ -297,6 +301,14 @@ public class SysUser extends BaseEntity ...@@ -297,6 +301,14 @@ public class SysUser extends BaseEntity
this.roleId = roleId; this.roleId = roleId;
} }
public String getSignaturePicture() {
return signaturePicture;
}
public void setSignaturePicture(String signaturePicture) {
this.signaturePicture = signaturePicture;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
...@@ -319,6 +331,7 @@ public class SysUser extends BaseEntity ...@@ -319,6 +331,7 @@ public class SysUser extends BaseEntity
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("remark", getRemark()) .append("remark", getRemark())
.append("dept", getDept()) .append("dept", getDept())
.append("signaturePicture", getSignaturePicture())
.toString(); .toString();
} }
} }
...@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="signaturePicture" column="signature_picture" />
<association property="dept" javaType="SysDept" resultMap="deptResult" /> <association property="dept" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> <collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap> </resultMap>
...@@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectUserVo"> <sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.signature_picture,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u from sys_user u
...@@ -168,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -168,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">status,</if> <if test="status != null and status != ''">status,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if> <if test="remark != null and remark != ''">remark,</if>
<if test="signaturePicture != null and signaturePicture != ''">signature_picture,</if>
create_time create_time
)values( )values(
<if test="userId != null and userId != ''">#{userId},</if> <if test="userId != null and userId != ''">#{userId},</if>
...@@ -182,6 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -182,6 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">#{status},</if> <if test="status != null and status != ''">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="signaturePicture != null and signaturePicture != ''">#{signaturePicture},</if>
sysdate() sysdate()
) )
</insert> </insert>
...@@ -202,6 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -202,6 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="loginDate != null">login_date = #{loginDate},</if> <if test="loginDate != null">login_date = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="signaturePicture != null">signature_picture = #{signaturePicture},</if>
update_time = sysdate() update_time = sysdate()
</set> </set>
where user_id = #{userId} where user_id = #{userId}
......
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