Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 178b48ad
authored
Dec 01, 2023
by
刘鑫
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(派单结果更新): 增加内部跨服务调用接口
1 parent
89589938
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
5 deletions
project-order/src/main/java/com/dituhui/pea/order/feign/bean/AllotResultParam.java → project-interface/src/main/java/com/dituhui/pea/bean/AllotResultParam.java
project-interface/src/main/java/com/dituhui/pea/bean/RemoteBeanApi.java
project-order/src/main/java/com/dituhui/pea/order/feign/BeanRemoteServiceInner.java
project-order/src/main/java/com/dituhui/pea/order/feign/IBeanRemoteService.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/BeanRemoteServiceImpl.java
project-
order/src/main/java/com/dituhui/pea/order/feign
/bean/AllotResultParam.java
→
project-
interface/src/main/java/com/dituhui/pea
/bean/AllotResultParam.java
View file @
178b48a
package
com
.
dituhui
.
pea
.
order
.
feign
.
bean
;
package
com
.
dituhui
.
pea
.
bean
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
@@ -23,11 +23,11 @@ public class AllotResultParam {
*/
private
String
reason
;
/**
* 预约开始时间
* 预约开始时间
--时间戳
*/
private
long
appointmentStartTime
;
/**
* 预约结束时间
* 预约结束时间
--时间戳
*/
private
long
appointmentEndTime
;
}
project-interface/src/main/java/com/dituhui/pea/bean/RemoteBeanApi.java
0 → 100644
View file @
178b48a
package
com
.
dituhui
.
pea
.
bean
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
javax.validation.Valid
;
/**
* BEAN 回调接口 跨服务调用入口
*/
@FeignClient
(
value
=
"project-order"
,
contextId
=
"BEAN"
)
@Validated
public
interface
RemoteBeanApi
{
/**
* 服务工单派单结果更新
*
* @param allotResultParam 更新参数
* @return 是否回调BEAN成功
*/
@PostMapping
(
"/task/updateAllotResult"
)
boolean
allotResultUpdate
(
@Valid
@RequestBody
AllotResultParam
allotResultParam
);
}
project-order/src/main/java/com/dituhui/pea/order/feign/BeanRemoteServiceInner.java
0 → 100644
View file @
178b48a
package
com
.
dituhui
.
pea
.
order
.
feign
;
import
com.dituhui.pea.bean.AllotResultParam
;
import
com.dituhui.pea.bean.RemoteBeanApi
;
import
com.dituhui.pea.order.service.impl.BeanRemoteServiceImpl
;
import
lombok.AllArgsConstructor
;
import
org.springframework.web.bind.annotation.RestController
;
@RestController
@AllArgsConstructor
public
class
BeanRemoteServiceInner
implements
RemoteBeanApi
{
private
final
BeanRemoteServiceImpl
beanRemoteService
;
@Override
public
boolean
allotResultUpdate
(
AllotResultParam
allotResultParam
)
{
return
beanRemoteService
.
allotResultUpdate
(
allotResultParam
);
}
}
project-order/src/main/java/com/dituhui/pea/order/feign/IBeanRemoteService.java
View file @
178b48a
package
com
.
dituhui
.
pea
.
order
.
feign
;
import
com.dituhui.pea.bean.AllotResultParam
;
import
com.dituhui.pea.order.feign.bean.*
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.*
;
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/BeanRemoteServiceImpl.java
View file @
178b48a
...
...
@@ -3,6 +3,7 @@ package com.dituhui.pea.order.service.impl;
import
cn.hutool.core.util.ObjUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.nacos.common.utils.CollectionUtils
;
import
com.dituhui.pea.bean.AllotResultParam
;
import
com.dituhui.pea.common.BusinessException
;
import
com.dituhui.pea.common.Result
;
import
com.dituhui.pea.enums.StatusCodeEnum
;
...
...
@@ -150,8 +151,11 @@ public class BeanRemoteServiceImpl {
* @return 是否回写成功
* @apiNote 服务工单排单结果更新,PEA需要把派工的结果:负责人和计划时间,回写回来
*/
public
BeanR
<?>
allotResultUpdate
(
AllotResultParam
allotResultParam
)
{
return
beanRemoteService
.
allotResultUpdate
(
getAccessToken
(),
allotResultParam
);
public
boolean
allotResultUpdate
(
AllotResultParam
allotResultParam
)
{
log
.
info
(
"[服务工单派单结果更新回调], 请求参数:{}"
,
JsonUtil
.
toJson
(
allotResultParam
));
BeanR
<?>
beanR
=
beanRemoteService
.
allotResultUpdate
(
getAccessToken
(),
allotResultParam
);
log
.
info
(
"[服务工单派单结果更新][allotResultUpdate]【/api/openapi/task/updateAllotResult】返回值-------------------->{}"
,
JsonUtil
.
toJson
(
beanR
));
return
beanR
.
getSuccess
();
}
/**
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment