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
9bd49717
Commit
9bd49717
authored
Sep 10, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hz_dev' into base-modify
parents
42adbcae
a4b9c0f5
Changes
22
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
1197 additions
and
253 deletions
+1197
-253
CustomerServiceBiz.java
...ain/java/com/xxfc/platform/im/biz/CustomerServiceBiz.java
+15
-5
MsgBiz.java
...server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
+16
-5
UserBiz.java
...erver/src/main/java/com/xxfc/platform/im/biz/UserBiz.java
+0
-1
CustomerServiceRepository.java
...com/xxfc/platform/im/repos/CustomerServiceRepository.java
+11
-6
MsgController.java
...rc/main/java/com/xxfc/platform/im/rest/MsgController.java
+2
-2
DedDetailDTO.java
.../main/java/com/xxfc/platform/order/pojo/DedDetailDTO.java
+3
-1
OrderRefundBiz.java
...main/java/com/xxfc/platform/order/biz/OrderRefundBiz.java
+5
-3
OrderVehicleCrosstownBiz.java
...com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
+95
-52
OrderCancelBiz.java
...ava/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
+3
-2
ArticleBiz.java
.../src/main/java/com/xxfc/platform/uccn/biz/ArticleBiz.java
+4
-0
VehicleModelController.java
...a/com/xxfc/platform/uccn/rest/VehicleModelController.java
+1
-0
pom.xml
xx-universal/xx-universal-api/pom.xml
+1
-1
MessagePush.java
.../java/com/xxfc/platform/universal/entity/MessagePush.java
+85
-0
PushExample.java
...n/java/com/xxfc/platform/universal/utils/PushExample.java
+476
-0
JPushBiz.java
...c/main/java/com/xxfc/platform/universal/biz/JPushBiz.java
+192
-3
JPushController.java
...m/xxfc/platform/universal/controller/JPushController.java
+38
-0
MessagePushMapper.java
...com/xxfc/platform/universal/mapper/MessagePushMapper.java
+15
-0
VehicleModelQueryCondition.java
...xfc/platform/vehicle/pojo/VehicleModelQueryCondition.java
+2
-0
CompanyBaseBiz.java
...in/java/com/xxfc/platform/vehicle/biz/CompanyBaseBiz.java
+47
-0
VehicleActiveService.java
...a/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
+177
-170
CompanyController.java
...m/xxfc/platform/vehicle/rest/admin/CompanyController.java
+2
-2
VehicleModelMapper.xml
...e-server/src/main/resources/mapper/VehicleModelMapper.xml
+7
-0
No files found.
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/CustomerServiceBiz.java
View file @
9bd49717
...
...
@@ -15,6 +15,8 @@ import lombok.RequiredArgsConstructor;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Example
;
import
org.springframework.data.domain.ExampleMatcher
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
...
...
@@ -68,13 +70,12 @@ public class CustomerServiceBiz {
CustomerService
customerService
=
new
CustomerService
();
BeanUtils
.
copyProperties
(
customerServiceDTO
,
customerService
);
customerService
.
setCreateTime
(
Instant
.
now
().
toEpochMilli
());
String
password
=
new
BCryptPasswordEncoder
(
UserConstant
.
PW_ENCORDER_SALT
).
encode
(
INIT_PASSWORD
);
customerService
.
setName
(
String
.
format
(
"%s%s"
,
NICK_PRE_NAME
,
customerServiceDTO
.
getTelphone
()));
customerService
.
setIsDel
(
false
);
Map
<
String
,
Object
>
imMap
=
new
HashMap
<>(
2
);
imMap
.
put
(
"telephone"
,
customerServiceDTO
.
getTelphone
());
imMap
.
put
(
"password"
,
password
);
imMap
.
put
(
"password"
,
INIT_PASSWORD
);
imMap
.
put
(
"nickname"
,
customerService
.
getName
());
BaseResponse
imResponse
=
userBiz
.
register
(
imMap
);
String
imResult
=
imResponse
.
getMessage
();
...
...
@@ -88,10 +89,19 @@ public class CustomerServiceBiz {
customerServiceRepository
.
save
(
customerService
);
}
/**
* 1: mongoTemplate.find(Query.query(Criteria.where("isDel").is(false)), CustomerService.class);
*
* 2. customerServiceRepository.findByIsDelEquals(false);
* @return
*/
public
List
<
CustomerServiceVO
>
findAll
()
{
List
<
CustomerServiceVO
>
customerServiceVOS
=
new
ArrayList
<>();
// List<CustomerService> customerServices = mongoTemplate.find(Query.query(Criteria.where("isDel").is(false)), CustomerService.class);
List
<
CustomerService
>
customerServices
=
customerServiceRepository
.
findByIsDelEquals
(
false
);
CustomerService
customer_service
=
new
CustomerService
();
Example
<
CustomerService
>
customerServiceExample
=
Example
.
of
(
customer_service
,
ExampleMatcher
.
matchingAll
());
List
<
CustomerService
>
customerServices
=
customerServiceRepository
.
findAll
(
customerServiceExample
);
CustomerServiceVO
customerServiceVO
;
if
(
CollectionUtils
.
isNotEmpty
(
customerServices
)){
List
<
Integer
>
imUserIds
=
customerServices
.
stream
().
map
(
CustomerService:
:
getImUserId
).
collect
(
Collectors
.
toList
());
...
...
@@ -117,7 +127,7 @@ public class CustomerServiceBiz {
public
void
updateCustomerServiceIsDelToTrue
(
String
id
,
Integer
imUserId
){
Query
query
=
query
(
Criteria
.
where
(
"_id"
).
is
(
id
));
Update
update
=
update
(
"is_del"
,
true
).
set
(
"update_time"
,
Instant
.
now
().
toEpochMilli
());
UpdateResult
customer_service
=
mongoTemplate
.
updateFirst
(
query
,
update
,
Map
.
class
,
"customer_service"
);
mongoTemplate
.
updateFirst
(
query
,
update
,
Map
.
class
,
"customer_service"
);
userBiz
.
deleteById
(
imUserId
);
}
}
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
View file @
9bd49717
...
...
@@ -8,8 +8,10 @@ import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import
com.github.wxiaoqi.security.admin.vo.ImiVo
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.im.dto.CommentVo
;
import
com.xxfc.platform.im.dto.PraiseVo
;
import
com.xxfc.platform.im.dto.QuestionParamDto
;
import
com.xxfc.platform.im.model.Comment
;
import
com.xxfc.platform.im.model.Msg
;
import
com.xxfc.platform.im.model.Praise
;
...
...
@@ -38,6 +40,9 @@ public class MsgBiz {
@Autowired
UserBiz
userBiz
;
@Autowired
ImQuestionBiz
imQuestionBiz
;
/**
* 获取消息列表
*
...
...
@@ -123,7 +128,7 @@ public class MsgBiz {
return
ObjectRestResponse
.
succ
();
}
public
ObjectRestResponse
getMsgListByUserId
(
Integer
page
,
Integer
limit
)
{
public
ObjectRestResponse
getMsgListByUserId
(
Integer
page
,
Integer
limit
,
Integer
type
)
{
//获取所有朋友圈
page
=
page
==
null
?
1
:
page
;
limit
=
limit
==
null
?
10
:
limit
;
...
...
@@ -136,8 +141,14 @@ public class MsgBiz {
}
Pageable
pageable
=
PageRequest
.
of
(--
page
,
limit
);
List
<
Integer
>
ids
=
new
ArrayList
<>();
ids
.
add
(
2
);
ids
.
add
(
4
);
if
(
type
!=
null
)
{
ids
.
add
(
type
);
}
if
(
type
!=
null
&&
type
==
5
)
{
QuestionParamDto
questionParamDto
=
new
QuestionParamDto
();
questionParamDto
.
setUserId
(
Long
.
parseLong
(
userId
+
""
));
return
imQuestionBiz
.
getList
(
questionParamDto
);
}
Query
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
));
query
.
addCriteria
(
Criteria
.
where
(
"userId"
).
is
(
userId
));
int
totalSize
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
).
size
();
...
...
@@ -147,7 +158,7 @@ public class MsgBiz {
List
<
MsgVo
>
msgVoList
=
replaceMsgResult
(
msgList
);
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
msgVoList
);
goodPageInfo
.
setPageSize
(
totalSize
%
limit
==
0
?
totalSize
/
limit
:
totalSize
/
limit
+
1
);
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
return
ObjectRestResponse
.
succ
(
PageDataVO
.
pageInfo
(
goodPageInfo
)
);
}
...
...
@@ -246,7 +257,7 @@ public class MsgBiz {
return
praiseVoArrayList
;
}
public
List
<
CommentVo
>
replaceCommentResult
(
List
<
Comment
>
list
)
{
public
List
<
CommentVo
>
replaceCommentResult
(
List
<
Comment
>
list
)
{
List
<
CommentVo
>
commentVoList
=
new
ArrayList
<>();
for
(
Comment
comment
:
list
)
{
CommentVo
commentVo
=
new
CommentVo
();
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/UserBiz.java
View file @
9bd49717
...
...
@@ -257,7 +257,6 @@ public class UserBiz {
*/
public
void
updatePasswordByPhone
(
String
telphone
,
String
password
){
Query
query
=
Query
.
query
(
Criteria
.
where
(
"phone"
).
is
(
telphone
));
password
=
new
BCryptPasswordEncoder
(
UserConstant
.
PW_ENCORDER_SALT
).
encode
(
password
);
Update
update
=
Update
.
update
(
"password"
,
password
);
mongoTemplate
.
updateFirst
(
query
,
update
,
Map
.
class
,
"user"
);
}
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/repos/CustomerServiceRepository.java
View file @
9bd49717
package
com
.
xxfc
.
platform
.
im
.
repos
;
import
com.xxfc.platform.im.model.CustomerService
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
org.springframework.stereotype.Repository
;
import
com.xxfc.platform.im.model.CustomerService
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
org.springframework.data.mongodb.repository.Query
;
import
org.springframework.data.repository.query.Param
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.List
;
/**
* @author libin
...
...
@@ -17,10 +19,13 @@ public interface CustomerServiceRepository extends MongoRepository<CustomerServi
/**
* 查询客服
* @param isDel 删除状态
*
*
@param isDel 删除状态
* @return
*/
List
<
CustomerService
>
findByIsDelEquals
(
Boolean
isDel
);
List
<
CustomerService
>
findByIsDel
(
Boolean
isDel
);
// @Query(value = "{'is_del':?0}",fields ="{'telphone':1}",sort = "{'create_time':-1}")
@Query
(
value
=
"{'is_del':?#{[0]}}"
,
fields
=
"{'name':1}"
,
sort
=
"{'create_time':-1}"
)
List
<
CustomerService
>
findByIsDelState
(
Boolean
isDel
);
}
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/rest/MsgController.java
View file @
9bd49717
...
...
@@ -32,7 +32,7 @@ public class MsgController {
}
@GetMapping
(
value
=
"/getByUserId"
)
public
ObjectRestResponse
getByUserId
(
Integer
page
,
Integer
limit
)
{
return
msgBiz
.
getMsgListByUserId
(
page
,
limit
);
public
ObjectRestResponse
getByUserId
(
Integer
page
,
Integer
limit
,
Integer
type
)
{
return
msgBiz
.
getMsgListByUserId
(
page
,
limit
,
type
);
}
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/DedDetailDTO.java
View file @
9bd49717
...
...
@@ -8,7 +8,7 @@ import java.util.List;
@Data
public
class
DedDetailDTO
{
/**
* : 扣除项
* : 扣除项
名称
*/
String
deductions
;
...
...
@@ -34,4 +34,6 @@ public class DedDetailDTO {
//type对应的中文
String
statusName
;
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderRefundBiz.java
View file @
9bd49717
...
...
@@ -145,7 +145,7 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
* @param timeLag 与开始时间的时间差
* @param dicParentKey
*/
public
void
rentRefundProcess
(
BaseOrder
baseOrder
,
Long
timeLag
,
String
dicParentKey
)
{
public
BigDecimal
rentRefundProcess
(
BaseOrder
baseOrder
,
Long
timeLag
,
String
dicParentKey
)
{
//计算退款金额
//商品价格 - 优惠券减免的价格
BigDecimal
originalRefundAmount
=
BigDecimal
.
ZERO
.
add
(
baseOrder
.
getGoodsAmount
().
subtract
(
baseOrder
.
getCouponAmount
()));
...
...
@@ -158,6 +158,7 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
//退款子流程: 订单基础,退款描述,退款金额
refundSubProcess
(
baseOrder
,
refundDescBuilder
.
toString
(),
originalRefundAmount
,
refundAmount
,
RefundTypeEnum
.
ORDER_FUND
.
getCode
(),
RefundStatusEnum
.
ALL
.
getCode
());
return
refundAmount
;
}
/**
...
...
@@ -168,7 +169,7 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
* @param dicParentKey
* @param originalDeductAmount
*/
public
void
rentRefundDepositProcess
(
BaseOrder
baseOrder
,
BigDecimal
depositAmount
,
Long
timeLag
,
String
dicParentKey
,
BigDecimal
originalDeductAmount
)
{
public
BigDecimal
rentRefundDepositProcess
(
BaseOrder
baseOrder
,
BigDecimal
depositAmount
,
Long
timeLag
,
String
dicParentKey
,
BigDecimal
originalDeductAmount
)
{
// 1、押金 + 租金(规则扣除)
BigDecimal
originalRefundAmount
=
BigDecimal
.
ZERO
.
add
(
depositAmount
);
BigDecimal
refundAmount
=
BigDecimal
.
ZERO
.
add
(
depositAmount
);
...
...
@@ -178,12 +179,13 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
BigDecimal
residueAmount
=
calculateRefund
(
originalDeductAmount
,
timeLag
,
dicParentKey
,
refundDescBuilder
);
residueAmount
=
residueAmount
.
setScale
(
2
,
RoundingMode
.
HALF_UP
);
//退款金额 :押金 - (原扣除款 - 剩余款)
//退款金额 :押金 - (原扣除款 - 剩余款)
即: 押金 - (免费天数对应的钱 - 剩余款)
refundAmount
=
originalRefundAmount
.
subtract
(
originalDeductAmount
.
subtract
(
residueAmount
));
}
//触发押金退款
refundSubProcess
(
baseOrder
,
refundDescBuilder
.
toString
(),
originalRefundAmount
,
refundAmount
,
RefundTypeEnum
.
DEPOSIT
.
getCode
(),
RefundStatusEnum
.
ALL
.
getCode
());
return
refundAmount
;
}
public
BigDecimal
calculateRefund
(
BigDecimal
goodsAmount
,
Long
timeLag
,
String
dicParentKey
,
StringBuilder
refundDescBuilder
)
{
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
View file @
9bd49717
This diff is collapsed.
Click to expand it.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
View file @
9bd49717
...
...
@@ -134,11 +134,12 @@ public class OrderCancelBiz {
// }
//退款流程
//退押金
orderRefundBiz
.
rentRefundDepositProcess
(
hasUpdateOrder
,
orvd
.
getDeposit
(),
timeLag
,
APP_ORDER
+
"_"
+
RENT_REFUND
,
freeDayAmount
);
//退订单款
orderRefundBiz
.
rentRefundProcess
(
hasUpdateOrder
,
timeLag
,
APP_ORDER
+
"_"
+
RENT_REFUND
);
//退押金
orderRefundBiz
.
rentRefundDepositProcess
(
hasUpdateOrder
,
orvd
.
getDeposit
(),
timeLag
,
APP_ORDER
+
"_"
+
RENT_REFUND
,
freeDayAmount
);
//已付款的取消订单发送消息
try
{
AppUserDTO
appUserDTO
=
userFeign
.
userDetailById
(
baseOrder
.
getUserId
()).
getData
();
...
...
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/biz/ArticleBiz.java
View file @
9bd49717
...
...
@@ -131,6 +131,10 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
if
(
article
.
getType
()
==
null
)
{
article
.
setType
(
0
);
}
if
(
article
.
getStatus
()==
1
){
article
.
setAddTime
(
new
Date
());
}
article
.
setCreTime
(
new
Date
());
mapper
.
insertSelective
(
article
);
...
...
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/rest/VehicleModelController.java
View file @
9bd49717
...
...
@@ -64,6 +64,7 @@ public class VehicleModelController extends CommonBaseController {
@GetMapping
(
value
=
"/findVehicleModelPage"
)
@IgnoreUserToken
public
ObjectRestResponse
<
PageDataVO
<
VehicleModelVo
>>
findVehicleModelPageUnauthfind
(
VehicleModelQueryCondition
vmqc
)
{
vmqc
.
setNotInIds
(
"67"
);
ObjectRestResponse
<
PageDataVO
<
VehicleModelVo
>>
objectRestResponse
=
vehicleFeign
.
findVehicleModelPageUnauthfind
(
vmqc
);
PageDataVO
<
VehicleModelVo
>
pageDataVOs
=
objectRestResponse
.
getData
();
pageDataVOs
.
getData
().
forEach
(
v
->
{
...
...
xx-universal/xx-universal-api/pom.xml
View file @
9bd49717
...
...
@@ -76,7 +76,7 @@
<dependency>
<groupId>
cn.jpush.api
</groupId>
<artifactId>
jpush-client
</artifactId>
<version>
3.3.
7
</version>
<version>
3.3.
9
</version>
</dependency>
<dependency>
<groupId>
cn.jpush.api
</groupId>
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/entity/MessagePush.java
0 → 100644
View file @
9bd49717
package
com
.
xxfc
.
platform
.
universal
.
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
;
import
java.io.Serializable
;
/**
* 消息推送表
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-05-28 16:17:42
*/
@Data
@Table
(
name
=
"message_push"
)
public
class
MessagePush
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
//
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
""
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"1-手动推送;2-系统自动推送"
)
private
Integer
type
;
@Column
(
name
=
"send_type"
)
@ApiModelProperty
(
value
=
"系统发送类型:1-支付完成"
)
private
Integer
sendType
;
@ApiModelProperty
(
value
=
"通知标题"
)
private
String
title
;
@ApiModelProperty
(
value
=
"通知内容"
)
private
String
alert
;
@ApiModelProperty
(
value
=
"通知栏样式类型:1-大文本;2-文本条目;3-大图片"
)
private
Integer
style
;
@Column
(
name
=
"big_text"
)
@ApiModelProperty
(
value
=
"大文本通知栏样式"
)
private
String
bigText
;
@ApiModelProperty
(
value
=
"文本条目通知栏样式"
)
private
String
inbox
;
@Column
(
name
=
"big_pic_path"
)
@ApiModelProperty
(
value
=
"大图片通知栏样式"
)
private
String
bigPicPath
;
@ApiModelProperty
(
value
=
"指定跳转页面"
)
private
String
intent
;
@Column
(
name
=
"crt_time"
)
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
private
Long
crtTime
;
@Column
(
name
=
"upd_time"
)
@ApiModelProperty
(
value
=
"更新时间"
,
hidden
=
true
)
private
Long
updTime
;
@Column
(
name
=
"is_del"
)
@ApiModelProperty
(
value
=
"是否删除"
)
private
Integer
isDel
;
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/utils/PushExample.java
0 → 100644
View file @
9bd49717
This diff is collapsed.
Click to expand it.
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/JPushBiz.java
View file @
9bd49717
...
...
@@ -2,22 +2,35 @@ package com.xxfc.platform.universal.biz;
import
cn.jiguang.common.ClientConfig
;
import
cn.jiguang.common.ServiceHelper
;
import
cn.jiguang.common.resp.APIConnectionException
;
import
cn.jiguang.common.resp.APIRequestException
;
import
cn.jpush.api.JPushClient
;
import
cn.jpush.api.push.PushResult
;
import
cn.jpush.api.push.model.Options
;
import
cn.jpush.api.push.model.Platform
;
import
cn.jpush.api.push.model.PushPayload
;
import
cn.jpush.api.push.model.audience.Audience
;
import
cn.jpush.api.push.model.notification.AndroidNotification
;
import
cn.jpush.api.push.model.notification.Notification
;
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.universal.service.SmsService
;
import
com.xxfc.platform.universal.utils.CCPRestSmsUtils
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.google.gson.Gson
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonPrimitive
;
import
com.xxfc.platform.universal.entity.MessagePush
;
import
com.xxfc.platform.universal.mapper.MessagePushMapper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
tk.mybatis.mapper.entity.Example
;
@Service
@Slf4j
public
class
JPushBiz
{
public
class
JPushBiz
extends
BaseBiz
<
MessagePushMapper
,
MessagePush
>
{
@Value
(
"${universal.MASTER_SECRET}"
)
...
...
@@ -25,6 +38,8 @@ public class JPushBiz {
@Value
(
"${universal.APP_KEY}"
)
private
String
APP_KEY
;
public
static
final
String
ALERT
=
"Test from API Example - alert"
;
//推送给所有平台设备
public
ObjectRestResponse
jpushToAllPlat
(
String
title
){
ClientConfig
clientConfig
=
ClientConfig
.
getInstance
();
...
...
@@ -48,5 +63,179 @@ public class JPushBiz {
}
}
//推送给所有平台设备
public
ObjectRestResponse
jpushToAllPlat1
(){
ClientConfig
clientConfig
=
ClientConfig
.
getInstance
();
final
JPushClient
jpushClient
=
new
JPushClient
(
MASTER_SECRET
,
APP_KEY
,
null
,
clientConfig
);
PushPayload
payload
=
buildPushObject_android_newly_support
();
try
{
PushResult
result
=
jpushClient
.
sendPush
(
payload
);
log
.
debug
(
"\n推送结果:"
+
result
);
return
ObjectRestResponse
.
succ
();
}
catch
(
APIConnectionException
e
)
{
// Connection error, should retry later
log
.
debug
(
"\nConnection error, should retry later"
+
e
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
e
.
getMessage
());
}
catch
(
APIRequestException
e
)
{
// Should review the error, and fix the request
log
.
debug
(
"\nShould review the error, and fix the request"
+
e
);
log
.
debug
(
"\nHTTP Status: "
+
e
.
getStatus
());
log
.
debug
(
"\nError Code: "
+
e
.
getErrorCode
());
log
.
debug
(
"\nError Message: "
+
e
.
getErrorMessage
());
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
e
.
getMessage
());
}
}
public
static
PushPayload
buildPushObject_android_newly_support
()
{
JsonObject
inbox
=
new
JsonObject
();
inbox
.
add
(
"line1"
,
new
JsonPrimitive
(
"line1 string"
));
inbox
.
add
(
"line2"
,
new
JsonPrimitive
(
"line2 string"
));
inbox
.
add
(
"contentTitle"
,
new
JsonPrimitive
(
"title string"
));
inbox
.
add
(
"summaryText"
,
new
JsonPrimitive
(
"+3 more"
));
JsonObject
intent
=
new
JsonObject
();
intent
.
add
(
"url"
,
new
JsonPrimitive
(
"intent:#Intent;component=com.jiguang.push/com.example.jpushdemo.SettingActivity;end"
));
Notification
notification
=
Notification
.
newBuilder
()
.
addPlatformNotification
(
AndroidNotification
.
newBuilder
()
.
setAlert
(
"测试通知内容"
)
.
setBigPicPath
(
"https://xxtest.upyuns.com/image/app/oyI48qqcy3m38iCFffFc3UeZLcm1s3.png"
)
.
setBigText
(
"long text"
)
.
setBuilderId
(
1
)
.
setCategory
(
"CATEGORY_SOCIAL"
)
.
setInbox
(
inbox
)
.
setStyle
(
3
)
.
setTitle
(
"测试通知标题"
)
.
setPriority
(
1
)
.
setLargeIcon
(
"https://xxtest.upyuns.com/image/admin/stock.jpg"
)
.
setIntent
(
intent
)
.
build
())
.
build
();
return
PushPayload
.
newBuilder
()
.
setPlatform
(
Platform
.
all
())
.
setAudience
(
Audience
.
all
())
.
setNotification
(
notification
)
.
setOptions
(
Options
.
newBuilder
()
.
setApnsProduction
(
true
)
.
setSendno
(
ServiceHelper
.
generateSendno
())
.
build
())
.
build
();
}
//推送
public
ObjectRestResponse
jpushToAlias
(
Integer
id
,
String
userIds
){
ClientConfig
clientConfig
=
ClientConfig
.
getInstance
();
final
JPushClient
jpushClient
=
new
JPushClient
(
MASTER_SECRET
,
APP_KEY
,
null
,
clientConfig
);
PushPayload
payload
=
buildPushObject_android_id
(
id
,
userIds
);
if
(
payload
==
null
){
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
"参数无效"
);
}
try
{
PushResult
result
=
jpushClient
.
sendPush
(
payload
);
log
.
debug
(
"\n推送结果:"
+
result
);
return
ObjectRestResponse
.
succ
();
}
catch
(
APIConnectionException
e
)
{
// Connection error, should retry later
log
.
debug
(
"\nConnection error, should retry later"
+
e
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
e
.
getMessage
());
}
catch
(
APIRequestException
e
)
{
// Should review the error, and fix the request
log
.
debug
(
"\nShould review the error, and fix the request"
+
e
);
log
.
debug
(
"\nHTTP Status: "
+
e
.
getStatus
());
log
.
debug
(
"\nError Code: "
+
e
.
getErrorCode
());
log
.
debug
(
"\nError Message: "
+
e
.
getErrorMessage
());
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
FAILED_CODE
,
e
.
getMessage
());
}
}
public
PushPayload
buildPushObject_android_id
(
Integer
id
,
String
userIds
)
{
Example
example
=
new
Example
(
MessagePush
.
class
);
example
.
createCriteria
().
andEqualTo
(
"id"
,
id
).
andEqualTo
(
"isDel"
,
0
);
MessagePush
messagePush
=
mapper
.
selectOneByExample
(
example
);
if
(
messagePush
==
null
||
messagePush
.
getType
()==
null
){
log
.
info
(
"无有效数据--id=="
+
id
);
return
null
;
}
Audience
audience
=
Audience
.
all
();
if
(
messagePush
.
getType
()==
2
){
if
(
StringUtils
.
isBlank
(
userIds
)){
log
.
info
(
"无有效数据--type=="
+
messagePush
.
getType
()+
"------userId=="
+
userIds
);
return
null
;
}
audience
=
Audience
.
alias
(
userIds
);
}
JsonObject
intent
=
new
JsonObject
();
if
(
StringUtils
.
isNotBlank
(
messagePush
.
getIntent
())){
intent
=
getJsonObject
(
messagePush
.
getIntent
());
}
Notification
notification
=
Notification
.
newBuilder
()
.
addPlatformNotification
(
AndroidNotification
.
newBuilder
()
.
setAlert
(
messagePush
.
getAlert
())
.
setBigPicPath
(
messagePush
.
getBigPicPath
())
.
setBigText
(
messagePush
.
getBigText
())
.
setBuilderId
(
1
)
.
setCategory
(
"CATEGORY_SOCIAL"
)
.
setInbox
(
messagePush
.
getInbox
())
.
setStyle
(
messagePush
.
getStyle
())
.
setTitle
(
messagePush
.
getTitle
())
.
setPriority
(
1
)
.
setIntent
(
intent
)
.
build
())
.
build
();
return
PushPayload
.
newBuilder
()
.
setPlatform
(
Platform
.
all
())
.
setAudience
(
audience
)
.
setNotification
(
notification
)
.
setOptions
(
Options
.
newBuilder
()
.
setApnsProduction
(
true
)
.
setSendno
(
ServiceHelper
.
generateSendno
())
.
build
())
.
build
();
}
//字符串转JsonObject
public
JsonObject
getJsonObject
(
String
json
){
Gson
g
=
new
Gson
();
return
g
.
fromJson
(
json
,
JsonObject
.
class
);
}
//编辑推送内容
public
ObjectRestResponse
updMessagePush
(
MessagePush
messagePush
){
Integer
id
=
messagePush
.
getId
();
if
(
id
==
null
){
insertSelective
(
messagePush
);
}
else
{
updateSelectiveById
(
messagePush
);
}
return
ObjectRestResponse
.
succ
();
}
//删除推送内容
public
ObjectRestResponse
delMessagePush
(
MessagePush
messagePush
){
messagePush
.
setIsDel
(
1
);
updateSelectiveById
(
messagePush
);
return
ObjectRestResponse
.
succ
();
}
//获取列表
public
ObjectRestResponse
getList
(
Integer
page
,
Integer
limit
,
String
title
,
Integer
type
){
Example
example
=
new
Example
(
MessagePush
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"isDel"
,
0
);
if
(
StringUtils
.
isNotBlank
(
title
)){
criteria
.
andLike
(
"title"
,
"%"
+
title
+
"%"
);
}
if
(
type
!=
null
&&
type
!=
0
){
criteria
.
andEqualTo
(
"type"
,
type
);
}
return
ObjectRestResponse
.
succ
(
PageDataVO
.
pageInfo
(
page
,
limit
,
()->
mapper
.
selectByExample
(
example
)));
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/controller/JPushController.java
View file @
9bd49717
...
...
@@ -5,6 +5,7 @@ package com.xxfc.platform.universal.controller;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.universal.biz.JPushBiz
;
import
com.xxfc.platform.universal.entity.MessagePush
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -27,5 +28,42 @@ public class JPushController {
return
jPushBiz
.
jpushToAllPlat
(
title
);
}
@RequestMapping
(
value
=
"/app/unauth/alls"
,
method
=
RequestMethod
.
GET
)
//匹配的是href中的download请求
public
ObjectRestResponse
alls
()
throws
Exception
{
return
jPushBiz
.
jpushToAllPlat1
();
}
@RequestMapping
(
value
=
"/stype"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
stype
(
@RequestParam
(
value
=
"id"
,
defaultValue
=
"0"
)
Integer
id
,
@RequestParam
(
value
=
"userIds"
,
defaultValue
=
""
)
String
userIds
)
throws
Exception
{
return
jPushBiz
.
jpushToAlias
(
id
,
userIds
);
}
@RequestMapping
(
value
=
"/addMessagePush"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
addMessagePush
(
@RequestBody
MessagePush
messagePush
){
return
jPushBiz
.
updMessagePush
(
messagePush
);
}
@RequestMapping
(
value
=
"/udpMessagePush"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
udpMessagePush
(
@RequestBody
MessagePush
messagePush
){
return
jPushBiz
.
updMessagePush
(
messagePush
);
}
@RequestMapping
(
value
=
"/del"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
delMessagePush
(
@RequestBody
MessagePush
messagePush
){
return
jPushBiz
.
delMessagePush
(
messagePush
);
}
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
getList
(
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
value
=
"limit"
,
defaultValue
=
"10"
)
Integer
limit
,
@RequestParam
(
value
=
"title"
,
defaultValue
=
""
)
String
title
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
){
return
jPushBiz
.
getList
(
page
,
limit
,
title
,
type
);
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/mapper/MessagePushMapper.java
0 → 100644
View file @
9bd49717
package
com
.
xxfc
.
platform
.
universal
.
mapper
;
import
com.xxfc.platform.universal.entity.MessagePush
;
import
tk.mybatis.mapper.common.Mapper
;
/**
* 消息推送表
*
* @author zjw
* @email nishijjo@qq.com
* @date 2019-05-28 16:17:42
*/
public
interface
MessagePushMapper
extends
Mapper
<
MessagePush
>
{
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehicleModelQueryCondition.java
View file @
9bd49717
...
...
@@ -30,6 +30,8 @@ public class VehicleModelQueryCondition {
private
Integer
status
;
@ApiModelProperty
(
"分类逗号分割"
)
String
catasStr
;
@ApiModelProperty
(
"排除的车型id"
)
String
notInIds
;
@ApiModelProperty
(
value
=
"分类列表"
,
hidden
=
true
)
Map
<
Integer
,
List
<
VehiclePlatCata
>>
catas
;
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/CompanyBaseBiz.java
View file @
9bd49717
...
...
@@ -3,6 +3,7 @@ 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.RandomUtil
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
...
...
@@ -10,6 +11,7 @@ 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.SysRegionMapper
;
import
com.xxfc.platform.vehicle.pojo.AddOrUpdateVehicleVo
;
import
com.xxfc.platform.vehicle.pojo.dto.CompanyBaseDetailDTO
;
import
com.xxfc.platform.vehicle.pojo.vo.CompanyBaseVo
;
import
com.xxfc.platform.vehicle.pojo.vo.CompanyVo
;
...
...
@@ -26,6 +28,7 @@ import javax.servlet.http.HttpServletRequest;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Scanner
;
@Service
@Slf4j
...
...
@@ -47,6 +50,9 @@ public class CompanyBaseBiz extends BaseBiz<CompanyBaseMapper, CompanyBase> {
@Autowired
AreaBiz
areaBiz
;
@Autowired
VehicleBiz
vehicleBiz
;
@Value
(
"${branchCompanyPic.url}"
)
private
String
companyUrl
;
...
...
@@ -85,6 +91,47 @@ public class CompanyBaseBiz extends BaseBiz<CompanyBaseMapper, CompanyBase> {
return
ObjectRestResponse
.
succ
();
}
//临时数据同步4(添加车辆)
public
ObjectRestResponse
synchro4
()
throws
Exception
{
List
<
BranchCompany
>
list
=
branchCompanyBiz
.
selectListAll
();
if
(
list
.
size
()>
0
){
int
num
=
1
;
for
(
BranchCompany
branchCompany:
list
){
List
<
AddOrUpdateVehicleVo
>
addOrUpdateVehicleVoList
=
new
ArrayList
<>();
for
(
int
i
=
1
;
i
<
6
;
i
++){
String
numberPlate
=
"测试"
+
getNumberPlate
(
num
);
AddOrUpdateVehicleVo
vehicleVo
=
new
AddOrUpdateVehicleVo
();
vehicleVo
.
setCode
(
Integer
.
parseInt
(
RandomUtil
.
getRandomStr
(
4
)));
vehicleVo
.
setNumberPlate
(
numberPlate
);
vehicleVo
.
setStatus
(
1
);
vehicleVo
.
setBrand
(
5
);
vehicleVo
.
setUseType
(
1
);
vehicleVo
.
setModelId
(
67
);
vehicleVo
.
setSubordinateBranch
(
branchCompany
.
getId
());
vehicleVo
.
setMaintenanceMileage
(
3000
);
vehicleVo
.
setParkBranchCompanyId
(
branchCompany
.
getId
());
vehicleVo
.
setTravelStatus
(
3
);
addOrUpdateVehicleVoList
.
add
(
vehicleVo
);
num
++;
log
.
info
(
"----成功---num=="
+
num
+
"---numberPlate==="
+
numberPlate
);
}
vehicleBiz
.
add
(
addOrUpdateVehicleVoList
);
}
}
return
ObjectRestResponse
.
succ
();
}
public
String
getNumberPlate
(
int
number
){
String
str
=
number
+
""
;
char
[]
ary1
=
str
.
toCharArray
();
char
[]
ary2
=
{
'0'
,
'0'
,
'0'
,
'0'
};
System
.
arraycopy
(
ary1
,
0
,
ary2
,
ary2
.
length
-
ary1
.
length
,
ary1
.
length
);
String
result
=
new
String
(
ary2
);
return
result
;
}
//临时数据同步2
public
ObjectRestResponse
synchro2
(){
List
<
BranchCompany
>
list
=
branchCompanyBiz
.
selectListAll
();
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
View file @
9bd49717
This diff is collapsed.
Click to expand it.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/CompanyController.java
View file @
9bd49717
...
...
@@ -21,8 +21,8 @@ public class CompanyController extends BaseController<CompanyBaseBiz> {
@ApiOperation
(
"同步分公司信息"
)
@PostMapping
(
"synchro"
)
public
ObjectRestResponse
<
String
>
synchro
()
{
return
baseBiz
.
synchro
();
public
ObjectRestResponse
synchro
()
throws
Exception
{
return
baseBiz
.
synchro
4
();
}
@ApiOperation
(
"同步分公司地址"
)
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleModelMapper.xml
View file @
9bd49717
...
...
@@ -46,6 +46,13 @@
</foreach>
) > 0
</if>
<if
test=
"notInIds != null"
>
and vmqc.id not in (
<foreach
collection=
"notInIds.split(',')"
item=
"noIdItem"
index=
"noIdIndex"
>
#{noIdItem}
</foreach>
)
</if>
ORDER BY vmqc.id ASC
</select>
...
...
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