Commit ae0a5747 by jx-art

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

parents 601ecc71 5657d57c
......@@ -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`
......
/**
* @(#)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