提交 69bad9ab authored 作者: 艾庆国's avatar 艾庆国

Merge branch 'refs/heads/v16.3_line_warn_20240528' into test

package com.clx.performance.controller.temp; package com.clx.performance.controller.temp;
import com.clx.order.vo.feign.FeignAddressVO;
import com.clx.performance.extranal.user.AddressService;
import com.clx.performance.service.linewarn.LineWarnMqService; import com.clx.performance.service.linewarn.LineWarnMqService;
import com.clx.performance.utils.gd.GdUtils;
import com.msl.common.base.Optional;
import com.msl.common.result.Result; import com.msl.common.result.Result;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.HashMap;
import java.util.Map;
/** /**
* @Author: aiqingguo * @Author: aiqingguo
* @Description: 临时接口 * @Description: 临时接口
...@@ -22,6 +30,10 @@ public class TempLineWarnController { ...@@ -22,6 +30,10 @@ public class TempLineWarnController {
@Autowired @Autowired
private LineWarnMqService lineWarnMqService; private LineWarnMqService lineWarnMqService;
@Autowired
private AddressService addressService;
@Autowired
private GdUtils gdUtils;
@ApiOperation(value = "test", notes = "<br>By:艾庆国") @ApiOperation(value = "test", notes = "<br>By:艾庆国")
@PostMapping("/test") @PostMapping("/test")
...@@ -45,5 +57,31 @@ public class TempLineWarnController { ...@@ -45,5 +57,31 @@ public class TempLineWarnController {
lineWarnMqService.orderGoodsAdd(orderGoodsNo); lineWarnMqService.orderGoodsAdd(orderGoodsNo);
return Result.ok(); return Result.ok();
} }
@ApiOperation(value = "天气", notes = "<br>By:艾庆国")
@PostMapping("/orderGoodsAdd")
public Result<Map<String, String>> orderGoodsAdd(Integer sendAddressId, Integer receiveAddressId) {
Map<String, String> result = new HashMap<>();
Optional<FeignAddressVO> addressOptional = addressService
.getSendAndReceiveAddress(sendAddressId, receiveAddressId);
if (addressOptional.isEmpty()) {return Result.ok(result);}
FeignAddressVO feignAddressVO = addressOptional.get();
if (feignAddressVO.getSendAddress()!=null
&& StringUtils.isNotBlank(feignAddressVO.getSendAddress().getCityCode())){
String weather = gdUtils.getWeather(feignAddressVO.getSendAddress().getCityCode());
result.put("send", weather);
}
if (feignAddressVO.getReceiveAddress()!=null
&& StringUtils.isNotBlank(feignAddressVO.getReceiveAddress().getCityCode())){
String weather = gdUtils.getWeather(feignAddressVO.getReceiveAddress().getCityCode());
result.put("receive", weather);
}
return Result.ok(result);
}
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论