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
2d2ba6ee
Commit
2d2ba6ee
authored
Aug 02, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'base-modify' of
http://113.105.137.151:22280/youjj/cloud-platform
into base-modify
parents
b07481d2
59dfb218
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
70 additions
and
197 deletions
+70
-197
BaseOrderController.java
...ava/com/xxfc/platform/order/rest/BaseOrderController.java
+7
-31
BaseOrderMapper.xml
...rder-server/src/main/resources/mapper/BaseOrderMapper.xml
+2
-2
OrderPayBiz.java
...ain/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
+17
-24
VehicleBookRecordQueryVo.java
.../xxfc/platform/vehicle/pojo/VehicleBookRecordQueryVo.java
+1
-3
VehiclePlanDto.java
...va/com/xxfc/platform/vehicle/pojo/dto/VehiclePlanDto.java
+1
-2
BranchCompanyBiz.java
.../java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
+7
-32
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+4
-24
VehicleBookRecordBiz.java
...a/com/xxfc/platform/vehicle/biz/VehicleBookRecordBiz.java
+28
-64
BranchCompanyMapper.xml
...-server/src/main/resources/mapper/BranchCompanyMapper.xml
+1
-1
VehicleBookRecordMapper.xml
...ver/src/main/resources/mapper/VehicleBookRecordMapper.xml
+2
-14
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BaseOrderController.java
View file @
2d2ba6ee
...
@@ -35,6 +35,7 @@ import com.xxfc.platform.universal.entity.Dictionary;
...
@@ -35,6 +35,7 @@ import com.xxfc.platform.universal.entity.Dictionary;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.universal.vo.OrderPayVo
;
import
com.xxfc.platform.universal.vo.OrderPayVo
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
...
@@ -60,7 +61,6 @@ import java.util.List;
...
@@ -60,7 +61,6 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_FALSE
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
APP_ORDER
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
APP_ORDER
;
@Controller
@Controller
...
@@ -97,6 +97,7 @@ public class BaseOrderController extends CommonBaseController implements UserRes
...
@@ -97,6 +97,7 @@ public class BaseOrderController extends CommonBaseController implements UserRes
@Autowired
@Autowired
RabbitProduct
rabbitProduct
;
RabbitProduct
rabbitProduct
;
@Override
@Override
public
UserFeign
getUserFeign
()
{
public
UserFeign
getUserFeign
()
{
return
userFeign
;
return
userFeign
;
...
@@ -182,39 +183,16 @@ public class BaseOrderController extends CommonBaseController implements UserRes
...
@@ -182,39 +183,16 @@ public class BaseOrderController extends CommonBaseController implements UserRes
if
(
userDTO
==
null
)
{
if
(
userDTO
==
null
)
{
return
ObjectRestResponse
.
succ
(
new
PageDataVO
<>());
return
ObjectRestResponse
.
succ
(
new
PageDataVO
<>());
}
}
if
(
dto
.
getStartZoneId
()
==
null
)
{
//默认查出所有权限内的数据
List
<
BranchCompany
>
branchCompanies
=
vehicleFeign
.
companyAll
(
userDTO
.
getDataAll
(),
userDTO
.
getDataCompany
(),
userDTO
.
getDataZone
());
if
(
DATA_ALL_FALSE
.
equals
(
userDTO
.
getDataAll
()))
{
//不能获取全部数据
List
<
Integer
>
companyIds
=
branchCompanies
.
stream
().
map
(
BranchCompany:
:
getId
).
collect
(
Collectors
.
toList
());
String
zoneId
=
null
;
dto
.
setCompanyIds
(
companyIds
);
if
(
StringUtils
.
isNotBlank
(
userDTO
.
getDataZone
()))
{
if
(
userDTO
.
getDataZone
().
contains
(
","
))
{
zoneId
=
userDTO
.
getDataZone
();
}
else
{
zoneId
=
userDTO
.
getDataZone
()
+
","
;
}
}
else
{
zoneId
=
userDTO
.
getZoneId
()
+
","
;
}
dto
.
setZoneIds
(
zoneId
.
split
(
","
));
String
companyId
=
null
;
if
(
StringUtils
.
isNotBlank
(
userDTO
.
getDataCompany
()))
{
if
(
userDTO
.
getDataCompany
().
contains
(
","
))
{
companyId
=
userDTO
.
getDataCompany
();
}
else
{
companyId
=
userDTO
.
getDataCompany
()
+
","
;
}
}
else
{
companyId
=
userDTO
.
getCompanyId
()
+
","
;
}
dto
.
setCompanyIds
(
companyId
.
split
(
","
));
}
}
Query
query
=
new
Query
(
dto
);
Query
query
=
new
Query
(
dto
);
PageDataVO
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
baseOrderBiz
.
listOrder
(
query
.
getSuper
()));
PageDataVO
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
baseOrderBiz
.
listOrder
(
query
.
getSuper
()));
List
<
OrderListVo
>
list
=
pageDataVO
.
getData
();
List
<
OrderListVo
>
list
=
pageDataVO
.
getData
();
List
<
Integer
>
userIds
=
list
.
stream
().
map
(
OrderListVo:
:
getUserId
).
distinct
().
collect
(
Collectors
.
toList
());
List
<
Integer
>
userIds
=
list
.
stream
().
map
(
OrderListVo:
:
getUserId
).
distinct
().
collect
(
Collectors
.
toList
());
if
(
userIds
!=
null
&&
userIds
.
size
()
>
0
)
{
if
(
userIds
!=
null
&&
userIds
.
size
()
>
0
)
{
ObjectRestResponse
<
List
<
AppUserVo
>>
objectRestResponse
=
userFeign
.
getByUserIds
(
userIds
);
ObjectRestResponse
<
List
<
AppUserVo
>>
objectRestResponse
=
userFeign
.
getByUserIds
(
userIds
);
log
.
info
(
"获取用户信息:objectRestResponse = {}"
,
objectRestResponse
.
get
Message
());
log
.
info
(
"获取用户信息:objectRestResponse = {}"
,
objectRestResponse
.
get
Data
());
Map
<
String
,
AppUserVo
>
appUserVoMap
=
objectRestResponse
.
getData
()
==
null
?
new
HashMap
<
String
,
AppUserVo
>()
Map
<
String
,
AppUserVo
>
appUserVoMap
=
objectRestResponse
.
getData
()
==
null
?
new
HashMap
<
String
,
AppUserVo
>()
:
objectRestResponse
.
getData
().
parallelStream
().
collect
(
Collectors
.
toMap
(
v
->
v
.
getUserid
().
toString
(),
v
->
v
));
:
objectRestResponse
.
getData
().
parallelStream
().
collect
(
Collectors
.
toMap
(
v
->
v
.
getUserid
().
toString
(),
v
->
v
));
...
@@ -466,7 +444,6 @@ public class BaseOrderController extends CommonBaseController implements UserRes
...
@@ -466,7 +444,6 @@ public class BaseOrderController extends CommonBaseController implements UserRes
return
null
;
return
null
;
}
}
/**
/**
* 订单查询类
* 订单查询类
*/
*/
...
@@ -497,8 +474,7 @@ public class BaseOrderController extends CommonBaseController implements UserRes
...
@@ -497,8 +474,7 @@ public class BaseOrderController extends CommonBaseController implements UserRes
@ApiModelProperty
(
"每页限制"
)
@ApiModelProperty
(
"每页限制"
)
Integer
limit
;
Integer
limit
;
String
[]
companyIds
;
List
<
Integer
>
companyIds
;
String
[]
zoneIds
;
}
}
}
}
xx-order/xx-order-server/src/main/resources/mapper/BaseOrderMapper.xml
View file @
2d2ba6ee
...
@@ -138,7 +138,7 @@
...
@@ -138,7 +138,7 @@
and (r.start_time between #{startTime} and #{endTime}
and (r.start_time between #{startTime} and #{endTime}
or t.start_time between #{startTime} and #{endTime})
or t.start_time between #{startTime} and #{endTime})
</if>
</if>
<if
test=
"companyIds != null"
>
<if
test=
"companyIds != null
and companyIds.size > 0
"
>
and (r.start_company_id in
and (r.start_company_id in
<foreach
collection=
"companyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"companyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
#{id}
...
@@ -149,7 +149,7 @@
...
@@ -149,7 +149,7 @@
</foreach>
</foreach>
)
)
</if>
</if>
<if
test=
"zoneIds != null"
>
<if
test=
"zoneIds != null
and zoneIds.size > 0
"
>
and (r.start_zone_id in
and (r.start_zone_id in
<foreach
collection=
"zoneIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"zoneIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
#{id}
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
View file @
2d2ba6ee
package
com
.
xxfc
.
platform
.
universal
.
biz
;
package
com
.
xxfc
.
platform
.
universal
.
biz
;
import
cn.hutool.core.text.UnicodeUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alipay.api.AlipayApiException
;
import
com.alipay.api.AlipayApiException
;
...
@@ -280,7 +279,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -280,7 +279,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
//实例化客户端
//实例化客户端
AlipayClient
alipayClient
=
new
DefaultAlipayClient
(
SystemConfig
.
ALIPAY_PAY_BASE_URL
+
"/gateway.do"
,
AlipayClient
alipayClient
=
new
DefaultAlipayClient
(
SystemConfig
.
ALIPAY_PAY_BASE_URL
+
"/gateway.do"
,
SystemConfig
.
ALIPAY_APPID
,
SystemConfig
.
ALIPAY_PRIVATE_KEY
,
AlipayConstants
.
FORMAT_JSON
,
SystemConfig
.
ALIPAY_APPID
,
SystemConfig
.
ALIPAY_PRIVATE_KEY
,
AlipayConstants
.
FORMAT_JSON
,
AlipayConstants
.
CHARSET_UTF8
,
SystemConfig
.
ALIPAY_PUBLIC_KEY
,
AlipayConstants
.
SIGN_TYPE_RSA2
);
"UTF-8"
,
SystemConfig
.
ALIPAY_PUBLIC_KEY
,
AlipayConstants
.
SIGN_TYPE_RSA2
);
orderPayVo
.
setNotifyUrl
(
notifyUrl
);
orderPayVo
.
setNotifyUrl
(
notifyUrl
);
try
{
try
{
if
(
orderPayVo
.
getPayWay
()
==
2
)
{
//支付宝APP支付
if
(
orderPayVo
.
getPayWay
()
==
2
)
{
//支付宝APP支付
...
@@ -301,31 +300,25 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -301,31 +300,25 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
BigDecimal
realAmount
=
new
BigDecimal
(
orderPayVo
.
getAmount
().
toString
()).
divide
(
new
BigDecimal
(
"100"
),
2
,
BigDecimal
.
ROUND_UP
);
BigDecimal
realAmount
=
new
BigDecimal
(
orderPayVo
.
getAmount
().
toString
()).
divide
(
new
BigDecimal
(
"100"
),
2
,
BigDecimal
.
ROUND_UP
);
AlipayTradeAppPayRequest
request
=
new
AlipayTradeAppPayRequest
();
AlipayTradeAppPayRequest
request
=
new
AlipayTradeAppPayRequest
();
//SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。
//SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。
try
{
//这里和普通的接口调用不同,使用的是sdkExecute
// request.setBizContent("{" +
// request.setBizContent("{" +
// "\"timeout_express\":\"30m\"," +
// "\"product_code\":\"QUICK_MSECURITY_PAY\"," +
// "\"total_amount\":\"" + realAmount.toString() + "\"," +
// "\"total_amount\":\"" + realAmount.toString() + "\"," +
// "\"subject\":\"" + orderPayVo.getSubject() + "\"," +
// "\"subject\":\"" + orderPayVo.getSubject() + "\"," +
// "\"body\":\"" + orderPayVo.getBody() + "\"," +
// "\"body\":\"" + orderPayVo.getBody() + "\"," +
// "\"out_trade_no\":\"" + orderPayVo.getTradeNo() + "\"" +
// "\"out_trade_no\":\"" + orderPayVo.getTradeNo() + "\"" +
// "}");
// " }");
AlipayTradeAppPayModel
model
=
new
AlipayTradeAppPayModel
();
request
.
setBizContent
(
"{"
+
//model.setBody("我是测试数据");
"\"total_amount\":\"0.01\","
+
model
.
setSubject
(
orderPayVo
.
getSubject
());
"\"subject\":\"大乐透\","
+
model
.
setOutTradeNo
(
orderPayVo
.
getTradeNo
());
"\"out_trade_no\":\"70501111111S001111119\""
+
model
.
setTimeoutExpress
(
"30m"
);
" }"
);
model
.
setTotalAmount
(
realAmount
.
toString
());
model
.
setProductCode
(
"QUICK_MSECURITY_PAY"
);
request
.
setBizModel
(
model
);
request
.
setNotifyUrl
(
orderPayVo
.
getNotifyUrl
());
request
.
setNotifyUrl
(
orderPayVo
.
getNotifyUrl
());
log
.
info
(
"请求参数:param = {}"
,
request
.
getBizModel
().
toString
());
log
.
info
(
"请求参数:param = {}"
,
request
.
getBizContent
());
try
{
//这里和普通的接口调用不同,使用的是sdkExecute
AlipayTradeAppPayResponse
response
=
alipayClient
.
sdkExecute
(
request
);
AlipayTradeAppPayResponse
response
=
alipayClient
.
sdkExecute
(
request
);
log
.
info
(
UnicodeUtil
.
toUnicode
(
response
.
getBody
()
));
//就是orderString 可以直接给客户端请求,无需再做处理。
log
.
info
(
response
.
getBody
(
));
//就是orderString 可以直接给客户端请求,无需再做处理。
return
UnicodeUtil
.
toUnicode
(
response
.
getBody
()
);
return
response
.
getBody
(
);
}
catch
(
Exception
e
)
{
}
catch
(
AlipayApi
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
return
null
;
return
null
;
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehicleBookRecordQueryVo.java
View file @
2d2ba6ee
...
@@ -46,11 +46,9 @@ public class VehicleBookRecordQueryVo extends PageParam {
...
@@ -46,11 +46,9 @@ public class VehicleBookRecordQueryVo extends PageParam {
*/
*/
private
Integer
bookType
;
private
Integer
bookType
;
private
Integer
zoneId
;
private
Integer
companyId
;
private
Integer
companyId
;
private
List
<
String
>
zoneIds
;
private
List
<
String
>
companyIds
;
private
List
<
Integer
>
companyIds
;
private
String
upkeepIds
;
private
String
upkeepIds
;
private
Integer
userCompany
;
private
Integer
userCompany
;
}
}
\ No newline at end of file
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/dto/VehiclePlanDto.java
View file @
2d2ba6ee
...
@@ -33,7 +33,6 @@ public class VehiclePlanDto extends PageParam {
...
@@ -33,7 +33,6 @@ public class VehiclePlanDto extends PageParam {
@ApiModelProperty
(
value
=
"所属分公司大区"
)
@ApiModelProperty
(
value
=
"所属分公司大区"
)
private
Integer
zoneId
;
private
Integer
zoneId
;
private
List
<
String
>
companyIds
;
private
List
<
Integer
>
companyIds
;
private
List
<
String
>
zoneIds
;
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
View file @
2d2ba6ee
...
@@ -9,6 +9,7 @@ import com.github.wxiaoqi.security.admin.feign.UserFeign;
...
@@ -9,6 +9,7 @@ import com.github.wxiaoqi.security.admin.feign.UserFeign;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
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.vo.PageDataVO
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
...
@@ -16,11 +17,10 @@ import com.xxfc.platform.vehicle.entity.BranchCompany;
...
@@ -16,11 +17,10 @@ import com.xxfc.platform.vehicle.entity.BranchCompany;
import
com.xxfc.platform.vehicle.entity.BranchCompanyStockInfo
;
import
com.xxfc.platform.vehicle.entity.BranchCompanyStockInfo
;
import
com.xxfc.platform.vehicle.entity.SysRegion
;
import
com.xxfc.platform.vehicle.entity.SysRegion
;
import
com.xxfc.platform.vehicle.mapper.BranchCompanyMapper
;
import
com.xxfc.platform.vehicle.mapper.BranchCompanyMapper
;
import
com.xxfc.platform.vehicle.util.excel.ExcelImport
;
import
com.xxfc.platform.vehicle.pojo.BranchCompanyVo
;
import
com.xxfc.platform.vehicle.pojo.BranchCompanyVo
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
import
com.xxfc.platform.vehicle.pojo.CompanySearchDTO
;
import
com.xxfc.platform.vehicle.pojo.CompanySearchDTO
;
import
com.
github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.
xxfc.platform.vehicle.util.excel.ExcelImport
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections4.map.HashedMap
;
import
org.apache.commons.collections4.map.HashedMap
;
...
@@ -44,7 +44,8 @@ import java.util.concurrent.TimeUnit;
...
@@ -44,7 +44,8 @@ import java.util.concurrent.TimeUnit;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_FALSE
;
import
static
com
.
xxfc
.
platform
.
vehicle
.
constant
.
DbColumnConstant
.*;
import
static
com
.
xxfc
.
platform
.
vehicle
.
constant
.
DbColumnConstant
.
COMPANY_ZONE_ID
;
import
static
com
.
xxfc
.
platform
.
vehicle
.
constant
.
DbColumnConstant
.
ID
;
import
static
com
.
xxfc
.
platform
.
vehicle
.
constant
.
RedisKey
.
BRANCH_COMPANY_CACHE_DATAZONE
;
import
static
com
.
xxfc
.
platform
.
vehicle
.
constant
.
RedisKey
.
BRANCH_COMPANY_CACHE_DATAZONE
;
@Service
@Service
...
@@ -92,37 +93,11 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
...
@@ -92,37 +93,11 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
}
}
Map
<
String
,
Object
>
map
=
new
HashedMap
<>();
Map
<
String
,
Object
>
map
=
new
HashedMap
<>();
map
.
put
(
"zoneId"
,
zoneId
);
map
.
put
(
"zoneId"
,
zoneId
);
String
ids
=
null
;
List
<
Integer
>
branchCompanies
=
Lists
.
newArrayList
()
;
if
(
DATA_ALL_FALSE
.
equals
(
userDTO
.
getDataAll
()))
{
//不能获取全部数据
if
(
DATA_ALL_FALSE
.
equals
(
userDTO
.
getDataAll
()))
{
//不能获取全部数据
if
(
StringUtils
.
isNotBlank
(
userDTO
.
getDataZone
()))
{
//获取权限大区ID
branchCompanies
=
vehicleBiz
.
dataCompany
(
userDTO
.
getDataZone
(),
userDTO
.
getDataCompany
());
if
(
userDTO
.
getDataZone
().
contains
(
","
))
{
ids
=
userDTO
.
getDataZone
();
}
else
{
ids
=
userDTO
.
getDataZone
()
+
","
;
}
}
else
{
ids
=
userDTO
.
getZoneId
()
+
","
;
}
String
companyId
=
null
;
if
(
Arrays
.
asList
(
ids
.
split
(
","
)).
contains
(
zoneId
+
""
))
{
//获取权限公司
if
(
StringUtils
.
isNotBlank
(
userDTO
.
getDataCompany
()))
{
if
(
userDTO
.
getDataCompany
().
contains
(
","
))
{
companyId
=
userDTO
.
getDataCompany
();
}
else
{
companyId
=
userDTO
.
getDataCompany
()
+
","
;
}
}
else
{
companyId
=
userDTO
.
getCompanyId
()
+
","
;
}
map
.
put
(
"ids"
,
companyId
.
split
(
","
));
List
<
BranchCompany
>
list
=
mapper
.
selectByZoneId
(
map
);
//查询对应大区和公司的数据
return
list
;
}
else
{
return
null
;
}
}
}
map
.
put
(
"ids"
,
null
);
map
.
put
(
"ids"
,
branchCompanies
);
return
mapper
.
selectByZoneId
(
map
);
return
mapper
.
selectByZoneId
(
map
);
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
2d2ba6ee
...
@@ -1277,34 +1277,14 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -1277,34 +1277,14 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
if
(
userDTO
==
null
)
{
if
(
userDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
235
,
"token失效"
);
return
ObjectRestResponse
.
createFailedResult
(
235
,
"token失效"
);
}
}
List
<
String
>
zoneList
=
null
;
List
<
Integer
>
companyList
=
Lists
.
newArrayList
();
List
<
String
>
companyList
=
null
;
if
(
vehiclePlanDto
.
getZoneId
()
==
null
)
{
//默认查出所有权限内的数据
if
(
DATA_ALL_FALSE
.
equals
(
userDTO
.
getDataAll
()))
{
//不能获取全部数据
if
(
DATA_ALL_FALSE
.
equals
(
userDTO
.
getDataAll
()))
{
//不能获取全部数据
String
zoneId
=
null
;
companyList
=
dataCompany
(
userDTO
.
getDataZone
(),
userDTO
.
getDataCompany
());
if
(
StringUtils
.
isNotBlank
(
userDTO
.
getDataZone
()))
{
zoneId
=
userDTO
.
getDataZone
();
}
else
{
zoneId
=
userDTO
.
getZoneId
()
+
","
;
}
zoneList
=
new
ArrayList
<>(
Arrays
.
asList
(
zoneId
.
split
(
","
)));
String
companyId
=
null
;
if
(
StringUtils
.
isNotBlank
(
userDTO
.
getDataCompany
()))
{
companyId
=
userDTO
.
getDataCompany
();
}
else
{
companyId
=
userDTO
.
getCompanyId
()
+
","
;
}
companyList
=
new
ArrayList
<>(
Arrays
.
asList
(
companyId
.
split
(
","
)));
}
}
}
if
(
vehiclePlanDto
.
getParkBranchCompanyId
()
!=
null
)
{
if
(
vehiclePlanDto
.
getParkBranchCompanyId
()
!=
null
)
{
if
(
companyList
==
null
)
{
companyList
.
add
(
vehiclePlanDto
.
getParkBranchCompanyId
());
companyList
=
Lists
.
newArrayList
();
}
companyList
.
add
(
vehiclePlanDto
.
getParkBranchCompanyId
()
+
""
);
}
}
vehiclePlanDto
.
setCompanyIds
(
companyList
);
vehiclePlanDto
.
setCompanyIds
(
companyList
);
vehiclePlanDto
.
setZoneIds
(
zoneList
);
Query
query
=
new
Query
(
vehiclePlanDto
);
Query
query
=
new
Query
(
vehiclePlanDto
);
PageDataVO
<
VehicleAndModelInfoVo
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
getVehicle
(
query
.
getSuper
()));
PageDataVO
<
VehicleAndModelInfoVo
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
getVehicle
(
query
.
getSuper
()));
return
ObjectRestResponse
.
succ
(
pageDataVO
);
return
ObjectRestResponse
.
succ
(
pageDataVO
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBookRecordBiz.java
View file @
2d2ba6ee
...
@@ -18,6 +18,7 @@ import com.xxfc.platform.vehicle.constant.RedisKey;
...
@@ -18,6 +18,7 @@ import com.xxfc.platform.vehicle.constant.RedisKey;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus
;
import
com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus
;
import
com.xxfc.platform.vehicle.entity.BookRecordAccItem
;
import
com.xxfc.platform.vehicle.entity.BookRecordAccItem
;
import
com.xxfc.platform.vehicle.entity.BranchCompany
;
import
com.xxfc.platform.vehicle.entity.VehicleBookRecord
;
import
com.xxfc.platform.vehicle.entity.VehicleBookRecord
;
import
com.xxfc.platform.vehicle.mapper.BookRecordAccItemMapper
;
import
com.xxfc.platform.vehicle.mapper.BookRecordAccItemMapper
;
import
com.xxfc.platform.vehicle.mapper.VehicleBookRecordMapper
;
import
com.xxfc.platform.vehicle.mapper.VehicleBookRecordMapper
;
...
@@ -38,11 +39,11 @@ import org.springframework.stereotype.Service;
...
@@ -38,11 +39,11 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_FALSE
;
...
@@ -64,6 +65,9 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
...
@@ -64,6 +65,9 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
@Autowired
@Autowired
private
BookRecordAccItemMapper
bookRecordAccItemMapper
;
private
BookRecordAccItemMapper
bookRecordAccItemMapper
;
@Autowired
BranchCompanyBiz
branchCompanyBiz
;
@Autowired
@Autowired
UserFeign
userFeign
;
UserFeign
userFeign
;
...
@@ -105,37 +109,14 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
...
@@ -105,37 +109,14 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
if
(
userDTO
==
null
)
{
if
(
userDTO
==
null
)
{
return
RestResponse
.
codeAndMessage
(
235
,
"token失效"
);
return
RestResponse
.
codeAndMessage
(
235
,
"token失效"
);
}
}
vehicleBookRecordQueryVo
.
setUserCompany
(
userDTO
.
getCompanyId
());
List
<
Integer
>
companyList
=
Lists
.
newArrayList
();
if
(
vehicleBookRecordQueryVo
.
getZoneId
()
==
null
)
{
//默认查出所有权限内的数据
if
(
DATA_ALL_FALSE
.
equals
(
userDTO
.
getDataAll
()))
{
//不能获取全部数据
if
(
DATA_ALL_FALSE
.
equals
(
userDTO
.
getDataAll
()))
{
//不能获取全部数据
String
zoneId
=
null
;
companyList
=
dataCompany
(
userDTO
.
getDataZone
(),
userDTO
.
getDataCompany
());
if
(
StringUtils
.
isNotBlank
(
userDTO
.
getDataZone
()))
{
}
if
(
userDTO
.
getDataZone
().
contains
(
","
))
{
if
(
vehicleBookRecordQueryVo
.
getUserCompany
()
!=
null
)
{
zoneId
=
userDTO
.
getDataZone
();
companyList
.
add
(
vehicleBookRecordQueryVo
.
getUserCompany
());
}
else
{
}
zoneId
=
userDTO
.
getDataZone
()
+
","
;
vehicleBookRecordQueryVo
.
setCompanyIds
(
companyList
);
}
}
else
{
zoneId
=
userDTO
.
getZoneId
()
+
","
;
}
vehicleBookRecordQueryVo
.
setZoneIds
(
Arrays
.
asList
(
zoneId
.
split
(
","
)));
String
companyId
=
null
;
if
(
StringUtils
.
isNotBlank
(
userDTO
.
getDataCompany
()))
{
if
(
userDTO
.
getDataCompany
().
contains
(
","
))
{
companyId
=
userDTO
.
getDataCompany
();
}
else
{
companyId
=
userDTO
.
getDataCompany
()
+
","
;
}
}
else
{
companyId
=
userDTO
.
getCompanyId
()
+
","
;
}
vehicleBookRecordQueryVo
.
setCompanyIds
(
Arrays
.
asList
(
companyId
.
split
(
","
)));
}
}
else
{
vehicleBookRecordQueryVo
.
setZoneIds
(
Arrays
.
asList
((
vehicleBookRecordQueryVo
.
getZoneId
()
+
","
).
split
(
","
)));
vehicleBookRecordQueryVo
.
setCompanyIds
(
Arrays
.
asList
((
vehicleBookRecordQueryVo
.
getLiftCompany
()
+
","
).
split
(
","
)));
}
vehicleBookRecordQueryVo
.
getCompanyIds
().
add
(
vehicleBookRecordQueryVo
.
getCompanyId
()
+
""
);
Query
query
=
new
Query
(
vehicleBookRecordQueryVo
);
Query
query
=
new
Query
(
vehicleBookRecordQueryVo
);
PageDataVO
<
VehicleBookRecordVo
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
getBookRecordInfo
(
query
.
getSuper
()));
PageDataVO
<
VehicleBookRecordVo
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
getBookRecordInfo
(
query
.
getSuper
()));
return
RestResponse
.
suc
(
pageDataVO
);
return
RestResponse
.
suc
(
pageDataVO
);
...
@@ -152,41 +133,14 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
...
@@ -152,41 +133,14 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
return
RestResponse
.
codeAndMessage
(
235
,
"token失效"
);
return
RestResponse
.
codeAndMessage
(
235
,
"token失效"
);
}
}
vehicleBookRecordQueryVo
.
setUserCompany
(
userDTO
.
getCompanyId
());
vehicleBookRecordQueryVo
.
setUserCompany
(
userDTO
.
getCompanyId
());
if
(
vehicleBookRecordQueryVo
.
getZoneId
()
==
null
)
{
//默认查出所有权限内的数据
List
<
Integer
>
companyList
=
Lists
.
newArrayList
();
if
(
DATA_ALL_FALSE
.
equals
(
userDTO
.
getDataAll
()))
{
//不能获取全部数据
if
(
DATA_ALL_FALSE
.
equals
(
userDTO
.
getDataAll
()))
{
//不能获取全部数据
String
zoneId
=
null
;
companyList
=
dataCompany
(
userDTO
.
getDataZone
(),
userDTO
.
getDataCompany
());
if
(
StringUtils
.
isNotBlank
(
userDTO
.
getDataZone
()))
{
if
(
userDTO
.
getDataZone
().
contains
(
","
))
{
zoneId
=
userDTO
.
getDataZone
();
}
else
{
zoneId
=
userDTO
.
getDataZone
()
+
","
;
}
}
else
{
zoneId
=
userDTO
.
getZoneId
()
+
","
;
}
vehicleBookRecordQueryVo
.
setZoneIds
(
Arrays
.
asList
(
zoneId
.
split
(
","
)));
String
companyId
=
null
;
if
(
StringUtils
.
isNotBlank
(
userDTO
.
getDataCompany
()))
{
if
(
userDTO
.
getDataCompany
().
contains
(
","
))
{
companyId
=
userDTO
.
getDataCompany
();
}
else
{
companyId
=
userDTO
.
getDataCompany
()
+
","
;
}
}
else
{
companyId
=
userDTO
.
getCompanyId
()
+
","
;
}
vehicleBookRecordQueryVo
.
setCompanyIds
(
Arrays
.
asList
(
companyId
.
split
(
","
)));
}
}
else
{
vehicleBookRecordQueryVo
.
setZoneIds
(
Arrays
.
asList
((
vehicleBookRecordQueryVo
.
getZoneId
()
+
","
).
split
(
","
)));
vehicleBookRecordQueryVo
.
setCompanyIds
(
Arrays
.
asList
((
vehicleBookRecordQueryVo
.
getLiftCompany
()
+
","
).
split
(
","
)));
}
}
if
(
vehicleBookRecordQueryVo
.
getCompanyId
()
!=
null
)
{
if
(
vehicleBookRecordQueryVo
.
getCompanyId
()
!=
null
)
{
if
(
vehicleBookRecordQueryVo
.
getCompanyIds
()
==
null
)
{
companyList
.
add
(
vehicleBookRecordQueryVo
.
getCompanyId
());
vehicleBookRecordQueryVo
.
setCompanyIds
(
new
ArrayList
<>());
}
vehicleBookRecordQueryVo
.
getCompanyIds
().
add
(
vehicleBookRecordQueryVo
.
getCompanyId
()
+
""
);
}
}
vehicleBookRecordQueryVo
.
setCompanyIds
(
companyList
.
size
()
>
0
?
companyList
:
null
);
Query
query
=
new
Query
(
vehicleBookRecordQueryVo
);
Query
query
=
new
Query
(
vehicleBookRecordQueryVo
);
PageDataVO
<
VehicleBookRecordVo
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
getBookRecordInfo
(
query
.
getSuper
()));
PageDataVO
<
VehicleBookRecordVo
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
getBookRecordInfo
(
query
.
getSuper
()));
return
RestResponse
.
suc
(
pageDataVO
);
return
RestResponse
.
suc
(
pageDataVO
);
...
@@ -493,6 +447,16 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
...
@@ -493,6 +447,16 @@ public class VehicleBookRecordBiz extends BaseBiz<VehicleBookRecordMapper, Vehic
private
void
createAccItemTbIfNotExists
(
String
tbName
){
private
void
createAccItemTbIfNotExists
(
String
tbName
){
bookRecordAccItemMapper
.
createTbIfNotExists
(
tbName
);
bookRecordAccItemMapper
.
createTbIfNotExists
(
tbName
);
}
}
public
List
<
Integer
>
dataCompany
(
String
dataZone
,
String
dataCompany
)
{
List
<
BranchCompany
>
zoneCompanys
=
branchCompanyBiz
.
dataCompany
(
dataZone
);
//((VehicleBiz)AopContext.currentProxy()).dataCompany(dataZone);
List
<
Integer
>
zoneCompanyIds
=
zoneCompanys
.
parallelStream
().
map
(
BranchCompany:
:
getId
).
collect
(
Collectors
.
toList
());
if
(
StringUtils
.
isNotBlank
(
dataCompany
))
{
List
<
Integer
>
dataCompanyIds
=
Arrays
.
asList
(
dataCompany
.
split
(
","
)).
parallelStream
().
map
(
s
->
Integer
.
valueOf
(
s
)).
collect
(
Collectors
.
toList
());
zoneCompanyIds
.
addAll
(
dataCompanyIds
);
}
//去重
return
zoneCompanyIds
.
parallelStream
().
distinct
().
collect
(
Collectors
.
toList
());
}
}
}
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/BranchCompanyMapper.xml
View file @
2d2ba6ee
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
<select
id=
"selectByZoneId"
parameterType=
"java.util.Map"
resultType=
"com.xxfc.platform.vehicle.entity.BranchCompany"
>
<select
id=
"selectByZoneId"
parameterType=
"java.util.Map"
resultType=
"com.xxfc.platform.vehicle.entity.BranchCompany"
>
select * from branch_company
select * from branch_company
where zone_id = #{zoneId}
where zone_id = #{zoneId}
<if
test=
"ids != null"
>
<if
test=
"ids != null
and ids.size > 0
"
>
and id in
and id in
<foreach
collection=
"ids"
item=
"id"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"ids"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
#{id}
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleBookRecordMapper.xml
View file @
2d2ba6ee
...
@@ -395,19 +395,13 @@
...
@@ -395,19 +395,13 @@
<if
test=
"bookType != null"
>
<if
test=
"bookType != null"
>
and v1.book_type = #{bookType}
and v1.book_type = #{bookType}
</if>
</if>
<if
test=
"companyIds != null"
>
<if
test=
"companyIds != null
and companyIds.size > 0
"
>
and v1.lift_company in
and v1.lift_company in
<foreach
collection=
"companyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"companyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
#{id}
</foreach>
</foreach>
</if>
</if>
<if
test=
"zoneIds != null"
>
and bc1.zone_id in
<foreach
collection=
"zoneIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</if>
and v1.status between 1 and 2
and v1.status between 1 and 2
</where>
</where>
...
@@ -433,7 +427,7 @@
...
@@ -433,7 +427,7 @@
<if
test=
"bookType != null"
>
<if
test=
"bookType != null"
>
and v1.book_type = #{bookType}
and v1.book_type = #{bookType}
</if>
</if>
<if
test=
"companyIds != null"
>
<if
test=
"companyIds != null
and companyIds.size > 0
"
>
and (v1.lift_company in
and (v1.lift_company in
<foreach
collection=
"companyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"companyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
#{id}
...
@@ -443,12 +437,6 @@
...
@@ -443,12 +437,6 @@
#{id}
#{id}
</foreach>
)
</foreach>
)
</if>
</if>
<if
test=
"zoneIds != null"
>
and bc1.zone_id in
<foreach
collection=
"zoneIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</if>
<if
test=
"status != null"
>
<if
test=
"status != null"
>
and v1.status = #{status}
and v1.status = #{status}
</if>
</if>
...
...
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