|
|
@@ -379,8 +379,7 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
|
|
|
task.setDeletedSign(DeleteStatus.UNDELETE.getCode());
|
|
|
contractTaskMapper.insert(task);
|
|
|
}
|
|
|
- Contract contract = contractMapper.selectByPrimaryKey(contractId);
|
|
|
- return setTaskDistribution(contract);
|
|
|
+ return setTaskDistribution(contractId);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -429,8 +428,7 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
|
|
|
throw new BusinessException(new Error(ErrorConstants.NOT_ACCORD_WITH_NEXT, taskId, ""));
|
|
|
}
|
|
|
contractTaskMapper.deleteByPrimaryKey(taskId);
|
|
|
- Contract contract = contractMapper.selectByPrimaryKey(task.getContractId());
|
|
|
- return setTaskDistribution(contract);
|
|
|
+ return setTaskDistribution(task.getContractId());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -483,16 +481,18 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
|
|
|
return contractMapper.updateByPrimaryKeySelective(contract);
|
|
|
}
|
|
|
|
|
|
- private int setTaskDistribution(Contract contract){
|
|
|
- TmpTable tt = contractMapper.selectTaskDistribution(contract.getOrderNo());
|
|
|
+ private int setTaskDistribution(String contractId){
|
|
|
+ int allCount = contractMapper.selectTaskAllCount(contractId);
|
|
|
+ int disCount = contractMapper.selectTaskDisCount(contractId);
|
|
|
int taskDistribution = TaskDistributionState.NOT_DISTRIBUTION.getCode();
|
|
|
- if (tt.getAllCount() == tt.getDisCount())
|
|
|
+ if (allCount == disCount)
|
|
|
taskDistribution = TaskDistributionState.ALL_DISTRIBUTION.getCode();
|
|
|
- else if (tt.getAllCount() > tt.getDisCount() && tt.getDisCount() != 0)
|
|
|
+ else if (allCount > disCount && disCount != 0)
|
|
|
taskDistribution = TaskDistributionState.PART_DISTRIBUTION.getCode();
|
|
|
- else if (tt.getAllCount() > tt.getDisCount() && tt.getDisCount() == 0)
|
|
|
+ else if (allCount > disCount && disCount == 0)
|
|
|
taskDistribution = TaskDistributionState.NOT_DISTRIBUTION.getCode();
|
|
|
- return contractMapper.updateRepairData(tt.getOrderNo(), taskDistribution);
|
|
|
+ contractMapper.updateRepairData(contractId, taskDistribution);
|
|
|
+ return 1;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -505,8 +505,7 @@ public class TechProjectServiceImpl extends BaseMybatisDao<TechProjectMapper> im
|
|
|
task.setTaskDistributionTime(new Date());
|
|
|
task.setTaskStatus(TaskState.DISTRIBUTION.getCode());
|
|
|
contractTaskMapper.updateByPrimaryKeySelective(task);
|
|
|
- Contract contract = contractMapper.selectByPrimaryKey(task.getContractId());
|
|
|
- return setTaskDistribution(contract);
|
|
|
+ return setTaskDistribution(task.getContractId());
|
|
|
}
|
|
|
return 0;
|
|
|
}
|