Merge branch '2.0-dev' of http://gitea.dctpay.com/hurui/hai-server into 2.0-dev

2.0-dev
胡锐 7 months ago
commit 203f04be4e
  1. 14
      hai-cweb/src/main/java/com/cweb/controller/CmsContentController.java
  2. 2
      hai-service/src/main/java/com/hai/service/CmsCategoryService.java
  3. 33
      hai-service/src/main/java/com/hai/service/impl/CmsCategoryServiceImpl.java

@ -49,6 +49,9 @@ public class CmsContentController {
@Resource @Resource
private BsMsgService bsMsgService; private BsMsgService bsMsgService;
@Resource
private tPigController tPigController;
@Autowired @Autowired
private UserCenter userCenter; private UserCenter userCenter;
@ -94,6 +97,7 @@ public class CmsContentController {
object.put("sort" , cmsCategory.getSort()); object.put("sort" , cmsCategory.getSort());
object.put("code" , cmsCategory.getCode()); object.put("code" , cmsCategory.getCode());
cmsContent = cmsContentService.getListCmsContentByCategoryId(cmsCategory.getId() , companyId , platform); cmsContent = cmsContentService.getListCmsContentByCategoryId(cmsCategory.getId() , companyId , platform);
if (cmsContent.size() > 0) { if (cmsContent.size() > 0) {
dataWhetherNull = false; dataWhetherNull = false;
} }
@ -168,7 +172,15 @@ public class CmsContentController {
object.put("name" , category.getName()); object.put("name" , category.getName());
object.put("sort" , category.getSort()); object.put("sort" , category.getSort());
object.put("code" , category.getCode()); object.put("code" , category.getCode());
object.put("childCategory" , cmsContentService.getListCmsContentByCategoryId(category.getId() , companyId , platform));
cmsContent = cmsContentService.getListCmsContentByCategoryId(category.getId() , companyId , platform);
for (CmsContent content : cmsContent) {
if (content.getTitle().equals("电影票")) {
content.setJumpUrl(cmsCategoryService.queryCinemaUrl());
}
}
object.put("childCategory" , cmsContent);
return ResponseMsgUtil.success(object); return ResponseMsgUtil.success(object);
} }

@ -147,4 +147,6 @@ public interface CmsCategoryService {
*/ */
List<Integer> getRolesOfCategory(Long id) throws Exception; List<Integer> getRolesOfCategory(Long id) throws Exception;
String queryCinemaUrl() throws Exception;
} }

@ -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;
}
} }

Loading…
Cancel
Save