Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 2 years ago
parent
commit
8d77618d43
  1. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyClassController.java
  2. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyClassService.java
  3. 46
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyClassServiceImpl.java
  4. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainTemplateImpl.java
  5. 12
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyClassController.java

@ -16,6 +16,7 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -118,7 +119,10 @@ public class ImsDutyClassController extends BladeController {
@ApiOperation(value = "批量修改", notes = "imsDutyClassEntities") @ApiOperation(value = "批量修改", notes = "imsDutyClassEntities")
public R updateBatch(@Valid @RequestBody List<ImsDutyClassEntity> imsDutyClassEntities) { public R updateBatch(@Valid @RequestBody List<ImsDutyClassEntity> imsDutyClassEntities) {
//imsDutyClassService.determineThe(imsDutyClassEntities); //imsDutyClassService.determineThe(imsDutyClassEntities);
return R.status(imsDutyClassService.updateBatchById(imsDutyClassEntities)); if(CollectionUtil.isEmpty(imsDutyClassEntities)){
return R.fail("无数据");
}
return imsDutyClassService.save(imsDutyClassEntities);
} }

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyClassService.java

@ -1,8 +1,6 @@
package com.hnac.hzims.operational.duty.service; package com.hnac.hzims.operational.duty.service;
import com.hnac.hzims.operational.duty.entity.ImsDutyClassEntity; import com.hnac.hzims.operational.duty.entity.ImsDutyClassEntity;
import com.hnac.hzims.operational.duty.entity.ImsDutyClassTypeEntity;
import com.hnac.hzims.operational.duty.vo.DutyMainInfoVo;
import org.springblade.core.mp.base.BaseService; import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
@ -29,7 +27,7 @@ public interface IImsDutyClassService extends BaseService<ImsDutyClassEntity> {
List<ImsDutyClassEntity> getList(ImsDutyClassEntity imsDutyClass); List<ImsDutyClassEntity> getList(ImsDutyClassEntity imsDutyClass);
R save (List<ImsDutyClassEntity> imsDutyClassEntities);
R typeRemove(Long classTypeId); R typeRemove(Long classTypeId);

46
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyClassServiceImpl.java

@ -1,27 +1,20 @@
package com.hnac.hzims.operational.duty.service.impl; package com.hnac.hzims.operational.duty.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hnac.hzims.operational.duty.entity.DutyGroupGeneratingCapacityEntity;
import com.hnac.hzims.operational.duty.entity.ImsDutyClassEntity; import com.hnac.hzims.operational.duty.entity.ImsDutyClassEntity;
import com.hnac.hzims.operational.duty.entity.ImsDutyClassTypeEntity; import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity;
import com.hnac.hzims.operational.duty.mapper.ImsDutyClassMapper; import com.hnac.hzims.operational.duty.mapper.ImsDutyClassMapper;
import com.hnac.hzims.operational.duty.service.IDutyGroupGeneratingCapacityService; import com.hnac.hzims.operational.duty.mapper.ImsDutyMainMapper;
import com.hnac.hzims.operational.duty.service.IImsDutyClassService; import com.hnac.hzims.operational.duty.service.IImsDutyClassService;
import com.hnac.hzims.operational.duty.service.IImsDutyMainService;
import com.hnac.hzims.operational.duty.vo.DutyMainInfoVo;
import lombok.AllArgsConstructor;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 服务实现类 * 服务实现类
@ -31,6 +24,8 @@ import java.util.List;
@Service @Service
public class ImsDutyClassServiceImpl extends BaseServiceImpl<ImsDutyClassMapper, ImsDutyClassEntity> implements IImsDutyClassService { public class ImsDutyClassServiceImpl extends BaseServiceImpl<ImsDutyClassMapper, ImsDutyClassEntity> implements IImsDutyClassService {
@Autowired
private ImsDutyMainMapper imsDutyMainMapper;
@Override @Override
public R saveOrUpdateImsDutyClass(ImsDutyClassEntity imsDutyClass) { public R saveOrUpdateImsDutyClass(ImsDutyClassEntity imsDutyClass) {
if (null == imsDutyClass.getClassTypeId()) { if (null == imsDutyClass.getClassTypeId()) {
@ -56,6 +51,30 @@ public class ImsDutyClassServiceImpl extends BaseServiceImpl<ImsDutyClassMapper,
return this.baseMapper.getList(imsDutyClass); return this.baseMapper.getList(imsDutyClass);
} }
@Override
public R save(List<ImsDutyClassEntity> imsDutyClass) {
List<Long> collect = imsDutyClass.stream().map(s -> s.getId()).collect(Collectors.toList());
List<ImsDutyMainEntity> imsDutyMainEntities = imsDutyMainMapper.selectList(new LambdaQueryWrapper<ImsDutyMainEntity>() {{
in(ImsDutyMainEntity::getClassId, collect);
eq(ImsDutyMainEntity::getIsDeleted, 0);
}});
if (CollectionUtil.isNotEmpty(imsDutyMainEntities)){
return R.fail("该班次存在排班,不可修改或删除");
}else {
List<ImsDutyClassEntity> res = this.baseMapper.selectList(new LambdaQueryWrapper<ImsDutyClassEntity>() {{
in(ImsDutyClassEntity::getClassTypeId, imsDutyClass.get(0).getClassTypeId());
eq(ImsDutyClassEntity::getIsDeleted, 0);
notIn(ImsDutyClassEntity::getId, collect);
}});
if (CollectionUtil.isNotEmpty(res)){
List<Long> id = res.stream().map(s -> s.getId()).collect(Collectors.toList());
this.deleteLogic(id);
}
return R.status(this.saveOrUpdateBatch(imsDutyClass));
}
}
/** /**
* 根据班次类型Id 删除所属类型班次 * 根据班次类型Id 删除所属类型班次
* *
@ -63,6 +82,13 @@ public class ImsDutyClassServiceImpl extends BaseServiceImpl<ImsDutyClassMapper,
*/ */
@Override @Override
public R typeRemove(Long classTypeId) { public R typeRemove(Long classTypeId) {
List<ImsDutyMainEntity> imsDutyMainEntities = imsDutyMainMapper.selectList(new LambdaQueryWrapper<ImsDutyMainEntity>() {{
eq(ImsDutyMainEntity::getClassId, classTypeId);
eq(ImsDutyMainEntity::getIsDeleted, 0);
}});
if (CollectionUtil.isNotEmpty(imsDutyMainEntities)){
return R.fail("该班次存在排班,不可修改或删除");
}
List<ImsDutyClassEntity> imsDutyClassEntities = this.baseMapper.selectListByClassTypeId(classTypeId); List<ImsDutyClassEntity> imsDutyClassEntities = this.baseMapper.selectListByClassTypeId(classTypeId);
if (CollectionUtil.isNotEmpty(imsDutyClassEntities)) { if (CollectionUtil.isNotEmpty(imsDutyClassEntities)) {
return R.fail("该班次已绑定值班,不可删除!"); return R.fail("该班次已绑定值班,不可删除!");

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainTemplateImpl.java

@ -10,7 +10,6 @@ import com.hnac.hzims.operational.duty.vo.FlexibleSchedulingVo;
import com.hnac.hzims.operational.duty.vo.ImsSchedulingVo; import com.hnac.hzims.operational.duty.vo.ImsSchedulingVo;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -30,6 +29,9 @@ public class ImsDutyMainTemplateImpl extends BaseServiceImpl<ImsDutyMainTemplate
eq(ImsDutyMainTemplateEntity::getCreateDept, entity.getCreateDept()); eq(ImsDutyMainTemplateEntity::getCreateDept, entity.getCreateDept());
eq(ImsDutyMainTemplateEntity::getType, entity.getType()); eq(ImsDutyMainTemplateEntity::getType, entity.getType());
} }
if (null != entity.getDutyClassTypeId()) {
eq(ImsDutyMainTemplateEntity::getDutyClassTypeId, entity.getDutyClassTypeId());
}
}}); }});
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
for (ImsDutyMainTemplateEntity imsDutyMainTemplateEntity : list) { for (ImsDutyMainTemplateEntity imsDutyMainTemplateEntity : list) {

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

@ -319,8 +319,14 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
return imsDutyRecVOIPage; return imsDutyRecVOIPage;
} }
for (ImsDutyRecVO imsDutyRecVO : records) { for (ImsDutyRecVO imsDutyRecVO : records) {
ImsSchedulingVo imsSchedulingVo = imsDutyMainMapper.selectByIdOneV2(imsDutyRecVO.getDutyId(), null); ImsSchedulingVo imsSchedulingVo = imsDutyMainService.getByIdOneV2(imsDutyRecVO.getDutyId(), null);
imsDutyRecVO.setCarryDutyMainVo(imsDutyMainMapper.selectByPreDutyIdOne(Optional.ofNullable(imsSchedulingVo).map(ImsSchedulingVo::getId).orElse(null))); ImsSchedulingVo carryDutyMainVo = imsDutyMainMapper.selectByPreDutyIdOne(Optional.ofNullable(imsSchedulingVo).map(ImsSchedulingVo::getId).orElse(null));
if (ObjectUtil.isNotEmpty(carryDutyMainVo)){
if (StringUtil.isBlank(carryDutyMainVo.getGroupName())){
carryDutyMainVo.setGroupName("临时班组");
}
}
imsDutyRecVO.setCarryDutyMainVo(carryDutyMainVo);
if (ObjectUtil.isEmpty(imsDutyRecVO)) { if (ObjectUtil.isEmpty(imsDutyRecVO)) {
continue; continue;
} }
@ -645,7 +651,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl<ImsDutyRecMapper, Ims
} else {//已发起接班流程 判断是否提醒接班 } else {//已发起接班流程 判断是否提醒接班
ImsDutyClassEntity carryClassEntity = imsDutyClassService.getById(carryMainentity.getClassId()); ImsDutyClassEntity carryClassEntity = imsDutyClassService.getById(carryMainentity.getClassId());
Long differMinute = DateUtils.getDifferMinute(calculateDate(carryMainentity, carryClassEntity, OperationalConstants.DutyRecTypeEnum.CARRY_REC.getVal())); Long differMinute = DateUtils.getDifferMinute(calculateDate(carryMainentity, carryClassEntity, OperationalConstants.DutyRecTypeEnum.CARRY_REC.getVal()));
if (differMinute > 0 && one.getDelayStatus() == 0) { if (differMinute > 0 && one.getDelayStatus() == 0&&differMinute < 15) {
//提醒站长 接班人 交班人 //提醒站长 接班人 交班人
User admin = userClient.userByAccount(entity.getTenantId(), "admin").getData(); User admin = userClient.userByAccount(entity.getTenantId(), "admin").getData();
remondingStationV2(carryMainentity.getDutyDate(),admin, admin.getName(), classEntity, carryMainentity.getTenantId(), carryMainentity.getId(), carryMainentity.getCreateDept(), carryMainentity.getCreateUser());//提醒站长 remondingStationV2(carryMainentity.getDutyDate(),admin, admin.getName(), classEntity, carryMainentity.getTenantId(), carryMainentity.getId(), carryMainentity.getCreateDept(), carryMainentity.getCreateUser());//提醒站长

Loading…
Cancel
Save