From a81500beb2db6fab2ba6741708f602bc0fc983c0 Mon Sep 17 00:00:00 2001 From: zhn <947514737@qq.com> Date: Tue, 19 Sep 2023 16:45:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E5=9E=8B=E9=A1=B9=E7=9B=AE=E5=BA=93?= =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=B8=85=E5=8D=95=E5=85=B3=E8=81=94=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E4=BB=B6=E8=A1=A8-=E6=89=B9=E9=87=8F=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LawsInventoryPlatformEOController.java | 13 +++++++ .../entity/LawsInventoryPlatformEO.java | 18 +++++----- .../ILawsInventoryPlatformEOService.java | 6 ++++ .../LawsInventoryPlatformEOServiceImpl.java | 34 +++++++++++++++++-- 4 files changed, 61 insertions(+), 10 deletions(-) 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); + } + } + } /** * 更新