Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 1 year ago
parent
commit
e4814dee89
  1. 4
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ContentDefinitionClient.java
  2. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ProjectServiceImpl.java

4
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.dto.ContentDefinitionDTO;
import com.hnac.hzinfo.inspect.obj.entity.ContentDefinitionEntity; import com.hnac.hzinfo.inspect.obj.entity.ContentDefinitionEntity;
import com.hnac.hzinfo.inspect.obj.services.IContentDefinitionService; 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.vo.ContentDefinitionVO;
import com.hnac.hzinfo.inspect.obj.wrapper.ContentDefinitionWrapper; import com.hnac.hzinfo.inspect.obj.wrapper.ContentDefinitionWrapper;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
@ -12,6 +13,7 @@ import lombok.Getter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import oracle.jdbc.proxy.annotation.Post; import oracle.jdbc.proxy.annotation.Post;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
@ -42,6 +44,7 @@ public class ContentDefinitionClient implements IContentDefinitionClient {
@PostMapping(SAVE_BATCH) @PostMapping(SAVE_BATCH)
public R<Boolean> saveBatch(@RequestBody List<ContentDefinitionDTO> request) { public R<Boolean> saveBatch(@RequestBody List<ContentDefinitionDTO> request) {
List<ContentDefinitionEntity> list = JSONArray.parseArray(JSON.toJSONString(request), ContentDefinitionEntity.class); List<ContentDefinitionEntity> list = JSONArray.parseArray(JSON.toJSONString(request), ContentDefinitionEntity.class);
list.stream().forEach(definition -> definition.setCode(CodeUtils.randomCode()));
return R.data(contentDefinitionService.saveBatch(list)); return R.data(contentDefinitionService.saveBatch(list));
} }
@ -55,6 +58,7 @@ public class ContentDefinitionClient implements IContentDefinitionClient {
@PostMapping(SAVE_OR_UPDATE_BATCH) @PostMapping(SAVE_OR_UPDATE_BATCH)
public R<Boolean> saveOrUpdateBatch(@RequestBody List<ContentDefinitionDTO> request) { public R<Boolean> saveOrUpdateBatch(@RequestBody List<ContentDefinitionDTO> request) {
List<ContentDefinitionEntity> list = JSONArray.parseArray(JSON.toJSONString(request), ContentDefinitionEntity.class); List<ContentDefinitionEntity> 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)); return R.data(contentDefinitionService.saveOrUpdateBatch(list));
} }

2
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.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.ObjectConstants;
import com.hnac.hzinfo.inspect.obj.dto.ContentDTO; import com.hnac.hzinfo.inspect.obj.dto.ContentDTO;
import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO; import com.hnac.hzinfo.inspect.obj.dto.ProjectDTO;
@ -74,6 +75,7 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectMapper, ProjectEn
ProjectContentServiceImpl projectContentService = SpringUtil.getBean(ProjectContentServiceImpl.class); ProjectContentServiceImpl projectContentService = SpringUtil.getBean(ProjectContentServiceImpl.class);
request.forEach(projectDTO -> { request.forEach(projectDTO -> {
projectDTO.setCode(CodeUtils.randomCode()); projectDTO.setCode(CodeUtils.randomCode());
projectDTO.setSupportAutoVideo(Constants.InspectTypeEnum.COMMON.getVal());
projectDTO.setStatus(ObjectConstants.ProjectEnableEnum.YES.getEnableType()); projectDTO.setStatus(ObjectConstants.ProjectEnableEnum.YES.getEnableType());
ProjectEntity project = BeanUtil.copy(projectDTO, ProjectEntity.class); ProjectEntity project = BeanUtil.copy(projectDTO, ProjectEntity.class);
if(this.save(project)) { if(this.save(project)) {

Loading…
Cancel
Save