Commit b5b5012d authored by wux's avatar wux

根据放货ID生成客户信息

parent eea7b5ab
......@@ -165,4 +165,9 @@ public interface OrderCargoControlPickService extends IService<OrderCargoControl
* 查询控货订单列表统计
*/
StatisticsOrderVO statisticsOrderControl(OrderQueryVO query);
/**
* 根据放货信息生成客户信息
*/
void createCustomerByCargoControlPickId(OrderCargoControlPickDO orderCargoControlPick);
}
......@@ -1547,4 +1547,13 @@ public class OrderCargoControlPickServiceImpl extends AbstractService<OrderCargo
return orderCargoControlPickMapper.statisticsOrderControl(query);
}
@Override
public void createCustomerByCargoControlPickId(OrderCargoControlPickDO orderCargoControlPick) {
OrderDO orderDO = orderService.getById(orderCargoControlPick.getOrderId());
OrderBackInfoDto info = orderQueryService.info(orderDO.getOrderId());
LogisticsInfoDto logisticsInfoDto = info.getLogisticsInfoDto();
String destTitleEn = logisticsInfoDto.getDestAddressEn();
//控货收货人自动创建客户
customerApiImpl.associateCargoCustomerAuto(destTitleEn,orderDO.getTransportId(),orderCargoControlPick.getConsigneeCountryCode(), orderCargoControlPick.getConsigneePhone(), orderCargoControlPick.getConsigneeName(), orderCargoControlPick.getConsigneeEmail());
}
}
......@@ -221,4 +221,16 @@ public class OrderCargoControlPickController {
orderCargoControlPickService.cancelApprovalByOrderApprovalId(orderApprovalId, reason);
return success(Boolean.TRUE);
}
@GetMapping("create/customer/{id}")
@ApiOperation("根据放货ID生成客户信息")
@ApiImplicitParam(name = "id", value = "放货记录ID", required = true, example = "1024", dataType = "Long")
public CommonResult<Boolean> createCustomerByCargoControlPickId(@PathVariable(value = "id") Long id) {
OrderCargoControlPickDO orderCargoControlPickDO = orderCargoControlPickService.getById(id);
if (Objects.isNull(orderCargoControlPickDO)) {
throw exception(ORDER_CARGO_CONTROL_PICK_NOT_EXISTS);
}
orderCargoControlPickService.createCustomerByCargoControlPickId(orderCargoControlPickDO);
return success(true);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment