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
72a5afac
Commit
72a5afac
authored
Sep 07, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Plain Diff
合并本地分支
parents
109bc792
8efef1ad
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
712 additions
and
172 deletions
+712
-172
.gitignore
.gitignore
+5
-1
BackStageOrderController.java
...om/xxfc/platform/order/rest/BackStageOrderController.java
+2
-0
ModelDto.java
...pi/src/main/java/com/xxfc/platform/uccn/dto/ModelDto.java
+19
-0
SeoDTO.java
...-api/src/main/java/com/xxfc/platform/uccn/dto/SeoDTO.java
+21
-0
Model.java
...pi/src/main/java/com/xxfc/platform/uccn/entity/Model.java
+61
-0
SEO.java
...-api/src/main/java/com/xxfc/platform/uccn/entity/SEO.java
+57
-0
ModelQuery.java
...i/src/main/java/com/xxfc/platform/uccn/vo/ModelQuery.java
+12
-0
ModelVo.java
...-api/src/main/java/com/xxfc/platform/uccn/vo/ModelVo.java
+12
-0
SEOQuery.java
...api/src/main/java/com/xxfc/platform/uccn/vo/SEOQuery.java
+12
-0
SEOVo.java
...cn-api/src/main/java/com/xxfc/platform/uccn/vo/SEOVo.java
+9
-0
ModelBackgroundBiz.java
...n/java/com/xxfc/platform/uccn/biz/ModelBackgroundBiz.java
+117
-0
SEOBiz.java
...rver/src/main/java/com/xxfc/platform/uccn/biz/SEOBiz.java
+61
-0
SummitActivityBiz.java
...in/java/com/xxfc/platform/uccn/biz/SummitActivityBiz.java
+1
-0
ModelBackgroundMapper.java
.../com/xxfc/platform/uccn/mapper/ModelBackgroundMapper.java
+7
-0
SEOMapper.java
...rc/main/java/com/xxfc/platform/uccn/mapper/SEOMapper.java
+11
-0
SEOController.java
.../main/java/com/xxfc/platform/uccn/rest/SEOController.java
+29
-0
ModelBackgroundController.java
...c/platform/uccn/rest/admin/ModelBackgroundController.java
+33
-0
SEOBackgroundController.java
...xfc/platform/uccn/rest/admin/SEOBackgroundController.java
+38
-0
ArticleMapper.xml
...x-uccn-server/src/main/resources/mapper/ArticleMapper.xml
+1
-1
SEOMapper.xml
...cn/xx-uccn-server/src/main/resources/mapper/SEOMapper.xml
+27
-0
VehicleActiveService.java
...a/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
+177
-170
No files found.
.gitignore
View file @
72a5afac
...
@@ -7,6 +7,10 @@ target/
...
@@ -7,6 +7,10 @@ target/
.settings/
.settings/
.classpath
.classpath
ace-modules/ace-tool/src/main/resources/application-dev.yml
ace-modules/ace-tool/src/main/resources/application-dev.yml
**/logs
**/src/test
**/src/test
**/logs
xx-order/xx-order-server/logs/**
*.log
logs/**
/src/main/test/**
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BackStageOrderController.java
View file @
72a5afac
...
@@ -106,6 +106,8 @@ public class BackStageOrderController extends CommonBaseController implements Us
...
@@ -106,6 +106,8 @@ public class BackStageOrderController extends CommonBaseController implements Us
AppUserLogin
appUserLogin
=
userFeign
.
one
(
dto
.
getPhone
());
AppUserLogin
appUserLogin
=
userFeign
.
one
(
dto
.
getPhone
());
if
(
appUserLogin
!=
null
)
{
if
(
appUserLogin
!=
null
)
{
dto
.
setUserId
(
appUserLogin
.
getId
());
dto
.
setUserId
(
appUserLogin
.
getId
());
}
else
{
return
ObjectRestResponse
.
succ
(
new
PageDataVO
<>());
}
}
}
}
UserDTO
userDTO
=
getAdminUserInfo
();
UserDTO
userDTO
=
getAdminUserInfo
();
...
...
xx-uccn/xx-uccn-api/src/main/java/com/xxfc/platform/uccn/dto/ModelDto.java
0 → 100644
View file @
72a5afac
package
com
.
xxfc
.
platform
.
uccn
.
dto
;
import
com.xxfc.platform.uccn.entity.Model
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@Data
@NoArgsConstructor
public
class
ModelDto
{
private
Model
parent
;
private
List
<
Model
>
list
;
public
ModelDto
(
Model
parent
,
List
<
Model
>
list
)
{
this
.
parent
=
parent
;
this
.
list
=
list
;
}
}
xx-uccn/xx-uccn-api/src/main/java/com/xxfc/platform/uccn/dto/SeoDTO.java
0 → 100644
View file @
72a5afac
package
com
.
xxfc
.
platform
.
uccn
.
dto
;
import
com.xxfc.platform.uccn.entity.SEO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.Column
;
@Data
@Api
public
class
SeoDTO
extends
SEO
{
@Column
(
name
=
"modeName"
)
@ApiModelProperty
(
value
=
"模块名称"
)
private
String
modelName
;
@Column
(
name
=
"model_id"
)
@ApiModelProperty
(
value
=
"模块id"
)
private
Integer
modelId
;
}
xx-uccn/xx-uccn-api/src/main/java/com/xxfc/platform/uccn/entity/Model.java
0 → 100644
View file @
72a5afac
package
com
.
xxfc
.
platform
.
uccn
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
javafx.scene.input.Mnemonic
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.util.Date
;
@Data
@Table
(
name
=
"model"
)
@ApiModel
(
value
=
"官网模块实体"
)
@NoArgsConstructor
public
class
Model
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@ApiModelProperty
(
value
=
"主键"
)
private
Integer
id
;
@Column
(
name
=
"parent_id"
)
@ApiModelProperty
(
value
=
"父模块id"
)
private
Integer
parentId
;
@Column
(
name
=
"name"
)
@ApiModelProperty
(
value
=
"模块名称"
)
private
String
name
;
@Column
(
name
=
"level"
)
@ApiModelProperty
(
value
=
"模块等级"
)
private
Integer
level
;
@Column
(
name
=
"cre_time"
)
@ApiModelProperty
(
value
=
" 创建时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
creTime
;
@Column
(
name
=
"upd_time"
)
@ApiModelProperty
(
value
=
"修改时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updTime
;
@Column
(
name
=
"is_del"
)
@ApiModelProperty
(
value
=
"是否删除"
)
private
Integer
isDel
;
@Column
(
name
=
"rank"
)
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
rank
;
public
Model
(
Integer
id
)
{
this
.
id
=
id
;
}
}
xx-uccn/xx-uccn-api/src/main/java/com/xxfc/platform/uccn/entity/SEO.java
0 → 100644
View file @
72a5afac
package
com
.
xxfc
.
platform
.
uccn
.
entity
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
javax.persistence.*
;
import
java.util.Date
;
@Data
@Table
(
name
=
"seo"
)
@ApiModel
(
value
=
"seo列表实体"
)
@NoArgsConstructor
public
class
SEO
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@ApiModelProperty
(
value
=
"主键"
)
private
Integer
id
;
@Column
(
name
=
"model_id"
)
@ApiModelProperty
(
value
=
"模块id"
)
private
Integer
modelId
;
@Column
(
name
=
"title"
)
@ApiModelProperty
(
value
=
"title内容"
)
private
String
title
;
@Column
(
name
=
"keywords"
)
@ApiModelProperty
(
value
=
"关键子"
)
private
String
keywords
;
@Column
(
name
=
"description"
)
@ApiModelProperty
(
value
=
"description内容"
)
private
String
description
;
@Column
(
name
=
"header"
)
@ApiModelProperty
(
value
=
"标题"
)
private
String
header
;
@Column
(
name
=
"cre_time"
)
@ApiModelProperty
(
value
=
" 创建时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
creTime
;
@Column
(
name
=
"upd_time"
)
@ApiModelProperty
(
value
=
"修改时间"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
,
timezone
=
"GMT+8"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
updTime
;
}
xx-uccn/xx-uccn-api/src/main/java/com/xxfc/platform/uccn/vo/ModelQuery.java
0 → 100644
View file @
72a5afac
package
com
.
xxfc
.
platform
.
uccn
.
vo
;
import
lombok.Data
;
/**
* @author Administrator
*/
@Data
public
class
ModelQuery
{
private
Integer
page
=
1
;
private
Integer
limit
=
10
;
}
xx-uccn/xx-uccn-api/src/main/java/com/xxfc/platform/uccn/vo/ModelVo.java
0 → 100644
View file @
72a5afac
package
com
.
xxfc
.
platform
.
uccn
.
vo
;
import
com.xxfc.platform.uccn.entity.Model
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
ModelVo
{
private
Integer
parentId
;
private
List
<
Model
>
list
;
}
xx-uccn/xx-uccn-api/src/main/java/com/xxfc/platform/uccn/vo/SEOQuery.java
0 → 100644
View file @
72a5afac
package
com
.
xxfc
.
platform
.
uccn
.
vo
;
import
lombok.Data
;
/**
* @author Administrator
*/
@Data
public
class
SEOQuery
{
private
Integer
page
=
1
;
private
Integer
limit
=
10
;
}
xx-uccn/xx-uccn-api/src/main/java/com/xxfc/platform/uccn/vo/SEOVo.java
0 → 100644
View file @
72a5afac
package
com
.
xxfc
.
platform
.
uccn
.
vo
;
import
com.xxfc.platform.uccn.entity.SEO
;
import
lombok.Data
;
@Data
public
class
SEOVo
extends
SEO
{
}
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/biz/ModelBackgroundBiz.java
0 → 100644
View file @
72a5afac
package
com
.
xxfc
.
platform
.
uccn
.
biz
;
import
com.ace.cache.annotation.Cache
;
import
com.ace.cache.annotation.CacheClear
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.xxfc.platform.uccn.dto.ModelDto
;
import
com.xxfc.platform.uccn.entity.Model
;
import
com.xxfc.platform.uccn.vo.ModelVo
;
import
com.xxfc.platform.uccn.mapper.ModelBackgroundMapper
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.stereotype.Service
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
@Service
public
class
ModelBackgroundBiz
extends
BaseBiz
<
ModelBackgroundMapper
,
Model
>
{
private
final
Integer
BASE_PARENT_ID
=
0
;
private
final
Integer
NOT_DELETE
=
0
;
private
final
Integer
level
=
2
;
@Autowired
private
ApplicationContext
context
;
public
List
<
ModelDto
>
getList
()
{
List
<
Model
>
ModelList
=
getProxy
().
getListByParentId
(
BASE_PARENT_ID
);
if
(
CollectionUtils
.
isEmpty
(
ModelList
))
{
return
new
ArrayList
<>();
}
return
getModelDtos
(
ModelList
);
}
/**
* 获取ModelDto集合
* @param models
* @return
*/
private
ArrayList
<
ModelDto
>
getModelDtos
(
List
<
Model
>
models
)
{
ArrayList
<
ModelDto
>
modelDtos
=
new
ArrayList
<>();
for
(
Model
el
:
models
)
{
if
(
el
.
getLevel
()==
3
)
{
break
;
}
List
<
Model
>
list
=
getListByParentId
(
el
.
getId
());
modelDtos
.
add
(
new
ModelDto
(
el
,
list
));
modelDtos
.
addAll
(
getModelDtos
(
list
));
}
return
modelDtos
;
}
/**
* 根据父类id获取所有子类集合
*
* @param parentId
* @return
*/
// @Cache(key = "ModelList{1}")
public
List
<
Model
>
getListByParentId
(
Integer
parentId
)
{
Example
exa
=
new
Example
(
Model
.
class
);
Example
.
Criteria
criteria
=
exa
.
createCriteria
();
criteria
.
andEqualTo
(
"parentId"
,
parentId
).
andEqualTo
(
"isDel"
,
NOT_DELETE
);
exa
.
orderBy
(
"rank"
).
asc
();
return
mapper
.
selectByExample
(
exa
);
}
/**
* 获取代理对象
*
* @return
*/
private
ModelBackgroundBiz
getProxy
()
{
return
context
.
getBean
(
ModelBackgroundBiz
.
class
);
}
/**
* 修改子模块
*
* @param Modelvo
* @return
*/
// @CacheClear(key = "ModelList{1.Integer}")
public
String
update
(
ModelVo
Modelvo
)
{
if
(
Modelvo
==
null
||
Modelvo
.
getParentId
()==
null
)
{
return
"无修改数据"
;
}
Model
Model
=
selectById
(
Modelvo
.
getParentId
());
if
(
Model
==
null
||(!
Model
.
getIsDel
().
equals
(
NOT_DELETE
))||
BASE_PARENT_ID
.
equals
(
Model
.
getParentId
()))
{
return
"该标签不能修改"
;
}
if
(
CollectionUtils
.
isNotEmpty
(
Modelvo
.
getList
()))
{
for
(
Model
el
:
Modelvo
.
getList
())
{
if
(
el
.
getId
()==
null
)
{
el
.
setIsDel
(
NOT_DELETE
);
el
.
setCreTime
(
new
Date
());
el
.
setParentId
(
Modelvo
.
getParentId
());
if
(
el
.
getRank
()
==
null
)
{
el
.
setRank
(
0
);
}
mapper
.
insertSelective
(
el
);
}
else
{
el
.
setUpdTime
(
new
Date
());
mapper
.
updateByPrimaryKeySelective
(
el
);
}
}
}
return
null
;
}
}
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/biz/SEOBiz.java
0 → 100644
View file @
72a5afac
package
com
.
xxfc
.
platform
.
uccn
.
biz
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.xxfc.platform.uccn.dto.SeoDTO
;
import
com.xxfc.platform.uccn.entity.SEO
;
import
com.xxfc.platform.uccn.mapper.SEOMapper
;
import
com.xxfc.platform.uccn.vo.SEOQuery
;
import
com.xxfc.platform.uccn.vo.SEOVo
;
import
org.apache.commons.beanutils.BeanUtilsBean
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author Administrator
*/
@Service
public
class
SEOBiz
extends
BaseBiz
<
SEOMapper
,
SEO
>
{
public
PageInfo
<
SeoDTO
>
getList
(
SEOQuery
query
)
{
PageHelper
.
startPage
(
query
.
getPage
(),
query
.
getLimit
());
List
<
SeoDTO
>
seodtoList
=
mapper
.
getSEODTOList
();
return
PageInfo
.
of
(
seodtoList
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
update
(
SEOVo
seoVo
)
{
try
{
if
(
seoVo
==
null
)
{
return
false
;
}
SEO
seo
=
new
SEO
();
BeanUtilsBean
.
getInstance
().
copyProperties
(
seo
,
seoVo
);
if
(
seo
.
getId
()==
null
)
{
seo
.
setCreTime
(
new
Date
());
mapper
.
insertSelective
(
seo
);
}
else
{
seo
.
setUpdTime
(
new
Date
());
mapper
.
updateByPrimaryKeySelective
(
seo
);
}
return
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
return
false
;
}
}
public
SEO
getSeoByModelId
(
Integer
modelId
)
{
SEO
seo
=
new
SEO
();
seo
.
setModelId
(
modelId
);
return
selectOne
(
seo
);
}
}
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/biz/SummitActivityBiz.java
View file @
72a5afac
...
@@ -212,6 +212,7 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv
...
@@ -212,6 +212,7 @@ public class SummitActivityBiz extends BaseBiz<SummitActivityMapper, SummitActiv
PageDataVO
<
SummitActivityVo
>
dataVO
=
new
PageDataVO
<>();
PageDataVO
<
SummitActivityVo
>
dataVO
=
new
PageDataVO
<>();
Example
example
=
new
Example
(
SummitActivity
.
class
);
Example
example
=
new
Example
(
SummitActivity
.
class
);
example
.
setOrderByClause
(
"rank ASC ,start_time DESC"
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
Example
.
Criteria
criteria
=
example
.
createCriteria
();
//未删除
//未删除
criteria
.
andEqualTo
(
"isDel"
,
0
);
criteria
.
andEqualTo
(
"isDel"
,
0
);
...
...
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/mapper/ModelBackgroundMapper.java
0 → 100644
View file @
72a5afac
package
com
.
xxfc
.
platform
.
uccn
.
mapper
;
import
com.xxfc.platform.uccn.entity.Model
;
import
tk.mybatis.mapper.common.Mapper
;
public
interface
ModelBackgroundMapper
extends
Mapper
<
Model
>
{
}
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/mapper/SEOMapper.java
0 → 100644
View file @
72a5afac
package
com
.
xxfc
.
platform
.
uccn
.
mapper
;
import
com.xxfc.platform.uccn.dto.SeoDTO
;
import
com.xxfc.platform.uccn.entity.SEO
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
public
interface
SEOMapper
extends
Mapper
<
SEO
>
{
List
<
SeoDTO
>
getSEODTOList
();
}
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/rest/SEOController.java
0 → 100644
View file @
72a5afac
package
com
.
xxfc
.
platform
.
uccn
.
rest
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.xxfc.platform.uccn.biz.SEOBiz
;
import
com.xxfc.platform.uccn.entity.SEO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* @author Administrator
*/
@RestController
@RequestMapping
(
"seo"
)
@Api
(
tags
={
"seo后台管理类"
})
public
class
SEOController
extends
BaseController
<
SEOBiz
,
SEO
>
{
@GetMapping
(
"officialWebsite/{modelId}"
)
@ApiOperation
(
value
=
"获取官网seo"
)
public
ObjectRestResponse
getSeoByModelId
(
@PathVariable
Integer
modelId
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
getSeoByModelId
(
modelId
));
}
}
\ No newline at end of file
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/rest/admin/ModelBackgroundController.java
0 → 100644
View file @
72a5afac
package
com
.
xxfc
.
platform
.
uccn
.
rest
.
admin
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.uccn.biz.ModelBackgroundBiz
;
import
com.xxfc.platform.uccn.entity.Model
;
import
com.xxfc.platform.uccn.vo.ModelVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
@RestController
@RequestMapping
(
"Model"
)
@Api
(
tags
={
"Model后台管理类"
})
public
class
ModelBackgroundController
extends
BaseController
<
ModelBackgroundBiz
,
Model
>
{
@GetMapping
(
"/list"
)
@ApiOperation
(
value
=
"查询模块列表"
)
public
ObjectRestResponse
findList
(){
return
ObjectRestResponse
.
succ
(
baseBiz
.
getList
());
}
@PutMapping
(
"/upd"
)
@ApiOperation
(
value
=
"修改模块"
)
public
ObjectRestResponse
update
(
@RequestBody
ModelVo
modelvo
){
String
update
=
baseBiz
.
update
(
modelvo
);
if
(
update
==
null
)
{
return
ObjectRestResponse
.
succ
();
}
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
update
)
;
}
}
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/rest/admin/SEOBackgroundController.java
0 → 100644
View file @
72a5afac
package
com
.
xxfc
.
platform
.
uccn
.
rest
.
admin
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.xxfc.platform.uccn.biz.SEOBiz
;
import
com.xxfc.platform.uccn.entity.SEO
;
import
com.xxfc.platform.uccn.vo.SEOQuery
;
import
com.xxfc.platform.uccn.vo.SEOVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
/**
* @author Administrator
*/
@RestController
@RequestMapping
(
"seoBackground"
)
@Api
(
tags
={
"seo后台管理类"
})
public
class
SEOBackgroundController
extends
BaseController
<
SEOBiz
,
SEO
>
{
@PostMapping
(
"/list"
)
@ApiOperation
(
value
=
"查询模块列表"
)
public
ObjectRestResponse
findList
(
@RequestBody
SEOQuery
query
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
getList
(
query
));
}
@PutMapping
(
"/upd"
)
@ApiOperation
(
value
=
"修改模块"
)
public
ObjectRestResponse
update
(
@RequestBody
SEOVo
seoVo
){
boolean
result
=
baseBiz
.
update
(
seoVo
);
if
(
result
)
{
return
ObjectRestResponse
.
succ
();
}
return
ObjectRestResponse
.
createDefaultFail
()
;
}
}
xx-uccn/xx-uccn-server/src/main/resources/mapper/ArticleMapper.xml
View file @
72a5afac
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<mapper
namespace=
"com.xxfc.platform.uccn.mapper.ArticleMapper"
>
<mapper
namespace=
"com.xxfc.platform.uccn.mapper.ArticleMapper"
>
<select
id=
"getArticleList"
resultType=
"com.xxfc.platform.uccn.entity.Article"
>
<select
id=
"getArticleList"
resultType=
"com.xxfc.platform.uccn.entity.Article"
>
select id, title,epitome,add_time,cover_image from article
select id, title,epitome,add_time,cover_image from article
where
where
is_del=0
is_del=0
...
...
xx-uccn/xx-uccn-server/src/main/resources/mapper/SEOMapper.xml
0 → 100644
View file @
72a5afac
<?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.uccn.mapper.SEOMapper"
>
<select
id=
"getSEODTOList"
resultType=
"com.xxfc.platform.uccn.dto.SeoDTO"
>
select
m.name as modelName ,
m.id as model_id,
s.title as title,
s.keywords as keywords,
s.description as description,
s.header as header
from
model m
left join
seo s
on
m.id= s.model_id
WHERE
m.is_del = 0
ORDER BY
m.`level` ASC
</select>
</mapper>
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
View file @
72a5afac
...
@@ -58,95 +58,99 @@ public class VehicleActiveService {
...
@@ -58,95 +58,99 @@ public class VehicleActiveService {
*
*
* @param departureVo
* @param departureVo
*/
*/
@Transactional
public
void
departure
(
VehicleDepartureVo
departureVo
)
{
public
void
departure
(
VehicleDepartureVo
departureVo
)
{
Vehicle
vehicle
=
vehicleMapper
.
selectByPrimaryKey
(
departureVo
.
getVehicleId
());
try
{
if
(
vehicle
==
null
)
{
Vehicle
vehicle
=
vehicleMapper
.
selectByPrimaryKey
(
departureVo
.
getVehicleId
());
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
if
(
vehicle
==
null
)
{
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getCode
());
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
}
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getCode
());
if
(
StringUtils
.
isBlank
(
departureVo
.
getCheckMan
())
||
StringUtils
.
isBlank
(
departureVo
.
getCheckManTel
()))
{
}
throw
new
BaseException
(
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getDesc
(),
if
(
StringUtils
.
isBlank
(
departureVo
.
getCheckMan
())
||
StringUtils
.
isBlank
(
departureVo
.
getCheckManTel
()))
{
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getCode
());
throw
new
BaseException
(
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getDesc
(),
}
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getCode
());
if
(!
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
NORMAL
.
getCode
()))
{
}
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getDesc
()
+
", 车辆状态是:"
+
getVehicleStatus
(
vehicle
.
getStatus
(),
vehicle
.
getId
()),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getCode
());
}
//添加出车时间过滤 再出车开始时间前一天至结束时间内可以出车,并且预定记录为已审核状态
checkDateInvalide
(
departureVo
);
Integer
MileageLift
=
vehicle
.
getMileageLastUpdate
();
Integer
MileageLift1
=
departureVo
.
getMileage
();
if
(
MileageLift1
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
}
if
(
MileageLift
==
null
||
MileageLift1
>=
MileageLift
)
{
// 写入车辆公里数,预计目的地
vehicle
.
setMileageLastUpdate
(
MileageLift1
);
vehicle
.
setExpectDestinationBranchCompanyId
(
departureVo
.
getExpectArrivalBranchCompanyId
());
vehicleMapper
.
updateByPrimaryKeySelective
(
vehicle
);
// 修改车辆状态,确认是空闲状态
int
result
=
vehicleMapper
.
updateStatusByIdAndStatus
(
departureVo
.
getVehicleId
(),
VehicleStatus
.
DEPARTURE
.
getCode
(),
VehicleStatus
.
NORMAL
.
getCode
());
if
(!
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
NORMAL
.
getCode
()))
{
if
(!
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
NORMAL
.
getCode
()))
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getDesc
()
+
", 车辆状态是:"
+
getVehicleStatus
(
vehicle
.
getStatus
(),
vehicle
.
getId
()),
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getDesc
()
+
", 车辆状态是:"
+
getVehicleStatus
(
vehicle
.
getStatus
(),
vehicle
.
getId
()),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getCode
());
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getCode
());
}
}
//修改预约记录状态
//添加出车时间过滤 再出车开始时间前一天至结束时间内可以出车,并且预定记录为已审核状态
VehicleBookRecord
vehicleBookRecord
=
null
;
checkDateInvalide
(
departureVo
);
if
(
departureVo
.
getBookRecordId
()
!=
null
)
{
Integer
MileageLift
=
vehicle
.
getMileageLastUpdate
();
vehicleBookRecord
=
vehicleBookRecordBiz
.
selectById
(
departureVo
.
getBookRecordId
());
Integer
MileageLift1
=
departureVo
.
getMileage
();
updateBookRecordStatus
(
vehicleBookRecord
,
1
);
if
(
MileageLift1
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
}
}
VehicleDepartureLogVo
vehicleDepartureLogVo
=
vehicleDepartureLogMapper
.
selectByBookRecordId
(
departureVo
.
getBookRecordId
());
if
(
MileageLift
==
null
||
MileageLift1
>=
MileageLift
)
{
if
(
vehicleDepartureLogVo
!=
null
)
{
// 写入车辆公里数,预计目的地
BeanUtil
.
copyProperties
(
departureVo
,
vehicleDepartureLogVo
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
)
);
vehicle
.
setMileageLastUpdate
(
MileageLift1
);
VehicleDepartureLog
departureLog
=
vehicleDepartureLogVo
.
getVehicleDeparture
(
vehicleDepartureLogVo
);
vehicle
.
setExpectDestinationBranchCompanyId
(
departureVo
.
getExpectArrivalBranchCompanyId
()
);
departureLog
.
setDepartureTime
(
new
Date
()
);
vehicleMapper
.
updateByPrimaryKeySelective
(
vehicle
);
departureLog
.
setUpdateTime
(
new
Date
());
departureLog
.
setState
(
VehicleDepartureState
.
DEPARTURE
.
getCode
());
// 修改车辆状态,确认是空闲状态
departureLog
.
setDepartureRemark
(
departureVo
.
getRemark
());
int
result
=
vehicleMapper
.
updateStatusByIdAndStatus
(
departureVo
.
getVehicleId
(),
VehicleStatus
.
DEPARTURE
.
getCode
(),
if
(
vehicleBookRecord
!=
null
)
{
VehicleStatus
.
NORMAL
.
getCode
());
departureLog
.
setDepartureBranchCompanyId
(
vehicleBookRecord
.
getLiftCompany
());
departureLog
.
setUse
(
BookType
.
getByCode
(
vehicleBookRecord
.
getBookType
()));
if
(!
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
NORMAL
.
getCode
()))
{
departureLog
.
setUser
(
vehicleBookRecord
.
getVehicleUsername
());
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getDesc
()
+
", 车辆状态是:"
+
getVehicleStatus
(
vehicle
.
getStatus
(),
vehicle
.
getId
()),
departureLog
.
setUserTel
(
vehicleBookRecord
.
getVehicleUserPhon
e
());
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_DISABLE
.
getCod
e
());
}
}
vehicleDepartureLogMapper
.
updateByPrimaryKeySelective
(
departureLog
);
//修改预约记录状态
}
else
{
VehicleBookRecord
vehicleBookRecord
=
null
;
// 出车记录
if
(
departureVo
.
getBookRecordId
()
!=
null
)
{
VehicleDepartureLog
departureLog
=
new
VehicleDepartureLog
();
vehicleBookRecord
=
vehicleBookRecordBiz
.
selectById
(
departureVo
.
getBookRecordId
());
BeanUtils
.
copyProperties
(
departureVo
,
departureLog
);
updateBookRecordStatus
(
vehicleBookRecord
,
1
);
departureLog
.
setDepartureTime
(
new
Date
());
}
departureLog
.
setCreateTime
(
new
Date
());
VehicleDepartureLogVo
vehicleDepartureLogVo
=
vehicleDepartureLogMapper
.
selectByBookRecordId
(
departureVo
.
getBookRecordId
());
departureLog
.
setMileageStart
(
departureVo
.
getMileage
());
if
(
vehicleDepartureLogVo
!=
null
)
{
departureLog
.
setState
(
VehicleDepartureState
.
DEPARTURE
.
getCode
());
BeanUtil
.
copyProperties
(
departureVo
,
vehicleDepartureLogVo
,
CopyOptions
.
create
().
setIgnoreNullValue
(
true
).
setIgnoreError
(
true
));
departureLog
.
setBookRecordId
(
departureVo
.
getBookRecordId
());
VehicleDepartureLog
departureLog
=
vehicleDepartureLogVo
.
getVehicleDeparture
(
vehicleDepartureLogVo
);
departureLog
.
setDepartureRemark
(
departureVo
.
getRemark
());
departureLog
.
setDepartureTime
(
new
Date
());
if
(
vehicleBookRecord
!=
null
)
{
departureLog
.
setUpdateTime
(
new
Date
());
departureLog
.
setDepartureBranchCompanyId
(
vehicleBookRecord
.
getLiftCompany
());
departureLog
.
setState
(
VehicleDepartureState
.
DEPARTURE
.
getCode
());
departureLog
.
setUse
(
BookType
.
getByCode
(
vehicleBookRecord
.
getBookType
()));
departureLog
.
setDepartureRemark
(
departureVo
.
getRemark
());
departureLog
.
setUser
(
vehicleBookRecord
.
getVehicleUsername
());
if
(
vehicleBookRecord
!=
null
)
{
departureLog
.
setUserTel
(
vehicleBookRecord
.
getVehicleUserPhone
());
departureLog
.
setDepartureBranchCompanyId
(
vehicleBookRecord
.
getLiftCompany
());
departureLog
.
setUse
(
BookType
.
getByCode
(
vehicleBookRecord
.
getBookType
()));
departureLog
.
setUser
(
vehicleBookRecord
.
getVehicleUsername
());
departureLog
.
setUserTel
(
vehicleBookRecord
.
getVehicleUserPhone
());
}
vehicleDepartureLogMapper
.
updateByPrimaryKeySelective
(
departureLog
);
}
else
{
// 出车记录
VehicleDepartureLog
departureLog
=
new
VehicleDepartureLog
();
BeanUtils
.
copyProperties
(
departureVo
,
departureLog
);
departureLog
.
setDepartureTime
(
new
Date
());
departureLog
.
setCreateTime
(
new
Date
());
departureLog
.
setMileageStart
(
departureVo
.
getMileage
());
departureLog
.
setState
(
VehicleDepartureState
.
DEPARTURE
.
getCode
());
departureLog
.
setBookRecordId
(
departureVo
.
getBookRecordId
());
departureLog
.
setDepartureRemark
(
departureVo
.
getRemark
());
if
(
vehicleBookRecord
!=
null
)
{
departureLog
.
setDepartureBranchCompanyId
(
vehicleBookRecord
.
getLiftCompany
());
departureLog
.
setUse
(
BookType
.
getByCode
(
vehicleBookRecord
.
getBookType
()));
departureLog
.
setUser
(
vehicleBookRecord
.
getVehicleUsername
());
departureLog
.
setUserTel
(
vehicleBookRecord
.
getVehicleUserPhone
());
}
vehicleDepartureLogMapper
.
insert
(
departureLog
);
}
}
vehicleDepartureLogMapper
.
insert
(
departureLog
);
}
// 车辆活动日志
// 车辆活动日志
VehicleActiveLog
activeLog
=
new
VehicleActiveLog
();
VehicleActiveLog
activeLog
=
new
VehicleActiveLog
();
activeLog
.
setVehicleId
(
departureVo
.
getVehicleId
());
activeLog
.
setVehicleId
(
departureVo
.
getVehicleId
());
activeLog
.
setActiveType
(
VehicleActiveType
.
Departure
.
getCode
());
activeLog
.
setActiveType
(
VehicleActiveType
.
Departure
.
getCode
());
activeLog
.
setStartTime
(
new
Date
());
activeLog
.
setStartTime
(
new
Date
());
activeLog
.
setCreateTime
(
new
Date
());
activeLog
.
setCreateTime
(
new
Date
());
vehicleActiveLogMapper
.
insert
(
activeLog
);
vehicleActiveLogMapper
.
insert
(
activeLog
);
}
else
{
}
else
{
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
...
@@ -187,115 +191,115 @@ public class VehicleActiveService {
...
@@ -187,115 +191,115 @@ public class VehicleActiveService {
return
stringBuilder
.
toString
();
return
stringBuilder
.
toString
();
}
}
@Transactional
public
void
arrival
(
VehicleArrivalVo
arrivalVo
)
{
public
void
arrival
(
VehicleArrivalVo
arrivalVo
)
{
Vehicle
vehicle
=
vehicleMapper
.
selectByPrimaryKey
(
arrivalVo
.
getVehicleId
());
try
{
if
(
vehicle
==
null
)
{
Vehicle
vehicle
=
vehicleMapper
.
selectByPrimaryKey
(
arrivalVo
.
getVehicleId
());
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
if
(
vehicle
==
null
)
{
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getCode
());
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getDesc
(),
}
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNEXIST
.
getCode
());
if
(
StringUtils
.
isBlank
(
arrivalVo
.
getRecycleMan
())
||
StringUtils
.
isBlank
(
arrivalVo
.
getRecycleManTel
()))
{
}
throw
new
BaseException
(
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getDesc
(),
if
(
StringUtils
.
isBlank
(
arrivalVo
.
getRecycleMan
())
||
StringUtils
.
isBlank
(
arrivalVo
.
getRecycleManTel
()))
{
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getCode
());
throw
new
BaseException
(
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getDesc
(),
}
ResCode
.
CHECKUSER_AND_PHONE_NOT_NULL
.
getCode
());
}
// if (!vehicle.getStatus().equals(VehicleStatus.DEPARTURE.getCode())) {
// if (!vehicle.getStatus().equals(VehicleStatus.DEPARTURE.getCode())) {
// throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()),
// throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc() + ", 车辆状态是:" + getVehicleStatus(vehicle.getStatus(), vehicle.getId()),
// ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode());
// ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode());
// }
// }
Integer
Mileagerest
=
vehicle
.
getMileageLastUpdate
();
Integer
Mileagerest
=
vehicle
.
getMileageLastUpdate
();
Integer
Mileagerest1
=
arrivalVo
.
getMileage
();
Integer
Mileagerest1
=
arrivalVo
.
getMileage
();
if
(
Mileagerest1
==
null
)
{
if
(
Mileagerest1
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
}
if
(
Mileagerest
!=
null
&&
Mileagerest1
>=
Mileagerest
)
{
VehicleBookRecord
vehicleBookRecord
=
null
;
if
(
arrivalVo
.
getBookRecordId
()
!=
null
)
{
vehicleBookRecord
=
vehicleBookRecordBiz
.
selectById
(
arrivalVo
.
getBookRecordId
());
updateBookRecordStatus
(
vehicleBookRecord
,
2
);
}
}
if
(
Mileagerest
!=
null
&&
Mileagerest1
>=
Mileagerest
)
{
VehicleBookRecord
vehicleBookRecord
=
null
;
if
(
arrivalVo
.
getBookRecordId
()
!=
null
)
{
vehicleBookRecord
=
vehicleBookRecordBiz
.
selectById
(
arrivalVo
.
getBookRecordId
());
updateBookRecordStatus
(
vehicleBookRecord
,
2
);
}
// 写入车辆公里数,还车分公司id
// 写入车辆公里数,还车分公司id
vehicle
.
setMileageLastUpdate
(
Mileagerest1
);
vehicle
.
setMileageLastUpdate
(
Mileagerest1
);
if
(
vehicleBookRecord
!=
null
)
{
if
(
vehicleBookRecord
!=
null
)
{
vehicle
.
setParkBranchCompanyId
(
vehicleBookRecord
.
getRetCompany
());
vehicle
.
setParkBranchCompanyId
(
vehicleBookRecord
.
getRetCompany
());
}
}
vehicle
.
setExpectDestinationBranchCompanyId
(
0
);
vehicle
.
setExpectDestinationBranchCompanyId
(
0
);
vehicleMapper
.
updateByPrimaryKeySelective
(
vehicle
);
vehicleMapper
.
updateByPrimaryKeySelective
(
vehicle
);
// 出车记录
// 出车记录
VehicleDepartureLogVo
departureLogVo
=
vehicleDepartureLogMapper
.
selectByBookRecordId
(
arrivalVo
.
getBookRecordId
());
VehicleDepartureLogVo
departureLogVo
=
vehicleDepartureLogMapper
.
selectByBookRecordId
(
arrivalVo
.
getBookRecordId
());
if
(
departureLogVo
==
null
)
{
if
(
departureLogVo
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getDesc
(),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getCode
());
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getCode
());
}
// 修改状态,确认是出车状态
//兼容错误还车流程,先查询,是否有其他出行记录
boolean
flag
=
true
;
VehicleDepartureLog
departureLog
=
departureLogVo
.
getVehicleDeparture
(
departureLogVo
);
List
<
VehicleDepartureLog
>
list
=
vehicleDepartureLogMapper
.
selectByVehicle
(
arrivalVo
.
getVehicleId
());
for
(
VehicleDepartureLog
vehicleDepartureLogVo
:
list
)
{
if
(
vehicleDepartureLogVo
.
getState
()
!=
1
&&
vehicleDepartureLogVo
.
getId
()
>
departureLog
.
getId
())
{
//后面还有未收车的记录
flag
=
false
;
}
}
}
// 修改状态,确认是出车状态
if
(
flag
)
{
//如果此条记录后面还有未收车记录,就不修改车辆状态
//兼容错误还车流程,先查询,是否有其他出行记录
int
result
=
vehicleMapper
.
updateStatus
(
arrivalVo
.
getVehicleId
(),
VehicleStatus
.
NORMAL
.
getCode
());
boolean
flag
=
true
;
VehicleDepartureLog
departureLog
=
departureLogVo
.
getVehicleDeparture
(
departureLogVo
);
List
<
VehicleDepartureLog
>
list
=
vehicleDepartureLogMapper
.
selectByVehicle
(
arrivalVo
.
getVehicleId
());
for
(
VehicleDepartureLog
vehicleDepartureLogVo
:
list
)
{
if
(
vehicleDepartureLogVo
.
getState
()
!=
1
&&
vehicleDepartureLogVo
.
getId
()
>
departureLog
.
getId
())
{
//后面还有未收车的记录
flag
=
false
;
}
}
if
(
flag
)
{
//如果此条记录后面还有未收车记录,就不修改车辆状态
int
result
=
vehicleMapper
.
updateStatus
(
arrivalVo
.
getVehicleId
(),
VehicleStatus
.
NORMAL
.
getCode
());
// if (result == 0) {
// if (result == 0) {
// throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc(),
// throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc(),
// ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode());
// ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode());
// }
// }
}
}
DateTime
arrivalDate
=
new
DateTime
(
vehicleBookRecord
.
getBookEndDate
());
DateTime
arrivalDate
=
new
DateTime
(
vehicleBookRecord
.
getBookEndDate
());
DateTime
actualArrivalDate
=
new
DateTime
(
new
Date
());
DateTime
actualArrivalDate
=
new
DateTime
(
new
Date
());
//提前还车处理
//提前还车处理
if
(
actualArrivalDate
.
compareTo
(
arrivalDate
)
<
0
)
{
//实际还车时间小于预计还车时间,需要释放后面的时间
if
(
actualArrivalDate
.
compareTo
(
arrivalDate
)
<
0
)
{
//实际还车时间小于预计还车时间,需要释放后面的时间
BookVehicleVO
bookVehicleVo
=
new
BookVehicleVO
();
BookVehicleVO
bookVehicleVo
=
new
BookVehicleVO
();
BeanUtils
.
copyProperties
(
vehicleBookRecord
,
bookVehicleVo
);
BeanUtils
.
copyProperties
(
vehicleBookRecord
,
bookVehicleVo
);
bookVehicleVo
.
setNotCheckTimeLegal
(
Boolean
.
TRUE
);
bookVehicleVo
.
setNotCheckTimeLegal
(
Boolean
.
TRUE
);
bookVehicleVo
.
setBookStartDate
(
null
);
bookVehicleVo
.
setBookStartDate
(
null
);
bookVehicleVo
.
setBookEndDate
(
null
);
bookVehicleVo
.
setBookEndDate
(
null
);
bookVehicleVo
.
setUnbookStartDate
(
actualArrivalDate
.
toString
(
DATE_TIME_FORMATTER
));
bookVehicleVo
.
setUnbookStartDate
(
actualArrivalDate
.
toString
(
DATE_TIME_FORMATTER
));
bookVehicleVo
.
setUnbookEndDate
(
arrivalDate
.
toString
(
DATE_TIME_FORMATTER
));
bookVehicleVo
.
setUnbookEndDate
(
arrivalDate
.
toString
(
DATE_TIME_FORMATTER
));
try
{
try
{
Boolean
hasSuc
=
vehicleBiz
.
unbookVehicle
(
bookVehicleVo
);
Boolean
hasSuc
=
vehicleBiz
.
unbookVehicle
(
bookVehicleVo
);
if
(!
hasSuc
)
{
if
(!
hasSuc
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_UNBOOK_FAIL
.
getDesc
(),
ResCode
.
VEHICLE_UNBOOK_FAIL
.
getCode
());
throw
new
BaseException
(
ResCode
.
VEHICLE_UNBOOK_FAIL
.
getDesc
(),
ResCode
.
VEHICLE_UNBOOK_FAIL
.
getCode
());
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
departureLog
.
setMileageEnd
(
arrivalVo
.
getMileage
());
departureLog
.
setMileageEnd
(
arrivalVo
.
getMileage
());
departureLog
.
setRecycleMan
(
arrivalVo
.
getRecycleMan
());
departureLog
.
setRecycleMan
(
arrivalVo
.
getRecycleMan
());
departureLog
.
setRecycleManTel
(
arrivalVo
.
getRecycleManTel
());
departureLog
.
setRecycleManTel
(
arrivalVo
.
getRecycleManTel
());
departureLog
.
setArrivalBranchCompanyId
(
arrivalVo
.
getArrivalBranchCompanyId
());
departureLog
.
setArrivalBranchCompanyId
(
arrivalVo
.
getArrivalBranchCompanyId
());
departureLog
.
setUpdateTime
(
new
Date
());
departureLog
.
setUpdateTime
(
new
Date
());
departureLog
.
setArrivalTime
(
new
Date
());
departureLog
.
setArrivalTime
(
new
Date
());
departureLog
.
setState
(
VehicleDepartureState
.
END
.
getCode
());
departureLog
.
setState
(
VehicleDepartureState
.
END
.
getCode
());
departureLog
.
setIllegalPic
(
arrivalVo
.
getIllegalPic
());
departureLog
.
setIllegalPic
(
arrivalVo
.
getIllegalPic
());
departureLog
.
setIllegalAmount
(
arrivalVo
.
getIllegalAmount
());
departureLog
.
setIllegalAmount
(
arrivalVo
.
getIllegalAmount
());
departureLog
.
setArrivalPic
(
arrivalVo
.
getArrivalPic
());
departureLog
.
setArrivalPic
(
arrivalVo
.
getArrivalPic
());
departureLog
.
setArrivalRemark
(
arrivalVo
.
getRemark
());
departureLog
.
setArrivalRemark
(
arrivalVo
.
getRemark
());
if
(
vehicleBookRecord
!=
null
)
{
if
(
vehicleBookRecord
!=
null
)
{
departureLog
.
setArrivalBranchCompanyId
(
vehicleBookRecord
.
getRetCompany
());
departureLog
.
setArrivalBranchCompanyId
(
vehicleBookRecord
.
getRetCompany
());
}
}
vehicleDepartureLogMapper
.
updateByPrimaryKeySelective
(
departureLog
);
vehicleDepartureLogMapper
.
updateByPrimaryKeySelective
(
departureLog
);
// 车辆活动日志
// 车辆活动日志
VehicleActiveLog
activeLog
=
vehicleActiveLogMapper
.
selectLastByVehicleId
(
arrivalVo
.
getVehicleId
());
VehicleActiveLog
activeLog
=
vehicleActiveLogMapper
.
selectLastByVehicleId
(
arrivalVo
.
getVehicleId
());
if
(
activeLog
==
null
)
{
if
(
activeLog
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getDesc
(),
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getCode
());
ResCode
.
VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE
.
getCode
());
}
}
activeLog
.
setEndTime
(
new
Date
());
activeLog
.
setEndTime
(
new
Date
());
activeLog
.
setUpdateTime
(
new
Date
());
activeLog
.
setUpdateTime
(
new
Date
());
vehicleActiveLogMapper
.
updateByPrimaryKeySelective
(
activeLog
);
vehicleActiveLogMapper
.
updateByPrimaryKeySelective
(
activeLog
);
//取消预定时间 bookInfo和bookRecord
//取消预定时间 bookInfo和bookRecord
// BookVehicleVO bookVehicleVo = new BookVehicleVO();
// BookVehicleVO bookVehicleVo = new BookVehicleVO();
// BeanUtils.copyProperties(vehicleBookRecord, bookVehicleVo);
// BeanUtils.copyProperties(vehicleBookRecord, bookVehicleVo);
// bookVehicleVo.setNotCheckTimeLegal(Boolean.TRUE);
// bookVehicleVo.setNotCheckTimeLegal(Boolean.TRUE);
...
@@ -311,9 +315,12 @@ public class VehicleActiveService {
...
@@ -311,9 +315,12 @@ public class VehicleActiveService {
// } catch ( Exception e) {
// } catch ( Exception e) {
// e.printStackTrace();
// e.printStackTrace();
// }
// }
}
else
{
}
else
{
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getDesc
(),
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
ResCode
.
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
.
getCode
());
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
...
...
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