| | |
| | | import com.yeshi.fanli.service.inter.msg.UserOtherMsgNotificationService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.cloud.UserCloudService;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | |
|
| | | @Service
|
| | |
| | | private UserCloudService userCloudService;
|
| | |
|
| | |
|
| | | |
| | | @Transactional
|
| | | @Override
|
| | | public UserCloudOrder addCloudOrder(Long uid, String type) throws UserCloudOrderException{
|
| | | if (uid == null)
|
| | |
| | | if (menuEnum == null)
|
| | | throw new UserCloudOrderException(1, "请选择正确套餐");
|
| | |
|
| | | if (menuEnum == CloudOrderMenuEnum.robotMonthHalfPrice || menuEnum == CloudOrderMenuEnum.robotMonthVip) {
|
| | | List<UserCloudOrder> list = userCloudOrderMapper.list(menuEnum.name(), uid, true);
|
| | | if (list != null && list.size() > 0)
|
| | | throw new UserCloudOrderException(1, "只能购买一次");
|
| | | }
|
| | | UserCloudOrder cloudOrder = new UserCloudOrder();
|
| | | cloudOrder.setUid(uid);
|
| | | cloudOrder.setState(false);
|