|
|
@@ -262,22 +262,24 @@ public class SchoolUserServiceImpl extends SuperService implements SchoolUserSer
|
|
|
// 保存卡片信息
|
|
|
List<CardInfoParam> cardInfos = param.getCardInfos();
|
|
|
|
|
|
- HashMap<String, String> map = new HashMap<>();
|
|
|
- for (CardInfoParam cardInfo : cardInfos) {
|
|
|
- if (cardInfo.getCardType() == null) {
|
|
|
- return ResultContent.buildFail("卡片类型不能为空");
|
|
|
- }
|
|
|
- if (StringUtils.isEmpty(cardInfo.getCode())) {
|
|
|
- return ResultContent.buildFail("code不能为空");
|
|
|
- }
|
|
|
- if (map.containsKey(cardInfo.getCode())) {
|
|
|
- return ResultContent.buildFail(String.format("code已存在:%s", cardInfo.getCode()));
|
|
|
- }
|
|
|
- map.put(cardInfo.getCode(), cardInfo.getCode());
|
|
|
+ if (ObjectUtils.isNotEmpty(cardInfos)) {
|
|
|
+ HashMap<String, String> map = new HashMap<>();
|
|
|
+ for (CardInfoParam cardInfo : cardInfos) {
|
|
|
+ if (cardInfo.getCardType() == null) {
|
|
|
+ return ResultContent.buildFail("卡片类型不能为空");
|
|
|
+ }
|
|
|
+ if (StringUtils.isEmpty(cardInfo.getCode())) {
|
|
|
+ return ResultContent.buildFail("code不能为空");
|
|
|
+ }
|
|
|
+ if (map.containsKey(cardInfo.getCode())) {
|
|
|
+ return ResultContent.buildFail(String.format("code已存在:%s", cardInfo.getCode()));
|
|
|
+ }
|
|
|
+ map.put(cardInfo.getCode(), cardInfo.getCode());
|
|
|
|
|
|
- CardInfo cardInfo1 = cardInfoDao.findByCode(cardInfo.getCode());
|
|
|
- if (ObjectUtils.isNotEmpty(cardInfo1)) {
|
|
|
- return ResultContent.buildFail(String.format("卡号code已存在:%s", cardInfo.getCode()));
|
|
|
+ CardInfo cardInfo1 = cardInfoDao.findByCode(cardInfo.getCode());
|
|
|
+ if (ObjectUtils.isNotEmpty(cardInfo1)) {
|
|
|
+ return ResultContent.buildFail(String.format("卡号code已存在:%s", cardInfo.getCode()));
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -299,6 +301,7 @@ public class SchoolUserServiceImpl extends SuperService implements SchoolUserSer
|
|
|
return ResultContent.buildFail(resultContent.getMsg());
|
|
|
}
|
|
|
|
|
|
+ // 添加卡片
|
|
|
String userId = resultContent.getContent();
|
|
|
if (ObjectUtils.isNotEmpty(cardInfos)) {
|
|
|
for (CardInfoParam cardInfo : cardInfos) {
|