添加返回类等

20230922-ljl-fixBug
qiushengjie 1 year ago
parent 134d64c830
commit b6ecded227

@ -47,9 +47,9 @@ public class TestSignService implements ExtensionServiceHandler<ItemDTO, String>
params.put("double", 10.1); params.put("double", 10.1);
params.put("string", "test"); params.put("string", "test");
params.put("struct1", new GetCurrentShopMoveSettingRequestDTO()); // params.put("struct1", new GetCurrentShopMoveSettingRequestDTO());
params.put("struct2", new GetMoveHistoryProductListRequestDTO()); // params.put("struct2", new GetMoveHistoryProductListRequestDTO());
params.put("struct3", new SaveBatchMoveTaskRequestDTO()); // params.put("struct3", new SaveBatchMoveTaskRequestDTO());
List<Object> arrayStruct = new LinkedList<>(); List<Object> arrayStruct = new LinkedList<>();
arrayStruct.add(new GetCurrentShopMoveSettingRequestDTO()); arrayStruct.add(new GetCurrentShopMoveSettingRequestDTO());

@ -10,6 +10,7 @@ import com.ms.api.common.R;
import com.ms.api.common.Ret; import com.ms.api.common.Ret;
import com.ms.api.common.SPIBaseService; import com.ms.api.common.SPIBaseService;
import com.ms.api.common.StrObjMap; import com.ms.api.common.StrObjMap;
import com.ms.api.consts.CommonConst;
import com.ms.api.consts.StatusConst; import com.ms.api.consts.StatusConst;
import com.ms.api.dto.move.SaveBatchMoveTaskRequestDTO; import com.ms.api.dto.move.SaveBatchMoveTaskRequestDTO;
import com.ms.api.service.MoveCollectTaskDetailService; import com.ms.api.service.MoveCollectTaskDetailService;
@ -30,7 +31,7 @@ import java.util.*;
*/ */
@ExtensionService("saveBatchMoveTask") @ExtensionService("saveBatchMoveTask")
@Slf4j @Slf4j
public class SaveBatchMoveTaskService extends SPIBaseService implements ExtensionServiceHandler<SaveBatchMoveTaskRequestDTO, Void> { public class SaveBatchMoveTaskService extends SPIBaseService implements ExtensionServiceHandler<SaveBatchMoveTaskRequestDTO, Ret> {
@Autowired @Autowired
private MoveCollectTaskService moveCollectTaskService; private MoveCollectTaskService moveCollectTaskService;
@ -42,7 +43,7 @@ public class SaveBatchMoveTaskService extends SPIBaseService implements Extensio
private MoveCollectTaskDetailService moveCollectTaskDetailService; private MoveCollectTaskDetailService moveCollectTaskDetailService;
@Override @Override
public BaseResponse<Void> handle(BaseRequest<SaveBatchMoveTaskRequestDTO> req) { public BaseResponse<Ret> handle(BaseRequest<SaveBatchMoveTaskRequestDTO> req) {
initHandle(req); initHandle(req);
// ----参数校验---- // ----参数校验----
SaveBatchMoveTaskRequestDTO fields = req.getData(); SaveBatchMoveTaskRequestDTO fields = req.getData();
@ -68,23 +69,59 @@ public class SaveBatchMoveTaskService extends SPIBaseService implements Extensio
shopMoveConditionMap = (StrObjMap) checkAndFormatRet.getData().get("shopMoveConditionMap"); shopMoveConditionMap = (StrObjMap) checkAndFormatRet.getData().get("shopMoveConditionMap");
log.info("shopId " + shopId + " start allocShopProductsByAuthShop"); log.info("shopId " + shopId + " start allocShopProductsByAuthShop");
StrObjMap shopProducts = allocShopProductsByAuthShop(needMoveShopIds,curProductDetails); StrObjMap shopProducts = allocShopProductsByAuthShop(needMoveShopIds, curProductDetails);
Ret checkDsValidRet = checkDsValid(needMoveShopIds, shopProducts); Ret checkDsValidRet = checkDsValid(needMoveShopIds, shopProducts);
if (CommonTool.isFailRet(checkDsValidRet)) { if (CommonTool.isFailRet(checkDsValidRet)) {
R.ok(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) { 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; return null;
} }
private StrObjMap getProductSimpleDetails(StrObjMap productSimpleDetails, Long shopId) {
return null;
}
private StrObjMap allocShopProductsByAuthShop(StrObjMap needMoveShopIds, StrObjMap curProductDetails) { private StrObjMap allocShopProductsByAuthShop(StrObjMap needMoveShopIds, StrObjMap curProductDetails) {
return needMoveShopIds; return needMoveShopIds;
@ -94,8 +131,9 @@ public class SaveBatchMoveTaskService extends SPIBaseService implements Extensio
return null; return null;
} }
private void saveTaskByAuthShop() { private Ret saveTaskByAuthShop(Long shopId, String copyType, StrObjMap shopMoveConditionMap, StrObjMap shopConditions, StrObjMap shopProducts, StrObjMap shopPreviewCateAttr) {
return null;
} }
// private Map<String, Object> saveTaskByAuthShop(int shopId, String copyType, Map<String, Object> shopMoveConditionMap, Map<String, Object> shopMoveSettingOperateLogMap, Map<String, Object> shopConditions, Map<String, Object> shopProducts, Map<String, Object> shopPreviewCateAttr, String hostname, String operateSource, int isFromLtaoRank) { // private Map<String, Object> saveTaskByAuthShop(int shopId, String copyType, Map<String, Object> shopMoveConditionMap, Map<String, Object> shopMoveSettingOperateLogMap, Map<String, Object> shopConditions, Map<String, Object> shopProducts, Map<String, Object> shopPreviewCateAttr, String hostname, String operateSource, int isFromLtaoRank) {

Loading…
Cancel
Save