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
0b5fac9d
Commit
0b5fac9d
authored
Aug 22, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
ec52c7d0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
1 deletion
+83
-1
CompanyBaseBiz.java
...in/java/com/xxfc/platform/vehicle/biz/CompanyBaseBiz.java
+47
-1
CompanyBaseController.java
...fc/platform/vehicle/rest/admin/CompanyBaseController.java
+36
-0
No files found.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/CompanyBaseBiz.java
View file @
0b5fac9d
...
...
@@ -4,17 +4,63 @@ package com.xxfc.platform.vehicle.biz;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.vehicle.entity.*
;
import
com.xxfc.platform.vehicle.mapper.BranchCompanyStockInfoMapper
;
import
com.xxfc.platform.vehicle.mapper.CompanyBaseMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Service
@Slf4j
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
.
setState
(
2
);
stockRightBiz
.
insertSelective
(
branchCompanyStockRight
);
}
num
++;
log
.
info
(
"----成功---num=="
+
num
+
"---companyBaseId==="
+
companyBaseId
);
}
}
return
ObjectRestResponse
.
succ
();
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/CompanyBaseController.java
0 → 100644
View file @
0b5fac9d
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