Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
ufo-platform
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
caoyan
7 years ago
Commit
aa7534b3c7c68b914eb49c0465b46bce69f75468
1 parent
d588c886
订单管理
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
51 deletions
dal/src/main/java/com/yoho/order/dal/BuyerOrderMapper.java
dal/src/main/resources/META-INF/mybatis/BuyerOrderMapper.xml
order/src/main/java/com/yoho/ufo/order/controller/BuyerOrderController.java
order/src/main/java/com/yoho/ufo/order/service/IBuyerOrderService.java
order/src/main/java/com/yoho/ufo/order/service/impl/BuyerOrderServiceImpl.java
dal/src/main/java/com/yoho/order/dal/BuyerOrderMapper.java
View file @
aa7534b
...
...
@@ -2,9 +2,6 @@ package com.yoho.order.dal;
import
java.util.List
;
import
com.yoho.order.model.BuyerOrder
;
import
com.yohobuy.ufo.model.order.req.BuyerOrderListReq
;
/**
* Created by caoyan on 2018/9/12.
*/
...
...
@@ -12,7 +9,7 @@ public interface BuyerOrderMapper {
int
selectCountByStatus
(
List
<
Byte
>
statusList
);
int
selectTotalByCondition
(
BuyerOrderListReq
req
);
//
int selectTotalByCondition(BuyerOrderListReq req);
List
<
BuyerOrder
>
selectByCondition
(
BuyerOrderListReq
req
);
//
List<BuyerOrder> selectByCondition(BuyerOrderListReq req);
}
...
...
dal/src/main/resources/META-INF/mybatis/BuyerOrderMapper.xml
View file @
aa7534b
...
...
@@ -46,16 +46,14 @@
</if>
</sql>
<select
id=
"selectTotalByCondition"
resultType=
"java.lang.Integer"
parameterType=
"com.yohobuy.ufo.model.order.req.BuyerOrderListReq"
>
<select
id=
"selectTotalByCondition"
resultType=
"java.lang.Integer"
>
select count(1)
from buyer_order
where 1=1
<include
refid=
"Query_Order_Sql"
/>
</select>
<select
id=
"selectByCondition"
resultMap=
"BaseResultMap"
parameterType=
"com.yohobuy.ufo.model.order.req.BuyerOrderListReq"
>
<select
id=
"selectByCondition"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from buyer_order
where 1=1
...
...
order/src/main/java/com/yoho/ufo/order/controller/BuyerOrderController.java
View file @
aa7534b
...
...
@@ -10,9 +10,6 @@ import org.springframework.web.bind.annotation.RestController;
import
com.yoho.ufo.order.service.IBuyerOrderService
;
import
com.yoho.ufo.service.model.ApiResponse
;
import
com.yohobuy.ufo.model.order.req.BuyerOrderListReq
;
import
com.yohobuy.ufo.model.order.resp.BuyerOrderResp
;
import
com.yohobuy.ufo.model.order.resp.PageResponseBO
;
@RestController
@RequestMapping
(
value
=
"/buyerOrder"
)
...
...
@@ -30,10 +27,10 @@ public class BuyerOrderController {
return
new
ApiResponse
.
ApiResponseBuilder
().
code
(
200
).
message
(
"查询成功"
).
data
(
map
).
build
();
}
@RequestMapping
(
value
=
"/queryOrderList"
)
public
ApiResponse
queryOrderList
(
BuyerOrderListReq
req
)
{
LOGGER
.
info
(
"queryOrderList in. req is {}"
,
req
);
PageResponseBO
<
BuyerOrderResp
>
result
=
buyerOrderService
.
queryOrderList
(
req
);
return
new
ApiResponse
.
ApiResponseBuilder
().
code
(
200
).
message
(
"查询成功"
).
data
(
result
).
build
();
}
// @RequestMapping(value = "/queryOrderList")
// public ApiResponse queryOrderList(BuyerOrderListReq req) {
// LOGGER.info("queryOrderList in. req is {}", req);
// PageResponseBO<BuyerOrderResp> result = buyerOrderService.queryOrderList(req);
// return new ApiResponse.ApiResponseBuilder().code(200).message("查询成功").data(result).build();
// }
}
...
...
order/src/main/java/com/yoho/ufo/order/service/IBuyerOrderService.java
View file @
aa7534b
...
...
@@ -2,10 +2,6 @@ package com.yoho.ufo.order.service;
import
java.util.Map
;
import
com.yohobuy.ufo.model.order.req.BuyerOrderListReq
;
import
com.yohobuy.ufo.model.order.resp.BuyerOrderResp
;
import
com.yohobuy.ufo.model.order.resp.PageResponseBO
;
/**
* @author caoyan
* @date 2018/9/13
...
...
@@ -13,5 +9,5 @@ import com.yohobuy.ufo.model.order.resp.PageResponseBO;
public
interface
IBuyerOrderService
{
Map
<
String
,
Integer
>
getCountByJudgeStatus
();
PageResponseBO
<
BuyerOrderResp
>
queryOrderList
(
BuyerOrderListReq
req
);
//
PageResponseBO<BuyerOrderResp> queryOrderList(BuyerOrderListReq req);
}
...
...
order/src/main/java/com/yoho/ufo/order/service/impl/BuyerOrderServiceImpl.java
View file @
aa7534b
...
...
@@ -50,35 +50,36 @@ public class BuyerOrderServiceImpl implements IBuyerOrderService {
return
resultMap
;
}
public
PageResponseBO
<
BuyerOrderResp
>
queryOrderList
(
BuyerOrderListReq
req
)
{
int
total
=
buyerOrderMapper
.
selectTotalByCondition
(
req
);
if
(
total
==
0
)
{
return
null
;
}
// public PageResponseBO<BuyerOrderResp> queryOrderList(BuyerOrderListReq req) {
// int total = buyerOrderMapper.selectTotalByCondition(req);
// if(total == 0) {
// return null;
// }
//
// List<BuyerOrder> orderList = buyerOrderMapper.selectByCondition(req);
// if(CollectionUtils.isEmpty(orderList)) {
// return null;
// }
//
// List<BuyerOrderResp> respList = Lists.newArrayList();
// for(BuyerOrder item : orderList) {
// BuyerOrderResp resp = new BuyerOrderResp();
// resp.setOrderCode(item.getOrderCode());
// resp.setStatus(item.getStatus());
// resp.setCreateTimeStr(DateUtil.long2DateStr(item.getCreateTime()*1000, "yyyy-MM-dd HH:mm:ss"));
//
// respList.add(resp);
// }
//
// PageResponseBO<BuyerOrderResp> result=new PageResponseBO<>();
// result.setList(respList);
// result.setPage(req.getPage());
// result.setSize(req.getSize());
// result.setTotal(total);
//
// return result;
List
<
BuyerOrder
>
orderList
=
buyerOrderMapper
.
selectByCondition
(
req
);
if
(
CollectionUtils
.
isEmpty
(
orderList
))
{
return
null
;
}
List
<
BuyerOrderResp
>
respList
=
Lists
.
newArrayList
();
for
(
BuyerOrder
item
:
orderList
)
{
BuyerOrderResp
resp
=
new
BuyerOrderResp
();
resp
.
setOrderCode
(
item
.
getOrderCode
());
resp
.
setStatus
(
item
.
getStatus
());
resp
.
setCreateTimeStr
(
DateUtil
.
long2DateStr
(
item
.
getCreateTime
()*
1000
,
"yyyy-MM-dd HH:mm:ss"
));
respList
.
add
(
resp
);
}
PageResponseBO
<
BuyerOrderResp
>
result
=
new
PageResponseBO
<>();
result
.
setList
(
respList
);
result
.
setPage
(
req
.
getPage
());
result
.
setSize
(
req
.
getSize
());
result
.
setTotal
(
total
);
return
result
;
}
// }
}
...
...
Please
register
or
login
to post a comment