Commit bcefa2e6 by “zcwang”

add: 运维接口

parent 85fa6c21
......@@ -74,7 +74,7 @@ public class AutoSubmit extends IJobHandler {
return ReturnT.SUCCESS;
}
private void progressRecord(ChangeRecord changeRecord) {
public void progressRecord(ChangeRecord changeRecord) {
Long flowId = changeRecord.getFlowId();
String flowNode = changeRecord.getFlowNode();
String uid = changeRecord.getChangeCommander();
......
......@@ -6,15 +6,19 @@
*/
package com.netease.mail.yanxuan.change.web.controller;
import java.util.ArrayList;
import java.util.List;
import com.netease.mail.yanxuan.change.biz.service.impl.InteriorChangeConfigServiceImpl;
import com.netease.mail.yanxuan.change.biz.meta.exception.ExceptionFactory;
import com.netease.mail.yanxuan.change.biz.service.ChangeFlowService;
import com.netease.mail.yanxuan.change.biz.task.AutoSubmit;
import com.netease.mail.yanxuan.change.common.bean.ResponseCode;
import com.netease.mail.yanxuan.change.common.enums.ChangeFlowEnum;
import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierGoodsInfoReq;
import com.netease.mail.yanxuan.change.integration.flow.supplier.req.SupplierRelatedUserReq;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierGoodsInfoRsp;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierUserRsp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSON;
......@@ -40,6 +44,12 @@ public class TestController {
@Autowired
private TodoService todoService;
@Autowired
private ChangeFlowService changeFlowService;
@Autowired
private AutoSubmit autoSubmit;
@PostMapping("/createToDo")
public AjaxResult<Void> createTodoTask(ChangeRecord entity) {
log.info("[createToDoTask] entity:{}", JSON.toJSONString(entity));
......@@ -58,23 +68,33 @@ public class TestController {
private FlowRpcSupplierSendService supplierSendService;
@PostMapping("/test1")
public String test1(@RequestBody List<Long> itemIds){
public String test1(@RequestBody List<Long> itemIds) {
return supplierSendService.queryGoodsPurchase(itemIds);
}
@PostMapping("/test2")
public AjaxResponse<List<SupplierUserRsp>> test2(@RequestBody SupplierRelatedUserReq req){
public AjaxResponse<List<SupplierUserRsp>> test2(@RequestBody SupplierRelatedUserReq req) {
return supplierSendService.querySupplierRelatedUser(req);
}
@PostMapping("/test3")
public AjaxResponse<List<SupplierSimpleRsp>> test3(@RequestBody SupplierSearchRemoteReq req){
public AjaxResponse<List<SupplierSimpleRsp>> test3(@RequestBody SupplierSearchRemoteReq req) {
return supplierSendService.queryByConditionForQc(req);
}
@PostMapping("/test4")
public AjaxResponse<List<SupplierGoodsInfoRsp>> test4(@RequestBody SupplierGoodsInfoReq req){
public AjaxResponse<List<SupplierGoodsInfoRsp>> test4(@RequestBody SupplierGoodsInfoReq req) {
return supplierSendService.SupplierGoodsInfoBySupplier(req);
}
@PostMapping("/submit")
public AjaxResult<Void> submit(Long id) {
ChangeRecord record = changeFlowService.getById(id);
Assert.notNull(record, "工单不存在");
if (!record.getFlowNode().equals(ChangeFlowEnum.CHANGE_FLOW_EXE.getNodeId())) {
throw ExceptionFactory.createBiz(ResponseCode.SUBMIT_FLOW_ERROR, "不是变更执行节点,不可运维提交");
}
autoSubmit.progressRecord(record);
return AjaxResult.success();
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment