|
@@ -20,6 +20,7 @@ import com.usky.fire.service.PatrolInspectionPersonnelService;
|
|
|
import com.usky.fire.service.PatrolInspectionPlanScheduleService;
|
|
|
import com.usky.fire.service.config.rabbitmq.RabbitMQConfig;
|
|
|
import com.usky.fire.service.vo.PatrolInspectionPlanRequestVO;
|
|
|
+import org.apache.catalina.security.SecurityUtil;
|
|
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -72,20 +73,27 @@ public class PatrolInspectionEventServiceImpl extends AbstractCrudService<Patrol
|
|
|
|
|
|
Map<Object,Object> map = new HashMap<>();
|
|
|
|
|
|
- Integer planId = patrolInspectionEvent.getPlanId();
|
|
|
- LambdaQueryWrapper<PatrolInspectionPlanSchedule> queryWrapper = Wrappers.lambdaQuery();
|
|
|
- queryWrapper.eq(PatrolInspectionPlanSchedule::getPlanId,planId);
|
|
|
- List<PatrolInspectionPlanSchedule> list = patrolInspectionPlanScheduleService.list(queryWrapper);
|
|
|
- if(list.size() > 0){
|
|
|
- Integer personnelId = list.get(0).getPersonnelId();
|
|
|
- LambdaQueryWrapper<PatrolInspectionPersonnel> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
- queryWrapper1.eq(PatrolInspectionPersonnel::getId,personnelId);
|
|
|
- PatrolInspectionPersonnel one = patrolInspectionPersonnelService.getOne(queryWrapper1);
|
|
|
-
|
|
|
- patrolInspectionEvent.setPersonnelId(personnelId);
|
|
|
- patrolInspectionEvent.setPersonnelName(one.getFullName());
|
|
|
- map.put("idCard",one.getIdCard());
|
|
|
+ if(null != patrolInspectionEvent.getPlanId()){
|
|
|
+ Integer planId = patrolInspectionEvent.getPlanId();
|
|
|
+ LambdaQueryWrapper<PatrolInspectionPlanSchedule> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(PatrolInspectionPlanSchedule::getPlanId,planId);
|
|
|
+ List<PatrolInspectionPlanSchedule> list = patrolInspectionPlanScheduleService.list(queryWrapper);
|
|
|
+ if(list.size() > 0){
|
|
|
+ Integer personnelId = list.get(0).getPersonnelId();
|
|
|
+ LambdaQueryWrapper<PatrolInspectionPersonnel> queryWrapper1 = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper1.eq(PatrolInspectionPersonnel::getId,personnelId);
|
|
|
+ PatrolInspectionPersonnel one = patrolInspectionPersonnelService.getOne(queryWrapper1);
|
|
|
+
|
|
|
+ patrolInspectionEvent.setPersonnelId(personnelId);
|
|
|
+ patrolInspectionEvent.setPersonnelName(one.getFullName());
|
|
|
+ map.put("idCard",one.getIdCard());
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ Long userId = SecurityUtils.getUserId();
|
|
|
+ patrolInspectionEvent.setPersonnelId(userId.intValue());
|
|
|
+ patrolInspectionEvent.setPersonnelName(SecurityUtils.getUsername());
|
|
|
}
|
|
|
+
|
|
|
patrolInspectionEvent.setHandleStatus(0);
|
|
|
patrolInspectionEvent.setTenantId(SecurityUtils.getTenantId());
|
|
|
patrolInspectionEvent.setCreateBy(SecurityUtils.getUsername());
|