Commit a7c5a8a9 by “zcwang”

modify: 发起变更

parent 34f84e9a
......@@ -21,5 +21,18 @@ public interface ChangeFlowService {
*/
TitleConfig getTitleConfig();
/**
* 保存工单详情
* @param changeRecord
* @return
*/
Boolean saveRecord(ChangeRecord changeRecord);
/**
* 根据工单id查询
* @param flowId
* @return
*/
ChangeRecord getByFlowId(Long flowId);
}
\ No newline at end of file
......@@ -38,4 +38,9 @@ public class ChangeFlowServiceImpl implements ChangeFlowService {
public Boolean saveRecord(ChangeRecord changeRecord) {
return changeRecordMapper.insertSelective(changeRecord) > 0;
}
@Override
public ChangeRecord getByFlowId(Long flowId) {
return changeRecordMapper.selectByFlowId(flowId);
}
}
\ No newline at end of file
......@@ -15,6 +15,8 @@ public class CommonConstants {
// 工单业务数据操作key
public static final String FLOW_OPERATION_KEY = "operation";;
public static final int INIT_HASH_MAP_SIZE = 10;
public static Integer SIZE = 1;
public static Integer PAGE = 10;
......
......@@ -122,7 +122,10 @@ public enum ResponseCode {
CREATE_FLOW_ERROR(1001, "创建工单错误"),
DETAIL_FLOW_ERROR(1002, "查询工单详情错误"),
SUBMIT_FLOW_ERROR(1002, "查询工单详情错误"),
SUBMIT_FLOW_ERROR(1002, "提交工单错误"),
ERROR_FLOW_ID(1003, "工单id不存在"),
NODE_ERROR(1004, "工单已流转至其他节点"),
NO_AUTH(1005, "没有当前节点操作权限"),
//----------10xx-----------
......
......@@ -13,7 +13,8 @@ package com.netease.mail.yanxuan.change.common.enums;
public enum ChangeStatusEnum {
IN(1, "进行中"),
END(2, "完结");
CANCEL(2, "取消"),
END(3, "完结");
private Integer status;
......
......@@ -130,7 +130,7 @@ public class ChangeRecord {
/**
* 是否被取消
*/
private Integer isCancel;
private String cancelReason;
/**
* 变更结论
......
......@@ -7,6 +7,8 @@
package com.netease.mail.yanxuan.change.dal.mapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.netease.mail.yanxuan.change.dal.entity.ChangeRecord;
......@@ -16,4 +18,7 @@ import com.netease.mail.yanxuan.change.dal.entity.ChangeRecord;
*/
@Mapper
public interface ChangeRecordMapper extends tk.mybatis.mapper.common.Mapper<ChangeRecord> {
@Select("select * from TB_YX_QC_CHANGE_RECORD where `flow_id` = #{flowId}")
ChangeRecord selectByFlowId(@Param("flowId") Long flowId);
}
\ No newline at end of file
......@@ -8,6 +8,10 @@ package com.netease.mail.yanxuan.change.dal.meta.model.req;
import java.util.List;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import lombok.Data;
/**
......@@ -20,7 +24,15 @@ public class ChangeFlowReq {
/**
* 工单id
*/
private long flowId;
@NotNull(message = "工单id不能为空")
private Long flowId;
/**
* 当前节点id
*/
@NotBlank(message = "当前节点不能为空")
private String currentNodeId;
/**
* 一级类型id
*/
......
......@@ -75,7 +75,7 @@ public class ChangeFlowController {
* @return
*/
@PostMapping("/create")
public AjaxResult<List<String>> createAndSubmit(@RequestBody @Valid ChangeFlowCreateReq changeFlowCreateReq) {
public AjaxResult<String> createAndSubmit(@RequestBody @Valid ChangeFlowCreateReq changeFlowCreateReq) {
log.info("[createAndSubmit] createAndSubmit req={}", JSON.toJSONString(changeFlowCreateReq));
return AjaxResult.success(changeFlowBiz.createAndSubmit(changeFlowCreateReq));
}
......@@ -85,9 +85,8 @@ public class ChangeFlowController {
* @return
*/
@PostMapping("/submit")
public AjaxResult<Boolean> submit(@RequestBody ChangeFlowReq changeFlowReq) {
return AjaxResult.success();
public AjaxResult<String> submit(@RequestBody @Valid ChangeFlowReq changeFlowReq) {
return AjaxResult.success(changeFlowBiz.submit(changeFlowReq));
}
/**
......
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