Commit ae0a5747 by jx-art

Merge remote-tracking branch 'origin/feature-changeFlow-221110' into feature-changeFlow-221110

parents 601ecc71 5657d57c
Pipeline #42887 passed with stages
in 1 minute 12 seconds
......@@ -84,7 +84,8 @@ CREATE TABLE `TB_YX_QC_CHANGE_FILE`
`file_url` varchar(255) NOT NULL DEFAULT '' COMMENT '文件地址',
`create_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '创建时间',
`update_time` bigint(20) NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
PRIMARY KEY (`id`),
KEY `key_record_id` (`change_record_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='附件表';
CREATE TABLE `TB_YX_QC_CHANGE_EXEC_RECORD`
......
......@@ -21,22 +21,33 @@ import org.springframework.util.CollectionUtils;
import com.alibaba.fastjson.JSON;
import com.netease.mail.yanxuan.change.biz.config.AppConfig;
import com.netease.mail.yanxuan.change.biz.meta.exception.ExceptionFactory;
import com.netease.mail.yanxuan.change.biz.service.ChangeFileService;
import com.netease.mail.yanxuan.change.biz.service.ChangeFlowExecService;
import com.netease.mail.yanxuan.change.biz.service.ChangeFlowService;
import com.netease.mail.yanxuan.change.biz.service.change.ChangeConfigService;
import com.netease.mail.yanxuan.change.biz.service.change.ChangeTypeService;
import com.netease.mail.yanxuan.change.common.bean.CommonConstants;
import com.netease.mail.yanxuan.change.common.bean.ResponseCode;
import com.netease.mail.yanxuan.change.common.bean.ResponseCodeEnum;
import com.netease.mail.yanxuan.change.common.enums.ChangeFlowEnum;
import com.netease.mail.yanxuan.change.common.enums.ChangeResultEnum;
import com.netease.mail.yanxuan.change.common.enums.ChangeStatusEnum;
import com.netease.mail.yanxuan.change.common.enums.ChangeSubjectEnum;
import com.netease.mail.yanxuan.change.common.enums.FlowOperationTypeEnum;
import com.netease.mail.yanxuan.change.common.enums.FlowxOperationEnum;
import com.netease.mail.yanxuan.change.common.util.DateUtils;
import com.netease.mail.yanxuan.change.dal.entity.ChangeExecRecord;
import com.netease.mail.yanxuan.change.dal.entity.ChangeFile;
import com.netease.mail.yanxuan.change.dal.entity.ChangeRecord;
import com.netease.mail.yanxuan.change.dal.entity.ChangeType;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeExecConfigReq;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeFlowCancelReq;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeFlowCreateReq;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeFlowFile;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeFlowSubmitReq;
import com.netease.mail.yanxuan.change.dal.meta.model.vo.BasicChangeFlowVO;
import com.netease.mail.yanxuan.change.dal.meta.model.vo.ChangeFlowExecVO;
import com.netease.mail.yanxuan.change.dal.meta.model.vo.ChangeFlowVO;
import com.netease.mail.yanxuan.change.integration.flow.FlowRpcService;
import com.netease.yanxuan.flowx.sdk.meta.controller.communal.AjaxResponse;
import com.netease.yanxuan.flowx.sdk.meta.dto.base.FlowDataDTO;
......@@ -54,7 +65,7 @@ import lombok.extern.slf4j.Slf4j;
public class ChangeFlowBiz {
@Autowired
private ChangeConfigService changeConfigService;
private ChangeTypeService changeTypeService;
@Autowired
private ChangeFlowService changeFlowService;
......@@ -65,6 +76,12 @@ public class ChangeFlowBiz {
@Autowired
private FlowRpcService flowRpcService;
@Autowired
private ChangeFileService changeFileService;
@Autowired
private ChangeFlowExecService changeFlowExecService;
public String createAndSubmit(ChangeFlowCreateReq changeFlowCreateReq) {
// String uid = RequestLocalBean.getUid();
String uid = "x@mesg.com";
......@@ -107,12 +124,12 @@ public class ChangeFlowBiz {
// 如果发起人=变更负责人
if (true) {
List<String> nextNodeIdList = submitFlow(flowId, flowDataDTO, uid,
ChangeFlowEnum.CHANGE_FLOW_START.getTopoId(), JSON.toJSONString(content));
if (CollectionUtils.isEmpty(nextNodeIdList)) {
String nextNodeId = submitFlow(flowId, flowDataDTO, uid,
ChangeFlowEnum.CHANGE_FLOW_START.getTopoId(), JSON.toJSONString(content));
if (null == nextNodeId) {
throw ExceptionFactory.createBiz(ResponseCode.SUBMIT_FLOW_ERROR, "首次提交节点失败");
}
return nextNodeIdList.get(0);
return nextNodeId;
}
return flowId;
}
......@@ -159,7 +176,7 @@ public class ChangeFlowBiz {
return flowCreateReqDTO;
}
private List<String> submitFlow(String flowId, FlowDataDTO flowDataDTO, String uid, String topoId, String content) {
private String submitFlow(String flowId, FlowDataDTO flowDataDTO, String uid, String topoId, String content) {
NodeSubmitReqDTO nodeSubmitReqDTO = new NodeSubmitReqDTO();
nodeSubmitReqDTO.setFlowId(flowId);
nodeSubmitReqDTO.setNodeId(flowDataDTO.getFlowMeta().getCurrNodeDataList().get(0).getNodeId());
......@@ -184,7 +201,10 @@ public class ChangeFlowBiz {
JSON.toJSONString(submitResponse));
throw ExceptionFactory.createBiz(ResponseCode.SUBMIT_FLOW_ERROR, "提交工单错误");
}
return nextNodeIdList;
if (CollectionUtils.isEmpty(nextNodeIdList)) {
return ChangeFlowEnum.END.getNodeId();
}
return nextNodeIdList.get(0);
}
private String createFlow(FlowCreateReqDTO flowCreateReqDTO) {
......@@ -233,7 +253,7 @@ public class ChangeFlowBiz {
changeRecord.setChangeConfirmResultTime(changeFlowCreateReq.getChangeConfirmResultTime());
changeRecord.setState(ChangeStatusEnum.IN.getStatus());
// 变更结论
changeRecord.setChangeResult(1);
changeRecord.setChangeResult(ChangeResultEnum.INIT.getStatus());
changeRecord.setCreateSource(changeFlowCreateReq.getCreateSource());
changeRecord.setCreateSupplier(changeFlowCreateReq.getChangeSupplier());
changeRecord.setCreateTime(DateUtils.getCurrentTime());
......@@ -245,14 +265,11 @@ public class ChangeFlowBiz {
log.info("[submitFlow] changeFlowReq:{}", JSON.toJSONString(changeFlowSubmitReq));
Long flowId = changeFlowSubmitReq.getFlowId();
// 查询工单有效性
ChangeRecord changeRecord = changeFlowService.getByFlowId(flowId);
if (changeRecord == null) {
throw ExceptionFactory.createBiz(ResponseCode.ERROR_FLOW_ID, "工单id不存在");
}
if (!changeRecord.getFlowNode().equals(changeFlowSubmitReq.getCurrentNodeId())) {
throw ExceptionFactory.createBiz(ResponseCode.NODE_ERROR, "工单已流转至其他节点");
}
ChangeRecord changeRecord = this.getFlowInfo(flowId);
// 检查工单节点
this.checkNode(changeRecord.getFlowNode(), changeFlowSubmitReq.getCurrentNodeId());
// todo:检验操作权限
// String uid = RequestLocalBean.getUid();
String uid = "1";
String changeCommander = changeRecord.getChangeCommander();
......@@ -261,20 +278,113 @@ public class ChangeFlowBiz {
}
// 获取工单详情
FlowDataDTO flowDataDTO = this.flowDetail(flowId.toString());
if (flowDataDTO == null) {
throw ExceptionFactory.createBiz(ResponseCode.DETAIL_FLOW_ERROR, "工单查询错误,不存在");
}
// 工单流传
Map<String, Object> content = new HashMap<>(CommonConstants.INIT_HASH_MAP_SIZE);
content.put("updateTime", System.currentTimeMillis());
content.put(CommonConstants.FLOW_OPERATION_KEY, FlowOperationTypeEnum.PASS.getValue());
List<String> nextNodeList = this.submitFlow(flowId.toString(), flowDataDTO, uid,
return this.submitFlow(flowId.toString(), flowDataDTO, uid,
ChangeFlowEnum.CHANGE_FLOW_SUBMIT.getTopoId(), JSON.toJSONString(content));
if (CollectionUtils.isEmpty(nextNodeList)) {
return ChangeFlowEnum.END.getNodeId();
}
private ChangeRecord getFlowInfo(Long flowId) {
ChangeRecord changeRecord = changeFlowService.getByFlowId(flowId);
if (changeRecord == null) {
throw ExceptionFactory.createBiz(ResponseCode.ERROR_FLOW_ID, "工单id不存在");
}
return nextNodeList.get(0);
return changeRecord;
}
private void checkNode(String recordNode, String currentNodeId){
if (!recordNode.equals(currentNodeId)) {
throw ExceptionFactory.createBiz(ResponseCode.NODE_ERROR, "工单已流转至其他节点");
}
};
public Boolean cancel(ChangeFlowCancelReq req) {
log.info("[cancel] req:{}", JSON.toJSONString(req));
return false;
Long flowId = req.getFlowId();
// 查询工单有效性
ChangeRecord changeRecord = getFlowInfo(flowId);
// 检查工单节点
this.checkNode(changeRecord.getFlowNode(), ChangeFlowEnum.CHANGE_FLOW_EXE.getNodeId());
// todo:检查审核人
// 获取工单详情
FlowDataDTO flowDataDTO = this.flowDetail(flowId.toString());
if (flowDataDTO == null) {
throw ExceptionFactory.createBiz(ResponseCode.DETAIL_FLOW_ERROR, "工单查询错误,不存在");
}
// 工单流转
Map<String, Object> content = new HashMap<>(CommonConstants.INIT_HASH_MAP_SIZE);
content.put("updateTime", System.currentTimeMillis());
content.put(CommonConstants.FLOW_OPERATION_KEY, FlowOperationTypeEnum.REFUSE.getValue());
// String uid = RequestLocalBean.getUid();
String uid = "1";
String nextNodeId = this.submitFlow(String.valueOf(flowId), flowDataDTO, uid, ChangeFlowEnum.CHANGE_FLOW_EXE.getTopoId(), JSON.toJSONString(content));
log.info("[cancel] nextNodeId:{}", nextNodeId);
// 填充更新数据
changeRecord.setFlowNode(nextNodeId);
changeRecord.setState(ChangeStatusEnum.CANCEL.getStatus());
changeRecord.setCancelReason(req.getCancelReason());
changeRecord.setUpdateTime(DateUtils.getCurrentTime());
return changeFlowService.updateRecord(changeRecord);
}
public BasicChangeFlowVO quote(Long flowId) {
// 获取工单详情
ChangeRecord changeRecord = this.getFlowInfo(flowId);
// 获取附件
List<ChangeFlowFile> changeFileList = changeFileService.getChangeFileList(changeRecord.getId());
return BasicChangeFlowVO.builder().parentChangeClassId(changeRecord.getParentChangeClassId())
.sonChangeClassId(changeRecord.getSonChangeClassId()).changeSubject(changeRecord.getChangeSubject())
.changeItem(changeRecord.getChangeItem()).changeSupplier(changeRecord.getChangeSupplier())
.changeReason(changeRecord.getChangeReason()).changeContent(changeRecord.getChangeContent())
.changeRiskDesc(changeRecord.getChangeRiskDesc()).changeProfit(changeRecord.getChangeProfit())
.changeProfitDesc(changeRecord.getChangeProfitDesc()).files(changeFileList).build();
}
public ChangeFlowVO detail(Long id) {
ChangeRecord changeRecord = changeFlowService.getById(id);
if (changeRecord == null) {
throw ExceptionFactory.createBiz(ResponseCode.ERROR_FLOW_ID, "工单id不存在");
}
ChangeFlowVO changeFlowVO = new ChangeFlowVO();
changeFlowVO.setId(changeRecord.getId());
changeFlowVO.setFlowId(changeFlowVO.getFlowId());
changeFlowVO.setChangeSubject(changeRecord.getChangeSubject());
ChangeType parentChangeType = changeTypeService.getChangeTypeById(changeRecord.getParentChangeClassId());
if (parentChangeType == null) {
throw ExceptionFactory.createBiz(ResponseCode.CHANGE_TYPE_NOT_EXIST, "变更类型不存在");
}
ChangeType sonChangeType = changeTypeService.getChangeTypeById(changeRecord.getSonChangeClassId());
if (sonChangeType == null) {
throw ExceptionFactory.createBiz(ResponseCode.CHANGE_TYPE_NOT_EXIST, "变更类型配置不存在");
}
changeFlowVO.setChangeType(parentChangeType.getTypeName() + ">" + sonChangeType.getTypeName());
changeFlowVO.setChangeLevel(changeRecord.getChangeLevel());
changeFlowVO.setChangeDepartment(changeRecord.getChangeDepartment());
changeFlowVO.setChangeCommander(changeRecord.getChangeCommander());
changeFlowVO.setSupplier(changeRecord.getChangeSupplier());
changeFlowVO.setChangeReason(changeRecord.getChangeReason());
changeFlowVO.setChangeContent(changeRecord.getChangeContent());
changeFlowVO.setChangeRiskDesc(changeRecord.getChangeRiskDesc());
// 获取附件
List<ChangeFlowFile> changeFileList = changeFileService.getChangeFileList(changeRecord.getId());
changeFlowVO.setFiles(changeFileList);
changeFlowVO.setChangeProfit(changeRecord.getChangeProfit());
changeFlowVO.setChangeProfitDesc(changeRecord.getChangeProfitDesc());
changeFlowVO.setChangeItems(changeRecord.getChangeItem());
changeFlowVO.setChangeState(changeRecord.getState());
changeFlowVO.setChangeCreator(changeRecord.getCreator());
List<ChangeFlowExecVO> changeFlowExecRecord = changeFlowExecService.getChangeFlowExecRecord(changeRecord.getId());
changeFlowVO.setChangeExecDepartment(changeFlowExecRecord);
changeFlowVO.setCreateTime(changeRecord.getCreateTime());
changeFlowVO.setChangeConfirmResultTime(changeRecord.getChangeConfirmResultTime());
changeFlowVO.setState(changeRecord.getState());
changeFlowVO.setChangeResult(changeRecord.getChangeResult());
return changeFlowVO;
}
}
/**
* @(#)ChangeFileService.java, 2022/11/21.
* <p/>
* Copyright 2022 Netease, Inc. All rights reserved.
* NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.netease.mail.yanxuan.change.biz.service;
import java.util.List;
import com.netease.mail.yanxuan.change.dal.entity.ChangeFile;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeFlowFile;
/**
* @Author zcwang
* @Date 2022/11/21
*/
public interface ChangeFileService {
/**
* 获取工单对应的附件
* @param changeRecordId
* @return
*/
List<ChangeFlowFile> getChangeFileList(Long changeRecordId);
}
\ No newline at end of file
/**
* @(#)ChangeFlowExecService.java, 2022/11/21.
* <p/>
* Copyright 2022 Netease, Inc. All rights reserved.
* NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.netease.mail.yanxuan.change.biz.service;
import java.util.List;
import com.netease.mail.yanxuan.change.dal.entity.ChangeExecRecord;
import com.netease.mail.yanxuan.change.dal.meta.model.vo.ChangeFlowExecVO;
/**
* @Author zcwang
* @Date 2022/11/21
*/
public interface ChangeFlowExecService {
/**
* 查询行动项
* @param id
* @return
*/
List<ChangeFlowExecVO> getChangeFlowExecRecord(Long id);
}
\ No newline at end of file
......@@ -6,6 +6,8 @@
*/
package com.netease.mail.yanxuan.change.biz.service;
import java.util.List;
import com.netease.mail.yanxuan.change.biz.config.TitleConfig;
import com.netease.mail.yanxuan.change.dal.entity.ChangeRecord;
......@@ -35,4 +37,17 @@ public interface ChangeFlowService {
*/
ChangeRecord getByFlowId(Long flowId);
/**
* 更新工单信息
* @param changeRecord
* @return
*/
Boolean updateRecord(ChangeRecord changeRecord);
/**
* 根据实例id获取工单详情
* @param id
* @return
*/
ChangeRecord getById(Long id);
}
\ No newline at end of file
......@@ -45,4 +45,11 @@ public interface ChangeTypeService {
* @return
*/
List<ChangeTypePo> queryConfigType();
/**
* 根据主键获取类型信息
* @param id
* @return
*/
ChangeType getChangeTypeById(Long id);
}
/**
* @(#)ChangeFileServiceImpl.java, 2022/11/21.
* <p/>
* Copyright 2022 Netease, Inc. All rights reserved.
* NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.netease.mail.yanxuan.change.biz.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.netease.mail.yanxuan.change.biz.service.ChangeFileService;
import com.netease.mail.yanxuan.change.dal.entity.ChangeFile;
import com.netease.mail.yanxuan.change.dal.mapper.ChangeFileMapper;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeFlowFile;
/**
* @Author zcwang
* @Date 2022/11/21
*/
@Service
public class ChangeFileServiceImpl implements ChangeFileService {
@Autowired
private ChangeFileMapper changeFileMapper;
@Override
public List<ChangeFlowFile> getChangeFileList(Long changeRecordId) {
List<ChangeFile> changeFiles = changeFileMapper.selectByChangeRecordId(changeRecordId);
if (CollectionUtils.isNotEmpty(changeFiles)) {
return changeFiles.stream().map(c -> ChangeFlowFile.builder().fileType(c.getFileType()).fileName(c.getFileName())
.fileUrl(c.getFileUrl()).build()).collect(Collectors.toList());
}
return new ArrayList<>();
}
}
\ No newline at end of file
/**
* @(#)ChangeFlowExecServiceImpl.java, 2022/11/21.
* <p/>
* Copyright 2022 Netease, Inc. All rights reserved.
* NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.netease.mail.yanxuan.change.biz.service.impl;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.netease.mail.yanxuan.change.biz.service.ChangeFlowExecService;
import com.netease.mail.yanxuan.change.dal.entity.ChangeExecRecord;
import com.netease.mail.yanxuan.change.dal.mapper.ChangeExecRecordMapper;
import com.netease.mail.yanxuan.change.dal.meta.model.vo.ChangeFlowExecVO;
/**
* @Author zcwang
* @Date 2022/11/21
*/
@Service
public class ChangeFlowExecServiceImpl implements ChangeFlowExecService {
@Autowired
private ChangeExecRecordMapper changeExecRecordMapper;
@Override
public List<ChangeFlowExecVO> getChangeFlowExecRecord(Long id) {
List<ChangeExecRecord> changeExecRecords = changeExecRecordMapper.selectByChangeRecordId(id);
if (CollectionUtils.isNotEmpty(changeExecRecords)) {
return changeExecRecords.stream()
.map(c -> ChangeFlowExecVO.builder().changeRecordId(c.getChangeRecordId())
.changeExecDepartment(c.getChangeExecDepartment()).changeExecUser(c.getChangeExecUser())
.changeRiskDesc(c.getChangeRiskDesc()).changeExecProject(c.getChangeExecProject())
.changeChecking(c.getChangeChecking()).changeExecFinishTime(c.getChangeExecFinishTime())
.changeExecFinishDesc(c.getChangeExecFinishDesc()).build())
.collect(Collectors.toList());
}
return new ArrayList<>();
}
}
\ No newline at end of file
......@@ -14,7 +14,6 @@ import com.netease.mail.yanxuan.change.biz.config.TitleConfig;
import com.netease.mail.yanxuan.change.biz.service.ChangeFlowService;
import com.netease.mail.yanxuan.change.dal.entity.ChangeRecord;
import com.netease.mail.yanxuan.change.dal.mapper.ChangeRecordMapper;
import com.netease.mail.yanxuan.change.dal.meta.model.vo.ChangeFlowVO;
/**
* @Author zcwang
......@@ -43,4 +42,14 @@ public class ChangeFlowServiceImpl implements ChangeFlowService {
public ChangeRecord getByFlowId(Long flowId) {
return changeRecordMapper.selectByFlowId(flowId);
}
@Override
public Boolean updateRecord(ChangeRecord changeRecord) {
return changeRecordMapper.updateByPrimaryKey(changeRecord) > 0;
}
@Override
public ChangeRecord getById(Long id) {
return changeRecordMapper.selectByPrimaryKey(id);
}
}
\ No newline at end of file
......@@ -167,6 +167,11 @@ public class ChangeTypeServiceImpl implements ChangeTypeService {
return pos;
}
@Override
public ChangeType getChangeTypeById(Long id) {
return mapper.selectByPrimaryKey(id);
}
/**
* 判断变更类型是否重复(只判断未伪善出的)
* @param changeTypes
......
......@@ -128,6 +128,7 @@ public enum ResponseCode {
NODE_ERROR(1004, "工单已流转至其他节点"),
NO_AUTH(1005, "没有当前节点操作权限"),
CHANGE_SUBJECT_ERROR(1006, "变更主体类型错误"),
CHANGE_TYPE_NOT_EXIST(1007, "变更类型不存在"),
/**
* 无权限
......
/**
* @(#)ChangeResultEnum.java, 2022/11/21.
* <p/>
* Copyright 2022 Netease, Inc. All rights reserved.
* NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.netease.mail.yanxuan.change.common.enums;
/**
* @Author zcwang
* @Date 2022/11/21
*/
public enum ChangeResultEnum {
INIT(0, "初始化"),
FINISH_ALL(1, "完成变更管理,风险可控,可实施变更"),
FINISH_PART(2, "完成变更管理,部分风险不可控,待修订变更方案"),
CANCEL(3, "不通过,变更取消"),
DELAY(4, "延期确认");
private Integer status;
private String desc;
ChangeResultEnum(Integer status, String desc) {
this.status = status;
this.desc = desc;
}
public Integer getStatus() {
return status;
}
}
\ No newline at end of file
......@@ -6,7 +6,11 @@
*/
package com.netease.mail.yanxuan.change.dal.mapper;
import java.util.List;
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.ChangeExecRecord;
......@@ -16,4 +20,7 @@ import com.netease.mail.yanxuan.change.dal.entity.ChangeExecRecord;
*/
@Mapper
public interface ChangeExecRecordMapper extends tk.mybatis.mapper.common.Mapper<ChangeExecRecord> {
@Select("SELECT * FROM TB_YX_QC_CHANGE_EXEC_RECORD WHERE change_record_id = #{changeRecordId}}")
List<ChangeExecRecord> selectByChangeRecordId(@Param("id") Long id);
}
\ No newline at end of file
......@@ -6,7 +6,11 @@
*/
package com.netease.mail.yanxuan.change.dal.mapper;
import java.util.List;
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.ChangeFile;
......@@ -16,4 +20,7 @@ import com.netease.mail.yanxuan.change.dal.entity.ChangeFile;
*/
@Mapper
public interface ChangeFileMapper extends tk.mybatis.mapper.common.Mapper<ChangeFile> {
@Select("SELECT * FROM TB_YX_QC_CHANGE_FILE WHERE change_record_id = #{changeRecordId}")
List<ChangeFile> selectByChangeRecordId(@Param("changeRecordId") Long changeRecordId);
}
\ No newline at end of file
......@@ -6,12 +6,18 @@
*/
package com.netease.mail.yanxuan.change.dal.meta.model.req;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author zcwang
* @Date 2022/11/14
*/
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
public class ChangeFlowFile {
......
/**
* @(#)BasicChangeFlowVO.java, 2022/11/21.
* <p/>
* Copyright 2022 Netease, Inc. All rights reserved.
* NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.netease.mail.yanxuan.change.dal.meta.model.vo;
import java.util.List;
import com.netease.mail.yanxuan.change.dal.entity.ChangeFile;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeFlowFile;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author zcwang
* @Date 2022/11/21
*/
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
public class BasicChangeFlowVO {
/**
* 一级变更类型id
*/
private Long parentChangeClassId;
/**
* 二级变更类型id
*/
private Long sonChangeClassId;
/**
* 变更主体
*/
private Integer changeSubject;
/**
* 变更商品(变更主体为商品时有效)
*/
private String changeItem;
/**
* 变更供应商(变更主体为供应商时有效)
*/
private String changeSupplier;
/**
* 变更原因
*/
private String changeReason;
/**
* 变更内容
*/
private String changeContent;
/**
* 变更潜在风险描述
*/
private String changeRiskDesc;
/**
* 变更收益类型
*/
private Integer changeProfit;
/**
* 变更收益说明
*/
private String changeProfitDesc;
/**
* 附件
*/
private List<ChangeFlowFile> files;
}
\ No newline at end of file
/**
* @(#)ChangeFlowExecVO.java, 2022/11/21.
* <p/>
* Copyright 2022 Netease, Inc. All rights reserved.
* NETEASE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.netease.mail.yanxuan.change.dal.meta.model.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author zcwang
* @Date 2022/11/21
*/
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
public class ChangeFlowExecVO {
/**
* 变更记录id
*/
private Long changeRecordId;
/**
* 变更执行部门名
*/
private String changeExecDepartment;
/**
* 变更行动人(不同类型存储不同内容)
*/
private String changeExecUser;
/**
* 变更风险描述
*/
private String changeRiskDesc;
/**
* 行动项
*/
private String changeExecProject;
/**
* 变更措施验证
*/
private String changeChecking;
/**
* 行动完成时间
*/
private Long changeExecFinishTime;
/**
* 行动完成情况
*/
private String changeExecFinishDesc;
}
\ No newline at end of file
......@@ -10,6 +10,8 @@ import java.util.List;
import com.netease.mail.yanxuan.change.common.enums.ChangeStatusEnum;
import com.netease.mail.yanxuan.change.common.enums.ChangeSubjectEnum;
import com.netease.mail.yanxuan.change.dal.entity.ChangeExecRecord;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeFlowFile;
import lombok.Builder;
import lombok.Data;
......@@ -19,7 +21,6 @@ import lombok.Data;
* @Date 2022/11/14
*/
@Builder
@Data
public class ChangeFlowVO {
......@@ -38,6 +39,22 @@ public class ChangeFlowVO {
* 变更类型,一级类型>二级类型
*/
private String changeType;
/**
* 变更等级
*/
private Integer changeLevel;
/**
* 变更负责部门名
*/
private String changeDepartment;
/**
* 变更原因
*/
private String changeReason;
/**
* 变更内容
*/
......@@ -46,10 +63,30 @@ public class ChangeFlowVO {
* 变更负责人
*/
private String changeCommander;
/**
* 变更潜在风险描述
*/
private String changeRiskDesc;
/**
* 附件
*/
private List<ChangeFlowFile> files;
/**
* 变更收益类型
*/
private Integer changeProfit;
/**
* 变更收益说明
*/
private String changeProfitDesc;
/**
* 变更商品列表
*/
private List<ChangeItemVO> changeItems;
private String changeItems;
/**
* 变更供应商
*/
......@@ -66,9 +103,34 @@ public class ChangeFlowVO {
/**
* 变更行动部门
*/
private String changeExecDepartment;
private List<ChangeFlowExecVO> changeExecDepartment;
/**
* 创建时间
*/
private Long createTime;
/**
* 变更结果确认时间
*/
private Long changeConfirmResultTime;
/**
* 工单状态
*/
private Integer state;
/**
* 取消原因
*/
private String cancelReason;
/**
* 变更结论
*/
private Integer changeResult;
/**
* 备注
*/
private String remark;
}
\ No newline at end of file
......@@ -8,11 +8,13 @@ package com.netease.mail.yanxuan.change.web.controller;
import javax.validation.Valid;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;
......@@ -23,6 +25,8 @@ import com.netease.mail.yanxuan.change.biz.service.ChangeFlowService;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeFlowCancelReq;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeFlowCreateReq;
import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeFlowSubmitReq;
import com.netease.mail.yanxuan.change.dal.meta.model.vo.BasicChangeFlowVO;
import com.netease.mail.yanxuan.change.dal.meta.model.vo.ChangeFlowVO;
import lombok.extern.slf4j.Slf4j;
......@@ -46,9 +50,8 @@ public class ChangeFlowController {
* @return
*/
@GetMapping("/detail")
public AjaxResult<Void> detail() {
return AjaxResult.success();
public AjaxResult<ChangeFlowVO> detail(@RequestParam Long id) {
return AjaxResult.success(changeFlowBiz.detail(id));
}
/**
......@@ -111,9 +114,8 @@ public class ChangeFlowController {
* @return
*/
@GetMapping("/quote")
public AjaxResult<Void> quote() {
return AjaxResult.success();
public AjaxResult<BasicChangeFlowVO> quote(@RequestParam Long flowId) {
return AjaxResult.success(changeFlowBiz.quote(flowId));
}
......
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