Commit fd6a4e09 by 丁伟峰

登记OrderChange

1 parent d2ae3820
package com.alibaba.cloud.integration.order.entity;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.persistence.*;
import java.util.Date;
......@@ -8,6 +9,7 @@ import java.util.Date;
@Entity
@Data
@Accessors(chain = true)
@Table(name="order_change")
public class OrderChangeEntity {
/**
......
......@@ -2,6 +2,8 @@ package com.alibaba.cloud.integration.order.service;
import com.alibaba.cloud.integration.order.dao.CapacityTeamStatDao;
import com.alibaba.cloud.integration.order.dao.MapBlockInfoDao;
import com.alibaba.cloud.integration.order.dao.OrderChangeDao;
import com.alibaba.cloud.integration.order.entity.OrderChangeEntity;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.experimental.Accessors;
......@@ -15,6 +17,7 @@ import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Random;
......@@ -28,6 +31,9 @@ public class CommonService {
@Autowired
private CapacityTeamStatDao capacityTeamStatDao;
@Autowired
private OrderChangeDao orderChangeDao;
public String getTeamIdByInput(String location, String address, String layer) {
// todo 目前会随机兜底,后面将合理化
String teamId = null;
......@@ -118,4 +124,11 @@ public class CommonService {
private String areaId;
private String areaName;
}
public void addOrderChange(String orderId, String subOrderId, String source, String operator, String content, String memo){
OrderChangeEntity entity = new OrderChangeEntity();
entity.setOrderId(orderId).setSuborderId(subOrderId).setSource(source).setOperator(operator).setContent(content).setMemo(memo);
entity.setCreateTime(new Date()).setUpdateTime(new Date());
orderChangeDao.save(entity);
}
}
......@@ -135,6 +135,8 @@ public class OrderCreateServiceImpl implements OrderCreateService {
String catalogId = categoryEntity.getProductCategoryId();
entity.setCategoryId(catalogId);
orderRequestDao.save(entity);
// 登记
commonService.addOrderChange(orderId, "", req.getSource(), "API", "创建订单", "" );
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!