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); } }