Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
customer-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SuperHive
back-end
customer-service
Commits
b14c1383
Commit
b14c1383
authored
May 06, 2020
by
huangcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
承运商接口:停用司机帐号时,通知APP后台
parent
871a6a22
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
6 deletions
+59
-6
pom.xml
pom.xml
+1
-2
FeignAppService.java
.../java/com/esv/freight/customer/feign/FeignAppService.java
+28
-0
FeignBaseService.java
...java/com/esv/freight/customer/feign/FeignBaseService.java
+7
-0
DriverAccountServiceImpl.java
.../module/driver/service/impl/DriverAccountServiceImpl.java
+21
-2
application-dev.yml
src/main/resources/application-dev.yml
+1
-1
application-test.yml
src/main/resources/application-test.yml
+1
-1
No files found.
pom.xml
View file @
b14c1383
...
@@ -45,7 +45,6 @@
...
@@ -45,7 +45,6 @@
<dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-configuration-processor
</artifactId>
<artifactId>
spring-boot-configuration-processor
</artifactId>
<optional>
true
</optional>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.alibaba.cloud
</groupId>
<groupId>
com.alibaba.cloud
</groupId>
...
@@ -82,7 +81,7 @@
...
@@ -82,7 +81,7 @@
<dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<artifactId>
lombok
</artifactId>
<
optional>
true
</optional
>
<
scope>
provided
</scope
>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<groupId>
com.fasterxml.jackson.core
</groupId>
...
...
src/main/java/com/esv/freight/customer/feign/FeignAppService.java
0 → 100644
View file @
b14c1383
package
com
.
esv
.
freight
.
customer
.
feign
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.PostMapping
;
/**
* @description:
* @project: freight-customer-service
* @name: com.esv.freight.customer.feign.FeignAppService
* @author: 黄朝斌
* @email: huangchaobin@esvtek.com
* @createTime: 2020/04/17 17:56
* @version:1.0
*/
@FeignClient
(
value
=
"freight-app-service"
)
public
interface
FeignAppService
{
/**
* description 停用司机帐号
* param [bodyJson]
* return com.alibaba.fastjson.JSONObject
* author Administrator
* createTime 2020/05/06 14:35
**/
@PostMapping
(
value
=
"/app/driverBackend/account/stop"
)
JSONObject
blockDriverAccount
(
JSONObject
bodyJson
);
}
src/main/java/com/esv/freight/customer/feign/FeignBaseService.java
View file @
b14c1383
...
@@ -16,6 +16,13 @@ import org.springframework.web.bind.annotation.PostMapping;
...
@@ -16,6 +16,13 @@ import org.springframework.web.bind.annotation.PostMapping;
@FeignClient
(
value
=
"freight-base-service"
)
@FeignClient
(
value
=
"freight-base-service"
)
public
interface
FeignBaseService
{
public
interface
FeignBaseService
{
/**
* description 生成编号
* param [bodyJson]
* return com.alibaba.fastjson.JSONObject
* author Administrator
* createTime 2020/05/06 14:36
**/
@PostMapping
(
value
=
"/base/batchId/generate"
)
@PostMapping
(
value
=
"/base/batchId/generate"
)
JSONObject
getBatchId
(
JSONObject
bodyJson
);
JSONObject
getBatchId
(
JSONObject
bodyJson
);
}
}
src/main/java/com/esv/freight/customer/module/driver/service/impl/DriverAccountServiceImpl.java
View file @
b14c1383
package
com
.
esv
.
freight
.
customer
.
module
.
driver
.
service
.
impl
;
package
com
.
esv
.
freight
.
customer
.
module
.
driver
.
service
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
@@ -10,6 +11,7 @@ import com.esv.freight.customer.common.component.PasswordComponent;
...
@@ -10,6 +11,7 @@ import com.esv.freight.customer.common.component.PasswordComponent;
import
com.esv.freight.customer.common.exception.EException
;
import
com.esv.freight.customer.common.exception.EException
;
import
com.esv.freight.customer.common.util.ReqUtils
;
import
com.esv.freight.customer.common.util.ReqUtils
;
import
com.esv.freight.customer.common.vo.PageResultVO
;
import
com.esv.freight.customer.common.vo.PageResultVO
;
import
com.esv.freight.customer.feign.FeignAppService
;
import
com.esv.freight.customer.module.carrier.CarrierConstants
;
import
com.esv.freight.customer.module.carrier.CarrierConstants
;
import
com.esv.freight.customer.module.carrier.entity.CarrierAccountEntity
;
import
com.esv.freight.customer.module.carrier.entity.CarrierAccountEntity
;
import
com.esv.freight.customer.module.carrier.service.CarrierAccountService
;
import
com.esv.freight.customer.module.carrier.service.CarrierAccountService
;
...
@@ -26,6 +28,7 @@ import com.esv.freight.customer.module.driver.service.DriverAccountService;
...
@@ -26,6 +28,7 @@ import com.esv.freight.customer.module.driver.service.DriverAccountService;
import
com.esv.freight.customer.module.driver.service.DriverAuditHistoryService
;
import
com.esv.freight.customer.module.driver.service.DriverAuditHistoryService
;
import
com.esv.freight.customer.module.driver.service.DriverInfoService
;
import
com.esv.freight.customer.module.driver.service.DriverInfoService
;
import
com.esv.freight.customer.module.driver.vo.DriverListVO
;
import
com.esv.freight.customer.module.driver.vo.DriverListVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -37,6 +40,7 @@ import java.util.List;
...
@@ -37,6 +40,7 @@ import java.util.List;
@Service
(
"driverAccountService"
)
@Service
(
"driverAccountService"
)
@Slf4j
public
class
DriverAccountServiceImpl
extends
ServiceImpl
<
DriverAccountDao
,
DriverAccountEntity
>
implements
DriverAccountService
{
public
class
DriverAccountServiceImpl
extends
ServiceImpl
<
DriverAccountDao
,
DriverAccountEntity
>
implements
DriverAccountService
{
private
ErrorMessageComponent
errorMessageComponent
;
private
ErrorMessageComponent
errorMessageComponent
;
...
@@ -49,15 +53,18 @@ public class DriverAccountServiceImpl extends ServiceImpl<DriverAccountDao, Driv
...
@@ -49,15 +53,18 @@ public class DriverAccountServiceImpl extends ServiceImpl<DriverAccountDao, Driv
private
CarrierAccountService
carrierAccountService
;
private
CarrierAccountService
carrierAccountService
;
private
FeignAppService
feignAppService
;
@Autowired
@Autowired
public
DriverAccountServiceImpl
(
ErrorMessageComponent
errorMessageComponent
,
PasswordComponent
passwordComponent
,
public
DriverAccountServiceImpl
(
ErrorMessageComponent
errorMessageComponent
,
PasswordComponent
passwordComponent
,
DriverInfoService
driverInfoService
,
DriverAuditHistoryService
driverAuditHistoryService
,
DriverInfoService
driverInfoService
,
DriverAuditHistoryService
driverAuditHistoryService
,
CarrierAccountService
carrierAccountService
)
{
CarrierAccountService
carrierAccountService
,
FeignAppService
feignAppService
)
{
this
.
errorMessageComponent
=
errorMessageComponent
;
this
.
errorMessageComponent
=
errorMessageComponent
;
this
.
passwordComponent
=
passwordComponent
;
this
.
passwordComponent
=
passwordComponent
;
this
.
driverInfoService
=
driverInfoService
;
this
.
driverInfoService
=
driverInfoService
;
this
.
driverAuditHistoryService
=
driverAuditHistoryService
;
this
.
driverAuditHistoryService
=
driverAuditHistoryService
;
this
.
carrierAccountService
=
carrierAccountService
;
this
.
carrierAccountService
=
carrierAccountService
;
this
.
feignAppService
=
feignAppService
;
}
}
@Override
@Override
...
@@ -232,7 +239,19 @@ public class DriverAccountServiceImpl extends ServiceImpl<DriverAccountDao, Driv
...
@@ -232,7 +239,19 @@ public class DriverAccountServiceImpl extends ServiceImpl<DriverAccountDao, Driv
DriverAccountEntity
driverAccountEntity
=
new
DriverAccountEntity
();
DriverAccountEntity
driverAccountEntity
=
new
DriverAccountEntity
();
driverAccountEntity
.
setId
(
id
);
driverAccountEntity
.
setId
(
id
);
driverAccountEntity
.
setAccountStatus
(
DriverConstants
.
ACCOUNT_STATUS_BLOCK
);
driverAccountEntity
.
setAccountStatus
(
DriverConstants
.
ACCOUNT_STATUS_BLOCK
);
return
this
.
baseMapper
.
updateById
(
driverAccountEntity
);
int
flag
=
this
.
baseMapper
.
updateById
(
driverAccountEntity
);
// 4:通知APP后台
JSONObject
bodyJson
=
new
JSONObject
();
bodyJson
.
put
(
"phone"
,
accountEntity
.
getAccount
());
try
{
JSONObject
resultJson
=
feignAppService
.
blockDriverAccount
(
bodyJson
);
log
.
info
(
"停用帐号Feign通知APP后台响应结果:{}"
,
resultJson
.
toJSONString
());
}
catch
(
Exception
e
)
{
log
.
error
(
"停用帐号Feign通知APP后台发生错误:"
+
e
.
getMessage
(),
e
);
}
return
flag
;
}
}
@Override
@Override
...
...
src/main/resources/application-dev.yml
View file @
b14c1383
...
@@ -44,7 +44,7 @@ mybatis-plus:
...
@@ -44,7 +44,7 @@ mybatis-plus:
ribbon
:
ribbon
:
eager-load
:
eager-load
:
enabled
:
true
enabled
:
true
clients
:
freight-base-service
clients
:
freight-base-service
,freight-app-service
error-message
:
error-message
:
goodsowner
:
goodsowner
:
account
:
account
:
...
...
src/main/resources/application-test.yml
View file @
b14c1383
...
@@ -44,7 +44,7 @@ mybatis-plus:
...
@@ -44,7 +44,7 @@ mybatis-plus:
ribbon
:
ribbon
:
eager-load
:
eager-load
:
enabled
:
true
enabled
:
true
clients
:
freight-base-service
clients
:
freight-base-service
,freight-app-service
error-message
:
error-message
:
goodsowner
:
goodsowner
:
account
:
account
:
...
...
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