Commit 4d285259 authored by chenzhao's avatar chenzhao

Merge branch 'develop_dl_3.7.0.8' of http://39.98.45.134:8090/moa/amos-boot-biz…

Merge branch 'develop_dl_3.7.0.8' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_3.7.0.8
parents b85f271b 60efd6d8
...@@ -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();
......
...@@ -201,6 +201,7 @@ public class JobService implements IJobService { ...@@ -201,6 +201,7 @@ public class JobService implements IJobService {
iPlanTaskDetailDao.saveAndFlush(action); iPlanTaskDetailDao.saveAndFlush(action);
}); });
} }
log.info("更新plan_task 和 plan_task_detail表完成,planTask:{}", planTask);
// 巡检站端与中心级数据同步 // 巡检站端与中心级数据同步
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() { TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronization() {
@Override @Override
......
...@@ -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