|
|
@ -1,5 +1,7 @@
|
|
|
|
package com.ms.biz.spi.callback;
|
|
|
|
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.BaseRequest;
|
|
|
|
import com.jinritemai.cloud.base.api.BaseResponse;
|
|
|
|
import com.jinritemai.cloud.base.api.BaseResponse;
|
|
|
|
import com.jinritemai.cloud.base.api.ExtensionService;
|
|
|
|
import com.jinritemai.cloud.base.api.ExtensionService;
|
|
|
@ -16,18 +18,18 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
|
@ExtensionService("batchCreate")
|
|
|
|
@ExtensionService("batchCreate")
|
|
|
|
@Slf4j
|
|
|
|
@Slf4j
|
|
|
|
@AllArgsConstructor
|
|
|
|
@AllArgsConstructor
|
|
|
|
public class BatchCreateService extends SPIBaseService implements ExtensionServiceHandler<BatchCreateParam, BatchCreateData> {
|
|
|
|
public class BatchCreateService extends SPIBaseService implements ExtensionServiceHandler<BatchCreateParam, JSONObject> {
|
|
|
|
private DistributionOrderService distributionOrderService;
|
|
|
|
private DistributionOrderService distributionOrderService;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public BaseResponse<BatchCreateData> handle(BaseRequest<BatchCreateParam> req) {
|
|
|
|
public BaseResponse<JSONObject> handle(BaseRequest<BatchCreateParam> req) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
BatchCreateParam param = req.getData();
|
|
|
|
BatchCreateParam param = req.getData();
|
|
|
|
BatchCreateData data = new BatchCreateData();
|
|
|
|
BatchCreateData data = new BatchCreateData();
|
|
|
|
distributionOrderService.batchCreate(param, data);
|
|
|
|
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) {
|
|
|
|
} 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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|