|
@@ -130,7 +130,9 @@ public class EntitlementsImportAnalysis extends DataAnalysis<EntitlementsImportA
|
|
|
if (StringUtils.isBlank(item.getTenantAlbumName())) {
|
|
|
ret += "机构专辑名称不能为空;";
|
|
|
} else if (smallStudent != null) {
|
|
|
- if (MapUtils.isNotEmpty(tenantAlbumMap)) {
|
|
|
+ if (smallStudent.getTenantId() == null || smallStudent.getTenantId() ==-1) {
|
|
|
+ ret += "学生未绑定机构,不能添加"+item.getEntitlementName()+";";
|
|
|
+ } else if (MapUtils.isNotEmpty(tenantAlbumMap)) {
|
|
|
List<TenantAlbumWrapper.SmallTenantAlbum> tenantAlbums = tenantAlbumMap.get(smallStudent.getTenantId());
|
|
|
if (CollectionUtils.isEmpty(tenantAlbums)) {
|
|
|
ret += "机构专辑不存在;";
|
|
@@ -149,19 +151,23 @@ public class EntitlementsImportAnalysis extends DataAnalysis<EntitlementsImportA
|
|
|
}
|
|
|
item.setEntitlementType("TENANT_ALBUM");
|
|
|
}else {
|
|
|
- // VIP/SVIP/畅学卡/机构专辑
|
|
|
- switch (item.getEntitlementName()) {
|
|
|
- case "VIP":
|
|
|
- item.setEntitlementType("VIP");
|
|
|
- break;
|
|
|
- case "SVIP":
|
|
|
- item.setEntitlementType("SVIP");
|
|
|
- break;
|
|
|
- case "畅学卡":
|
|
|
- item.setEntitlementType("DISCOUNT");
|
|
|
- break;
|
|
|
- default:
|
|
|
- ret += "权益类型错误;";
|
|
|
+ if (smallStudent!=null && smallStudent.getTenantId() != null && smallStudent.getTenantId() >0) {
|
|
|
+ ret += "机构学生只能添加机构专辑;";
|
|
|
+ } else {
|
|
|
+ // VIP/SVIP/畅学卡/机构专辑
|
|
|
+ switch (item.getEntitlementName()) {
|
|
|
+ case "VIP":
|
|
|
+ item.setEntitlementType("VIP");
|
|
|
+ break;
|
|
|
+ case "SVIP":
|
|
|
+ item.setEntitlementType("SVIP");
|
|
|
+ break;
|
|
|
+ case "畅学卡":
|
|
|
+ item.setEntitlementType("DISCOUNT");
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ ret += "权益类型错误;";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
if (item.getPeriod() == null) {
|