Commit deafb218 authored by wdy's avatar wdy

查询第一整车样品信息对应的企业名称

parent 4cee23c5
...@@ -86,5 +86,9 @@ public class ReviewDetailsResult implements Serializable { ...@@ -86,5 +86,9 @@ public class ReviewDetailsResult implements Serializable {
@ApiModelProperty("关联到车企留档文件") @ApiModelProperty("关联到车企留档文件")
private Long reviewEnterpriseArchiveId; private Long reviewEnterpriseArchiveId;
@TableField(exist = false)
@ApiModelProperty("企业名称")
private String enterpriseName;
} }
...@@ -53,6 +53,15 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init ...@@ -53,6 +53,15 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
@Autowired @Autowired
private ReviewTaskInboxMapper reviewTaskInboxMapper; private ReviewTaskInboxMapper reviewTaskInboxMapper;
@Autowired
private TaskMapper taskMapper;
@Autowired
private TaskSampleRelationMapper taskSampleRelationMapper;
@Autowired
private SampleManagementMapper sampleManagementMapper;
// PENDING状态下 // PENDING状态下
// 1.standard字段查询当前最新问卷 // 1.standard字段查询当前最新问卷
// 2.查询场景变更任务 // 2.查询场景变更任务
...@@ -65,6 +74,19 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init ...@@ -65,6 +74,19 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
// 获取当前问卷答案 // 获取当前问卷答案
List<ReviewDetailsResult> results = reviewDetailsResultService.findByTaskId(carReviewTask.getId()); List<ReviewDetailsResult> results = reviewDetailsResultService.findByTaskId(carReviewTask.getId());
// 任务样品关系
List<TaskSampleRelation> relations = taskSampleRelationMapper.selectByTaskId(taskMapper.findByCarReviewTaskId(carReviewTask.getId()),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE);
if (results.size() != 0 && results != null) {
for (ReviewDetailsResult reviewDetailsResult : results) {
if (reviewDetailsResult != null && reviewDetailsResult.getReviewEnterpriseArchiveId() == null && relations.size() != 0 && relations != null) {
TaskSampleRelation taskSampleRelation = relations.get(0);
Sample sample = sampleManagementMapper.selectSampleManagementById(taskSampleRelation.getSampleId());
reviewDetailsResult.setEnterpriseName(sample.getManufacturingEnterprise());
}
}
}
// 绑定问卷与答案 // 绑定问卷与答案
setDetailsResult(standardTree, results); setDetailsResult(standardTree, results);
......
...@@ -5,10 +5,7 @@ import com.ruoyi.common.core.domain.entity.SysUser; ...@@ -5,10 +5,7 @@ import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.domain.*; import com.ruoyi.domain.*;
import com.ruoyi.mapper.ReviewDetailsMapper; import com.ruoyi.mapper.*;
import com.ruoyi.mapper.ReviewDetailsResultMapper;
import com.ruoyi.mapper.ReviewTaskInboxMapper;
import com.ruoyi.mapper.SystemReviewTaskMapper;
import com.ruoyi.service.*; import com.ruoyi.service.*;
import com.ruoyi.web.response.SystemReviewTaskViewResponse; import com.ruoyi.web.response.SystemReviewTaskViewResponse;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
...@@ -53,6 +50,15 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask ...@@ -53,6 +50,15 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
@Autowired @Autowired
private ReviewTaskInboxMapper reviewTaskInboxMapper; private ReviewTaskInboxMapper reviewTaskInboxMapper;
@Autowired
private TaskMapper taskMapper;
@Autowired
private TaskSampleRelationMapper taskSampleRelationMapper;
@Autowired
private SampleManagementMapper sampleManagementMapper;
@Override @Override
public void doStart(SystemReviewTask systemReviewTask) { public void doStart(SystemReviewTask systemReviewTask) {
throw new ServiceException("不能开始一个已经开始的任务", HttpStatus.ERROR); throw new ServiceException("不能开始一个已经开始的任务", HttpStatus.ERROR);
...@@ -116,6 +122,19 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask ...@@ -116,6 +122,19 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
// 获取当前问卷答案 // 获取当前问卷答案
List<ReviewDetailsResult> results = reviewDetailsResultService.findByTaskId(systemReviewTask.getId()); List<ReviewDetailsResult> results = reviewDetailsResultService.findByTaskId(systemReviewTask.getId());
// 任务样品关系
List<TaskSampleRelation> relations = taskSampleRelationMapper.selectByTaskId(taskMapper.findBySystemReviewTaskId(systemReviewTask.getId()),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE);
if (results.size() != 0 && results != null) {
for (ReviewDetailsResult reviewDetailsResult : results) {
if (reviewDetailsResult != null && reviewDetailsResult.getReviewEnterpriseArchiveId() == null && relations.size() != 0 && relations != null) {
TaskSampleRelation taskSampleRelation = relations.get(0);
Sample sample = sampleManagementMapper.selectSampleManagementById(taskSampleRelation.getSampleId());
reviewDetailsResult.setEnterpriseName(sample.getManufacturingEnterprise());
}
}
}
// 绑定问卷与答案 // 绑定问卷与答案
setDetailsResult(standardTree, results); setDetailsResult(standardTree, results);
......
...@@ -153,12 +153,12 @@ ...@@ -153,12 +153,12 @@
<select id="findByCarReviewTaskId" resultType="java.lang.Long"> <select id="findByCarReviewTaskId" resultType="java.lang.Long">
SELECT id SELECT id
FROM t_task FROM t_task
WHERE system_review_task_id = #{systemReviewId} WHERE car_review_task_id = #{carReviewId}
</select> </select>
<select id="findBySystemReviewTaskId" resultType="java.lang.Long"> <select id="findBySystemReviewTaskId" resultType="java.lang.Long">
SELECT id SELECT id
FROM t_task FROM t_task
WHERE car_review_task_id = #{carReviewId} WHERE system_review_task_id = #{systemReviewId}
</select> </select>
<select id="findByUserId" resultMap="ResponseMap"> <select id="findByUserId" resultMap="ResponseMap">
SELECT t.id, t.system_review_task_id, t.car_review_task_id, SELECT t.id, t.system_review_task_id, t.car_review_task_id,
......
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