Commit 4ba9028d by kk

刷数据:根据文件指定sku刷A+产品的上传人,同策划的也刷

parent 498fa6be
......@@ -49,23 +49,30 @@ public class APlusProductServiceImpl extends ServiceImpl<APlusProductMapper, APl
List<APlusProduct> aPlusProducts = baseMapper.selectList(Wrappers.<APlusProduct>lambdaQuery()
.eq(APlusProduct::getSku, skuPeopleNameDto.getSku())
.eq(APlusProduct::getSite, "Amazon.com")
.select(APlusProduct::getId, APlusProduct::getSku, APlusProduct::getSite)
.select(APlusProduct::getId, APlusProduct::getSku, APlusProduct::getSite, APlusProduct::getAPlusPlanId)
);
if (CollectionUtils.isEmpty(aPlusProducts)) {
log.error("sku:{}, site:{}, 未找到对应的A+产品", skuPeopleNameDto.getSku(), "Amazon.com");
continue;
}
APlusProduct aPlusProduct = aPlusProducts.get(0);
List<SyncProductPublish> syncProductPublishes = syncProductPublishMapper.selectList(Wrappers.<SyncProductPublish>lambdaQuery()
.eq(SyncProductPublish::getSku, aPlusProduct.getSku())
.eq(SyncProductPublish::getSite, aPlusProduct.getSite())
.select(SyncProductPublish::getThirtyDaySales)
);
if (CollectionUtils.isEmpty(syncProductPublishes)) {
log.error("sku:{}, site:{}, 未找到对应的销量数据", skuPeopleNameDto.getSku(), "Amazon.com");
continue;
List<APlusProduct> aPlusProductList = baseMapper.selectList(Wrappers.<APlusProduct>lambdaQuery()
.eq(APlusProduct::getAPlusPlanId, aPlusProduct.getAPlusPlanId())
.select(APlusProduct::getId, APlusProduct::getSku, APlusProduct::getSite));
aPlusProductList.add(aPlusProduct);
for (APlusProduct plusProduct : aPlusProductList) {
List<SyncProductPublish> syncProductPublishes = syncProductPublishMapper.selectList(Wrappers.<SyncProductPublish>lambdaQuery()
.eq(SyncProductPublish::getSku, plusProduct.getSku())
.eq(SyncProductPublish::getSite, plusProduct.getSite())
.select(SyncProductPublish::getThirtyDaySales)
);
if (CollectionUtils.isEmpty(syncProductPublishes)) {
log.error("sku:{}, site:{}, 未找到对应的销量数据", skuPeopleNameDto.getSku(), "Amazon.com");
continue;
}
SyncProductPublish syncProductPublish = syncProductPublishes.get(0);
plusProduct.setSale30(syncProductPublish.getThirtyDaySales());
}
SyncProductPublish syncProductPublish = syncProductPublishes.get(0);
List<VisualDesigner> visualDesigners = visualDesignerMapper.selectList(Wrappers.<VisualDesigner>lambdaQuery()
.eq(VisualDesigner::getUserName, skuPeopleNameDto.getPeopleName())
.in(VisualDesigner::getDepartmentKey, "a_plus_plan")
......@@ -76,17 +83,20 @@ public class APlusProductServiceImpl extends ServiceImpl<APlusProductMapper, APl
}
VisualDesigner visualDesigner = visualDesigners.get(0);
aPlusProduct.setSale30(syncProductPublish.getThirtyDaySales())
.setIsUploadBackstage(2)
.setUploadBackstageId(Long.valueOf(visualDesigner.getUserId()))
.setUploadBackstageUser(visualDesigner.getUserName())
.setUploadBackstageTime(currentTimeSecond)
;
baseMapper.updateById(aPlusProduct);
visualDesignLogService.addLog("a_plus_product",
String.format("sku:%s, site:%s, 上传A+产品信息修改为:上传人:%s,上传时间:%s", aPlusProduct.getSku(), aPlusProduct.getSite(), visualDesigner.getUserName(), DateUtils.format10YMD(currentTimeSecond)),
aPlusProduct.getId());
count++;
for (APlusProduct plusProduct : aPlusProductList) {
plusProduct
.setIsUploadBackstage(2)
.setUploadBackstageId(Long.valueOf(visualDesigner.getUserId()))
.setUploadBackstageUser(visualDesigner.getUserName())
.setUploadBackstageTime(currentTimeSecond)
;
baseMapper.updateById(plusProduct);
visualDesignLogService.addLog("a_plus_product",
String.format("sku:%s, site:%s, 上传A+产品信息修改为:上传人:%s,上传时间:%s", plusProduct.getSku(), plusProduct.getSite(), visualDesigner.getUserName(), DateUtils.format10YMD(currentTimeSecond)),
plusProduct.getId());
count++;
}
}
log.info("共上传{}个A+产品信息", count);
......
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