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
7c6df77d
Commit
7c6df77d
authored
Jun 28, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增数据字典,修改订单接口
parent
15d3ab44
Changes
27
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
647 additions
and
87 deletions
+647
-87
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
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.
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/UserBiz.java
View file @
7c6df77d
...
@@ -5,8 +5,10 @@ import com.github.wxiaoqi.security.admin.feign.UserFeign;
...
@@ -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.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.common.msg.BaseResponse
;
import
com.github.wxiaoqi.security.common.msg.BaseResponse
;
import
com.xxfc.platform.im.model.User
;
import
com.xxfc.platform.im.model.User
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Query
;
...
@@ -23,6 +25,7 @@ import java.util.HashMap;
...
@@ -23,6 +25,7 @@ import java.util.HashMap;
import
java.util.Map
;
import
java.util.Map
;
@Component
@Component
@Slf4j
public
class
UserBiz
{
public
class
UserBiz
{
@Autowired
@Autowired
...
@@ -31,6 +34,9 @@ public class UserBiz {
...
@@ -31,6 +34,9 @@ public class UserBiz {
@Autowired
@Autowired
UserFeign
userFeign
;
UserFeign
userFeign
;
@Value
(
"${im.url}"
)
String
imUrl
;
/**
/**
* 注册
* 注册
* @param map
* @param map
...
@@ -48,8 +54,7 @@ public class UserBiz {
...
@@ -48,8 +54,7 @@ public class UserBiz {
if
(
map
.
get
(
"nickname"
)
!=
null
&&
!(
""
).
equals
(
map
.
get
(
"nickname"
))){
if
(
map
.
get
(
"nickname"
)
!=
null
&&
!(
""
).
equals
(
map
.
get
(
"nickname"
))){
str
+=
"nickname="
+
map
.
get
(
"nickname"
).
toString
();
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
);
JSONObject
json
=
JSONObject
.
parseObject
(
result
);
//如果已经注册过,查询出手机号对应用户信息执行登录返回
//如果已经注册过,查询出手机号对应用户信息执行登录返回
if
(
0
==
json
.
getInteger
(
"resultCode"
)){
if
(
0
==
json
.
getInteger
(
"resultCode"
)){
...
@@ -72,6 +77,7 @@ public class UserBiz {
...
@@ -72,6 +77,7 @@ public class UserBiz {
baseResponse
.
setStatus
(
200
);
baseResponse
.
setStatus
(
200
);
baseResponse
.
setMessage
(
result
);
baseResponse
.
setMessage
(
result
);
log
.
info
(
"用户注册:result = {}, telephone = {}, password = {}, nickname = {}"
,
result
,
map
.
get
(
"telephone"
),
map
.
get
(
"password"
),
map
.
get
(
"nickname"
));
return
baseResponse
;
return
baseResponse
;
}
}
...
@@ -92,8 +98,9 @@ public class UserBiz {
...
@@ -92,8 +98,9 @@ public class UserBiz {
str
+=
"password="
+
map
.
get
(
"password"
).
toString
();
str
+=
"password="
+
map
.
get
(
"password"
).
toString
();
}
}
str
+=
"&areaCode=86"
;
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
);
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
());
json
.
put
(
"password"
,
map
.
get
(
"password"
).
toString
());
return
json
.
toJSONString
();
return
json
.
toJSONString
();
}
}
...
...
xx-im/xx-im-server/src/main/resources/mapper/ImQuestionMapper.xml
View file @
7c6df77d
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
and is_del = #{isDel}
and is_del = #{isDel}
</if>
</if>
</where>
</where>
order by
time
DESC
order by
praise_count, comment_count
DESC
</select>
</select>
</mapper>
</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 @
7c6df77d
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 @
7c6df77d
package
com
.
xxfc
.
platform
.
order
.
entity
;
package
com
.
xxfc
.
platform
.
order
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.RequiredArgsConstructor
;
import
javax.persistence.*
;
import
javax.persistence.*
;
@Table
(
name
=
"order_vehicle_crosstown"
)
@Table
(
name
=
"order_vehicle_crosstown"
)
@Data
@Data
@RequiredArgsConstructor
public
class
OrderVehicaleCrosstown
{
public
class
OrderVehicaleCrosstown
{
/**
/**
* 主键id
* 主键id
...
@@ -28,23 +25,6 @@ public class OrderVehicaleCrosstown {
...
@@ -28,23 +25,6 @@ public class OrderVehicaleCrosstown {
@Column
(
name
=
"order_no"
)
@Column
(
name
=
"order_no"
)
private
String
orderNo
;
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 {
...
@@ -122,11 +102,6 @@ public class OrderVehicaleCrosstown {
*/
*/
private
String
dedDetail
;
private
String
dedDetail
;
/**
* 驾驶人身份证号
*/
private
String
licenseIdCard
;
/**
/**
* 1、交车, 2、还车
* 1、交车, 2、还车
*/
*/
...
@@ -141,4 +116,9 @@ public class OrderVehicaleCrosstown {
...
@@ -141,4 +116,9 @@ public class OrderVehicaleCrosstown {
* 剩余押金
* 剩余押金
*/
*/
private
Integer
restDeposit
;
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 @
7c6df77d
...
@@ -15,14 +15,19 @@ public class OrderPageVO extends BaseOrder {
...
@@ -15,14 +15,19 @@ public class OrderPageVO extends BaseOrder {
public
static
final
String
NO
=
"no="
;
public
static
final
String
NO
=
"no="
;
OrderRentVehicleDetail
orderRentVehicleDetail
;
OrderRentVehicleDetail
orderRentVehicleDetail
;
OrderTourDetail
orderTourDetail
;
OrderTourDetail
orderTourDetail
;
List
<
VehicleUserLicense
>
vehicleUserLicenses
;
List
<
VehicleUserLicense
>
vehicleUserLicenses
;
private
String
username
;
private
String
username
;
private
String
vehicalNumberPlat
;
private
String
vehicalNumberPlat
;
private
String
qrcodeStr
;
private
String
qrcodeStr
;
private
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
;
public
void
setQrcodeStr
(
String
prefix
)
{
public
void
setQrcodeStr
(
String
prefix
)
{
this
.
qrcodeStr
=
prefix
+
"?"
+
TYPE
+
getType
()+
"&"
+
NO
+
getNo
();
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 @
7c6df77d
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 @
7c6df77d
...
@@ -5,6 +5,7 @@ import com.github.wxiaoqi.security.admin.dto.UserMemberDTO;
...
@@ -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.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.xxfc.platform.order.contant.enumerate.OrderStatusEnum
;
import
com.xxfc.platform.order.contant.enumerate.OrderStatusEnum
;
...
@@ -13,9 +14,11 @@ import com.xxfc.platform.order.contant.enumerate.RefundTypeEnum;
...
@@ -13,9 +14,11 @@ import com.xxfc.platform.order.contant.enumerate.RefundTypeEnum;
import
com.xxfc.platform.order.entity.*
;
import
com.xxfc.platform.order.entity.*
;
import
com.xxfc.platform.order.mapper.BaseOrderMapper
;
import
com.xxfc.platform.order.mapper.BaseOrderMapper
;
import
com.xxfc.platform.order.pojo.order.OrderPageVO
;
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.tour.feign.TourFeign
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.universal.vo.OrderRefundVo
;
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.entity.VehicleUserLicense
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -52,6 +55,12 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
...
@@ -52,6 +55,12 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
@Autowired
@Autowired
OrderRentVehicleBiz
orderRentVehicleBiz
;
OrderRentVehicleBiz
orderRentVehicleBiz
;
@Autowired
OrderVehicalCrosstownBiz
orderVehicalCrosstownBiz
;
@Autowired
OrderUserLicenseBiz
orderUserLicenseBiz
;
@Autowired
@Autowired
OrderRefundBiz
orderRefundBiz
;
OrderRefundBiz
orderRefundBiz
;
...
@@ -100,27 +109,56 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
...
@@ -100,27 +109,56 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
* @param no
* @param no
* @return
* @return
*/
*/
public
O
rderPageVO
getOrderDetail
(
String
no
)
{
public
O
bjectRestResponse
getOrderDetail
(
String
no
)
{
OrderPageVO
orderPageVo
=
mapper
.
getOrderDetail
(
no
);
OrderPageVO
orderPageVo
=
mapper
.
getOrderDetail
(
no
);
String
myDriverIds
=
orderPageVo
.
getOrderRentVehicleDetail
().
getMyDriverIds
();
if
(
orderPageVo
==
null
)
{
return
ObjectRestResponse
.
createDefaultFail
();
}
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
();
List
<
VehicleUserLicense
>
vehicleUserLicenses
=
Lists
.
newArrayList
();
String
myDriverIds
=
orderPageVo
.
getOrderRentVehicleDetail
().
getMyDriverIds
();
if
(
StringUtils
.
isNotBlank
(
myDriverIds
))
{
if
(
StringUtils
.
isNotBlank
(
myDriverIds
))
{
if
(
myDriverIds
.
contains
(
","
))
{
if
(
myDriverIds
.
contains
(
","
))
{
String
[]
ids
=
myDriverIds
.
split
(
","
);
String
[]
ids
=
myDriverIds
.
split
(
","
);
try
{
try
{
for
(
String
id
:
ids
)
{
//目前暂定一个驾驶人,后期需要更改再此更改
vehicleUserLicenses
.
add
(
vehicleFeign
.
one
(
Integer
.
parseInt
(
id
)).
getData
());
RestResponse
<
VehicleUserLicense
>
restResponse
=
vehicleFeign
.
getOne
(
Integer
.
parseInt
(
ids
[
0
]));
log
.
info
(
restResponse
.
getMessage
());
if
(
restResponse
.
getData
()
!=
null
)
{
vehicleUserLicenses
.
add
(
restResponse
.
getData
());
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
else
{
}
else
{
try
{
try
{
vehicleUserLicenses
.
add
(
vehicleFeign
.
one
(
Integer
.
parseInt
(
myDriverIds
)).
getData
());
vehicleUserLicenses
.
add
(
vehicleFeign
.
one
(
Integer
.
parseInt
(
myDriverIds
)).
getData
());
}
catch
(
Exception
e
){}
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
}
}
}
orderPageVo
.
setVehicleUserLicenses
(
vehicleUserLicenses
);
orderPageVo
.
setVehicleUserLicenses
(
vehicleUserLicenses
);
return
orderPageVo
;
}
return
ObjectRestResponse
.
succ
(
orderPageVo
);
}
}
/**
/**
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderUserLicenseBiz.java
0 → 100644
View file @
7c6df77d
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 @
7c6df77d
...
@@ -4,6 +4,7 @@ import com.ace.cache.annotation.Cache;
...
@@ -4,6 +4,7 @@ import com.ace.cache.annotation.Cache;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.xxfc.platform.order.entity.OrderVehicaleCrosstown
;
import
com.xxfc.platform.order.entity.OrderVehicaleCrosstown
;
import
com.xxfc.platform.order.mapper.OrderVehicaleCrosstownMapper
;
import
com.xxfc.platform.order.mapper.OrderVehicaleCrosstownMapper
;
import
com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.List
;
...
@@ -15,7 +16,7 @@ public class OrderVehicalCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
...
@@ -15,7 +16,7 @@ public class OrderVehicalCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
return
selectById
(
id
);
return
selectById
(
id
);
}
}
public
List
<
OrderVehicaleCrosstown
>
selectByOrderId
(
OrderVehic
aleCrosstown
orderVehicaleCrosstown
)
{
public
List
<
OrderVehicaleCrosstown
>
selectByOrderId
(
OrderVehic
leCrosstownDto
orderVehicleCrosstownDto
)
{
return
mapper
.
selectByOrderId
(
orderVehic
aleCrosstown
);
return
mapper
.
selectByOrderId
(
orderVehic
leCrosstownDto
);
}
}
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mapper/OrderUserLicenseMapper.java
0 → 100644
View file @
7c6df77d
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 @
7c6df77d
package
com
.
xxfc
.
platform
.
order
.
mapper
;
package
com
.
xxfc
.
platform
.
order
.
mapper
;
import
com.xxfc.platform.order.entity.OrderVehicaleCrosstown
;
import
com.xxfc.platform.order.entity.OrderVehicaleCrosstown
;
import
com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
import
java.util.List
;
public
interface
OrderVehicaleCrosstownMapper
extends
Mapper
<
OrderVehicaleCrosstown
>
{
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 @
7c6df77d
...
@@ -188,7 +188,7 @@ public class BaseOrderController extends CommonBaseController {
...
@@ -188,7 +188,7 @@ public class BaseOrderController extends CommonBaseController {
if
(
StringUtils
.
isBlank
(
orderNo
))
{
if
(
StringUtils
.
isBlank
(
orderNo
))
{
return
ObjectRestResponse
.
paramIsEmpty
();
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 @
7c6df77d
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 @
7c6df77d
...
@@ -2,13 +2,21 @@ package com.xxfc.platform.order.rest;
...
@@ -2,13 +2,21 @@ package com.xxfc.platform.order.rest;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
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.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.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.entity.OrderVehicaleCrosstown
;
import
com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.List
;
...
@@ -22,27 +30,51 @@ public class OrderVehicleCrosstownController {
...
@@ -22,27 +30,51 @@ public class OrderVehicleCrosstownController {
@Autowired
@Autowired
OrderVehicalCrosstownBiz
orderVehicalCrosstownBiz
;
OrderVehicalCrosstownBiz
orderVehicalCrosstownBiz
;
@Autowired
OrderUserLicenseBiz
orderUserLicenseBiz
;
@Autowired
BaseOrderBiz
baseOrderBiz
;
@PostMapping
(
value
=
"/add"
)
@PostMapping
(
value
=
"/add"
)
@ApiOperation
(
value
=
"添加交还车记录"
)
@ApiOperation
(
value
=
"添加交还车记录"
)
public
ObjectRestResponse
<?>
add
(
OrderVehicaleCrosstown
orderVehicaleCrosstown
)
{
@Transactional
log
.
info
(
"添加的参数:orderVehicaleCrosstown = {}"
,
orderVehicaleCrosstown
);
public
ObjectRestResponse
<
OrderVehicleCrosstownDto
>
add
(
@RequestBody
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
)
{
if
(
orderVehicaleCrosstown
==
null
)
{
log
.
info
(
"添加的参数:orderVehicaleCrosstown = {}"
,
orderVehicleCrosstownDto
);
if
(
orderVehicleCrosstownDto
==
null
||
orderVehicleCrosstownDto
.
getOrderId
()
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
500
,
"参数为空!"
);
return
ObjectRestResponse
.
createFailedResult
(
500
,
"参数为空!"
);
}
}
if
(
orderVehicaleCrosstown
.
getId
()
!=
null
)
{
BaseOrder
baseOrder
=
baseOrderBiz
.
selectById
(
orderVehicleCrosstownDto
.
getOrderId
());
OrderVehicaleCrosstown
oldValue
=
orderVehicalCrosstownBiz
.
get
(
orderVehicaleCrosstown
.
getId
());
if
(
baseOrder
==
null
)
{
if
(
oldValue
!=
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
500
,
"订单不存在!"
);
BeanUtil
.
copyProperties
(
orderVehicaleCrosstown
,
oldValue
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
orderVehicalCrosstownBiz
.
updateSelectiveById
(
oldValue
);
return
ObjectRestResponse
.
succ
();
}
}
orderVehicalCrosstownBiz
.
insertSelective
(
orderVehicaleCrosstown
);
List
<
OrderVehicaleCrosstown
>
oldValue
=
orderVehicalCrosstownBiz
.
selectByOrderId
(
orderVehicleCrosstownDto
);
return
ObjectRestResponse
.
succ
();
if
(
oldValue
.
size
()
==
1
)
{
}
else
{
//已有直接返回
orderVehicalCrosstownBiz
.
insertSelective
(
orderVehicaleCrosstown
);
//交车完成 设置订单状态为出行中
return
ObjectRestResponse
.
succ
();
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}"
)
@GetMapping
(
value
=
"/{id}"
)
...
@@ -53,11 +85,24 @@ public class OrderVehicleCrosstownController {
...
@@ -53,11 +85,24 @@ public class OrderVehicleCrosstownController {
@GetMapping
(
value
=
"/getByOrderId"
)
@GetMapping
(
value
=
"/getByOrderId"
)
@ApiOperation
(
value
=
"根据订单Id获取所有记录信息"
)
@ApiOperation
(
value
=
"根据订单Id获取所有记录信息"
)
public
ObjectRestResponse
<
List
<
OrderVehicaleCrosstown
>>
getByOrderId
(
OrderVehic
aleCrosstown
orderVehicaleCrosstown
)
{
public
ObjectRestResponse
<
List
<
OrderVehicaleCrosstown
>>
getByOrderId
(
OrderVehic
leCrosstownDto
orderVehicleCrosstownDto
)
{
if
(
orderVehic
aleCrosstown
==
null
)
{
if
(
orderVehic
leCrosstownDto
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
500
,
"参数orderId为空"
);
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 @
7c6df77d
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
</plugin>
</plugin>
<jdbcConnection
driverClass=
"com.mysql.jdbc.Driver"
<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"
userId=
"root"
password=
"sslcloud123*()"
>
password=
"sslcloud123*()"
>
</jdbcConnection>
</jdbcConnection>
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<!-- </table>-->
<!-- </table>-->
<!-- <table tableName="branch_company_stock_info" domainObjectName="BranchCompanyStockInfo"></table>-->
<!-- <table tableName="branch_company_stock_info" domainObjectName="BranchCompanyStockInfo"></table>-->
<!-- <table tableName="branch_company_stock_apply_info" domainObjectName="BranchCompanyStockApplyInfo"></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>-->
<!-- <table tableName="vehicle_upkeep_log" domainObjectName="VehicleUpkeepLog"></table>-->
</context>
</context>
</generatorConfiguration>
</generatorConfiguration>
\ No newline at end of file
xx-order/xx-order-server/src/main/resources/mapper/BaseOrderMapper.xml
View file @
7c6df77d
...
@@ -138,8 +138,8 @@
...
@@ -138,8 +138,8 @@
</select>
</select>
<select
id=
"getOrderDetail"
parameterType=
"java.lang.String"
resultMap=
"orderPageMap"
>
<select
id=
"getOrderDetail"
parameterType=
"java.lang.String"
resultMap=
"orderPageMap"
>
select
b.
*
select *
from base_order
b
from base_order
where no = #{no}
where no = #{no}
</select>
</select>
...
...
xx-order/xx-order-server/src/main/resources/mapper/OrderUserLicenseMapper.xml
0 → 100644
View file @
7c6df77d
<?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 @
7c6df77d
...
@@ -8,9 +8,6 @@
...
@@ -8,9 +8,6 @@
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"order_id"
jdbcType=
"INTEGER"
property=
"orderId"
/>
<result
column=
"order_id"
jdbcType=
"INTEGER"
property=
"orderId"
/>
<result
column=
"order_no"
jdbcType=
"VARCHAR"
property=
"orderNo"
/>
<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"
jdbcType=
"INTEGER"
property=
"mileage"
/>
<result
column=
"mileage_img"
jdbcType=
"VARCHAR"
property=
"mileageImg"
/>
<result
column=
"mileage_img"
jdbcType=
"VARCHAR"
property=
"mileageImg"
/>
<result
column=
"status"
jdbcType=
"BIT"
property=
"status"
/>
<result
column=
"status"
jdbcType=
"BIT"
property=
"status"
/>
...
@@ -23,15 +20,15 @@
...
@@ -23,15 +20,15 @@
<result
column=
"crt_time"
jdbcType=
"BIGINT"
property=
"crtTime"
/>
<result
column=
"crt_time"
jdbcType=
"BIGINT"
property=
"crtTime"
/>
<result
column=
"upd_time"
jdbcType=
"BIGINT"
property=
"updTime"
/>
<result
column=
"upd_time"
jdbcType=
"BIGINT"
property=
"updTime"
/>
<result
column=
"vehicle_key"
jdbcType=
"LONGVARCHAR"
property=
"vehicleKey"
/>
<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=
"deduction"
jdbcType=
"BIT"
property=
"deduction"
/>
<result
column=
"ded_detail"
jdbcType=
"LONGVARCHAR"
property=
"dedDetail"
/>
<result
column=
"ded_detail"
jdbcType=
"LONGVARCHAR"
property=
"dedDetail"
/>
<result
column=
"type"
jdbcType=
"INTEGER"
property=
"type"
/>
<result
column=
"type"
jdbcType=
"INTEGER"
property=
"type"
/>
<result
column=
"deduction_cost"
jdbcType=
"INTEGER"
property=
"deductionCost"
/>
<result
column=
"deduction_cost"
jdbcType=
"INTEGER"
property=
"deductionCost"
/>
<result
column=
"rest_deposit"
jdbcType=
"INTEGER"
property=
"restDeposit"
/>
<result
column=
"rest_deposit"
jdbcType=
"INTEGER"
property=
"restDeposit"
/>
<result
column=
"user_license_id"
jdbcType=
"VARCHAR"
property=
"userLicenseId"
/>
</resultMap>
</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 *
select *
from order_vehicle_crosstown
from order_vehicle_crosstown
<where>
<where>
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/entity/Dictionary.java
0 → 100644
View file @
7c6df77d
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 @
7c6df77d
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 @
7c6df77d
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 @
7c6df77d
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 @
7c6df77d
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 @
7c6df77d
<?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 @
7c6df77d
...
@@ -47,17 +47,17 @@ public class VehicleUserLicense implements Serializable {
...
@@ -47,17 +47,17 @@ public class VehicleUserLicense implements Serializable {
//驾驶证
//驾驶证
@Column
(
name
=
"license"
)
@Column
(
name
=
"license"
)
@ApiModelProperty
(
value
=
"驾驶证"
)
@ApiModelProperty
(
value
=
"驾驶证
号码
"
)
private
String
license
;
private
String
license
;
//正面图片
//正面图片
@Column
(
name
=
"img"
)
@Column
(
name
=
"img"
)
@ApiModelProperty
(
value
=
"正面图片"
)
@ApiModelProperty
(
value
=
"
驾驶证
正面图片"
)
private
String
img
;
private
String
img
;
//反面图片
//反面图片
@Column
(
name
=
"fimg"
)
@Column
(
name
=
"fimg"
)
@ApiModelProperty
(
value
=
"反面图片"
)
@ApiModelProperty
(
value
=
"
驾驶证
反面图片"
)
private
String
fimg
;
private
String
fimg
;
//创建时间
//创建时间
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
7c6df77d
...
@@ -53,4 +53,8 @@ public interface VehicleFeign {
...
@@ -53,4 +53,8 @@ public interface VehicleFeign {
@RequestMapping
(
value
=
"/user/license/one"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/user/license/one"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
<
VehicleUserLicense
>
one
(
@RequestParam
(
value
=
"id"
,
defaultValue
=
"0"
)
Integer
id
)
throws
Exception
;
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 @
7c6df77d
...
@@ -59,7 +59,11 @@ public class VehicleLicenseController extends VehicleBaseController<VehicleLicen
...
@@ -59,7 +59,11 @@ public class VehicleLicenseController extends VehicleBaseController<VehicleLicen
}
}
return
RestResponse
.
suc
(
baseBiz
.
getOneById
(
id
));
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
(
"多个驾驶员查询"
)
@ApiOperation
(
"多个驾驶员查询"
)
@RequestMapping
(
value
=
"/license/multi"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/license/multi"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
List
<
VehicleUserLicense
>>
multi
(
QueryMultiDTO
dto
)
throws
Exception
{
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