Commit 0862939b authored by wdy's avatar wdy

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

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