|
@@ -29,13 +29,14 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
* @email 771190883@qq.com
|
|
* @email 771190883@qq.com
|
|
|
* @date 2019-10-11 15:44:20
|
|
* @date 2019-10-11 15:44:20
|
|
|
*/
|
|
*/
|
|
|
-@Api(value = "订单表接口", tags = {"订单表接口" })
|
|
|
|
|
|
|
+@Api(value = "订单表接口", tags = {"订单表接口"})
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("business/Order")
|
|
@RequestMapping("business/Order")
|
|
|
public class OrderController extends BaseController {
|
|
public class OrderController extends BaseController {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private OrderService orderService;
|
|
private OrderService orderService;
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* <p>根据Id。</p>
|
|
* <p>根据Id。</p>
|
|
|
*/
|
|
*/
|
|
@@ -43,9 +44,10 @@ public class OrderController extends BaseController {
|
|
|
@RequestMapping(value = "/get/{id}", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/get/{id}", method = RequestMethod.GET)
|
|
|
public Result getOrderEntity(@PathVariable("id") String id) {
|
|
public Result getOrderEntity(@PathVariable("id") String id) {
|
|
|
|
|
|
|
|
- Order data = orderService.getById(id);
|
|
|
|
|
|
|
+ Order data = orderService.getById(id);
|
|
|
return Result.success(true, data);
|
|
return Result.success(true, data);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* <p>分页查询。</p>
|
|
* <p>分页查询。</p>
|
|
|
*/
|
|
*/
|
|
@@ -62,22 +64,22 @@ public class OrderController extends BaseController {
|
|
|
return Result.success(true, result);
|
|
return Result.success(true, result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
|
|
+ /**
|
|
|
* <p>excel。</p>
|
|
* <p>excel。</p>
|
|
|
*/
|
|
*/
|
|
|
@ApiOperation(value = "分页获取订单表数据", notes = "根据条件获取")
|
|
@ApiOperation(value = "分页获取订单表数据", notes = "根据条件获取")
|
|
|
@RequestMapping(value = "/excel", method = RequestMethod.GET)
|
|
@RequestMapping(value = "/excel", method = RequestMethod.GET)
|
|
|
- public void excel( HttpServletResponse response) {
|
|
|
|
|
|
|
+ public void excel(HttpServletResponse response) {
|
|
|
|
|
|
|
|
List<Order> allList = orderService.getAllList(null);
|
|
List<Order> allList = orderService.getAllList(null);
|
|
|
- allList.stream().forEach(o ->{
|
|
|
|
|
|
|
+ allList.stream().forEach(o -> {
|
|
|
orderService.FullOrderInfo(o);
|
|
orderService.FullOrderInfo(o);
|
|
|
o.setShopName(o.getOrderSkus().get(0).getSkuName());
|
|
o.setShopName(o.getOrderSkus().get(0).getSkuName());
|
|
|
});
|
|
});
|
|
|
try {
|
|
try {
|
|
|
- List<Object> exchangeCodes = new ArrayList<>();
|
|
|
|
|
- if (!exchangeCodes.isEmpty()) {
|
|
|
|
|
- String excelName = "商城全部订单" ;
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (!allList.isEmpty()) {
|
|
|
|
|
+ String excelName = "商城全部订单";
|
|
|
LinkedHashMap<String, String> fieldMap = new LinkedHashMap<String, String>();
|
|
LinkedHashMap<String, String> fieldMap = new LinkedHashMap<String, String>();
|
|
|
fieldMap.put("orderCode", "订单号");
|
|
fieldMap.put("orderCode", "订单号");
|
|
|
fieldMap.put("billNo", "银联单号");
|
|
fieldMap.put("billNo", "银联单号");
|
|
@@ -91,7 +93,7 @@ public class OrderController extends BaseController {
|
|
|
fieldMap.put("status", "订单状态");
|
|
fieldMap.put("status", "订单状态");
|
|
|
fieldMap.put("originalPrice", "实付金额");
|
|
fieldMap.put("originalPrice", "实付金额");
|
|
|
fieldMap.put("source", "来源");
|
|
fieldMap.put("source", "来源");
|
|
|
- ExcelPoiUtil.export(excelName, exchangeCodes, fieldMap, response);
|
|
|
|
|
|
|
+ ExcelPoiUtil.export(excelName, allList, fieldMap, response);
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
|
|
|