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
80430f91
Commit
80430f91
authored
Aug 23, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
84c40e22
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
158 additions
and
2 deletions
+158
-2
BranchCompanyStockRight.java
...xxfc/platform/vehicle/entity/BranchCompanyStockRight.java
+2
-1
CompanyVo.java
...ain/java/com/xxfc/platform/vehicle/pojo/vo/CompanyVo.java
+80
-0
CompanyBaseBiz.java
...in/java/com/xxfc/platform/vehicle/biz/CompanyBaseBiz.java
+76
-1
No files found.
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/BranchCompanyStockRight.java
View file @
80430f91
...
...
@@ -40,7 +40,8 @@ public class BranchCompanyStockRight{
*/
private
Integer
type
;
private
Integer
state
;
@Column
(
name
=
"stock_state"
)
private
Integer
stockState
;
/**
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/vo/CompanyVo.java
0 → 100644
View file @
80430f91
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* 分公司信息
*/
@Data
public
class
CompanyVo
{
/**
* 公司基本信息表
*/
@ApiModelProperty
(
"公司基本信息id"
)
Integer
id
;
@ApiModelProperty
(
"公司全名称"
)
String
name
;
@ApiModelProperty
(
"公司封面"
)
String
cover
;
@ApiModelProperty
(
"轮播图"
)
String
images
;
@ApiModelProperty
(
"片区id"
)
Integer
zoneId
;
@ApiModelProperty
(
"公司简介"
)
String
describes
;
@ApiModelProperty
(
"详情"
)
String
content
;
@ApiModelProperty
(
"地址-省/直辖市(编码)"
)
Integer
addrProvince
;
@ApiModelProperty
(
"地址-市(编码)"
)
Integer
addrCity
;
@ApiModelProperty
(
"地址-镇/县(编码)"
)
Integer
addrTown
;
/**
* 分支机构
*/
@ApiModelProperty
(
"分支机构id"
)
Integer
companyId
;
@ApiModelProperty
(
"分支机构名称"
)
String
companyName
;
@ApiModelProperty
(
"详细地址"
)
String
addrDetail
;
@ApiModelProperty
(
"上下架:1-上架;2-下架"
)
Integer
state
;
@ApiModelProperty
(
"负责人"
)
private
String
leader
;
@ApiModelProperty
(
"负责人联系方式"
)
private
String
leaderContactInfo
;
@ApiModelProperty
(
"公司状态"
)
private
Integer
status
;
@ApiModelProperty
(
"公司地址-纬度"
)
private
BigDecimal
latitude
;
@ApiModelProperty
(
"公司地址-经度"
)
private
BigDecimal
longitude
;
@ApiModelProperty
(
"租车客服电话"
)
private
String
vehiceServicePhone
;
@ApiModelProperty
(
"旅游客服电话"
)
private
String
tourServicePhone
;
/**
* 股权信息
*/
@ApiModelProperty
(
"股份id"
)
Integer
stockId
;
@ApiModelProperty
(
"剩余股份"
)
Integer
balance
;
@ApiModelProperty
(
"股份总数"
)
Integer
total
;
@ApiModelProperty
(
"股份单价"
)
BigDecimal
price
;
@ApiModelProperty
(
"排序"
)
Integer
rank
;
@ApiModelProperty
(
"(-1:下架,0:筹备中,1:筹备完成,2:上架)"
)
Integer
stockState
;
@ApiModelProperty
(
"股价类型:1-万/股;2-港万/股"
)
Integer
type
;
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/CompanyBaseBiz.java
View file @
80430f91
...
...
@@ -3,10 +3,14 @@ package com.xxfc.platform.vehicle.biz;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.vehicle.entity.*
;
import
com.xxfc.platform.vehicle.mapper.BranchCompanyStockInfoMapper
;
import
com.xxfc.platform.vehicle.mapper.CompanyBaseMapper
;
import
com.xxfc.platform.vehicle.pojo.vo.CompanyVo
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
...
...
@@ -52,7 +56,7 @@ public class CompanyBaseBiz extends BaseBiz<CompanyBaseMapper, CompanyBase> {
branchCompanyStockRight
.
setPrice
(
price
);
branchCompanyStockRight
.
setTotal
(
total
);
branchCompanyStockRight
.
setCompanyBaseId
(
companyBaseId
);
branchCompanyStockRight
.
setState
(
2
);
branchCompanyStockRight
.
setSt
ockSt
ate
(
2
);
stockRightBiz
.
insertSelective
(
branchCompanyStockRight
);
}
num
++;
...
...
@@ -62,6 +66,77 @@ public class CompanyBaseBiz extends BaseBiz<CompanyBaseMapper, CompanyBase> {
return
ObjectRestResponse
.
succ
();
}
//设置基础信息
public
ObjectRestResponse
updCompany
(
CompanyVo
companyVo
){
if
(
companyVo
==
null
||
StringUtils
.
isBlank
(
companyVo
.
getCompanyName
())||
StringUtils
.
isBlank
(
companyVo
.
getName
())||
companyVo
.
getZoneId
()==
null
||
companyVo
.
getZoneId
()==
0
||
companyVo
.
getAddrProvince
()==
null
||
companyVo
.
getAddrProvince
()==
0
||
companyVo
.
getAddrCity
()==
null
||
companyVo
.
getAddrCity
()==
0
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数不能为空"
);
}
Integer
state
=
companyVo
.
getState
()==
null
?
2
:
companyVo
.
getState
();
if
(
state
==
1
&&(
StringUtils
.
isBlank
(
companyVo
.
getAddrDetail
())||
StringUtils
.
isBlank
(
companyVo
.
getImages
())||
StringUtils
.
isBlank
(
companyVo
.
getDescribes
())||
StringUtils
.
isBlank
(
companyVo
.
getContent
())
||
StringUtils
.
isBlank
(
companyVo
.
getLeader
())||
StringUtils
.
isBlank
(
companyVo
.
getLeaderContactInfo
())||
StringUtils
.
isBlank
(
companyVo
.
getTourServicePhone
())||
StringUtils
.
isBlank
(
companyVo
.
getVehiceServicePhone
()))){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"上架时参数不能为空"
);
}
CompanyBase
companyBase
=
new
CompanyBase
();
BeanUtils
.
copyProperties
(
companyVo
,
companyBase
);
Integer
companyBaseId
=
companyVo
.
getId
();
if
(
companyBaseId
==
null
||
companyBaseId
==
0
){
insertSelective
(
companyBase
);
companyBaseId
=
companyBase
.
getId
();
}
else
{
updateSelectiveById
(
companyBase
);
}
BranchCompany
branchCompany
=
new
BranchCompany
();
BeanUtils
.
copyProperties
(
companyVo
,
branchCompany
);
branchCompany
.
setCompanyBaseId
(
companyBaseId
);
branchCompany
.
setName
(
companyVo
.
getCompanyName
());
Integer
companyId
=
companyVo
.
getCompanyId
();
if
(
companyId
==
null
||
companyId
==
0
){
branchCompany
.
setId
(
null
);
insertSelective
(
companyBase
);
}
else
{
branchCompany
.
setId
(
companyId
);
updateSelectiveById
(
companyBase
);
}
return
ObjectRestResponse
.
succ
();
}
//设置股权信息
public
ObjectRestResponse
updStockInfo
(
CompanyVo
companyVo
){
if
(
companyVo
==
null
||
StringUtils
.
isBlank
(
companyVo
.
getCompanyName
())||
StringUtils
.
isBlank
(
companyVo
.
getName
())||
companyVo
.
getZoneId
()==
null
||
companyVo
.
getZoneId
()==
0
||
companyVo
.
getAddrProvince
()==
null
||
companyVo
.
getAddrProvince
()==
0
||
companyVo
.
getAddrCity
()==
null
||
companyVo
.
getAddrCity
()==
0
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数不能为空"
);
}
Integer
state
=
companyVo
.
getState
()==
null
?
2
:
companyVo
.
getState
();
if
(
state
==
1
&&(
StringUtils
.
isBlank
(
companyVo
.
getAddrDetail
())||
StringUtils
.
isBlank
(
companyVo
.
getImages
())||
StringUtils
.
isBlank
(
companyVo
.
getDescribes
())||
StringUtils
.
isBlank
(
companyVo
.
getContent
())
||
StringUtils
.
isBlank
(
companyVo
.
getLeader
())||
StringUtils
.
isBlank
(
companyVo
.
getLeaderContactInfo
())||
StringUtils
.
isBlank
(
companyVo
.
getTourServicePhone
())||
StringUtils
.
isBlank
(
companyVo
.
getVehiceServicePhone
()))){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"上架时参数不能为空"
);
}
CompanyBase
companyBase
=
new
CompanyBase
();
BeanUtils
.
copyProperties
(
companyVo
,
companyBase
);
Integer
companyBaseId
=
companyVo
.
getId
();
if
(
companyBaseId
==
null
||
companyBaseId
==
0
){
insertSelective
(
companyBase
);
companyBaseId
=
companyBase
.
getId
();
}
else
{
updateSelectiveById
(
companyBase
);
}
BranchCompany
branchCompany
=
new
BranchCompany
();
BeanUtils
.
copyProperties
(
companyVo
,
branchCompany
);
branchCompany
.
setCompanyBaseId
(
companyBaseId
);
branchCompany
.
setName
(
companyVo
.
getCompanyName
());
Integer
companyId
=
companyVo
.
getCompanyId
();
if
(
companyId
==
null
||
companyId
==
0
){
branchCompany
.
setId
(
null
);
insertSelective
(
companyBase
);
}
else
{
branchCompany
.
setId
(
companyId
);
updateSelectiveById
(
companyBase
);
}
return
ObjectRestResponse
.
succ
();
}
}
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