记得上下班打卡 | 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 { ...@@ -353,11 +353,10 @@ public class GoblinMongoUtils {
} }
public boolean updateStoreNoticeVoByRelease(String uid, LocalDateTime nowTime, String storeId, List<String> noticeIdList) { 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( 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(), 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) Update.update("status", "1").set("releaseTime", nowTimeMdbObj).set("updatedBy", uid).set("updatedAt", nowTimeMdbObj).getUpdateObject()
.set("updatedBy", uid).set("updatedAt", time).getUpdateObject()
).getModifiedCount() > 0; ).getModifiedCount() > 0;
} }
...@@ -701,11 +700,11 @@ public class GoblinMongoUtils { ...@@ -701,11 +700,11 @@ public class GoblinMongoUtils {
} }
public boolean delGoodsSkuInfoVo(List<String> skuIdList, String operator, LocalDateTime time) { 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( return mongoTemplate.getCollection(GoblinGoodsSkuInfoVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("skuId").in(skuIdList).and("delFlg").is("0")).getQueryObject(), Query.query(Criteria.where("skuId").in(skuIdList).and("delFlg").is("0")).getQueryObject(),
Update.update("delFlg", "1").set("updatedBy", operator).set("updatedAt", timeAt) Update.update("delFlg", "1").set("updatedBy", operator).set("updatedAt", timeMdbObj)
.set("deletedBy", operator).set("deletedAt", timeAt).getUpdateObject() .set("deletedBy", operator).set("deletedAt", timeMdbObj).getUpdateObject()
).getModifiedCount() > 0; ).getModifiedCount() > 0;
} }
......
...@@ -70,15 +70,15 @@ public class PlatformGoblinGoodsService extends ServiceImpl<GoblinGoodsMapper, G ...@@ -70,15 +70,15 @@ public class PlatformGoblinGoodsService extends ServiceImpl<GoblinGoodsMapper, G
LiquidnetServiceException liquidnetServiceException = new LiquidnetServiceException(); LiquidnetServiceException liquidnetServiceException = new LiquidnetServiceException();
if (goblinGoodsSkuMapper.update(updateSku, updateSkuWrapper) > 0) { 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( 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(), 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) { if (updateSpuResult.getModifiedCount() > 0) {
UpdateResult updateSkuResult = mongoTemplate.getCollection(GoblinGoodsSkuInfoVo.class.getSimpleName()).updateMany( UpdateResult updateSkuResult = mongoTemplate.getCollection(GoblinGoodsSkuInfoVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("spuId").in(spuIdList).and("delFlg").is("0")).getQueryObject(), 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) { if (updateSkuResult.getModifiedCount() > 0) {
AbstractRedisUtil redisGoblinUtil = redisDataSourceUtil.getRedisGoblinUtil(); 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