Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
haungxing 2 years ago
parent
commit
dacdb3c68b
  1. 14
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/scheduled/DutyRecCreateTask.java
  2. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyMainPersonService.java
  3. 10
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyRecService.java
  4. 35
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyGroupServiceImpl.java
  5. 58
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainPersonServiceImpl.java
  6. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java
  7. 1865
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java
  8. 35
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainStatisticsServiceImpl.java

14
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/scheduled/DutyRecCreateTask.java

@ -5,8 +5,6 @@ import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import static com.hnac.hzims.operational.duty.constant.DutyScheduledConstant.TASK_VALUE_MESSAGE_REMINDING_CREATE;
@ -24,13 +22,17 @@ public class DutyRecCreateTask {
* @return
* @throws Exception
*/
// @XxlJob(TASK_VALUE_MESSAGE_REMINDING_CREATE)
// public ReturnT<String> messageRemonding(String param) throws Exception {
// recService.messageRemonding();
// return new ReturnT<>("SUCCESS");
// }
@XxlJob(TASK_VALUE_MESSAGE_REMINDING_CREATE)
public ReturnT<String> messageRemonding(String param) throws Exception {
recService.messageRemonding();
public ReturnT<String> messageRemondingV2(String param) throws Exception {
recService.messageRemondingV2();
return new ReturnT<>("SUCCESS");
}
}

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyMainPersonService.java

@ -14,4 +14,7 @@ public interface IImsDutyMainPersonService extends BaseService<ImsDutyMainPerson
void doSaveBasch(List<ImsDutyMainPersonEntity> list);
List<ImsDutyMainPersonEntity> selectByMainIds(List<Long> dutyMainIds);
List<ImsDutyMainPersonEntity> selectByMainId(Long dutyMainId);
}

10
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyRecService.java

@ -6,10 +6,8 @@ import com.hnac.hzims.operational.duty.dto.ChangeShiftsRspDTO;
import com.hnac.hzims.operational.duty.entity.ImsDutyClassEntity;
import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity;
import com.hnac.hzims.operational.duty.entity.ImsDutyRecEntity;
import com.hnac.hzims.operational.duty.vo.ImsDutyQrCodeVo;
import com.hnac.hzims.operational.duty.vo.ImsDutyRecVO;
import com.hnac.hzims.operational.duty.vo.ImsRecVo;
import com.hnac.hzims.operational.duty.vo.ImsSchedulingVo;
import com.hnac.hzinfo.inspect.plan.vo.PlanVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
@ -62,9 +60,15 @@ public interface IImsDutyRecService extends BaseService<ImsDutyRecEntity> {
String getQRCode();
/**
* 消息提醒 20230414之后已弃用
* 根据黄兴的消息中心模板更新为新的V2的接口
*/
// void messageRemonding();
/**
* 消息提醒
*/
void messageRemonding();
void messageRemondingV2();
/**
* 消息提醒测试

35
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyGroupServiceImpl.java

@ -3,12 +3,10 @@ package com.hnac.hzims.operational.duty.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.operational.duty.entity.ImsDutyGroupEntity;
import com.hnac.hzims.operational.duty.entity.ImsDutyGroupPEntity;
import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity;
import com.hnac.hzims.operational.duty.entity.ImsDutyRecEntity;
import com.hnac.hzims.operational.duty.entity.*;
import com.hnac.hzims.operational.duty.mapper.ImsDutyGroupMapper;
import com.hnac.hzims.operational.duty.mapper.ImsDutyGroupPMapper;
import com.hnac.hzims.operational.duty.mapper.ImsDutyMainPersonMapper;
import com.hnac.hzims.operational.duty.service.IImsDutyGroupPService;
import com.hnac.hzims.operational.duty.service.IImsDutyGroupService;
import com.hnac.hzims.operational.duty.service.IImsDutyMainService;
@ -48,7 +46,8 @@ public class ImsDutyGroupServiceImpl extends BaseServiceImpl<ImsDutyGroupMapper,
@Autowired
private ImsDutyGroupPMapper imsDutyGroupPMapper;
@Autowired
private ImsDutyMainPersonMapper imsDutyMainPersonMapper;
@Autowired
private IUserClient userClient;
@ -292,17 +291,33 @@ public class ImsDutyGroupServiceImpl extends BaseServiceImpl<ImsDutyGroupMapper,
if (CollectionUtil.isNotEmpty(list1)) {
ImsDutyMainEntity imsDutyMainEntity = list1.get(0);
ImsDutyGroupEntity groupEntity = this.baseMapper.selectById(imsDutyMainEntity.getDutyGroupId());
String userName = "";
if (null != groupEntity.getManagerId()) {
R<User> userR = userClient.userInfoById(groupEntity.getManagerId());
Long managerId = null;
String groupName = "";
if (imsDutyMainEntity.getDutyGroupId()!=null) {
ImsDutyGroupEntity groupEntity = this.baseMapper.selectById(imsDutyMainEntity.getDutyGroupId());
if (null != groupEntity.getManagerId()){
managerId=groupEntity.getManagerId();
}
groupName=groupEntity.getGroupName();
}else {
ImsDutyMainPersonEntity imsDutyMainPersonEntity = imsDutyMainPersonMapper.selectOne(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
eq(ImsDutyMainPersonEntity::getDutyMainId, imsDutyMainEntity.getId());
last(" limit 1");
}});
managerId=imsDutyMainPersonEntity.getDutyChargePerson();
groupName="灵活排班";
}
if (managerId!=null) {
R<User> userR = userClient.userInfoById(managerId);
if (userR.isSuccess() && ObjectUtil.isNotEmpty(userR.getData())) {
userName = userR.getData().getName();
}
}
return R.fail(groupEntity.getGroupName() + userName +
"是负责人,且存在排班不能直接删除,请先更换" + groupEntity.getGroupName() + "负责人,再进行删除操作!");
return R.fail(groupName +"-"+ userName +
"是负责人,且存在排班不能直接删除,请先更换" + groupName + "负责人,再进行删除操作!");
}
}
imsDutyGroupPService.deleteBatch(ids);

58
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainPersonServiceImpl.java

@ -1,47 +1,19 @@
package com.hnac.hzims.operational.duty.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import com.hnac.hzims.monitor.utils.DateUtils;
import com.hnac.hzims.operational.defect.constants.DefectConstant;
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity;
import com.hnac.hzims.operational.defect.mapper.OperPhenomenonMapper;
import com.hnac.hzims.operational.duty.entity.*;
import com.hnac.hzims.operational.duty.enume.DutyRecStatus;
import com.hnac.hzims.operational.duty.enume.JoinStatus;
import com.hnac.hzims.operational.duty.entity.ImsDutyMainPersonEntity;
import com.hnac.hzims.operational.duty.mapper.*;
import com.hnac.hzims.operational.duty.scheduled.ThreadTask;
import com.hnac.hzims.operational.duty.service.IImsDutyGroupPService;
import com.hnac.hzims.operational.duty.service.IImsDutyMainPersonService;
import com.hnac.hzims.operational.duty.service.IImsDutyMainService;
import com.hnac.hzims.operational.duty.service.IImsDutyMainTemplateService;
import com.hnac.hzims.operational.duty.vo.*;
import com.hnac.hzims.operational.main.vo.DutyPersonalReportVO;
import com.hnac.hzims.operational.report.vo.DutyReportVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.*;
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 org.springframework.transaction.annotation.Transactional;
import java.sql.Time;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.stream.Collectors;
import java.util.List;
/**
* 服务实现类
@ -71,4 +43,28 @@ public class ImsDutyMainPersonServiceImpl extends BaseServiceImpl<ImsDutyMainPer
public void doSaveBasch(List<ImsDutyMainPersonEntity> list) {
this.saveBatch(list);
}
@Override
public List<ImsDutyMainPersonEntity> selectByMainIds(List<Long> dutyMainIds) {
List<ImsDutyMainPersonEntity> imsDutyMainPersonEntities = this.baseMapper.selectList(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
in(ImsDutyMainPersonEntity::getDutyMainId, dutyMainIds);
}});
if (CollectionUtils.isNotEmpty(imsDutyMainPersonEntities)){
return imsDutyMainPersonEntities;
}
return null;
}
@Override
public List<ImsDutyMainPersonEntity> selectByMainId(Long dutyMainId) {
List<ImsDutyMainPersonEntity> imsDutyMainPersonEntities = this.baseMapper.selectList(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
eq(ImsDutyMainPersonEntity::getDutyMainId, dutyMainId);
}});
if (CollectionUtils.isNotEmpty(imsDutyMainPersonEntities)){
return imsDutyMainPersonEntities;
}
return null;
}
}

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainServiceImpl.java

@ -160,6 +160,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
imsSchedulingVo.setGroupName("临时班组");
ImsDutyMainPersonEntity imsDutyMainPersonEntity = imsDutyMainPersonMapper.selectOne(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
eq(ImsDutyMainPersonEntity::getDutyMainId, id);
last(" limit 1");
}});
imsSchedulingVo.setManagerId(imsDutyMainPersonEntity.getDutyChargePerson());
} else {
@ -1110,7 +1111,6 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
eq(DutyGroupGeneratingCapacityEntity::getEndTime, dutyMainInfoVo.getEndTime());
eq(DutyGroupGeneratingCapacityEntity::getDutyDept, dutyMainInfoVo.getCreateDept());
eq(DutyGroupGeneratingCapacityEntity::getDateTime, DateUtil.format(dutyMainInfoVo.getDutyDate(), DateUtil.PATTERN_DATE));
eq(DutyGroupGeneratingCapacityEntity::getGroupId, dutyMainInfoVo.getDutyGroupId());
}});
if (CollectionUtil.isNotEmpty(generatingCapacityList)) {
double generatingCapacity = generatingCapacityList.stream().mapToDouble(DutyGroupGeneratingCapacityEntity::getGeneratingCapacity).sum();
@ -1376,7 +1376,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
*/
private NextDutyInfoVo getUpDutyInfo(DutyInfoVo item) {
DutyMainInfoVo dutyMainInfoVo = this.baseMapper.queryDutyInfoV2(item.getPreDutyId());
if (null == dutyMainInfoVo.getGroupName()) {
if (null == dutyMainInfoVo.getDutyGroupId()) {
ImsDutyMainPersonEntity imsDutyMainPersonEntity = imsDutyMainPersonMapper.selectOne(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
eq(ImsDutyMainPersonEntity::getDutyMainId, dutyMainInfoVo.getId());
}});
@ -1634,7 +1634,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
public List<DutyMainInfoVo> getDutyDataV2(Long deptId) {
List<DutyMainInfoVo> dutyMainInfoVos = this.baseMapper.selectDutyMainInfoVoV2(deptId);
dutyMainInfoVos = dutyMainInfoVos.stream().map(s -> {
if (null == s.getGroupName()) {
if (null == s.getDutyGroupId()) {
ImsDutyMainPersonEntity imsDutyMainPersonEntity = imsDutyMainPersonMapper.selectOne(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
eq(ImsDutyMainPersonEntity::getDutyMainId, s.getId());
}});
@ -1658,7 +1658,7 @@ public class ImsDutyMainServiceImpl extends BaseServiceImpl<ImsDutyMainMapper, I
@Override
public DutyMainInfoVo getNextDutyDataV2(Long parentId) {
DutyMainInfoVo dutyMainInfoVo = this.baseMapper.selectDutyMainInfoSignV2(parentId);
if (null == dutyMainInfoVo.getGroupName()) {
if (null == dutyMainInfoVo.getDutyGroupId()) {
ImsDutyMainPersonEntity imsDutyMainPersonEntity = imsDutyMainPersonMapper.selectOne(new LambdaQueryWrapper<ImsDutyMainPersonEntity>() {{
eq(ImsDutyMainPersonEntity::getDutyMainId, dutyMainInfoVo.getId());
}});

1865
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java

File diff suppressed because it is too large Load Diff

35
hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/MainStatisticsServiceImpl.java

@ -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;

Loading…
Cancel
Save