diff --git a/ms-biz/src/main/java/com/ms/api/TestSignService.java b/ms-biz/src/main/java/com/ms/api/TestSignService.java index 9f32f277..61f365d5 100644 --- a/ms-biz/src/main/java/com/ms/api/TestSignService.java +++ b/ms-biz/src/main/java/com/ms/api/TestSignService.java @@ -47,9 +47,9 @@ public class TestSignService implements ExtensionServiceHandler params.put("double", 10.1); params.put("string", "test"); - params.put("struct1", new GetCurrentShopMoveSettingRequestDTO()); - params.put("struct2", new GetMoveHistoryProductListRequestDTO()); - params.put("struct3", new SaveBatchMoveTaskRequestDTO()); +// params.put("struct1", new GetCurrentShopMoveSettingRequestDTO()); +// params.put("struct2", new GetMoveHistoryProductListRequestDTO()); +// params.put("struct3", new SaveBatchMoveTaskRequestDTO()); List arrayStruct = new LinkedList<>(); arrayStruct.add(new GetCurrentShopMoveSettingRequestDTO()); diff --git a/ms-biz/src/main/java/com/ms/api/spi/move/SaveBatchMoveTaskService.java b/ms-biz/src/main/java/com/ms/api/spi/move/SaveBatchMoveTaskService.java index 718571a9..64824760 100644 --- a/ms-biz/src/main/java/com/ms/api/spi/move/SaveBatchMoveTaskService.java +++ b/ms-biz/src/main/java/com/ms/api/spi/move/SaveBatchMoveTaskService.java @@ -10,6 +10,7 @@ import com.ms.api.common.R; import com.ms.api.common.Ret; import com.ms.api.common.SPIBaseService; import com.ms.api.common.StrObjMap; +import com.ms.api.consts.CommonConst; import com.ms.api.consts.StatusConst; import com.ms.api.dto.move.SaveBatchMoveTaskRequestDTO; import com.ms.api.service.MoveCollectTaskDetailService; @@ -30,7 +31,7 @@ import java.util.*; */ @ExtensionService("saveBatchMoveTask") @Slf4j -public class SaveBatchMoveTaskService extends SPIBaseService implements ExtensionServiceHandler { +public class SaveBatchMoveTaskService extends SPIBaseService implements ExtensionServiceHandler { @Autowired private MoveCollectTaskService moveCollectTaskService; @@ -42,7 +43,7 @@ public class SaveBatchMoveTaskService extends SPIBaseService implements Extensio private MoveCollectTaskDetailService moveCollectTaskDetailService; @Override - public BaseResponse handle(BaseRequest req) { + public BaseResponse handle(BaseRequest req) { initHandle(req); // ----参数校验---- SaveBatchMoveTaskRequestDTO fields = req.getData(); @@ -68,23 +69,59 @@ public class SaveBatchMoveTaskService extends SPIBaseService implements Extensio shopMoveConditionMap = (StrObjMap) checkAndFormatRet.getData().get("shopMoveConditionMap"); log.info("shopId " + shopId + " start allocShopProductsByAuthShop"); - StrObjMap shopProducts = allocShopProductsByAuthShop(needMoveShopIds,curProductDetails); + StrObjMap shopProducts = allocShopProductsByAuthShop(needMoveShopIds, curProductDetails); Ret checkDsValidRet = checkDsValid(needMoveShopIds, shopProducts); if (CommonTool.isFailRet(checkDsValidRet)) { R.ok(checkDsValidRet); } -// addCollectTask(shopId, "copyType", "name",null); + log.info("shopId " + shopId + " start saveTaskByAuthShop"); + Ret saveRet = saveTaskByAuthShop(shopId, copyType, shopMoveConditionMap, shopConditions, shopProducts, shopPreviewCateAttr); + if (CommonTool.isFailRet(saveRet)) { + R.ok(saveRet); + } + + String shopTaskId = (String)saveRet.getData().get("taskId"); + log.info("shopId "+shopId+" session shopId saveTask success, shopTaskId" + shopTaskId); + int submitCnt = ((List)shopProducts.get(shopId)).size(); + if (submitCnt == 0) { + Ret ret = new Ret(); + ret.setResult(CommonConst.FAIL); + ret.setReason("提交商品数为0,请检查是否正常提交商品"); + StrObjMap retData = new StrObjMap(); + retData.put("taskId",shopTaskId); + retData.put("submitCnt",submitCnt); + ret.setData(retData); + R.ok(ret); + } + +// if ($_POST['sameType']) { +// $this->moveService->saveSameProductCopyLog($_POST['sameType'], $_POST['searchSameProductMap'], $shopId, $copyType == MoveConst::collectDsCopy); +// } // ----结果返回---- - return R.ok(); + Ret ret = new Ret(); + ret.setResult(CommonConst.SUCCESS); + StrObjMap retData = new StrObjMap(); + retData.put("taskId",shopTaskId); + retData.put("submitCnt",submitCnt); + ret.setData(retData); + return R.ok(ret); } private Ret checkAndFormatData(Long shopId, StrObjMap needMoveShopIds, StrObjMap shopMoveConditionMap, StrObjMap shopPreviewCateAttr, StrObjMap productSimpleDetails, String copyType) { + productSimpleDetails = getProductSimpleDetails(productSimpleDetails,shopId); + StrObjMap curProductDetails = (StrObjMap)productSimpleDetails.get(String.valueOf(shopId)); + return null; } + private StrObjMap getProductSimpleDetails(StrObjMap productSimpleDetails, Long shopId) { + return null; + } + + private StrObjMap allocShopProductsByAuthShop(StrObjMap needMoveShopIds, StrObjMap curProductDetails) { return needMoveShopIds; @@ -94,8 +131,9 @@ public class SaveBatchMoveTaskService extends SPIBaseService implements Extensio return null; } - private void saveTaskByAuthShop() { + private Ret saveTaskByAuthShop(Long shopId, String copyType, StrObjMap shopMoveConditionMap, StrObjMap shopConditions, StrObjMap shopProducts, StrObjMap shopPreviewCateAttr) { + return null; } // private Map saveTaskByAuthShop(int shopId, String copyType, Map shopMoveConditionMap, Map shopMoveSettingOperateLogMap, Map shopConditions, Map shopProducts, Map shopPreviewCateAttr, String hostname, String operateSource, int isFromLtaoRank) {