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
654ba2a0
Commit
654ba2a0
authored
Apr 29, 2019
by
youjj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
公司股权购买申请参数方式修改,股权信息添加图片
parent
fd98a01e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
3 deletions
+64
-3
BranchCompanyStockService.java
...aravan/caravan/vehicle/biz/BranchCompanyStockService.java
+44
-0
BranchCompanyStockInfo.java
...aravan/caravan/vehicle/entity/BranchCompanyStockInfo.java
+2
-0
BranchCompanyStockController.java
...an/caravan/vehicle/rest/BranchCompanyStockController.java
+17
-1
BranchCompanyStockInfoVo.java
...ncaravan/caravan/vehicle/vo/BranchCompanyStockInfoVo.java
+1
-2
No files found.
vehicle/src/main/java/com/xinxincaravan/caravan/vehicle/biz/BranchCompanyStockService.java
View file @
654ba2a0
...
@@ -3,7 +3,9 @@ package com.xinxincaravan.caravan.vehicle.biz;
...
@@ -3,7 +3,9 @@ package com.xinxincaravan.caravan.vehicle.biz;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.xinxincaravan.caravan.vehicle.common.RestResponse
;
import
com.xinxincaravan.caravan.vehicle.constant.BranchCompanyStockApplyState
;
import
com.xinxincaravan.caravan.vehicle.constant.BranchCompanyStockApplyState
;
import
com.xinxincaravan.caravan.vehicle.constant.RedisKey
;
import
com.xinxincaravan.caravan.vehicle.constant.ResCode.ResCode
;
import
com.xinxincaravan.caravan.vehicle.constant.ResCode.ResCode
;
import
com.xinxincaravan.caravan.vehicle.entity.BranchCompanyStockApplyInfo
;
import
com.xinxincaravan.caravan.vehicle.entity.BranchCompanyStockApplyInfo
;
import
com.xinxincaravan.caravan.vehicle.entity.BranchCompanyStockInfo
;
import
com.xinxincaravan.caravan.vehicle.entity.BranchCompanyStockInfo
;
...
@@ -14,17 +16,36 @@ import com.xinxincaravan.caravan.vehicle.vo.BranchCompanyStockApplyInfoVo;
...
@@ -14,17 +16,36 @@ import com.xinxincaravan.caravan.vehicle.vo.BranchCompanyStockApplyInfoVo;
import
com.xinxincaravan.caravan.vehicle.vo.BranchCompanyStockApplyVo
;
import
com.xinxincaravan.caravan.vehicle.vo.BranchCompanyStockApplyVo
;
import
com.xinxincaravan.caravan.vehicle.vo.BranchCompanyStockInfoVo
;
import
com.xinxincaravan.caravan.vehicle.vo.BranchCompanyStockInfoVo
;
import
com.xinxincaravan.caravan.vehicle.vo.BranchCompanyStockSearchVo
;
import
com.xinxincaravan.caravan.vehicle.vo.BranchCompanyStockSearchVo
;
import
org.apache.commons.io.FileUtils
;
import
org.joda.time.DateTime
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormatter
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
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.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.File
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
@Service
@Service
public
class
BranchCompanyStockService
{
public
class
BranchCompanyStockService
{
public
static
final
DateTimeFormatter
DEFAULT_DATE_TIME_FORMATTER
=
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd"
);
public
static
final
DateTimeFormatter
YEARMONTH_DATE_TIME_FORMATTER
=
DateTimeFormat
.
forPattern
(
"yyyy-MM"
);
@Value
(
"${branchCompanyStockPic.baseUploadPath:/data/branchCompanyStock/upload/}"
)
private
String
baseUploadPath
;
@Autowired
private
RedisTemplate
customRedisTemplate
;
@Autowired
@Autowired
BranchCompanyStockInfoMapper
branchCompanyStockInfoMapper
;
BranchCompanyStockInfoMapper
branchCompanyStockInfoMapper
;
...
@@ -169,4 +190,27 @@ public class BranchCompanyStockService {
...
@@ -169,4 +190,27 @@ public class BranchCompanyStockService {
public
void
deleteApply
(
Integer
id
)
{
public
void
deleteApply
(
Integer
id
)
{
branchCompanyStockApplyInfoMapper
.
deleteByPrimaryKey
(
id
);
branchCompanyStockApplyInfoMapper
.
deleteByPrimaryKey
(
id
);
}
}
/**
* 写入上传文件,返回相对路径
* @param file
* @return
*/
public
RestResponse
<
String
>
uploadCompanyPic
(
MultipartFile
file
)
throws
Exception
{
//创建本日存放目录
DateTime
now
=
DateTime
.
now
();
String
dirPathToday
=
File
.
separator
+
now
.
toString
(
DEFAULT_DATE_TIME_FORMATTER
);
String
redisNoKey
=
RedisKey
.
UPLOAD_FILE_NO_PREFIX
+
now
.
toString
(
DEFAULT_DATE_TIME_FORMATTER
);
Long
no
=
customRedisTemplate
.
opsForValue
().
increment
(
redisNoKey
);
if
(
no
.
equals
(
1
l
)){
customRedisTemplate
.
expire
(
redisNoKey
,
1
,
TimeUnit
.
DAYS
);
}
String
fileName
=
file
.
getOriginalFilename
();
String
realFileRelPath
=
dirPathToday
+
File
.
separator
+
no
+
fileName
.
substring
(
fileName
.
lastIndexOf
(
"."
));
//文件存放路径
String
filePath
=
baseUploadPath
+
realFileRelPath
;
//将文件写入指定位置
FileUtils
.
copyInputStreamToFile
(
file
.
getInputStream
(),
new
File
(
filePath
));
return
RestResponse
.
suc
(
realFileRelPath
);
}
}
}
vehicle/src/main/java/com/xinxincaravan/caravan/vehicle/entity/BranchCompanyStockInfo.java
View file @
654ba2a0
...
@@ -38,4 +38,6 @@ public class BranchCompanyStockInfo {
...
@@ -38,4 +38,6 @@ public class BranchCompanyStockInfo {
private
Integer
addrCity
;
private
Integer
addrCity
;
private
Integer
state
;
private
Integer
state
;
private
Integer
companyPic
;
}
}
\ No newline at end of file
vehicle/src/main/java/com/xinxincaravan/caravan/vehicle/rest/BranchCompanyStockController.java
View file @
654ba2a0
...
@@ -11,6 +11,7 @@ import com.xinxincaravan.caravan.vehicle.vo.BranchCompanyStockInfoVo;
...
@@ -11,6 +11,7 @@ import com.xinxincaravan.caravan.vehicle.vo.BranchCompanyStockInfoVo;
import
com.xinxincaravan.caravan.vehicle.vo.BranchCompanyStockSearchVo
;
import
com.xinxincaravan.caravan.vehicle.vo.BranchCompanyStockSearchVo
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
@RestController
@RestController
@IgnoreClientToken
@IgnoreClientToken
...
@@ -18,6 +19,8 @@ import org.springframework.web.bind.annotation.*;
...
@@ -18,6 +19,8 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping
(
"branchCompany/stock"
)
@RequestMapping
(
"branchCompany/stock"
)
public
class
BranchCompanyStockController
{
public
class
BranchCompanyStockController
{
private
static
Integer
MAX_DRIVING_LICENSE_SIZE
=
10
*
1024
*
1024
;
//10M
@Autowired
@Autowired
BranchCompanyStockService
branchCompanyStockService
;
BranchCompanyStockService
branchCompanyStockService
;
...
@@ -95,13 +98,26 @@ public class BranchCompanyStockController {
...
@@ -95,13 +98,26 @@ public class BranchCompanyStockController {
return
RestResponse
.
suc
();
return
RestResponse
.
suc
();
}
}
@RequestMapping
(
value
=
"/upload/companyPic"
,
method
=
RequestMethod
.
POST
)
public
RestResponse
uploadCompanyPic
(
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
Exception
{
String
contentType
=
file
.
getContentType
();
//图片文件类型
if
(!
contentType
.
equals
(
"image/jpeg"
)
&&
!
contentType
.
equals
(
"image/gif"
)){
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
}
if
(
file
.
getSize
()
>
MAX_DRIVING_LICENSE_SIZE
){
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
}
return
branchCompanyStockService
.
uploadCompanyPic
(
file
);
}
/**
/**
* 申请购买
* 申请购买
* @param applyVo
* @param applyVo
* @return
* @return
*/
*/
@PostMapping
(
"apply"
)
@PostMapping
(
"apply"
)
public
RestResponse
apply
(
BranchCompanyStockApplyVo
applyVo
)
{
public
RestResponse
apply
(
@RequestBody
BranchCompanyStockApplyVo
applyVo
)
{
if
(
applyVo
.
getCompanyId
()
==
null
||
applyVo
.
getName
()
==
null
||
applyVo
.
getTel
()
==
null
||
applyVo
.
getCount
()
==
null
)
{
if
(
applyVo
.
getCompanyId
()
==
null
||
applyVo
.
getName
()
==
null
||
applyVo
.
getTel
()
==
null
||
applyVo
.
getCount
()
==
null
)
{
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
...
...
vehicle/src/main/java/com/xinxincaravan/caravan/vehicle/vo/BranchCompanyStockInfoVo.java
View file @
654ba2a0
...
@@ -16,7 +16,6 @@ public class BranchCompanyStockInfoVo {
...
@@ -16,7 +16,6 @@ public class BranchCompanyStockInfoVo {
BigDecimal
price
;
BigDecimal
price
;
Integer
addrProvince
;
Integer
addrProvince
;
Integer
addrCity
;
Integer
addrCity
;
// String addrStrProvince;
// String addrStrCity;
Integer
state
;
Integer
state
;
String
companyPic
;
}
}
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