|
|
@@ -30,9 +30,9 @@ import com.zhongshu.card.server.core.domain.org.UserAccount;
|
|
|
import com.zhongshu.card.server.core.domain.school.CardInfo;
|
|
|
import com.zhongshu.card.server.core.domain.school.CardInfoLossRecord;
|
|
|
import com.zhongshu.card.server.core.domain.school.CardInfoPool;
|
|
|
-import com.zhongshu.card.server.core.event.DevicePermissChangeEvent;
|
|
|
import com.zhongshu.card.server.core.event.UserInfoChangeSyncEvent;
|
|
|
import com.zhongshu.card.server.core.service.base.SuperService;
|
|
|
+import com.zhongshu.card.server.core.service.devices.DevicePermissEventService;
|
|
|
import com.zhongshu.card.server.core.service.org.OrganizationServiceImpl;
|
|
|
import com.zhongshu.card.server.core.service.org.OrganizationUserServiceImpl;
|
|
|
import com.zhongshu.card.server.core.service.orgManager.OrganizationManagerServiceImpl;
|
|
|
@@ -111,6 +111,9 @@ public class CardInfoServiceImpl extends SuperService implements CardInfoService
|
|
|
@Autowired
|
|
|
ApplicationContext applicationContext;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private DevicePermissEventService devicePermissEventService;
|
|
|
+
|
|
|
/**
|
|
|
* 添加或修改卡片信息
|
|
|
*
|
|
|
@@ -271,9 +274,7 @@ public class CardInfoServiceImpl extends SuperService implements CardInfoService
|
|
|
cardInfoPoolDao.save(cardInfoPool);
|
|
|
|
|
|
// 用户卡片增多
|
|
|
- UserInfoChangeSyncEvent event = new UserInfoChangeSyncEvent(this,
|
|
|
- List.of(cardInfo.getUserId()), cardInfo.getProjectOid());
|
|
|
- applicationContext.publishEvent(event);
|
|
|
+ devicePermissEventService.sendUserInfoChangeEvent(cardInfo.getUserId(), cardInfo.getProjectOid());
|
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
|
|
|
|
@@ -302,9 +303,7 @@ public class CardInfoServiceImpl extends SuperService implements CardInfoService
|
|
|
}
|
|
|
|
|
|
// 用户可用卡片减少
|
|
|
- UserInfoChangeSyncEvent event = new UserInfoChangeSyncEvent(this,
|
|
|
- List.of(cardInfo.getUserId()), cardInfo.getProjectOid());
|
|
|
- applicationContext.publishEvent(event);
|
|
|
+ devicePermissEventService.sendUserInfoChangeEvent(cardInfo.getUserId(), cardInfo.getProjectOid());
|
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
|
|
|
|
@@ -472,9 +471,7 @@ public class CardInfoServiceImpl extends SuperService implements CardInfoService
|
|
|
cardInfoLossRecordDao.save(cardInfoLossRecord);
|
|
|
|
|
|
// 卡片信息发送变化
|
|
|
- UserInfoChangeSyncEvent event = new UserInfoChangeSyncEvent(this,
|
|
|
- List.of(cardInfo.getUserId()), cardInfo.getProjectOid());
|
|
|
- applicationContext.publishEvent(event);
|
|
|
+ devicePermissEventService.sendUserInfoChangeEvent(cardInfo.getUserId(), cardInfo.getProjectOid());
|
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
|
|
|
|
@@ -510,9 +507,7 @@ public class CardInfoServiceImpl extends SuperService implements CardInfoService
|
|
|
cardInfoLossRecord.setOperationType(CardOperationType.Enable);
|
|
|
cardInfoLossRecordDao.save(cardInfoLossRecord);
|
|
|
// 卡片信息发送变化
|
|
|
- UserInfoChangeSyncEvent event = new UserInfoChangeSyncEvent(this,
|
|
|
- List.of(cardInfo.getUserId()), cardInfo.getProjectOid());
|
|
|
- applicationContext.publishEvent(event);
|
|
|
+ devicePermissEventService.sendUserInfoChangeEvent(cardInfo.getUserId(), cardInfo.getProjectOid());
|
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
|
|
|
|
@@ -575,9 +570,7 @@ public class CardInfoServiceImpl extends SuperService implements CardInfoService
|
|
|
cardInfoLossRecordDao.save(cardInfoLossRecord);
|
|
|
|
|
|
// 用户可用卡片发生变化
|
|
|
- UserInfoChangeSyncEvent event = new UserInfoChangeSyncEvent(this,
|
|
|
- List.of(cardInfo.getUserId()), cardInfo.getProjectOid());
|
|
|
- applicationContext.publishEvent(event);
|
|
|
+ devicePermissEventService.sendUserInfoChangeEvent(cardInfo.getUserId(), cardInfo.getProjectOid());
|
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
|
|
|
|
@@ -687,9 +680,7 @@ public class CardInfoServiceImpl extends SuperService implements CardInfoService
|
|
|
cardInfoLossRecord.setOperationType(CardOperationType.Enable);
|
|
|
cardInfoLossRecordDao.save(cardInfoLossRecord);
|
|
|
|
|
|
- UserInfoChangeSyncEvent event = new UserInfoChangeSyncEvent(this,
|
|
|
- List.of(cardInfo.getUserId()), cardInfo.getProjectOid());
|
|
|
- applicationContext.publishEvent(event);
|
|
|
+ devicePermissEventService.sendUserInfoChangeEvent(cardInfo.getUserId(), cardInfo.getProjectOid());
|
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
|
|
|
|
@@ -840,9 +831,7 @@ public class CardInfoServiceImpl extends SuperService implements CardInfoService
|
|
|
bindCardFromPoolByOrgId(bind2OrgUserParam.getPoolId(), bind2OrgUserParam.getId(), bind2OrgUserParam.getRemark());
|
|
|
}
|
|
|
|
|
|
- UserInfoChangeSyncEvent event = new UserInfoChangeSyncEvent(this,
|
|
|
- userIds, projectOid);
|
|
|
- applicationContext.publishEvent(event);
|
|
|
+ devicePermissEventService.sendUserInfoChangeEvent(userIds, projectOid);
|
|
|
}
|
|
|
model.setSuccess(cardInfoPools.size());
|
|
|
model.setFailDetails(failDetails);
|
|
|
@@ -958,10 +947,6 @@ public class CardInfoServiceImpl extends SuperService implements CardInfoService
|
|
|
ExcelUtils.commonExecuteExcel(request, response, execlParam);
|
|
|
}
|
|
|
|
|
|
- public void sendUserInfoChangeEvent(){
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
//----------------------------园区卡片操作 end --------------------------
|
|
|
|
|
|
// 简单的信息
|