From 018938e80c6de88e12cabbf779b7fab462f5a60e Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Wed, 20 Jul 2022 15:50:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=9D=E8=B4=B9=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E9=85=8D=E7=BD=AE=E4=BA=A7=E5=93=81=E7=BC=96=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OutRechargePriceController.java | 42 ++++++++++++++++--- .../hai/service/BsRechargeCodeService.java | 11 ++++- .../impl/BsRechargeCodeServiceImpl.java | 11 +++-- 3 files changed, 54 insertions(+), 10 deletions(-) diff --git a/hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java b/hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java index 94b8cf56..57db0dbf 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java @@ -323,16 +323,13 @@ public class OutRechargePriceController { map.put("sourceId" , id); map.put("rechargePlatform" , dictionary.getCodeValue()); BsRechargeCode rechargeCode = bsRechargeCodeService.findByMap(map); - + object.put("rechargePlatformName" , dictionary.getCodeName()); + object.put("rechargePlatform" , dictionary.getCodeValue()); if (rechargeCode != null) { object.put("id" , rechargeCode.getId()); - object.put("rechargePlatformName" , dictionary.getCodeName()); - object.put("rechargePlatform" , rechargeCode.getRechargePlatform()); object.put("goodsId" , rechargeCode.getGoodsId()); - - objectList.add(object); } - + objectList.add(object); } @@ -344,4 +341,37 @@ public class OutRechargePriceController { } } + @RequestMapping(value = "/editRechargeCode", method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑充值编码") + public ResponseData editRechargeCode(@RequestBody List objectList, HttpServletRequest request) { + try { + + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + + for (BsRechargeCode rechargeCode : objectList) { + rechargeCode.setOperatorId(userInfoModel.getSecUser().getId()); + rechargeCode.setOperatorName(userInfoModel.getSecUser().getUserName()); + rechargeCode.setStatus(100); + + if (rechargeCode.getId() == null) { + rechargeCode.setCreateTime(new Date()); + rechargeCode.setUpdateTime(new Date()); + bsRechargeCodeService.insertRechargeCode(rechargeCode); + } else { + rechargeCode.setUpdateTime(new Date()); + bsRechargeCodeService.updateRechargeCode(rechargeCode); + } + } + + return ResponseMsgUtil.success("新增成功"); + + } catch (Exception e) { + log.error("HighOrderController --> unionStagingPay() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + } diff --git a/hai-service/src/main/java/com/hai/service/BsRechargeCodeService.java b/hai-service/src/main/java/com/hai/service/BsRechargeCodeService.java index a42ebea9..7537ca43 100644 --- a/hai-service/src/main/java/com/hai/service/BsRechargeCodeService.java +++ b/hai-service/src/main/java/com/hai/service/BsRechargeCodeService.java @@ -53,5 +53,14 @@ public interface BsRechargeCodeService { * @return com.hai.entity.BsRechargeCode */ BsRechargeCode findByMap(Map map); - + + /** + * @Author Sum1Dream + * @name findById.java + * @Description // 根据id查询线切割 + * @Date 14:57 2022/7/20 + * @Param [java.lang.Long] + * @return com.hai.entity.BsRechargeCode + */ + BsRechargeCode findById(Long id); } diff --git a/hai-service/src/main/java/com/hai/service/impl/BsRechargeCodeServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/BsRechargeCodeServiceImpl.java index 2e0f656c..3ab28063 100644 --- a/hai-service/src/main/java/com/hai/service/impl/BsRechargeCodeServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/BsRechargeCodeServiceImpl.java @@ -25,7 +25,7 @@ public class BsRechargeCodeServiceImpl implements BsRechargeCodeService { @Override public void updateRechargeCode(BsRechargeCode rechargeCode) { - rechargeCodeMapper.updateByPrimaryKey(rechargeCode); + rechargeCodeMapper.updateByPrimaryKeySelective(rechargeCode); } @Override @@ -46,7 +46,7 @@ public class BsRechargeCodeServiceImpl implements BsRechargeCodeService { criteria.andTypeEqualTo(MapUtils.getInteger(map, "type")); } if (MapUtils.getString(map, "sourceId") != null) { - criteria.andSourceIdEqualTo(MapUtils.getString(map, "SourceId")); + criteria.andSourceIdEqualTo(MapUtils.getString(map, "sourceId")); } if (MapUtils.getInteger(map, "rechargePlatform") != null) { criteria.andRechargePlatformEqualTo(MapUtils.getInteger(map, "rechargePlatform")); @@ -55,9 +55,14 @@ public class BsRechargeCodeServiceImpl implements BsRechargeCodeService { List list = rechargeCodeMapper.selectByExample(example); if (list.size() > 0) { - list.get(0); + return list.get(0); } return null; } + + @Override + public BsRechargeCode findById(Long id) { + return rechargeCodeMapper.selectByPrimaryKey(id); + } }