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
e451f2af
Commit
e451f2af
authored
Jun 28, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/base-modify' into base-modify
parents
2da8b4b9
cb38c417
Changes
30
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
651 additions
and
88 deletions
+651
-88
AuthBootstrap.java
.../java/com/github/wxiaoqi/security/auth/AuthBootstrap.java
+1
-1
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+1
-0
UserBiz.java
...erver/src/main/java/com/xxfc/platform/im/biz/UserBiz.java
+10
-3
ImQuestionMapper.xml
...-im-server/src/main/resources/mapper/ImQuestionMapper.xml
+1
-1
OrderUserLicense.java
...java/com/xxfc/platform/order/entity/OrderUserLicense.java
+37
-0
OrderVehicaleCrosstown.java
...om/xxfc/platform/order/entity/OrderVehicaleCrosstown.java
+5
-25
OrderPageVO.java
.../java/com/xxfc/platform/order/pojo/order/OrderPageVO.java
+5
-0
OrderVehicleCrosstownDto.java
...c/platform/order/pojo/order/OrderVehicleCrosstownDto.java
+28
-0
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+57
-19
OrderTourVerificationBiz.java
...com/xxfc/platform/order/biz/OrderTourVerificationBiz.java
+2
-0
OrderUserLicenseBiz.java
...java/com/xxfc/platform/order/biz/OrderUserLicenseBiz.java
+73
-0
OrderVehicalCrosstownBiz.java
...com/xxfc/platform/order/biz/OrderVehicalCrosstownBiz.java
+3
-2
OrderUserLicenseMapper.java
...om/xxfc/platform/order/mapper/OrderUserLicenseMapper.java
+10
-0
OrderVehicaleCrosstownMapper.java
...c/platform/order/mapper/OrderVehicaleCrosstownMapper.java
+2
-1
BaseOrderController.java
...ava/com/xxfc/platform/order/rest/BaseOrderController.java
+1
-1
OrderUserLicenseController.java
.../xxfc/platform/order/rest/OrderUserLicenseController.java
+40
-0
OrderVehicleCrosstownController.java
.../platform/order/rest/OrderVehicleCrosstownController.java
+66
-21
generatorConfig.xml
...der-server/src/main/resources/builder/generatorConfig.xml
+2
-2
BaseOrderMapper.xml
...rder-server/src/main/resources/mapper/BaseOrderMapper.xml
+2
-2
OrderUserLicenseMapper.xml
...rver/src/main/resources/mapper/OrderUserLicenseMapper.xml
+19
-0
OrderVehicaleCrosstownMapper.xml
...rc/main/resources/mapper/OrderVehicaleCrosstownMapper.xml
+2
-5
Dictionary.java
...n/java/com/xxfc/platform/universal/entity/Dictionary.java
+37
-0
DictionaryVo.java
...ain/java/com/xxfc/platform/universal/vo/DictionaryVo.java
+13
-0
DictionaryBiz.java
...n/java/com/xxfc/platform/universal/biz/DictionaryBiz.java
+122
-0
DictionaryController.java
...c/platform/universal/controller/DictionaryController.java
+48
-0
DictionaryMapper.java
.../com/xxfc/platform/universal/mapper/DictionaryMapper.java
+15
-0
DictionaryMapper.xml
...sal-server/src/main/resources/mapper/DictionaryMapper.xml
+36
-0
VehicleUserLicense.java
.../com/xxfc/platform/vehicle/entity/VehicleUserLicense.java
+4
-4
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+4
-0
VehicleLicenseController.java
.../xxfc/platform/vehicle/rest/VehicleLicenseController.java
+5
-1
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/AuthBootstrap.java
View file @
e451f2af
...
...
@@ -13,7 +13,7 @@ import tk.mybatis.spring.annotation.MapperScan;
*/
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
(
defaultConfiguration
=
HeaderConfig
.
class
)
@EnableFeignClients
@MapperScan
(
"com.github.wxiaoqi.security.auth.mapper"
)
//@EnableAutoConfiguration
public
class
AuthBootstrap
{
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
e451f2af
...
...
@@ -240,6 +240,7 @@ public class AppPermissionService {
userLogin
.
setImUserid
(
imUserId
);
userLogin
.
setUsername
(
username
);
appUserLoginBiz
.
updateSelectiveById
(
userLogin
);
log
.
info
(
username
+
"----userLogin updateSelectiveById---username====="
+
username
+
"----imPassword===="
+
imPassword
);
}
data
.
put
(
"imToken"
,
access_token
);
data
.
put
(
"imUserId"
,
imUserId
);
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/UserBiz.java
View file @
e451f2af
...
...
@@ -5,8 +5,10 @@ import com.github.wxiaoqi.security.admin.feign.UserFeign;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.common.msg.BaseResponse
;
import
com.xxfc.platform.im.model.User
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
...
...
@@ -23,6 +25,7 @@ import java.util.HashMap;
import
java.util.Map
;
@Component
@Slf4j
public
class
UserBiz
{
@Autowired
...
...
@@ -31,6 +34,9 @@ public class UserBiz {
@Autowired
UserFeign
userFeign
;
@Value
(
"${im.url}"
)
String
imUrl
;
/**
* 注册
* @param map
...
...
@@ -48,8 +54,7 @@ public class UserBiz {
if
(
map
.
get
(
"nickname"
)
!=
null
&&
!(
""
).
equals
(
map
.
get
(
"nickname"
))){
str
+=
"nickname="
+
map
.
get
(
"nickname"
).
toString
();
}
String
result
=
this
.
doPost
(
"http://10.5.52.3:6688/xxfcim/user/register"
,
str
)
;
String
result
=
this
.
doPost
(
imUrl
+
"/xxfcim/user/register"
,
str
)
;
JSONObject
json
=
JSONObject
.
parseObject
(
result
);
//如果已经注册过,查询出手机号对应用户信息执行登录返回
if
(
0
==
json
.
getInteger
(
"resultCode"
)){
...
...
@@ -72,6 +77,7 @@ public class UserBiz {
baseResponse
.
setStatus
(
200
);
baseResponse
.
setMessage
(
result
);
log
.
info
(
"用户注册:result = {}, telephone = {}, password = {}, nickname = {}"
,
result
,
map
.
get
(
"telephone"
),
map
.
get
(
"password"
),
map
.
get
(
"nickname"
));
return
baseResponse
;
}
...
...
@@ -93,8 +99,9 @@ public class UserBiz {
str
+=
"password="
+
map
.
get
(
"password"
).
toString
();
}
str
+=
"&areaCode=86"
;
String
result
=
this
.
doPost
(
"http://10.5.52.3:6688
/xxfcim/user/login"
,
str
)
;
String
result
=
this
.
doPost
(
imUrl
+
"
/xxfcim/user/login"
,
str
)
;
JSONObject
json
=
JSONObject
.
parseObject
(
result
);
log
.
info
(
"用户登录:result = {}, telephone = {}, password = {}, userId = {}"
,
result
,
map
.
get
(
"telephone"
),
map
.
get
(
"password"
),
map
.
get
(
"userId"
));
json
.
put
(
"password"
,
map
.
get
(
"password"
).
toString
());
return
json
.
toJSONString
();
}
...
...
xx-im/xx-im-server/src/main/resources/mapper/ImQuestionMapper.xml
View file @
e451f2af
...
...
@@ -42,7 +42,7 @@
and is_del = #{isDel}
</if>
</where>
order by
time
DESC
order by
praise_count, comment_count
DESC
</select>
</mapper>
\ No newline at end of file
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/OrderUserLicense.java
0 → 100644
View file @
e451f2af
package
com
.
xxfc
.
platform
.
order
.
entity
;
import
lombok.Data
;
import
javax.persistence.*
;
@Table
(
name
=
"order_user_license"
)
@Data
public
class
OrderUserLicense
{
@Id
private
Integer
id
;
/**
* 驾驶人
*/
@Column
(
name
=
"license_name"
)
private
String
licenseName
;
/**
* 驾驶人手机号
*/
@Column
(
name
=
"license_phone"
)
private
String
licensePhone
;
/**
* 驾驶人身份证号
*/
@Column
(
name
=
"license_id_card"
)
private
String
licenseIdCard
;
/**
* 驾驶证照
*/
@Column
(
name
=
"license_img"
)
private
String
licenseImg
;
}
\ No newline at end of file
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/OrderVehicaleCrosstown.java
View file @
e451f2af
package
com
.
xxfc
.
platform
.
order
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.RequiredArgsConstructor
;
import
javax.persistence.*
;
@Table
(
name
=
"order_vehicle_crosstown"
)
@Data
@RequiredArgsConstructor
public
class
OrderVehicaleCrosstown
{
/**
* 主键id
...
...
@@ -28,23 +25,6 @@ public class OrderVehicaleCrosstown {
@Column
(
name
=
"order_no"
)
private
String
orderNo
;
/**
* 驾驶人
*/
@Column
(
name
=
"license_name"
)
private
String
licenseName
;
/**
* 驾驶人手机号
*/
@Column
(
name
=
"license_phone"
)
private
String
licensePhone
;
/**
* 驾驶证照
*/
@Column
(
name
=
"license_img"
)
private
String
licenseImg
;
/**
* 公里数(公里)
...
...
@@ -122,11 +102,6 @@ public class OrderVehicaleCrosstown {
*/
private
String
dedDetail
;
/**
* 驾驶人身份证号
*/
private
String
licenseIdCard
;
/**
* 1、交车, 2、还车
*/
...
...
@@ -141,4 +116,9 @@ public class OrderVehicaleCrosstown {
* 剩余押金
*/
private
Integer
restDeposit
;
/**
* 驾驶人Id
*/
private
String
userLicenseId
;
}
\ No newline at end of file
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/OrderPageVO.java
View file @
e451f2af
...
...
@@ -15,14 +15,19 @@ public class OrderPageVO extends BaseOrder {
public
static
final
String
NO
=
"no="
;
OrderRentVehicleDetail
orderRentVehicleDetail
;
OrderTourDetail
orderTourDetail
;
List
<
VehicleUserLicense
>
vehicleUserLicenses
;
private
String
username
;
private
String
vehicalNumberPlat
;
private
String
qrcodeStr
;
private
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
;
public
void
setQrcodeStr
(
String
prefix
)
{
this
.
qrcodeStr
=
prefix
+
"?"
+
TYPE
+
getType
()+
"&"
+
NO
+
getNo
();
}
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/OrderVehicleCrosstownDto.java
0 → 100644
View file @
e451f2af
package
com
.
xxfc
.
platform
.
order
.
pojo
.
order
;
import
com.xxfc.platform.order.entity.OrderVehicaleCrosstown
;
import
lombok.Data
;
@Data
public
class
OrderVehicleCrosstownDto
extends
OrderVehicaleCrosstown
{
String
userLicenses
;
/**
* 驾驶人
*/
private
String
licenseName
;
/**
* 驾驶人手机号
*/
private
String
licensePhone
;
/**
* 驾驶证照
*/
private
String
licenseImg
;
/**
* 驾驶人身份证号
*/
private
String
licenseIdCard
;
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
e451f2af
...
...
@@ -5,6 +5,7 @@ import com.github.wxiaoqi.security.admin.dto.UserMemberDTO;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.google.common.collect.Lists
;
import
com.xxfc.platform.order.contant.enumerate.OrderStatusEnum
;
...
...
@@ -13,9 +14,11 @@ import com.xxfc.platform.order.contant.enumerate.RefundTypeEnum;
import
com.xxfc.platform.order.entity.*
;
import
com.xxfc.platform.order.mapper.BaseOrderMapper
;
import
com.xxfc.platform.order.pojo.order.OrderPageVO
;
import
com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto
;
import
com.xxfc.platform.tour.feign.TourFeign
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.universal.vo.OrderRefundVo
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.entity.VehicleUserLicense
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -52,6 +55,12 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
@Autowired
OrderRentVehicleBiz
orderRentVehicleBiz
;
@Autowired
OrderVehicalCrosstownBiz
orderVehicalCrosstownBiz
;
@Autowired
OrderUserLicenseBiz
orderUserLicenseBiz
;
@Autowired
OrderRefundBiz
orderRefundBiz
;
...
...
@@ -100,27 +109,56 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
* @param no
* @return
*/
public
O
rderPageVO
getOrderDetail
(
String
no
)
{
public
O
bjectRestResponse
getOrderDetail
(
String
no
)
{
OrderPageVO
orderPageVo
=
mapper
.
getOrderDetail
(
no
);
String
myDriverIds
=
orderPageVo
.
getOrderRentVehicleDetail
().
getMyDriverIds
();
List
<
VehicleUserLicense
>
vehicleUserLicenses
=
Lists
.
newArrayList
();
if
(
StringUtils
.
isNotBlank
(
myDriverIds
))
{
if
(
myDriverIds
.
contains
(
","
))
{
String
[]
ids
=
myDriverIds
.
split
(
","
);
try
{
for
(
String
id
:
ids
)
{
vehicleUserLicenses
.
add
(
vehicleFeign
.
one
(
Integer
.
parseInt
(
id
)).
getData
());
}
}
catch
(
Exception
e
)
{
}
}
else
{
try
{
vehicleUserLicenses
.
add
(
vehicleFeign
.
one
(
Integer
.
parseInt
(
myDriverIds
)).
getData
());
}
catch
(
Exception
e
){}
}
if
(
orderPageVo
==
null
)
{
return
ObjectRestResponse
.
createDefaultFail
();
}
orderPageVo
.
setVehicleUserLicenses
(
vehicleUserLicenses
);
return
orderPageVo
;
if
(
orderPageVo
.
getStatus
()
>=
5
)
{
//出行中 已交车
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
=
new
OrderVehicleCrosstownDto
();
orderVehicleCrosstownDto
.
setOrderId
(
orderPageVo
.
getId
());
orderVehicleCrosstownDto
.
setOrderNo
(
orderPageVo
.
getNo
());
List
<
OrderVehicaleCrosstown
>
orderVehicaleCrosstowns
=
orderVehicalCrosstownBiz
.
selectByOrderId
(
orderVehicleCrosstownDto
);
if
(
orderVehicaleCrosstowns
!=
null
&&
orderVehicaleCrosstowns
.
size
()
>
0
)
{
List
<
OrderUserLicense
>
orderUserLicenses
=
orderUserLicenseBiz
.
selectByIds
(
orderVehicaleCrosstowns
.
get
(
0
).
getUserLicenseId
()).
getData
();
if
(
orderUserLicenses
!=
null
&&
orderUserLicenses
.
size
()
>
0
)
{
orderVehicleCrosstownDto
.
setLicenseIdCard
(
orderUserLicenses
.
get
(
0
).
getLicenseIdCard
());
orderVehicleCrosstownDto
.
setLicenseImg
(
orderUserLicenses
.
get
(
0
).
getLicenseImg
());
orderVehicleCrosstownDto
.
setLicenseName
(
orderUserLicenses
.
get
(
0
).
getLicenseName
());
orderVehicleCrosstownDto
.
setLicensePhone
(
orderUserLicenses
.
get
(
0
).
getLicensePhone
());
}
}
orderPageVo
.
setOrderVehicleCrosstownDto
(
orderVehicleCrosstownDto
);
}
else
{
//未交车
List
<
VehicleUserLicense
>
vehicleUserLicenses
=
Lists
.
newArrayList
();
String
myDriverIds
=
orderPageVo
.
getOrderRentVehicleDetail
().
getMyDriverIds
();
if
(
StringUtils
.
isNotBlank
(
myDriverIds
))
{
if
(
myDriverIds
.
contains
(
","
))
{
String
[]
ids
=
myDriverIds
.
split
(
","
);
try
{
//目前暂定一个驾驶人,后期需要更改再此更改
RestResponse
<
VehicleUserLicense
>
restResponse
=
vehicleFeign
.
getOne
(
Integer
.
parseInt
(
ids
[
0
]));
log
.
info
(
restResponse
.
getMessage
());
if
(
restResponse
.
getData
()
!=
null
)
{
vehicleUserLicenses
.
add
(
restResponse
.
getData
());
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
else
{
try
{
vehicleUserLicenses
.
add
(
vehicleFeign
.
one
(
Integer
.
parseInt
(
myDriverIds
)).
getData
());
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
}
orderPageVo
.
setVehicleUserLicenses
(
vehicleUserLicenses
);
}
return
ObjectRestResponse
.
succ
(
orderPageVo
);
}
/**
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderTourVerificationBiz.java
View file @
e451f2af
...
...
@@ -61,6 +61,7 @@ public class OrderTourVerificationBiz{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"订单不是已支付状态"
);
}
Integer
orderId
=
baseOrder
.
getId
();
Integer
version
=
baseOrder
.
getVersion
();
OrderTourDetail
tourDetail
=
new
OrderTourDetail
();
tourDetail
.
setOrderId
(
orderId
);
tourDetail
=
tourDetailBiz
.
selectOne
(
tourDetail
);
...
...
@@ -81,6 +82,7 @@ public class OrderTourVerificationBiz{
baseOrder
=
new
BaseOrder
();
baseOrder
.
setId
(
orderId
);
baseOrder
.
setStatus
(
OrderStatusEnum
.
ORDER_FINISH
.
getCode
());
baseOrder
.
setVersion
(
version
);
baseOrderBiz
.
updateSelectiveById
(
baseOrder
);
tourDetail
.
setVerificationUser
(
userDTO
.
getId
());
tourDetail
.
setVerificationName
(
userDTO
.
getName
());
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderUserLicenseBiz.java
0 → 100644
View file @
e451f2af
package
com
.
xxfc
.
platform
.
order
.
biz
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.google.common.collect.Lists
;
import
com.xxfc.platform.order.entity.OrderUserLicense
;
import
com.xxfc.platform.order.mapper.OrderUserLicenseMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
@Service
@Slf4j
public
class
OrderUserLicenseBiz
extends
BaseBiz
<
OrderUserLicenseMapper
,
OrderUserLicense
>
{
/**
* 添加驾驶人信息
* @param orderUserLicense
* @return
*/
public
ObjectRestResponse
<
OrderUserLicense
>
add
(
OrderUserLicense
orderUserLicense
)
{
if
(
orderUserLicense
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
OrderUserLicense
oldValue
=
mapper
.
selectByLicenseIdCard
(
orderUserLicense
.
getLicenseIdCard
());
if
(
oldValue
==
null
)
{
mapper
.
insertSelective
(
orderUserLicense
);
return
ObjectRestResponse
.
succ
(
mapper
.
selectByLicenseIdCard
(
orderUserLicense
.
getLicenseIdCard
()));
}
BeanUtil
.
copyProperties
(
orderUserLicense
,
oldValue
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
mapper
.
updateByPrimaryKeySelective
(
oldValue
);
return
ObjectRestResponse
.
succ
(
mapper
.
selectByLicenseIdCard
(
oldValue
.
getLicenseIdCard
()));
}
/**
* 根据id获取信息
* @param ids
* @return
*/
public
ObjectRestResponse
<
List
<
OrderUserLicense
>>
selectByIds
(
String
ids
)
{
if
(
StringUtils
.
isBlank
(
ids
))
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
List
<
OrderUserLicense
>
orderUserLicenses
=
Lists
.
newArrayList
();
if
(
ids
.
contains
(
","
))
{
String
[]
licenseIds
=
ids
.
split
(
","
);
for
(
String
license
:
licenseIds
)
{
OrderUserLicense
orderUserLicense
=
selectById
(
Integer
.
parseInt
(
license
));
if
(
orderUserLicense
!=
null
)
orderUserLicenses
.
add
(
orderUserLicense
);
}
}
else
{
OrderUserLicense
orderUserLicense
=
selectById
(
Integer
.
parseInt
(
ids
));
if
(
orderUserLicense
!=
null
)
orderUserLicenses
.
add
(
orderUserLicense
);
}
return
ObjectRestResponse
.
succ
(
orderUserLicenses
);
}
public
ObjectRestResponse
<
OrderUserLicense
>
selectByUserIdCard
(
String
licenseIdCard
)
{
if
(
StringUtils
.
isBlank
(
licenseIdCard
))
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
OrderUserLicense
orderUserLicense
=
mapper
.
selectByLicenseIdCard
(
licenseIdCard
);
return
ObjectRestResponse
.
succ
(
orderUserLicense
);
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderVehicalCrosstownBiz.java
View file @
e451f2af
...
...
@@ -4,6 +4,7 @@ import com.ace.cache.annotation.Cache;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.xxfc.platform.order.entity.OrderVehicaleCrosstown
;
import
com.xxfc.platform.order.mapper.OrderVehicaleCrosstownMapper
;
import
com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
...
...
@@ -15,7 +16,7 @@ public class OrderVehicalCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
return
selectById
(
id
);
}
public
List
<
OrderVehicaleCrosstown
>
selectByOrderId
(
OrderVehic
aleCrosstown
orderVehicaleCrosstown
)
{
return
mapper
.
selectByOrderId
(
orderVehic
aleCrosstown
);
public
List
<
OrderVehicaleCrosstown
>
selectByOrderId
(
OrderVehic
leCrosstownDto
orderVehicleCrosstownDto
)
{
return
mapper
.
selectByOrderId
(
orderVehic
leCrosstownDto
);
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mapper/OrderUserLicenseMapper.java
0 → 100644
View file @
e451f2af
package
com
.
xxfc
.
platform
.
order
.
mapper
;
import
com.xxfc.platform.order.entity.OrderUserLicense
;
import
tk.mybatis.mapper.common.Mapper
;
public
interface
OrderUserLicenseMapper
extends
Mapper
<
OrderUserLicense
>
{
OrderUserLicense
selectByLicenseIdCard
(
String
licenseIdCard
);
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mapper/OrderVehicaleCrosstownMapper.java
View file @
e451f2af
package
com
.
xxfc
.
platform
.
order
.
mapper
;
import
com.xxfc.platform.order.entity.OrderVehicaleCrosstown
;
import
com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
public
interface
OrderVehicaleCrosstownMapper
extends
Mapper
<
OrderVehicaleCrosstown
>
{
List
<
OrderVehicaleCrosstown
>
selectByOrderId
(
OrderVehic
aleCrosstown
orderVehicaleCrosstown
);
List
<
OrderVehicaleCrosstown
>
selectByOrderId
(
OrderVehic
leCrosstownDto
orderVehicleCrosstownDto
);
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BaseOrderController.java
View file @
e451f2af
...
...
@@ -191,7 +191,7 @@ public class BaseOrderController extends CommonBaseController {
if
(
StringUtils
.
isBlank
(
orderNo
))
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
return
ObjectRestResponse
.
succ
(
baseOrderBiz
.
getOrderDetail
(
orderNo
)
);
return
baseOrderBiz
.
getOrderDetail
(
orderNo
);
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderUserLicenseController.java
0 → 100644
View file @
e451f2af
package
com
.
xxfc
.
platform
.
order
.
rest
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.order.biz.OrderUserLicenseBiz
;
import
com.xxfc.platform.order.entity.OrderUserLicense
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@RequestMapping
(
value
=
"/orderUserLicense"
)
@Api
(
value
=
"订单驾驶员信息"
)
public
class
OrderUserLicenseController
{
@Autowired
OrderUserLicenseBiz
orderUserLicenseBiz
;
@PostMapping
(
value
=
"/add"
)
@ApiOperation
(
value
=
"添加订单驾驶员信息"
)
public
ObjectRestResponse
add
(
OrderUserLicense
orderUserLicense
)
{
return
orderUserLicenseBiz
.
add
(
orderUserLicense
);
}
@GetMapping
(
value
=
"/getUserLicenseById"
)
@ApiOperation
(
value
=
"根据id获取驾驶人信息"
)
public
ObjectRestResponse
getUserLicenseById
(
String
userLicenseIds
)
{
return
orderUserLicenseBiz
.
selectByIds
(
userLicenseIds
);
}
@GetMapping
(
value
=
"/selectByUserIdCard"
)
@ApiOperation
(
value
=
"根据身份证号获取驾驶人信息"
)
public
ObjectRestResponse
selectByUserIdCard
(
String
licenseIdCard
)
{
return
orderUserLicenseBiz
.
selectByUserIdCard
(
licenseIdCard
);
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderVehicleCrosstownController.java
View file @
e451f2af
...
...
@@ -2,13 +2,21 @@ package com.xxfc.platform.order.rest;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.order.biz.BaseOrderBiz
;
import
com.xxfc.platform.order.biz.OrderUserLicenseBiz
;
import
com.xxfc.platform.order.biz.OrderVehicalCrosstownBiz
;
import
com.xxfc.platform.order.entity.BaseOrder
;
import
com.xxfc.platform.order.entity.OrderUserLicense
;
import
com.xxfc.platform.order.entity.OrderVehicaleCrosstown
;
import
com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
...
...
@@ -22,27 +30,51 @@ public class OrderVehicleCrosstownController {
@Autowired
OrderVehicalCrosstownBiz
orderVehicalCrosstownBiz
;
@Autowired
OrderUserLicenseBiz
orderUserLicenseBiz
;
@Autowired
BaseOrderBiz
baseOrderBiz
;
@PostMapping
(
value
=
"/add"
)
@ApiOperation
(
value
=
"添加交还车记录"
)
public
ObjectRestResponse
<?>
add
(
OrderVehicaleCrosstown
orderVehicaleCrosstown
)
{
log
.
info
(
"添加的参数:orderVehicaleCrosstown = {}"
,
orderVehicaleCrosstown
);
if
(
orderVehicaleCrosstown
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
500
,
"参数为空!"
);
}
if
(
orderVehicaleCrosstown
.
getId
()
!=
null
)
{
OrderVehicaleCrosstown
oldValue
=
orderVehicalCrosstownBiz
.
get
(
orderVehicaleCrosstown
.
getId
());
if
(
oldValue
!=
null
)
{
BeanUtil
.
copyProperties
(
orderVehicaleCrosstown
,
oldValue
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
orderVehicalCrosstownBiz
.
updateSelectiveById
(
oldValue
);
return
ObjectRestResponse
.
succ
();
@Transactional
public
ObjectRestResponse
<
OrderVehicleCrosstownDto
>
add
(
@RequestBody
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
)
{
log
.
info
(
"添加的参数:orderVehicaleCrosstown = {}"
,
orderVehicleCrosstownDto
);
if
(
orderVehicleCrosstownDto
==
null
||
orderVehicleCrosstownDto
.
getOrderId
()
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
500
,
"参数为空!"
);
}
orderVehicalCrosstownBiz
.
insertSelective
(
orderVehicaleCrosstown
);
return
ObjectRestResponse
.
succ
();
}
else
{
orderVehicalCrosstownBiz
.
insertSelective
(
orderVehicaleCrosstown
);
return
ObjectRestResponse
.
succ
();
}
BaseOrder
baseOrder
=
baseOrderBiz
.
selectById
(
orderVehicleCrosstownDto
.
getOrderId
());
if
(
baseOrder
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
500
,
"订单不存在!"
);
}
List
<
OrderVehicaleCrosstown
>
oldValue
=
orderVehicalCrosstownBiz
.
selectByOrderId
(
orderVehicleCrosstownDto
);
if
(
oldValue
.
size
()
==
1
)
{
//已有直接返回
//交车完成 设置订单状态为出行中
if
(
baseOrder
.
getStatus
()
==
4
)
{
baseOrder
.
setStatus
(
5
);
baseOrderBiz
.
updateSelectiveById
(
baseOrder
);
}
OrderVehicleCrosstownDto
vehicleCrosstownDto
=
new
OrderVehicleCrosstownDto
();
BeanUtil
.
copyProperties
(
oldValue
.
get
(
0
),
vehicleCrosstownDto
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
List
<
OrderUserLicense
>
orderUserLicenses
=
orderUserLicenseBiz
.
selectByIds
(
oldValue
.
get
(
0
).
getUserLicenseId
()).
getData
();
if
(
orderUserLicenses
!=
null
&&
orderUserLicenses
.
size
()
>
0
)
{
orderVehicleCrosstownDto
.
setLicenseIdCard
(
orderUserLicenses
.
get
(
0
).
getLicenseIdCard
());
orderVehicleCrosstownDto
.
setLicenseImg
(
orderUserLicenses
.
get
(
0
).
getLicenseImg
());
orderVehicleCrosstownDto
.
setLicenseName
(
orderUserLicenses
.
get
(
0
).
getLicenseName
());
orderVehicleCrosstownDto
.
setLicensePhone
(
orderUserLicenses
.
get
(
0
).
getLicensePhone
());
}
return
ObjectRestResponse
.
succ
(
vehicleCrosstownDto
);
}
else
if
(
oldValue
.
size
()
<=
0
)
{
getOrderLicense
(
orderVehicleCrosstownDto
);
orderVehicalCrosstownBiz
.
insertSelective
(
orderVehicleCrosstownDto
);
//交车完成 设置订单状态为出行中
baseOrder
.
setStatus
(
5
);
baseOrderBiz
.
updateSelectiveById
(
baseOrder
);
return
ObjectRestResponse
.
succ
(
orderVehicleCrosstownDto
);
}
return
ObjectRestResponse
.
createDefaultFail
();
}
@GetMapping
(
value
=
"/{id}"
)
...
...
@@ -53,11 +85,24 @@ public class OrderVehicleCrosstownController {
@GetMapping
(
value
=
"/getByOrderId"
)
@ApiOperation
(
value
=
"根据订单Id获取所有记录信息"
)
public
ObjectRestResponse
<
List
<
OrderVehicaleCrosstown
>>
getByOrderId
(
OrderVehic
aleCrosstown
orderVehicaleCrosstown
)
{
if
(
orderVehic
aleCrosstown
==
null
)
{
public
ObjectRestResponse
<
List
<
OrderVehicaleCrosstown
>>
getByOrderId
(
OrderVehic
leCrosstownDto
orderVehicleCrosstownDto
)
{
if
(
orderVehic
leCrosstownDto
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
500
,
"参数orderId为空"
);
}
return
ObjectRestResponse
.
succ
(
orderVehicalCrosstownBiz
.
selectByOrderId
(
orderVehicaleCrosstown
));
return
ObjectRestResponse
.
succ
(
orderVehicalCrosstownBiz
.
selectByOrderId
(
orderVehicleCrosstownDto
));
}
public
void
getOrderLicense
(
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
)
{
OrderUserLicense
orderUserLicense
=
new
OrderUserLicense
();
orderUserLicense
.
setLicenseIdCard
(
orderVehicleCrosstownDto
.
getLicenseIdCard
());
orderUserLicense
.
setLicenseImg
(
orderVehicleCrosstownDto
.
getLicenseImg
());
orderUserLicense
.
setLicenseName
(
orderVehicleCrosstownDto
.
getLicenseName
());
orderUserLicense
.
setLicensePhone
(
orderVehicleCrosstownDto
.
getLicensePhone
());
if
(
orderUserLicense
!=
null
)
{
Integer
id
=
orderUserLicenseBiz
.
add
(
orderUserLicense
).
getData
().
getId
();
orderVehicleCrosstownDto
.
setUserLicenseId
(
id
+
""
);
}
}
}
xx-order/xx-order-server/src/main/resources/builder/generatorConfig.xml
View file @
e451f2af
...
...
@@ -15,7 +15,7 @@
</plugin>
<jdbcConnection
driverClass=
"com.mysql.jdbc.Driver"
connectionURL=
"jdbc:mysql://10.5.52.3:3306/xxfc_
order
?useUnicode=true&characterEncoding=UTF8"
connectionURL=
"jdbc:mysql://10.5.52.3:3306/xxfc_
third_platform
?useUnicode=true&characterEncoding=UTF8"
userId=
"root"
password=
"sslcloud123*()"
>
</jdbcConnection>
...
...
@@ -37,7 +37,7 @@
<!-- </table>-->
<!-- <table tableName="branch_company_stock_info" domainObjectName="BranchCompanyStockInfo"></table>-->
<!-- <table tableName="branch_company_stock_apply_info" domainObjectName="BranchCompanyStockApplyInfo"></table>-->
<table
tableName=
"
order_vehicle_crosstown"
domainObjectName=
"OrderVehicaleCrosstown
"
></table>
<table
tableName=
"
dictionary"
domainObjectName=
"Dictionary
"
></table>
<!-- <table tableName="vehicle_upkeep_log" domainObjectName="VehicleUpkeepLog"></table>-->
</context>
</generatorConfiguration>
\ No newline at end of file
xx-order/xx-order-server/src/main/resources/mapper/BaseOrderMapper.xml
View file @
e451f2af
...
...
@@ -138,8 +138,8 @@
</select>
<select
id=
"getOrderDetail"
parameterType=
"java.lang.String"
resultMap=
"orderPageMap"
>
select
b.
*
from base_order
b
select *
from base_order
where no = #{no}
</select>
...
...
xx-order/xx-order-server/src/main/resources/mapper/OrderUserLicenseMapper.xml
0 → 100644
View file @
e451f2af
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.xxfc.platform.order.mapper.OrderUserLicenseMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.xxfc.platform.order.entity.OrderUserLicense"
>
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"license_name"
property=
"licenseName"
jdbcType=
"VARCHAR"
/>
<result
column=
"license_phone"
property=
"licensePhone"
jdbcType=
"VARCHAR"
/>
<result
column=
"license_id_card"
property=
"licenseIdCard"
jdbcType=
"VARCHAR"
/>
<result
column=
"license_img"
property=
"licenseImg"
jdbcType=
"VARCHAR"
/>
<result
column=
"crt_time"
property=
"crtTime"
jdbcType=
"BIGINT"
/>
<result
column=
"upd_time"
property=
"updTime"
jdbcType=
"BIGINT"
/>
</resultMap>
<select
id=
"selectByLicenseIdCard"
resultType=
"com.xxfc.platform.order.entity.OrderUserLicense"
parameterType=
"java.lang.String"
>
select * from order_user_license
where license_id_card = #{licenseIdCard}
</select>
</mapper>
\ No newline at end of file
xx-order/xx-order-server/src/main/resources/mapper/OrderVehicaleCrosstownMapper.xml
View file @
e451f2af
...
...
@@ -8,9 +8,6 @@
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"order_id"
jdbcType=
"INTEGER"
property=
"orderId"
/>
<result
column=
"order_no"
jdbcType=
"VARCHAR"
property=
"orderNo"
/>
<result
column=
"license_name"
jdbcType=
"VARCHAR"
property=
"licenseName"
/>
<result
column=
"license_phone"
jdbcType=
"VARCHAR"
property=
"licensePhone"
/>
<result
column=
"license_img"
jdbcType=
"VARCHAR"
property=
"licenseImg"
/>
<result
column=
"mileage"
jdbcType=
"INTEGER"
property=
"mileage"
/>
<result
column=
"mileage_img"
jdbcType=
"VARCHAR"
property=
"mileageImg"
/>
<result
column=
"status"
jdbcType=
"BIT"
property=
"status"
/>
...
...
@@ -23,15 +20,15 @@
<result
column=
"crt_time"
jdbcType=
"BIGINT"
property=
"crtTime"
/>
<result
column=
"upd_time"
jdbcType=
"BIGINT"
property=
"updTime"
/>
<result
column=
"vehicle_key"
jdbcType=
"LONGVARCHAR"
property=
"vehicleKey"
/>
<result
column=
"license_id_card"
jdbcType=
"VARCHAR"
property=
"licenseIdCard"
/>
<result
column=
"deduction"
jdbcType=
"BIT"
property=
"deduction"
/>
<result
column=
"ded_detail"
jdbcType=
"LONGVARCHAR"
property=
"dedDetail"
/>
<result
column=
"type"
jdbcType=
"INTEGER"
property=
"type"
/>
<result
column=
"deduction_cost"
jdbcType=
"INTEGER"
property=
"deductionCost"
/>
<result
column=
"rest_deposit"
jdbcType=
"INTEGER"
property=
"restDeposit"
/>
<result
column=
"user_license_id"
jdbcType=
"VARCHAR"
property=
"userLicenseId"
/>
</resultMap>
<select
id=
"selectByOrderId"
parameterType=
"com.xxfc.platform.order.
entity.OrderVehicaleCrosstown
"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByOrderId"
parameterType=
"com.xxfc.platform.order.
pojo.order.OrderVehicleCrosstownDto
"
resultMap=
"BaseResultMap"
>
select *
from order_vehicle_crosstown
<where>
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/entity/Dictionary.java
0 → 100644
View file @
e451f2af
package
com
.
xxfc
.
platform
.
universal
.
entity
;
import
lombok.Data
;
import
javax.persistence.*
;
import
java.util.Set
;
@Data
@Table
(
name
=
"data_dictionary"
)
public
class
Dictionary
{
@Id
private
Integer
id
;
/**
* 类型
*/
private
String
type
;
/**
* 编码
*/
private
String
code
;
/**
* 父类Id
*/
private
Integer
pid
;
private
String
name
;
private
String
detail
;
@Transient
private
Set
<
Dictionary
>
childrens
;
}
\ No newline at end of file
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/vo/DictionaryVo.java
0 → 100644
View file @
e451f2af
package
com
.
xxfc
.
platform
.
universal
.
vo
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
lombok.Data
;
import
java.util.Set
;
@Data
public
class
DictionaryVo
extends
Dictionary
{
Set
<
Dictionary
>
childrens
;
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/DictionaryBiz.java
0 → 100644
View file @
e451f2af
package
com
.
xxfc
.
platform
.
universal
.
biz
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.google.common.collect.Lists
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.mapper.DictionaryMapper
;
import
com.xxfc.platform.universal.vo.DictionaryVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.StringUtils
;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
@Service
@Slf4j
public
class
DictionaryBiz
extends
BaseBiz
<
DictionaryMapper
,
Dictionary
>
{
public
ObjectRestResponse
add
(
Dictionary
dictionary
)
{
if
(
dictionary
==
null
)
return
ObjectRestResponse
.
paramIsEmpty
();
List
<
Dictionary
>
dictionaryVos
=
mapper
.
selectByCodeAndType
(
dictionary
);
if
(
dictionaryVos
.
size
()
==
1
)
{
//已有数据 直接更新
BeanUtil
.
copyProperties
(
dictionary
,
dictionaryVos
.
get
(
0
),
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
mapper
.
updateByPrimaryKeySelective
(
dictionaryVos
.
get
(
0
));
return
ObjectRestResponse
.
succ
();
}
if
(
dictionary
.
getPid
()
!=
null
)
{
//有父类 判断是否存在
Dictionary
parent
=
mapper
.
selectByPrimaryKey
(
dictionary
.
getPid
());
if
(
parent
==
null
)
{
log
.
info
(
"pid所属数据不存在, dictionary = {}"
,
dictionary
);
return
ObjectRestResponse
.
createFailedResult
(
500
,
"pid所属数据不存在"
);
}
}
else
{
//没有父类设置pid为0
dictionary
.
setPid
(
0
);
}
mapper
.
insertSelective
(
dictionary
);
return
ObjectRestResponse
.
succ
();
}
public
ObjectRestResponse
get
(
Dictionary
dictionary
)
{
if
(
dictionary
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
List
<
Dictionary
>
dictionaryList
=
mapper
.
selectByCodeAndType
(
dictionary
);
for
(
Dictionary
parent
:
dictionaryList
)
{
Set
<
Dictionary
>
dictionaryVoList
=
buildTree
(
parent
.
getId
());
parent
.
setChildrens
(
dictionaryVoList
);
}
return
ObjectRestResponse
.
succ
(
dictionaryList
);
}
public
ObjectRestResponse
deleteByEntity
(
Dictionary
dictionary
)
{
if
(
dictionary
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
//删除所有子元素
Set
<
Dictionary
>
childrens
=
mapper
.
selectByPid
(
dictionary
.
getId
());
if
(
childrens
.
size
()
>
0
)
{
childrens
.
forEach
((
a
)
->
mapper
.
deleteByPrimaryKey
(
a
));
}
mapper
.
deleteByPrimaryKey
(
dictionary
);
return
ObjectRestResponse
.
succ
();
}
public
ObjectRestResponse
update
(
Dictionary
dictionary
)
{
if
(
StringUtils
.
isEmpty
(
dictionary
))
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
Dictionary
oldValue
=
mapper
.
selectByPrimaryKey
(
dictionary
.
getId
());
BeanUtil
.
copyProperties
(
dictionary
,
oldValue
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
mapper
.
updateByPrimaryKeySelective
(
oldValue
);
return
ObjectRestResponse
.
succ
();
}
public
ObjectRestResponse
getParent
()
{
Set
<
Dictionary
>
dictionaryList
=
mapper
.
selectByPid
(
0
);
for
(
Dictionary
parent
:
dictionaryList
)
{
Set
<
Dictionary
>
dictionaryVoList
=
buildTree
(
parent
.
getId
());
parent
.
setChildrens
(
dictionaryVoList
);
}
return
ObjectRestResponse
.
succ
(
dictionaryList
);
}
public
DictionaryVo
buidTree
(
Dictionary
dictionary
)
{
DictionaryVo
dictionaryVo
=
new
DictionaryVo
();
if
(
dictionary
.
getPid
()
==
0
)
{
BeanUtil
.
copyProperties
(
dictionary
,
dictionaryVo
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
Set
<
Dictionary
>
childrens
=
mapper
.
selectByPid
(
dictionary
.
getId
());
dictionaryVo
.
setChildrens
(
childrens
);
for
(
Dictionary
children
:
childrens
)
{
buidTree
(
children
);
}
}
return
dictionaryVo
;
}
public
Set
<
Dictionary
>
buildTree
(
int
parentId
)
{
Set
<
Dictionary
>
childrens
=
mapper
.
selectByPid
(
parentId
);
Set
<
Dictionary
>
dictionaryVoList
=
new
HashSet
<>();
for
(
Dictionary
dictionary
:
childrens
)
{
int
dictionaryId
=
dictionary
.
getId
();
int
pid
=
dictionary
.
getPid
();
if
(
parentId
==
pid
)
{
Set
<
Dictionary
>
menuLists
=
buildTree
(
dictionaryId
);
dictionary
.
setChildrens
(
menuLists
);
dictionaryVoList
.
add
(
dictionary
);
}
}
return
dictionaryVoList
;
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/DictionaryController.java
0 → 100644
View file @
e451f2af
package
com
.
xxfc
.
platform
.
universal
.
controller
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.universal.biz.DictionaryBiz
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
@RestController
@RequestMapping
(
value
=
"dictionary"
)
@Api
(
value
=
"数据字典"
)
public
class
DictionaryController
{
@Autowired
DictionaryBiz
dictionaryBiz
;
@PostMapping
(
value
=
"/add"
)
@ApiOperation
(
value
=
"添加数据"
)
public
ObjectRestResponse
<?>
add
(
@RequestBody
Dictionary
dictionary
)
{
return
dictionaryBiz
.
add
(
dictionary
);
}
@GetMapping
(
value
=
"/get"
)
@ApiOperation
(
value
=
"获取数据"
)
public
ObjectRestResponse
<?>
get
(
Dictionary
dictionary
)
{
return
dictionaryBiz
.
get
(
dictionary
);
}
@DeleteMapping
(
value
=
"/delete"
)
@ApiOperation
(
value
=
"删除数据"
)
public
ObjectRestResponse
<?>
delete
(
Dictionary
dictionary
)
{
return
dictionaryBiz
.
deleteByEntity
(
dictionary
);
}
@PostMapping
(
value
=
"/update"
)
@ApiOperation
(
value
=
"修改数据"
)
public
ObjectRestResponse
<?>
update
(
@RequestBody
Dictionary
dictionary
)
{
return
dictionaryBiz
.
update
(
dictionary
);
}
@GetMapping
(
value
=
"/getParents"
)
@ApiOperation
(
value
=
"获取所有的父类元素 pid=0"
)
public
ObjectRestResponse
getParent
()
{
return
dictionaryBiz
.
getParent
();
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/mapper/DictionaryMapper.java
0 → 100644
View file @
e451f2af
package
com
.
xxfc
.
platform
.
universal
.
mapper
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
import
java.util.Set
;
public
interface
DictionaryMapper
extends
Mapper
<
Dictionary
>
{
List
<
Dictionary
>
selectByCodeAndType
(
Dictionary
dictionary
);
Set
<
Dictionary
>
selectByPid
(
Integer
pid
);
}
\ No newline at end of file
xx-universal/xx-universal-server/src/main/resources/mapper/DictionaryMapper.xml
0 → 100644
View file @
e451f2af
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.xxfc.platform.universal.mapper.DictionaryMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.xxfc.platform.universal.entity.Dictionary"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
property=
"id"
jdbcType=
"INTEGER"
/>
<result
column=
"type"
property=
"type"
jdbcType=
"VARCHAR"
/>
<result
column=
"code"
property=
"code"
jdbcType=
"VARCHAR"
/>
<result
column=
"pid"
property=
"pid"
jdbcType=
"INTEGER"
/>
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
<result
column=
"detail"
property=
"detail"
jdbcType=
"VARCHAR"
/>
</resultMap>
<select
id=
"selectByCodeAndType"
parameterType=
"com.xxfc.platform.universal.entity.Dictionary"
resultType=
"com.xxfc.platform.universal.entity.Dictionary"
>
select * from dictionary
<where>
<if
test=
"type != null"
>
and type = #{type}
</if>
<if
test=
"code"
>
and code = #{code}
</if>
<if
test=
"pid"
>
and pid = #{pid}
</if>
</where>
</select>
<select
id =
"selectByPid"
parameterType=
"java.lang.Integer"
resultType=
"com.xxfc.platform.universal.entity.Dictionary"
>
select * from dictionary
where pid = #{pid}
</select>
</mapper>
\ No newline at end of file
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/VehicleUserLicense.java
View file @
e451f2af
...
...
@@ -47,17 +47,17 @@ public class VehicleUserLicense implements Serializable {
//驾驶证
@Column
(
name
=
"license"
)
@ApiModelProperty
(
value
=
"驾驶证"
)
private
String
license
;
@ApiModelProperty
(
value
=
"驾驶证
号码
"
)
private
String
license
;
//正面图片
@Column
(
name
=
"img"
)
@ApiModelProperty
(
value
=
"正面图片"
)
@ApiModelProperty
(
value
=
"
驾驶证
正面图片"
)
private
String
img
;
//反面图片
@Column
(
name
=
"fimg"
)
@ApiModelProperty
(
value
=
"反面图片"
)
@ApiModelProperty
(
value
=
"
驾驶证
反面图片"
)
private
String
fimg
;
//创建时间
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
e451f2af
...
...
@@ -53,4 +53,8 @@ public interface VehicleFeign {
@RequestMapping
(
value
=
"/user/license/one"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
<
VehicleUserLicense
>
one
(
@RequestParam
(
value
=
"id"
,
defaultValue
=
"0"
)
Integer
id
)
throws
Exception
;
@RequestMapping
(
value
=
"/user/license/company/getOne"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
<
VehicleUserLicense
>
getOne
(
@RequestParam
(
value
=
"id"
,
defaultValue
=
"0"
)
Integer
id
)
throws
Exception
;
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleLicenseController.java
View file @
e451f2af
...
...
@@ -59,7 +59,11 @@ public class VehicleLicenseController extends VehicleBaseController<VehicleLicen
}
return
RestResponse
.
suc
(
baseBiz
.
getOneById
(
id
));
}
@RequestMapping
(
value
=
"/license/company/getOne"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
<
VehicleUserLicense
>
getOne
(
@RequestParam
(
value
=
"id"
,
defaultValue
=
"0"
)
Integer
id
)
throws
Exception
{
return
RestResponse
.
suc
(
baseBiz
.
getOneById
(
id
));
}
@ApiOperation
(
"多个驾驶员查询"
)
@RequestMapping
(
value
=
"/license/multi"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
List
<
VehicleUserLicense
>>
multi
(
QueryMultiDTO
dto
)
throws
Exception
{
...
...
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