From c96e44ceedf98afe9541b49172a3d80d983442a0 Mon Sep 17 00:00:00 2001 From: 潘志宝 <979469083@qq.com> Date: 星期六, 02 十一月 2024 20:39:50 +0800 Subject: [PATCH] 计划数据 --- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/item/service/impl/IndItemServiceImpl.java | 2 +- /dev/null | 11 ----------- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/DevCameraDahuaTask.java | 1 + iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/plan/item/vo/PlanItemSaveReqVO.java | 4 ---- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/plan/item/service/impl/PlanItemServiceImpl.java | 12 +++++++----- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java | 10 +--------- iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/common/enums/IncreaseCodeEnum.java | 11 +++++++++++ 7 files changed, 21 insertions(+), 30 deletions(-) diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/common/enums/IncreaseCodeEnum.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/common/enums/IncreaseCodeEnum.java new file mode 100644 index 0000000..c164a20 --- /dev/null +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/common/enums/IncreaseCodeEnum.java @@ -0,0 +1,11 @@ +package com.iailab.module.data.common.enums; + +/** + * 编号自增主键 + * + * @author PanZhibao + * @date 2021年05月24日 9:41 + */ +public enum IncreaseCodeEnum { + POINT_M, POINT_C, POINT_F, IND_A, IND_D, IND_C, PLAN; +} diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/item/service/impl/IndItemServiceImpl.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/item/service/impl/IndItemServiceImpl.java index 39fb790..50ac0c4 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/item/service/impl/IndItemServiceImpl.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/ind/item/service/impl/IndItemServiceImpl.java @@ -16,7 +16,7 @@ import com.iailab.module.data.ind.item.vo.IndItemPageReqVO; import com.iailab.module.data.ind.item.vo.IndItemRespVO; import com.iailab.module.data.ind.item.vo.IndItemSaveReqVO; -import com.iailab.module.data.point.common.IncreaseCodeEnum; +import com.iailab.module.data.common.enums.IncreaseCodeEnum; import com.iailab.module.data.point.service.DaSequenceNumService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/DevCameraDahuaTask.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/DevCameraDahuaTask.java index 5eed5c8..a3ef27d 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/DevCameraDahuaTask.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/job/task/DevCameraDahuaTask.java @@ -71,6 +71,7 @@ } } logger.info("devCameraDahuaTask定时任务执行完成:" + LocalDateTime.now()); + } catch (Exception ex) { ex.printStackTrace(); logger.info("devCameraDahuaTask定时任务失败时间:" + LocalDateTime.now()); diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/plan/item/service/impl/PlanItemServiceImpl.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/plan/item/service/impl/PlanItemServiceImpl.java index c3740dd..ccbe1e7 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/plan/item/service/impl/PlanItemServiceImpl.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/plan/item/service/impl/PlanItemServiceImpl.java @@ -4,16 +4,14 @@ import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.service.impl.BaseServiceImpl; import com.iailab.framework.common.util.object.BeanUtils; -import com.iailab.module.data.ind.item.dao.IndItemDao; -import com.iailab.module.data.ind.item.entity.IndItemEntity; -import com.iailab.module.data.ind.item.service.IndItemService; -import com.iailab.module.data.ind.item.vo.IndItemPageReqVO; -import com.iailab.module.data.ind.item.vo.IndItemSaveReqVO; import com.iailab.module.data.plan.item.dao.PlanItemDao; import com.iailab.module.data.plan.item.entity.PlanItemEntity; import com.iailab.module.data.plan.item.service.PlanItemService; import com.iailab.module.data.plan.item.vo.PlanItemPageReqVO; import com.iailab.module.data.plan.item.vo.PlanItemSaveReqVO; +import com.iailab.module.data.common.enums.IncreaseCodeEnum; +import com.iailab.module.data.point.service.DaSequenceNumService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.Date; @@ -27,6 +25,9 @@ */ @Service public class PlanItemServiceImpl extends BaseServiceImpl<PlanItemDao, PlanItemEntity> implements PlanItemService { + + @Autowired + private DaSequenceNumService daSequenceNumService; @Override public PageResult<PlanItemEntity> page(PlanItemPageReqVO reqVO) { @@ -44,6 +45,7 @@ public void create(PlanItemSaveReqVO createReqVO) { PlanItemEntity entity = BeanUtils.toBean(createReqVO, PlanItemEntity.class); entity.setId(UUID.randomUUID().toString()); + entity.setItemNo(daSequenceNumService.getAndIncreaseByCode(IncreaseCodeEnum.PLAN.name())); entity.setCreateTime(new Date()); baseDao.insert(entity); } diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/plan/item/vo/PlanItemSaveReqVO.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/plan/item/vo/PlanItemSaveReqVO.java index 60fe16f..31a2d55 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/plan/item/vo/PlanItemSaveReqVO.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/plan/item/vo/PlanItemSaveReqVO.java @@ -24,10 +24,6 @@ @NotNull(message = "名称不能为空") private String itemName; - @Schema(description = "指标类型", requiredMode = Schema.RequiredMode.REQUIRED) - @NotNull(message = "指标类型不能为空") - private String itemType; - @Schema(description = "指标分类", requiredMode = Schema.RequiredMode.REQUIRED) @NotNull(message = "指标分类不能为空") private String itemCategory; diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/common/IncreaseCodeEnum.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/common/IncreaseCodeEnum.java deleted file mode 100644 index 4e6fb45..0000000 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/common/IncreaseCodeEnum.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.iailab.module.data.point.common; - -/** - * 编号自增主键 - * - * @author PanZhibao - * @date 2021年05月24日 9:41 - */ -public enum IncreaseCodeEnum { - POINT_M, POINT_C, POINT_F, IND_A, IND_D, IND_C; -} diff --git a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java index ac053f1..a761e3b 100644 --- a/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java +++ b/iailab-module-data/iailab-module-data-biz/src/main/java/com/iailab/module/data/point/service/impl/DaPointServiceImpl.java @@ -1,23 +1,18 @@ package com.iailab.module.data.point.service.impl; import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONArray; import com.baomidou.dynamic.datasource.annotation.DSTransactional; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.google.common.annotations.VisibleForTesting; -import com.iailab.framework.common.exception.ServiceException; import com.iailab.framework.common.pojo.PageResult; import com.iailab.framework.common.util.object.BeanUtils; import com.iailab.framework.common.util.object.ConvertUtils; -import com.iailab.framework.datapermission.core.util.DataPermissionUtils; -import com.iailab.framework.mybatis.core.query.LambdaQueryWrapperX; import com.iailab.module.data.channel.common.service.ChannelSourceService; import com.iailab.module.data.common.enums.CommonConstant; import com.iailab.module.data.common.enums.IsEnableEnum; -import com.iailab.module.data.point.common.IncreaseCodeEnum; +import com.iailab.module.data.common.enums.IncreaseCodeEnum; import com.iailab.module.data.point.common.PointTypeEnum; import com.iailab.module.data.point.dao.DaPointDao; import com.iailab.module.data.point.dto.DaMeasurePointDTO; @@ -32,14 +27,11 @@ import com.iailab.module.infra.api.config.ConfigApi; import org.apache.commons.lang3.ObjectUtils; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.util.*; - -import com.iailab.module.data.enums.ErrorCodeConstants; import static com.iailab.framework.common.exception.util.ServiceExceptionUtil.exception; import static com.iailab.module.data.enums.ErrorCodeConstants.*; -- Gitblit v1.9.3