From f62aecb925481ede899e40ba6a55e23b0146c1b4 Mon Sep 17 00:00:00 2001 From: wangzhijiang <12345678> Date: Mon, 13 Mar 2023 11:24:47 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A4=E8=AF=81=E6=B8=85=E5=8D=95-=E8=B0=83?= =?UTF-8?q?=E5=8F=96=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ectCertificationInventoryEOController.java | 7 +++ ...rojectCertificationInventoryEOService.java | 7 +++ ...ctCertificationInventoryEOServiceImpl.java | 46 ++++++++++++++++++- 3 files changed, 58 insertions(+), 2 deletions(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java index e391fdfbf..51f739282 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/controller/ProjectCertificationInventoryEOController.java @@ -248,4 +248,11 @@ public class ProjectCertificationInventoryEOController extends JeroController updateConfigItemBatch(@RequestBody JSONObject json) { return this.projectCertificationInventoryEOService.updateConfigItemBatch(json); } + + @AutoLog(value = "项目库-认证清单表-调取添加") + @ApiOperation(value="项目库-认证清单表-调取添加", notes="项目库-认证清单表-调取添加") + @PostMapping(value = "/callAdd") + public Result callAdd(@RequestBody JSONObject json) { + return this.projectCertificationInventoryEOService.callAdd(json); + } } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java index 792c9ce16..4d86f8bbe 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/IProjectCertificationInventoryEOService.java @@ -167,4 +167,11 @@ public interface IProjectCertificationInventoryEOService extends IService updateConfigItemBatch(JSONObject json); + + /** + * 调取添加 + * @param json + * @return + */ + Result callAdd(JSONObject json); } diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java index bd93b3bb0..e8535fb80 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectCertificationInventoryEOServiceImpl.java @@ -11,6 +11,9 @@ import com.jero.common.constant.enums.CutEnum; import com.jero.common.exception.JeroBootException; import com.jero.common.system.vo.LoginUser; import com.jero.common.util.DateUtils; +import com.jero.modules.authDummy.entity.AuthDummyInventoryInfoEO; +import com.jero.modules.authDummy.service.IAuthDummyInventoryBaseEOService; +import com.jero.modules.authDummy.service.IAuthDummyInventoryInfoEOService; import com.jero.modules.feishu.enums.TemplateInfoEnum2; import com.jero.modules.feishu.service.IFeishuService; import com.jero.modules.project.entity.ProjectCertificationInventoryEO; @@ -84,6 +87,10 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl standNameAndItemName = this.getStandNameAndItemName(projectCertificationInventoryEOList); String standName = (String) standNameAndItemName.get("standName"); String itemName = (String) standNameAndItemName.get("itemName"); @@ -1693,8 +1704,6 @@ public class ProjectCertificationInventoryEOServiceImpl extends ServiceImpl callAdd(JSONObject json) { + String authDummyInventoryBaseId = json.getString("authDummyInventoryBaseId"); + if(StringUtils.isEmpty(authDummyInventoryBaseId)){ + throw new JeroBootException("请选择一个认证虚拟清单进行操作!"); + } + + String authDummyInventoryInfoIds = json.getString("authDummyInventoryInfoIds"); + if(StringUtils.isEmpty(authDummyInventoryInfoIds)){ + throw new JeroBootException("至少选择一条数据进行调取!"); + } + + String projectLibraryId = json.getString("projectLibraryId"); + + QueryWrapper authDummyInfoQueryWrap = new QueryWrapper<>(); + authDummyInfoQueryWrap.lambda().in(AuthDummyInventoryInfoEO::getId,authDummyInventoryInfoIds.split(",")); + List authDummyInventoryInfoEOList = this.authDummyInventoryInfoEOService.list(authDummyInfoQueryWrap); + + if(CollectionUtils.isNotEmpty(authDummyInventoryInfoEOList)){ + List projectCertificationInventoryEOList = new ArrayList<>(); + for (AuthDummyInventoryInfoEO authDummyInventoryInfoEO : authDummyInventoryInfoEOList) { + ProjectCertificationInventoryEO projectCertificationInventoryEOTemp = new ProjectCertificationInventoryEO(); + BeanUtils.copyProperties(authDummyInventoryInfoEO,projectCertificationInventoryEOTemp); + + projectCertificationInventoryEOTemp.setProjectLibraryId(projectLibraryId); + projectCertificationInventoryEOList.add(projectCertificationInventoryEOTemp); + } + this.saveBatch(projectCertificationInventoryEOList); + } + + return Result.OK("调取成功!"); + } }