Commit 178b48ad by 刘鑫

feat(派单结果更新): 增加内部跨服务调用接口

1 parent 89589938
package com.dituhui.pea.order.feign.bean; package com.dituhui.pea.bean;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
...@@ -23,11 +23,11 @@ public class AllotResultParam { ...@@ -23,11 +23,11 @@ public class AllotResultParam {
*/ */
private String reason; private String reason;
/** /**
* 预约开始时间 * 预约开始时间 --时间戳
*/ */
private long appointmentStartTime; private long appointmentStartTime;
/** /**
* 预约结束时间 * 预约结束时间 --时间戳
*/ */
private long appointmentEndTime; private long appointmentEndTime;
} }
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);
}
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);
}
}
package com.dituhui.pea.order.feign; package com.dituhui.pea.order.feign;
import com.dituhui.pea.bean.AllotResultParam;
import com.dituhui.pea.order.feign.bean.*; import com.dituhui.pea.order.feign.bean.*;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
......
...@@ -3,6 +3,7 @@ package com.dituhui.pea.order.service.impl; ...@@ -3,6 +3,7 @@ package com.dituhui.pea.order.service.impl;
import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.ObjUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.common.utils.CollectionUtils; import com.alibaba.nacos.common.utils.CollectionUtils;
import com.dituhui.pea.bean.AllotResultParam;
import com.dituhui.pea.common.BusinessException; import com.dituhui.pea.common.BusinessException;
import com.dituhui.pea.common.Result; import com.dituhui.pea.common.Result;
import com.dituhui.pea.enums.StatusCodeEnum; import com.dituhui.pea.enums.StatusCodeEnum;
...@@ -150,8 +151,11 @@ public class BeanRemoteServiceImpl { ...@@ -150,8 +151,11 @@ public class BeanRemoteServiceImpl {
* @return 是否回写成功 * @return 是否回写成功
* @apiNote 服务工单排单结果更新,PEA需要把派工的结果:负责人和计划时间,回写回来 * @apiNote 服务工单排单结果更新,PEA需要把派工的结果:负责人和计划时间,回写回来
*/ */
public BeanR<?> allotResultUpdate(AllotResultParam allotResultParam) { public boolean allotResultUpdate(AllotResultParam allotResultParam) {
return beanRemoteService.allotResultUpdate(getAccessToken(), 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();
} }
/** /**
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!