From 2d3b9145378aebafb9dd4d4b0228c7dc0e017d00 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Wed, 29 May 2024 14:13:20 +0800 Subject: [PATCH] Changes --- .../bweb/controller/mer/BsMerController.java | 23 ++++++------------- .../mer/impl/BsMerPayConfigServiceImpl.java | 16 ++++++++++--- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/bweb/src/main/java/com/bweb/controller/mer/BsMerController.java b/bweb/src/main/java/com/bweb/controller/mer/BsMerController.java index d6df513..82856a6 100644 --- a/bweb/src/main/java/com/bweb/controller/mer/BsMerController.java +++ b/bweb/src/main/java/com/bweb/controller/mer/BsMerController.java @@ -195,14 +195,6 @@ public class BsMerController { try { - SessionObject sessionObject = userCenter.getSessionObject(request); - SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); - - if (userModel.getAccount().getObjectType() != SecUserObjectTypeEnum.type2.getCode()) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.ROLE_NOT_PERMISSIONS, ""); - - } - if (body == null || body.getMerId() == null || body.getPayPlatform() == null) { @@ -221,14 +213,13 @@ public class BsMerController { } } - BsMerPayConfig merPayConfig; + Map param = new HashMap<>(); + param.put("merId", body.getMerId()); + param.put("payPlatform", body.getPayPlatform()); - if (body.getId() != null) { - merPayConfig = bsMerPayConfigService.queryDetail(body.getId()); - if (merPayConfig == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.CONTENT_NOT_FOUND, ""); - } - } else { + BsMerPayConfig merPayConfig = bsMerPayConfigService.queryDetailByMap(param); + + if (merPayConfig == null) { merPayConfig = new BsMerPayConfig(); merPayConfig.setCreateTime(new Date()); } @@ -248,7 +239,7 @@ public class BsMerController { merPayConfig.setStatus(1); - if (body.getId() != null) { + if (merPayConfig.getId() != null) { bsMerPayConfigService.update(merPayConfig); } else { bsMerPayConfigService.create(merPayConfig); diff --git a/service/src/main/java/com/hfkj/mer/impl/BsMerPayConfigServiceImpl.java b/service/src/main/java/com/hfkj/mer/impl/BsMerPayConfigServiceImpl.java index 449e127..8819b6c 100644 --- a/service/src/main/java/com/hfkj/mer/impl/BsMerPayConfigServiceImpl.java +++ b/service/src/main/java/com/hfkj/mer/impl/BsMerPayConfigServiceImpl.java @@ -85,8 +85,8 @@ public class BsMerPayConfigServiceImpl implements BsMerPayConfigService { if (MapUtils.getLong(map, "merId") != null) { criteria.andMerIdEqualTo(MapUtils.getLong(map, "merId")); } - if (MapUtils.getLong(map, "payPlatform") != null) { - criteria.andMerIdEqualTo(MapUtils.getLong(map, "payPlatform")); + if (MapUtils.getInteger(map, "payPlatform") != null) { + criteria.andPayPlatformEqualTo(MapUtils.getInteger(map, "payPlatform")); } criteria.andStatusEqualTo(1); @@ -100,6 +100,16 @@ public class BsMerPayConfigServiceImpl implements BsMerPayConfigService { @Override public List getList(Map map) { - return Collections.emptyList(); + BsMerPayConfigExample example = new BsMerPayConfigExample(); + BsMerPayConfigExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getLong(map, "merId") != null) { + criteria.andMerIdEqualTo(MapUtils.getLong(map, "merId")); + } + if (MapUtils.getString(map, "merNo") != null) { + criteria.andMerNoEqualTo(MapUtils.getString(map, "merNo")); + } + criteria.andStatusEqualTo(1); + return bsMerPayConfigMapper.selectByExample(example); } }