Commit 0862939b authored by wdy's avatar wdy

子任务进度修改&查询标准表

parent 94b90764
...@@ -12,7 +12,7 @@ import java.util.List; ...@@ -12,7 +12,7 @@ import java.util.List;
public interface StandardMapper extends BaseMapper<Standard> { public interface StandardMapper extends BaseMapper<Standard> {
// 分页查询 // 分页查询
List<Standard> findList(); List<Standard> findList(StandardListRequest request);
// 根据id查询 // 根据id查询
Standard findListById(@Param("id") Long Id); Standard findListById(@Param("id") Long Id);
......
...@@ -14,7 +14,7 @@ import java.util.List; ...@@ -14,7 +14,7 @@ import java.util.List;
public interface StandardService extends IService<Standard> { public interface StandardService extends IService<Standard> {
// 分页查询 // 分页查询
List<Standard> findList(); List<Standard> findList(StandardListRequest request);
//根据id查询 //根据id查询
Standard findListById(Long id); Standard findListById(Long id);
......
...@@ -28,8 +28,8 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i ...@@ -28,8 +28,8 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
* @return * @return
*/ */
@Override @Override
public List<Standard> findList() { public List<Standard> findList(StandardListRequest request) {
return standardMapper.findList(); return standardMapper.findList(request);
} }
/** /**
......
...@@ -177,12 +177,22 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas ...@@ -177,12 +177,22 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
List<TaskFindResponse> responses = taskMapper.findPending(request,userId); List<TaskFindResponse> responses = taskMapper.findPending(request,userId);
for (TaskFindResponse response : responses) { for (TaskFindResponse response : responses) {
if (response.getSystemReviewTaskId() != null) { if (response.getSystemReviewTaskId() != null) {
BigDecimal num = new BigDecimal(((double)reviewDetailsMapper.count(response.getSystemReviewTaskId(),SystemReviewTask.TYPE))* 100); SystemReviewTask systemReviewTask = systemReviewTaskMapper.selectById(response.getSystemReviewTaskId());
response.setSystemReview(num.setScale(1,BigDecimal.ROUND_UP).doubleValue() ); if (Objects.equals(systemReviewTask.getTaskStatus(), SystemReviewTask.STATUS_FINISH)) {
response.setSystemReview(100.0);
} else {
BigDecimal num = new BigDecimal(((double)reviewDetailsMapper.count(response.getSystemReviewTaskId(),SystemReviewTask.TYPE))* 100 * 0.9);
response.setSystemReview(num.setScale(1,BigDecimal.ROUND_UP).doubleValue());
}
} }
if (response.getCarReviewTaskId() != null) { if (response.getCarReviewTaskId() != null) {
BigDecimal num = new BigDecimal(((double)reviewDetailsMapper.count(response.getCarReviewTaskId(),CarReviewTask.TYPE)) * 100); CarReviewTask carReviewTask = carReviewTaskMapper.selectById(response.getCarReviewTaskId());
response.setCarReview(num.setScale(1,BigDecimal.ROUND_UP).doubleValue()); if (Objects.equals(carReviewTask.getTaskStatus(), CarReviewTask.TASK_STATUS_FINISH)) {
response.setCarReview(100.0);
} else {
BigDecimal num = new BigDecimal(((double) reviewDetailsMapper.count(response.getCarReviewTaskId(), CarReviewTask.TYPE)) * 100 * 0.9);
response.setCarReview(num.setScale(1, BigDecimal.ROUND_UP).doubleValue());
}
} }
} }
return responses; return responses;
...@@ -259,12 +269,22 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas ...@@ -259,12 +269,22 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
List<TaskFindResponse> responses = taskMapper.findByUserId(request,userId); List<TaskFindResponse> responses = taskMapper.findByUserId(request,userId);
for (TaskFindResponse response : responses) { for (TaskFindResponse response : responses) {
if (response.getSystemReviewTaskId() != null) { if (response.getSystemReviewTaskId() != null) {
BigDecimal num = new BigDecimal(((double)reviewDetailsMapper.count(response.getSystemReviewTaskId(),SystemReviewTask.TYPE))* 100); SystemReviewTask systemReviewTask = systemReviewTaskMapper.selectById(response.getSystemReviewTaskId());
response.setSystemReview(num.setScale(1,BigDecimal.ROUND_UP).doubleValue()); if (Objects.equals(systemReviewTask.getTaskStatus(), SystemReviewTask.STATUS_FINISH)) {
response.setSystemReview(100.0);
} else {
BigDecimal num = new BigDecimal(((double)reviewDetailsMapper.count(response.getSystemReviewTaskId(),SystemReviewTask.TYPE))* 100 * 0.9);
response.setSystemReview(num.setScale(1,BigDecimal.ROUND_UP).doubleValue());
}
} }
if (response.getCarReviewTaskId() != null) { if (response.getCarReviewTaskId() != null) {
BigDecimal num = new BigDecimal(((double)reviewDetailsMapper.count(response.getCarReviewTaskId(),CarReviewTask.TYPE)) * 100); CarReviewTask carReviewTask = carReviewTaskMapper.selectById(response.getCarReviewTaskId());
response.setCarReview(num.setScale(1,BigDecimal.ROUND_UP).doubleValue()); if (Objects.equals(carReviewTask.getTaskStatus(), CarReviewTask.TASK_STATUS_FINISH)) {
response.setCarReview(100.0);
} else {
BigDecimal num = new BigDecimal(((double) reviewDetailsMapper.count(response.getCarReviewTaskId(), CarReviewTask.TYPE)) * 100 * 0.9);
response.setCarReview(num.setScale(1, BigDecimal.ROUND_UP).doubleValue());
}
} }
} }
return responses; return responses;
......
...@@ -41,7 +41,7 @@ public class StandardController extends BaseController { ...@@ -41,7 +41,7 @@ public class StandardController extends BaseController {
@RequestMapping(method = RequestMethod.POST, value = "/findStandardList") @RequestMapping(method = RequestMethod.POST, value = "/findStandardList")
public TableDataInfo<Standard> findList(@Validated @RequestBody StandardListRequest request) { public TableDataInfo<Standard> findList(@Validated @RequestBody StandardListRequest request) {
startPage(request); startPage(request);
return getDataTable(standardService.findList()); return getDataTable(standardService.findList(request));
} }
@ApiOperation("编辑标准库") @ApiOperation("编辑标准库")
......
...@@ -8,4 +8,7 @@ import lombok.Data; ...@@ -8,4 +8,7 @@ import lombok.Data;
@ApiModel(value = "StandardListRequest", description = "查询标准") @ApiModel(value = "StandardListRequest", description = "查询标准")
@Data @Data
public class StandardListRequest extends PageDomain { public class StandardListRequest extends PageDomain {
@ApiModelProperty("关键字")
private String keyWord;
} }
...@@ -18,6 +18,11 @@ ...@@ -18,6 +18,11 @@
<select id="findList" parameterType="com.ruoyi.web.request.StandardListRequest" resultMap="BaseResultMap"> <select id="findList" parameterType="com.ruoyi.web.request.StandardListRequest" resultMap="BaseResultMap">
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>
<if test="keyWord != null and keyWord != ''">
name like concat('%',#{keyWord},'%') OR standard_no like concat('%',#{keyWord},'%')
</if>
</where>
</select> </select>
<select id="findListById" resultMap="BaseResultMap"> <select id="findListById" resultMap="BaseResultMap">
......
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