Commit 60efd6d8 authored by zhangsen's avatar zhangsen

巡检报告中 上传缺陷相关 bug处理

parent 541240bc
...@@ -184,7 +184,9 @@ public class PlanController extends AbstractBaseController { ...@@ -184,7 +184,9 @@ public class PlanController extends AbstractBaseController {
} }
} }
map.put("param", param); map.put("param", param);
return CommonResponseUtil.success(planService.addPlan(map)); Plan plan = planService.addPlan(map);
Object ob = plan != null ? ToJson.tojson(plan) : null;
return CommonResponseUtil.success(ob);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
return CommonResponseUtil.failure("巡检计划新增失败"); return CommonResponseUtil.failure("巡检计划新增失败");
......
...@@ -214,4 +214,6 @@ public interface PlanTaskMapper extends BaseMapper { ...@@ -214,4 +214,6 @@ public interface PlanTaskMapper extends BaseMapper {
List<Map<String, Object>> getCheckQualifiedEquipInfo(@Param(value="taskDetailId") String taskDetailId); List<Map<String, Object>> getCheckQualifiedEquipInfo(@Param(value="taskDetailId") String taskDetailId);
List<Map<String, Object>> getCheckNotQualifiedEquipInfo(@Param(value="taskDetailId") String taskDetailId); List<Map<String, Object>> getCheckNotQualifiedEquipInfo(@Param(value="taskDetailId") String taskDetailId);
String getCheckIdByDetailId(@Param(value="taskDetailId") String taskDetailId);
} }
package com.yeejoin.amos.patrol.business.feign; package com.yeejoin.amos.patrol.business.feign;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
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;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List; import java.util.List;
...@@ -28,6 +28,6 @@ public interface IdxFeign { ...@@ -28,6 +28,6 @@ public interface IdxFeign {
* @Date 2023/04/22 17:46 * @Date 2023/04/22 17:46
*/ */
@PostMapping(value = "/defect/check/list") @PostMapping(value = "/defect/check/list")
FeignClientResult queryDefectByCodes(@RequestBody List<String> codes); FeignClientResult queryDefectByCodes(@RequestBody List<String> codes, @RequestParam String checkId);
} }
...@@ -1920,10 +1920,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -1920,10 +1920,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
} }
map.put("missed_equip_rate", miss_task_percent); map.put("missed_equip_rate", miss_task_percent);
List<String> codes = planTaskMapper.getDefinitionObjCode(taskDetailId); List<String> codes = planTaskMapper.getDefinitionObjCode(taskDetailId);
String checkId = planTaskMapper.getCheckIdByDetailId(taskDetailId);
FeignClientResult responseModel = new FeignClientResult(); FeignClientResult responseModel = new FeignClientResult();
List result = new ArrayList(); List result = new ArrayList();
try { try {
responseModel = idxFeign.queryDefectByCodes(codes); responseModel = idxFeign.queryDefectByCodes(codes, checkId);
result = (List) responseModel.getResult(); result = (List) responseModel.getResult();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
......
...@@ -1350,4 +1350,8 @@ ...@@ -1350,4 +1350,8 @@
pci.is_ok = 2 AND pc.plan_task_detail_id = #{taskDetailId} pci.is_ok = 2 AND pc.plan_task_detail_id = #{taskDetailId}
GROUP BY cl.id; GROUP BY cl.id;
</select> </select>
<select id="getCheckIdByDetailId" resultType="java.lang.String">
select id from p_check where plan_task_detail_id = #{taskDetailId} limit 1
</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