Commit 91fd9661 authored by xixinzhao's avatar xixinzhao

修改bug

parent f754a00b
......@@ -11,6 +11,7 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import javax.xml.transform.Result;
......@@ -33,6 +34,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.scheduling.annotation.Async;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -175,9 +177,10 @@ public class CheckController extends AbstractBaseController {
int statu = -1;
PlanTask planTask =null;
if(requestParam.getPlanTaskId()!=null && requestParam.getPlanTaskId() !=0){
Map<String, Object> map = checkService.selectCheckById(requestParam.getPlanTaskId());
if (!ObjectUtils.isEmpty(map)) {
checkService.delCheckByTaskId(requestParam.getPlanTaskId(), Long.valueOf(map.get("id").toString()));
List<Map<String, Object>> map = checkService.selectCheckById(requestParam.getPlanTaskId());
if (!CollectionUtils.isEmpty(map)) {
List<Long> ids = map.stream().map(m -> Long.valueOf(m.get("id").toString())).collect(Collectors.toList());
checkService.delCheckByTaskId(requestParam.getPlanTaskId(), ids);
}
planTask = planTaskService.selectPlanTaskStatus(requestParam.getPlanTaskId());
}
......
......@@ -285,8 +285,8 @@ public interface CheckMapper extends BaseMapper {
int delCheckByTaskId(@Param(value = "taskId") Long taskId);
int delCheckInputByCheckId(@Param(value = "checkId") Long checkId);
int delCheckInputByCheckId(@Param(value = "ids") List<Long> ids);
Map<String, Object> selectCheckById(@Param(value = "taskId") Long taskId);
List<Map<String, Object>> selectCheckById(@Param(value = "taskId") Long taskId);
}
......@@ -739,14 +739,14 @@ public class CheckServiceImpl implements ICheckService {
}
@Override
public Map<String, Object> selectCheckById(Long id) {
public List<Map<String, Object>> selectCheckById(Long id) {
return checkMapper.selectCheckById(id);
}
@Override
public void delCheckByTaskId(Long id, Long checkId) {
public void delCheckByTaskId(Long id, List<Long> ids) {
checkMapper.delCheckByTaskId(id);
checkMapper.delCheckInputByCheckId(checkId);
checkMapper.delCheckInputByCheckId(ids);
}
private CheckInput paraseText(CheckInput checkInput, String json, CheckInputParam item, String isScore) {
......
......@@ -55,9 +55,9 @@ public interface ICheckService {
void delCheckById(List<Long> ids);
void delCheckByTaskId(Long id, Long checkId);
void delCheckByTaskId(Long id, List<Long> ids);
Map<String, Object> selectCheckById(Long id);
List<Map<String, Object>> selectCheckById(Long id);
/**
* 获取检查结果中所有不合格检查项
......
......@@ -67,6 +67,7 @@
WHERE
-- 因为此处属于确定查询条件,所以此处写入常量
wes.equipment_code LIKE CONCAT( '92032000', '%' )
ORDER BY a.`value` DESC
<!-- <if test="bizOrgCode!=null and bizOrgCode!=''">-->
<!-- AND wes.biz_org_code like concat(#{bizOrgCode}, '%')-->
<!-- </if>-->
......@@ -188,6 +189,7 @@
WHERE
wes.equipment_code LIKE concat( '920319', '%' )
) temp
ORDER BY temp.nowLevel DESC
</select>
<select id="selectOilDrainage" resultType="java.util.Map">
......
......@@ -2168,7 +2168,8 @@
<select id="delCheckInputByCheckId" resultType="int">
DELETE FROM
p_check_input pci
WHERE pci.check_id = #{checkId}
WHERE pci.check_id in
<foreach collection="ids" item="id" index="index" open="(" close=")" separator=",">#{id}</foreach>
</select>
<select id="selectCheckById" resultType="java.util.HashMap">
......
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