From 1bff74c4eee4a9c38b30bb0e319577e641a605cf Mon Sep 17 00:00:00 2001 From: tyty Date: Tue, 9 May 2023 19:44:24 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=80=BC=E7=8F=AD?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=A8=A1=E6=9D=BF=E7=9A=84=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzims/operational/duty/service/impl/ImsDutyMainTemplateImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainTemplateImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainTemplateImpl.java index 7e91c96..bacbf05 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyMainTemplateImpl.java +++ b/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 lombok.extern.slf4j.Slf4j; import org.springblade.core.mp.base.BaseServiceImpl; -import org.springblade.core.mp.support.Condition; import org.springblade.core.tool.utils.CollectionUtil; import org.springframework.stereotype.Service; @@ -30,6 +29,9 @@ public class ImsDutyMainTemplateImpl extends BaseServiceImpl Date: Wed, 10 May 2023 08:27:09 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=80=BC=E7=8F=ADbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../duty/controller/ImsDutyClassController.java | 6 ++- .../duty/service/IImsDutyClassService.java | 4 +- .../duty/service/impl/ImsDutyClassServiceImpl.java | 46 +++++++++++++++++----- 3 files changed, 42 insertions(+), 14 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyClassController.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyClassController.java index dc99dc1..b464ca2 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/controller/ImsDutyClassController.java +++ b/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.Query; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; @@ -118,7 +119,10 @@ public class ImsDutyClassController extends BladeController { @ApiOperation(value = "批量修改", notes = "imsDutyClassEntities") public R updateBatch(@Valid @RequestBody List imsDutyClassEntities) { //imsDutyClassService.determineThe(imsDutyClassEntities); - return R.status(imsDutyClassService.updateBatchById(imsDutyClassEntities)); + if(CollectionUtil.isEmpty(imsDutyClassEntities)){ + return R.fail("无数据"); + } + return imsDutyClassService.save(imsDutyClassEntities); } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyClassService.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyClassService.java index 038ac96..76c7d53 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/IImsDutyClassService.java +++ b/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; 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.tool.api.R; @@ -29,7 +27,7 @@ public interface IImsDutyClassService extends BaseService { List getList(ImsDutyClassEntity imsDutyClass); - + R save (List imsDutyClassEntities); R typeRemove(Long classTypeId); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyClassServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyClassServiceImpl.java index 57cacc5..cb31c38 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyClassServiceImpl.java +++ b/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; 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.ImsDutyClassTypeEntity; +import com.hnac.hzims.operational.duty.entity.ImsDutyMainEntity; 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.IImsDutyMainService; -import com.hnac.hzims.operational.duty.vo.DutyMainInfoVo; -import lombok.AllArgsConstructor; import org.apache.commons.lang3.StringUtils; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.tool.api.R; 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.stereotype.Service; -import java.util.Collection; import java.util.List; +import java.util.stream.Collectors; /** * 服务实现类 @@ -31,6 +24,8 @@ import java.util.List; @Service public class ImsDutyClassServiceImpl extends BaseServiceImpl implements IImsDutyClassService { + @Autowired + private ImsDutyMainMapper imsDutyMainMapper; @Override public R saveOrUpdateImsDutyClass(ImsDutyClassEntity imsDutyClass) { if (null == imsDutyClass.getClassTypeId()) { @@ -56,6 +51,30 @@ public class ImsDutyClassServiceImpl extends BaseServiceImpl imsDutyClass) { + List collect = imsDutyClass.stream().map(s -> s.getId()).collect(Collectors.toList()); + List imsDutyMainEntities = imsDutyMainMapper.selectList(new LambdaQueryWrapper() {{ + in(ImsDutyMainEntity::getClassId, collect); + eq(ImsDutyMainEntity::getIsDeleted, 0); + }}); + if (CollectionUtil.isNotEmpty(imsDutyMainEntities)){ + return R.fail("该班次存在排班,不可修改或删除"); + }else { + List res = this.baseMapper.selectList(new LambdaQueryWrapper() {{ + in(ImsDutyClassEntity::getClassTypeId, imsDutyClass.get(0).getClassTypeId()); + eq(ImsDutyClassEntity::getIsDeleted, 0); + notIn(ImsDutyClassEntity::getId, collect); + }}); + if (CollectionUtil.isNotEmpty(res)){ + List id = res.stream().map(s -> s.getId()).collect(Collectors.toList()); + this.deleteLogic(id); + } + return R.status(this.saveOrUpdateBatch(imsDutyClass)); + } + } + + /** * 根据班次类型Id 删除所属类型班次 * @@ -63,6 +82,13 @@ public class ImsDutyClassServiceImpl extends BaseServiceImpl imsDutyMainEntities = imsDutyMainMapper.selectList(new LambdaQueryWrapper() {{ + eq(ImsDutyMainEntity::getClassId, classTypeId); + eq(ImsDutyMainEntity::getIsDeleted, 0); + }}); + if (CollectionUtil.isNotEmpty(imsDutyMainEntities)){ + return R.fail("该班次存在排班,不可修改或删除"); + } List imsDutyClassEntities = this.baseMapper.selectListByClassTypeId(classTypeId); if (CollectionUtil.isNotEmpty(imsDutyClassEntities)) { return R.fail("该班次已绑定值班,不可删除!"); From 262131a9cb64b38b412b39712bf56f3ca09d7347 Mon Sep 17 00:00:00 2001 From: tyty Date: Wed, 10 May 2023 11:40:52 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=80=BC=E7=8F=ADbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../operational/duty/service/impl/ImsDutyRecServiceImpl.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java index 1e0bcb3..a60e1fa 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java @@ -319,8 +319,14 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl 0 && one.getDelayStatus() == 0) { + if (differMinute > 0 && one.getDelayStatus() == 0&&differMinute < 15) { //提醒站长 接班人 交班人 User admin = userClient.userByAccount(entity.getTenantId(), "admin").getData(); remondingStationV2(carryMainentity.getDutyDate(),admin, admin.getName(), classEntity, carryMainentity.getTenantId(), carryMainentity.getId(), carryMainentity.getCreateDept(), carryMainentity.getCreateUser());//提醒站长 From 7ec4a635bab5ff378f5b8e492ccf4cfe46c6d6b7 Mon Sep 17 00:00:00 2001 From: tyty Date: Wed, 10 May 2023 11:46:55 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=80=BC=E7=8F=ADbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java index a60e1fa..a5de84f 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsDutyRecServiceImpl.java @@ -322,7 +322,7 @@ public class ImsDutyRecServiceImpl extends BaseServiceImpl