Commit 812d6680 by huangjinxin

Merge remote-tracking branch 'origin/develop' into develop

2 parents bb0a097c d856f1fb
......@@ -64,6 +64,7 @@ public class PeaApiController {
private static final String stage = "{\"orderId\": \"X10001\", \"engineerCode\": \"E12005\", \"engineerName\": \"祝枝山\", \"engineerCodeAssist\": \"E12446\", \"engineerNameAssist\": \"李晓阳\", \"planVisitTime\": \"2023-07-27 12:00:00\", \"realtimeInfo\": {\"engineerLocation\": {\"latitude\": 31.349701, \"longitude\": 120.675945, \"address\": \"江苏省苏州市苏州工业园区和顺路\", \"name\": \"和顺大酒店\"}, \"estimate\": {\"distance\": 2300, \"arriveTime\": \"2023-07-27 12:12:00\"}}}";
/**
* 3.1GET 查询技术员日历
*
......@@ -185,6 +186,21 @@ public class PeaApiController {
*/
@PostMapping("/order/create")
public Result<?> orderCreate(@Validated @RequestBody OrderDTO.OrderCreateRequest request) {
TypeCodeCheckTableEntity brand = tableCodeCheckDao.findByTypeAndCode("BRAND", request.getBrand());
if (Objects.isNull(brand)) {
throw new BusinessException("查询不到:" + request.getBrand() + "对应的品牌");
}
TypeCodeCheckTableEntity type = tableCodeCheckDao.findByTypeAndCode("TYPE", request.getProductType());
if (Objects.isNull(type)) {
throw new BusinessException("查询不到:" + request.getProductType() + "对应的产品类型");
}
TypeCodeCheckTableEntity skill = tableCodeCheckDao.findByTypeAndCode("SKILL", request.getServiceType());
if (Objects.isNull(skill)) {
throw new BusinessException("查询不到:" + request.getServiceType() + "对应的技能");
}
request.setBrand(brand.getName());
request.setProductType(type.getName());
request.setServiceType(skill.getName());
return orderCreateService.createOrder(request);
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!