提交话费新增配置产品编码

dev-discount
袁野 2 years ago
parent 189b5990eb
commit 018938e80c
  1. 42
      hai-bweb/src/main/java/com/bweb/controller/OutRechargePriceController.java
  2. 9
      hai-service/src/main/java/com/hai/service/BsRechargeCodeService.java
  3. 11
      hai-service/src/main/java/com/hai/service/impl/BsRechargeCodeServiceImpl.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<BsRechargeCode> 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);
}
}
}

@ -54,4 +54,13 @@ public interface BsRechargeCodeService {
*/
BsRechargeCode findByMap(Map<String, Object> 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);
}

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

Loading…
Cancel
Save