diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsInventoryPlatformEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsInventoryPlatformEOController.java index e3c976ac0..f4a6f62f3 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsInventoryPlatformEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/LawsInventoryPlatformEOController.java @@ -93,6 +93,19 @@ public class LawsInventoryPlatformEOController extends JeroController addBatch(@Validated @RequestBody List lawsInventoryPlatformEOList) { + lawsInventoryPlatformEOService.addBatch(lawsInventoryPlatformEOList); + return Result.OK("添加成功!"); + } /** * 编辑 diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/LawsInventoryPlatformEO.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/LawsInventoryPlatformEO.java index 2548502e5..1f8118edb 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/LawsInventoryPlatformEO.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/entity/LawsInventoryPlatformEO.java @@ -1,21 +1,19 @@ package com.jero.modules.project.entity; -import java.io.Serializable; -import java.io.UnsupportedEncodingException; -import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; -import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; -import org.springframework.format.annotation.DateTimeFormat; -import org.jeecgframework.poi.excel.annotation.Excel; -import com.jero.common.aspect.annotation.Dict; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; /** @@ -71,4 +69,8 @@ public class LawsInventoryPlatformEO implements Serializable { @ApiModelProperty(value = "平台件项目库法规清单id") private java.lang.String platformLawsInventoryId; + @TableField(exist = false) + @ApiModelProperty(value = "平台件项目库法规清单ids") + private java.lang.String platformLawsInventoryIds; + } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/ILawsInventoryPlatformEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/ILawsInventoryPlatformEOService.java index 45b5a1a7e..3a3c4f99d 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/ILawsInventoryPlatformEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/ILawsInventoryPlatformEOService.java @@ -20,6 +20,12 @@ public interface ILawsInventoryPlatformEOService extends IService lawsInventoryPlatformEOList); + /** * 更新 * diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/LawsInventoryPlatformEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/LawsInventoryPlatformEOServiceImpl.java index 8aaecb0e1..76024f23d 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/LawsInventoryPlatformEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/LawsInventoryPlatformEOServiceImpl.java @@ -1,12 +1,15 @@ package com.jero.modules.project.service.impl; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.jero.modules.project.entity.LawsInventoryPlatformEO; import com.jero.modules.project.mapper.LawsInventoryPlatformEOMapper; import com.jero.modules.project.service.ILawsInventoryPlatformEOService; +import com.jero.modules.system.util.StringUtils; import org.springframework.stereotype.Service; -import java.util.List; + +import java.util.ArrayList; import java.util.Date; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.List; /** * @Description: 车型项目库法规清单关联平台件表 @@ -30,6 +33,33 @@ public class LawsInventoryPlatformEOServiceImpl extends ServiceImpl lawsInventoryPlatformEOList) { + if(!lawsInventoryPlatformEOList.isEmpty()){ + List lawsInventoryPlatformEOS = new ArrayList<>(); + for (LawsInventoryPlatformEO lawsInventoryPlatformEO : lawsInventoryPlatformEOList) { + if(StringUtils.isNotBlank(lawsInventoryPlatformEO.getPlatformLawsInventoryIds())){ + for (String platformLawsInventoryId : lawsInventoryPlatformEO.getPlatformLawsInventoryIds().split(",")) { + LawsInventoryPlatformEO inventoryPlatformEO = new LawsInventoryPlatformEO(); + inventoryPlatformEO.setCreateTime(new Date()); + inventoryPlatformEO.setUpdateTime(new Date()); + inventoryPlatformEO.setLawsInventoryId(lawsInventoryPlatformEO.getLawsInventoryId()); + inventoryPlatformEO.setPlatformLawsInventoryId(platformLawsInventoryId); + lawsInventoryPlatformEOS.add(inventoryPlatformEO); + } + } + } + if(!lawsInventoryPlatformEOS.isEmpty()){ + this.saveBatch(lawsInventoryPlatformEOS); + } + } + } /** * 更新