修改区域公司

dev-discount
袁野 2 years ago
parent 3787961b31
commit fde3db4fa8
  1. 204
      hai-bweb/src/main/java/com/bweb/controller/CmsContentController.java
  2. 82
      hai-cweb/src/main/java/com/cweb/controller/CmsContentController.java
  3. 58
      hai-service/src/main/java/com/hai/config/CmsContentConfig.java
  4. 5
      hai-service/src/main/java/com/hai/dao/CmsContentMapperExt.java
  5. 2
      hai-service/src/main/java/com/hai/entity/CmsCategory.java
  6. 14
      hai-service/src/main/java/com/hai/entity/CmsContent.java
  7. 52
      hai-service/src/main/java/com/hai/enum_type/CmsContentDataEnum.java
  8. 20
      hai-service/src/main/java/com/hai/service/CmsCategoryService.java
  9. 50
      hai-service/src/main/java/com/hai/service/CmsContentService.java
  10. 25
      hai-service/src/main/java/com/hai/service/impl/CmsCategoryServiceImpl.java
  11. 51
      hai-service/src/main/java/com/hai/service/impl/CmsContentServiceImpl.java
  12. 2
      hai-service/src/main/java/com/hai/service/impl/HighDiscountPackageServiceImpl.java

@ -11,11 +11,12 @@ import com.hai.common.security.SessionObject;
import com.hai.common.security.UserCenter;
import com.hai.common.utils.ResponseMsgUtil;
import com.bweb.config.SysConfig;
import com.hai.entity.CmsContent;
import com.hai.entity.CmsPatch;
import com.hai.entity.*;
import com.hai.model.CmsContentModel;
import com.hai.model.OutRechargePriceModel;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.CmsCategoryService;
import com.hai.service.CmsContentService;
import com.hai.service.CmsPatchService;
import io.swagger.annotations.Api;
@ -28,6 +29,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.*;
@Controller
@ -45,9 +47,13 @@ public class CmsContentController {
@Resource
private CmsContentService cmsContentService;
@Resource
private CmsPatchService cmsPatchService;
@Resource
private CmsCategoryService cmsCategoryService;
@RequestMapping(value = "/addContent", method = RequestMethod.POST)
@ApiOperation(value = "创建内容")
@ResponseBody
@ -180,9 +186,10 @@ public class CmsContentController {
@ApiOperation(value = "查询内容列表(不包括附件)")
@ResponseBody
public ResponseData getListContent(@RequestParam(value = "title", required = false) String title,
@RequestParam(value = "category", required = false) Long category,
@RequestParam(value = "categoryId", required = false) Long categoryId,
@RequestParam(value = "categoryCode", required = false) String categoryCode,
@RequestParam(value = "tag", required = false) String tag,
@RequestParam(value = "platform", required = false) String platform,
@RequestParam(value = "status", required = false) Integer status,
@RequestParam(value = "companyId", required = false) Long companyId,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@ -192,8 +199,11 @@ public class CmsContentController {
if (StringUtils.isNotBlank(title)) {
paramsMap.put("title", title);
}
if (category != null) {
paramsMap.put("category", category.toString());
if (categoryId != null) {
paramsMap.put("categoryId", categoryId.toString());
}
if (platform != null) {
paramsMap.put("platform", platform);
}
if (categoryCode != null) {
paramsMap.put("categoryCode", categoryCode);
@ -216,7 +226,35 @@ public class CmsContentController {
}
}
@RequestMapping(value = "/getListCmsContent", method = RequestMethod.GET)
@ApiOperation(value = "查询内容列表(不包括附件)")
@ResponseBody
public ResponseData getListCmsContent(@RequestParam(value = "title", required = false) String title,
@RequestParam(value = "categoryId", required = false) Long categoryId,
@RequestParam(value = "platform", required = false) Integer platform,
@RequestParam(value = "status", required = false) Integer status,
@RequestParam(name = "pageNum", required = true) Integer pageNum,
@RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
Map<String, Object> paramsMap = new HashMap<>();
paramsMap.put("title", title);
paramsMap.put("platform", platform);
paramsMap.put("categoryId", categoryId);
paramsMap.put("status", status);
paramsMap.put("companyId", userInfoModel.getBsCompany().getId());
PageHelper.startPage(pageNum, pageSize);
return ResponseMsgUtil.success(new PageInfo<>(cmsContentService.getListCmsContent(paramsMap)));
} catch (Exception e) {
log.error("CmsContentController --> getListContent() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/updateStatusOfContent", method = RequestMethod.POST)
@ApiOperation(value = "更新 内容发布状态")
@ -391,4 +429,160 @@ public class CmsContentController {
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/insertCmsContent", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "新增CMS内容")
public ResponseData insertCmsContent(@RequestBody CmsContent cmsContent, HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (cmsContent == null ||
cmsContent.getCategoryId() == null ||
cmsContent.getTitle() == null ||
cmsContent.getSortId() == null ||
cmsContent.getDescription() == null
) {
log.error("CmsContentController -> insertPrice() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
// 获取分类信息
CmsCategory category = cmsCategoryService.getCategoryById(cmsContent.getCategoryId());
for (Integer platform : cmsContent.getPlatformArray()) {
cmsContent.setUpdateTime(new Date());
cmsContent.setCreateTime(new Date());
cmsContent.setStatus(1);
cmsContent.setPlatform(platform);
cmsContent.setCategoryCode(category.getCode());
cmsContent.setCompanyId(userInfoModel.getBsCompany().getId());
cmsContent.setCompanyName(userInfoModel.getBsCompany().getName());
cmsContent.setOpId(userInfoModel.getSecUser().getId());
cmsContent.setUserName(userInfoModel.getSecUser().getUserName());
cmsContent.setTag(category.getName());
cmsContentService.insertCmsContent(cmsContent);
}
return ResponseMsgUtil.success("新增成功");
} catch (Exception e) {
log.error("CmsContentController --> insertPrice() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/updateCmsContent", method = RequestMethod.POST)
@ResponseBody
@ApiOperation(value = "修改CMS内容")
public ResponseData updateCmsContent(@RequestBody CmsContent cmsContent, HttpServletRequest request) {
try {
SessionObject sessionObject = userCenter.getSessionObject(request);
UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject();
if (cmsContent == null ||
cmsContent.getId() == null ||
cmsContent.getCategoryId() == null ||
cmsContent.getTitle() == null ||
cmsContent.getSortId() == null ||
cmsContent.getDescription() == null
) {
log.error("CmsContentController -> updateCmsContent() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, "");
}
CmsContent content = cmsContentService.findById(cmsContent.getId());
// 获取分类信息
CmsCategory category = cmsCategoryService.getCategoryById(cmsContent.getCategoryId());
if (content == null) {
log.error("CmsContentController -> updateCmsContent() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "未找到匹配数据!");
}
cmsContent.setUpdateTime(new Date());
cmsContent.setStatus(1);
cmsContent.setCreateTime(content.getCreateTime());
cmsContent.setOpId(userInfoModel.getSecUser().getId());
cmsContent.setUserName(userInfoModel.getSecUser().getUserName());
cmsContent.setCompanyName(content.getCompanyName());
cmsContent.setCompanyId(content.getCompanyId());
cmsContent.setCategoryCode(category.getCode());
cmsContent.setTag(category.getName());
cmsContentService.updateCmsContent(cmsContent);
return ResponseMsgUtil.success("修改成功");
} catch (Exception e) {
log.error("CmsContentController --> updateCmsContent() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value="/updateContentStatus",method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "修改内容状态")
public ResponseData updateContentStatus(@RequestParam(name = "id", required = true) Long id,
@RequestParam(name = "status", required = true) Integer status) {
try {
// 查询优惠券
CmsContent cmsContent = cmsContentService.findById(id);
if (cmsContent == null) {
log.error("CmsContentController -> updateContentStatus() error!","未找到相关信息");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到相关信息");
}
cmsContent.setStatus(status);
cmsContent.setUpdateTime(new Date());
cmsContentService.updateCmsContent(cmsContent);
return ResponseMsgUtil.success("操作成功");
} catch (Exception e) {
log.error("HighDiscountController -> updateDiscountStatus() error!",e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/findById", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据id查询详情")
public ResponseData findById(@RequestParam(value = "id", required = true) Long id) {
try {
return ResponseMsgUtil.success(cmsContentService.findById(id));
} catch (Exception e) {
log.error("CmsContentController --> findById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
@RequestMapping(value = "/deleteById", method = RequestMethod.GET)
@ResponseBody
@ApiOperation(value = "根据id删除内容")
public ResponseData deleteById(@RequestParam(value = "id", required = true) Long id) {
try {
CmsContent content = cmsContentService.findById(id);
if (content == null) {
log.error("CmsContentController -> updateCmsContent() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "未找到匹配数据!");
}
if (content.getStatus() == 2) {
log.error("CmsContentController -> updateCmsContent() error!");
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "当前状态不可删除!");
}
content.setStatus(0);
cmsContentService.updateCmsContent(content);
return ResponseMsgUtil.success("删除成功");
} catch (Exception e) {
log.error("CmsContentController --> findById() error!", e);
return ResponseMsgUtil.exception(e);
}
}
}

@ -1,17 +1,16 @@
package com.cweb.controller;
import com.alibaba.fastjson.JSONObject;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
import com.hai.common.exception.SysCode;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.BsCompany;
import com.hai.entity.CmsContent;
import com.hai.entity.CmsPatch;
import com.hai.entity.SecRegion;
import com.hai.config.CmsContentConfig;
import com.hai.entity.*;
import com.hai.model.CmsContentModel;
import com.hai.model.ResponseData;
import com.hai.model.UserInfoModel;
import com.hai.service.BsCompanyService;
import com.hai.service.CmsContentService;
import com.hai.service.CmsPatchService;
import com.hai.service.CommonService;
import com.hai.service.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
@ -37,28 +36,73 @@ public class CmsContentController {
@Resource
private CmsContentService cmsContentService;
@Resource
private CmsCategoryService cmsCategoryService;
@Resource
private BsCompanyService bsCompanyService;
@Resource
private CmsContentConfig cmsContentConfig;
@RequestMapping(value = "/getCmsContent", method = RequestMethod.GET)
@ApiOperation(value = "查询首页轮播图")
@ResponseBody
public ResponseData getCmsContent(@RequestParam(name = "regionId", required = true) String regionId,
public ResponseData getCmsContent(@RequestParam(name = "companyId", required = true) Long companyId,
@RequestParam(name = "platform", required = true) Integer platform,
@RequestParam(name = "categoryCode", required = true) String categoryCode) {
try {
SecRegion region = commonService.getParentByRegion(Long.parseLong(regionId));
if (region != null) {
BsCompany bsCompany = bsCompanyService.selectCompanyByRegion(region.getRegionId().toString());
if (bsCompany != null) {
Map<String,String> map = new HashMap<>();
map.put("companyId", bsCompany.getId().toString());
map.put("status", "2");
map.put("categoryCode", categoryCode);
return ResponseMsgUtil.success(cmsContentService.getListContentByCrest(map));
CmsCategory category = cmsCategoryService.getCategoryByCode(categoryCode);
if (category == null) {
log.error("CmsContentController --> getCmsContent() error!");
throw ErrorHelp.genException(SysCode.System , ErrorCode.COMMON_ERROR , "未找到当前信息");
}
if (category.getParentId() == null) {
List<CmsCategory> categoryList = cmsCategoryService.getCategoryByParentId(category.getId());
List<JSONObject> objectList = new ArrayList<>();
for (CmsCategory cmsCategory : categoryList) {
JSONObject object = new JSONObject();
// 1.小图一行四个 2.轮播图 3.消息通知 4.大图展示 5.一横图三小图 6.数据库数据 7.小图一行五个
if (cmsCategory.getType() == 1 || cmsCategory.getType() == 2 || cmsCategory.getType() == 4 || cmsCategory.getType() == 5|| cmsCategory.getType() == 7 ) {
object.put("type" , cmsCategory.getType());
object.put("name" , cmsCategory.getName());
object.put("sort" , cmsCategory.getSort());
object.put("code" , cmsCategory.getCode());
object.put("childCategory" , cmsContentService.getListCmsContentByCategoryId(cmsCategory.getId() , companyId , platform));
} else if(cmsCategory.getType() == 6) {
object.put("type" , cmsCategory.getType());
object.put("name" , cmsCategory.getName());
object.put("sort" , cmsCategory.getSort());
object.put("code" , cmsCategory.getCode());
object.put("childDate" , cmsContentConfig.getCmsContentData(cmsCategory.getName() , companyId));
} else if(cmsCategory.getType() == 3) {
object.put("type" , cmsCategory.getType());
object.put("name" , cmsCategory.getName());
object.put("sort" , cmsCategory.getSort());
object.put("code" , cmsCategory.getCode());
object.put("childDate" , null);
}
objectList.add(object);
}
return ResponseMsgUtil.success(new ArrayList<>());
return ResponseMsgUtil.success(objectList);
} else {
JSONObject object = new JSONObject();
object.put("type" , category.getType());
object.put("name" , category.getName());
object.put("sort" , category.getSort());
object.put("code" , category.getCode());
object.put("childCategory" , cmsContentService.getListCmsContentByCategoryId(category.getId() , companyId , platform));
return ResponseMsgUtil.success(object);
}
} catch (Exception e) {
log.error("CmsContentController --> getCorporateAdvertising() error!", e);
return ResponseMsgUtil.exception(e);

@ -0,0 +1,58 @@
package com.hai.config;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hai.common.utils.ResponseMsgUtil;
import com.hai.entity.HighCoupon;
import com.hai.enum_type.CmsContentDataEnum;
import com.hai.service.HighCouponService;
import com.hai.service.HighDiscountPackageService;
import com.itextpdf.tool.xml.html.head.Title;
import org.springframework.context.annotation.Configuration;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;
/**
* @serviceName QrCodeUtilsConfig.java
* @author Sum1Dream
* @version 1.0.0
* @Description // CMS内容工具
* @createTime 09:54 2022/4/13
**/
@Configuration
public class CmsContentConfig {
@Resource
private HighCouponService highCouponService;
@Resource
private HighDiscountPackageService highDiscountPackageService;
public Object getCmsContentData(String title , Long companyId) throws Exception {
Map<String , Object> map = new HashMap<>();
// 判断是否是天天好券
if (CmsContentDataEnum.DISCOUNT.getName().equals(title)) {
map.put("companyId", companyId);
map.put("salesType" , 1);
map.put("status" , 1);
PageHelper.startPage(1, 3);
return new PageInfo<>( highDiscountPackageService.getDiscountPackageList(map)).getList();
} else {
map.put("companyId", companyId);
map.put("displayArea", CmsContentDataEnum.getTypeByName(title));
map.put("notCouponSource", 2);
map.put("status", 2);
PageHelper.startPage(1, 3);
return new PageInfo<>(highCouponService.getCouponList(map)).getList();
}
}
}

@ -25,11 +25,14 @@ public interface CmsContentMapperExt {
" AND cc.title REGEXP #{title}",
"</if>",
"<if test=\"category != null\">",
" AND cc.category_id = #{category}",
" AND cc.category_id = #{categoryId}",
"</if>",
"<if test=\"categoryCode != null\">",
" AND cc.category_code = #{categoryCode}",
"</if>",
"<if test=\"platform != null\">",
" AND cc.platform = #{platform}",
"</if>",
"<if test=\"companyId != null\">",
" AND cc.company_id = #{companyId}",
"</if>",

@ -18,7 +18,7 @@ public class CmsCategory implements Serializable {
private Long id;
/**
* 类型: 1.cms内容 2.数据库数据
* 类型: // 1.小图一行四个 2.轮播图 3.消息通知 4.大图展示 5.一横图三小图 6.数据库数据 7.小图一行五个
*/
private Integer type;

@ -1,5 +1,7 @@
package com.hai.entity;
import com.alibaba.fastjson.JSONArray;
import java.io.Serializable;
import java.util.Date;
@ -118,6 +120,17 @@ public class CmsContent implements Serializable {
*/
private String userName;
private Integer[] platformArray;
public Integer[] getPlatformArray() {
return platformArray;
}
public void setPlatformArray(Integer[] platformArray) {
this.platformArray = platformArray;
}
/**
* 操作人id
*/
@ -134,6 +147,7 @@ public class CmsContent implements Serializable {
*/
private String content;
private static final long serialVersionUID = 1L;
public Long getId() {

@ -0,0 +1,52 @@
package com.hai.enum_type;
import java.util.Objects;
/**
* @serviceName CmsContentDataEnum.java
* @author Sum1Dream
* @version 1.0.0
* @Description // CMS内容数据
* @createTime 09:22 2022/9/28
**/
public enum CmsContentDataEnum {
REFUEL(1 , "加油专区"),
INTEGRAL(2 , "积分专区"),
UNION_PAY(3 , "银联专区"),
PREFERABLY(4 , "优选商品"),
UNION_CARD(5 , "工会卡专区"),
DISCOUNT(6 , "天天好券"),
;
private Integer type;
private String name;
CmsContentDataEnum(int type , String name) {
this.type = type;
this.name = name;
}
public static Integer getTypeByName(String name) {
for (CmsContentDataEnum ele : values()) {
if(Objects.equals(name,ele.getName())) return ele.getType();
}
return null;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

@ -61,6 +61,26 @@ public interface CmsCategoryService {
*/
CmsCategory getCategoryById(Long id) throws Exception;
/**
* @Author Sum1Dream
* @Name getCategoryByCode
* @Description // 根据编码查询内容
* @Date 17:06 2022/9/27
* @Param [categoryCode]
* @Return com.hai.entity.CmsCategory
*/
CmsCategory getCategoryByCode(String categoryCode ) throws Exception;
/**
* @Author Sum1Dream
* @Name getCategoryByParentId
* @Description //
* @Date 17:22 2022/9/27
* @Param [parentId]
* @Return java.util.List<com.hai.entity.CmsCategory>
*/
List<CmsCategory> getCategoryByParentId(Long parentId);
/**
*
* @Title: getCategoryTree

@ -30,6 +30,7 @@ public interface CmsContentService {
*/
int addContent(CmsContent cmsContent, List<CmsPatch> patchList, Map<String, String> paramsMap, String cmsPath) throws Exception;
/**
*
* @Title: updateContent
@ -52,6 +53,36 @@ public interface CmsContentService {
*/
int delContent(Long id, String cmsPath) throws Exception;
/**
* @Author Sum1Dream
* @Name insertCmsContent
* @Description // 新增CMS内容
* @Date 16:42 2022/9/26
* @Param [cmsContent]
* @Return void
*/
void insertCmsContent(CmsContent cmsContent);
/**
* @Author Sum1Dream
* @Name updateCmsContent
* @Description // 修改CMS内容
* @Date 16:42 2022/9/26
* @Param [cmsContent]
* @Return void
*/
void updateCmsContent(CmsContent cmsContent);
/**
* @Author Sum1Dream
* @Name findById
* @Description // 根据id 查询内容
* @Date 16:44 2022/9/26
* @Param [id]
* @Return com.hai.entity.CmsContent
*/
CmsContent findById(Long id);
/**
*
* @Title: getContentById
@ -85,6 +116,25 @@ public interface CmsContentService {
*/
List<CmsContentModel> getListContent(Map<String, String> paramsMap) throws Exception;
/**
* @Author Sum1Dream
* @Name getListCmsContent
* @Description // 查询内容列表
* @Date 10:30 2022/9/27
* @Param [map]
* @Return java.util.List<com.hai.entity.CmsContent>
*/
List<CmsContent> getListCmsContent(Map<String , Object> map);
/**
* @Author Sum1Dream
* @Name getListCmsContentByCategoryId
* @Description // 根据编码id 查询内容
* @Date 17:59 2022/9/27
* @Param [categoryId]
* @Return java.util.List<com.hai.entity.CmsContent>
*/
List<CmsContent> getListCmsContentByCategoryId(Long categoryId , Long companyId , Integer platform);
/**
*

@ -79,7 +79,6 @@ public class CmsCategoryServiceImpl implements CmsCategoryService {
if(cmsCategory.getStatus() == null){
cmsCategory.setStatus(category.getStatus());
}
cmsCategory.setCode(category.getCode());
cmsCategory.setParentId(category.getParentId());
cmsCategoryMapper.updateByPrimaryKey(cmsCategory);
@ -109,6 +108,30 @@ public class CmsCategoryServiceImpl implements CmsCategoryService {
return cmsCategoryMapper.selectByPrimaryKey(id);
}
@Override
public CmsCategory getCategoryByCode(String categoryCode) throws Exception {
CmsCategoryExample example = new CmsCategoryExample();
example.createCriteria().andCodeEqualTo(categoryCode).andStatusEqualTo(1);
List<CmsCategory> categoryList = cmsCategoryMapper.selectByExample(example);
if (categoryList.size() > 0) {
return categoryList.get(0);
}
return null;
}
@Override
public List<CmsCategory> getCategoryByParentId(Long parentId) {
CmsCategoryExample example = new CmsCategoryExample();
example.createCriteria().andParentIdEqualTo(parentId).andStatusEqualTo(1);
example.setOrderByClause("sort");
return cmsCategoryMapper.selectByExample(example);
}
@Override
public List<CmsCategoryTreeModel> getCategoryTree(Map<String, Object> paramsMap) throws Exception {
// 查询分类列表

@ -8,6 +8,7 @@ import com.hai.dao.CmsContentMapper;
import com.hai.entity.*;
import com.hai.model.CmsContentModel;
import com.hai.service.*;
import org.apache.commons.collections4.MapUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
@ -178,6 +179,42 @@ public class CmsContentServiceImpl implements CmsContentService {
return cmsContentMapper.getListContent(paramsMap);
}
@Override
public List<CmsContent> getListCmsContent(Map<String, Object> map) {
CmsContentExample example = new CmsContentExample();
CmsContentExample.Criteria criteria = example.createCriteria();
if (MapUtils.getString(map,"title") != null) {
criteria.andTitleLike("%" + MapUtils.getString(map,"title") + "%");
}
if (MapUtils.getLong(map,"categoryId") != null) {
criteria.andCategoryIdEqualTo(MapUtils.getLong(map,"categoryId"));
}
if (MapUtils.getInteger(map,"platform") != null) {
criteria.andPlatformEqualTo(MapUtils.getInteger(map,"platform"));
}
if (MapUtils.getInteger(map,"status") != null) {
criteria.andStatusEqualTo(MapUtils.getInteger(map,"status"));
}else {
criteria.andStatusNotEqualTo(0);
}
if (MapUtils.getLong(map,"companyId") != null) {
criteria.andCompanyIdEqualTo(MapUtils.getLong(map,"companyId"));
}
return cmsContentMapper.selectByExample(example);
}
@Override
public List<CmsContent> getListCmsContentByCategoryId(Long categoryId , Long companyId , Integer platform) {
CmsContentExample example = new CmsContentExample();
example.createCriteria().andCategoryIdEqualTo(categoryId).andStatusEqualTo(2).andCompanyIdEqualTo(companyId).andPlatformEqualTo(platform);
return cmsContentMapper.selectByExample(example);
}
@Override
public List<CmsContentModel> getListContentByCrest(Map<String, String> paramsMap) throws Exception {
return cmsContentMapper.getListContentByCrest(paramsMap);
@ -229,4 +266,18 @@ public class CmsContentServiceImpl implements CmsContentService {
return "/CMS/html/" + strContentId + ".html";
}
@Override
public void insertCmsContent(CmsContent cmsContent) {
cmsContentMapper.insert(cmsContent);
}
@Override
public void updateCmsContent(CmsContent cmsContent) {
cmsContentMapper.updateByPrimaryKey(cmsContent);
}
@Override
public CmsContent findById(Long id) {
return cmsContentMapper.selectByPrimaryKey(id);
}
}

@ -1,5 +1,6 @@
package com.hai.service.impl;
import com.github.pagehelper.PageHelper;
import com.google.common.base.Stopwatch;
import com.hai.common.exception.ErrorCode;
import com.hai.common.exception.ErrorHelp;
@ -116,7 +117,6 @@ public class HighDiscountPackageServiceImpl implements HighDiscountPackageServic
} else {
criteria.andStatusNotEqualTo(4);
}
example.setOrderByClause("created_time desc");
return highDiscountPackageMapper.selectByExample(example);

Loading…
Cancel
Save