Commit 6cc9875b authored by wdy's avatar wdy

Merge branch 'wangdingyi' into 'dev'

任务进度限制位数

See merge request !156
parents 0a58b3b7 02732afd
......@@ -20,7 +20,7 @@ public interface ReviewDetailsMapper extends BaseMapper<ReviewDetails> {
*/
List<ReviewDetails> findNoResult(@Param("taskId") Long taskId, @Param("type") String type);
Long count (@Param("taskId")Long taskId, @Param("type")String type);
Double count (@Param("taskId")Long taskId, @Param("type")String type);
// 根据要点id查询细则列表
List<ReviewDetails> findByKeyPointId(@Param("keyPointId") Long keyPointId);
......
......@@ -90,10 +90,10 @@ public class StrategyCarReviewTaskFinish implements StrategyCarReviewTask, Initi
List<TaskUserRelation> relationList = taskUserRelationMapper.selectQTeamMembers(taskMapper.findByCarReviewTaskId(carReviewTask.getId()));
BigDecimal standardPass = new BigDecimal(calculateStandardsPass(standards, resultMap) / (double) carReviewTask.getStandards());
carReviewTask.setStandardsPass(standardPass.setScale(3,BigDecimal.ROUND_UP).doubleValue() * 100);
BigDecimal detailsPass = new BigDecimal(DataStatisticsUtils.calculateDetailsPass(standards, resultMap) / (double) carReviewTask.getDetails());
carReviewTask.setDetailsPass(detailsPass.setScale(3,BigDecimal.ROUND_UP).doubleValue() * 100);
BigDecimal standardPass = new BigDecimal((calculateStandardsPass(standards, resultMap) / (double) carReviewTask.getStandards())*100);
carReviewTask.setStandardsPass(standardPass.setScale(1,BigDecimal.ROUND_UP).doubleValue());
BigDecimal detailsPass = new BigDecimal((DataStatisticsUtils.calculateDetailsPass(standards, resultMap) / (double) carReviewTask.getDetails())*100);
carReviewTask.setDetailsPass(detailsPass.setScale(1,BigDecimal.ROUND_UP).doubleValue());
carReviewTask.setPerson(relationList.size());
}
......
......@@ -197,11 +197,11 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
List<TaskUserRelation> relationList = taskUserRelationMapper.selectQTeamMembers(taskMapper.findByCarReviewTaskId(carReviewTask.getId()));
carReviewTask.setStandards(DataStatisticsUtils.calculateStandards(standards));
BigDecimal standardPass = new BigDecimal(calculateStandardsPass(standards, resultMap) / (double) carReviewTask.getStandards());
carReviewTask.setStandardsPass(standardPass.setScale(3,BigDecimal.ROUND_UP).doubleValue() * 100);
BigDecimal standardPass = new BigDecimal((calculateStandardsPass(standards, resultMap) / (double) carReviewTask.getStandards())*100);
carReviewTask.setStandardsPass(standardPass.setScale(1,BigDecimal.ROUND_UP).doubleValue());
carReviewTask.setDetails(DataStatisticsUtils.calculateDetails(standards));
BigDecimal detailsPass = new BigDecimal(DataStatisticsUtils.calculateDetailsPass(standards, resultMap) / (double) carReviewTask.getDetails());
carReviewTask.setDetailsPass(detailsPass.setScale(3,BigDecimal.ROUND_UP).doubleValue() * 100);
BigDecimal detailsPass = new BigDecimal((DataStatisticsUtils.calculateDetailsPass(standards, resultMap) / (double) carReviewTask.getDetails())*100);
carReviewTask.setDetailsPass(detailsPass.setScale(1,BigDecimal.ROUND_UP).doubleValue());
carReviewTask.setPerson(relationList.size());
carReviewTaskMapper.updateById(carReviewTask);
......
......@@ -124,10 +124,10 @@ public class StrategyCarReviewTaskSigned implements StrategyCarReviewTask, Initi
List<TaskUserRelation> relationList = taskUserRelationMapper.selectQTeamMembers(taskMapper.findByCarReviewTaskId(carReviewTask.getId()));
BigDecimal standardPass = new BigDecimal(calculateStandardsPass(standards, resultMap) / (double) carReviewTask.getStandards());
carReviewTask.setStandardsPass(standardPass.setScale(3,BigDecimal.ROUND_UP).doubleValue() * 100);
BigDecimal detailsPass = new BigDecimal(DataStatisticsUtils.calculateDetailsPass(standards, resultMap) / (double) carReviewTask.getDetails());
carReviewTask.setDetailsPass(detailsPass.setScale(3,BigDecimal.ROUND_UP).doubleValue() * 100);
BigDecimal standardPass = new BigDecimal((calculateStandardsPass(standards, resultMap) / (double) carReviewTask.getStandards())*100);
carReviewTask.setStandardsPass(standardPass.setScale(1,BigDecimal.ROUND_UP).doubleValue());
BigDecimal detailsPass = new BigDecimal((DataStatisticsUtils.calculateDetailsPass(standards, resultMap) / (double) carReviewTask.getDetails())*100);
carReviewTask.setDetailsPass(detailsPass.setScale(1,BigDecimal.ROUND_UP).doubleValue());
carReviewTask.setPerson(relationList.size());
}
......
......@@ -94,10 +94,10 @@ public class StrategySystemReviewTaskFinish implements StrategySystemReviewTask,
List<TaskUserRelation> relationList = taskUserRelationMapper.selectQTeamMembers(taskMapper.findBySystemReviewTaskId(systemReviewTask.getId()));
BigDecimal standardPass = new BigDecimal(DataStatisticsUtils.calculateStandardsPass(standards, resultMap) / (double) systemReviewTask.getStandards());
systemReviewTask.setStandardsPass(standardPass.setScale(3,BigDecimal.ROUND_UP).doubleValue() * 100);
BigDecimal detailsPass = new BigDecimal(DataStatisticsUtils.calculateDetailsPass(standards, resultMap) / (double) systemReviewTask.getDetails());
systemReviewTask.setDetailsPass(detailsPass.setScale(3,BigDecimal.ROUND_UP).doubleValue() * 100);
BigDecimal standardPass = new BigDecimal((DataStatisticsUtils.calculateStandardsPass(standards, resultMap) / (double) systemReviewTask.getStandards())*100);
systemReviewTask.setStandardsPass(standardPass.setScale(1,BigDecimal.ROUND_UP).doubleValue());
BigDecimal detailsPass = new BigDecimal((DataStatisticsUtils.calculateDetailsPass(standards, resultMap) / (double) systemReviewTask.getDetails())*100);
systemReviewTask.setDetailsPass(detailsPass.setScale(1,BigDecimal.ROUND_UP).doubleValue());
systemReviewTask.setPerson(relationList.size());
}
......
......@@ -195,11 +195,11 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
List<TaskUserRelation> relationList = taskUserRelationMapper.selectQTeamMembers(taskMapper.findBySystemReviewTaskId(systemReviewTask.getId()));
systemReviewTask.setStandards(DataStatisticsUtils.calculateStandards(standards));
BigDecimal standardPass = new BigDecimal(DataStatisticsUtils.calculateStandardsPass(standards, resultMap) / (double) systemReviewTask.getStandards());
systemReviewTask.setStandardsPass(standardPass.setScale(3,BigDecimal.ROUND_UP).doubleValue() * 100);
BigDecimal standardPass = new BigDecimal((DataStatisticsUtils.calculateStandardsPass(standards, resultMap) / (double) systemReviewTask.getStandards())*100);
systemReviewTask.setStandardsPass(standardPass.setScale(1,BigDecimal.ROUND_UP).doubleValue());
systemReviewTask.setDetails(DataStatisticsUtils.calculateDetails(standards));
BigDecimal detailsPass = new BigDecimal(DataStatisticsUtils.calculateDetailsPass(standards, resultMap) / (double) systemReviewTask.getDetails());
systemReviewTask.setDetailsPass(detailsPass.setScale(3,BigDecimal.ROUND_UP).doubleValue() * 100);
BigDecimal detailsPass = new BigDecimal((DataStatisticsUtils.calculateDetailsPass(standards, resultMap) / (double) systemReviewTask.getDetails())*100);
systemReviewTask.setDetailsPass(detailsPass.setScale(1,BigDecimal.ROUND_UP).doubleValue());
systemReviewTask.setPerson(relationList.size());
systemReviewTaskMapper.updateById(systemReviewTask);
......
......@@ -126,10 +126,10 @@ public class StrategySystemReviewTaskSigned implements StrategySystemReviewTask,
List<TaskUserRelation> relationList = taskUserRelationMapper.selectQTeamMembers(taskMapper.findBySystemReviewTaskId(systemReviewTask.getId()));
BigDecimal standardPass = new BigDecimal(DataStatisticsUtils.calculateStandardsPass(standards, resultMap) / (double) systemReviewTask.getStandards());
systemReviewTask.setStandardsPass(standardPass.setScale(3,BigDecimal.ROUND_UP).doubleValue() * 100);
BigDecimal detailsPass = new BigDecimal(DataStatisticsUtils.calculateDetailsPass(standards, resultMap) / (double) systemReviewTask.getDetails());
systemReviewTask.setDetailsPass(detailsPass.setScale(3,BigDecimal.ROUND_UP).doubleValue() * 100);
BigDecimal standardPass = new BigDecimal((DataStatisticsUtils.calculateStandardsPass(standards, resultMap) / (double) systemReviewTask.getStandards())*100);
systemReviewTask.setStandardsPass(standardPass.setScale(1,BigDecimal.ROUND_UP).doubleValue());
BigDecimal detailsPass = new BigDecimal((DataStatisticsUtils.calculateDetailsPass(standards, resultMap) / (double) systemReviewTask.getDetails())*100);
systemReviewTask.setDetailsPass(detailsPass.setScale(1,BigDecimal.ROUND_UP).doubleValue());
systemReviewTask.setPerson(relationList.size());
}
......
......@@ -180,10 +180,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
List<TaskFindResponse> responses = taskMapper.findPending(request);
for (TaskFindResponse response : responses) {
if (response.getSystemReviewTaskId() != null) {
response.setSystemReview(reviewDetailsMapper.count(response.getSystemReviewTaskId(),SystemReviewTask.TYPE));
BigDecimal num = new BigDecimal(((double)reviewDetailsMapper.count(response.getSystemReviewTaskId(),SystemReviewTask.TYPE))* 100);
response.setSystemReview(num.setScale(1,BigDecimal.ROUND_UP).doubleValue() );
}
if (response.getCarReviewTaskId() != null) {
response.setCarReview(reviewDetailsMapper.count(response.getCarReviewTaskId(),CarReviewTask.TYPE));
BigDecimal num = new BigDecimal(((double)reviewDetailsMapper.count(response.getCarReviewTaskId(),CarReviewTask.TYPE)) * 100);
response.setCarReview(num.setScale(1,BigDecimal.ROUND_UP).doubleValue());
}
}
return responses;
......@@ -334,10 +336,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
List<TaskFindResponse> responses = taskMapper.findByUserId(request,userId);
for (TaskFindResponse response : responses) {
if (response.getSystemReviewTaskId() != null) {
response.setSystemReview(reviewDetailsMapper.count(response.getSystemReviewTaskId(),SystemReviewTask.TYPE));
response.setSystemReview((double)reviewDetailsMapper.count(response.getSystemReviewTaskId(),SystemReviewTask.TYPE));
}
if (response.getCarReviewTaskId() != null) {
response.setCarReview(reviewDetailsMapper.count(response.getCarReviewTaskId(),CarReviewTask.TYPE));
response.setCarReview((double)reviewDetailsMapper.count(response.getCarReviewTaskId(),CarReviewTask.TYPE));
}
}
return responses;
......@@ -628,14 +630,14 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
response.setSystemStandardsPassNum(DataStatisticsUtils.calculateStandardsPass(standards, resultMap));
response.setSystemStandardsNoPassNum(DataStatisticsUtils.calculateStandardsNoPass(standards, resultMap));
response.setSystemStandardsUnderNum(response.getSystemStandards() -response.getSystemStandardsPassNum() - response.getSystemStandardsNoPassNum());
BigDecimal standardPass = new BigDecimal(response.getSystemStandardsPassNum() / (double) response.getSystemStandards());
response.setSystemStandardsPass(standardPass.setScale(3,BigDecimal.ROUND_UP).doubleValue() * 100);
BigDecimal standardPass = new BigDecimal((response.getSystemStandardsPassNum() / (double) response.getSystemStandards())*100);
response.setSystemStandardsPass(standardPass.setScale(1,BigDecimal.ROUND_UP).doubleValue());
response.setSystemDetails(DataStatisticsUtils.calculateDetails(standards));
response.setSystemDetailsPassNum(DataStatisticsUtils.calculateDetailsPass(standards, resultMap));
response.setSystemDetailsNoPassNum(DataStatisticsUtils.calculateDetailsNoPass(standards, resultMap));
response.setSystemDetailsUnderNum(response.getSystemDetails() - response.getSystemDetailsPassNum() - response.getSystemDetailsNoPassNum());
BigDecimal detailsPass = new BigDecimal(response.getSystemDetailsPassNum() / (double) response.getSystemDetails());
response.setSystemDetailsPass(detailsPass.setScale(3,BigDecimal.ROUND_UP).doubleValue() * 100);
BigDecimal detailsPass = new BigDecimal((response.getSystemDetailsPassNum() / (double) response.getSystemDetails())*100);
response.setSystemDetailsPass(detailsPass.setScale(1,BigDecimal.ROUND_UP).doubleValue());
}
......@@ -646,14 +648,14 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
response.setCarStandardsPassNum(DataStatisticsUtils.calculateStandardsPass(standards, resultMap));
response.setCarStandardsNoPassNum(DataStatisticsUtils.calculateStandardsNoPass(standards, resultMap));
response.setCarStandardsUnderNum(response.getCarStandards() -response.getCarStandardsPassNum() - response.getCarStandardsNoPassNum());
BigDecimal standardPass = new BigDecimal(response.getCarStandardsPassNum() / (double) response.getCarStandards());
response.setCarStandardsPass(standardPass.setScale(3,BigDecimal.ROUND_UP).doubleValue() * 100);
BigDecimal standardPass = new BigDecimal((response.getCarStandardsPassNum() / (double) response.getCarStandards())*100);
response.setCarStandardsPass(standardPass.setScale(1,BigDecimal.ROUND_UP).doubleValue());
response.setCarDetails(DataStatisticsUtils.calculateDetails(standards));
response.setCarDetailsPassNum(DataStatisticsUtils.calculateDetailsPass(standards, resultMap));
response.setCarDetailsNoPassNum(DataStatisticsUtils.calculateDetailsNoPass(standards, resultMap));
response.setCarDetailsUnderNum(response.getCarDetails() - response.getCarDetailsPassNum() - response.getCarDetailsNoPassNum());
BigDecimal detailsPass = new BigDecimal(response.getCarDetailsPassNum() / (double) response.getCarDetails());
response.setCarDetailsPass(detailsPass.setScale(3,BigDecimal.ROUND_UP).doubleValue() * 100);
BigDecimal detailsPass = new BigDecimal((response.getCarDetailsPassNum() / (double) response.getCarDetails())*100);
response.setCarDetailsPass(detailsPass.setScale(1,BigDecimal.ROUND_UP).doubleValue());
}
......
......@@ -52,7 +52,7 @@ public class TaskStatePending extends TaskStateAdapter implements TaskState, Ini
@Override
public void doSubmit(Task task) {
long subTaskCount = 0;
Double subTaskCount = 0.0;
SystemReviewTask systemReviewTask = systemReviewTaskMapper.selectById(task.getSystemReviewTaskId());
......
......@@ -62,7 +62,7 @@ public class TaskFindResponse {
private String reviewStatus;
@ApiModelProperty("体系审查任务进度")
private Long systemReview;
private Double systemReview;
@ApiModelProperty("体系问卷任务开始时间")
private Date systemTaskBeginTime;
......@@ -74,7 +74,7 @@ public class TaskFindResponse {
private String carReviewStatus;
@ApiModelProperty("车型审查任务进度")
private Long carReview;
private Double carReview;
@ApiModelProperty("车辆问卷任务开始时间")
private Date carTaskBeginTime;
......@@ -86,5 +86,5 @@ public class TaskFindResponse {
private String carTestStatus;
@ApiModelProperty("测试任务进度")
private Long carTest;
private Double carTest;
}
......@@ -22,7 +22,7 @@
AND trs.type = #{type}
</select>
<select id="count" resultType="long">
<select id="count" resultType="double">
SELECT
IFNULL((SELECT COUNT(*) FROM t_review_details_result WHERE task_id = #{taskId}), 0) /
IFNULL((SELECT COUNT(*) FROM t_review_details trd
......
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