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
cb4730b7
Commit
cb4730b7
authored
Nov 04, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
6e325d61
167d7660
Changes
47
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
47 changed files
with
683 additions
and
478 deletions
+683
-478
AppUserPhoneNotes.java
...thub/wxiaoqi/security/admin/entity/AppUserPhoneNotes.java
+37
-0
AppUserLoginBiz.java
...om/github/wxiaoqi/security/admin/biz/AppUserLoginBiz.java
+6
-6
AppUserPhoneNotesBiz.java
...thub/wxiaoqi/security/admin/biz/AppUserPhoneNotesBiz.java
+17
-0
AppUserRelationBiz.java
...github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
+4
-1
AppUserPhoneNotesMapper.java
...xiaoqi/security/admin/mapper/AppUserPhoneNotesMapper.java
+11
-0
AppUserController.java
...github/wxiaoqi/security/admin/rest/AppUserController.java
+2
-1
AppUserRelationController.java
...xiaoqi/security/admin/rest/AppUserRelationController.java
+4
-2
AppUserRest.java
...va/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
+1
-2
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+17
-7
TimeMinimumSubdivisionEnum.java
...m/order/contant/enumerate/TimeMinimumSubdivisionEnum.java
+24
-0
DailyOrderStatistics.java
.../com/xxfc/platform/order/entity/DailyOrderStatistics.java
+1
-1
DailyTravelOrderStatistics.java
...xfc/platform/order/entity/DailyTravelOrderStatistics.java
+2
-2
DailyVehicleOrderStatistics.java
...fc/platform/order/entity/DailyVehicleOrderStatistics.java
+10
-9
OrderStatistics.java
.../java/com/xxfc/platform/order/entity/OrderStatistics.java
+10
-10
HomePageOrderData.java
.../java/com/xxfc/platform/order/pojo/HomePageOrderData.java
+3
-3
Term.java
...-api/src/main/java/com/xxfc/platform/order/pojo/Term.java
+46
-0
DailyMembersOrderStatisticsBiz.java
...fc/platform/order/biz/DailyMembersOrderStatisticsBiz.java
+46
-32
DailyOrderStatisticsBiz.java
.../com/xxfc/platform/order/biz/DailyOrderStatisticsBiz.java
+3
-4
DailyTravelOrderStatisticsBiz.java
...xfc/platform/order/biz/DailyTravelOrderStatisticsBiz.java
+37
-81
DailyVehicleOrderStatisticsBiz.java
...fc/platform/order/biz/DailyVehicleOrderStatisticsBiz.java
+77
-175
OrderAccountBiz.java
...ain/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
+4
-4
OrderStatisticsBiz.java
.../java/com/xxfc/platform/order/biz/OrderStatisticsBiz.java
+165
-38
OrderVehicleCrosstownBiz.java
...com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
+12
-9
DailyMembersOrderStatisticsMapper.java
...tform/order/mapper/DailyMembersOrderStatisticsMapper.java
+1
-1
DailyTravelOrderStatisticsMapper.java
...atform/order/mapper/DailyTravelOrderStatisticsMapper.java
+1
-1
DailyVehicleOrderStatisticsMapper.java
...tform/order/mapper/DailyVehicleOrderStatisticsMapper.java
+1
-1
OrderAccountMapper.java
...va/com/xxfc/platform/order/mapper/OrderAccountMapper.java
+2
-1
OrderStatisticsController.java
...form/order/rest/background/OrderStatisticsController.java
+20
-51
DailyMembersOrderStatisticsMapper.xml
...in/resources/mapper/DailyMembersOrderStatisticsMapper.xml
+5
-3
DailyTravelOrderStatisticsMapper.xml
...ain/resources/mapper/DailyTravelOrderStatisticsMapper.xml
+5
-2
DailyVehicleOrderStatisticsMapper.xml
...in/resources/mapper/DailyVehicleOrderStatisticsMapper.xml
+6
-3
OrderAccountMapper.xml
...r-server/src/main/resources/mapper/OrderAccountMapper.xml
+32
-7
ServiceTest.java
xx-order/xx-order-server/src/test/java/ServiceTest.java
+1
-1
BJCYAuthentication.java
...vice/authenticationInterface/impl/BJCYAuthentication.java
+0
-12
XCFQAuthentication.java
...vice/authenticationInterface/impl/XCFQAuthentication.java
+1
-1
ResCode.java
...a/com/xxfc/platform/vehicle/constant/ResCode/ResCode.java
+2
-0
Vehicle.java
...c/main/java/com/xxfc/platform/vehicle/entity/Vehicle.java
+11
-0
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+2
-0
AddOrUpdateVehicleVo.java
.../com/xxfc/platform/vehicle/pojo/AddOrUpdateVehicleVo.java
+3
-0
VehiclePageQueryVo.java
...va/com/xxfc/platform/vehicle/pojo/VehiclePageQueryVo.java
+2
-0
BranchCompanyBiz.java
.../java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
+4
-0
VehicleActiveService.java
...a/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
+4
-4
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+19
-0
BranchCompanyController.java
...m/xxfc/platform/vehicle/rest/BranchCompanyController.java
+10
-0
VehicleActiveController.java
...m/xxfc/platform/vehicle/rest/VehicleActiveController.java
+4
-1
VehicleController.java
...ava/com/xxfc/platform/vehicle/rest/VehicleController.java
+6
-0
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+2
-2
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/AppUserPhoneNotes.java
0 → 100644
View file @
cb4730b7
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
/**
* 手机号码记录表
*/
@Table
(
name
=
"app_user_phone_notes"
)
@Data
public
class
AppUserPhoneNotes
{
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
private
Integer
id
;
@ApiModelProperty
(
"用户id"
)
@Column
(
name
=
"user_id"
)
private
Integer
userId
;
@ApiModelProperty
(
"旧手机号码"
)
@Column
(
name
=
"old_phone"
)
private
String
oldPhone
;
@ApiModelProperty
(
"新手机号码"
)
@Column
(
name
=
"new_phone"
)
private
String
newPhone
;
@ApiModelProperty
(
"创建时间"
)
@Column
(
name
=
"crt_time"
)
private
Long
crtTime
;
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserLoginBiz.java
View file @
cb4730b7
...
...
@@ -344,7 +344,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
default
:
break
;
}
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
(
accountBindDTO
.
getNickName
()
);
}
/**
...
...
@@ -354,14 +354,14 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
*/
private
void
wxBinding
(
AccountBindDTO
accountBindDTO
,
Integer
userId
)
{
//检查微信是否绑定
Example
example
=
new
Example
(
AppUserLogin
.
class
);
/*
Example example = new Example(AppUserLogin.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("id", userId);
criteria.andEqualTo("wxOpenid", accountBindDTO.getOpendId());
List<AppUserLogin> appUserLogins = mapper.selectByExample(example);
if (CollectionUtils.isNotEmpty(appUserLogins)) {
throw new BaseException("该微信已经绑定过了");
}
}
*/
AppUserLogin
appUserLogin
=
new
AppUserLogin
();
appUserLogin
.
setId
(
userId
);
...
...
@@ -378,14 +378,14 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
*/
private
void
qqBinding
(
AccountBindDTO
accountBindDTO
,
Integer
userId
)
{
//检查qq是否绑定
Example
example
=
new
Example
(
AppUserLogin
.
class
);
/*
Example example = new Example(AppUserLogin.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("id", userId);
criteria.andEqualTo("openid", accountBindDTO.getOpendId());
List<AppUserLogin> appUserLogins = mapper.selectByExample(example);
if (CollectionUtils.isNotEmpty(appUserLogins)) {
throw
new
BaseException
(
"该
微信
已经绑定过了"
);
}
throw new BaseException("该
qq
已经绑定过了");
}
*/
AppUserLogin
appUserLogin
=
new
AppUserLogin
();
appUserLogin
.
setId
(
userId
);
appUserLogin
.
setWxOpenid
(
accountBindDTO
.
getOpendId
());
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserPhoneNotesBiz.java
0 → 100644
View file @
cb4730b7
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.github.wxiaoqi.security.admin.entity.AppUserPhoneNotes
;
import
com.github.wxiaoqi.security.admin.mapper.AppUserPhoneNotesMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.springframework.stereotype.Service
;
/**
* @author keliii
*/
@Service
public
class
AppUserPhoneNotesBiz
extends
BaseBiz
<
AppUserPhoneNotesMapper
,
AppUserPhoneNotes
>
{
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
View file @
cb4730b7
...
...
@@ -214,9 +214,12 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
public
AppUserRelation
getRelationByIdUserIdAndTime
(
Integer
userId
){
AppUserRelation
userRelation
=
getMyBiz
().
getRelationByUserId
(
userId
);
if
(
userRelation
==
null
){
return
null
;
return
null
;
}
log
.
info
(
"---userId==="
+
userId
+
"-----isForever==="
+
userRelation
.
getIsForever
());
if
(
validTime
==
null
||
validTime
==
0
){
return
userRelation
;
}
Long
time
=
System
.
currentTimeMillis
()-
validTime
;
if
(
userRelation
.
getIsForever
()==
1
||
userRelation
.
getBindTime
()>
time
){
return
userRelation
;
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserPhoneNotesMapper.java
0 → 100644
View file @
cb4730b7
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.entity.AppUserPhoneNotes
;
import
tk.mybatis.mapper.additional.idlist.SelectByIdListMapper
;
import
tk.mybatis.mapper.common.Mapper
;
public
interface
AppUserPhoneNotesMapper
extends
Mapper
<
AppUserPhoneNotes
>,
SelectByIdListMapper
<
AppUserPhoneNotes
,
Integer
>
{
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUserController.java
View file @
cb4730b7
...
...
@@ -229,6 +229,7 @@ public class AppUserController extends CommonBaseController{
appUserAlipayBiz
.
getUserInfo
(
userVo
.
getAliCode
(),
request
);
}
}
return
ObjectRestResponse
.
succ
();
}
...
...
@@ -337,7 +338,7 @@ public class AppUserController extends CommonBaseController{
}
@PostMapping
(
"/bind"
)
private
ObjectRestResponse
accountBinding
(
AccountBindDTO
accountBindDTO
,
HttpServletRequest
request
){
private
ObjectRestResponse
accountBinding
(
@RequestBody
AccountBindDTO
accountBindDTO
,
HttpServletRequest
request
){
try
{
IJWTInfo
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
));
return
appUserLoginBiz
.
bindAccount
(
accountBindDTO
,
Integer
.
valueOf
(
infoFromToken
.
getId
()),
request
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUserRelationController.java
View file @
cb4730b7
...
...
@@ -45,8 +45,10 @@ public class AppUserRelationController extends BaseController<AppUserRelationBiz
@RequestParam
(
value
=
"code"
,
defaultValue
=
""
)
String
code
,
HttpServletRequest
request
){
try
{
Integer
userid
=
Integer
.
parseInt
(
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
)).
getId
());
return
baseBiz
.
appBindRelation
(
userid
,
code
);
//屏蔽分享绑定
/*Integer userid = Integer.parseInt(userAuthUtil.getInfoFromToken(userAuthConfig.getToken(request)).getId());
return baseBiz.appBindRelation(userid,code);*/
return
ObjectRestResponse
.
succ
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
BaseException
(
e
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/AppUserRest.java
View file @
cb4730b7
...
...
@@ -255,7 +255,7 @@ public class AppUserRest {
@ApiModelProperty
(
"检查手机号验证码"
)
@GetMapping
(
"/unauth/checkMobilecode"
)
public
ObjectRestResponse
checkMobilecode
(
@RequestParam
(
value
=
"phone"
)
String
phone
,
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
)
{
@RequestParam
(
value
=
"mobilecode"
)
String
mobilecode
)
{
if
(
StringUtils
.
isBlank
(
phone
)
||
StringUtils
.
isBlank
(
mobilecode
))
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
}
...
...
@@ -264,7 +264,6 @@ public class AppUserRest {
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"验证码错误"
);
}
return
ObjectRestResponse
.
succ
();
}
@ApiModelProperty
(
"修改手机号码"
)
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
cb4730b7
...
...
@@ -10,10 +10,7 @@ import com.github.wxiaoqi.security.admin.dto.BaseUserMemberExportDTO;
import
com.github.wxiaoqi.security.admin.dto.RegisterParamDTO
;
import
com.github.wxiaoqi.security.admin.dto.RegisterQueueDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.entity.AppUser
;
import
com.github.wxiaoqi.security.admin.entity.AppUserDetail
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.entity.Element
;
import
com.github.wxiaoqi.security.admin.entity.*
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.admin.vo.ImiVo
;
import
com.github.wxiaoqi.security.api.vo.authority.PermissionInfo
;
...
...
@@ -111,6 +108,9 @@ public class AppPermissionService {
@Value
(
"${admin.smallName}"
)
private
String
smallName
;
@Autowired
private
AppUserPhoneNotesBiz
notesBiz
;
public
AppUserInfo
validate
(
String
username
,
String
password
)
{
AppUserInfo
info
=
new
AppUserInfo
();
...
...
@@ -434,13 +434,14 @@ public class AppPermissionService {
if
(
type
!=
null
&&
type
==
1
){
try
{
Integer
parentId
=
0
;
if
(
StringUtils
.
isNotBlank
(
code
))
{
//屏蔽app登录的绑定关系
/*if (StringUtils.isNotBlank(code)) {
parentId = appUserDetailBiz.getUserByCode(code);
}
//绑定上下线关系
if (parentId != null && parentId > 0) {
relationBiz.bindRelation(userid, parentId, 1);
}
}
*/
//活动消息
Integer
state
=
userVo
.
getState
();
log
.
info
(
"-----------autoLogin----state==="
+
state
);
...
...
@@ -1147,12 +1148,21 @@ public class AppPermissionService {
// 是否已存在
AppUserLogin
user
=
appUserLoginBiz
.
checkeUserLogin
(
username
);
if
(
null
!=
user
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
EXIST_CODE
,
"用户已存在"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
EXIST_CODE
,
"手机号已存在"
);
}
user
=
appUserLoginBiz
.
selectById
(
userId
);
if
(
user
==
null
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
EXIST_CODE
,
"用户不存在"
);
}
AppUserLogin
userLogin
=
new
AppUserLogin
();
userLogin
.
setId
(
userId
);
userLogin
.
setUsername
(
username
);
appUserLoginBiz
.
disable
(
userLogin
);
AppUserPhoneNotes
notes
=
new
AppUserPhoneNotes
();
notes
.
setUserId
(
userId
);
notes
.
setNewPhone
(
username
);
notes
.
setOldPhone
(
user
.
getUsername
());
notesBiz
.
insertSelective
(
notes
);
return
ObjectRestResponse
.
succ
();
}
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/contant/enumerate/TimeMinimumSubdivisionEnum.java
0 → 100644
View file @
cb4730b7
package
com
.
xxfc
.
platform
.
order
.
contant
.
enumerate
;
/**
* 查询时间段最小细分(时间段内又划分的片段)
*/
public
enum
TimeMinimumSubdivisionEnum
{
nothing
(
0
,
"无细分"
),
day
(
1
,
"最小细分到天"
)
;
private
int
code
;
private
String
msg
;
public
String
getMsg
()
{
return
msg
;
}
TimeMinimumSubdivisionEnum
(
int
code
,
String
msg
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
}
public
Integer
getCode
()
{
return
code
;
}
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/DailyOrderStatistics.java
View file @
cb4730b7
...
...
@@ -40,7 +40,7 @@ public class DailyOrderStatistics implements Serializable {
* 成交总金额
*/
@Column
(
name
=
"gmv"
)
private
BigDecimal
gmv
;
private
BigDecimal
gmv
=
BigDecimal
.
ZERO
;
/**
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/DailyTravelOrderStatistics.java
View file @
cb4730b7
...
...
@@ -18,10 +18,10 @@ public class DailyTravelOrderStatistics extends DailyOrderStatistics {
* 违约总额
*/
@Column
(
name
=
"default_money "
)
private
BigDecimal
defaultMoney
;
private
BigDecimal
defaultMoney
=
BigDecimal
.
ZERO
;
/**
* 退还订单金额
*/
@Column
(
name
=
"return_gmv"
)
private
BigDecimal
returnGmv
;
private
BigDecimal
returnGmv
=
BigDecimal
.
ZERO
;
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/DailyVehicleOrderStatistics.java
View file @
cb4730b7
...
...
@@ -29,32 +29,32 @@ public class DailyVehicleOrderStatistics extends DailyOrderStatistics {
* 预交押金总额
*/
@Column
(
name
=
"security_deposit"
)
private
BigDecimal
securityDeposit
;
private
BigDecimal
securityDeposit
=
BigDecimal
.
ZERO
;
/**
* 退还押金总额
*/
@Column
(
name
=
"refund_security_deposit"
)
private
BigDecimal
refundSecurityDeposit
;
private
BigDecimal
refundSecurityDeposit
=
BigDecimal
.
ZERO
;
/**
* 损坏赔偿总额
*/
@Column
(
name
=
"compensation"
)
private
BigDecimal
compensation
;
private
BigDecimal
compensation
=
BigDecimal
.
ZERO
;
/**
* 违章总额
*/
@Column
(
name
=
"forfeit"
)
private
BigDecimal
violationMoney
;
private
BigDecimal
forfeit
=
BigDecimal
.
ZERO
;
/**
* 退还订单金额
*/
@Column
(
name
=
"return_gmv"
)
private
BigDecimal
returnGmv
;
private
BigDecimal
returnGmv
=
BigDecimal
.
ZERO
;
...
...
@@ -70,13 +70,14 @@ public class DailyVehicleOrderStatistics extends DailyOrderStatistics {
* 违约总额
*/
@Column
(
name
=
"default_money "
)
private
BigDecimal
defaultMoney
;
private
BigDecimal
defaultMoney
=
BigDecimal
.
ZERO
;
/**
*
消费金总额
*
订单补偿
*/
@Column
(
name
=
"
total_expenditure
"
)
private
BigDecimal
totalExpenditure
;
@Column
(
name
=
"
order_compensation
"
)
private
BigDecimal
orderCompensation
=
BigDecimal
.
ZERO
;
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/OrderStatistics.java
View file @
cb4730b7
...
...
@@ -22,48 +22,48 @@ public class OrderStatistics {
* 历史交总金额
*/
@ApiModelProperty
(
value
=
"历史交易总金额"
)
private
BigDecimal
totalGmv
;
private
BigDecimal
totalGmv
=
BigDecimal
.
ZERO
;
/**
* 历史押金总额
*/
@ApiModelProperty
(
value
=
"历史押金总额"
)
private
BigDecimal
totalSecurityDeposit
;
private
BigDecimal
totalSecurityDeposit
=
BigDecimal
.
ZERO
;
/**
* 历史退还押金总额
*/
@ApiModelProperty
(
value
=
"历史退还押金总额"
)
private
BigDecimal
totalRefundSecurityDeposit
;
private
BigDecimal
totalRefundSecurityDeposit
=
BigDecimal
.
ZERO
;
/**
* 历史赔偿总额
*/
@ApiModelProperty
(
value
=
"历史赔偿总额"
)
private
BigDecimal
totalCompensation
;
private
BigDecimal
totalCompensation
=
BigDecimal
.
ZERO
;
/**
* 历史违章总额
*/
@ApiModelProperty
(
value
=
"历史违章总额"
)
private
BigDecimal
totalForfeit
;
private
BigDecimal
totalForfeit
=
BigDecimal
.
ZERO
;
/**
* 历史订单退款
*/
@ApiModelProperty
(
value
=
"历史订单退款"
)
private
BigDecimal
totalReturnGmv
;
private
BigDecimal
totalReturnGmv
=
BigDecimal
.
ZERO
;
/**
* 历史延期扣款总额
*/
@ApiModelProperty
(
value
=
"历史延期扣款总额"
)
private
BigDecimal
totalDefaultMoney
;
private
BigDecimal
totalDefaultMoney
=
BigDecimal
.
ZERO
;
/**
*
历史实际消费
总额
*
订单补偿
总额
*/
@ApiModelProperty
(
value
=
"历史
实际消费
总额"
)
private
BigDecimal
total
Expenditure
;
@ApiModelProperty
(
value
=
"历史
订单补偿
总额"
)
private
BigDecimal
total
OrderCompensation
=
BigDecimal
.
ZERO
;
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/HomePageOrderData.java
View file @
cb4730b7
...
...
@@ -10,16 +10,16 @@ public class HomePageOrderData {
/**
* 订单总额
*/
private
BigDecimal
totalOrders
;
private
BigDecimal
totalOrders
=
BigDecimal
.
ZERO
;
/**
* 未退还退还押金总额
*/
private
BigDecimal
totalOutstandingDeposit
;
private
BigDecimal
totalOutstandingDeposit
=
BigDecimal
.
ZERO
;
/**
* 额外赔款
*/
private
BigDecimal
additionalIndemnity
;
private
BigDecimal
additionalIndemnity
=
BigDecimal
.
ZERO
;
@Override
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/Term.java
0 → 100644
View file @
cb4730b7
package
com
.
xxfc
.
platform
.
order
.
pojo
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@Data
@NoArgsConstructor
@AllArgsConstructor
public
class
Term
{
/**
* 订单类型
*/
private
Integer
orderType
;
/**
* 几天前(用于判断计算几天前的数据) subdivide=2的实际存在
*/
private
Integer
day
;
/**
* 时间最小细分类型(最小细分到天,无细分)
*/
private
int
subdivide
;
/**
* 开始时间
*/
private
Long
startTime
;
/**
* 结束时间
*/
private
Long
endTime
;
/**
* 分公司id 数组
*/
private
List
<
Integer
>
companyIds
;
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/DailyMembersOrderStatisticsBiz.java
View file @
cb4730b7
...
...
@@ -10,6 +10,7 @@ import com.xxfc.platform.order.entity.OrderAccount;
import
com.xxfc.platform.order.entity.OrderStatistics
;
import
com.xxfc.platform.order.mapper.DailyMembersOrderStatisticsMapper
;
import
com.xxfc.platform.order.pojo.OrderQuery
;
import
com.xxfc.platform.order.pojo.Term
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDTO
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDetail
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -43,50 +44,61 @@ public class DailyMembersOrderStatisticsBiz extends BaseBiz<DailyMembersOrderSta
/**
* 总公司id默认为1
*/
private
final
Integer
OMPANY_ID
=
1
;
private
final
Integer
OMPANY_ID
=
1
;
@Autowired
private
OrderAccountBiz
accountBiz
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
saveD
ailyMembersOrderRecord
(
Integer
day
)
{
public
boolean
d
ailyMembersOrderRecord
(
Integer
day
)
{
try
{
List
<
OrderAccountDTO
>
accountList
=
accountBiz
.
getOrderAccountByOrderType
(
OrderTypeEnum
.
MEMBER
.
getCode
(),
day
);
if
(
CollectionUtils
.
isNotEmpty
(
accountList
))
{
DailyMembersOrderStatistics
orderStatistics
=
new
DailyMembersOrderStatistics
();
ArrayList
<
OrderAccountDetail
>
orderAccountDetails
=
getOrderAccountDetail
(
accountList
);
if
(
CollectionUtils
.
isNotEmpty
(
orderAccountDetails
))
{
//获取订单总额
BigDecimal
gmv
=
getOrderAmountTotal
(
orderAccountDetails
);
orderStatistics
.
setGmv
(
gmv
);
orderStatistics
.
setBranchCompanyId
(
OMPANY_ID
);
orderStatistics
.
setOneDay
(
accountList
.
get
(
0
).
getOneDay
());
}
log
.
info
(
"Members:统计完成"
);
if
(
JudgmentOfExistence
(
orderStatistics
))
{
insertSelectiveRe
(
orderStatistics
);
}
else
{
mapper
.
updateByExampleSelective
(
orderStatistics
,
Example
.
builder
(
DailyMembersOrderStatistics
.
class
)
.
where
(
WeekendSqls
.<
DailyMembersOrderStatistics
>
custom
()
.
andEqualTo
(
DailyMembersOrderStatistics:
:
getOneDay
,
orderStatistics
.
getOneDay
())
.
andEqualTo
(
DailyMembersOrderStatistics:
:
getBranchCompanyId
,
orderStatistics
.
getBranchCompanyId
()))
.
build
());
}
log
.
info
(
"Members:保存成功"
);
}
DailyMembersOrderStatistics
orderStatistics
=
statistics
(
new
Term
(
OrderTypeEnum
.
MEMBER
.
getCode
(),
day
,
1
,
null
,
null
,
null
));
log
.
info
(
"Members:统计完成"
);
save
(
orderStatistics
);
log
.
info
(
"Members:保存成功"
);
return
true
;
}
catch
(
Exception
e
)
{
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
log
.
error
(
"Members:"
+
e
.
getMessage
());
log
.
error
(
"Members:"
+
e
.
getMessage
());
return
false
;
}
}
public
void
save
(
DailyMembersOrderStatistics
orderStatistics
)
{
if
(
orderStatistics
!=
null
)
{
if
(
JudgmentOfExistence
(
orderStatistics
))
{
insertSelectiveRe
(
orderStatistics
);
}
else
{
mapper
.
updateByExampleSelective
(
orderStatistics
,
Example
.
builder
(
DailyMembersOrderStatistics
.
class
)
.
where
(
WeekendSqls
.<
DailyMembersOrderStatistics
>
custom
()
.
andEqualTo
(
DailyMembersOrderStatistics:
:
getOneDay
,
orderStatistics
.
getOneDay
())
.
andEqualTo
(
DailyMembersOrderStatistics:
:
getBranchCompanyId
,
orderStatistics
.
getBranchCompanyId
()))
.
build
());
}
}
}
public
DailyMembersOrderStatistics
statistics
(
Term
term
)
{
List
<
OrderAccountDTO
>
accountList
=
accountBiz
.
getOrderAccountByOrderType
(
term
);
if
(
CollectionUtils
.
isNotEmpty
(
accountList
))
{
DailyMembersOrderStatistics
orderStatistics
=
new
DailyMembersOrderStatistics
();
ArrayList
<
OrderAccountDetail
>
orderAccountDetails
=
getOrderAccountDetail
(
accountList
);
if
(
CollectionUtils
.
isNotEmpty
(
orderAccountDetails
))
{
//获取订单总额
BigDecimal
gmv
=
getOrderAmountTotal
(
orderAccountDetails
);
orderStatistics
.
setGmv
(
gmv
);
orderStatistics
.
setBranchCompanyId
(
OMPANY_ID
);
orderStatistics
.
setOneDay
(
accountList
.
get
(
0
).
getOneDay
());
}
return
orderStatistics
;
}
return
null
;
}
/**
* 添加前查询是否存在这条数据
*
* @param orderStatistic
* @return
*/
...
...
@@ -101,6 +113,7 @@ public class DailyMembersOrderStatisticsBiz extends BaseBiz<DailyMembersOrderSta
}
return
true
;
}
/**
* 获取押金和
*
...
...
@@ -143,16 +156,17 @@ public class DailyMembersOrderStatisticsBiz extends BaseBiz<DailyMembersOrderSta
return
mapper
.
insertSelective
(
entity
);
}
public
OrderStatistics
findAll
(
Integer
companyId
)
{
return
mapper
.
monthOrderTotal
(
companyId
);
public
OrderStatistics
findAll
(
List
<
Integer
>
companyIds
)
{
return
mapper
.
monthOrderTotal
(
companyId
s
);
}
/**
* 根据时间按年月日分组
*
* @param query
* @return
*/
public
List
<
MembersOrder
>
getMemberOrderStatistics
(
OrderQuery
query
)
{
return
mapper
.
getMemberOrderStatistics
(
query
);
return
mapper
.
getMemberOrderStatistics
(
query
);
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/DailyOrderStatisticsBiz.java
View file @
cb4730b7
...
...
@@ -25,11 +25,10 @@ public class DailyOrderStatisticsBiz extends BaseBiz<DailyOrderStatisticsMapper,
@Autowired
private
DailyMembersOrderStatisticsBiz
membersStatisticsBiz
;
// @Scheduled(cron = "0 0 2 * * ?")
public
boolean
statisticalOrder
(
Integer
day
){
boolean
vehicleFlag
=
vehicleStatisticsBiz
.
saveD
ailyVehicleOrderRecord
(
day
);
boolean
travelFlag
=
travelStatisticsBiz
.
saveD
ailyTravelOrderRecord
(
day
);
boolean
membersFlag
=
membersStatisticsBiz
.
saveD
ailyMembersOrderRecord
(
day
);
boolean
vehicleFlag
=
vehicleStatisticsBiz
.
d
ailyVehicleOrderRecord
(
day
);
boolean
travelFlag
=
travelStatisticsBiz
.
d
ailyTravelOrderRecord
(
day
);
boolean
membersFlag
=
membersStatisticsBiz
.
d
ailyMembersOrderRecord
(
day
);
if
(
vehicleFlag
&&
travelFlag
&&
membersFlag
){
log
.
info
(
"----statisticalOrder:成功-----"
);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/DailyTravelOrderStatisticsBiz.java
View file @
cb4730b7
...
...
@@ -12,6 +12,7 @@ import com.xxfc.platform.order.contant.enumerate.DeductionTypeEnum;
import
com.xxfc.platform.order.contant.enumerate.OrderTypeEnum
;
import
com.xxfc.platform.order.entity.*
;
import
com.xxfc.platform.order.mapper.DailyTravelOrderStatisticsMapper
;
import
com.xxfc.platform.order.pojo.Term
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDTO
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDeduction
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDetail
;
...
...
@@ -43,89 +44,18 @@ public class DailyTravelOrderStatisticsBiz extends BaseBiz<DailyTravelOrderStati
@Autowired
private
OrderAccountBiz
accountBiz
;
// @Transactional(rollbackFor = Exception.class)
// public boolean StatisticsOfTravelOrders() {
// try {
//
// ArrayList<DailyTravelOrderStatistics> objects = new ArrayList<>();
// List<DailyTravelOrderStatistics> travelGmv = mapper.getTravelGmv(day);
// objects.addAll(travelGmv);
// List<DailyTravelOrderStatistics> travelPenalSum = mapper.getTravelPenalSum(day);
// objects.addAll(travelPenalSum);
// insertByList(objects);
//
// return true;
// } catch (Exception e) {
// e.printStackTrace();
// TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
// return false;
// }
// }
//
// private void insertByList(ArrayList<DailyTravelOrderStatistics> objects) throws Exception {
//
// if (CollectionUtils.isNotEmpty(objects)) {
// HashMap<Integer, DailyTravelOrderStatistics> map = new HashMap<>();
// for (DailyTravelOrderStatistics object : objects) {
//
// DailyTravelOrderStatistics statistics = map.get(object.getBranchCompanyId());
// if (statistics == null) {
// statistics = new DailyTravelOrderStatistics();
// map.put(object.getBranchCompanyId(), statistics);
// }
//
// BeanUtil.copyProperties(object, statistics, CopyOptions.create().setIgnoreNullValue(true).setIgnoreError(true));
//
// }
// String oneDay = map.entrySet().parallelStream().map(Map.Entry::getValue).collect(Collectors.toList()).get(0).getOneDay();
//
// if (StringUtils.isBlank(oneDay)) {
// throw new BaseException();
// }
// Example exa= new Example(DailyTravelOrderStatistics.class);
// exa.createCriteria().andEqualTo("oneDay",oneDay);
// List<DailyTravelOrderStatistics> statistics= selectByExample(exa);
// if (CollectionUtils.isEmpty(statistics)){
// for (Map.Entry<Integer, DailyTravelOrderStatistics> entry : map.entrySet()) {
// insertSelectiveRe(entry.getValue());
// }
// }else {
// log.error("今日已统计车辆订单,请不要重复统计!");
// }
//
////
//// for (Map.Entry<Integer, DailyTravelOrderStatistics> e : map.entrySet()) {
//// insertSelectiveRe(e.getValue());
//// }
// }
// }
/******************************************************************************************************************************/
/**
* 统计订单并保存到数据库当中
* @return
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
saveD
ailyTravelOrderRecord
(
Integer
day
)
{
public
boolean
d
ailyTravelOrderRecord
(
Integer
day
)
{
try
{
//获取每日订单统计
List
<
DailyTravelOrderStatistics
>
orderStatistics
=
getDailyTravelOrderStatistics
(
day
);
List
<
DailyTravelOrderStatistics
>
orderStatistics
=
getDailyTravelOrderStatistics
(
new
Term
(
OrderTypeEnum
.
TOUR
.
getCode
(),
day
,
1
,
null
,
null
,
null
)
);
log
.
info
(
"Travel:统计完成"
);
if
(
CollectionUtils
.
isNotEmpty
(
orderStatistics
))
{
for
(
DailyTravelOrderStatistics
orderStatistic
:
orderStatistics
)
{
if
(
JudgmentOfExistence
(
orderStatistic
))
{
insertSelectiveRe
(
orderStatistic
);
}
else
{
mapper
.
updateByExampleSelective
(
orderStatistic
,
Example
.
builder
(
DailyTravelOrderStatistics
.
class
)
.
where
(
WeekendSqls
.<
DailyTravelOrderStatistics
>
custom
()
.
andEqualTo
(
DailyTravelOrderStatistics:
:
getOneDay
,
orderStatistic
.
getOneDay
())
.
andEqualTo
(
DailyTravelOrderStatistics:
:
getBranchCompanyId
,
orderStatistic
.
getBranchCompanyId
()))
.
build
());
}
}
}
seve
(
orderStatistics
);
log
.
info
(
"Travel:保存成功"
);
return
true
;
}
catch
(
Exception
e
)
{
...
...
@@ -135,6 +65,23 @@ public class DailyTravelOrderStatisticsBiz extends BaseBiz<DailyTravelOrderStati
}
}
public
void
seve
(
List
<
DailyTravelOrderStatistics
>
orderStatistics
)
{
if
(
CollectionUtils
.
isNotEmpty
(
orderStatistics
))
{
for
(
DailyTravelOrderStatistics
orderStatistic
:
orderStatistics
)
{
if
(
JudgmentOfExistence
(
orderStatistic
))
{
insertSelectiveRe
(
orderStatistic
);
}
else
{
mapper
.
updateByExampleSelective
(
orderStatistic
,
Example
.
builder
(
DailyTravelOrderStatistics
.
class
)
.
where
(
WeekendSqls
.<
DailyTravelOrderStatistics
>
custom
()
.
andEqualTo
(
DailyTravelOrderStatistics:
:
getOneDay
,
orderStatistic
.
getOneDay
())
.
andEqualTo
(
DailyTravelOrderStatistics:
:
getBranchCompanyId
,
orderStatistic
.
getBranchCompanyId
()))
.
build
());
}
}
}
}
/**
* 添加前查询是否存在这条数据
* @param orderStatistic
...
...
@@ -151,9 +98,9 @@ public class DailyTravelOrderStatisticsBiz extends BaseBiz<DailyTravelOrderStati
}
return
true
;
}
p
rivate
List
<
DailyTravelOrderStatistics
>
getDailyTravelOrderStatistics
(
Integer
day
)
{
p
ublic
List
<
DailyTravelOrderStatistics
>
getDailyTravelOrderStatistics
(
Term
term
)
{
//获取当天所有订单账目
List
<
OrderAccountDTO
>
accountList
=
accountBiz
.
getOrderAccountByOrderType
(
OrderTypeEnum
.
TOUR
.
getCode
(),
day
);
List
<
OrderAccountDTO
>
accountList
=
accountBiz
.
getOrderAccountByOrderType
(
term
);
if
(
CollectionUtils
.
isEmpty
(
accountList
))
{
return
null
;
}
...
...
@@ -225,19 +172,27 @@ public class DailyTravelOrderStatisticsBiz extends BaseBiz<DailyTravelOrderStati
}
if
(
CollectionUtils
.
isNotEmpty
(
arrayList
))
{
ArrayList
<
OrderAccountDetail
>
orderAccountDetail
=
getOrderAccountDetail
(
arrayList
);
if
(
CollectionUtils
.
isNotEmpty
(
orderAccountDetail
))
{
//订单退还总额
BigDecimal
depositAmountTotal
=
getOrderAmountTotal
(
orderAccountDetail
);
orderStatistics
.
setReturnGmv
(
depositAmountTotal
);
List
<
OrderAccountDeduction
>
OrderAccountDeductions
=
gettDeductions
(
orderAccountDetail
);
//获取违约总额
BigDecimal
bigDecimal
=
get
(
OrderAccountDeductions
,
new
ArrayList
<
Integer
>()
{{
add
(
DeductionTypeEnum
.
VIOLATE_CANCEL
.
getCode
());
add
(
DeductionTypeEnum
.
VIOLATE_ADVANCE
.
getCode
());
add
(
DeductionTypeEnum
.
VIOLATE_DELAY
.
getCode
());
}});
orderStatistics
.
setDefaultMoney
(
bigDecimal
);
//订单退还总额
orderStatistics
.
setReturnGmv
(
orderStatistics
.
getGmv
().
subtract
(
bigDecimal
));
}
}
}
private
DailyTravelOrderStatistics
getGmvAndSecurityDeposit
(
Map
<
Integer
,
List
<
OrderAccountDTO
>>
map
)
{
...
...
@@ -256,6 +211,7 @@ public class DailyTravelOrderStatisticsBiz extends BaseBiz<DailyTravelOrderStati
return
orderStatistics
;
}
/**
* 获取金额详情
*
...
...
@@ -322,7 +278,7 @@ public class DailyTravelOrderStatisticsBiz extends BaseBiz<DailyTravelOrderStati
return
mapper
.
insertSelective
(
entity
);
}
public
OrderStatistics
findAll
(
Integer
branchCompanyId
)
{
return
mapper
.
monthOrderTotal
(
branchCompanyId
);
public
OrderStatistics
findAll
(
List
<
Integer
>
companyIds
)
{
return
mapper
.
monthOrderTotal
(
companyIds
);
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/DailyVehicleOrderStatisticsBiz.java
View file @
cb4730b7
This diff is collapsed.
Click to expand it.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
View file @
cb4730b7
...
...
@@ -17,6 +17,7 @@ import com.xxfc.platform.order.contant.enumerate.*;
import
com.xxfc.platform.order.entity.*
;
import
com.xxfc.platform.order.mapper.OrderAccountMapper
;
import
com.xxfc.platform.order.pojo.DedDetailDTO
;
import
com.xxfc.platform.order.pojo.Term
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDTO
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDeduction
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDetail
;
...
...
@@ -551,12 +552,11 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
/**
* 获取每日订单账目,用于统计
* @param code
* @param day
* @param term
* @return
*/
public
List
<
OrderAccountDTO
>
getOrderAccountByOrderType
(
Integer
code
,
Integer
day
)
{
return
mapper
.
getOrderAccountByOrderType
(
code
,
day
);
public
List
<
OrderAccountDTO
>
getOrderAccountByOrderType
(
Term
term
)
{
return
mapper
.
getOrderAccountByOrderType
(
term
);
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderStatisticsBiz.java
View file @
cb4730b7
This diff is collapsed.
Click to expand it.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
View file @
cb4730b7
...
...
@@ -182,16 +182,19 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
return
ObjectRestResponse
.
createFailedResult
(
3503
,
"无收车权限"
);
}
}
Vehicle
vehicle
=
null
;
RestResponse
<
Vehicle
>
vehicleRestResponse
=
vehicleFeign
.
findById
(
orderRentVehicleDetail
.
getVehicleId
());
log
.
info
(
"获取车辆信息返回消息:{}"
,
vehicleRestResponse
.
getMessage
());
if
(
vehicleRestResponse
.
getData
()
!=
null
)
{
vehicle
=
vehicleRestResponse
.
getData
();
}
if
(
vehicle
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getCode
(),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
());
}
// if (vehicle.getStatus().equals(VehicleStatus.DEPARTURE.getCode())) {
// return ObjectRestResponse.createFailedResult(ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getCode(), ResCode.VEHICLE_DEPARTURE_VEHICLE_DISABLE.getDesc());
// }
if
(
baseOrder
.
getStatus
()
!=
-
1
)
{
Vehicle
vehicle
=
null
;
RestResponse
<
Vehicle
>
restResponse
=
vehicleFeign
.
findById
(
orderRentVehicleDetail
.
getVehicleId
());
log
.
info
(
"获取车辆信息返回消息:{}"
,
restResponse
.
getMessage
());
if
(
restResponse
.
getData
()
!=
null
)
{
vehicle
=
restResponse
.
getData
();
}
if
(
vehicle
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getCode
(),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
());
}
if
(
vehicle
.
getMileageLastUpdate
()
!=
null
)
{
//判断车辆公里数
if
(
orderVehicleCrosstownDto
.
getMileage
()
==
null
||
orderVehicleCrosstownDto
.
getMileage
()
<
vehicle
.
getMileageLastUpdate
())
{
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mapper/DailyMembersOrderStatisticsMapper.java
View file @
cb4730b7
...
...
@@ -18,7 +18,7 @@ public interface DailyMembersOrderStatisticsMapper extends Mapper<DailyMembersOr
Map
<
String
,
Object
>
getTravelGmv
(
@Param
(
"day"
)
Integer
day
);
OrderStatistics
monthOrderTotal
(
@Param
(
"companyId"
)
Integer
companyId
);
OrderStatistics
monthOrderTotal
(
List
<
Integer
>
companyIds
);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mapper/DailyTravelOrderStatisticsMapper.java
View file @
cb4730b7
...
...
@@ -19,5 +19,5 @@ public interface DailyTravelOrderStatisticsMapper extends Mapper<DailyTravelOrde
List
<
DailyTravelOrderStatistics
>
getTravelPenalSum
(
@Param
(
"day"
)
Integer
day
);
OrderStatistics
monthOrderTotal
(
@Param
(
"companyId"
)
Integer
companyId
);
OrderStatistics
monthOrderTotal
(
List
<
Integer
>
companyIds
);
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mapper/DailyVehicleOrderStatisticsMapper.java
View file @
cb4730b7
...
...
@@ -25,5 +25,5 @@ public interface DailyVehicleOrderStatisticsMapper extends Mapper<DailyVehicleOr
List
<
DailyVehicleOrderStatistics
>
getViolationMoney
(
@Param
(
"day"
)
Integer
day
);
OrderStatistics
monthOrderTotal
(
@Param
(
"companyId"
)
Integer
companyId
);
OrderStatistics
monthOrderTotal
(
List
<
Integer
>
companyIds
);
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mapper/OrderAccountMapper.java
View file @
cb4730b7
package
com
.
xxfc
.
platform
.
order
.
mapper
;
import
com.xxfc.platform.order.entity.OrderAccount
;
import
com.xxfc.platform.order.pojo.Term
;
import
com.xxfc.platform.order.pojo.account.OrderAccountDTO
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.common.Mapper
;
...
...
@@ -17,5 +18,5 @@ import java.util.List;
*/
public
interface
OrderAccountMapper
extends
Mapper
<
OrderAccount
>
{
List
<
OrderAccountDTO
>
getOrderAccountByOrderType
(
@Param
(
"type"
)
Integer
type
,
@Param
(
"day"
)
Integer
day
);
List
<
OrderAccountDTO
>
getOrderAccountByOrderType
(
Term
term
);
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/background/OrderStatisticsController.java
View file @
cb4730b7
package
com
.
xxfc
.
platform
.
order
.
rest
.
background
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.io.IoUtil
;
import
cn.hutool.poi.excel.ExcelUtil
;
import
cn.hutool.poi.excel.ExcelWriter
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel
;
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.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.google.common.collect.Lists
;
import
com.xxfc.platform.order.biz.DailyMembersOrderStatisticsBiz
;
import
com.xxfc.platform.order.biz.DailyTravelOrderStatisticsBiz
;
import
com.xxfc.platform.order.biz.DailyVehicleOrderStatisticsBiz
;
...
...
@@ -22,23 +20,18 @@ import com.xxfc.platform.order.entity.OrderStatistics;
import
com.xxfc.platform.order.pojo.HomePageOrderData
;
import
com.xxfc.platform.order.pojo.MembersOrderDto
;
import
com.xxfc.platform.order.pojo.OrderQuery
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.ServletOutputStream
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.lang.reflect.Array
;
import
java.text.DateFormat
;
import
java.text.ParseException
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* @author Administrator
...
...
@@ -90,64 +83,41 @@ public class OrderStatisticsController extends BaseController<OrderStatisticsBiz
@Autowired
private
DailyMembersOrderStatisticsBiz
membersBiz
;
@Autowired
private
VehicleFeign
vehicleFeign
;
@ApiOperation
(
"获取订单统计数据"
)
@GetMapping
(
"/findAll/{type}"
)
public
ObjectRestResponse
findAll
(
@PathVariable
Integer
type
)
{
try
{
ObjectRestResponse
<
UserDTO
>
userDTOObjectRestResponse
=
userFeign
.
userinfoByToken
(
userAuthConfig
.
getToken
(
getRequest
()));
if
(
userDTOObjectRestResponse
==
null
||
userDTOObjectRestResponse
.
getData
()
==
null
)
{
throw
new
BaseException
(
"
请登录
!"
);
throw
new
BaseException
(
"
token失效
!"
);
}
UserDTO
user
=
userDTOObjectRestResponse
.
getData
();
Integer
companyId
=
user
.
getCompanyId
();
if
(
DATA_AUTHORITY
.
equals
(
user
.
getDataAll
()))
{
companyId
=
null
;
List
<
Integer
>
companyIds
=
null
;
if
(!
DATA_AUTHORITY
.
equals
(
user
.
getDataAll
()))
{
companyIds
=
vehicleFeign
.
getCompanyIds
().
getData
();
}
//只统计租车订单
if
(
TYPE_VEHICLE
.
equals
(
type
))
{
OrderStatistics
vehicle
=
vehicleBiz
.
findAll
(
companyId
);
return
ObjectRestResponse
.
succ
(
new
HomePageOrderData
()
{{
setTotalOrders
(
vehicle
.
getTotalGmv
().
subtract
(
vehicle
.
getTotalReturnGmv
()));
setAdditionalIndemnity
(
vehicle
.
getTotalCompensation
()
.
add
(
vehicle
.
getTotalForfeit
())
.
add
(
vehicle
.
getTotalDefaultMoney
())
.
add
(
vehicle
.
getTotalExpenditure
().
subtract
(
vehicle
.
getTotalGmv
().
subtract
(
vehicle
.
getTotalReturnGmv
())))
);
setTotalOutstandingDeposit
(
vehicle
.
getTotalSecurityDeposit
()
.
subtract
(
vehicle
.
getTotalRefundSecurityDeposit
())
.
subtract
(
getAdditionalIndemnity
()));
}});
return
ObjectRestResponse
.
succ
(
baseBiz
.
getVehicleHomePageOrderData
(
companyIds
));
}
//只统计
会租车
订单
//只统计
旅游
订单
if
(
TYPE_TOUR
.
equals
(
type
))
{
OrderStatistics
tour
=
TravelBiz
.
findAll
(
companyId
);
return
ObjectRestResponse
.
succ
(
new
HomePageOrderData
()
{{
setTotalOrders
(
tour
.
getTotalGmv
().
subtract
(
tour
.
getTotalReturnGmv
()));
setAdditionalIndemnity
(
tour
.
getTotalDefaultMoney
());
}});
return
ObjectRestResponse
.
succ
(
baseBiz
.
getTourHomePageOrderData
(
companyIds
));
}
//只统计会员
定案
//只统计会员
订单
if
(
TYPE_MEMBER
.
equals
(
type
))
{
OrderStatistics
member
=
membersBiz
.
findAll
(
companyId
);
return
ObjectRestResponse
.
succ
(
new
HomePageOrderData
()
{{
setTotalOrders
(
member
.
getTotalGmv
());
}});
return
ObjectRestResponse
.
succ
(
baseBiz
.
getMemberHomePageOrderData
(
companyIds
));
}
//所有订单
if
(
TYPE_TOTAL
.
equals
(
type
))
{
return
ObjectRestResponse
.
succ
(
baseBiz
.
getTotalOrder
(
companyId
));
return
ObjectRestResponse
.
succ
(
baseBiz
.
getTotalOrder
(
companyId
s
));
}
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"参数错误!"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -155,12 +125,11 @@ public class OrderStatisticsController extends BaseController<OrderStatisticsBiz
}
}
@PostMapping
(
"/order"
)
@ApiOperation
(
value
=
"会员统计"
)
public
ObjectRestResponse
<
List
<
MembersOrderDto
>>
getMemberOrderStatisticsData
(
@RequestBody
OrderQuery
query
)
throws
ParseException
{
if
(
query
.
getEndTime
()
!=
null
)
{
query
.
setEndTime
(
query
.
getEndTime
()
+(
24
*
60
*
60
*
1000
));
if
(
query
.
getEndTime
()
!=
null
)
{
query
.
setEndTime
(
query
.
getEndTime
()
+
(
24
*
60
*
60
*
1000
));
}
//获取会员等级信息
List
<
BaseUserMemberLevel
>
memberLevels
=
userFeign
.
levels
();
...
...
@@ -172,8 +141,8 @@ public class OrderStatisticsController extends BaseController<OrderStatisticsBiz
@PostMapping
(
"/excel"
)
@ApiOperation
(
value
=
"下载excel表"
)
public
void
downloadExcel
(
@RequestBody
OrderQuery
query
)
throws
Exception
{
if
(
query
.
getEndTime
()
!=
null
)
{
query
.
setEndTime
(
query
.
getEndTime
()
+(
24
*
60
*
60
*
1000
));
if
(
query
.
getEndTime
()
!=
null
)
{
query
.
setEndTime
(
query
.
getEndTime
()
+
(
24
*
60
*
60
*
1000
));
}
// 通过工具类创建writer,默认创建xls格式
ExcelWriter
writer
=
ExcelUtil
.
getWriter
(
true
);
...
...
xx-order/xx-order-server/src/main/resources/mapper/DailyMembersOrderStatisticsMapper.xml
View file @
cb4730b7
...
...
@@ -22,10 +22,12 @@
daily_members_order_statistics
WHERE
1=1
<if
test=
"companyId != null"
>
and branch_company_id = #{companyId}
<if
test=
"companyIds != null and companyIds.size()!=0"
>
and branch_company_id in
<foreach
collection=
"companyIds"
index=
"index"
item=
"companyId"
open=
"("
separator=
","
close=
")"
>
#{companyId}
</foreach>
</if>
</select>
<!-- <select id="updateByExampleSelective">-->
<!-- SELECT-->
...
...
xx-order/xx-order-server/src/main/resources/mapper/DailyTravelOrderStatisticsMapper.xml
View file @
cb4730b7
...
...
@@ -58,8 +58,11 @@
daily_travel_order_statistics
WHERE
1=1
<if
test=
"companyId != null"
>
and branch_company_id = #{companyId}
<if
test=
"companyIds != null and companyIds.size()!=0"
>
and branch_company_id in
<foreach
collection=
"companyIds"
index=
"index"
item=
"companyId"
open=
"("
separator=
","
close=
")"
>
#{companyId}
</foreach>
</if>
</select>
...
...
xx-order/xx-order-server/src/main/resources/mapper/DailyVehicleOrderStatisticsMapper.xml
View file @
cb4730b7
...
...
@@ -89,13 +89,16 @@
IFNULL( sum( compensation ), 0 ) AS totalCompensation,
IFNULL( sum( return_gmv ), 0 ) AS totalReturnGmv,
IFNULL( sum( default_money ), 0 ) AS totalDefaultMoney,
IFNULL( sum(
total_expenditure ), 0 ) AS totalExpenditure
IFNULL( sum(
order_compensation ), 0 ) AS totalOrderCompensation
FROM
daily_vehicle_order_statistics
WHERE
1=1
<if
test=
"companyId != null"
>
and branch_company_id = #{companyId}
<if
test=
"companyIds != null and companyIds.size()!=0"
>
and branch_company_id in
<foreach
collection=
"companyIds"
index=
"index"
item=
"companyId"
open=
"("
separator=
","
close=
")"
>
#{companyId}
</foreach>
</if>
</select>
...
...
xx-order/xx-order-server/src/main/resources/mapper/OrderAccountMapper.xml
View file @
cb4730b7
...
...
@@ -3,27 +3,52 @@
<mapper
namespace=
"com.xxfc.platform.order.mapper.OrderAccountMapper"
>
<select
id=
"getOrderAccountByOrderType"
resultType=
"com.xxfc.platform.order.pojo.account.OrderAccountDTO"
>
SELECT
date(DATE_SUB(now(),interval #{day} day)) as oneDay,
<if
test=
"subdivide !=null and subdivide ==1"
>
date( FROM_UNIXTIME( a.crt_time / 1000 ) ) as oneDay,
</if>
a.*
<if
test=
"
type != null and t
ype == 1"
>
<if
test=
"
orderType != null and orderT
ype == 1"
>
, v.start_company_id as companyId
</if>
<if
test=
"
type != null and t
ype == 2"
>
<if
test=
"
orderType != null and orderT
ype == 2"
>
, t.start_company_id as companyId
</if>
FROM
order_account a
LEFT JOIN base_order b ON a.order_id = b.id
<if
test=
"
type != null and t
ype==1"
>
<if
test=
"
orderType != null and orderT
ype==1"
>
LEFT JOIN order_rent_vehicle_detail v ON b.id = v.order_id
</if>
<if
test=
"
type != null and t
ype==2"
>
<if
test=
"
orderType != null and orderT
ype==2"
>
LEFT JOIN order_tour_detail t ON b.id = t.order_id
</if>
WHERE
a.account_status=1
AND
b.type = #{type}
AND date( FROM_UNIXTIME( a.crt_time / 1000 ) ) = date( DATE_SUB( now( ), INTERVAL #{day} DAY ) )
b.type = #{orderType}
<if
test=
"startTime != null"
>
AND a.crt_time
<![CDATA[>= ]]>
#{startTime}
</if>
<if
test=
"endTime != null"
>
AND a.crt_time
>
endTime
</if>
<if
test=
"companyIds != null and companyIds.size() != 0 "
>
<if
test=
"orderType != null and orderType == 1"
>
AND v.start_company_id in
<foreach
collection=
"companyIds"
index=
"index"
item=
"companyId"
open=
"("
separator=
","
close=
")"
>
#{companyId}
</foreach>
</if>
<if
test=
"orderType != null and orderType == 2"
>
AND t.start_company_id in
<foreach
collection=
"companyIds"
index=
"index"
item=
"companyId"
open=
"("
separator=
","
close=
")"
>
#{companyId}
</foreach>
</if>
</if>
<if
test=
"subdivide !=null and subdivide ==1"
>
AND date( FROM_UNIXTIME( a.crt_time / 1000 ) ) = date( DATE_SUB( now( ), INTERVAL #{day} DAY ) )
</if>
</select>
</mapper>
\ No newline at end of file
xx-order/xx-order-server/src/test/java/ServiceTest.java
View file @
cb4730b7
...
...
@@ -75,7 +75,7 @@ public class ServiceTest {
@Test
public
void
handlerTeset
()
{
handler
.
execute
(
"2019-0
8-15
"
);
handler
.
execute
(
"2019-0
9-29
"
);
}
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/authenticationInterface/impl/BJCYAuthentication.java
View file @
cb4730b7
package
com
.
xxfc
.
platform
.
universal
.
service
.
authenticationInterface
.
impl
;
import
cn.hutool.core.map.MapUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xxfc.platform.universal.biz.UserMessage
;
import
com.xxfc.platform.universal.service.authenticationInterface.UserAuthentication
;
import
com.xxfc.platform.universal.utils.CertifHttpUtils
;
import
com.xxfc.platform.universal.utils.HttpUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.StatusLine
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.context.annotation.Primary
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* 调用北京畅游互联科技有限公司接口
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/authenticationInterface/impl/XCFQAuthentication.java
View file @
cb4730b7
...
...
@@ -5,7 +5,6 @@ import cn.hutool.core.map.MapUtil;
import
com.alibaba.fastjson.JSONObject
;
import
com.xxfc.platform.universal.biz.UserMessage
;
import
com.xxfc.platform.universal.service.authenticationInterface.UserAuthentication
;
import
com.xxfc.platform.universal.utils.CertifHttpUtils
;
import
com.xxfc.platform.universal.utils.HttpUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
...
...
@@ -67,6 +66,7 @@ public class XCFQAuthentication implements UserAuthentication {
/**
* 状态码: 200 正常;400 URL无效;401 appCode错误; 403 次数用完; 500 API网管错误
*/
log
.
info
(
"外部接口响应状态码:"
+
statusCode
);
//获取response的body
if
(
statusCode
==
200
)
{
String
result
=
EntityUtils
.
toString
(
response
.
getEntity
());
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/constant/ResCode/ResCode.java
View file @
cb4730b7
...
...
@@ -49,6 +49,8 @@ public enum ResCode {
VEHICLE_UPKEEP_VEHICLE_DISABLE
(
106002
,
"车辆不可用"
),
VEHICLE_UPKEEP_ITEM_UNEXIST
(
106003
,
"保养项目不存在"
),
VEHICLE_UPKEEP_VEHICLE_UNUPKEEP
(
106004
,
"车辆不在保养中"
),
VEHICLE_STATUS_IS_NOT_NORMAL
(
106005
,
"上次的出行未做收车操作, 请先收车"
),
VEHICLE_IS_BOOKED_TODAY
(
106006
,
"车辆当前时段已经被预定"
),
FIND_VEHICLE_PLAT_FAILE
(
106007
,
"获取车型列表失败"
),
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/Vehicle.java
View file @
cb4730b7
...
...
@@ -64,11 +64,17 @@ public class Vehicle {
*/
private
Integer
insuranceCompany
;
private
Integer
strongInsuranceCompany
;
/**
* 保险单号
*/
private
String
insuranceNo
;
/**
* 强险单号
*/
private
String
strongInsuranceNo
;
/**
* 保险开始时间
...
...
@@ -80,6 +86,11 @@ public class Vehicle {
*/
private
Date
insuranceEndDate
;
/**
* 强险的结束时间
*/
private
Date
strongInsuranceEndDate
;
/**
* 年审时间
*/
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
cb4730b7
...
...
@@ -197,4 +197,6 @@ public interface VehicleFeign {
@GetMapping
(
value
=
"/bookRecord/get"
)
public
ObjectRestResponse
<
List
<
BookRecordUpdateLog
>>
get
(
@RequestParam
(
value
=
"bookRecordId"
)
Long
bookRecordId
);
@RequestMapping
(
value
=
"/branchCompany/app/unauth/getCompanyIds"
,
method
=
RequestMethod
.
GET
)
RestResponse
<
List
<
Integer
>>
getCompanyIds
();
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/AddOrUpdateVehicleVo.java
View file @
cb4730b7
...
...
@@ -68,12 +68,14 @@ public class AddOrUpdateVehicleVo {
* 保险公司,见常量表
*/
private
Integer
insuranceCompany
;
private
Integer
strongInsuranceCompany
;
/**
* 保险单号
*/
private
String
insuranceNo
;
private
String
strongInsuranceNo
;
/**
* 保险开始时间
...
...
@@ -84,6 +86,7 @@ public class AddOrUpdateVehicleVo {
* 保险结束时间
*/
private
Date
insuranceEndDate
;
private
Date
strongInsuranceEndDate
;
/**
* 年审时间
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehiclePageQueryVo.java
View file @
cb4730b7
...
...
@@ -138,4 +138,6 @@ public class VehiclePageQueryVo {
*/
private
Integer
modelId
;
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
View file @
cb4730b7
...
...
@@ -413,4 +413,8 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
return
ObjectRestResponse
.
succ
(
list
);
}
public
List
<
Integer
>
getCompanyIds
()
{
UserDTO
userDTO
=
getAdminUserInfo
();
return
vehicleBiz
.
dataCompany
(
userDTO
.
getDataZone
(),
userDTO
.
getDataCompany
());
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
View file @
cb4730b7
...
...
@@ -60,7 +60,7 @@ public class VehicleActiveService {
*/
public
void
departure
(
VehicleDepartureVo
departureVo
)
{
log
.
info
(
"出车参数: departureVo = {}"
,
departureVo
.
toString
());
Vehicle
vehicle
=
vehicle
Mapper
.
selectByPrimaryKey
(
departureVo
.
getVehicleId
());
Vehicle
vehicle
=
vehicle
Biz
.
selectById
(
departureVo
.
getVehicleId
());
if
(
vehicle
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getCode
());
...
...
@@ -69,9 +69,9 @@ public class VehicleActiveService {
throw
new
BaseException
(
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getDesc
(),
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getCode
());
}
if
(
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
DISCARD
.
getCode
())
||
vehicle
.
getIsDel
()
==
1
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_
DEPARTURE_VEHICLE_DISABLE
.
getDesc
()
+
", 车辆状态是:"
+
getVehicleStatus
(
vehicle
.
getStatus
(),
vehicle
.
getId
()
),
ResCode
.
VEHICLE_
DEPARTURE_VEHICLE_DISABLE
.
getCode
());
if
(
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
DISCARD
.
getCode
())
||
vehicle
.
getIsDel
()
==
1
||
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
DEPARTURE
.
getCode
())
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_
STATUS_IS_NOT_NORMAL
.
getDesc
(
),
ResCode
.
VEHICLE_
STATUS_IS_NOT_NORMAL
.
getCode
());
}
//添加出车时间过滤 再出车开始时间前一天至结束时间内可以出车,并且预定记录为已审核状态
checkDateInvalid
(
departureVo
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
cb4730b7
...
...
@@ -491,6 +491,25 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
return
Boolean
.
TRUE
;
}
/**
*
* @param vehicleId
* @return
*/
public
ObjectRestResponse
checkVehicleStatus
(
String
vehicleId
)
{
if
(
StringUtils
.
isBlank
(
vehicleId
))
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
Vehicle
vehicle
=
mapper
.
selectByPrimaryKey
(
vehicleId
);
if
(
vehicle
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
VEHICLE_UPKEEP_VEHICLE_UNEXIST
.
getCode
(),
ResCode
.
VEHICLE_UPKEEP_VEHICLE_UNUPKEEP
.
getDesc
());
}
if
(
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
DEPARTURE
.
getCode
())
||
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
DISCARD
.
getCode
())
||
vehicle
.
getIsDel
()
!=
0
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResCode
.
VEHICLE_STATUS_IS_NOT_NORMAL
.
getCode
(),
ResCode
.
VEHICLE_STATUS_IS_NOT_NORMAL
.
getDesc
());
}
return
ObjectRestResponse
.
succ
();
}
public
boolean
filterHourInfoBooked
(
String
vehicleId
,
Map
<
String
,
Integer
>
hourInfo
)
{
if
(
MapUtils
.
isEmpty
(
hourInfo
))
{
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/BranchCompanyController.java
View file @
cb4730b7
...
...
@@ -25,7 +25,9 @@ import com.xxfc.platform.vehicle.pojo.vo.BranchCompanyListVO;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.assertj.core.util.Lists
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -35,6 +37,7 @@ import javax.servlet.http.HttpServletRequest;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@RestController
@RequestMapping
(
"/branchCompany"
)
...
...
@@ -217,4 +220,11 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
public
ObjectRestResponse
<
List
<
BranchCompany
>>
companys
()
{
return
baseBiz
.
branchCompans
();
}
@RequestMapping
(
value
=
"/app/unauth/getCompanyIds"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
<
List
<
Integer
>>
getCompanyIds
()
{
return
RestResponse
.
suc
(
baseBiz
.
getCompanyIds
());
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleActiveController.java
View file @
cb4730b7
...
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.vehicle.rest;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.vehicle.biz.VehicleActiveService
;
import
com.xxfc.platform.vehicle.biz.VehicleBiz
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.pojo.*
;
...
...
@@ -17,7 +18,8 @@ public class VehicleActiveController {
@Autowired
VehicleActiveService
vehicleActiveService
;
@Autowired
VehicleBiz
vehicleBiz
;
/**
* 发车
...
...
@@ -32,6 +34,7 @@ public class VehicleActiveController {
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
}
vehicleActiveService
.
departure
(
departureVo
);
return
RestResponse
.
suc
();
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleController.java
View file @
cb4730b7
...
...
@@ -485,6 +485,12 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
return
ObjectRestResponse
.
succ
(
map
);
}
@GetMapping
(
value
=
"/app/unauth/checkVehicleStatus"
)
@ApiOperation
(
value
=
"检车车辆状态是否是正常状态"
)
public
ObjectRestResponse
checkVehicleStatus
(
String
vehicleId
)
{
return
vehicleBiz
.
checkVehicleStatus
(
vehicleId
);
}
/**
* 保存
*
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
cb4730b7
...
...
@@ -121,7 +121,7 @@
and v.belong_to_name like concat('%',#{belongToName},'%')
</if>
<if
test=
"vin !=null and vin != ''"
>
and v.vin
= #{vin}
and v.vin
like CONCAT('%',#{vin},'%')
</if>
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
...
...
@@ -289,7 +289,7 @@
and v.belong_to_name = #{belongToName}
</if>
<if
test=
"vin !=null and vin != ''"
>
and v.vin
= #{vin}
and v.vin
like CONCAT('%',#{vin},'%')
</if>
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
...
...
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