From b16d91a0170c6fc03a1ed17841cdc71bcdd24fc9 Mon Sep 17 00:00:00 2001 From: haungxing <1203316822@qq.com> Date: Tue, 4 Jul 2023 15:04:15 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E5=B7=A1=E6=A3=80=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=97=B6=E7=BC=96=E7=A0=81=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E7=94=9F=E6=88=90=20#=20feign=E6=8E=A5=E5=8F=A3=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E5=B7=A1=E6=A3=80=E9=A1=B9=E7=9B=AE=E5=B7=A1=E6=A3=80?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E8=87=AA=E5=8A=A8=E5=A1=AB=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/hnac/hzinfo/inspect/obj/feign/ContentDefinitionClient.java | 4 ++++ .../com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java | 2 ++ 2 files changed, 6 insertions(+) diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ContentDefinitionClient.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ContentDefinitionClient.java index 5cf8228..4c75758 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ContentDefinitionClient.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ContentDefinitionClient.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; import com.hnac.hzinfo.inspect.obj.dto.ContentDefinitionDTO; import com.hnac.hzinfo.inspect.obj.entity.ContentDefinitionEntity; import com.hnac.hzinfo.inspect.obj.services.IContentDefinitionService; +import com.hnac.hzinfo.inspect.obj.utils.CodeUtils; import com.hnac.hzinfo.inspect.obj.vo.ContentDefinitionVO; import com.hnac.hzinfo.inspect.obj.wrapper.ContentDefinitionWrapper; import lombok.AllArgsConstructor; @@ -12,6 +13,7 @@ import lombok.Getter; import lombok.extern.slf4j.Slf4j; import oracle.jdbc.proxy.annotation.Post; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.Func; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -42,6 +44,7 @@ public class ContentDefinitionClient implements IContentDefinitionClient { @PostMapping(SAVE_BATCH) public R saveBatch(@RequestBody List request) { List list = JSONArray.parseArray(JSON.toJSONString(request), ContentDefinitionEntity.class); + list.stream().forEach(definition -> definition.setCode(CodeUtils.randomCode())); return R.data(contentDefinitionService.saveBatch(list)); } @@ -55,6 +58,7 @@ public class ContentDefinitionClient implements IContentDefinitionClient { @PostMapping(SAVE_OR_UPDATE_BATCH) public R saveOrUpdateBatch(@RequestBody List request) { List list = JSONArray.parseArray(JSON.toJSONString(request), ContentDefinitionEntity.class); + list.stream().filter(definition -> Func.isNotEmpty(definition.getId())).forEach(definition -> definition.setCode(CodeUtils.randomCode())); return R.data(contentDefinitionService.saveOrUpdateBatch(list)); } diff --git a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java index a2d541a..7597cfd 100644 --- a/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java +++ b/hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.hnac.hzinfo.inspect.Constants; import com.hnac.hzinfo.inspect.obj.ObjectConstants; import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO; @@ -74,6 +75,7 @@ public class ProjectServiceImpl extends BaseServiceImpl { projectDTO.setCode(CodeUtils.randomCode()); + projectDTO.setSupportAutoVideo(Constants.InspectTypeEnum.COMMON.getVal()); projectDTO.setStatus(ObjectConstants.ProjectEnableEnum.YES.getEnableType()); ProjectEntity project = BeanUtil.copy(projectDTO, ProjectEntity.class); if(this.save(project)) {