|
|
|
@ -1,5 +1,7 @@
|
|
|
|
|
package com.ms.biz.spi.callback;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.jinritemai.cloud.base.api.BaseRequest;
|
|
|
|
|
import com.jinritemai.cloud.base.api.BaseResponse;
|
|
|
|
|
import com.jinritemai.cloud.base.api.ExtensionService;
|
|
|
|
@ -16,18 +18,18 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
@ExtensionService("batchCreate")
|
|
|
|
|
@Slf4j
|
|
|
|
|
@AllArgsConstructor
|
|
|
|
|
public class BatchCreateService extends SPIBaseService implements ExtensionServiceHandler<BatchCreateParam, BatchCreateData> {
|
|
|
|
|
public class BatchCreateService extends SPIBaseService implements ExtensionServiceHandler<BatchCreateParam, JSONObject> {
|
|
|
|
|
private DistributionOrderService distributionOrderService;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public BaseResponse<BatchCreateData> handle(BaseRequest<BatchCreateParam> req) {
|
|
|
|
|
public BaseResponse<JSONObject> handle(BaseRequest<BatchCreateParam> req) {
|
|
|
|
|
try {
|
|
|
|
|
BatchCreateParam param = req.getData();
|
|
|
|
|
BatchCreateData data = new BatchCreateData();
|
|
|
|
|
distributionOrderService.batchCreate(param, data);
|
|
|
|
|
return BaseResponse.<BatchCreateData>builder().success(true).message("success").code("0").data(data).build();
|
|
|
|
|
return BaseResponse.<JSONObject>builder().success(true).message("success").code("0").data(JSON.parseObject(JSON.toJSONString(data))).build();
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
return BaseResponse.<BatchCreateData>builder().success(true).message(e.getMessage()).code("100003").build();
|
|
|
|
|
return BaseResponse.<JSONObject>builder().success(true).message(e.getMessage()).code("100003").build();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|