From b6d82795195a7f15b5d3fd8bb4ea9cac1f950de2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=AD=E5=87=A1=E5=87=A1?= Date: Wed, 30 Mar 2022 17:57:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TenantBasicManagementServiceImpl.java | 48 ++++++++++++++----- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/pms/ocp/service/impl/TenantBasicManagementServiceImpl.java b/src/main/java/com/pms/ocp/service/impl/TenantBasicManagementServiceImpl.java index 610afd9..841a1e4 100644 --- a/src/main/java/com/pms/ocp/service/impl/TenantBasicManagementServiceImpl.java +++ b/src/main/java/com/pms/ocp/service/impl/TenantBasicManagementServiceImpl.java @@ -406,28 +406,50 @@ public class TenantBasicManagementServiceImpl extends ServiceImpl lambdaQueryWrapper2 = new LambdaQueryWrapper<>(); + lambdaQueryWrapper2.eq(OcpTenantBase::getTenantCode, tenantCode); + OcpTenantBase one = this.getOne(lambdaQueryWrapper2); OcpTenantBase ocpTenantBase = new OcpTenantBase(); BeanUtils.copyProperties(ocpBaseTiocnDto, ocpTenantBase); ocpTenantBase.setIsDelete((short) 0); + if (StringUtils.isEmpty(objId)){ + if (one!=null){ + return ResponseVO.error("应用编码不能重复"); + }else { + ocpTenantBase.setTenantCtime(new Timestamp(System.currentTimeMillis())); + ocpTenantBase.setTenantMtime(new Timestamp(System.currentTimeMillis())); + this.save(ocpTenantBase); + } + }else { + ocpTenantBase.setTenantMtime(new Timestamp(System.currentTimeMillis())); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.eq(OcpTenantBase::getObjId,ocpTenantBase.getObjId()); + this.update(ocpTenantBase,lambdaQueryWrapper); + } + + + - LambdaQueryWrapper lambdaQueryWrapper2 = new LambdaQueryWrapper<>(); - lambdaQueryWrapper2.eq(OcpTenantBase::getTenantCode, tenantCode); // boolean flag = this.update(ocpTenantBase, lambdaQueryWrapper2); // if (flag) { // log.info("应用基础表修改成功"); // System.out.println("应用基础表修改成功"); // } - int delete = tenantBasicManagementMapper.delete(lambdaQueryWrapper2); - if (delete == 0) { - log.info("增加"); - ocpTenantBase.setTenantCtime(new Timestamp(System.currentTimeMillis())); - ocpTenantBase.setTenantMtime(new Timestamp(System.currentTimeMillis())); - } else { - log.info("编辑"); - ocpTenantBase.setTenantMtime(new Timestamp(System.currentTimeMillis())); - } - boolean save1 = this.save(ocpTenantBase); +// int delete = tenantBasicManagementMapper.delete(lambdaQueryWrapper2); +// if (delete == 0) { +// log.info("增加"); +// ocpTenantBase.setTenantCtime(new Timestamp(System.currentTimeMillis())); +// ocpTenantBase.setTenantMtime(new Timestamp(System.currentTimeMillis())); +// } else { +// log.info("编辑"); +// ocpTenantBase.setTenantMtime(new Timestamp(System.currentTimeMillis())); +// } +// boolean save1 = this.save(ocpTenantBase); + + + OcpTenantExtent ocpTenantExtent = new OcpTenantExtent(); ocpTenantExtent.setTenantCode(tenantCode); ocpTenantExtent.setTenantState((short) 0); @@ -457,7 +479,7 @@ public class TenantBasicManagementServiceImpl extends ServiceImpl