搬家相关

20230922-ljl-fixBug
qiushengjie 1 year ago
parent d6ba055846
commit 6f9400c279

@ -15,7 +15,7 @@ public class MoveConst {
public static final String PRICE_DECIMAL_TYPE_CLEAR_FEN_JIAO = "clearFenJiao";
public static final String PRICE_DECIMAL_TYPE_CLEAR_FEN = "clearFen";
public static final String PRICE_DECIMAL_TYPE_DIY = "diy";
public static final int MOVE_TITLE_LEN = 60; //标题最多60个字符(汉字算2英文数字算1)
public static final int MOVE_TITLE_LEN = 58; //标题最多60个字符(汉字算2英文数字算1)
//0-普通3-虚拟6玉石闪购7云闪购
public static final int PRODUCT_TYPE_NORMAL = 0;

@ -520,7 +520,7 @@ public class ProcessMovePublishToPicTaskService extends TaskBaseService {
String title = productData.getString("title");
if (!Objects.isNull(title)) {
param.setName(title);
param.setName(title.substring(0, Math.min(title.length(), 10)));
}
String mainImgUrls = productData.getString("mainImgUrls");
@ -592,10 +592,12 @@ public class ProcessMovePublishToPicTaskService extends TaskBaseService {
param.setProductFormatNew("{\"631\":[{\"diy_type\":1,\"name\":\"嘻哈风\",\"value\":196227}],\"1467\":[{\"diy_type\":0,\"name\":\"59%-69%(含)\",\"value\":168368}],\"1551\":[{\"diy_type\":1,\"name\":\"超短裙\",\"value\":22064}],\"1687\":[{\"diy_type\":0,\"name\":\"改为具体的品牌,没有可以为空\",\"value\":0}],\"1878\":[{\"diy_type\":1,\"name\":\"高腰\",\"value\":16521}],\"2592\":[{\"diy_type\":1,\"name\":\"甜美\",\"value\":23925}],\"785\":[{\"diy_type\":0,\"name\":\"涤纶\",\"value\":25708}],\"813\":[{\"diy_type\":1,\"name\":\"X型\",\"value\":8017}],\"981\":[{\"diy_type\":1,\"name\":\"蛋糕裙\",\"value\":22253}]}");
// }
Long deliveryDelayDay = productData.getLong("deliveryDelayDay");
if (!Objects.isNull(deliveryDelayDay)) {
param.setDeliveryDelayDay(deliveryDelayDay);
}
// Long deliveryDelayDay = productData.getLong("deliveryDelayDay");
// if (!Objects.isNull(deliveryDelayDay)) {
// param.setDeliveryDelayDay(deliveryDelayDay);
// }
param.setDeliveryDelayDay(2L);
Long brandId = productData.getLong("brandId");
if (!Objects.isNull(brandId)) {
@ -617,10 +619,11 @@ public class ProcessMovePublishToPicTaskService extends TaskBaseService {
param.setRemark(remark);
}
Long presellType = productData.getLong("presellType");
if (!Objects.isNull(presellType)) {
param.setPresellType(presellType);
}
// Long presellType = productData.getLong("presellType");
// if (!Objects.isNull(presellType)) {
// param.setPresellType(presellType);
// }
param.setPresellType(0L);
Long presellConfigLevel = productData.getLong("presellConfigLevel");
if (!Objects.isNull(presellConfigLevel)) {
@ -667,10 +670,11 @@ public class ProcessMovePublishToPicTaskService extends TaskBaseService {
param.setSizeInfoTemplateId(sizeInfoTemplateId);
}
Long sizeTemplateId = productData.getLong("sizeTemplateId");
if (!Objects.isNull(sizeTemplateId)) {
param.setSizeInfoTemplateId(sizeTemplateId);
}
// Long sizeTemplateId = productData.getLong("sizeTemplateId");
// if (!Objects.isNull(sizeTemplateId)) {
// param.setSizeInfoTemplateId(sizeTemplateId);
// }
param.setSizeInfoTemplateId(7119681499770667267L);
Long spuId = productData.getLong("spuId");
if (!Objects.isNull(spuId)) {
@ -682,10 +686,14 @@ public class ProcessMovePublishToPicTaskService extends TaskBaseService {
param.setRecruitInfo(recruitInfo);
}
Map<String, String> afterSaleService = productData.getObject("afterSaleService", Map.class);
if (!Objects.isNull(afterSaleService)) {
param.setAfterSaleService(afterSaleService);
}
// Map<String, String> afterSaleService = productData.getObject("afterSaleService", Map.class);
// if (!Objects.isNull(afterSaleService)) {
// param.setAfterSaleService(afterSaleService);
// }
Map<String, String> ss = new HashMap<>();
ss.put("supply_day_return_selector", "7-1");
param.setAfterSaleService(ss);
String namePrefix = productData.getString("namePrefix");
if (!Objects.isNull(namePrefix)) {
@ -980,7 +988,7 @@ public class ProcessMovePublishToPicTaskService extends TaskBaseService {
private void processDsProduct(long shopId, long detailId, String status, String sourceItemId, Ret addProductRet) {
// 分销关系填入
if (!status.equals(StatusConst.success)) {
//E.throwMSException("状态不为成功,不进行分销关系填入");
E.throwMSException("状态不为成功,不进行分销关系填入");
log.info("状态不为成功,不进行分销关系填入");
return;
}

@ -704,25 +704,29 @@ public class ProcessProductPublishTaskService extends TaskBaseService {
private List<String> checkHasRepeatSpec(StrObjMap colorSpecArrCalc, StrObjMap sizeSpecArrCalc) {
List<String> repeatSpecArr = new ArrayList<>();
Map<String, Integer> colorSpecCounts = new HashMap<>();
for (String colorSpec : colorSpecArrCalc.keySet()) {
colorSpecCounts.put(colorSpec, colorSpecCounts.getOrDefault(colorSpec, 0) + 1);
}
if(ObjectUtil.isNotEmpty(colorSpecArrCalc)){
Map<String, Integer> colorSpecCounts = new HashMap<>();
for (String colorSpec : colorSpecArrCalc.keySet()) {
colorSpecCounts.put(colorSpec, colorSpecCounts.getOrDefault(colorSpec, 0) + 1);
}
Map<String, Integer> sizeSpecCounts = new HashMap<>();
for (String sizeSpec : sizeSpecArrCalc.keySet()) {
sizeSpecCounts.put(sizeSpec, sizeSpecCounts.getOrDefault(sizeSpec, 0) + 1);
for (String colorSpec : colorSpecCounts.keySet()) {
if (colorSpecCounts.get(colorSpec) > 1) {
repeatSpecArr.add(colorSpec);
}
}
}
for (String colorSpec : colorSpecCounts.keySet()) {
if (colorSpecCounts.get(colorSpec) > 1) {
repeatSpecArr.add(colorSpec);
if(ObjectUtil.isNotEmpty(sizeSpecArrCalc)){
Map<String, Integer> sizeSpecCounts = new HashMap<>();
for (String sizeSpec : sizeSpecArrCalc.keySet()) {
sizeSpecCounts.put(sizeSpec, sizeSpecCounts.getOrDefault(sizeSpec, 0) + 1);
}
}
for (String sizeSpec : sizeSpecCounts.keySet()) {
if (sizeSpecCounts.get(sizeSpec) > 1) {
repeatSpecArr.add(sizeSpec);
for (String sizeSpec : sizeSpecCounts.keySet()) {
if (sizeSpecCounts.get(sizeSpec) > 1) {
repeatSpecArr.add(sizeSpec);
}
}
}
@ -2579,22 +2583,22 @@ public class ProcessProductPublishTaskService extends TaskBaseService {
}
private Ret checkMoveDataCompletion(MoveProductPublishQueueBO taskDetail, JSONObject sourceProductData) {
if (ObjectUtil.isNull(taskDetail.getCondition())) {
return CommonTool.failResult("配置信息丢失,请联系客服");
}
if (sourceProductData.getString("title") == null || sourceProductData.getString("title").isEmpty()) {
return CommonTool.failResult("商品标题必填,检查源商品是否下架");
}
if (StrUtil.isBlank(taskDetail.getCid())) {
return CommonTool.failResult("类目ID必填~~");
}
if (ObjectUtil.isNotNull(taskDetail.getHasSaveNotes()) && taskDetail.getHasSaveNotes()) {
if (StrUtil.isBlank(taskDetail.getNotes())) {
return CommonTool.failResult("商品描述必填~~");
}
} else if (sourceProductData.getString("notes") == null || sourceProductData.getString("notes").isEmpty() && taskDetail.getCondition().getDesc().getString("descCopyType").equals(MoveConst.descCopyTypeCopy)) {
return CommonTool.failResult("商品描述必填~~");
}
// if (ObjectUtil.isNull(taskDetail.getCondition())) {
// return CommonTool.failResult("配置信息丢失,请联系客服");
// }
// if (sourceProductData.getString("title") == null || sourceProductData.getString("title").isEmpty()) {
// return CommonTool.failResult("商品标题必填,检查源商品是否下架");
// }
// if (StrUtil.isBlank(taskDetail.getCid())) {
// return CommonTool.failResult("类目ID必填~~");
// }
// if (ObjectUtil.isNotNull(taskDetail.getHasSaveNotes()) && taskDetail.getHasSaveNotes()) {
// if (StrUtil.isBlank(taskDetail.getNotes())) {
// return CommonTool.failResult("商品描述必填~~");
// }
// } else if (sourceProductData.getString("notes") == null || sourceProductData.getString("notes").isEmpty() && taskDetail.getCondition().getDesc().getString("descCopyType").equals(MoveConst.descCopyTypeCopy)) {
// return CommonTool.failResult("商品描述必填~~");
// }
// TODO 校验那边

@ -1,11 +1,34 @@
package com.ms.test;
import com.alibaba.fastjson.JSON;
import com.ms.api.dto.move.MoveProductDTO;
import com.ms.api.dto.move.SaveBatchMoveTaskRequestDTO;
import com.ms.api.tool.CommonTool;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class CommonToolTest {
public static void main(String[] args) {
String s = CommonTool.getCurMonthLastTime();
System.out.println(s);
// String s = CommonTool.getCurMonthLastTime();
// System.out.println(s);
Map<String,List<MoveProductDTO>> start = new HashMap<>();
List<MoveProductDTO> mList = new ArrayList<>();
MoveProductDTO moveProductDTO = new MoveProductDTO();
moveProductDTO.setSource("1688");
moveProductDTO.setIsFastMode(0);
moveProductDTO.setCid("20219");
moveProductDTO.setSourceImgUrl("https://cbu01.alicdn.com/img/ibank/O1CN01j9gsEX1LJpR9dXvjY_!!2215879181279-0-cib.jpg");
moveProductDTO.setSourceItemId(734074040263L);
moveProductDTO.setSourceTitle("半身裙女春夏2023新款裙裤短裙蓬蓬裙高腰百褶裙荷叶边超短裙");
mList.add(moveProductDTO);
start.put("products",mList);
System.out.println(JSON.toJSONString(start));
}
}

Loading…
Cancel
Save