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

Commit 01227d6b authored by 张国柄's avatar 张国柄

~TASK:商城商品上下架处理筛选逻辑调整;

parent 68196aee
...@@ -54,7 +54,7 @@ public class PlatformGoblinGoodsTaskController { ...@@ -54,7 +54,7 @@ public class PlatformGoblinGoodsTaskController {
try { try {
platformGoblinGoodsService.shelvesProcessing(spuIdList); platformGoblinGoodsService.shelvesProcessing(spuIdList);
} catch (Exception e) { } catch (Exception e) {
log.error("商品上架处理[totalCount={},spuIdList={}]", totalCount, JsonUtils.toJson(spuIdList)); log.error("Ex.商品上架处理[totalCount={},spuIdList={}],{}", totalCount, JsonUtils.toJson(spuIdList), e.getMessage());
return ResponseDto.failure(String.format("商品上架处理失败[totalCount=%s]", totalCount)); return ResponseDto.failure(String.format("商品上架处理失败[totalCount=%s]", totalCount));
} }
} }
......
...@@ -51,9 +51,10 @@ public class PlatformGoblinGoodsService extends ServiceImpl<GoblinGoodsMapper, G ...@@ -51,9 +51,10 @@ public class PlatformGoblinGoodsService extends ServiceImpl<GoblinGoodsMapper, G
updateSkuWrapper.in(GoblinGoodsSku::getSpuId, spuIdList); updateSkuWrapper.in(GoblinGoodsSku::getSpuId, spuIdList);
updateSkuWrapper.eq(GoblinGoodsSku::getDelFlg, "0"); updateSkuWrapper.eq(GoblinGoodsSku::getDelFlg, "0");
LiquidnetServiceException liquidnetServiceException = new LiquidnetServiceException();
if (goblinGoodsSkuMapper.update(updateSku, updateSkuWrapper) > 0) { if (goblinGoodsSkuMapper.update(updateSku, updateSkuWrapper) > 0) {
UpdateResult updateSpuResult = mongoTemplate.getCollection(GoblinGoodsInfoVo.class.getSimpleName()).updateMany( UpdateResult updateSpuResult = mongoTemplate.getCollection(GoblinGoodsInfoVo.class.getSimpleName()).updateMany(
Query.query(Criteria.where("spuId").in(spuIdList).and("shelvesStatus").is("0").and("shelvesHandle").is("3")).getQueryObject(), Query.query(Criteria.where("spuId").in(spuIdList).and("shelvesStatus").in("0", "1").and("shelvesHandle").is("3")).getQueryObject(),
Update.update("shelvesStatus", "3").set("shelvesAt", now).getUpdateObject() Update.update("shelvesStatus", "3").set("shelvesAt", now).getUpdateObject()
); );
if (updateSpuResult.getModifiedCount() > 0) { if (updateSpuResult.getModifiedCount() > 0) {
...@@ -83,10 +84,15 @@ public class PlatformGoblinGoodsService extends ServiceImpl<GoblinGoodsMapper, G ...@@ -83,10 +84,15 @@ public class PlatformGoblinGoodsService extends ServiceImpl<GoblinGoodsMapper, G
Query.query(Criteria.where("spuId").in(spuIdList).and("shelvesAt").is(now)).getQueryObject(), Query.query(Criteria.where("spuId").in(spuIdList).and("shelvesAt").is(now)).getQueryObject(),
Update.update("shelvesStatus", "0").set("shelvesAt", of).getUpdateObject() Update.update("shelvesStatus", "0").set("shelvesAt", of).getUpdateObject()
); );
liquidnetServiceException.setMessage("更新失败:Mongo.GoblinGoodsSkuInfoVo");
} }
} else {
liquidnetServiceException.setMessage("更新失败:Mongo.GoblinGoodsInfoVo");
} }
} else {
liquidnetServiceException.setMessage("更新失败:Mysql.GoblinGoodsSku");
} }
throw new LiquidnetServiceException(); throw liquidnetServiceException;
} }
} }
} }
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