|
|
@ -4,12 +4,18 @@ import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.hai.common.exception.ErrorCode; |
|
|
|
import com.hai.common.exception.ErrorCode; |
|
|
|
import com.hai.common.exception.ErrorHelp; |
|
|
|
import com.hai.common.exception.ErrorHelp; |
|
|
|
import com.hai.common.exception.SysCode; |
|
|
|
import com.hai.common.exception.SysCode; |
|
|
|
|
|
|
|
import com.hai.common.security.UserCenter; |
|
|
|
|
|
|
|
import com.hai.config.CommonSysConst; |
|
|
|
|
|
|
|
import com.hai.config.QianZhuConfig; |
|
|
|
import com.hai.dao.CmsCategoryMapper; |
|
|
|
import com.hai.dao.CmsCategoryMapper; |
|
|
|
import com.hai.entity.CmsCategory; |
|
|
|
import com.hai.entity.CmsCategory; |
|
|
|
import com.hai.entity.CmsCategoryExample; |
|
|
|
import com.hai.entity.CmsCategoryExample; |
|
|
|
|
|
|
|
import com.hai.entity.HighUser; |
|
|
|
import com.hai.model.CmsCategoryTreeModel; |
|
|
|
import com.hai.model.CmsCategoryTreeModel; |
|
|
|
|
|
|
|
import com.hai.model.HighUserModel; |
|
|
|
import com.hai.service.CmsCategoryRoleService; |
|
|
|
import com.hai.service.CmsCategoryRoleService; |
|
|
|
import com.hai.service.CmsCategoryService; |
|
|
|
import com.hai.service.CmsCategoryService; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
@ -27,6 +33,9 @@ public class CmsCategoryServiceImpl implements CmsCategoryService { |
|
|
|
@Resource |
|
|
|
@Resource |
|
|
|
private CmsCategoryRoleService cmsCategoryRoleService; |
|
|
|
private CmsCategoryRoleService cmsCategoryRoleService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private UserCenter userCenter; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
@Transactional |
|
|
|
public int addCategory(CmsCategory cmsCategory, List<Integer> roleList) throws Exception { |
|
|
|
public int addCategory(CmsCategory cmsCategory, List<Integer> roleList) throws Exception { |
|
|
@ -273,4 +282,28 @@ public class CmsCategoryServiceImpl implements CmsCategoryService { |
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public String queryCinemaUrl() throws Exception { |
|
|
|
|
|
|
|
HighUserModel sessionModel = userCenter.getSessionModel(HighUserModel.class); |
|
|
|
|
|
|
|
if (sessionModel == null) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 查询用户
|
|
|
|
|
|
|
|
HighUser user = sessionModel.getHighUser(); |
|
|
|
|
|
|
|
if (user == null || sessionModel.getHighUser() == null) { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMPETENCE_INSUFFICIENT, ""); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取token
|
|
|
|
|
|
|
|
JSONObject token = QianZhuConfig.getToken(""+user.getId() , user.getName() , user.getPhone()); |
|
|
|
|
|
|
|
String url = ""; |
|
|
|
|
|
|
|
if (token.getBoolean("success")) { |
|
|
|
|
|
|
|
JSONObject data = token.getJSONObject("data"); |
|
|
|
|
|
|
|
url = CommonSysConst.getSysConfig().getQinzhuHtmlUrl()+"/cinema/?platformId="+CommonSysConst.getSysConfig().getQinzhuPlatformId()+"&token="+data.getString("accessToken"); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "获取地址失败"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return url; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|