Commit eb9a4bb07ee94b7d089ecda2cdb2616b0adb5a7d

Authored by zhangxing
2 parents a18b1835 7ca0016e
src/main/java/com/diligrp/xtrade/order/controllor/OrderApiController.java
1 -package com.diligrp.xtrade.order.controllor;  
2 -  
3 -import javax.annotation.Resource;  
4 -  
5 -import org.springframework.validation.annotation.Validated;  
6 -import org.springframework.web.bind.annotation.RequestBody;  
7 -import org.springframework.web.bind.annotation.RequestMapping;  
8 -import org.springframework.web.bind.annotation.RequestMethod;  
9 -import org.springframework.web.bind.annotation.RestController;  
10 -  
11 -import com.diligrp.xtrade.order.domain.dto.OrderCreateRequestDto;  
12 -import com.diligrp.xtrade.order.domain.dto.OrderRequestDto;  
13 -import com.diligrp.xtrade.order.domain.dto.OrderResponseDto;  
14 -import com.diligrp.xtrade.order.service.OrderService;  
15 -import com.diligrp.xtrade.shared.domain.Message;  
16 -import com.diligrp.xtrade.shared.domain.Page;  
17 -  
18 -/**  
19 - * 订单相关接口实现  
20 - * @author zhangxing  
21 - * @Date 2020/04/13  
22 - */  
23 -@RestController  
24 -@RequestMapping(value = "/sapi/order")  
25 -public class OrderApiController {  
26 -  
27 - @Resource  
28 - private OrderService orderservice;  
29 -  
30 - /**  
31 - * 订单创建接口  
32 - */  
33 - @RequestMapping(value = "/createOrder",method = {RequestMethod.POST})  
34 - public Message<Boolean> createOrder(@RequestBody @Validated OrderCreateRequestDto orderCreateRequestDto) {  
35 - orderservice.createOrder(orderCreateRequestDto);  
36 - return Message.success(Boolean.TRUE);  
37 - }  
38 -  
39 - /**  
40 - * 订单列表接口  
41 - */  
42 - @RequestMapping(value = "/listOrders")  
43 - public Message<Page<OrderResponseDto>> listOrders(@RequestBody OrderRequestDto orderQueryRequestDto) {  
44 - return Message.success(orderservice.orderLists(orderQueryRequestDto));  
45 - }  
46 -  
47 - /**  
48 - * 订单详情  
49 - */  
50 - @RequestMapping(value = "/orderDetail")  
51 - public Message<OrderResponseDto> orderDetail(@RequestBody @Validated OrderRequestDto orderQueryRequestDto) {  
52 - return Message.success(orderservice.orderDetail(orderQueryRequestDto.getOrderId()));  
53 - }  
54 -  
55 - /**  
56 - * 订单详情  
57 - */  
58 - @RequestMapping(value = "/updateBuyer")  
59 - public Message<Boolean> updateBuyer(@RequestBody @Validated OrderRequestDto orderQueryRequestDto) {  
60 - orderservice.updateBuyer(orderQueryRequestDto);  
61 - return Message.success(Boolean.TRUE);  
62 - }  
63 -} 1 +package com.diligrp.xtrade.order.controllor;
  2 +
  3 +import javax.annotation.Resource;
  4 +
  5 +import org.springframework.validation.annotation.Validated;
  6 +import org.springframework.web.bind.annotation.RequestBody;
  7 +import org.springframework.web.bind.annotation.RequestMapping;
  8 +import org.springframework.web.bind.annotation.RequestMethod;
  9 +import org.springframework.web.bind.annotation.RestController;
  10 +
  11 +import com.diligrp.xtrade.order.domain.dto.OrderCreateRequestDto;
  12 +import com.diligrp.xtrade.order.domain.dto.OrderRequestDto;
  13 +import com.diligrp.xtrade.order.domain.dto.OrderResponseDto;
  14 +import com.diligrp.xtrade.order.service.OrderService;
  15 +import com.diligrp.xtrade.shared.domain.Message;
  16 +import com.diligrp.xtrade.shared.domain.Page;
  17 +
  18 +/**
  19 + * 订单相关接口实现
  20 + * @author zhangxing
  21 + * @Date 2020/04/13
  22 + */
  23 +@RestController
  24 +@RequestMapping(value = "/sapi/order")
  25 +public class OrderApiController {
  26 +
  27 + @Resource
  28 + private OrderService orderservice;
  29 +
  30 + /**
  31 + * 订单创建接口
  32 + */
  33 + @RequestMapping(value = "/createOrder",method = {RequestMethod.POST})
  34 + public Message<Boolean> createOrder(@RequestBody @Validated OrderCreateRequestDto orderCreateRequestDto) {
  35 + orderservice.createOrder(orderCreateRequestDto);
  36 + return Message.success(Boolean.TRUE);
  37 + }
  38 +
  39 + /**
  40 + * 订单列表接口
  41 + */
  42 + @RequestMapping(value = "/listOrders")
  43 + public Message<Page<OrderResponseDto>> listOrders(@RequestBody OrderRequestDto orderQueryRequestDto) {
  44 + return Message.success(orderservice.orderLists(orderQueryRequestDto));
  45 + }
  46 +
  47 + /**
  48 + * 订单详情
  49 + */
  50 + @RequestMapping(value = "/orderDetail")
  51 + public Message<OrderResponseDto> orderDetail(@RequestBody @Validated OrderRequestDto orderQueryRequestDto) {
  52 + return Message.success(orderservice.orderDetail(orderQueryRequestDto.getOrderId()));
  53 + }
  54 +
  55 + /**
  56 + * 订单详情
  57 + */
  58 + @RequestMapping(value = "/updateBuyer")
  59 + public Message<Boolean> updateBuyer(@RequestBody @Validated OrderRequestDto orderQueryRequestDto) {
  60 + orderservice.updateBuyer(orderQueryRequestDto);
  61 + return Message.success(Boolean.TRUE);
  62 + }
  63 +}
src/main/java/com/diligrp/xtrade/product/controllor/MerchantController.java
@@ -25,7 +25,7 @@ public class MerchantController { @@ -25,7 +25,7 @@ public class MerchantController {
25 private MerchantService merchantService; 25 private MerchantService merchantService;
26 26
27 /** 27 /**
28 - * 新建市场 28 + * 新建商户
29 * @author miaoguoxin 29 * @author miaoguoxin
30 * @date 2020/4/22 30 * @date 2020/4/22
31 */ 31 */
src/main/java/com/diligrp/xtrade/product/domain/dto/MerchantResponseDto.java
@@ -9,31 +9,31 @@ import java.io.Serializable; @@ -9,31 +9,31 @@ import java.io.Serializable;
9 * @Date: 2020/4/21 16:04 9 * @Date: 2020/4/21 16:04
10 */ 10 */
11 public class MerchantResponseDto implements Serializable { 11 public class MerchantResponseDto implements Serializable {
12 - //商户id 12 + /**商户id*/
13 private Long merId; 13 private Long merId;
14 14
15 - //商户名称 15 + /**商户名称*/
16 private String merName; 16 private String merName;
17 17
18 - //园区编码 18 + /** 园区编码*/
19 private String marketId; 19 private String marketId;
20 20
21 /**类型 */ 21 /**类型 */
22 private AccountType type; 22 private AccountType type;
23 23
24 - //主账号 24 + /**主账号*/
25 private Long accountId; 25 private Long accountId;
26 26
27 - //账户名称 27 + /** 账户名称*/
28 private String accountName; 28 private String accountName;
29 29
30 - //商户状态 30 + /** 商户状态*/
31 private Integer status; 31 private Integer status;
32 32
33 - //市场编码 33 + /**市场编码*/
34 private String marketCode; 34 private String marketCode;
35 35
36 - //描述 36 + /**描述*/
37 private String description; 37 private String description;
38 38
39 public Long getMerId() { 39 public Long getMerId() {
src/main/java/com/diligrp/xtrade/product/repository/MerchantRepository.java
1 package com.diligrp.xtrade.product.repository; 1 package com.diligrp.xtrade.product.repository;
2 2
3 import com.diligrp.xtrade.product.dao.MerchantDao; 3 import com.diligrp.xtrade.product.dao.MerchantDao;
4 -import com.diligrp.xtrade.product.dao.ShopDao;  
5 -import com.diligrp.xtrade.product.domain.emuns.AccountType;  
6 import com.diligrp.xtrade.product.domain.emuns.IKeyGeneratorKeys; 4 import com.diligrp.xtrade.product.domain.emuns.IKeyGeneratorKeys;
7 import com.diligrp.xtrade.product.domain.entity.MerchantDo; 5 import com.diligrp.xtrade.product.domain.entity.MerchantDo;
8 -import com.diligrp.xtrade.product.domain.entity.ShopDo;  
9 import com.diligrp.xtrade.shared.sequence.IKeyGenerator; 6 import com.diligrp.xtrade.shared.sequence.IKeyGenerator;
10 import com.diligrp.xtrade.shared.sequence.KeyGeneratorManager; 7 import com.diligrp.xtrade.shared.sequence.KeyGeneratorManager;
11 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.beans.factory.annotation.Autowired;
12 import org.springframework.stereotype.Repository; 9 import org.springframework.stereotype.Repository;
13 10
14 -import java.time.LocalDateTime;  
15 import java.util.List; 11 import java.util.List;
  12 +import java.util.concurrent.Executors;
  13 +import java.util.concurrent.TimeUnit;
16 14
17 /** 15 /**
18 * @Auther: miaoguoxin 16 * @Auther: miaoguoxin
@@ -23,8 +21,6 @@ public class MerchantRepository implements IMerchantRepository { @@ -23,8 +21,6 @@ public class MerchantRepository implements IMerchantRepository {
23 @Autowired 21 @Autowired
24 private MerchantDao merchantDao; 22 private MerchantDao merchantDao;
25 @Autowired 23 @Autowired
26 - private ShopDao shopDao;  
27 - @Autowired  
28 private KeyGeneratorManager keyGeneratorManager; 24 private KeyGeneratorManager keyGeneratorManager;
29 25
30 @Override 26 @Override
@@ -49,4 +45,5 @@ public class MerchantRepository implements IMerchantRepository { @@ -49,4 +45,5 @@ public class MerchantRepository implements IMerchantRepository {
49 public void update(MerchantDo merchantDo) { 45 public void update(MerchantDo merchantDo) {
50 merchantDao.update(merchantDo); 46 merchantDao.update(merchantDo);
51 } 47 }
  48 +
52 } 49 }