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

Commit c4cb3e63 authored by zhengfuxin's avatar zhengfuxin

修改上线问题

parent fceb2f10
......@@ -131,12 +131,14 @@ public class GoblinFrontBannerController extends BaseController {
logger.info("上线操作");
boolean bannerResult=goblinFrontBannerService.online();
logger.info("bannerResult,{}",bannerResult);
boolean bannerMiddle=goblinFrontBannerService.middle();
logger.info("banner中部{}",bannerMiddle);
boolean hotWordResult=goblinFrontHotWordService.online();
logger.info("热词,{}",hotWordResult);
boolean navigationResult=goblinFrontNavigationService.online();
logger.info("导航栏,{}",navigationResult);
boolean secillResult=goblinFrontSeckillService.online();
logger.info("限时秒杀,{}",secillResult);
/* boolean secillResult=goblinFrontSeckillService.online();
logger.info("限时秒杀,{}",secillResult);*/
boolean selectGoods=goblinFrontSelectGoodsService.online();
logger.info("精选商品{}",selectGoods);
boolean moudleIndexResult=goblinFrontMoudleIndexService.online();
......@@ -146,7 +148,7 @@ public class GoblinFrontBannerController extends BaseController {
logger.info("魔方{}",cubeResult);
/* boolean hejiReult=goblinFrontCompilationsService.online();
logger.info("合集{}",hejiReult);*/
if (bannerResult&&hotWordResult&&navigationResult ) {
if (bannerResult&&hotWordResult&&navigationResult&bannerMiddle&&selectGoods&&moudleIndexResult&&cubeResult ) {
return success("操作成功");
} else {
return error("操作失败");
......
......@@ -154,47 +154,53 @@ public class GoblinFrontBannerServiceImpl extends ServiceImpl<GoblinFrontBannerM
queryWrapper.eq(GoblinFrontBanner::getBannerType,1);
queryWrapper.orderByAsc(GoblinFrontBanner::getIndexs);
List<GoblinFrontBanner> list=goblinFrontBannerMapper.selectList(queryWrapper);
//mongodb
for(GoblinFrontBanner goblinFrontBanner: list){
GoblinFrontBanner goblinFrontBanner1=mongoTemplate.findOne(Query.query(Criteria.where("bannerId").is(goblinFrontBanner.getBannerId())), GoblinFrontBanner.class, GoblinFrontBanner.class.getSimpleName());
if(null==goblinFrontBanner1){
mongoTemplate.save(goblinFrontBanner,GoblinFrontBanner.class.getSimpleName());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontBanner)));
mongoTemplate.getCollection(GoblinFrontBanner.class.getSimpleName()).updateOne(
Query.query(Criteria.where("bannerId").is(goblinFrontBanner.getBannerId())).getQueryObject(),
orderObject
);
if(list.size()>0){
//mongodb
for(GoblinFrontBanner goblinFrontBanner: list){
GoblinFrontBanner goblinFrontBanner1=mongoTemplate.findOne(Query.query(Criteria.where("bannerId").is(goblinFrontBanner.getBannerId())), GoblinFrontBanner.class, GoblinFrontBanner.class.getSimpleName());
if(null==goblinFrontBanner1){
mongoTemplate.save(goblinFrontBanner,GoblinFrontBanner.class.getSimpleName());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontBanner)));
mongoTemplate.getCollection(GoblinFrontBanner.class.getSimpleName()).updateOne(
Query.query(Criteria.where("bannerId").is(goblinFrontBanner.getBannerId())).getQueryObject(),
orderObject
);
}
}
//redis
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_TOP_BANNER,list);
//中部
}
//redis
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_TOP_BANNER,list);
//中部
return true;
}
public void middle(){
public boolean middle(){
LambdaQueryWrapper<GoblinFrontBanner> queryWrapper = Wrappers.lambdaQuery(GoblinFrontBanner.class);
queryWrapper.ne(GoblinFrontBanner::getDelTag,1);
//bannerType
queryWrapper.eq(GoblinFrontBanner::getBannerType,2);
queryWrapper.orderByDesc(GoblinFrontBanner::getIndexs);
List<GoblinFrontBanner> list=goblinFrontBannerMapper.selectList(queryWrapper);
//mongodb
for(GoblinFrontBanner goblinFrontBanner: list){
GoblinFrontBanner goblinFrontBanner1=mongoTemplate.findOne(Query.query(Criteria.where("bannerId").is(goblinFrontBanner.getBannerId())), GoblinFrontBanner.class, GoblinFrontBanner.class.getSimpleName());
if(null==goblinFrontBanner1){
mongoTemplate.save(goblinFrontBanner,GoblinFrontBanner.class.getSimpleName());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontBanner)));
mongoTemplate.getCollection(GoblinFrontBanner.class.getSimpleName()).updateOne(
Query.query(Criteria.where("bannerId").is(goblinFrontBanner.getBannerId())).getQueryObject(),
orderObject
);
if(list.size()>0){
//mongodb
for(GoblinFrontBanner goblinFrontBanner: list){
GoblinFrontBanner goblinFrontBanner1=mongoTemplate.findOne(Query.query(Criteria.where("bannerId").is(goblinFrontBanner.getBannerId())), GoblinFrontBanner.class, GoblinFrontBanner.class.getSimpleName());
if(null==goblinFrontBanner1){
mongoTemplate.save(goblinFrontBanner,GoblinFrontBanner.class.getSimpleName());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontBanner)));
mongoTemplate.getCollection(GoblinFrontBanner.class.getSimpleName()).updateOne(
Query.query(Criteria.where("bannerId").is(goblinFrontBanner.getBannerId())).getQueryObject(),
orderObject
);
}
}
//redis
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_MIDDLE_BANNER,list);
}
//redis
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_MIDDLE_BANNER,list);
return true;
}
......
......@@ -99,21 +99,24 @@ public class GoblinFrontCubeServiceImpl extends ServiceImpl<GoblinFrontCubeMappe
LambdaQueryWrapper<GoblinFrontCube> queryWrapper = Wrappers.lambdaQuery(GoblinFrontCube.class);
queryWrapper.ne(GoblinFrontCube::getDelTag,1);
List<GoblinFrontCube> list=goblinFrontCubeMapper.selectList(queryWrapper);
//mongodb
for(GoblinFrontCube goblinFrontCube: list){
GoblinFrontCube goblinFrontCube1=mongoTemplate.findOne(Query.query(Criteria.where("cubeId").is(goblinFrontCube.getCubeId())), GoblinFrontCube.class, GoblinFrontCube.class.getSimpleName());
if(null==goblinFrontCube1){
mongoTemplate.save(goblinFrontCube,GoblinFrontCube.class.getSimpleName());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontCube)));
mongoTemplate.getCollection(GoblinFrontCube.class.getSimpleName()).updateOne(
Query.query(Criteria.where("cubeId").is(goblinFrontCube.getCubeId())).getQueryObject(),
orderObject
);
if(list.size()>0){
//mongodb
for(GoblinFrontCube goblinFrontCube: list){
GoblinFrontCube goblinFrontCube1=mongoTemplate.findOne(Query.query(Criteria.where("cubeId").is(goblinFrontCube.getCubeId())), GoblinFrontCube.class, GoblinFrontCube.class.getSimpleName());
if(null==goblinFrontCube1){
mongoTemplate.save(goblinFrontCube,GoblinFrontCube.class.getSimpleName());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontCube)));
mongoTemplate.getCollection(GoblinFrontCube.class.getSimpleName()).updateOne(
Query.query(Criteria.where("cubeId").is(goblinFrontCube.getCubeId())).getQueryObject(),
orderObject
);
}
}
//redis
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_GOBLINFRONTCUBE,list);
}
//redis
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_GOBLINFRONTCUBE,list);
return true;
}
......
......@@ -146,21 +146,23 @@ public class GoblinFrontHotWordServiceImpl extends ServiceImpl<GoblinFrontHotWor
queryWrapper.ne(GoblinFrontHotWord::getDelTag,1);
queryWrapper.orderByDesc(GoblinFrontHotWord::getIndexs);
List<GoblinFrontHotWord> list=goblinFrontHotWordMapper.selectList(queryWrapper);
for(GoblinFrontHotWord goblinFrontHotWord: list){
//查看 mongodb 有没有
GoblinFrontHotWord goblinFrontHotWord1=mongoTemplate.findOne(Query.query(Criteria.where("hotWordId").is(goblinFrontHotWord.getHotWordId())), GoblinFrontHotWord.class, GoblinFrontHotWord.class.getSimpleName());
if(null==goblinFrontHotWord1){
mongoTemplate.save(goblinFrontHotWord,GoblinFrontHotWord.class.getSimpleName());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontHotWord)));
mongoTemplate.getCollection(GoblinFrontHotWord.class.getSimpleName()).updateOne(
Query.query(Criteria.where("hotWordId").is(goblinFrontHotWord.getHotWordId())).getQueryObject(),
orderObject
);
}
if(list.size()>0){
for(GoblinFrontHotWord goblinFrontHotWord: list){
//查看 mongodb 有没有
GoblinFrontHotWord goblinFrontHotWord1=mongoTemplate.findOne(Query.query(Criteria.where("hotWordId").is(goblinFrontHotWord.getHotWordId())), GoblinFrontHotWord.class, GoblinFrontHotWord.class.getSimpleName());
if(null==goblinFrontHotWord1){
mongoTemplate.save(goblinFrontHotWord,GoblinFrontHotWord.class.getSimpleName());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontHotWord)));
mongoTemplate.getCollection(GoblinFrontHotWord.class.getSimpleName()).updateOne(
Query.query(Criteria.where("hotWordId").is(goblinFrontHotWord.getHotWordId())).getQueryObject(),
orderObject
);
}
}
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_HOTWORD,list);
}
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_HOTWORD,list);
return true;
}
......
......@@ -67,23 +67,25 @@ public class GoblinFrontMoudleIndexServiceImpl extends ServiceImpl<GoblinFrontMo
queryWrapper.ne(GoblinFrontMoudleIndex::getDelTag,1);
queryWrapper.orderByAsc(GoblinFrontMoudleIndex::getIndexs);
List<GoblinFrontMoudleIndex> list=goblinFrontMoudleIndexMapper.selectList(queryWrapper);
// List<GoblinFrontMoudleIndexParam> list=this.listGoblinFrontMoudleIndex();
// mongodb 放入
for(GoblinFrontMoudleIndex 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());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontMoudleIndex)));
mongoTemplate.getCollection(GoblinFrontMoudleIndex.class.getSimpleName()).updateOne(
Query.query(Criteria.where("moudleIndexId").is(goblinFrontMoudleIndex.getMoudleIndexId())).getQueryObject(),
orderObject
);
if(list.size()>0){
for(GoblinFrontMoudleIndex 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());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontMoudleIndex)));
mongoTemplate.getCollection(GoblinFrontMoudleIndex.class.getSimpleName()).updateOne(
Query.query(Criteria.where("moudleIndexId").is(goblinFrontMoudleIndex.getMoudleIndexId())).getQueryObject(),
orderObject
);
}
}
// reids 存入
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.MOUDLE_INDEX,list);
}
// reids 存入
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.MOUDLE_INDEX,list);
// List<GoblinFrontMoudleIndexParam> list=this.listGoblinFrontMoudleIndex();
// mongodb 放入
return true;
}
......
......@@ -139,21 +139,24 @@ public class GoblinFrontNavigationServiceImpl extends ServiceImpl<GoblinFrontNav
queryWrapper.ne(GoblinFrontNavigation::getDelTag,1);
queryWrapper.orderByDesc(GoblinFrontNavigation::getIndexs);
List<GoblinFrontNavigation> list=goblinFrontNavigationMapper.selectList(queryWrapper);
//mongodb
for(GoblinFrontNavigation goblinFrontNavigation: list){
GoblinFrontNavigation goblinFrontNavigation1=mongoTemplate.findOne(Query.query(Criteria.where("navigationId").is(goblinFrontNavigation.getNavigationId())), GoblinFrontNavigation.class, GoblinFrontNavigation.class.getSimpleName());
if(null==goblinFrontNavigation1){
mongoTemplate.save(goblinFrontNavigation,GoblinFrontNavigation.class.getSimpleName());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontNavigation)));
mongoTemplate.getCollection(GoblinFrontNavigation.class.getSimpleName()).updateOne(
Query.query(Criteria.where("navigationId").is(goblinFrontNavigation.getNavigationId())).getQueryObject(),
orderObject
);
if(list.size()>0){
//mongodb
for(GoblinFrontNavigation goblinFrontNavigation: list){
GoblinFrontNavigation goblinFrontNavigation1=mongoTemplate.findOne(Query.query(Criteria.where("navigationId").is(goblinFrontNavigation.getNavigationId())), GoblinFrontNavigation.class, GoblinFrontNavigation.class.getSimpleName());
if(null==goblinFrontNavigation1){
mongoTemplate.save(goblinFrontNavigation,GoblinFrontNavigation.class.getSimpleName());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontNavigation)));
mongoTemplate.getCollection(GoblinFrontNavigation.class.getSimpleName()).updateOne(
Query.query(Criteria.where("navigationId").is(goblinFrontNavigation.getNavigationId())).getQueryObject(),
orderObject
);
}
}
//redis
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_NAVIGATION,list);
}
//redis
redisDataSourceUtil.getRedisGoblinUtil().set(GoblinRedisConst.FRONT_NAVIGATION,list);
return true;
}
......
......@@ -157,21 +157,23 @@ public class GoblinFrontSeckillServiceImpl extends ServiceImpl<GoblinFrontSeckil
queryWrapper.ne(GoblinFrontSeckill::getDelTag,1);
queryWrapper.orderByAsc(GoblinFrontSeckill::getIndexs);
List<GoblinFrontSeckill> list=goblinFrontSeckillMapper.selectList(queryWrapper);
//mongodb
for(GoblinFrontSeckill goblinFrontSeckill: list){
GoblinFrontSeckill goblinFrontNavigation1=mongoTemplate.findOne(Query.query(Criteria.where("seckilId").is(goblinFrontSeckill.getSeckilId())), GoblinFrontSeckill.class, GoblinFrontSeckill.class.getSimpleName());
if(null==goblinFrontNavigation1){
mongoTemplate.save(goblinFrontSeckill,GoblinFrontSeckill.class.getSimpleName());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontSeckill)));
mongoTemplate.getCollection(GoblinFrontSeckill.class.getSimpleName()).updateOne(
Query.query(Criteria.where("seckilId").is(goblinFrontSeckill.getSeckilId())).getQueryObject(),
orderObject
);
if(list.size()>0){
//mongodb
for(GoblinFrontSeckill goblinFrontSeckill: list){
GoblinFrontSeckill goblinFrontNavigation1=mongoTemplate.findOne(Query.query(Criteria.where("seckilId").is(goblinFrontSeckill.getSeckilId())), GoblinFrontSeckill.class, GoblinFrontSeckill.class.getSimpleName());
if(null==goblinFrontNavigation1){
mongoTemplate.save(goblinFrontSeckill,GoblinFrontSeckill.class.getSimpleName());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontSeckill)));
mongoTemplate.getCollection(GoblinFrontSeckill.class.getSimpleName()).updateOne(
Query.query(Criteria.where("seckilId").is(goblinFrontSeckill.getSeckilId())).getQueryObject(),
orderObject
);
}
}
//redis 保存秒杀表信息
redisGoblinUtil.set(GoblinRedisConst.FRONT_SECKILL,list);
}
//redis 保存秒杀表信息
redisGoblinUtil.set(GoblinRedisConst.FRONT_SECKILL,list);
return true;
}
}
......@@ -120,19 +120,22 @@ public class GoblinFrontSelectGoodsServiceImpl extends ServiceImpl<GoblinFrontSe
LambdaQueryWrapper<GoblinFrontSelectGoods> queryWrapper = Wrappers.lambdaQuery(GoblinFrontSelectGoods.class);
queryWrapper.eq(GoblinFrontSelectGoods::getDelTag,0);
List<GoblinFrontSelectGoods> list=goblinFrontSelectGoodsMapper.selectList(queryWrapper);
//放入mongodb
GoblinFrontSelectGoods goblinFrontSelectGoods= list.get(0);
GoblinFrontSelectGoods goblinFrontSelectGoods1= mongoTemplate.findOne(Query.query(Criteria.where("selectGoodsId").is(goblinFrontSelectGoods.getSelectGoodsId())), GoblinFrontSelectGoods.class, GoblinFrontSelectGoods.class.getSimpleName());
if(null==goblinFrontSelectGoods1){
mongoTemplate.save(goblinFrontSelectGoods,GoblinFrontSelectGoods.class.getSimpleName());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontSelectGoods)));
mongoTemplate.getCollection(GoblinFrontSelectGoods.class.getSimpleName()).updateOne(
Query.query(Criteria.where("selectGoodsId").is(goblinFrontSelectGoods.getSelectGoodsId())).getQueryObject(),
orderObject
);
if(list.size()>0){
//放入mongodb
GoblinFrontSelectGoods goblinFrontSelectGoods= list.get(0);
GoblinFrontSelectGoods goblinFrontSelectGoods1= mongoTemplate.findOne(Query.query(Criteria.where("selectGoodsId").is(goblinFrontSelectGoods.getSelectGoodsId())), GoblinFrontSelectGoods.class, GoblinFrontSelectGoods.class.getSimpleName());
if(null==goblinFrontSelectGoods1){
mongoTemplate.save(goblinFrontSelectGoods,GoblinFrontSelectGoods.class.getSimpleName());
}else{
BasicDBObject orderObject = new BasicDBObject("$set", JSON.parse(JsonUtils.toJson(goblinFrontSelectGoods)));
mongoTemplate.getCollection(GoblinFrontSelectGoods.class.getSimpleName()).updateOne(
Query.query(Criteria.where("selectGoodsId").is(goblinFrontSelectGoods.getSelectGoodsId())).getQueryObject(),
orderObject
);
}
redisGoblinUtil.set(GoblinRedisConst.SELECT_GOODS,list);
}
redisGoblinUtil.set(GoblinRedisConst.SELECT_GOODS,list);
return true;
}
}
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