From 37d91937990ec4fcee82ed902e30bb83620eac76 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Wed, 31 Jul 2024 08:24:46 +0800 Subject: [PATCH 1/4] =?UTF-8?q?#=20=E8=AE=BE=E5=A4=87=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E6=96=B0=E5=A2=9Ebug=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hnac/hzims/equipment/controller/EmDefinitionController.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmDefinitionController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmDefinitionController.java index 3b0cdc6..5f8ec5e 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmDefinitionController.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmDefinitionController.java @@ -18,7 +18,9 @@ import lombok.AllArgsConstructor; 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.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.Func; import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.entity.User; @@ -89,9 +91,9 @@ public class EmDefinitionController extends BladeController { @ApiOperationSupport(order = 2) @ApiOperation(value = "新增", notes = "传入EmDefinitionDTO") public R save(@Valid @RequestBody EmDefinitionDTO emDefinitionDTO) { - EmDefinitionEntity emDefinition = new EmDefinitionEntity(); - Func.copy(emDefinitionDTO, emDefinition); - return R.data(emDefinitionService.save(emDefinition)); + EmDefinitionEntity definition = BeanUtil.copy(emDefinitionDTO, EmDefinitionEntity.class); + definition.setCreateUser(AuthUtil.getUserId()); + return R.data(emDefinitionService.save(definition)); } /** From bd8f7a75c36a78569da553de0e9b00d0525533f2 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Wed, 31 Jul 2024 08:44:15 +0800 Subject: [PATCH 2/4] =?UTF-8?q?add=EF=BC=9A=E6=97=A5=E5=B8=B8=E7=BB=B4?= =?UTF-8?q?=E6=8A=A4=E8=AE=A1=E5=88=92=E6=9F=A5=E8=AF=A2=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=AB=99=E7=82=B9=E6=9D=A1=E4=BB=B6=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../maintenance/dto/OperMaintenanceMonitorReportMonthDTO.java | 3 +++ .../maintenance/service/impl/OperMaintenanceMonitorServiceImpl.java | 1 + 2 files changed, 4 insertions(+) diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceMonitorReportMonthDTO.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceMonitorReportMonthDTO.java index fc36121..e5a7cd9 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceMonitorReportMonthDTO.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceMonitorReportMonthDTO.java @@ -27,4 +27,7 @@ public class OperMaintenanceMonitorReportMonthDTO implements Serializable { @ApiModelProperty(value = "机构ID") private Long deptId; + @ApiModelProperty(value = "站点编号") + private String stationCode; + } diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceMonitorServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceMonitorServiceImpl.java index 660269c..8c61857 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceMonitorServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceMonitorServiceImpl.java @@ -49,6 +49,7 @@ public class OperMaintenanceMonitorServiceImpl implements IOperMaintenanceMonito eq(OperMaintenancePlanEntity::getIsDeleted, 0L); ge(OperMaintenancePlanEntity::getDisposeTime, startDate); lt(OperMaintenancePlanEntity::getDisposeTime, startDate.plusMonths(1)); + eq(StringUtil.isNotBlank(req.getStationCode()),OperMaintenancePlanEntity::getStationCode,req.getStationCode()); eq(Func.isNotEmpty(req.getDeptId()), OperMaintenancePlanEntity::getCreateDept, req.getDeptId()); }}); From 8c80d96ab46df55ad668157dae9fe082b7aa5bb5 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Wed, 31 Jul 2024 08:45:36 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix=EF=BC=9A=E5=B7=A1=E6=A3=80=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E4=BA=BA=E5=91=98=E5=88=97=E8=A1=A8=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7=E5=90=8D=E7=A7=B0=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../obj/services/impl/ObjectUserServiceImpl.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ObjectUserServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ObjectUserServiceImpl.java index e51682b..6ffe9ac 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ObjectUserServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ObjectUserServiceImpl.java @@ -11,7 +11,9 @@ import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.utils.CollectionUtil; +import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.ObjectUtil; +import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.entity.User; import org.springblade.system.user.feign.IUserClient; import org.springframework.stereotype.Service; @@ -53,11 +55,11 @@ public class ObjectUserServiceImpl extends ServiceImpl(); } - R> users = userClient.userListByCodeAndNameAndAccount(AuthUtil.getTenantId(),content.getUserCode(),content.getUserName(),content.getLoginName()); - if(!users.isSuccess() || CollectionUtil.isEmpty(users.getData())){ - return new ArrayList<>(); - } - Map userMap = users.getData().stream().collect(Collectors.toMap(User::getId, Function.identity())); +// R> users = userClient.userListByCodeAndNameAndAccount(AuthUtil.getTenantId(),content.getUserCode(),content.getUserName(),content.getLoginName()); +// if(!users.isSuccess() || CollectionUtil.isEmpty(users.getData())){ +// return new ArrayList<>(); +// } +// Map userMap = users.getData().stream().collect(Collectors.toMap(User::getId, Function.identity())); return objectUsers.stream().map(objectUser->{ ObjectUserListVO builder = new ObjectUserListVO(); builder.setId(objectUser.getId()); @@ -65,7 +67,8 @@ public class ObjectUserServiceImpl extends ServiceImpl Func.isNotEmpty(o.getUserId())).collect(Collectors.toList()); } } From 64628cfa4af4e2c4565f375d9c63d8de8eae3d56 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Wed, 31 Jul 2024 08:47:31 +0800 Subject: [PATCH 4/4] =?UTF-8?q?fix=EF=BC=9A=E5=B7=A1=E6=A3=80=E6=8A=A5?= =?UTF-8?q?=E5=A4=87=E6=97=A0=E6=B3=95=E6=89=A7=E8=A1=8C=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../task/service/impl/EventServiceImpl.java | 35 +++++++++------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/EventServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/EventServiceImpl.java index a0a406c..495e95e 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/EventServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/EventServiceImpl.java @@ -1,6 +1,7 @@ package com.hnac.hzinfo.inspect.task.service.impl; import com.alibaba.fastjson.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.google.common.collect.Lists; import com.hnac.hzims.operational.defect.constants.DefectConstant; @@ -92,31 +93,35 @@ public class EventServiceImpl extends ServiceImpl @Override @Transactional(rollbackFor = Exception.class) public boolean addTaskEvent(EventAddVO eventVO){ - BladeUser user = AuthUtil.getUser(); - //第一次登记时,需领用任务 if(!AuthUtil.isAdministrator()){ + // 判断当前登录人是否在任务人员列表中 ITaskService taskService = SpringUtil.getBean(ITaskService.class); TaskEntity taskEntity = taskService.getById(eventVO.getTaskId()); - TaskUserEntity taskUserEntity = taskUserService.getOne(Wrappers.lambdaQuery().eq(TaskUserEntity::getTaskId,eventVO.getTaskId()).eq(TaskUserEntity::getUserId,user == null ? eventVO.getUserId() : user.getUserId())); - if(taskUserEntity==null){ + BladeUser user = AuthUtil.getUser(); + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery() + .eq(TaskUserEntity::getTaskId, eventVO.getTaskId()) + .eq(TaskUserEntity::getUserId, user == null ? eventVO.getUserId() : user.getUserId()); + TaskUserEntity taskUserEntity = taskUserService.getOne(wrapper); + if(taskUserEntity == null){ throw new ServiceException("该任务已被别人领取"); } if(TaskContants.ClaimStatusEnum.UN_COLLECT.getStatus().equals(taskUserEntity.getClaimStatus())){ taskUserEntity.setClaimStatus(TaskContants.ClaimStatusEnum.COLLECT.getStatus()); taskUserEntity.setClaimTime(LocalDateTime.now()); taskUserService.updateById(taskUserEntity); - if(PlanContants.PlanMethodEnum.SEIZE.getMethod().equals(taskEntity.getMethod())){//如果是抢占任务,删除能够抢占此任务的其他人 - taskUserService.remove(Wrappers.lambdaQuery().eq(TaskUserEntity::getTaskId,eventVO.getTaskId()).ne(TaskUserEntity::getId,taskUserEntity.getUserId())); + if(PlanContants.PlanMethodEnum.SEIZE.getMethod().equals(taskEntity.getMethod())){ + //如果是抢占任务,删除能够抢占此任务的其他人 + LambdaQueryWrapper removeUser = Wrappers.lambdaQuery() + .eq(TaskUserEntity::getTaskId, eventVO.getTaskId()) + .ne(TaskUserEntity::getUserId, taskUserEntity.getUserId()); + taskUserService.remove(removeUser); } } } EventEntity event = BeanUtil.copy(eventVO, EventEntity.class); event.setUserId(eventVO.getUserId()); -// if(Func.isEmpty(user)){ -// event.setTenantId("000000"); -// } event.setObjectId(eventVO.getObjId()); event.setCode(CodeUtils.randomCode()); boolean success = this.save(event); @@ -160,18 +165,6 @@ public class EventServiceImpl extends ServiceImpl if(success && fileList.size()>0){ success = eventAttachmentService.saveBatch(fileList); } - //如果是问题则启动工作流引擎 - if(TaskContants.ProblemEnum.yes.getType().equals(eventVO.getIsProblem())){ - //TODO 并入缺陷处理模块 -// startFlow(user,taskObj,event); - /* OperPhenomenonEntity phenomenon = new OperPhenomenonEntity(); - phenomenon.setSourceCode(DefectConstant.DefectSourceEnum.XJ.getStatus()); - phenomenon.setSourceId(event.getId()); - phenomenon.setFinder(user == null ? eventVO.getUserId() : user.getUserId()); - phenomenon.setDescripiton(eventVO.getDescription()); - phenomenon.setInitResult(eventVO.getInitResult()); - startPhenomenonFlow(phenomenon);*/ - } checkProjectFinish(eventVO); return success; }