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

Commit 4a808db2 authored by 张国柄's avatar 张国柄

~MDB:update time zone更正;

parent 767a6804
......@@ -35,9 +35,9 @@ public class GoblinStoreMgtDigitalGoodsAddSkuParam implements Serializable {
@NotBlank(message = "藏品名称不能为空")
@Size(max = 36, message = "藏品名称内容过长")
private String name;
@ApiModelProperty(position = 14, required = true, value = "款式名称[36],`unbox=0`时必传", example = "款式名称...")
@NotBlank(message = "款式名称不能为空")
@Size(max = 36, message = "款式名称内容过长")
@ApiModelProperty(position = 14, required = true, value = "副标题[36],`unbox=0`时必传", example = "副标题...")
@NotBlank(message = "副标题不能为空")
@Size(max = 36, message = "副标题内容过长")
private String subtitle;
@ApiModelProperty(position = 15, required = true, value = "藏品封面图片URL[256]", example = "https://img.zhengzai.tv/files/2020/08/31/5f4c75095e9bc.png")
@NotBlank(message = "藏品封面图片不能为空")
......
......@@ -125,9 +125,9 @@
// Query.query(Criteria.where("artworkId").is(fromArtworkId).and("state").ne(1)).getQueryObject(),
// Update.update("state", userDigitalArtworkVo.getState())
// .set("delFlg", userDigitalArtworkVo.getDelFlg())
// .set("openingAt", userDigitalArtworkVo.getOpeningAt())
// .set("updatedAt", userDigitalArtworkVo.getUpdatedAt())
// .set("deletedAt", userDigitalArtworkVo.getDeletedAt())
// .set("openingAt", userDigitalArtworkVo.getOpeningAt().minusHours(8))
// .set("updatedAt", userDigitalArtworkVo.getUpdatedAt().minusHours(8))
// .set("deletedAt", userDigitalArtworkVo.getDeletedAt().minusHours(8))
// .getUpdateObject()
// );
// }
......
......@@ -336,7 +336,8 @@ public class GoblinMongoUtils {
if (StringUtils.isNotEmpty(r.getStoreId())) {
list.add(new UpdateOneModel<>(
Query.query(Criteria.where("storeId").is(r.getStoreId()).and("noticeId").is(r.getNoticeId())).getQueryObject(),
Update.update("releaseTime", r.getReleaseTime()).set("status", r.getStatus()).set("updatedBy", r.getUpdatedBy()).set("updatedAt", r.getUpdatedAt()).getUpdateObject()
Update.update("releaseTime", r.getReleaseTime().minusHours(8)).set("status", r.getStatus())
.set("updatedBy", r.getUpdatedBy()).set("updatedAt", r.getUpdatedAt().minusHours(8)).getUpdateObject()
));
}
});
......@@ -344,16 +345,18 @@ public class GoblinMongoUtils {
}
public boolean updateStoreNoticeVoByRelease(String uid, LocalDateTime nowTime, String storeId, List<String> noticeIdList) {
LocalDateTime time = nowTime.minusHours(8);
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", nowTime).set("updatedBy", uid).set("updatedAt", nowTime).getUpdateObject()
Update.update("status", "1").set("releaseTime", time)
.set("updatedBy", uid).set("updatedAt", time).getUpdateObject()
).getModifiedCount() > 0;
}
public boolean updateStoreNoticeVoByRemove(String uid, LocalDateTime nowTime, String storeId, List<String> noticeIdList) {
return mongoTemplate.getCollection(GoblinStoreNoticeVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("storeId").is(storeId).and("delFlg").is("0").and("noticeId").in(noticeIdList.toArray())).getQueryObject(),
Update.update("delFlg", "1").set("updatedBy", uid).set("updatedAt", nowTime).getUpdateObject()
Update.update("delFlg", "1").set("updatedBy", uid).set("updatedAt", nowTime.minusHours(8)).getUpdateObject()
).getModifiedCount() > 0;
}
......@@ -372,7 +375,8 @@ public class GoblinMongoUtils {
if (StringUtils.isNotEmpty(r.getStoreId())) {
list.add(new UpdateOneModel<>(
Query.query(Criteria.where("storeId").is(r.getStoreId()).and("configKey").is(r.getConfigKey())).getQueryObject(),
Update.update("configVal", r.getConfigVal()).set("updatedBy", r.getUpdatedBy()).set("updatedAt", r.getUpdatedAt()).getUpdateObject()
Update.update("configVal", r.getConfigVal()).set("updatedBy", r.getUpdatedBy())
.set("updatedAt", r.getUpdatedAt().minusHours(8)).getUpdateObject()
));
}
});
......@@ -625,7 +629,7 @@ public class GoblinMongoUtils {
.set("logisticsTemplate", vo.getLogisticsTemplate())
.set("serviceSupportVoList", mongoConverter.convertToMongoType(vo.getServiceSupportVoList()))
.set("updatedBy", vo.getUpdatedBy())
.set("updatedAt", vo.getUpdatedAt());
.set("updatedAt", vo.getUpdatedAt().minusHours(8));
if (vo.getTagVoList() != null) {
update.set("tagVoList", mongoConverter.convertToMongoType(vo.getTagVoList()));
}
......@@ -649,7 +653,7 @@ public class GoblinMongoUtils {
public boolean updateGoodsInfoVoAppear(String storeId, String spuAppear, LocalDateTime time, String uid) {
return mongoTemplate.getCollection(GoblinGoodsInfoVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("storeId").is(storeId).and("delFlg").is("0")).getQueryObject(),
Update.update("spuAppear", spuAppear).set("updatedBy", uid).set("updatedAt", time).getUpdateObject()
Update.update("spuAppear", spuAppear).set("updatedBy", uid).set("updatedAt", time.minusHours(8)).getUpdateObject()
).getModifiedCount() > 0;
}
......@@ -682,10 +686,11 @@ public class GoblinMongoUtils {
}
public boolean delGoodsSkuInfoVo(List<String> skuIdList, String operator, LocalDateTime time) {
LocalDateTime timeAt = time.minusHours(8);
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", time)
.set("deletedBy", operator).set("deletedAt", time).getUpdateObject()
Update.update("delFlg", "1").set("updatedBy", operator).set("updatedAt", timeAt)
.set("deletedBy", operator).set("deletedAt", timeAt).getUpdateObject()
).getModifiedCount() > 0;
}
......@@ -765,7 +770,7 @@ public class GoblinMongoUtils {
// .set("buyLimit", vo.getBuyLimit())
.set("skuValidity", vo.getSkuValidity())
.set("updatedBy", vo.getUpdatedBy())
.set("updatedAt", vo.getUpdatedAt())
.set("updatedAt", vo.getUpdatedAt().minusHours(8))
.getUpdateObject()
).getModifiedCount() > 0;
}
......@@ -1268,14 +1273,14 @@ public class GoblinMongoUtils {
public boolean activityMgtStoreCouponBasicVo(String uid, LocalDateTime time, String state, List<String> storeCouponIds) {
return mongoTemplate.getCollection(GoblinStoreCouponBasicVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("storeCouponId").in(storeCouponIds).and("delFlg").is("0")).getQueryObject(),
Update.update("state", state).set("updatedBy", uid).set("updatedAt", time).getUpdateObject()
Update.update("state", state).set("updatedBy", uid).set("updatedAt", time.minusHours(8)).getUpdateObject()
).getModifiedCount() > 0;
}
public boolean updateMgtStoreCouponStock(String storeCouponId, int stock, String uid, LocalDateTime time) {
return mongoTemplate.getCollection(GoblinStoreCouponBasicVo.class.getSimpleName()).updateOne(
Query.query(Criteria.where("storeCouponId").is(storeCouponId).and("delFlg").is("0")).getQueryObject(),
Update.update("stock", stock).set("updatedBy", uid).set("updatedAt", time).getUpdateObject()
Update.update("stock", stock).set("updatedBy", uid).set("updatedAt", time.minusHours(8)).getUpdateObject()
).getModifiedCount() > 0;
}
......@@ -1424,9 +1429,9 @@ public class GoblinMongoUtils {
Query.query(Criteria.where("artworkId").is(vo.getArtworkId()).and("state").ne(1)).getQueryObject(),
Update.update("state", vo.getState())
.set("delFlg", vo.getDelFlg())
.set("openingAt", vo.getOpeningAt())
.set("updatedAt", vo.getUpdatedAt())
.set("deletedAt", vo.getDeletedAt())
.set("openingAt", vo.getOpeningAt().minusHours(8))
.set("updatedAt", vo.getUpdatedAt().minusHours(8))
.set("deletedAt", vo.getDeletedAt().minusHours(8))
.getUpdateObject()
);
return updateResult.getModifiedCount() > 0;
......@@ -1442,7 +1447,7 @@ public class GoblinMongoUtils {
.set("tradingTxhash", vo.getTradingTxhash())
.set("tradingAt", vo.getTradingAt())
.set("state", vo.getState())
.set("updatedAt", vo.getUpdatedAt())
.set("updatedAt", vo.getUpdatedAt().minusHours(8))
.getUpdateObject()
);
return updateResult.getModifiedCount() > 0;
......
......@@ -70,14 +70,15 @@ public class PlatformGoblinGoodsService extends ServiceImpl<GoblinGoodsMapper, G
LiquidnetServiceException liquidnetServiceException = new LiquidnetServiceException();
if (goblinGoodsSkuMapper.update(updateSku, updateSkuWrapper) > 0) {
LocalDateTime time = now.minusHours(8);
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", now).getUpdateObject()
Update.update("shelvesStatus", "3").set("shelvesAt", time).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", now).getUpdateObject()
Update.update("shelvesStatus", "3").set("shelvesAt", time).getUpdateObject()
);
if (updateSkuResult.getModifiedCount() > 0) {
AbstractRedisUtil redisGoblinUtil = redisDataSourceUtil.getRedisGoblinUtil();
......
......@@ -22,11 +22,9 @@ import org.springframework.data.mongodb.core.query.Query;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;
@Service
public class PlatformGoblinGoodsSkuService extends ServiceImpl<GoblinGoodsSkuMapper, GoblinGoodsSku> {
......@@ -70,14 +68,15 @@ public class PlatformGoblinGoodsSkuService extends ServiceImpl<GoblinGoodsSkuMap
LiquidnetServiceException liquidnetServiceException = new LiquidnetServiceException();
if (goblinGoodsMapper.update(updateSpu, updateSpuWrapper) > 0) {
LocalDateTime time = now.minusHours(8);
UpdateResult updateSkuResult = mongoTemplate.getCollection(GoblinGoodsSkuInfoVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("skuId").in(skuIdList).and("delFlg").is("0").and("shelvesStatus").in("0").and("shelvesHandle").is("3")).getQueryObject(),
Update.update("shelvesStatus", "3").set("shelvesAt", now).set("updatedAt", now).getUpdateObject()
Update.update("shelvesStatus", "3").set("shelvesAt", time).set("updatedAt", time).getUpdateObject()
);
if (updateSkuResult.getModifiedCount() > 0) {
UpdateResult updateSpuResult = mongoTemplate.getCollection(GoblinGoodsInfoVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("spuId").in(spuIdList).and("delFlg").is("0")).getQueryObject(),
Update.update("shelvesStatus", "3").set("shelvesAt", now).set("updatedAt", now).getUpdateObject()
Update.update("shelvesStatus", "3").set("shelvesAt", time).set("updatedAt", time).getUpdateObject()
);
if (updateSpuResult.getModifiedCount() > 0) {
AbstractRedisUtil redisGoblinUtil = redisDataSourceUtil.getRedisGoblinUtil();
......
......@@ -59,7 +59,7 @@ public class PlatformGoblinStoreCouponService extends ServiceImpl<GoblinStoreCou
if (this.update(updateWrapper)) {
UpdateResult updateResult = mongoTemplate.getCollection(GoblinStoreCouponBasicVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("delFlg").is("0").and("state").is("0").and("storeCouponId").in(storeCouponIdList)).getQueryObject(),
Update.update("state", "1").set("updatedAt", now).set("updatedBy", "task").getUpdateObject()
Update.update("state", "1").set("updatedAt", now.minusHours(8)).set("updatedBy", "task").getUpdateObject()
);
if (updateResult.getModifiedCount() <= 0) {
log.warn("###商铺活动:优惠券处理失败:[now={},storeCouponIdList={}]", now, JsonUtils.toJson(storeCouponIdList));
......@@ -106,7 +106,7 @@ public class PlatformGoblinStoreCouponService extends ServiceImpl<GoblinStoreCou
if (this.update(updateWrapper)) {
UpdateResult updateResult = mongoTemplate.getCollection(GoblinStoreCouponBasicVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("delFlg").is("0").and("state").is("1").and("storeCouponId").in(storeCouponIdList)).getQueryObject(),
Update.update("state", "2").set("updatedAt", now).set("updatedBy", "task").getUpdateObject()
Update.update("state", "2").set("updatedAt", now.minusHours(8)).set("updatedBy", "task").getUpdateObject()
);
if (updateResult.getModifiedCount() <= 0) {
log.warn("###商铺活动:优惠券处理失败:[now={},storeCouponIdList={}]", now, JsonUtils.toJson(storeCouponIdList));
......
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