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
d2061861
Commit
d2061861
authored
Nov 02, 2020
by
unset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单核销接口修改
parent
554587d4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
22 deletions
+25
-22
OrderViolationBiz.java
...n/java/com/xxfc/platform/order/biz/OrderViolationBiz.java
+23
-1
OrderViolationController.java
...om/xxfc/platform/order/rest/OrderViolationController.java
+2
-21
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderViolationBiz.java
View file @
d2061861
package
com
.
xxfc
.
platform
.
order
.
biz
;
package
com
.
xxfc
.
platform
.
order
.
biz
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
...
@@ -26,6 +29,7 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -26,6 +29,7 @@ import org.springframework.web.multipart.MultipartFile;
import
java.io.File
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.math.BigInteger
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
...
@@ -36,14 +40,21 @@ import java.util.concurrent.TimeUnit;
...
@@ -36,14 +40,21 @@ import java.util.concurrent.TimeUnit;
*/
*/
@Service
@Service
@Slf4j
@Slf4j
public
class
OrderViolationBiz
extends
BaseBiz
<
OrderViolationMapper
,
OrderViolation
>
{
public
class
OrderViolationBiz
extends
BaseBiz
<
OrderViolationMapper
,
OrderViolation
>
implements
UserRestInterface
{
@Autowired
@Autowired
private
OrderRentVehicleDetailMapper
detailMapper
;
private
OrderRentVehicleDetailMapper
detailMapper
;
@Value
(
"order.violation.upload"
)
@Value
(
"order.violation.upload"
)
private
String
ovUpload
;
private
String
ovUpload
;
@Autowired
UserFeign
userFeign
;
public
static
final
DateTimeFormatter
DEFAULT_DATE_TIME_FORMATTER
=
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd"
);
public
static
final
DateTimeFormatter
DEFAULT_DATE_TIME_FORMATTER
=
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd"
);
@Override
public
UserFeign
getUserFeign
()
{
return
userFeign
;
}
@Autowired
@Autowired
private
RedisTemplate
redisTemplate
;
private
RedisTemplate
redisTemplate
;
...
@@ -55,6 +66,7 @@ public class OrderViolationBiz extends BaseBiz<OrderViolationMapper, OrderViolat
...
@@ -55,6 +66,7 @@ public class OrderViolationBiz extends BaseBiz<OrderViolationMapper, OrderViolat
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
insertOrderViolation
(
OrderViolation
orderViolation
)
{
public
void
insertOrderViolation
(
OrderViolation
orderViolation
)
{
UserDTO
userDTO
=
getBusinessUserByAppUser
();
OrderRentVehicleDetail
orderRentVehicleDetail
=
new
OrderRentVehicleDetail
();
OrderRentVehicleDetail
orderRentVehicleDetail
=
new
OrderRentVehicleDetail
();
orderRentVehicleDetail
.
setId
(
orderViolation
.
getDetailId
());
orderRentVehicleDetail
.
setId
(
orderViolation
.
getDetailId
());
orderRentVehicleDetail
.
setHandelViolation
(
0
);
orderRentVehicleDetail
.
setHandelViolation
(
0
);
...
@@ -62,6 +74,11 @@ public class OrderViolationBiz extends BaseBiz<OrderViolationMapper, OrderViolat
...
@@ -62,6 +74,11 @@ public class OrderViolationBiz extends BaseBiz<OrderViolationMapper, OrderViolat
Integer
orderStatus
=
(
Integer
)
status
.
get
(
"status"
);
Integer
orderStatus
=
(
Integer
)
status
.
get
(
"status"
);
Integer
refundStatus
=
(
Integer
)
status
.
get
(
"refundStatus"
);
Integer
refundStatus
=
(
Integer
)
status
.
get
(
"refundStatus"
);
if
(
orderStatus
>=
6
||
(
refundStatus
<=
2
&&
refundStatus
!=
1
))
{
if
(
orderStatus
>=
6
||
(
refundStatus
<=
2
&&
refundStatus
!=
1
))
{
orderViolation
.
setIsDel
(
0
);
orderViolation
.
setCrtHost
(
getRequest
().
getRemoteHost
());
orderViolation
.
setCrtName
(
userDTO
.
getName
());
orderViolation
.
setCrtUserId
(
userDTO
.
getId
());
orderViolation
.
setCrtTime
(
new
BigInteger
(
String
.
valueOf
(
System
.
currentTimeMillis
())));
insertSelective
(
orderViolation
);
insertSelective
(
orderViolation
);
detailMapper
.
updateByPrimaryKeySelective
(
orderRentVehicleDetail
);
detailMapper
.
updateByPrimaryKeySelective
(
orderRentVehicleDetail
);
}
else
{
}
else
{
...
@@ -77,10 +94,15 @@ public class OrderViolationBiz extends BaseBiz<OrderViolationMapper, OrderViolat
...
@@ -77,10 +94,15 @@ public class OrderViolationBiz extends BaseBiz<OrderViolationMapper, OrderViolat
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateOrderViolation
(
OrderViolation
orderViolation
)
{
public
void
updateOrderViolation
(
OrderViolation
orderViolation
)
{
UserDTO
userDTO
=
getBusinessUserByAppUser
();
Map
<
String
,
Object
>
status
=
mapper
.
getOrderAndVehicleStatus
(
orderViolation
.
getDetailId
());
Map
<
String
,
Object
>
status
=
mapper
.
getOrderAndVehicleStatus
(
orderViolation
.
getDetailId
());
Integer
orderStatus
=
(
Integer
)
status
.
get
(
"status"
);
Integer
orderStatus
=
(
Integer
)
status
.
get
(
"status"
);
Integer
refundStatus
=
(
Integer
)
status
.
get
(
"refundStatus"
);
Integer
refundStatus
=
(
Integer
)
status
.
get
(
"refundStatus"
);
if
(
orderStatus
>=
6
||
(
refundStatus
<=
2
&&
refundStatus
!=
1
))
{
if
(
orderStatus
>=
6
||
(
refundStatus
<=
2
&&
refundStatus
!=
1
))
{
orderViolation
.
setUpdHost
(
getRequest
().
getRemoteHost
());
orderViolation
.
setUpdName
(
userDTO
.
getName
());
orderViolation
.
setUpdUserId
(
userDTO
.
getId
());
orderViolation
.
setUpdTime
(
new
BigInteger
(
String
.
valueOf
(
System
.
currentTimeMillis
())));
updateSelectiveByIdRe
(
orderViolation
);
updateSelectiveByIdRe
(
orderViolation
);
}
else
{
}
else
{
throw
new
BaseException
(
"The operation cannot be changed at this time"
);
throw
new
BaseException
(
"The operation cannot be changed at this time"
);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderViolationController.java
View file @
d2061861
...
@@ -2,8 +2,6 @@ package com.xxfc.platform.order.rest;
...
@@ -2,8 +2,6 @@ package com.xxfc.platform.order.rest;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
...
@@ -21,7 +19,6 @@ import tk.mybatis.mapper.entity.Example;
...
@@ -21,7 +19,6 @@ import tk.mybatis.mapper.entity.Example;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.math.BigInteger
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
@@ -32,17 +29,14 @@ import java.util.List;
...
@@ -32,17 +29,14 @@ import java.util.List;
@RestController
@RestController
@RequestMapping
(
"/app/orderViolation"
)
@RequestMapping
(
"/app/orderViolation"
)
@Slf4j
@Slf4j
public
class
OrderViolationController
extends
BaseController
<
OrderViolationBiz
,
OrderViolation
>
implements
UserRestInterface
{
public
class
OrderViolationController
extends
BaseController
<
OrderViolationBiz
,
OrderViolation
>
{
@Autowired
@Autowired
private
UserFeign
userFeign
;
private
UserFeign
userFeign
;
@Autowired
@Autowired
OrderDepositRefundRecordBiz
orderDepositRefundRecordBiz
;
OrderDepositRefundRecordBiz
orderDepositRefundRecordBiz
;
@Override
public
UserFeign
getUserFeign
()
{
return
userFeign
;
}
private
Long
MAX_DRIVING_LICENSE_SIZE
=
1024
*
1024
*
50L
;
private
Long
MAX_DRIVING_LICENSE_SIZE
=
1024
*
1024
*
50L
;
...
@@ -58,22 +52,9 @@ public class OrderViolationController extends BaseController<OrderViolationBiz,
...
@@ -58,22 +52,9 @@ public class OrderViolationController extends BaseController<OrderViolationBiz,
@PostMapping
(
"/saveOrderViolation"
)
@PostMapping
(
"/saveOrderViolation"
)
public
ObjectRestResponse
saveOrderViolation
(
@RequestBody
OrderViolation
orderViolation
,
HttpServletRequest
request
)
{
public
ObjectRestResponse
saveOrderViolation
(
@RequestBody
OrderViolation
orderViolation
,
HttpServletRequest
request
)
{
log
.
info
(
"保存违章记录:orderViolation = {}"
,
orderViolation
.
toString
());
log
.
info
(
"保存违章记录:orderViolation = {}"
,
orderViolation
.
toString
());
AppUserDTO
userDTO
=
userFeign
.
userDetailByToken
(
request
.
getHeader
(
"Authorization"
)).
getData
();
if
(
userDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
,
"token is null or invalid"
);
}
if
(
orderViolation
.
getId
()
==
null
)
{
if
(
orderViolation
.
getId
()
==
null
)
{
orderViolation
.
setIsDel
(
0
);
orderViolation
.
setCrtHost
(
request
.
getRemoteHost
());
orderViolation
.
setCrtName
(
userDTO
.
getRealname
());
orderViolation
.
setCrtUserId
(
userDTO
.
getId
());
orderViolation
.
setCrtTime
(
new
BigInteger
(
String
.
valueOf
(
System
.
currentTimeMillis
())));
getBaseBiz
().
insertOrderViolation
(
orderViolation
);
getBaseBiz
().
insertOrderViolation
(
orderViolation
);
}
else
{
}
else
{
orderViolation
.
setUpdHost
(
request
.
getRemoteHost
());
orderViolation
.
setUpdName
(
userDTO
.
getRealname
());
orderViolation
.
setUpdUserId
(
userDTO
.
getId
());
orderViolation
.
setUpdTime
(
new
BigInteger
(
String
.
valueOf
(
System
.
currentTimeMillis
())));
getBaseBiz
().
updateOrderViolation
(
orderViolation
);
getBaseBiz
().
updateOrderViolation
(
orderViolation
);
}
}
orderDepositRefundRecordBiz
.
saveViolationDeposit
(
orderViolation
);
orderDepositRefundRecordBiz
.
saveViolationDeposit
(
orderViolation
);
...
...
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