Merge branch 'master' of codeup.aliyun.com:64d9c5feeceb191898f636d7/honor-dd-light-ds-java

20230922-ljl-fixBug
cxxxxxxx详 1 year ago
commit 1a8d15342e

@ -11,6 +11,7 @@ import java.util.Objects;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
@ -45,7 +46,6 @@ import com.doudian.open.core.AccessToken;
import com.ms.api.bo.MoveProductPublishQueueBO;
import com.ms.api.bo.MoveShopConfigBO;
import com.ms.api.bo.MoveShopSettingBO;
import com.ms.api.bo.ShopBO;
import com.ms.api.common.ApiResult;
import com.ms.api.common.E;
import com.ms.api.common.MSException;
@ -201,12 +201,11 @@ public class MoveService {
productDetailBase.put("categoryLeafId", queueMsg.getCid());
// 尺寸模版
if(StrUtil.isNotBlank(queueMsg.getCid())){
if (StrUtil.isNotBlank(queueMsg.getCid())) {
Long size = getSizeTemplateId(shopId, Long.parseLong(queueMsg.getCid()));
productDetailBase.put("sizeTemplateId", size);
}
// 发货时间
long deliveryDelayDay = condition.getDeliveryDelayDay();
if (deliveryDelayDay == 0) {
@ -352,7 +351,7 @@ public class MoveService {
ProductGetProductUpdateRuleParam param = new ProductGetProductUpdateRuleParam();
param.setCategoryId(Long.valueOf(cid));
ApiResult<ProductGetProductUpdateRuleData> productUpdateRuleRet = DdRequestUtil.getBrandListV2FromDdNotEx(param, accessToken);
if(!productUpdateRuleRet.isSuccess()){
if (!productUpdateRuleRet.isSuccess()) {
return new HashMap<>();
}
ProductGetProductUpdateRuleData productUpdateRule = productUpdateRuleRet.getData();
@ -1033,8 +1032,8 @@ public class MoveService {
String colorSpecStr = colorSpecArr.isEmpty() ? "" : ddColorName + "|" + String.join(",", colorSpecArr);
String sizeSpecStr = sizeSpecArr.isEmpty() ? "" : ddSizeName + "|" + String.join(",", sizeSpecArr);
String spec = colorSpecStr + "^" + sizeSpecStr;
String specName = ddColorName + "-" + ddSizeName;
String spec = Stream.of(colorSpecStr, sizeSpecStr).filter(StrUtil::isNotBlank).collect(Collectors.joining("^"));
String specName = Stream.of(colorSpecArr.isEmpty() ? "" : ddColorName, sizeSpecArr.isEmpty() ? "" : ddSizeName).filter(StrUtil::isNotBlank).collect(Collectors.joining("^"));
// String skuSpecStr = getSkuSpecStr(queueMsg, deliveryDelayDay);
// log.info("skuSpecStr: " + skuSpecStr);

@ -806,7 +806,9 @@ public class ProcessProductPublishTaskService extends TaskBaseService {
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);
String valueStr = ObjectUtil.isNotEmpty(attribute.getOptions())?attribute.getOptions().get(0).getValue():"0";
// Object valueObj = CommonTool.convertToNumericType(valueStr);
mStrObjmap.put("value",Integer.parseInt(valueStr));
matchList.add(mStrObjmap);
matchAttrs.put(currAid, matchList);
}

@ -998,4 +998,24 @@ public class CommonTool {
}
return len;
}
public static Object convertToNumericType(String value) {
try {
return Integer.parseInt(value);
} catch (NumberFormatException e1) {
try {
return Long.parseLong(value);
} catch (NumberFormatException e2) {
try {
return Float.parseFloat(value);
} catch (NumberFormatException e3) {
try {
return Double.parseDouble(value);
} catch (NumberFormatException e4) {
return null;
}
}
}
}
}
}

Loading…
Cancel
Save