Commit 8a66dc8e by jx-art

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

# Conflicts:
#	yanxuan-qc-change-system-web/src/main/java/com/netease/mail/yanxuan/change/web/controller/TestController.java
parents 64c7e3ef 4acfa4d9
...@@ -373,12 +373,11 @@ public class ChangeFlowBiz { ...@@ -373,12 +373,11 @@ public class ChangeFlowBiz {
ChangeRecord changeRecord = this.getFlowInfo(flowId); ChangeRecord changeRecord = this.getFlowInfo(flowId);
// 检查工单节点 // 检查工单节点
this.checkNode(changeRecord.getFlowNode(), Collections.singletonList(changeFlowSubmitReq.getCurrentNodeId())); this.checkNode(changeRecord.getFlowNode(), Collections.singletonList(changeFlowSubmitReq.getCurrentNodeId()));
// todo:检验操作权限
String uid = RequestLocalBean.getUid(); String uid = RequestLocalBean.getUid();
String changeCommander = changeRecord.getChangeCommander(); String changeCommander = changeRecord.getChangeCommander();
/*if (!uid.equals(changeCommander)) { if (!uid.equals(changeCommander)) {
throw ExceptionFactory.createBiz(ResponseCode.NO_AUTH, ResponseCode.NO_AUTH.getMsg()); throw ExceptionFactory.createBiz(ResponseCode.NO_AUTH, ResponseCode.NO_AUTH.getMsg());
}*/ }
// 获取工单详情 // 获取工单详情
FlowDataDTO flowDataDTO = flowService.flowDetail(flowId.toString()); FlowDataDTO flowDataDTO = flowService.flowDetail(flowId.toString());
if (flowDataDTO == null) { if (flowDataDTO == null) {
...@@ -556,11 +555,10 @@ public class ChangeFlowBiz { ...@@ -556,11 +555,10 @@ public class ChangeFlowBiz {
// 检查工单节点 // 检查工单节点
this.checkNode(changeRecord.getFlowNode(), Collections.singletonList(ChangeFlowEnum.CHANGE_FLOW_SUBMIT.getNodeId())); this.checkNode(changeRecord.getFlowNode(), Collections.singletonList(ChangeFlowEnum.CHANGE_FLOW_SUBMIT.getNodeId()));
String uid = RequestLocalBean.getUid(); String uid = RequestLocalBean.getUid();
// todo:检查审核人
String changeCommander = changeRecord.getChangeCommander(); String changeCommander = changeRecord.getChangeCommander();
/*if (!uid.equals(changeCommander)) { if (!uid.equals(changeCommander)) {
throw ExceptionFactory.createBiz(ResponseCode.NO_AUTH, ResponseCode.NO_AUTH.getMsg()); throw ExceptionFactory.createBiz(ResponseCode.NO_AUTH, ResponseCode.NO_AUTH.getMsg());
}*/ }
// 获取工单详情 // 获取工单详情
FlowDataDTO flowDataDTO = flowService.flowDetail(flowId.toString()); FlowDataDTO flowDataDTO = flowService.flowDetail(flowId.toString());
if (flowDataDTO == null) { if (flowDataDTO == null) {
...@@ -596,8 +594,8 @@ public class ChangeFlowBiz { ...@@ -596,8 +594,8 @@ public class ChangeFlowBiz {
.changeProfitDesc(changeRecord.getChangeProfitDesc()).files(changeFileList).build(); .changeProfitDesc(changeRecord.getChangeProfitDesc()).files(changeFileList).build();
} }
public ChangeFlowVO detail(Long id) { public ChangeFlowVO detail(Long flowId) {
ChangeRecord changeRecord = changeFlowService.getById(id); ChangeRecord changeRecord = changeFlowService.getByFlowId(flowId);
if (changeRecord == null) { if (changeRecord == null) {
throw ExceptionFactory.createBiz(ResponseCode.ERROR_FLOW_ID, "工单id不存在"); throw ExceptionFactory.createBiz(ResponseCode.ERROR_FLOW_ID, "工单id不存在");
} }
...@@ -852,12 +850,11 @@ public class ChangeFlowBiz { ...@@ -852,12 +850,11 @@ public class ChangeFlowBiz {
List<String> nodeList = Arrays.asList(ChangeFlowEnum.CHANGE_FLOW_SUBMIT.getNodeId(), List<String> nodeList = Arrays.asList(ChangeFlowEnum.CHANGE_FLOW_SUBMIT.getNodeId(),
ChangeFlowEnum.CHANGE_FLOW_CONFIRM.getNodeId()); ChangeFlowEnum.CHANGE_FLOW_CONFIRM.getNodeId());
this.checkNode(changeRecord.getFlowNode(), nodeList); this.checkNode(changeRecord.getFlowNode(), nodeList);
// todo:检验操作权限
String uid = RequestLocalBean.getUid(); String uid = RequestLocalBean.getUid();
String changeCommander = changeRecord.getChangeCommander(); String changeCommander = changeRecord.getChangeCommander();
/*if (!uid.equals(changeCommander)) { if (!uid.equals(changeCommander)) {
throw ExceptionFactory.createBiz(ResponseCode.NO_AUTH, ResponseCode.NO_AUTH.getMsg()); throw ExceptionFactory.createBiz(ResponseCode.NO_AUTH, ResponseCode.NO_AUTH.getMsg());
}*/ }
// 工单审核人转交 // 工单审核人转交
String deliverUser = req.getDeliverUser(); String deliverUser = req.getDeliverUser();
UserBaseDTO userBaseDTO = new UserBaseDTO(); UserBaseDTO userBaseDTO = new UserBaseDTO();
......
...@@ -4,12 +4,12 @@ import com.alibaba.fastjson.JSONObject; ...@@ -4,12 +4,12 @@ import com.alibaba.fastjson.JSONObject;
import com.netease.mail.yanxuan.change.biz.meta.exception.ExceptionFactory; import com.netease.mail.yanxuan.change.biz.meta.exception.ExceptionFactory;
import com.netease.mail.yanxuan.change.biz.service.change.ChangeConfigService; import com.netease.mail.yanxuan.change.biz.service.change.ChangeConfigService;
import com.netease.mail.yanxuan.change.biz.service.change.ChangeExecConfigService; import com.netease.mail.yanxuan.change.biz.service.change.ChangeExecConfigService;
import com.netease.mail.yanxuan.change.common.bean.AdminUserHolder;
import com.netease.mail.yanxuan.change.common.bean.AjaxResult; import com.netease.mail.yanxuan.change.common.bean.AjaxResult;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.netease.mail.yanxuan.change.biz.service.change.AdminChangeConfigService; import com.netease.mail.yanxuan.change.biz.service.change.AdminChangeConfigService;
import com.netease.mail.yanxuan.change.biz.service.change.ChangeTypeService; import com.netease.mail.yanxuan.change.biz.service.change.ChangeTypeService;
import com.netease.mail.yanxuan.change.common.bean.RequestLocalBean;
import com.netease.mail.yanxuan.change.common.bean.ResponseCode; 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.bean.ResponseCodeEnum;
import com.netease.mail.yanxuan.change.common.enums.ChangeSubjectEnum; import com.netease.mail.yanxuan.change.common.enums.ChangeSubjectEnum;
...@@ -212,7 +212,7 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService { ...@@ -212,7 +212,7 @@ public class AdminChangeConfigServiceImpl implements AdminChangeConfigService {
throw ExceptionFactory.createBiz(ResponseCode.PARAMETER_DEFICIENCY); throw ExceptionFactory.createBiz(ResponseCode.PARAMETER_DEFICIENCY);
//如果是执行人就从head里面把邮箱装载 //如果是执行人就从head里面把邮箱装载
}else if (changeConfigReq.getChangeCommanderType() == 1){ }else if (changeConfigReq.getChangeCommanderType() == 1){
changeConfigReq.setChangeCommander(AdminUserHolder.getUserName()); changeConfigReq.setChangeCommander(RequestLocalBean.getUid());
} }
changeConfig.setChangeCommanderType(changeConfigReq.getChangeCommanderType()); changeConfig.setChangeCommanderType(changeConfigReq.getChangeCommanderType());
if (changeConfigReq.getChangeCommander() == null){ if (changeConfigReq.getChangeCommander() == null){
......
package com.netease.mail.yanxuan.change.biz.service.impl.change; package com.netease.mail.yanxuan.change.biz.service.impl.change;
import com.netease.mail.yanxuan.change.biz.service.change.ChangeExecConfigService; import com.netease.mail.yanxuan.change.biz.service.change.ChangeExecConfigService;
import com.netease.mail.yanxuan.change.common.bean.AdminUserHolder; import com.netease.mail.yanxuan.change.common.bean.RequestLocalBean;
import com.netease.mail.yanxuan.change.dal.entity.ChangeExecConfig; import com.netease.mail.yanxuan.change.dal.entity.ChangeExecConfig;
import com.netease.mail.yanxuan.change.dal.mapper.ChangeExecConfigMapper; import com.netease.mail.yanxuan.change.dal.mapper.ChangeExecConfigMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -30,7 +30,7 @@ public class ChangeExecConfigServiceImpl implements ChangeExecConfigService { ...@@ -30,7 +30,7 @@ public class ChangeExecConfigServiceImpl implements ChangeExecConfigService {
for (ChangeExecConfig changeExecConfig : changeExecConfigs){ for (ChangeExecConfig changeExecConfig : changeExecConfigs){
//如果变更行动方案是变更发起人的话就填充登入人信息 //如果变更行动方案是变更发起人的话就填充登入人信息
if(changeExecConfig.getChangeExecUserType() == 1){ if(changeExecConfig.getChangeExecUserType() == 1){
changeExecConfig.setChangeExecUser(AdminUserHolder.getUserName()); changeExecConfig.setChangeExecUser(RequestLocalBean.getUid());
} }
//在修改的时候实际上删除在新增需要屏蔽掉ID //在修改的时候实际上删除在新增需要屏蔽掉ID
if (changeExecConfig.getId() != null){ if (changeExecConfig.getId() != null){
......
...@@ -22,7 +22,7 @@ import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeFlowListQueryReq ...@@ -22,7 +22,7 @@ import com.netease.mail.yanxuan.change.dal.meta.model.req.ChangeFlowListQueryReq
@Mapper @Mapper
public interface ChangeRecordMapper extends tk.mybatis.mapper.common.Mapper<ChangeRecord> { public interface ChangeRecordMapper extends tk.mybatis.mapper.common.Mapper<ChangeRecord> {
@Select("select * from TB_YX_QC_CHANGE_RECORD where `flow_id` = #{flowId}") @Select("select * from TB_YX_QC_CHANGE_RECORD where `flow_id` = #{flowId} limit 1")
ChangeRecord selectByFlowId(@Param("flowId") Long flowId); ChangeRecord selectByFlowId(@Param("flowId") Long flowId);
List<ChangeRecord> selectByCondition(ChangeFlowListQueryReq changeFlowListQueryReq); List<ChangeRecord> selectByCondition(ChangeFlowListQueryReq changeFlowListQueryReq);
......
package com.netease.mail.yanxuan.change.web.config; package com.netease.mail.yanxuan.change.web.config;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
...@@ -18,11 +22,16 @@ public class AdminUserLoginInterceptor implements HandlerInterceptor { ...@@ -18,11 +22,16 @@ public class AdminUserLoginInterceptor implements HandlerInterceptor {
@Override @Override
public boolean preHandle(HttpServletRequest request, public boolean preHandle(HttpServletRequest request,
HttpServletResponse response, Object handler) throws Exception { HttpServletResponse response, Object handler) throws Exception {
Map<String, String> headerMap = new HashMap<>();
Enumeration<String> enumeration = request.getHeaderNames();
while (enumeration.hasMoreElements()) {
String name = enumeration.nextElement();
String value = request.getHeader(name);
headerMap.put(name, value);
}
log.info("adminUserLoginInterceptor headerMap ={}", headerMap);
String uid = request.getHeader("uid"); String uid = request.getHeader("uid");
log.info("adminUserLoginInterceptor uid ={}", uid); log.info("adminUserLoginInterceptor uid ={}", uid);
if(uid == null){
uid = "grp.gyhtest1001@corp.netease.com";
}
AdminUserHolder.setUserName(uid); AdminUserHolder.setUserName(uid);
return true; return true;
} }
......
...@@ -15,7 +15,6 @@ import org.springframework.web.servlet.HandlerInterceptor; ...@@ -15,7 +15,6 @@ import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.netease.mail.yanxuan.change.common.bean.AdminUserHolder;
import com.netease.mail.yanxuan.change.common.bean.AjaxResult; import com.netease.mail.yanxuan.change.common.bean.AjaxResult;
import com.netease.mail.yanxuan.change.common.bean.RequestLocalBean; import com.netease.mail.yanxuan.change.common.bean.RequestLocalBean;
import com.netease.mail.yanxuan.change.common.bean.ResponseCodeEnum; import com.netease.mail.yanxuan.change.common.bean.ResponseCodeEnum;
......
...@@ -13,17 +13,21 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; ...@@ -13,17 +13,21 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
public class WebMvcConfig implements WebMvcConfigurer { public class WebMvcConfig implements WebMvcConfigurer {
@Autowired @Autowired
private AdminUserLoginInterceptor userLoginInterceptor; private UserInterceptor userInterceptor;
/** @Autowired
private AdminUserLoginInterceptor adminUserLoginInterceptor;
/**`
* 拦截器配置 * 拦截器配置
* *
* @param registry * @param registry
*/ */
@Override @Override
public void addInterceptors(InterceptorRegistry registry) { public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(userLoginInterceptor).addPathPatterns("/**").excludePathPatterns("/i/health") registry.addInterceptor(userInterceptor).addPathPatterns("/**").excludePathPatterns("/i/health")
.excludePathPatterns("/change/flow/getOperator", "/test/**"); .excludePathPatterns("/change/flow/getOperator", "/test/createToDo","/test/progressTodo","/test/submit");
registry.addInterceptor(adminUserLoginInterceptor).addPathPatterns("test/**");
} }
} }
...@@ -17,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -17,7 +17,6 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.github.pagehelper.PageInfo;
import com.netease.mail.yanxuan.change.biz.biz.ChangeFlowBiz; import com.netease.mail.yanxuan.change.biz.biz.ChangeFlowBiz;
import com.netease.mail.yanxuan.change.biz.config.TitleConfig; import com.netease.mail.yanxuan.change.biz.config.TitleConfig;
import com.netease.mail.yanxuan.change.biz.service.ChangeFlowService; import com.netease.mail.yanxuan.change.biz.service.ChangeFlowService;
...@@ -62,8 +61,8 @@ public class ChangeFlowController { ...@@ -62,8 +61,8 @@ public class ChangeFlowController {
* @return * @return
*/ */
@GetMapping("/detail") @GetMapping("/detail")
public AjaxResult<ChangeFlowVO> detail(@RequestParam Long id) { public AjaxResult<ChangeFlowVO> detail(@RequestParam Long flowId) {
return AjaxResult.success(changeFlowBiz.detail(id)); return AjaxResult.success(changeFlowBiz.detail(flowId));
} }
/** /**
......
...@@ -6,16 +6,11 @@ ...@@ -6,16 +6,11 @@
*/ */
package com.netease.mail.yanxuan.change.web.controller; package com.netease.mail.yanxuan.change.web.controller;
import java.util.List;
import com.netease.mail.yanxuan.change.integration.flow.supplier.FlowRpcSupplierInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; 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.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
...@@ -24,19 +19,10 @@ import com.netease.mail.yanxuan.change.biz.service.ChangeFlowService; ...@@ -24,19 +19,10 @@ import com.netease.mail.yanxuan.change.biz.service.ChangeFlowService;
import com.netease.mail.yanxuan.change.biz.service.rpc.TodoService; import com.netease.mail.yanxuan.change.biz.service.rpc.TodoService;
import com.netease.mail.yanxuan.change.biz.task.AutoSubmit; import com.netease.mail.yanxuan.change.biz.task.AutoSubmit;
import com.netease.mail.yanxuan.change.common.bean.AjaxResult; import com.netease.mail.yanxuan.change.common.bean.AjaxResult;
import com.netease.mail.yanxuan.change.common.bean.RequestLocalBean;
import com.netease.mail.yanxuan.change.common.bean.ResponseCode; import com.netease.mail.yanxuan.change.common.bean.ResponseCode;
import com.netease.mail.yanxuan.change.common.enums.ChangeFlowEnum; import com.netease.mail.yanxuan.change.common.enums.ChangeFlowEnum;
import com.netease.mail.yanxuan.change.dal.entity.ChangeRecord; import com.netease.mail.yanxuan.change.dal.entity.ChangeRecord;
import com.netease.mail.yanxuan.change.integration.flow.supplier.FlowRpcSupplierSendService;
import com.netease.mail.yanxuan.change.integration.flow.supplier.FlowRpcSupplierService;
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.req.SupplierSearchRemoteReq;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierGoodsInfoRsp;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierInfoRsp;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierSimpleRsp;
import com.netease.mail.yanxuan.change.integration.flow.supplier.rsp.SupplierUserRsp;
import com.netease.yanxuan.flowx.sdk.meta.controller.communal.AjaxResponse;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
...@@ -84,13 +70,9 @@ public class TestController { ...@@ -84,13 +70,9 @@ public class TestController {
return AjaxResult.success(); return AjaxResult.success();
} }
@Autowired @GetMapping("/getUid")
private FlowRpcSupplierInfoService supplierInfoService; public AjaxResult<String> getUid() {
return AjaxResult.success(RequestLocalBean.getUid());
@PostMapping("/test")
public AjaxResponse<List<SupplierUserRsp>> test(@RequestBody SupplierRelatedUserReq req) {
return supplierInfoService.querySupplierRelatedUser(req);
} }
} }
\ 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