项目中的绑卡与解绑
来源:互联网 发布:yy协议号软件 编辑:程序博客网 时间:2024/04/29 00:38
解绑操作
public void unBindCard(Long cardId, Long accountId){ AccountActivation aa = accountActivationRepo.findBychargingCard(chargingCardRepo.findById(cardId)); aa.setBindDate(null); aa.setEvcAccount(null); ChargingCard card = chargingCardRepo.findById(cardId); card.setTiedDate(null); card.setLastestUpdateBy(CurrentUserInfo.getUserName()); card.setLastestUpdateTime(new Date()); int count = accountActivationRepo.findByEvcAccountId(accountId).size(); if(count == 0){ EvcAccount account = evcAccountRepo.findById(accountId); account.setIsTied(false); account.setLastestUpdateBy(CurrentUserInfo.getUserName()); account.setLastestUpdateTime(new Date()); } accountActivationRepo.delete(aa); }
绑卡操作
public void evcAccountBindCard(AccoutSaveInfoDTO accoutSaveInfoDTO,List<Long> cardIdList) { Long accoutId = accoutSaveInfoDTO.getId(); EvcAccount evcAccount = evcAccountRepo.findById(accoutId); //EvcAccount evcAccount = convertTOEvcAccount(accoutSaveInfoDTO,accoutId); evcAccount.setIsTied(true); evcAccount.setLastestUpdateTime(new Date()); evcAccount.setLastestUpdateBy(CurrentUserInfo.getUserName()); if(cardIdList != null) { for (Long cardId : cardIdList) { ChargingCard chargingCard = chargingCardRepo.findById(cardId); AccountActivation accountActivation = null; if(chargingCard.getAccountActivations().isEmpty()) { accountActivation = new AccountActivation(); accountActivation.setChargingCard(chargingCard); chargingCard.getAccountActivations().add(accountActivation); } else{ accountActivation = chargingCard.getAccountActivations().get(0); } accountActivation.setBindDate(new Date()); accountActivation.setEvcAccount(evcAccount); chargingCard.setTiedDate(new Date()); } } }
0 0
- 项目中的绑卡与解绑
- js中的事件绑定与解绑
- 解绑
- 解绑
- MAC与IP解绑与绑定
- jquery绑定与解绑事件
- 事件的绑定与解绑
- 手机解绑
- 29、事件解绑
- igb_uio解绑
- MVP解绑
- MVP解绑
- MVP解绑
- mvp解绑
- MVP解绑
- MVP解绑
- MVP解绑
- Android_Ok的解绑
- pppoe v4 test env building
- HDU_1269_迷宫城堡(强连通分量)
- mysql 相关函数的使用情况
- 【iOS开发-数据传递】关于两个Controller跳转时的数据传递
- Linux kernel coding style
- 项目中的绑卡与解绑
- IOS启动页
- “50份简历没获得面试”也正常
- C#取得计算机主板序列号
- 【OpenCV】SIFT原理与源码分析:3.方向赋值
- Glibc辅助运行库 (C RunTime Library): crt0.o,crt1.o,crti.o crtn.o,crtbegin.o crtend.o
- MyEclipse2015不能自动生成web.xml的问题解答
- C++读取OBJ文件 对于f数据 取出任意自己想要的数据
- boost asio 异步实现tcp通讯