|
|
|
@ -16,6 +16,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springblade.core.tool.utils.CollectionUtil; |
|
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
|
import org.springblade.system.user.cache.UserCache; |
|
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
@ -97,13 +98,17 @@ public class DutyServiceImpl extends BaseServiceImpl<DutyMapper, ImsDutyMainEnti
|
|
|
|
|
eq(ImsDutyMainPersonEntity::getDutyMainId, dutyMainInfoVo.getId()); |
|
|
|
|
last(" LIMIT 1"); |
|
|
|
|
}}); |
|
|
|
|
if(ObjectUtil.isNotEmpty(imsDutyMainPersonEntity)){ |
|
|
|
|
dutyMainInfoVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson().toString()); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(dutyMainInfoVo.getDutyGroupId()); |
|
|
|
|
if(ObjectUtil.isNotEmpty(imsDutyGroupEntity)){ |
|
|
|
|
dutyMainInfoVo.setGroupName(imsDutyGroupEntity.getGroupName()); |
|
|
|
|
dutyMainInfoVo.setDutyGroupId(imsDutyGroupEntity.getId()); |
|
|
|
|
dutyMainInfoVo.setManagerId(imsDutyGroupEntity.getManagerId().toString()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (ObjectUtil.isEmpty(dutyMainInfoVo)) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
@ -140,12 +145,14 @@ public class DutyServiceImpl extends BaseServiceImpl<DutyMapper, ImsDutyMainEnti
|
|
|
|
|
NextDutyInfoVo dutyInfoVo = new NextDutyInfoVo(); |
|
|
|
|
dutyInfoVo.setGroupName(dutyMainInfoVo.getGroupName()); |
|
|
|
|
dutyInfoVo.setClassName(dutyMainInfoVo.getClassName()); |
|
|
|
|
if(StringUtil.isNotBlank(dutyMainInfoVo.getManagerId())){ |
|
|
|
|
// 负责人
|
|
|
|
|
User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId())); |
|
|
|
|
if (ObjectUtil.isNotEmpty(user)) { |
|
|
|
|
dutyInfoVo.setManagerName(user.getRealName()); |
|
|
|
|
dutyInfoVo.setManagerPhone(user.getPhone()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
dutyInfoVo.setGeneratingCapacity(0); |
|
|
|
|
return dutyInfoVo; |
|
|
|
|
} |
|
|
|
@ -165,13 +172,17 @@ public class DutyServiceImpl extends BaseServiceImpl<DutyMapper, ImsDutyMainEnti
|
|
|
|
|
eq(ImsDutyMainPersonEntity::getDutyMainId, dutyMainInfoVo.getId()); |
|
|
|
|
last("limit 1"); |
|
|
|
|
}}); |
|
|
|
|
if(ObjectUtil.isNotEmpty(imsDutyMainPersonEntity)){ |
|
|
|
|
dutyMainInfoVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson().toString()); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
ImsDutyGroupEntity imsDutyGroupEntity = dutyGroupMapper.selectById(dutyMainInfoVo.getDutyGroupId()); |
|
|
|
|
if(ObjectUtil.isNotEmpty(imsDutyGroupEntity)){ |
|
|
|
|
dutyMainInfoVo.setGroupName(imsDutyGroupEntity.getGroupName()); |
|
|
|
|
dutyMainInfoVo.setDutyGroupId(imsDutyGroupEntity.getId()); |
|
|
|
|
dutyMainInfoVo.setManagerId(imsDutyGroupEntity.getManagerId().toString()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (ObjectUtil.isEmpty(dutyMainInfoVo)) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
@ -180,12 +191,14 @@ public class DutyServiceImpl extends BaseServiceImpl<DutyMapper, ImsDutyMainEnti
|
|
|
|
|
dutyMainInfoVo.setDateTime(dutyMainInfoVo.getDateTime()); |
|
|
|
|
dutyMainInfoVo.setStartTime(dutyMainInfoVo.getStartTime()); |
|
|
|
|
dutyMainInfoVo.setEndTime(dutyMainInfoVo.getEndTime()); |
|
|
|
|
if(StringUtil.isNotBlank(dutyMainInfoVo.getManagerId())){ |
|
|
|
|
// 负责人
|
|
|
|
|
User user = UserCache.getUser(Long.valueOf(dutyMainInfoVo.getManagerId())); |
|
|
|
|
if (ObjectUtil.isNotEmpty(user)) { |
|
|
|
|
dutyMainInfoVo.setManagerName(user.getRealName()); |
|
|
|
|
dutyMainInfoVo.setManagerPhone(user.getPhone()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return dutyMainInfoVo; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|