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
5628808e
Commit
5628808e
authored
Aug 22, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'base-modify' into lb_dev
parents
67aedce3
e7b00a53
Changes
27
Hide whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
936 additions
and
34 deletions
+936
-34
StringToolsUtil.java
.../github/wxiaoqi/security/common/util/StringToolsUtil.java
+39
-0
AppUserManageBiz.java
...m/github/wxiaoqi/security/admin/biz/AppUserManageBiz.java
+3
-3
BaseUserMemberBiz.java
.../github/wxiaoqi/security/admin/biz/BaseUserMemberBiz.java
+2
-1
AppUsersManageController.java
...wxiaoqi/security/admin/rest/AppUsersManageController.java
+3
-2
BaseUserMemberController.java
...wxiaoqi/security/admin/rest/BaseUserMemberController.java
+3
-3
AppUserDetailMapper.xml
...e-admin/src/main/resources/mapper/AppUserDetailMapper.xml
+6
-0
pom.xml
ace-modules/ace-tool/pom.xml
+6
-3
pom.xml
ace-sidecar/ace-sidecar-client-demo/pom.xml
+8
-2
pom.xml
ace-sidecar/ace-sidecar-server/pom.xml
+4
-1
TourGoodVerificationController.java
...fc/platform/tour/rest/TourGoodVerificationController.java
+1
-5
CertificationController.java
...latform/universal/controller/CertificationController.java
+1
-1
CertificationService.java
...xxfc/platform/universal/service/CertificationService.java
+8
-7
ResCode.java
...a/com/xxfc/platform/vehicle/constant/ResCode/ResCode.java
+1
-0
BranchCompany.java
.../java/com/xxfc/platform/vehicle/entity/BranchCompany.java
+16
-0
BranchCompanyStockRight.java
...xxfc/platform/vehicle/entity/BranchCompanyStockRight.java
+70
-0
CompanyBase.java
...in/java/com/xxfc/platform/vehicle/entity/CompanyBase.java
+105
-0
RentVehicleBookDTO.java
...va/com/xxfc/platform/vehicle/pojo/RentVehicleBookDTO.java
+3
-2
BranchCompanyStockInfoRightVo.java
...atform/vehicle/pojo/vo/BranchCompanyStockInfoRightVo.java
+24
-0
BranchCompanyStockApplyInfoBiz.java
.../platform/vehicle/biz/BranchCompanyStockApplyInfoBiz.java
+121
-0
BranchCompanyStockRightBiz.java
...xxfc/platform/vehicle/biz/BranchCompanyStockRightBiz.java
+162
-0
CompanyBaseBiz.java
...in/java/com/xxfc/platform/vehicle/biz/CompanyBaseBiz.java
+20
-0
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+14
-3
BranchCompanyStockRightMapper.java
...latform/vehicle/mapper/BranchCompanyStockRightMapper.java
+28
-0
CompanyBaseMapper.java
...a/com/xxfc/platform/vehicle/mapper/CompanyBaseMapper.java
+10
-0
BranchCompanyStockRightController.java
...tform/vehicle/rest/BranchCompanyStockRightController.java
+194
-0
BranchCompanyStockRightMapper.xml
...c/main/resources/mapper/BranchCompanyStockRightMapper.xml
+83
-0
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+1
-1
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/util/StringToolsUtil.java
View file @
5628808e
...
...
@@ -40,4 +40,43 @@ public class StringToolsUtil {
String
REGEX_ID_CARD
=
"(^\\d{18}$)|(^\\d{15}$)"
;
return
Pattern
.
matches
(
REGEX_ID_CARD
,
idCard
);
}
public
static
boolean
isNumer
(
String
str
){
boolean
flag
=
false
;
try
{
if
(
StringUtils
.
isBlank
(
str
))
{
flag
=
false
;
}
Pattern
regex
=
Pattern
.
compile
(
"[0-9]*"
);
Matcher
m
=
regex
.
matcher
(
str
);
flag
=
m
.
matches
();
}
catch
(
Exception
e
){
flag
=
false
;
}
return
flag
;
}
public
static
boolean
isBigDecimal
(
String
str
)
{
if
(
str
==
null
||
str
.
trim
().
length
()
==
0
)
{
return
false
;
}
char
[]
chars
=
str
.
toCharArray
();
int
sz
=
chars
.
length
;
int
i
=
(
chars
[
0
]
==
'-'
)
?
1
:
0
;
if
(
i
==
sz
)
return
false
;
if
(
chars
[
i
]
==
'.'
)
return
false
;
//除了负号,第一位不能为'小数点'
boolean
radixPoint
=
false
;
for
(;
i
<
sz
;
i
++)
{
if
(
chars
[
i
]
==
'.'
)
{
if
(
radixPoint
)
return
false
;
radixPoint
=
true
;
}
else
if
(!(
chars
[
i
]
>=
'0'
&&
chars
[
i
]
<=
'9'
))
{
return
false
;
}
}
return
true
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserManageBiz.java
View file @
5628808e
...
...
@@ -103,9 +103,9 @@ public class AppUserManageBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
if
(
CollectionUtils
.
isEmpty
(
appUserManageVos
))
{
return
new
PageInfo
<
AppUserManageVo
>();
}
Set
<
Integer
>
usSet
=
appUserManageDTO
.
getCitySet
();
List
<
AppUserManageVo
>
results
=
appUserManageVos
.
parallelStream
().
filter
(
us
->
usSet
.
contains
(
us
.
getCityCode
())).
collect
(
Collectors
.
toList
());
PageInfo
<
AppUserManageVo
>
pageInfo
=
PageInfo
.
of
(
result
s
);
//
Set<Integer> usSet = appUserManageDTO.getCitySet();
//
List<AppUserManageVo> results = appUserManageVos.parallelStream().filter(us -> usSet.contains(us.getCityCode())).collect(Collectors.toList());
PageInfo
<
AppUserManageVo
>
pageInfo
=
PageInfo
.
of
(
appUserManageVo
s
);
return
getAppUserManageVoPageInfo
(
pageInfo
);
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/BaseUserMemberBiz.java
View file @
5628808e
...
...
@@ -208,11 +208,12 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper, BaseUserMem
if
(
baseUserMemberVO
!=
null
)
{
return
baseUserMemberVO
;
}
return
n
ew
BaseUserMemberVO
()
;
return
n
ull
;
}
/**
* 设置用户会员
*
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUsersManageController.java
View file @
5628808e
...
...
@@ -45,19 +45,20 @@ public class AppUsersManageController extends BaseController<AppUserManageBiz,Ap
@Autowired
private
VehicleFeign
vehicleFeign
;
private
Integer
ALL_PERMISSIONS
=
1
;
/**
* 查询所有
* @return
*/
@PostMapping
(
"/findAll"
)
public
ObjectRestResponse
<
PageInfo
<
AppUserManageVo
>>
findAllByQuery
(
@RequestBody
AppUserManageDTO
appUserManageDTO
,
HttpServletRequest
request
)
throws
Exception
{
public
ObjectRestResponse
<
PageInfo
<
AppUserManageVo
>>
findAllByQuery
(
@RequestBody
AppUserManageDTO
appUserManageDTO
)
throws
Exception
{
String
token
=
userAuthConfig
.
getToken
(
request
);
ObjectRestResponse
objectRestResponse
=
publicController
.
userinfoByToken
(
token
);
User
user
=
(
User
)
objectRestResponse
.
getData
();
if
(
user
==
null
){
throw
new
BaseException
(
"User error!"
);
}
if
(
user
.
getDataAll
()==
1
)
{
if
(
ALL_PERMISSIONS
.
equals
(
user
.
getDataAll
())
)
{
return
ObjectRestResponse
.
succ
(
baseBiz
.
findAllByQuery
(
appUserManageDTO
));
}
ObjectRestResponse
<
Set
<
Integer
>>
setObjectRestResponse
=
vehicleFeign
.
corporationCity
(
user
.
getDataZone
(),
user
.
getDataCompany
());
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/BaseUserMemberController.java
View file @
5628808e
...
...
@@ -3,7 +3,6 @@ package com.github.wxiaoqi.security.admin.rest;
import
com.github.wxiaoqi.security.admin.biz.BaseUserMemberBiz
;
import
com.github.wxiaoqi.security.admin.dto.BaseUserMemberVO
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.entity.AppUserManage
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMember
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
...
...
@@ -15,7 +14,6 @@ import io.swagger.annotations.ApiOperation;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.lang.reflect.InvocationTargetException
;
import
java.util.Objects
;
/**
...
...
@@ -40,7 +38,9 @@ public class BaseUserMemberController extends BaseController<BaseUserMemberBiz,
@ApiOperation
(
value
=
"根据用户id获取用户会员信息"
)
@GetMapping
(
"/findOne/{userId}"
)
public
ObjectRestResponse
<
BaseUserMemberVO
>
findOneByUserId
(
@PathVariable
Integer
userId
)
throws
Exception
{
return
ObjectRestResponse
.
succ
(
baseBiz
.
findOneByUserId
(
userId
));
BaseUserMemberVO
oneByUserId
=
baseBiz
.
findOneByUserId
(
userId
);
oneByUserId
=(
oneByUserId
==
null
?
new
BaseUserMemberVO
():
oneByUserId
);
return
ObjectRestResponse
.
succ
(
oneByUserId
);
}
...
...
ace-modules/ace-admin/src/main/resources/mapper/AppUserDetailMapper.xml
View file @
5628808e
...
...
@@ -133,6 +133,12 @@
<if
test=
"source !=null "
>
and d.source = #{source}
</if>
<if
test=
"citySet != null "
>
and d.city_code in
<foreach
collection=
"citySet"
item=
"item"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
order by l.id ASC
</select>
...
...
ace-modules/ace-tool/pom.xml
View file @
5628808e
...
...
@@ -87,7 +87,10 @@
<artifactId>
spring-cloud-starter-openfeign
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-consul-all
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-consul-all
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
...
...
@@ -95,8 +98,8 @@
</dependency>
<!--<dependency>-->
<!--<groupId>org.springframework.amqp</groupId>-->
<!--<artifactId>spring-rabbit</artifactId>-->
<!--<groupId>org.springframework.amqp</groupId>-->
<!--<artifactId>spring-rabbit</artifactId>-->
<!--</dependency>-->
<dependency>
...
...
ace-sidecar/ace-sidecar-client-demo/pom.xml
View file @
5628808e
...
...
@@ -36,8 +36,14 @@
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-config-server
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-consul-all
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-consul-all
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-consul-all
</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.cloud</groupId>-->
<!-- <artifactId>spring-cloud-starter-consul-all</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-openfeign
</artifactId>
...
...
ace-sidecar/ace-sidecar-server/pom.xml
View file @
5628808e
...
...
@@ -36,7 +36,10 @@
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-config-server
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-consul-all
</artifactId>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-consul-all
</artifactId>
</dependency>
</dependencies>
<build>
...
...
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/rest/TourGoodVerificationController.java
View file @
5628808e
...
...
@@ -5,20 +5,16 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.tour.biz.TourGoodVerificationBiz
;
import
com.xxfc.platform.tour.common.TourBaseController
;
import
com.xxfc.platform.tour.entity.TourGoodVerification
;
import
com.xxfc.platform.tour.vo.TourGoodOrderFindVo
;
import
com.xxfc.platform.tour.vo.TourGoodOrderVo
;
import
com.xxfc.platform.tour.vo.TourVerificationInfoVo
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
@RestController
@RequestMapping
(
"/tourGood/verfication"
)
@IgnoreClientToken
public
class
TourGoodVerificationController
extends
TourBaseController
<
TourGoodVerificationBiz
>
{
public
class
TourGoodVerificationController
extends
BaseController
<
TourGoodVerificationBiz
,
TourGoodVerification
>
{
/**
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/CertificationController.java
View file @
5628808e
...
...
@@ -102,7 +102,7 @@ public class CertificationController {
// }
// });
// thread.start();
}
}
return
result
;
}
}
catch
(
Exception
e
)
{
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/CertificationService.java
View file @
5628808e
...
...
@@ -251,16 +251,16 @@ public class CertificationService {
}
idInformation
.
setExpirationDate
(
expirationDate
);
CertificationService
cs
=
applicationContext
.
getBean
(
this
.
getClass
());
ObjectRestResponse
objRR
=
cs
.
addIdInformation
(
idInformation
);
log
.
info
(
"----请求admin========="
+
objRR
);
if
(
objRR
.
getRel
())
{
return
ObjectRestResponse
.
succ
(
objRR
.
getData
());
}
return
cs
.
addIdInformation
(
idInformation
);
//
log.info("----请求admin=========" + objRR);
//
if (objRR.getRel()) {
//
return ObjectRestResponse.succ(objRR.getData());
//
}
}
}
return
ObjectRestResponse
.
succ
(
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
INCOMPLETE_DATA
,
"网络异常,请稍后再试"
);
}
...
...
@@ -344,7 +344,8 @@ public class CertificationService {
// idInformation.setId(idInformation1.getId());
// idInformation.setUpdTime(new Date());
// idInformationMapper.updateByPrimaryKeySelective(idInformation);
throw
new
BaseException
(
"该身份证已存在,不要重复认证!"
);
log
.
error
(
"该身份证已存在,不要重复认证"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"该身份证已存在,不要重复认证"
);
}
log
.
info
(
"----addIdInformation---userid==="
+
idInformation
.
getUserLoginId
()+
"----name===="
+
idInformation
.
getName
()+
"---IdNumber==="
+
idInformation
.
getIdNumber
());
//认证成功后修改用户,用户认证状态
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/constant/ResCode/ResCode.java
View file @
5628808e
...
...
@@ -23,6 +23,7 @@ public enum ResCode {
VEHICLE_BOOKED_RECORD_ALREADY_CHANGED
(
103001
,
"车辆预定申请已被审批"
),
VEHICLE_BOOKED_RECORD_STATUS_CHANGED
(
103002
,
"车辆预定申请状态已变更"
),
VEHICLE_BOOKED_RECORD_MILEAGE_CHANGED
(
103003
,
"请输入仪表盘内当前显示的公里数"
),
VEHICLE_BOOKED_RECORD_NOT_EXIST
(
103004
,
"预定记录不存在"
),
CHECKUSER_AND_PHONE_NOT_NULL
(
103999
,
"收车或交车人姓名和电话不能为空"
),
USERNAME_AND_TELE_NOT_NULL
(
104000
,
"使用人和电话不能为空"
),
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/BranchCompany.java
View file @
5628808e
...
...
@@ -18,6 +18,10 @@ public class BranchCompany {
@ApiModelProperty
(
"主键id"
)
private
Integer
id
;
@Column
(
name
=
"company_base_id"
)
@ApiModelProperty
(
"主键id"
)
private
Integer
companyBaseId
;
/**
* 分公司名称
*/
...
...
@@ -119,4 +123,16 @@ public class BranchCompany {
@ApiModelProperty
(
"旅游客服电话"
)
private
String
tourServicePhone
;
/**
* 上下架:1-上架;2-下架
*/
private
Integer
state
;
/**
* 是否删除:0-正常;1-删除
*/
@Column
(
name
=
"is_del"
)
private
Integer
isDel
;
}
\ No newline at end of file
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/BranchCompanyStockRight.java
0 → 100644
View file @
5628808e
package
com
.
xxfc
.
platform
.
vehicle
.
entity
;
import
lombok.Data
;
import
javax.persistence.*
;
import
java.math.BigDecimal
;
@Data
@Table
(
name
=
"branch_company_stock_info_right"
)
public
class
BranchCompanyStockRight
{
/**
* 分公司ID
*/
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
,
generator
=
"JDBC"
)
private
Integer
id
;
/**
* 有限公司id
*/
@Column
(
name
=
"company_base_id"
)
private
Integer
companyBaseId
;
/**
* 剩余股份
*/
private
Integer
balance
;
/**
* 股份总数
*/
private
Integer
total
;
/**
* 股份单价
*/
private
BigDecimal
price
;
/**
* 股价类型:1-万/股;2-港万/股
*/
private
Integer
type
;
private
Integer
state
;
/**
* 创建时间
*/
@Column
(
name
=
"crt_time"
)
private
Long
crtTime
;
/**
* 排序
*/
private
Integer
rank
;
/**
* 更新时间
*/
@Column
(
name
=
"upd_time"
)
private
Long
updTime
;
/**
* 是否删除:0-正常;1-删除
*/
@Column
(
name
=
"is_del"
)
private
Integer
isDel
;
}
\ No newline at end of file
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/CompanyBase.java
0 → 100644
View file @
5628808e
package
com
.
xxfc
.
platform
.
vehicle
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
@Data
@Table
(
name
=
"company_base"
)
public
class
CompanyBase
{
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
"主键id"
)
private
Integer
id
;
/**
* 分公司名称
*/
@ApiModelProperty
(
"分公司名称"
)
private
String
name
;
/**
* 公司封面
*/
@ApiModelProperty
(
"公司封面"
)
private
String
cover
;
/**
* 轮播图
*/
@ApiModelProperty
(
"轮播图"
)
private
String
images
;
/**
* 片区id
*/
@Column
(
name
=
"zone_id"
)
@ApiModelProperty
(
"片区id"
)
private
Integer
zoneId
;
/**
* 公司简介
*/
@ApiModelProperty
(
"公司简介"
)
private
String
describes
;
/**
* 详情
*/
@ApiModelProperty
(
"详情"
)
private
String
content
;
/**
* 地址-省/直辖市(编码)
*/
@Column
(
name
=
"addr_province"
)
@ApiModelProperty
(
"地址-省/直辖市(编码)"
)
private
Integer
addrProvince
;
/**
* 地址-市(编码)
*/
@Column
(
name
=
"addr_city"
)
@ApiModelProperty
(
"地址-市(编码)"
)
private
Integer
addrCity
;
/**
* 地址-镇/县(编码)
*/
@Column
(
name
=
"addr_town"
)
@ApiModelProperty
(
"地址-镇/县(编码)"
)
private
Integer
addrTown
;
/**
* 创建时间
*/
@Column
(
name
=
"crt_time"
)
@ApiModelProperty
(
"创建时间"
)
private
Long
crtTime
;
/**
* 更新时间
*/
@Column
(
name
=
"upd_time"
)
@ApiModelProperty
(
"更新时间"
)
private
Long
updTime
;
/**
* 是否删除:0-正常;1-删除
*/
@Column
(
name
=
"is_del"
)
@ApiModelProperty
(
"更新时间"
)
private
Integer
isDel
;
}
\ No newline at end of file
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/RentVehicleBookDTO.java
View file @
5628808e
...
...
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
java.time.Instant
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.ZoneOffset
;
import
java.util.List
;
...
...
@@ -94,7 +95,7 @@ public class RentVehicleBookDTO extends PageParam {
this
.
bookStartDate
=
bookStartDate
;
//首次设置
if
(
null
==
this
.
startDateExtend
)
{
this
.
startDateExtend
=
YMR_SLASH_FORMATTER
.
format
(
LocalDate
Time
.
parse
(
bookStartDate
,
YMR_SLASH_FORMATTER
).
minusDays
(
1L
));
this
.
startDateExtend
=
YMR_SLASH_FORMATTER
.
format
(
LocalDate
.
parse
(
bookStartDate
,
YMR_SLASH_FORMATTER
).
minusDays
(
1L
));
}
}
...
...
@@ -102,7 +103,7 @@ public class RentVehicleBookDTO extends PageParam {
this
.
bookEndDate
=
bookEndDate
;
//首次设置
if
(
null
==
this
.
endDateExtend
)
{
this
.
endDateExtend
=
YMR_SLASH_FORMATTER
.
format
(
LocalDate
Time
.
parse
(
bookEndDate
,
YMR_SLASH_FORMATTER
).
plusDays
(
1L
));
this
.
endDateExtend
=
YMR_SLASH_FORMATTER
.
format
(
LocalDate
.
parse
(
bookEndDate
,
YMR_SLASH_FORMATTER
).
plusDays
(
1L
));
}
}
}
\ No newline at end of file
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/vo/BranchCompanyStockInfoRightVo.java
0 → 100644
View file @
5628808e
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
.
vo
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* 分公司股份信息
*/
@Data
public
class
BranchCompanyStockInfoRightVo
{
Integer
id
;
Integer
companyId
;
String
companyName
;
Integer
balance
;
Integer
rank
;
Integer
total
;
BigDecimal
price
;
Integer
addrProvince
;
Integer
addrCity
;
Integer
state
;
String
companyPic
;
String
info
;
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/BranchCompanyStockApplyInfoBiz.java
0 → 100644
View file @
5628808e
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.xxfc.platform.vehicle.constant.BranchCompanyStockApplyState
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.entity.BranchCompanyStockApplyInfo
;
import
com.xxfc.platform.vehicle.entity.BranchCompanyStockRight
;
import
com.xxfc.platform.vehicle.mapper.BranchCompanyStockApplyInfoMapper
;
import
com.xxfc.platform.vehicle.pojo.BranchCompanyStockApplyInfoVo
;
import
com.xxfc.platform.vehicle.pojo.BranchCompanyStockApplyVo
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
@Service
public
class
BranchCompanyStockApplyInfoBiz
extends
BaseBiz
<
BranchCompanyStockApplyInfoMapper
,
BranchCompanyStockApplyInfo
>
{
@Autowired
BranchCompanyStockRightBiz
branchCompanyStockRightBiz
;
/**
* 申请购买
* @param applyVo
*/
public
void
apply
(
BranchCompanyStockApplyVo
applyVo
)
{
BranchCompanyStockRight
stockInfo
=
branchCompanyStockRightBiz
.
selectById
(
applyVo
.
getCompanyId
());
if
(
stockInfo
==
null
)
{
throw
new
BaseException
(
ResCode
.
BRANCH_COMPANY_STOCK_UNEXIST
.
getDesc
(),
ResCode
.
BRANCH_COMPANY_STOCK_UNEXIST
.
getCode
());
}
if
(
stockInfo
.
getBalance
()
<=
0
)
{
throw
new
BaseException
(
ResCode
.
BRANCH_COMPANY_STOCK_NO_BALANCE
.
getDesc
(),
ResCode
.
BRANCH_COMPANY_STOCK_NO_BALANCE
.
getCode
());
}
if
(
stockInfo
.
getBalance
()
<
applyVo
.
getCount
())
{
throw
new
BaseException
(
ResCode
.
BRANCH_COMPANY_STOCK_BALANCE_NOT_ENOUGH
.
getDesc
(),
ResCode
.
BRANCH_COMPANY_STOCK_BALANCE_NOT_ENOUGH
.
getCode
());
}
BranchCompanyStockApplyInfo
applyInfo
=
new
BranchCompanyStockApplyInfo
();
BeanUtils
.
copyProperties
(
applyVo
,
applyInfo
);
applyInfo
.
setState
(
BranchCompanyStockApplyState
.
Apply
.
getCode
());
applyInfo
.
setCreateTime
(
new
Date
());
mapper
.
insertSelective
(
applyInfo
);
}
public
PageInfo
<
BranchCompanyStockApplyInfoVo
>
selectApplyAll
(
Integer
page
,
Integer
limit
)
{
PageHelper
.
startPage
(
page
,
limit
);
return
new
PageInfo
<>(
mapper
.
selectVoAll
());
}
/**
* 取消申请,修改申请状态
* @param applyId
*/
public
void
cancelApply
(
Integer
applyId
)
{
BranchCompanyStockApplyInfo
applyInfo
=
mapper
.
selectByPrimaryKey
(
applyId
);
if
(
applyInfo
==
null
)
{
throw
new
BaseException
(
ResCode
.
BRANCH_COMPANY_STOCK_APPLY_INFO_UNEXIST
.
getDesc
(),
ResCode
.
BRANCH_COMPANY_STOCK_APPLY_INFO_UNEXIST
.
getCode
());
}
applyInfo
.
setState
(
BranchCompanyStockApplyState
.
Cancel
.
getCode
());
applyInfo
.
setUpdateTime
(
new
Date
());
mapper
.
updateByPrimaryKeySelective
(
applyInfo
);
}
/**
* 确认申请购买股权,修改库存
* @param applyId
*/
@Transactional
public
void
buy
(
Integer
applyId
)
{
BranchCompanyStockApplyInfo
applyInfo
=
mapper
.
selectByPrimaryKey
(
applyId
);
if
(
applyInfo
==
null
)
{
throw
new
BaseException
(
ResCode
.
BRANCH_COMPANY_STOCK_APPLY_INFO_UNEXIST
.
getDesc
(),
ResCode
.
BRANCH_COMPANY_STOCK_APPLY_INFO_UNEXIST
.
getCode
());
}
if
(!
applyInfo
.
getState
().
equals
(
BranchCompanyStockApplyState
.
Apply
.
getCode
()))
{
throw
new
BaseException
(
ResCode
.
BRANCH_COMPANY_STOCK_APPLY_INFO_STATE_LOCKED
.
getDesc
(),
ResCode
.
BRANCH_COMPANY_STOCK_APPLY_INFO_STATE_LOCKED
.
getCode
());
}
BranchCompanyStockRight
stockInfo
=
branchCompanyStockRightBiz
.
selectById
(
applyInfo
.
getCompanyId
());
if
(
stockInfo
==
null
)
{
throw
new
BaseException
(
ResCode
.
BRANCH_COMPANY_STOCK_UNEXIST
.
getDesc
(),
ResCode
.
BRANCH_COMPANY_STOCK_UNEXIST
.
getCode
());
}
if
(
stockInfo
.
getBalance
()
<
applyInfo
.
getCount
())
{
throw
new
BaseException
(
ResCode
.
BRANCH_COMPANY_STOCK_BALANCE_NOT_ENOUGH
.
getDesc
(),
ResCode
.
BRANCH_COMPANY_STOCK_BALANCE_NOT_ENOUGH
.
getCode
());
}
int
result
=
branchCompanyStockRightBiz
.
updateBalance
(
applyInfo
.
getCompanyId
(),
stockInfo
.
getBalance
()
-
applyInfo
.
getCount
(),
stockInfo
.
getBalance
());
if
(
result
==
0
)
{
throw
new
BaseException
(
ResCode
.
BRANCH_COMPANY_STOCK_BALANCE_NOT_ENOUGH
.
getDesc
(),
ResCode
.
BRANCH_COMPANY_STOCK_BALANCE_NOT_ENOUGH
.
getCode
());
}
applyInfo
.
setState
(
BranchCompanyStockApplyState
.
Buy
.
getCode
());
applyInfo
.
setUpdateTime
(
new
Date
());
mapper
.
updateByPrimaryKey
(
applyInfo
);
}
public
BranchCompanyStockApplyInfo
getApplyById
(
Integer
id
)
{
return
mapper
.
selectByPrimaryKey
(
id
);
}
public
void
updateApply
(
BranchCompanyStockApplyInfo
applyInfo
)
{
mapper
.
updateByPrimaryKeySelective
(
applyInfo
);
}
public
void
deleteApply
(
Integer
id
)
{
mapper
.
deleteByPrimaryKey
(
id
);
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/BranchCompanyStockRightBiz.java
0 → 100644
View file @
5628808e
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.StringToolsUtil
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.vehicle.entity.BranchCompanyStockRight
;
import
com.xxfc.platform.vehicle.mapper.*
;
import
com.xxfc.platform.vehicle.pojo.BranchCompanyStockSearchVo
;
import
com.xxfc.platform.vehicle.pojo.vo.BranchCompanyStockInfoRightVo
;
import
com.xxfc.platform.vehicle.util.excel.ExcelImport
;
import
org.apache.commons.lang.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.web.multipart.MultipartFile
;
import
tk.mybatis.mapper.entity.Example
;
import
javax.servlet.http.HttpServletRequest
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
@Service
public
class
BranchCompanyStockRightBiz
extends
BaseBiz
<
BranchCompanyStockRightMapper
,
BranchCompanyStockRight
>
{
@Autowired
BranchCompanyBiz
branchCompanyBiz
;
@Autowired
BranchCompanyStockApplyInfoBiz
branchCompanyStockApplyInfoBiz
;
@Value
(
"${branchCompanyPic.stock}"
)
private
String
companyPic
;
//获取股权列表
public
PageInfo
<
BranchCompanyStockInfoRightVo
>
search
(
BranchCompanyStockSearchVo
searchVo
)
{
PageHelper
.
startPage
(
searchVo
.
getPage
(),
searchVo
.
getLimit
());
return
new
PageInfo
<>(
mapper
.
search
(
searchVo
));
}
//更新股权
public
ObjectRestResponse
updStockInfo
(
BranchCompanyStockInfoRightVo
stockInfoVo
)
{
if
(
stockInfoVo
==
null
||
stockInfoVo
.
getCompanyId
()==
null
||
stockInfoVo
.
getCompanyId
()==
0
){
}
Integer
id
=
stockInfoVo
.
getId
();
if
(!
checkInfo
(
id
,
stockInfoVo
.
getCompanyId
())){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"分公司已存在"
);
}
BranchCompanyStockRight
stockInfo
=
new
BranchCompanyStockRight
();
BeanUtils
.
copyProperties
(
stockInfoVo
,
stockInfo
);
if
(
stockInfo
.
getBalance
()
==
null
)
{
stockInfo
.
setBalance
(
stockInfo
.
getTotal
());
}
if
(
stockInfoVo
.
getState
()
==
null
)
{
stockInfo
.
setState
(
0
);
}
if
(
id
==
null
||
id
==
0
){
mapper
.
insertSelective
(
stockInfo
);
}
else
{
mapper
.
updateByPrimaryKeySelective
(
stockInfo
);
}
return
ObjectRestResponse
.
succ
();
}
//检查是否存在分公司
public
boolean
checkInfo
(
Integer
id
,
Integer
companyId
)
{
Example
example
=
new
Example
(
BranchCompanyStockRight
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"companyId"
,
companyId
);
if
(
id
!=
null
&&
id
>
0
){
criteria
.
andNotEqualTo
(
"id"
,
id
);
}
List
<
BranchCompanyStockRight
>
list
=
mapper
.
selectByExample
(
example
);
if
(
list
.
size
()>
0
)
return
false
;
return
true
;
}
//获取股权信息
public
BranchCompanyStockInfoRightVo
getInfoById
(
Integer
id
)
{
return
mapper
.
selectInfoById
(
id
);
}
/**
* 获取所有的股权单价
* @return
*/
public
List
<
Integer
>
getAllPrice
()
{
return
mapper
.
selectAllPrice
();
}
//更新股份
public
int
updateBalance
(
Integer
companyId
,
Integer
balance
,
Integer
lastBalance
){
return
mapper
.
updateBalance
(
companyId
,
balance
,
lastBalance
);
}
//删除股权
public
void
delete
(
Integer
id
)
{
BranchCompanyStockRight
stockRight
=
new
BranchCompanyStockRight
();
stockRight
.
setId
(
id
);
stockRight
.
setIsDel
(
1
);
mapper
.
updateByPrimaryKeySelective
(
stockRight
);
}
//导入
public
ObjectRestResponse
<
String
>
importExcel
(
MultipartFile
multipartfile
,
HttpServletRequest
request
){
try
{
List
<
String
[]>
readExcel
=
ExcelImport
.
getExcelData
(
multipartfile
);
if
(
readExcel
.
size
()<
4
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"导入不能没数据!!!"
);
}
List
<
BranchCompanyStockRight
>
list
=
new
ArrayList
<>();
for
(
int
i
=
3
;
i
<
readExcel
.
size
();
i
++)
{
BranchCompanyStockRight
stockInfoVo
=
new
BranchCompanyStockRight
();
String
[]
str
=
readExcel
.
get
(
i
);
String
companyName
=
str
[
2
];
Integer
companyId
=
mapper
.
getCompanyInfo
(
companyName
);
if
(
companyId
==
null
||
companyId
==
0
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"第"
+
(
i
+
1
)
+
"行的"
+
companyName
+
"不匹配"
);
}
String
str3
=
str
[
3
];
if
(
StringUtils
.
isBlank
(
str3
))
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"第"
+
(
i
+
1
)
+
"行的股价不能为空"
);
}
if
(
str3
.
contains
(
"万港币/股"
))
{
str3
=
str3
.
replace
(
"万港币/股"
,
""
);
}
else
{
str3
=
str3
.
replace
(
"万/股"
,
""
);
}
if
(!
StringToolsUtil
.
isBigDecimal
(
str3
)||!
StringToolsUtil
.
isNumer
(
str
[
4
])||!
StringToolsUtil
.
isNumer
(
str
[
5
])){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"第"
+
(
i
+
1
)
+
"行的数据格式不对"
);
}
BigDecimal
price
=
new
BigDecimal
(
str3
);
price
=
price
.
multiply
(
new
BigDecimal
(
"10000"
));
Integer
balance
=
Integer
.
parseInt
(
str
[
4
]);
Integer
total
=
Integer
.
parseInt
(
str
[
5
])+
balance
;
stockInfoVo
.
setPrice
(
price
);
stockInfoVo
.
setBalance
(
balance
);
stockInfoVo
.
setTotal
(
total
);
stockInfoVo
.
setState
(
2
);
list
.
add
(
stockInfoVo
);
}
mapper
.
addCompamyList
(
list
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"网络异常!"
);
}
return
ObjectRestResponse
.
succ
();
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/CompanyBaseBiz.java
0 → 100644
View file @
5628808e
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.CompanyBaseMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
@Service
@Slf4j
public
class
CompanyBaseBiz
extends
BaseBiz
<
CompanyBaseMapper
,
CompanyBase
>
{
//临时数据同步
// public ObjectRestResponse
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
5628808e
...
...
@@ -436,6 +436,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
if
(
yearMonthAndDate
.
size
()>
3
){
//连续的日期最多夸3个月
throw
new
BaseException
(
ResultCode
.
ONLY_BOOK_TWO_MONTH
);
}
//检验时间是否可以预定
Map
<
String
,
Integer
>
map
=
vehicleBookHourInfoBiz
.
getPredictableHours
(
bookVehicleVo
.
getBookStartDate
(),
bookVehicleVo
.
getBookEndDate
(),
bookVehicleVo
.
getNotCheckTimeLegal
());
for
(
Map
.
Entry
<
String
,
List
<
String
>>
entry:
yearMonthAndDate
.
entrySet
()){
Boolean
rsEach
=
applyVehicle4EmployeePerMonth
(
bookVehicleVo
.
getVehicleId
(),
entry
.
getValue
(),
entry
.
getKey
(),
map
);
...
...
@@ -458,9 +459,19 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
vehicleBookRecordBiz
.
save
(
vehicleBookRecord
);
}
else
{
vehicleBookRecord
=
vehicleBookRecordBiz
.
selectById
(
bookVehicleVo
.
getVehicleBookRecordId
());
vehicleBookRecord
.
setBookStartDate
(
startDay
.
toDate
());
vehicleBookRecord
.
setBookEndDate
(
endDay
.
toDate
());
vehicleBookRecordBiz
.
updateSelectiveByIdRe
(
vehicleBookRecord
);
if
(
vehicleBookRecord
==
null
)
{
throw
new
BaseException
(
ResCode
.
VEHICLE_BOOKED_RECORD_NOT_EXIST
.
getDesc
(),
ResCode
.
VEHICLE_BOOKED_RECORD_NOT_EXIST
.
getCode
());
}
else
{
//先取消预定,然后再修改
//先取消之前预定时间,然后再修改
bookVehicleVo
.
setUnbookStartDate
(
new
DateTime
(
vehicleBookRecord
.
getBookStartDate
()).
toString
(
DATE_TIME_FORMATTER
));
bookVehicleVo
.
setUnbookEndDate
(
new
DateTime
(
vehicleBookRecord
.
getBookEndDate
()).
toString
(
DATE_TIME_FORMATTER
));
unbookVehicle
(
bookVehicleVo
);
vehicleBookRecord
.
setBookStartDate
(
startDay
.
toDate
());
vehicleBookRecord
.
setBookEndDate
(
endDay
.
toDate
());
vehicleBookRecordBiz
.
updateSelectiveByIdRe
(
vehicleBookRecord
);
}
}
// //添加预定时间记录
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/BranchCompanyStockRightMapper.java
0 → 100644
View file @
5628808e
package
com
.
xxfc
.
platform
.
vehicle
.
mapper
;
import
com.xxfc.platform.vehicle.entity.BranchCompanyStockRight
;
import
com.xxfc.platform.vehicle.pojo.BranchCompanyStockSearchVo
;
import
com.xxfc.platform.vehicle.pojo.vo.BranchCompanyStockInfoRightVo
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
public
interface
BranchCompanyStockRightMapper
extends
Mapper
<
BranchCompanyStockRight
>
{
//获取股权列表
List
<
BranchCompanyStockInfoRightVo
>
search
(
BranchCompanyStockSearchVo
searchVo
);
//获取股价列表
List
<
Integer
>
selectAllPrice
();
//获取一条记录
BranchCompanyStockInfoRightVo
selectInfoById
(
@Param
(
"id"
)
Integer
id
);
//修改股权
int
updateBalance
(
@Param
(
"companyId"
)
Integer
companyId
,
@Param
(
"balance"
)
Integer
balance
,
@Param
(
"lastBalance"
)
Integer
lastBalance
);
//批量添加
int
addCompamyList
(
@Param
(
"list"
)
List
<
BranchCompanyStockRight
>
list
);
Integer
getCompanyInfo
(
@Param
(
"name"
)
String
name
);
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/CompanyBaseMapper.java
0 → 100644
View file @
5628808e
package
com
.
xxfc
.
platform
.
vehicle
.
mapper
;
import
com.xxfc.platform.vehicle.entity.CompanyBase
;
import
tk.mybatis.mapper.common.Mapper
;
public
interface
CompanyBaseMapper
extends
Mapper
<
CompanyBase
>
{
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/BranchCompanyStockRightController.java
0 → 100644
View file @
5628808e
package
com
.
xxfc
.
platform
.
vehicle
.
rest
;
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.BranchCompanyStockRightBiz
;
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
(
"branchCompany/stock/right"
)
public
class
BranchCompanyStockRightController
extends
BaseController
<
BranchCompanyStockRightBiz
>
{
@Autowired
BranchCompanyStockApplyInfoBiz
branchCompanyStockApplyInfoBiz
;
/**
* 搜索
* @param searchVo
* @return
*/
@ApiOperation
(
value
=
"获取股权列表"
)
@GetMapping
(
"search"
)
public
RestResponse
search
(
BranchCompanyStockSearchVo
searchVo
)
{
if
(
searchVo
.
getPage
()
==
null
||
searchVo
.
getLimit
()
==
null
)
{
searchVo
.
setPage
(
1
);
searchVo
.
setLimit
(
10
);
}
return
RestResponse
.
suc
(
baseBiz
.
search
(
searchVo
));
}
@ApiOperation
(
value
=
"获取股权信息"
)
@GetMapping
(
"info/{id}"
)
public
RestResponse
getInfo
(
@PathVariable
(
"id"
)
Integer
id
)
{
if
(
id
==
null
)
{
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
}
return
RestResponse
.
suc
(
baseBiz
.
getInfoById
(
id
));
}
/**
* 编辑
* @return
*/
@RequestMapping
(
value
=
"/updStockInfo"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
updStockInfo
(
@RequestBody
BranchCompanyStockInfoRightVo
stockInfoVo
)
{
if
(
stockInfoVo
==
null
||
stockInfoVo
.
getCompanyId
()==
null
||
stockInfoVo
.
getCompanyId
()==
0
||
stockInfoVo
.
getTotal
()
==
null
||
stockInfoVo
.
getPrice
()
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数不能为空"
);
}
return
baseBiz
.
updStockInfo
(
stockInfoVo
);
}
/**
* 新增
* @return
*/
@RequestMapping
(
value
=
"/addStockInfo"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
addStockInfo
(
@RequestBody
BranchCompanyStockInfoRightVo
stockInfoVo
)
{
if
(
stockInfoVo
==
null
||
stockInfoVo
.
getCompanyId
()==
null
||
stockInfoVo
.
getCompanyId
()==
0
||
stockInfoVo
.
getTotal
()
==
null
||
stockInfoVo
.
getPrice
()
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数不能为空"
);
}
return
baseBiz
.
updStockInfo
(
stockInfoVo
);
}
/**
* 删除
* @param id
* @return
*/
@DeleteMapping
(
"{id}"
)
public
ObjectRestResponse
delete
(
@PathVariable
(
"id"
)
Integer
id
)
{
baseBiz
.
delete
(
id
);
return
ObjectRestResponse
.
succ
();
}
/**
* 申请购买
* @param applyVo
* @return
*/
@PostMapping
(
"apply"
)
public
RestResponse
apply
(
@RequestBody
BranchCompanyStockApplyVo
applyVo
)
{
if
(
applyVo
.
getCompanyId
()
==
null
||
applyVo
.
getName
()
==
null
||
applyVo
.
getTel
()
==
null
||
applyVo
.
getCount
()
==
null
)
{
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
}
branchCompanyStockApplyInfoBiz
.
apply
(
applyVo
);
return
RestResponse
.
suc
();
}
@GetMapping
(
"apply/page"
)
public
RestResponse
applyPage
(
Integer
page
,
Integer
limit
)
{
if
(
page
==
null
||
limit
==
null
)
{
page
=
1
;
limit
=
10
;
}
return
RestResponse
.
suc
(
branchCompanyStockApplyInfoBiz
.
selectApplyAll
(
page
,
limit
));
}
@GetMapping
(
"apply/{id}"
)
public
RestResponse
getApplyById
(
@PathVariable
(
"id"
)
Integer
id
)
{
if
(
id
==
null
)
{
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
}
return
RestResponse
.
suc
(
branchCompanyStockApplyInfoBiz
.
getApplyById
(
id
));
}
@PutMapping
(
"apply"
)
public
RestResponse
updateApply
(
BranchCompanyStockApplyInfo
applyInfo
)
{
if
(
applyInfo
.
getId
()
==
null
)
{
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
}
branchCompanyStockApplyInfoBiz
.
updateApply
(
applyInfo
);
return
RestResponse
.
suc
();
}
@DeleteMapping
(
"apply/{id}"
)
public
RestResponse
deleteApply
(
@PathVariable
(
"id"
)
Integer
id
)
{
if
(
id
==
null
)
{
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
}
branchCompanyStockApplyInfoBiz
.
deleteApply
(
id
);
return
RestResponse
.
suc
();
}
/**
* 取消申请,放弃购买
* @return
*/
@PostMapping
(
"apply/cancel"
)
public
RestResponse
cancel
(
Integer
applyId
)
{
if
(
applyId
==
null
)
{
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
}
branchCompanyStockApplyInfoBiz
.
cancelApply
(
applyId
);
return
RestResponse
.
suc
();
}
/**
* 确认购买,减库存
*/
@PostMapping
(
"apply/buy"
)
public
RestResponse
buy
(
Integer
applyId
)
{
if
(
applyId
==
null
)
{
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
}
branchCompanyStockApplyInfoBiz
.
buy
(
applyId
);
return
RestResponse
.
suc
();
}
@GetMapping
(
"allPrice"
)
public
RestResponse
getAllPrice
()
{
return
RestResponse
.
suc
(
baseBiz
.
getAllPrice
());
}
/**
* 导入
* @param multipartfile
* @param request
* @return
*/
@PostMapping
(
"importExcel"
)
public
ObjectRestResponse
<
String
>
importExcel
(
@RequestParam
(
value
=
"file"
)
MultipartFile
multipartfile
,
HttpServletRequest
request
)
{
return
baseBiz
.
importExcel
(
multipartfile
,
request
);
}
}
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/BranchCompanyStockRightMapper.xml
0 → 100644
View file @
5628808e
<?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.vehicle.mapper.BranchCompanyStockRightMapper"
>
<update
id=
"updateBalance"
>
update branch_company_stock_info_right
set balance = #{balance}
where id = #{companyId} and balance = #{lastBalance}
</update>
<select
id=
"search"
resultType=
"com.xxfc.platform.vehicle.pojo.vo.BranchCompanyStockInfoRightVo"
>
SELECT
distinct r.company_id as companyId,
r.id,
r.balance,
r.company_pic as companyPic,
r.info,
r.price,
r.rank,
r.total,
r.state,
c.addr_city AS addrCity,
c.addr_province AS addrProvince,
c.`name` AS companyName
FROM
branch_company_stock_info_right r
LEFT JOIN branch_company c ON r.company_id = c.id
<trim
prefix=
"where"
suffixOverrides=
"and"
>
c.is_del = 0 and
<if
test=
"companyName != null"
>
c.name like CONCAT('%',#{companyName},'%')
</if>
<if
test=
"addrProvince != null"
>
c.addr_province = #{addrProvince} and
</if>
<if
test=
"addrCity != null"
>
c.addr_city = #{addrCity} and
</if>
<if
test=
"priceStart"
>
r.price >= #{priceStart} and
</if>
<if
test=
"priceEnd"
>
r.price
<
= #{priceEnd} and
</if>
</trim>
order by rank DESC,price DESC
</select>
<select
id=
"selectAllPrice"
resultType=
"int"
>
select distinct price from branch_company_stock_info_right where is_del=0 order by price
</select>
<select
id=
"selectInfoById"
resultType=
"com.xxfc.platform.vehicle.pojo.vo.BranchCompanyStockInfoRightVo"
>
SELECT
distinct r.company_id as companyId,
r.id,
r.balance,
r.company_pic as companyPic,
r.info,
r.price,
r.rank,
r.total,
r.state,
c.addr_city AS addrCity,
c.addr_province AS addrProvince,
c.`name` AS companyName
FROM
branch_company_stock_info_right r
LEFT JOIN branch_company c ON r.company_id = c.id
where c.is_del = 0 and r.id=#{id} and r.is_del=0
</select>
<select
id=
"getCompanyInfo"
resultType=
"Integer"
>
SELECT id FROM branch_company WHERE `name`=#{name} and is_del=0 limit 1
</select>
<insert
id=
"addCompamyList"
parameterType=
"java.util.List"
>
insert into branch_company_stock_info_right (
company_id,balance,total,price,state,company_pic,crt_time,upd_time
) VALUES
<foreach
collection =
"list"
item=
"item"
index=
"index"
separator =
","
>
(#{item.companyId},#{item.balance},#{item.total},#{item.price},#{item.state},#{item.companyPic},#{item.crtTime},#{item.updTime})
</foreach>
</insert>
</mapper>
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
5628808e
...
...
@@ -344,7 +344,7 @@
</select>
<select
id=
"selectByNumberPlate"
resultType=
"com.xxfc.platform.vehicle.entity.Vehicle"
>
select * from vehicle
where number_plate = #{numberPlate} and is_del=0
where number_plate = #{numberPlate} and
is_del=0
</select>
<select
id=
"selectById"
resultMap=
"searchModel"
>
...
...
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