From a427c9ed0faa30d1c208620c3af6b18a93997f9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=95=B8=E9=9D=9E?= <8153694@qq.com> Date: Thu, 14 Nov 2024 11:07:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B7=B2=E7=BB=8F=E9=83=A8?= =?UTF-8?q?=E7=BD=B2=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xhx/module/site/web/SiteController.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/base-manager/src/main/java/com/mortals/xhx/module/site/web/SiteController.java b/base-manager/src/main/java/com/mortals/xhx/module/site/web/SiteController.java index 369f0017..93bdfcf5 100644 --- a/base-manager/src/main/java/com/mortals/xhx/module/site/web/SiteController.java +++ b/base-manager/src/main/java/com/mortals/xhx/module/site/web/SiteController.java @@ -545,15 +545,20 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic if (ObjectUtils.isEmpty(areaCode)) { throw new AppException("鍖哄煙缂栫爜涓嶈兘涓虹┖锛�"); } - SiteEntity one = this.service.selectOne(new SiteQuery().areaCode(areaCode).siteName(siteName), getContext()); - if(!ObjectUtils.isEmpty(one)) throw new AppException("褰撳墠鍖哄煙涓嬬珯鐐瑰悕绉板凡瀛樺湪锛�"); + if (!ObjectUtils.isEmpty(one)) throw new AppException("褰撳墠鍖哄煙涓嬬珯鐐瑰悕绉板凡瀛樺湪锛�"); AreaEntity areaEntity = areaService.selectOne(new AreaQuery().areaCode(areaCode), getContext()); + siteEntity.initAttrValue(); + //鏌ヨ鏄惁鏈夌珯鐐逛簡锛屽鏋滄湁绔欑偣锛岃繖寮哄埗鏇存柊涓虹珯鐐� id=1鐨勬暟鎹� + SiteEntity site = this.service.get(1L); + + if (!ObjectUtils.isEmpty(site)) { + siteEntity.setId(site.getId()); + } - siteEntity.initAttrValue(); - siteEntity.setAreaCode(areaCode); - siteEntity.setSiteName(siteName); + siteEntity.setAreaCode(areaCode); + siteEntity.setSiteName(siteName); if (!ObjectUtils.isEmpty(areaEntity)) { siteEntity.setAreaID(areaEntity.getIid()); siteEntity.setAreaName(areaEntity.getName()); @@ -562,7 +567,7 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic SiteEntity save = this.service.save(siteEntity, getContext()); //todo 鏇存柊鐩稿叧琛ㄤ腑鐨勭珯鐐瑰悕绉帮紝绔欑偣缂栫爜锛岀珯鐐笽D - this.service.updateSiteInfo(siteEntity,getContext()); + this.service.updateSiteInfo(siteEntity, getContext()); recordSysLog(request, busiDesc + " 銆愭垚鍔熴€�"); jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS); @@ -577,6 +582,4 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic } - - } \ No newline at end of file -- 2.24.3