Commit 91fd9661 authored by xixinzhao's avatar xixinzhao

修改bug

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