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
1faf4505
Commit
1faf4505
authored
Aug 23, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hz_dev' into base-modify
parents
f1df06ae
80430f91
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
241 additions
and
2 deletions
+241
-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
+123
-1
CompanyBaseController.java
...fc/platform/vehicle/rest/admin/CompanyBaseController.java
+36
-0
No files found.
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/BranchCompanyStockRight.java
View file @
1faf4505
...
@@ -40,7 +40,8 @@ public class BranchCompanyStockRight{
...
@@ -40,7 +40,8 @@ public class BranchCompanyStockRight{
*/
*/
private
Integer
type
;
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 @
1faf4505
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 @
1faf4505
...
@@ -3,18 +3,140 @@ package com.xxfc.platform.vehicle.biz;
...
@@ -3,18 +3,140 @@ package com.xxfc.platform.vehicle.biz;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
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.entity.*
;
import
com.xxfc.platform.vehicle.mapper.BranchCompanyStockInfoMapper
;
import
com.xxfc.platform.vehicle.mapper.CompanyBaseMapper
;
import
com.xxfc.platform.vehicle.mapper.CompanyBaseMapper
;
import
com.xxfc.platform.vehicle.pojo.vo.CompanyVo
;
import
lombok.extern.slf4j.Slf4j
;
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
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Service
@Service
@Slf4j
@Slf4j
public
class
CompanyBaseBiz
extends
BaseBiz
<
CompanyBaseMapper
,
CompanyBase
>
{
public
class
CompanyBaseBiz
extends
BaseBiz
<
CompanyBaseMapper
,
CompanyBase
>
{
@Autowired
BranchCompanyStockRightBiz
stockRightBiz
;
@Autowired
BranchCompanyStockInfoMapper
stockInfoMapper
;
@Value
(
"${branchCompanyPic.url}"
)
private
String
companyUrl
;
//临时数据同步
//临时数据同步
// public ObjectRestResponse
public
ObjectRestResponse
synchro
(){
List
<
BranchCompanyStockInfo
>
list
=
stockInfoMapper
.
selectAll
();
if
(
list
.
size
()>
0
){
for
(
BranchCompanyStockInfo
companyStockInfo:
list
){
int
num
=
0
;
String
companyName
=
companyStockInfo
.
getCompanyName
();
Integer
balance
=
companyStockInfo
.
getBalance
();
Integer
total
=
companyStockInfo
.
getTotal
();
BigDecimal
price
=
companyStockInfo
.
getPrice
();
CompanyBase
companyBase
=
new
CompanyBase
();
companyBase
.
setAddrCity
(
companyStockInfo
.
getAddrCity
());
companyBase
.
setAddrProvince
(
companyStockInfo
.
getAddrProvince
());
companyBase
.
setName
(
companyName
);
companyBase
.
setCover
(
companyUrl
+
"/image/admin/upload"
+
companyStockInfo
.
getCompanyPic
());
companyBase
.
setImages
(
companyUrl
+
"/image/admin/upload"
+
companyStockInfo
.
getCompanyPic
());
insertSelective
(
companyBase
);
Integer
companyBaseId
=
companyBase
.
getId
();
if
(
companyBaseId
!=
null
){
BranchCompanyStockRight
branchCompanyStockRight
=
new
BranchCompanyStockRight
();
branchCompanyStockRight
.
setBalance
(
balance
);
branchCompanyStockRight
.
setPrice
(
price
);
branchCompanyStockRight
.
setTotal
(
total
);
branchCompanyStockRight
.
setCompanyBaseId
(
companyBaseId
);
branchCompanyStockRight
.
setStockState
(
2
);
stockRightBiz
.
insertSelective
(
branchCompanyStockRight
);
}
num
++;
log
.
info
(
"----成功---num=="
+
num
+
"---companyBaseId==="
+
companyBaseId
);
}
}
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
();
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/CompanyBaseController.java
0 → 100644
View file @
1faf4505
package
com
.
xxfc
.
platform
.
vehicle
.
rest
.
admin
;
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.util.process.ResultCode
;
import
com.xxfc.platform.vehicle.biz.BranchCompanyStockApplyInfoBiz
;
import
com.xxfc.platform.vehicle.biz.CompanyBaseBiz
;
import
com.xxfc.platform.vehicle.common.BaseController
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.entity.BranchCompanyStockApplyInfo
;
import
com.xxfc.platform.vehicle.pojo.BranchCompanyStockApplyVo
;
import
com.xxfc.platform.vehicle.pojo.BranchCompanyStockSearchVo
;
import
com.xxfc.platform.vehicle.pojo.vo.BranchCompanyStockInfoRightVo
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
javax.servlet.http.HttpServletRequest
;
@RestController
@IgnoreClientToken
@IgnoreUserToken
@RequestMapping
(
"company/base"
)
public
class
CompanyBaseController
extends
BaseController
<
CompanyBaseBiz
>
{
@PostMapping
(
"synchro"
)
public
ObjectRestResponse
<
String
>
synchro
()
{
return
baseBiz
.
synchro
();
}
}
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