|
@@ -8,12 +8,20 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.usky.common.core.bean.CommonPage;
|
|
|
import com.usky.common.security.utils.SecurityUtils;
|
|
|
import com.usky.fire.domain.PatrolInspectionEvent;
|
|
|
+import com.usky.fire.domain.PatrolInspectionPersonnel;
|
|
|
+import com.usky.fire.domain.PatrolInspectionPlanSchedule;
|
|
|
import com.usky.fire.mapper.PatrolInspectionEventMapper;
|
|
|
import com.usky.fire.service.PatrolInspectionEventService;
|
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
|
+import com.usky.fire.service.PatrolInspectionPersonnelService;
|
|
|
+import com.usky.fire.service.PatrolInspectionPlanScheduleService;
|
|
|
import com.usky.fire.service.vo.PatrolInspectionPlanRequestVO;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* <p>
|
|
|
* 事件管理表 服务实现类
|
|
@@ -24,6 +32,10 @@ import org.springframework.stereotype.Service;
|
|
|
*/
|
|
|
@Service
|
|
|
public class PatrolInspectionEventServiceImpl extends AbstractCrudService<PatrolInspectionEventMapper, PatrolInspectionEvent> implements PatrolInspectionEventService {
|
|
|
+ @Autowired
|
|
|
+ private PatrolInspectionPlanScheduleService patrolInspectionPlanScheduleService;
|
|
|
+ @Autowired
|
|
|
+ private PatrolInspectionPersonnelService patrolInspectionPersonnelService;
|
|
|
|
|
|
@Override
|
|
|
public CommonPage<PatrolInspectionEvent> patrolInspectionEventList(PatrolInspectionPlanRequestVO requestVO){
|
|
@@ -42,11 +54,33 @@ public class PatrolInspectionEventServiceImpl extends AbstractCrudService<Patrol
|
|
|
|
|
|
@Override
|
|
|
public void add(PatrolInspectionEvent patrolInspectionEvent){
|
|
|
+ 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());
|
|
|
+ }
|
|
|
+ patrolInspectionEvent.setHandleStatus(0);
|
|
|
+ patrolInspectionEvent.setTenantId(SecurityUtils.getTenantId());
|
|
|
+ patrolInspectionEvent.setCreateBy(SecurityUtils.getUsername());
|
|
|
+ patrolInspectionEvent.setCreateTime(LocalDateTime.now());
|
|
|
|
|
|
+ this.save(patrolInspectionEvent);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void edit(PatrolInspectionEvent patrolInspectionEvent){
|
|
|
+ patrolInspectionEvent.setHandleStatus(1);
|
|
|
+ patrolInspectionEvent.setHandleName(SecurityUtils.getUsername());
|
|
|
+ patrolInspectionEvent.setHandleTime(LocalDateTime.now());
|
|
|
+ this.updateById(patrolInspectionEvent);
|
|
|
|
|
|
}
|
|
|
|