20 changed files with 137 additions and 47 deletions
@ -0,0 +1,21 @@ |
|||||||
|
package com.logpm.trunkline.feign; |
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject; |
||||||
|
import org.springblade.common.constant.ModuleNameConstant; |
||||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||||
|
import org.springframework.web.bind.annotation.RequestParam; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@FeignClient( |
||||||
|
value = ModuleNameConstant.APPLICATION_TRUNKLINE_NAME |
||||||
|
) |
||||||
|
public interface ITrunklinePackageTrackLogClient { |
||||||
|
|
||||||
|
String API_PREFIX = "trunklinePackageTrackLog/client"; |
||||||
|
|
||||||
|
@PostMapping(API_PREFIX+"/addBatchPackageTrackLog") |
||||||
|
void addPackageTrackLog(@RequestParam List<JSONObject> addPackageTrackLogList, List<String> orderPackageCodes, Integer workNode); |
||||||
|
|
||||||
|
} |
@ -0,0 +1,33 @@ |
|||||||
|
package com.logpm.trunkline.feign; |
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject; |
||||||
|
import com.logpm.trunkline.service.IPackageTrackLogAsyncService; |
||||||
|
import com.logpm.warehouse.entity.WarehousePackageTrackLogEntity; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import lombok.extern.slf4j.Slf4j; |
||||||
|
import org.springframework.web.bind.annotation.RestController; |
||||||
|
import springfox.documentation.annotations.ApiIgnore; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@Slf4j |
||||||
|
@ApiIgnore() |
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
public class TrunklinePackageTrackLogClient implements ITrunklinePackageTrackLogClient{ |
||||||
|
|
||||||
|
private final IPackageTrackLogAsyncService packageTrackLogAsyncService; |
||||||
|
|
||||||
|
@Override |
||||||
|
public void addPackageTrackLog(List<JSONObject> addPackageTrackLogList, List<String> orderPackageCodes, Integer workNode) { |
||||||
|
List<WarehousePackageTrackLogEntity> ls = new ArrayList<>(); |
||||||
|
addPackageTrackLogList.forEach(jsonObject -> { |
||||||
|
WarehousePackageTrackLogEntity warehousePackageTrackLogEntity = jsonObject.toJavaObject(WarehousePackageTrackLogEntity.class); |
||||||
|
ls.add(warehousePackageTrackLogEntity); |
||||||
|
}); |
||||||
|
|
||||||
|
packageTrackLogAsyncService.addBatchPackageTrackLog(ls, orderPackageCodes, workNode); |
||||||
|
|
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue