Commit 6fa0878a by yinyong

数据中心--sku资料百伦分类过滤掉c_name不包含New

parent 2c740a69
...@@ -2,6 +2,7 @@ package com.bailuntec.job; ...@@ -2,6 +2,7 @@ package com.bailuntec.job;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.bailuntec.domain.entity.DcBaseBailuncategory; import com.bailuntec.domain.entity.DcBaseBailuncategory;
import com.bailuntec.domain.example.DcBaseBailuncategoryExample;
import com.bailuntec.domain.pojo.BailunCategoryResult; import com.bailuntec.domain.pojo.BailunCategoryResult;
import com.bailuntec.mapper.DcBaseBailuncategoryMapper; import com.bailuntec.mapper.DcBaseBailuncategoryMapper;
import com.bailuntec.utils.OkHttpUtil; import com.bailuntec.utils.OkHttpUtil;
...@@ -39,15 +40,19 @@ public class BailunCategoryJob implements SimpleJob { ...@@ -39,15 +40,19 @@ public class BailunCategoryJob implements SimpleJob {
if (bailunCategoryResult.getResult() != null && bailunCategoryResult.getResult().size() > 0) { if (bailunCategoryResult.getResult() != null && bailunCategoryResult.getResult().size() > 0) {
DcBaseBailuncategory dcBaseBailuncategory = new DcBaseBailuncategory(); DcBaseBailuncategory dcBaseBailuncategory = new DcBaseBailuncategory();
DcBaseBailuncategoryMapper mapper = SessionUtil.getSession().getMapper(DcBaseBailuncategoryMapper.class); DcBaseBailuncategoryMapper mapper = SessionUtil.getSession().getMapper(DcBaseBailuncategoryMapper.class);
LocalDateTime startTime = LocalDateTime.now();
for (DcBaseBailuncategory baseBailuncategory : bailunCategoryResult.getResult()) { for (DcBaseBailuncategory baseBailuncategory : bailunCategoryResult.getResult()) {
try { try {
BeanUtils.copyProperties(dcBaseBailuncategory, baseBailuncategory); BeanUtils.copyProperties(dcBaseBailuncategory, baseBailuncategory);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("BeanUtils.copyProperties失败",e); throw new RuntimeException("BeanUtils.copyProperties失败",e);
} }
dcBaseBailuncategory.setGmtModified(LocalDateTime.now()); if(dcBaseBailuncategory.getCName() != null && dcBaseBailuncategory.getCName().contains("New")) {
mapper.upsertSelective(dcBaseBailuncategory); dcBaseBailuncategory.setGmtModified(startTime);
mapper.upsertSelective(dcBaseBailuncategory);
}
} }
mapper.deleteByExample(DcBaseBailuncategoryExample.newAndCreateCriteria().andGmtModifiedLessThan(startTime).example());
} }
} else { } else {
throw new RuntimeException("调用百伦分类接口返回错误"); throw new RuntimeException("调用百伦分类接口返回错误");
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
SKU_URL=http://10.0.8.13:8000/api/sku/productsku/gmtproductskus SKU_URL=http://10.0.8.13:8000/api/sku/productsku/gmtproductskus
SKU_SIMPLE_CATEGORY_URL=http://10.0.8.13:8000/api/category/simplecategory/categoriessimplebylevel?level=0 SKU_SIMPLE_CATEGORY_URL=http://10.0.8.13:8000/api/category/simplecategory/categoriessimplebylevel?level=0
SKU_MAPPING_URL=http://172.31.255.108:6039/skumapping/getpageskumappings SKU_MAPPING_URL=http://172.31.255.108:6039/skumapping/getpageskumappings
BAILUN_CATEGORY_URL=http://10.0.8.13:8000/api/category/categorybailun/gmtbailuncategoriesbylevel # BAILUN_CATEGORY_URL=http://10.0.8.13:8000/api/category/categorybailun/gmtbailuncategoriesbylevel
#BAILUN_CATEGORY_URL=http://doc.bailuntec.com:6001/categorybailun/gmtbailuncategoriesbylevel BAILUN_CATEGORY_URL=http://doc.bailuntec.com:6001/categorybailun/gmtbailuncategoriesbylevel
# SKU_MAPPING_URL=http://doc.bailuntec.com:6021/skumapping/getpageskumappings # SKU_MAPPING_URL=http://doc.bailuntec.com:6021/skumapping/getpageskumappings
# \u7EBF\u4E0B\u73AF\u5883 # \u7EBF\u4E0B\u73AF\u5883
#SKU_URL=http://api.skums.bailuntec.com/api/sku/productsku/gmtproductskus #SKU_URL=http://api.skums.bailuntec.com/api/sku/productsku/gmtproductskus
......
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