Merge pull request 'fix: 修正一些bug' (#7) from feature/simcards_checker into develop
Reviewed-on: #7
This commit is contained in:
commit
d97c2c880d
@ -37,6 +37,10 @@ public class TrafficCardService {
|
|||||||
// ICCID变更,关闭旧映射,创建新映射
|
// ICCID变更,关闭旧映射,创建新映射
|
||||||
closeExistingMapping(activeMapping);
|
closeExistingMapping(activeMapping);
|
||||||
createNewMapping(device.getDeviceid(), currentIccid);
|
createNewMapping(device.getDeviceid(), currentIccid);
|
||||||
|
|
||||||
|
// 重置MSISDN以强制更新SIM卡号
|
||||||
|
// 换卡了必须重置这些内容,否则会显示旧卡号,后续的查询会出现问题
|
||||||
|
resetCardMsisdn(currentIccid);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,4 +105,12 @@ public class TrafficCardService {
|
|||||||
private void closeExistingMapping(TrafficDeviceMapping mapping) {
|
private void closeExistingMapping(TrafficDeviceMapping mapping) {
|
||||||
mappingMapper.endMapping(mapping.getId());
|
mappingMapper.endMapping(mapping.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void resetCardMsisdn(String iccid) {
|
||||||
|
TrafficCard card = trafficCardMapper.findByIccid(iccid);
|
||||||
|
if (card != null && card.getMsisdn() != null && !card.getMsisdn().isEmpty()) {
|
||||||
|
card.setMsisdn("");
|
||||||
|
trafficCardMapper.updateCardInfo(card);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user