Commit 68873b35 authored by litengwei's avatar litengwei

巡检BUG

parent a128e36c
...@@ -474,21 +474,22 @@ ...@@ -474,21 +474,22 @@
DROP PROCEDURE IF EXISTS `updatePlanTask`; DROP PROCEDURE IF EXISTS `updatePlanTask`;
</createProcedure> </createProcedure>
</changeSet> </changeSet>
<changeSet author="gaodongdong" id="1610421278000-21-230419" runAlways="true"> <changeSet author="gaodongdong" id="1610421278000-21-230915" runAlways="true">
<createProcedure procedureName="updatePlanTask" > <createProcedure procedureName="updatePlanTask" >
CREATE PROCEDURE `updatePlanTask`(IN `planTaskId` BIGINT,IN `pointId` BIGINT,IN `planTaskDetailId` BIGINT,IN `executorId` BIGINT) CREATE DEFINER=`root`@`%` PROCEDURE `updatePlanTask`(IN `planTaskId` BIGINT,IN `pointId` BIGINT,IN `planTaskDetailId` BIGINT,IN `executorId` BIGINT)
BEGIN BEGIN
declare num int ; declare num int ;
declare orgCode VARCHAR(50) ; declare orgCode VARCHAR(50) ;
declare currentTaskNum int ; declare currentTaskNum int ;
declare pointNum int ;
update p_plan_task_detail set is_finish = 1 where id=planTaskDetailId; update p_plan_task_detail set is_finish = 1 where id=planTaskDetailId;
select finish_num, org_code from p_plan_task where id = planTaskId into num, orgCode; select finish_num, org_code, point_num from p_plan_task where id = planTaskId into num, orgCode, pointNum;
select count(1) into currentTaskNum from p_plan_task_detail where task_no = planTaskId and is_finish in(0,2); select count(1) into currentTaskNum from p_plan_task_detail where task_no = planTaskId and is_finish in(0,2);
UPDATE p_plan_task_detail SET executor_id = executorId,executor_date = current_timestamp where id = planTaskDetailId; UPDATE p_plan_task_detail SET executor_id = executorId,executor_date = current_timestamp where id = planTaskDetailId;
if currentTaskNum > 0 THEN if currentTaskNum > 0 THEN
update p_plan_task set finish_num = (num + 1) where id = planTaskId; update p_plan_task set finish_num = (num + 1) where id = planTaskId and pointNum > num;
ELSE ELSE
update p_plan_task set finish_num = (num + 1), finish_status = 2 where id = planTaskId; update p_plan_task set finish_num = (num + 1), finish_status = 2 where id = planTaskId and pointNum > num;
end if; end if;
if executorId > 0 then if executorId > 0 then
call planTaskStatistics(executorId, null, orgCode); call planTaskStatistics(executorId, null, orgCode);
......
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