Commit 517cb0b8 authored by xixinzhao's avatar xixinzhao

巡检bug

parent 4e2f86d9
...@@ -22,6 +22,7 @@ import javax.xml.transform.TransformerFactory; ...@@ -22,6 +22,7 @@ import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.stream.StreamSource; import javax.xml.transform.stream.StreamSource;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.patrol.business.service.intfc.*; import com.yeejoin.amos.patrol.business.service.intfc.*;
import com.yeejoin.amos.patrol.business.util.*; import com.yeejoin.amos.patrol.business.util.*;
import com.yeejoin.amos.patrol.core.async.TaskExecutorPoolConfig; import com.yeejoin.amos.patrol.core.async.TaskExecutorPoolConfig;
...@@ -176,11 +177,12 @@ public class CheckController extends AbstractBaseController { ...@@ -176,11 +177,12 @@ public class CheckController extends AbstractBaseController {
token.setAppKey(request.getHeader("appKey")); token.setAppKey(request.getHeader("appKey"));
int statu = -1; int statu = -1;
PlanTask planTask =null; PlanTask planTask =null;
log.info("手机app保存巡检记录++++++++++++++++++++++: {}", JSON.toJSONString(requestParam));
if(requestParam.getPlanTaskId()!=null && requestParam.getPlanTaskId() !=0){ if(requestParam.getPlanTaskId()!=null && requestParam.getPlanTaskId() !=0){
List<Map<String, Object>> map = checkService.selectCheckById(requestParam.getPlanTaskId()); List<Map<String, Object>> map = checkService.selectCheckById(requestParam.getPlanTaskId(), requestParam.getPointId());
if (!CollectionUtils.isEmpty(map)) { if (!CollectionUtils.isEmpty(map)) {
List<Long> ids = map.stream().map(m -> Long.valueOf(m.get("id").toString())).collect(Collectors.toList()); List<Long> ids = map.stream().map(m -> Long.valueOf(m.get("id").toString())).collect(Collectors.toList());
checkService.delCheckByTaskId(requestParam.getPlanTaskId(), ids); checkService.delCheckByTaskId(requestParam.getPlanTaskId(), ids, requestParam.getPointId());
} }
planTask = planTaskService.selectPlanTaskStatus(requestParam.getPlanTaskId()); planTask = planTaskService.selectPlanTaskStatus(requestParam.getPlanTaskId());
} }
......
...@@ -4,7 +4,6 @@ import java.util.HashMap; ...@@ -4,7 +4,6 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.yeejoin.amos.patrol.dao.entity.Check;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.yeejoin.amos.patrol.business.entity.mybatis.CheckDetailBo; import com.yeejoin.amos.patrol.business.entity.mybatis.CheckDetailBo;
...@@ -283,10 +282,10 @@ public interface CheckMapper extends BaseMapper { ...@@ -283,10 +282,10 @@ public interface CheckMapper extends BaseMapper {
//Map<String, String> queryUserInfoByIds(@Param(value = "userIds") String userIds); //Map<String, String> queryUserInfoByIds(@Param(value = "userIds") String userIds);
int delCheckByTaskId(@Param(value = "taskId") Long taskId); Integer delCheckByTaskId(@Param(value = "taskId") Long taskId, @Param(value = "pointId") Long pointId);
int delCheckInputByCheckId(@Param(value = "ids") List<Long> ids); Integer delCheckInputByCheckId(@Param(value = "ids") List<Long> ids);
List<Map<String, Object>> selectCheckById(@Param(value = "taskId") Long taskId); List<Map<String, Object>> selectCheckById(@Param(value = "taskId") Long taskId, @Param(value = "pointId") Long pointId);
} }
...@@ -15,7 +15,6 @@ import java.util.stream.Collectors; ...@@ -15,7 +15,6 @@ import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.transaction.Transactional; import javax.transaction.Transactional;
import com.alibaba.fastjson.JSON;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.MessageModel; import com.yeejoin.amos.feign.systemctl.model.MessageModel;
...@@ -30,7 +29,6 @@ import org.assertj.core.util.Sets; ...@@ -30,7 +29,6 @@ import org.assertj.core.util.Sets;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cglib.beans.BeanMap; import org.springframework.cglib.beans.BeanMap;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
...@@ -739,13 +737,13 @@ public class CheckServiceImpl implements ICheckService { ...@@ -739,13 +737,13 @@ public class CheckServiceImpl implements ICheckService {
} }
@Override @Override
public List<Map<String, Object>> selectCheckById(Long id) { public List<Map<String, Object>> selectCheckById(Long id, Long pointId) {
return checkMapper.selectCheckById(id); return checkMapper.selectCheckById(id, pointId);
} }
@Override @Override
public void delCheckByTaskId(Long id, List<Long> ids) { public void delCheckByTaskId(Long id, List<Long> ids, Long pointId) {
checkMapper.delCheckByTaskId(id); checkMapper.delCheckByTaskId(id, pointId);
checkMapper.delCheckInputByCheckId(ids); checkMapper.delCheckInputByCheckId(ids);
} }
......
...@@ -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, List<Long> ids); void delCheckByTaskId(Long id, List<Long> ids, Long pointId);
List<Map<String, Object>> selectCheckById(Long id); List<Map<String, Object>> selectCheckById(Long id, Long pointId);
/** /**
* 获取检查结果中所有不合格检查项 * 获取检查结果中所有不合格检查项
......
...@@ -2159,13 +2159,13 @@ ...@@ -2159,13 +2159,13 @@
d.date d.date
</select> </select>
<select id="delCheckByTaskId" resultType="int"> <select id="delCheckByTaskId" resultType="java.lang.Integer">
DELETE FROM DELETE FROM
p_check pc p_check pc
WHERE pc.plan_task_id = #{taskId} WHERE pc.plan_task_id = #{taskId} AND pc.point_id = #{pointId} AND pc.is_ok = 3
</select> </select>
<select id="delCheckInputByCheckId" resultType="int"> <select id="delCheckInputByCheckId" resultType="java.lang.Integer">
DELETE FROM DELETE FROM
p_check_input pci p_check_input pci
WHERE pci.check_id in WHERE pci.check_id in
...@@ -2176,7 +2176,7 @@ ...@@ -2176,7 +2176,7 @@
SELECT * SELECT *
FROM FROM
p_check pc p_check pc
WHERE pc.plan_task_id = #{taskId} WHERE pc.plan_task_id = #{taskId} AND pc.point_id = #{pointId} AND pc.is_ok = 3
</select> </select>
</mapper> </mapper>
\ No newline at end of file
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