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

Commit 8aaafc1b authored by 胡佳晨's avatar 胡佳晨

Merge remote-tracking branch 'origin/dev_goblin' into dev_goblin

parents 279370f3 5e738d3f
......@@ -4,7 +4,10 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.client.admin.common.utils.ShiroUtils;
import com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinSelfGoodsCategoryService;
import com.liquidnet.common.cache.redis.util.RedisDataSourceUtil;
import com.liquidnet.common.exception.LiquidnetServiceException;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.dto.GoblinSelfGoodsCategoryDto;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfGoodsCategoryVo;
import com.liquidnet.service.goblin.entity.GoblinSelfGoodsCategory;
......@@ -38,6 +41,8 @@ public class GoblinSelfGoodsCategoryServiceImpl extends ServiceImpl<GoblinSelfGo
private GoblinSelfGoodsCategoryMapper goblinSelfGoodsCategoryMapper;
@Autowired
private MongoTemplate mongoTemplate;
@Autowired
private RedisDataSourceUtil redisDataSourceUtil;
@Override
public List<GoblinSelfGoodsCategoryDto> listForForMultiGrade() {
......@@ -49,7 +54,9 @@ public class GoblinSelfGoodsCategoryServiceImpl extends ServiceImpl<GoblinSelfGo
public boolean addSave(GoblinSelfGoodsCategory selfGoodsCategory) {
if (this.save(selfGoodsCategory)) {
mongoTemplate.insert(GoblinSelfGoodsCategoryVo.getNew().copy(selfGoodsCategory), GoblinSelfGoodsCategoryVo.class.getSimpleName());
// TODO: 2022/1/14 zhanggb redis
redisDataSourceUtil.getRedisGoblinUtil().del(GoblinRedisConst.BASIC_SELF_GOODS_CATEGORY);
return true;
}
return false;
......@@ -82,8 +89,13 @@ public class GoblinSelfGoodsCategoryServiceImpl extends ServiceImpl<GoblinSelfGo
Update.update("delFlg", "1").set("updatedBy", loginName).set("updatedAt", now).set("deletedBy", loginName).set("deletedAt", now),
GoblinSelfGoodsCategoryVo.class.getSimpleName()
);
log.info("店铺管理:商品分类:删除[cateIdArr={},MONGO.UpdateResult={}]", JsonUtils.toJson(cateIdArr), JsonUtils.toJson(updateResult));
// TODO: 2022/1/14 zhanggb redis
// log.info("店铺管理:商品分类:删除[cateIdArr={},MONGO.UpdateResult={}]", JsonUtils.toJson(cateIdArr), JsonUtils.toJson(updateResult));
if (updateResult.getModifiedCount() <= 0) {
log.error("店铺管理:商品分类:删除:MDB更新失败[cateIdArr={}]", JsonUtils.toJson(cateIdArr));
throw new LiquidnetServiceException();
}
redisDataSourceUtil.getRedisGoblinUtil().del(GoblinRedisConst.BASIC_SELF_GOODS_CATEGORY);
}
return rmvResultFlg;
}
......
......@@ -4,7 +4,10 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.client.admin.zhengzai.goblin.service.IGoblinSelfTagService;
import com.liquidnet.common.cache.redis.util.RedisDataSourceUtil;
import com.liquidnet.common.exception.LiquidnetServiceException;
import com.liquidnet.commons.lang.util.JsonUtils;
import com.liquidnet.service.goblin.constant.GoblinRedisConst;
import com.liquidnet.service.goblin.dto.vo.GoblinSelfTagVo;
import com.liquidnet.service.goblin.entity.GoblinSelfTag;
import com.liquidnet.service.goblin.mapper.GoblinSelfTagMapper;
......@@ -34,6 +37,8 @@ public class GoblinSelfGoodsTagServiceImpl extends ServiceImpl<GoblinSelfTagMapp
@Autowired
private MongoTemplate mongoTemplate;
@Autowired
private RedisDataSourceUtil redisDataSourceUtil;
@Autowired
private GoblinSelfTagMapper goblinSelfTagMapper;
@Transactional
......@@ -41,7 +46,9 @@ public class GoblinSelfGoodsTagServiceImpl extends ServiceImpl<GoblinSelfTagMapp
public boolean addSave(GoblinSelfTag selfTag) {
if (this.save(selfTag)) {
mongoTemplate.insert(GoblinSelfTagVo.getNew().copy(selfTag), GoblinSelfTagVo.class.getSimpleName());
// TODO: 2022/1/14 zhanggb redis
redisDataSourceUtil.getRedisGoblinUtil().del(GoblinRedisConst.BASIC_SELF_EXTAG);
return true;
}
return false;
......@@ -63,8 +70,15 @@ public class GoblinSelfGoodsTagServiceImpl extends ServiceImpl<GoblinSelfTagMapp
Query.query(Criteria.where("tagId").is(selfTag.getTagId()).and("tagBelong").is(selfTag.getTagBelong()).and("delFlg").is("0")).getQueryObject(),
Update.update("tagType", selfTag.getTagType()).set("tagName", selfTag.getTagName()).set("tagPic", selfTag.getTagPic()).getUpdateObject()
);
log.info("店铺管理:标签管理:编辑[selfTag={},MONGO.UpdateResult={}]", JsonUtils.toJson(selfTag), JsonUtils.toJson(updateResult));
// TODO: 2022/1/14 zhanggb redis
// log.info("店铺管理:标签管理:编辑[selfTag={},MONGO.UpdateResult={}]", JsonUtils.toJson(selfTag), JsonUtils.toJson(updateResult));
if (updateResult.getModifiedCount() <= 0) {
log.error("店铺管理:标签管理:编辑:MDB更新失败[selfTag={}]", JsonUtils.toJson(selfTag));
throw new LiquidnetServiceException();
}
redisDataSourceUtil.getRedisGoblinUtil().del(GoblinRedisConst.BASIC_SELF_EXTAG);
return true;
}
return false;
......@@ -85,8 +99,14 @@ public class GoblinSelfGoodsTagServiceImpl extends ServiceImpl<GoblinSelfTagMapp
Update.update("delFlg", "1"),
GoblinSelfTagVo.class.getSimpleName()
);
log.info("店铺管理:标签管理:删除[tagIdArr={},tagBelong={},MONGO.UpdateResult={}]", JsonUtils.toJson(tagIdArr), tagBelong, JsonUtils.toJson(updateResult));
// TODO: 2022/1/14 zhanggb redis
// log.info("店铺管理:标签管理:删除[tagIdArr={},tagBelong={},MONGO.UpdateResult={}]", JsonUtils.toJson(tagIdArr), tagBelong, JsonUtils.toJson(updateResult));
if (updateResult.getModifiedCount() <= 0) {
log.error("店铺管理:标签管理:删除:MDB更新失败[tagBelong={},tagIdArr={}]", tagBelong, JsonUtils.toJson(tagIdArr));
throw new LiquidnetServiceException();
}
redisDataSourceUtil.getRedisGoblinUtil().del(GoblinRedisConst.BASIC_SELF_EXTAG);
}
return rmvResultFlg;
}
......
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