Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
d5507559
Commit
d5507559
authored
Dec 31, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master-invoice-modular' into master-invoice-modular
parents
f5462b4e
e6dbfcac
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
58 additions
and
22 deletions
+58
-22
OrderInvoiceDto.java
...ava/com/xxfc/platform/order/pojo/dto/OrderInvoiceDto.java
+11
-0
OrderInvoiceBiz.java
...ain/java/com/xxfc/platform/order/biz/OrderInvoiceBiz.java
+15
-18
OrderInvoiceMapper.java
...va/com/xxfc/platform/order/mapper/OrderInvoiceMapper.java
+5
-0
OrderInvoiceController.java
.../com/xxfc/platform/order/rest/OrderInvoiceController.java
+11
-4
OrderInvoiceMapper.xml
...r-server/src/main/resources/mapper/OrderInvoiceMapper.xml
+16
-0
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/dto/OrderInvoiceDto.java
0 → 100644
View file @
d5507559
package
com
.
xxfc
.
platform
.
order
.
pojo
.
dto
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
lombok.Data
;
@Data
public
class
OrderInvoiceDto
extends
PageParam
{
private
Integer
type
;
private
Integer
userId
;
private
String
orderIds
;
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderInvoiceBiz.java
View file @
d5507559
...
...
@@ -4,17 +4,19 @@ import com.github.wxiaoqi.security.admin.feign.UserFeign;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.order.entity.BaseOrder
;
import
com.xxfc.platform.order.entity.OrderInvoice
;
import
com.xxfc.platform.order.mapper.OrderInvoiceMapper
;
import
com.xxfc.platform.order.pojo.dto.OrderInvoiceDto
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.HashSet
;
...
...
@@ -110,33 +112,22 @@ public class OrderInvoiceBiz extends BaseBiz<OrderInvoiceMapper, OrderInvoice> {
* 获取用户的发票记录列表
* @return
*/
public
ObjectRestResponse
<
List
<
OrderInvoice
>>
selectByToken
(
Integer
type
)
{
public
ObjectRestResponse
selectByToken
(
OrderInvoiceDto
orderInvoiceDto
)
{
AppUserDTO
appUserDTO
=
userFeign
.
userDetailByToken
(
request
.
getHeader
(
"Authorization"
)).
getData
();
if
(
appUserDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
,
ResultCode
.
getMsg
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
));
}
Example
example
=
new
Example
(
OrderInvoice
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"userId"
,
appUserDTO
.
getUserid
());
if
(
type
!=
null
)
{
criteria
.
andEqualTo
(
"type"
,
type
);
}
return
ObjectRestResponse
.
succ
(
mapper
.
selectByExample
(
example
));
orderInvoiceDto
.
setUserId
(
appUserDTO
.
getUserid
());
return
getByParam
(
orderInvoiceDto
);
}
/**
* 根据用户Id获取用户发票记录
* @param
userId
* @param
* @return
*/
public
ObjectRestResponse
<
List
<
OrderInvoice
>>
selectByUserId
(
Integer
userId
,
Integer
type
)
{
Example
example
=
new
Example
(
OrderInvoice
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"userId"
,
userId
);
if
(
type
!=
null
)
{
criteria
.
andEqualTo
(
"type"
,
type
);
}
return
ObjectRestResponse
.
succ
(
mapper
.
selectByExample
(
example
));
public
ObjectRestResponse
selectByUserId
(
OrderInvoiceDto
orderInvoiceDto
)
{
return
getByParam
(
orderInvoiceDto
);
}
public
ObjectRestResponse
<
OrderInvoice
>
selectByUserIdAndOrderId
(
Integer
userId
,
Integer
orderId
)
{
...
...
@@ -147,4 +138,10 @@ public class OrderInvoiceBiz extends BaseBiz<OrderInvoiceMapper, OrderInvoice> {
}}));
}
public
ObjectRestResponse
<
PageDataVO
<
OrderInvoice
>>
getByParam
(
OrderInvoiceDto
orderInvoiceDto
)
{
Query
query
=
new
Query
(
orderInvoiceDto
);
PageDataVO
<
OrderInvoice
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
getByParam
(
query
.
getSuper
()));
return
ObjectRestResponse
.
succ
(
pageDataVO
);
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mapper/OrderInvoiceMapper.java
View file @
d5507559
...
...
@@ -3,7 +3,12 @@ package com.xxfc.platform.order.mapper;
import
com.xxfc.platform.order.entity.OrderInvoice
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
import
java.util.Map
;
public
interface
OrderInvoiceMapper
extends
Mapper
<
OrderInvoice
>
{
OrderInvoice
selectByUserIdAndOrderId
(
OrderInvoice
orderInvoice
);
List
<
OrderInvoice
>
getByParam
(
Map
<
String
,
Object
>
param
);
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderInvoiceController.java
View file @
d5507559
...
...
@@ -2,8 +2,10 @@ package com.xxfc.platform.order.rest;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.order.biz.OrderInvoiceBiz
;
import
com.xxfc.platform.order.entity.OrderInvoice
;
import
com.xxfc.platform.order.pojo.dto.OrderInvoiceDto
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -26,13 +28,18 @@ public class OrderInvoiceController extends BaseController<OrderInvoiceBiz, Orde
}
@GetMapping
(
value
=
"selectByType"
)
public
ObjectRestResponse
<
List
<
OrderInvoice
>>
selectByToken
(
Integer
type
)
{
return
baseBiz
.
selectByToken
(
type
);
public
ObjectRestResponse
selectByToken
(
OrderInvoiceDto
orderInvoiceDto
)
{
return
baseBiz
.
selectByToken
(
orderInvoiceDto
);
}
@GetMapping
(
value
=
"getByUser"
)
public
ObjectRestResponse
<
List
<
OrderInvoice
>>
selectByUserId
(
Integer
userId
,
Integer
type
)
{
return
baseBiz
.
selectByUserId
(
userId
,
type
);
public
ObjectRestResponse
selectByUserId
(
OrderInvoiceDto
orderInvoiceDto
)
{
return
baseBiz
.
selectByUserId
(
orderInvoiceDto
);
}
@GetMapping
(
value
=
"/getAll"
)
public
ObjectRestResponse
<
PageDataVO
<
OrderInvoice
>>
getByParam
(
OrderInvoiceDto
orderInvoiceDto
)
{
return
baseBiz
.
getByParam
(
orderInvoiceDto
);
}
}
xx-order/xx-order-server/src/main/resources/mapper/OrderInvoiceMapper.xml
View file @
d5507559
...
...
@@ -4,4 +4,20 @@
<select
id=
"selectByUserIdAndOrderId"
parameterType=
"com.xxfc.platform.order.entity.OrderInvoice"
resultType=
"com.xxfc.platform.order.entity.OrderInvoice"
>
select * from order_e_invoice where user_id = #{userId} and order_ids like concat("%", #{orderIds}, "%")
</select>
<select
id=
"getByParam"
parameterType=
"Map"
resultType=
"com.xxfc.platform.order.entity.OrderInvoice"
>
select * from order_e_invoice
<where>
<if
test=
"type != null"
>
and type = #{type}
</if>
<if
test=
"userId != null"
>
and user_id = #{userId}
</if>
<if
test=
"orderIds != null and orderIds != ''"
>
and order_ids like concat("%", #{orderIds}, "%")
</if>
</where>
order by crt_time
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment