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

Commit e23becc2 authored by 张国柄's avatar 张国柄

~Mdb.update.LocalDateTime:更正mongoTemplate.getCollection(...).updteOne/upateMan...

~Mdb.update.LocalDateTime:更正mongoTemplate.getCollection(...).updteOne/upateMany中使用Update.update(...)更新时间`LocalDateTime`时区错误,以上情况统一使用Converter转换`LocalDateTime`处理;
parent d15d4f4e
......@@ -353,11 +353,10 @@ public class GoblinMongoUtils {
}
public boolean updateStoreNoticeVoByRelease(String uid, LocalDateTime nowTime, String storeId, List<String> noticeIdList) {
LocalDateTime time = nowTime.minusHours(8);
Object nowTimeMdbObj = mongoConverter.convertToMongoType(nowTime);
return mongoTemplate.getCollection(GoblinStoreNoticeVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("storeId").is(storeId).and("delFlg").is("0").and("noticeId").in(noticeIdList.toArray()).and("status").is("0")).getQueryObject(),
Update.update("status", "1").set("releaseTime", time)
.set("updatedBy", uid).set("updatedAt", time).getUpdateObject()
Update.update("status", "1").set("releaseTime", nowTimeMdbObj).set("updatedBy", uid).set("updatedAt", nowTimeMdbObj).getUpdateObject()
).getModifiedCount() > 0;
}
......@@ -701,11 +700,11 @@ public class GoblinMongoUtils {
}
public boolean delGoodsSkuInfoVo(List<String> skuIdList, String operator, LocalDateTime time) {
LocalDateTime timeAt = time.minusHours(8);
Object timeMdbObj = mongoConverter.convertToMongoType(time);
return mongoTemplate.getCollection(GoblinGoodsSkuInfoVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("skuId").in(skuIdList).and("delFlg").is("0")).getQueryObject(),
Update.update("delFlg", "1").set("updatedBy", operator).set("updatedAt", timeAt)
.set("deletedBy", operator).set("deletedAt", timeAt).getUpdateObject()
Update.update("delFlg", "1").set("updatedBy", operator).set("updatedAt", timeMdbObj)
.set("deletedBy", operator).set("deletedAt", timeMdbObj).getUpdateObject()
).getModifiedCount() > 0;
}
......
......@@ -70,15 +70,15 @@ public class PlatformGoblinGoodsService extends ServiceImpl<GoblinGoodsMapper, G
LiquidnetServiceException liquidnetServiceException = new LiquidnetServiceException();
if (goblinGoodsSkuMapper.update(updateSku, updateSkuWrapper) > 0) {
LocalDateTime time = now.minusHours(8);
Object nowTimeMdbObj = mongoTemplate.getConverter().convertToMongoType(now);
UpdateResult updateSpuResult = mongoTemplate.getCollection(GoblinGoodsInfoVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("spuId").in(spuIdList).and("delFlg").is("0").and("shelvesStatus").in("0", "1").and("shelvesHandle").is("3")).getQueryObject(),
Update.update("shelvesStatus", "3").set("shelvesAt", time).getUpdateObject()
Update.update("shelvesStatus", "3").set("shelvesAt", nowTimeMdbObj).getUpdateObject()
);
if (updateSpuResult.getModifiedCount() > 0) {
UpdateResult updateSkuResult = mongoTemplate.getCollection(GoblinGoodsSkuInfoVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("spuId").in(spuIdList).and("delFlg").is("0")).getQueryObject(),
Update.update("shelvesStatus", "3").set("shelvesAt", time).getUpdateObject()
Update.update("shelvesStatus", "3").set("shelvesAt", nowTimeMdbObj).getUpdateObject()
);
if (updateSkuResult.getModifiedCount() > 0) {
AbstractRedisUtil redisGoblinUtil = redisDataSourceUtil.getRedisGoblinUtil();
......
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