Commit a0328826 by 丁伟峰

Merge branch 'feat-dingwf' into develop

2 parents 5a3f0791 31c45ee6
package com.alibaba.cloud.integration.order.dao;
import com.alibaba.cloud.integration.order.entity.OrderRequestEntity;
import org.springframework.data.jpa.repository.JpaRepository;
public interface OrderReqeustDao extends JpaRepository <OrderRequestEntity, Long> {
}
...@@ -15,5 +15,5 @@ public class OrderCreateReqDTO { ...@@ -15,5 +15,5 @@ public class OrderCreateReqDTO {
private String expectEnd; private String expectEnd;
private String priority; private String priority;
private String orderTags; private String orderTags;
private String memo; private String description;
} }
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
package com.alibaba.cloud.integration.order.entity; package com.alibaba.cloud.integration.order.entity;
import lombok.Data;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType; import javax.persistence.GenerationType;
...@@ -23,7 +25,8 @@ import javax.persistence.Id; ...@@ -23,7 +25,8 @@ import javax.persistence.Id;
import java.io.Serializable; import java.io.Serializable;
@Entity @Entity
public class OrderRequestEntity implements Serializable { @Data
public class OrderRequestEntity {
@Id @Id
@GeneratedValue(strategy = GenerationType.IDENTITY) @GeneratedValue(strategy = GenerationType.IDENTITY)
......
...@@ -17,7 +17,10 @@ ...@@ -17,7 +17,10 @@
package com.alibaba.cloud.integration.order.service.impl; package com.alibaba.cloud.integration.order.service.impl;
import com.alibaba.cloud.integration.common.Result; import com.alibaba.cloud.integration.common.Result;
import com.alibaba.cloud.integration.order.dao.OrderReqeustDao;
import com.alibaba.cloud.integration.order.dto.LocationDTO;
import com.alibaba.cloud.integration.order.dto.OrderCreateReqDTO; import com.alibaba.cloud.integration.order.dto.OrderCreateReqDTO;
import com.alibaba.cloud.integration.order.entity.OrderRequestEntity;
import com.alibaba.cloud.integration.order.feign.AccountServiceFeignClient; import com.alibaba.cloud.integration.order.feign.AccountServiceFeignClient;
import com.alibaba.cloud.integration.order.feign.StorageServiceFeignClient; import com.alibaba.cloud.integration.order.feign.StorageServiceFeignClient;
import com.alibaba.cloud.integration.order.mapper.OrderMapper; import com.alibaba.cloud.integration.order.mapper.OrderMapper;
...@@ -34,21 +37,36 @@ import org.springframework.stereotype.Service; ...@@ -34,21 +37,36 @@ import org.springframework.stereotype.Service;
public class OrderServiceImpl implements OrderService { public class OrderServiceImpl implements OrderService {
@Autowired @Autowired
private OrderMapper orderMapper; private OrderReqeustDao orderReqeustDao;
@Autowired
private AccountServiceFeignClient accountService;
@Autowired
private StorageServiceFeignClient storageService;
@Override @Override
@GlobalTransactional @GlobalTransactional
public Result<?> createOrder(OrderCreateReqDTO orderCreateReqDTO) { public Result<?> createOrder(OrderCreateReqDTO req) {
log.info("[createOrder] current XID: {}", RootContext.getXID()); log.info("[createOrder] current XID: {}", RootContext.getXID());
OrderRequestEntity entity = new OrderRequestEntity();
return null; entity.setName(req.getName());
entity.setPhone(req.getPhone());
entity.setAddress(req.getAddress());
entity.setBrand(req.getBrand());
entity.setCategoryId(req.getCatalogId());
entity.setFaultDescribe(req.getFaultDescribe());
entity.setExpectTimeBegin(req.getExpectBegin());
entity.setExpectTimeEnd(req.getExpectEnd());
entity.setDescription(req.getDescription());
// location
LocationDTO location = req.getLocation();
entity.setProvince(location.getProvince());
entity.setCity(location.getCity());
entity.setCounty(location.getCountry());
orderReqeustDao.save(entity);
// 根据orderTags, 解析保存到type、skill等字段
String[] l = req.getLocation().getLocation().split(",");
entity.setX(l[0]);
entity.setY(l[1]);
// todo 服务单状态、预约状态等
entity.setStatus("");
entity.setAppointmentStatus("");
return Result.success(null);
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!