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)) {