|
|
|
@ -16,10 +16,8 @@ import com.hnac.hzims.operational.defect.service.IOperPhenomenonService;
|
|
|
|
|
import com.hnac.hzims.operational.duty.entity.ImsDutyClassEntity; |
|
|
|
|
import com.hnac.hzims.operational.duty.entity.ImsDutyGroupEntity; |
|
|
|
|
import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity; |
|
|
|
|
import com.hnac.hzims.operational.duty.service.IImsDutyClassService; |
|
|
|
|
import com.hnac.hzims.operational.duty.service.IImsDutyGroupService; |
|
|
|
|
import com.hnac.hzims.operational.duty.service.IImsDutyMainService; |
|
|
|
|
import com.hnac.hzims.operational.duty.service.IImsDutyRecService; |
|
|
|
|
import com.hnac.hzims.operational.duty.entity.ImsDutyMainPersonEntity; |
|
|
|
|
import com.hnac.hzims.operational.duty.service.*; |
|
|
|
|
import com.hnac.hzims.operational.main.service.IMainStatisticsService; |
|
|
|
|
import com.hnac.hzims.operational.main.vo.*; |
|
|
|
|
import com.hnac.hzims.operational.maintenance.constants.MaintenanceConstant; |
|
|
|
@ -30,21 +28,15 @@ import com.hnac.hzinfo.inspect.task.entity.TaskEntity;
|
|
|
|
|
import com.hnac.hzinfo.inspect.task.feign.IInspectTaskReportClient; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.*; |
|
|
|
|
import org.springblade.system.cache.DictCache; |
|
|
|
|
import org.springblade.system.entity.Dict; |
|
|
|
|
import org.springblade.system.feign.IDictClient; |
|
|
|
|
import org.springblade.system.user.cache.UserCache; |
|
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.time.LocalDateTime; |
|
|
|
|
import java.time.LocalTime; |
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
|
import java.util.*; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
@ -64,6 +56,7 @@ public class MainStatisticsServiceImpl implements IMainStatisticsService {
|
|
|
|
|
private final IOperDefectStatisticsService operDefectStatisticsService; |
|
|
|
|
private final IImsDutyClassService iImsDutyClassService; |
|
|
|
|
private final IDictClient dictClient; |
|
|
|
|
private final IImsDutyMainPersonService imsDutyMainPersonService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -85,13 +78,21 @@ public class MainStatisticsServiceImpl implements IMainStatisticsService {
|
|
|
|
|
DutyStatisticsVO dutyStatisticsVo = new DutyStatisticsVO(); |
|
|
|
|
if(imsDutyMainEntity != null){ |
|
|
|
|
dutyStatisticsVo = BeanUtil.copy(imsDutyMainEntity, DutyStatisticsVO.class); |
|
|
|
|
//完善负责人信息
|
|
|
|
|
ImsDutyGroupEntity imsDutyGroupEntity = imsDutyGroupService.getById(dutyStatisticsVo.getDutyGroupId()); |
|
|
|
|
if(imsDutyGroupEntity != null){ |
|
|
|
|
dutyStatisticsVo.setGroupName(imsDutyGroupEntity.getGroupName()); |
|
|
|
|
|
|
|
|
|
User managerUser = UserCache.getUser(imsDutyGroupEntity.getManagerId()); |
|
|
|
|
dutyStatisticsVo.setManager(managerUser); |
|
|
|
|
if (dutyStatisticsVo.getDutyGroupId()!=null) { |
|
|
|
|
//完善负责人信息
|
|
|
|
|
ImsDutyGroupEntity imsDutyGroupEntity = imsDutyGroupService.getById(dutyStatisticsVo.getDutyGroupId()); |
|
|
|
|
if (imsDutyGroupEntity != null) { |
|
|
|
|
dutyStatisticsVo.setGroupName(imsDutyGroupEntity.getGroupName()); |
|
|
|
|
User managerUser = UserCache.getUser(imsDutyGroupEntity.getManagerId()); |
|
|
|
|
dutyStatisticsVo.setManager(managerUser); |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
List<ImsDutyMainPersonEntity> imsDutyMainPersonEntities = imsDutyMainPersonService.selectByMainId(dutyStatisticsVo.getId()); |
|
|
|
|
dutyStatisticsVo.setGroupName("灵活排班"); |
|
|
|
|
if (CollectionUtil.isNotEmpty(imsDutyMainPersonEntities)) { |
|
|
|
|
User managerUser = UserCache.getUser(imsDutyMainPersonEntities.get(0).getDutyChargePerson()); |
|
|
|
|
dutyStatisticsVo.setManager(managerUser); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
String dutyPersonIds = dutyStatisticsVo.getDutyPersonIds(); |
|
|
|
|
int num = 0; |
|
|
|
|