|
|
|
@ -788,7 +788,8 @@ public class ProcessProductPublishTaskService extends TaskBaseService {
|
|
|
|
|
ProductGetCatePropertyV2Data attrRetData = (ProductGetCatePropertyV2Data) categoryAttrRet.getData().get("data");
|
|
|
|
|
List<DataItem> attributes = attrRetData.getData();
|
|
|
|
|
String title = productDetailBase.getString("title");
|
|
|
|
|
Map<Long, List<StrObjMap>> productFormatNew = buildProductAttrs(attributes, sourceAttrs, title,queueMsg);
|
|
|
|
|
// Map<Long, List<StrObjMap>> productFormatNew = buildProductAttrs(attributes, sourceAttrs, title,queueMsg);
|
|
|
|
|
Map<Long, List<StrObjMap>> productFormatNew = buildProductAttrsByDd(attributes, sourceAttrs, title,queueMsg);
|
|
|
|
|
productFormatNew = attachBrand2ProductFormatNew(brandId, brandName, productFormatNew);
|
|
|
|
|
productDetailBase.put("productFormatNew", productFormatNew);
|
|
|
|
|
|
|
|
|
@ -800,6 +801,22 @@ public class ProcessProductPublishTaskService extends TaskBaseService {
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private Map<Long, List<StrObjMap>> buildProductAttrsByDd(List<DataItem> attributes, JSONObject sourceAttrs, String title,MoveProductPublishQueueBO queueMsg) {
|
|
|
|
|
Map<Long, List<StrObjMap>> matchAttrs = new HashMap<>();
|
|
|
|
|
for (DataItem attribute : attributes) {
|
|
|
|
|
long currAid = attribute.getPropertyId();
|
|
|
|
|
List<StrObjMap> matchList = new ArrayList<>();
|
|
|
|
|
StrObjMap mStrObjmap = new StrObjMap();
|
|
|
|
|
mStrObjmap.put("name",attribute.getPropertyName());
|
|
|
|
|
mStrObjmap.put("diy_type",attribute.getDiyType());
|
|
|
|
|
mStrObjmap.put("value",ObjectUtil.isNotEmpty(attribute.getOptions())?attribute.getOptions().get(0):0);
|
|
|
|
|
matchList.add(mStrObjmap);
|
|
|
|
|
matchAttrs.put(currAid, matchList);
|
|
|
|
|
}
|
|
|
|
|
log.info(JSON.toJSONString(matchAttrs));
|
|
|
|
|
return matchAttrs;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String getSourceAttrBrandName(JSONObject sourceAttrs) {
|
|
|
|
|
String brandName = "";
|
|
|
|
|
for (Map.Entry entry : sourceAttrs.entrySet()) {
|
|
|
|
|