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