记得上下班打卡 | git大法好,push需谨慎

Commit faf4a598 authored by zhengfuxin's avatar zhengfuxin

修改bug

parent d4c9f7cf
package com.liquidnet.service.goblin.param;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.liquidnet.commons.lang.util.DateUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 组件排序
* </p>
*
* @author liquidnet
* @since 2022-01-06
*/
@Data
@EqualsAndHashCode(callSuper = false)
public class GoblinFrontMoudleIndexParam implements Serializable {
private static final long serialVersionUID = 1L;
@TableId(value = "mid", type = IdType.AUTO)
private Long mid;
/**
* 组件排序id
*/
private String moudleIndexId;
/**
* 名字
*/
private String moudleName;
/**
* 顺序
*/
private Integer indexs;
/**
* 修改时间
*/
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern=DateUtil.DATE_FULL_STR)
private LocalDateTime updateTime;
/**
* 创建时间
*/
@JsonFormat(shape=JsonFormat.Shape.STRING, pattern= DateUtil.DATE_FULL_STR)
private LocalDateTime createTime;
/**
* 0未删除1已删除
*/
private Integer delTag;
/**
* 0展示2不展示
*/
private Integer status;
}
......@@ -49,7 +49,7 @@ public class GoblinFrontBannerController extends BaseController {
* @Description:添加banner
* @date 2021/12/27 下午1:22
*/
@PostMapping("create")
/*@PostMapping("create")
@ApiOperation(value = "增加banner")
@ResponseBody
public AjaxResult create(@RequestBody GoblinFrontBannerBuildParam goblinFrontBannerBuildParam) {
......@@ -63,7 +63,7 @@ public class GoblinFrontBannerController extends BaseController {
return error("操作失败");
}
}
*/
@PostMapping("updateOrCreate")
@ApiOperation(value = "修改或者增加banner")
@ResponseBody
......@@ -96,7 +96,7 @@ public class GoblinFrontBannerController extends BaseController {
return error("操作失败");
}
}
@PostMapping("getOne")
/*@PostMapping("getOne")
@ApiOperation(value = "查看详情")
@ResponseBody
public AjaxResult getOne( @RequestBody GoblinFrontBannerBuildParam goblinFrontBannerBuildParam) {
......@@ -114,11 +114,11 @@ public class GoblinFrontBannerController extends BaseController {
BeanUtils.copyProperties(goblinFrontBannerBuildParam,goblinFrontBanner);
logger.info("分页banner{}", JSON.toJSONString(goblinFrontBanner));
return AjaxResult.success(goblinFrontBannerService.bannerPage(pageSize,pageNumber,null));
}
}*/
@PostMapping("list")
@ApiOperation(value = "list")
@ResponseBody
public AjaxResult page( @RequestParam(name = "type", required = true) String type) {
public AjaxResult list( @RequestParam(name = "type", required = true) String type) {
return AjaxResult.success(goblinFrontBannerService.listGoblinFrontBanner(type));
}
......
......@@ -32,7 +32,7 @@ public class GoblinFrontHotWordController extends BaseController {
* @author zhangfuxin
* @Description:添加banner
* @date 2021/12/27 下午1:22
*/
*//*
@PostMapping("create")
@ApiOperation(value = "增加热词")
@ResponseBody
......@@ -46,7 +46,7 @@ public class GoblinFrontHotWordController extends BaseController {
} else {
return error("操作失败");
}
}
}*/
@PostMapping("updateOrCreate")
@ApiOperation(value = "修改或者增加热词")
@ResponseBody
......@@ -65,10 +65,10 @@ public class GoblinFrontHotWordController extends BaseController {
@ApiOperation(value = "list")
@ResponseBody
public AjaxResult page( ) {
return AjaxResult.success(goblinFrontHotWordService.list());
return AjaxResult.success(goblinFrontHotWordService.listGoblinFrontHotWordBuildParam());
}
@PostMapping("delete")
/*@PostMapping("delete")
@ApiOperation(value = "删除热词")
@ResponseBody
public AjaxResult delete( @RequestBody GoblinFrontHotWordBuildParam goblinFrontHotWordBuildParam) {
......@@ -100,5 +100,5 @@ public class GoblinFrontHotWordController extends BaseController {
BeanUtils.copyProperties(goblinFrontHotWordBuildParam,goblinFrontHotWord);
logger.info("分页banner{}", JSON.toJSONString(goblinFrontHotWord));
return AjaxResult.success(goblinFrontHotWordService.page(pageSize,pageNumber,null));
}
}*/
}
......@@ -2,6 +2,7 @@ package com.liquidnet.client.admin.zhengzai.goblin.service;
import com.liquidnet.service.goblin.entity.GoblinFrontMoudleIndex;
import com.baomidou.mybatisplus.extension.service.IService;
import com.liquidnet.service.goblin.param.GoblinFrontMoudleIndexParam;
import java.util.List;
......@@ -14,7 +15,7 @@ import java.util.List;
* @since 2022-01-06
*/
public interface IGoblinFrontMoudleIndexService extends IService<GoblinFrontMoudleIndex> {
List<GoblinFrontMoudleIndex> listGoblinFrontMoudleIndex();
List<GoblinFrontMoudleIndexParam> listGoblinFrontMoudleIndex();
boolean upadteGoblinFrontMoudleIndex(GoblinFrontMoudleIndex goblinFrontMoudleIndex);
......
......@@ -12,7 +12,9 @@ import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.entity.GoblinFrontBanner;
import com.liquidnet.service.goblin.mapper.GoblinFrontBannerMapper;
import com.liquidnet.service.goblin.param.GoblinFrontBannerBuildParam;
import com.mongodb.BasicDBObject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
......@@ -20,6 +22,7 @@ import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -124,14 +127,20 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
}
return pageInfoTmp;
}
public List<GoblinFrontBanner> listGoblinFrontBanner(String type) {
public List<GoblinFrontBannerBuildParam> listGoblinFrontBanner(String type) {
//banner_type 1、首页顶部位置2、首页中部位置
// PageHelper.startPage(pageNumber, pageSize);
LambdaQueryWrapper<GoblinFrontBanner> queryWrapper = Wrappers.lambdaQuery(GoblinFrontBanner.class);
queryWrapper.eq(GoblinFrontBanner::getBannerType,type);
queryWrapper.orderByAsc(GoblinFrontBanner::getIndexs);
List<GoblinFrontBanner> list=goblinFrontBannerMapper.selectList(queryWrapper);
return list;
List<GoblinFrontBannerBuildParam> list1=new ArrayList();
for(GoblinFrontBanner goblinFrontBanner:list){
GoblinFrontBannerBuildParam goblinFrontBannerBuildParam=new GoblinFrontBannerBuildParam();
BeanUtils.copyProperties(goblinFrontBanner,goblinFrontBannerBuildParam);
list1.add(goblinFrontBannerBuildParam);
}
return list1;
}
public boolean online(){
//banner
......
......@@ -13,7 +13,9 @@ import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.entity.GoblinFrontHotWord;
import com.liquidnet.service.goblin.mapper.GoblinFrontHotWordMapper;
import com.liquidnet.service.goblin.param.GoblinFrontHotWordBuildParam;
import com.mongodb.BasicDBObject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
......@@ -21,6 +23,7 @@ import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -106,12 +109,18 @@ public class GoblinFrontHotWordServiceImpl extends ServiceImpl<GoblinFrontHotWor
this.update(goblinFrontHotWord);
return true;
}
public List<GoblinFrontHotWord> list(){
public List<GoblinFrontHotWordBuildParam> listGoblinFrontHotWordBuildParam(){
LambdaQueryWrapper<GoblinFrontHotWord> queryWrapper = Wrappers.lambdaQuery(GoblinFrontHotWord.class);
queryWrapper.ne(GoblinFrontHotWord::getDelTag,1);
queryWrapper.orderByDesc(GoblinFrontHotWord::getCreateTime);
List<GoblinFrontHotWord> list=goblinFrontHotWordMapper.selectList(queryWrapper);
return list;
List<GoblinFrontHotWordBuildParam> list1=new ArrayList<>();
for(GoblinFrontHotWord goblinFrontHotWord:list){
GoblinFrontHotWordBuildParam goblinFrontHotWordBuildParam=new GoblinFrontHotWordBuildParam();
BeanUtils.copyProperties(goblinFrontHotWord,goblinFrontHotWordBuildParam);
list1.add(goblinFrontHotWordBuildParam);
}
return list1;
}
/**
* @author zhangfuxin
......
......@@ -10,7 +10,9 @@ import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.entity.GoblinFrontMoudleIndex;
import com.liquidnet.service.goblin.mapper.GoblinFrontMoudleIndexMapper;
import com.liquidnet.service.goblin.param.GoblinFrontMoudleIndexParam;
import com.mongodb.BasicDBObject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoTemplate;
import org.springframework.data.mongodb.core.query.Criteria;
......@@ -18,6 +20,7 @@ import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Service;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
/**
......@@ -38,11 +41,17 @@ public class GoblinFrontMoudleIndexServiceImpl extends ServiceImpl<GoblinFrontMo
private RedisDataSourceUtil redisDataSourceUtil;
@Override
public List<GoblinFrontMoudleIndex> listGoblinFrontMoudleIndex() {
public List<GoblinFrontMoudleIndexParam> listGoblinFrontMoudleIndex() {
LambdaQueryWrapper<GoblinFrontMoudleIndex> queryWrapper = Wrappers.lambdaQuery(GoblinFrontMoudleIndex.class);
queryWrapper.orderByAsc(GoblinFrontMoudleIndex::getIndexs);
List<GoblinFrontMoudleIndex> list=goblinFrontMoudleIndexMapper.selectList(queryWrapper);
return list;
List<GoblinFrontMoudleIndexParam> list1=new ArrayList<>();
for(GoblinFrontMoudleIndex goblinFrontMoudleIndex:list){
GoblinFrontMoudleIndexParam goblinFrontMoudleIndexParam=new GoblinFrontMoudleIndexParam();
BeanUtils.copyProperties(goblinFrontMoudleIndex,goblinFrontMoudleIndexParam);
list1.add(goblinFrontMoudleIndexParam);
}
return list1;
}
@Override
......@@ -54,9 +63,9 @@ public class GoblinFrontMoudleIndexServiceImpl extends ServiceImpl<GoblinFrontMo
public boolean online(){
//查出数据
List<GoblinFrontMoudleIndex> list=this.listGoblinFrontMoudleIndex();
List<GoblinFrontMoudleIndexParam> list=this.listGoblinFrontMoudleIndex();
// mongodb 放入
for(GoblinFrontMoudleIndex goblinFrontMoudleIndex:list){
for(GoblinFrontMoudleIndexParam goblinFrontMoudleIndex:list){
GoblinFrontMoudleIndex goblinFrontMoudleIndex1=mongoTemplate.findOne(Query.query(Criteria.where("moudleIndexId").is(goblinFrontMoudleIndex.getMoudleIndexId())), GoblinFrontMoudleIndex.class, GoblinFrontMoudleIndex.class.getSimpleName());
if(null==goblinFrontMoudleIndex1){
mongoTemplate.save(goblinFrontMoudleIndex,GoblinFrontMoudleIndex.class.getSimpleName());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment