|
|
@ -1,17 +1,24 @@ |
|
|
|
package com.qs.serve.modules.seeyon; |
|
|
|
|
|
|
|
import com.qs.serve.common.config.properties.ProjectProperties; |
|
|
|
import com.qs.serve.common.model.dto.PageVo; |
|
|
|
import com.qs.serve.common.model.dto.R; |
|
|
|
import com.qs.serve.common.util.AuthContextUtils; |
|
|
|
import com.qs.serve.common.util.CollectionUtil; |
|
|
|
import com.qs.serve.common.util.JsonUtil; |
|
|
|
import com.qs.serve.common.util.ServletUtils; |
|
|
|
import com.qs.serve.controller.util.SyKeyLoginUtil; |
|
|
|
import com.qs.serve.modules.seeyon.entity.CtpAffair; |
|
|
|
import com.qs.serve.modules.seeyon.entity.bo.CheckTargetDTO; |
|
|
|
import com.qs.serve.modules.seeyon.entity.bo.SeeYonApproveQuery; |
|
|
|
import com.qs.serve.modules.seeyon.entity.vo.SeeYonApproveDataVo; |
|
|
|
import com.qs.serve.modules.seeyon.service.SeeYonRequestService; |
|
|
|
import com.qs.serve.modules.seeyon.service.impl.SeeYonRequestBaseService; |
|
|
|
import com.qs.serve.modules.sys.entity.SysUser; |
|
|
|
import com.qs.serve.modules.sys.service.SysUserService; |
|
|
|
import com.qs.serve.modules.tbs.common.TbsSeeYonConst; |
|
|
|
import com.qs.serve.modules.tbs.entity.TbsActivity; |
|
|
|
import com.qs.serve.modules.tbs.service.TbsActivityService; |
|
|
|
import com.qs.serve.modules.tbs.service.TbsCostApplyService; |
|
|
|
import com.qs.serve.modules.tzc.entity.TzcPolicy; |
|
|
|
import com.qs.serve.modules.tzc.service.TzcPolicyService; |
|
|
@ -19,10 +26,10 @@ import com.qs.serve.modules.vtb.entity.VtbVerification; |
|
|
|
import com.qs.serve.modules.vtb.service.VtbVerificationService; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.web.bind.annotation.GetMapping; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.bind.annotation.RestController; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import java.io.IOException; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
/** |
|
|
@ -37,10 +44,13 @@ import java.util.List; |
|
|
|
public class SeeYonController { |
|
|
|
|
|
|
|
private SeeYonRequestBaseService seeYonRequestBaseService; |
|
|
|
private SeeYonRequestService seeYonRequestService; |
|
|
|
private SysUserService sysUserService; |
|
|
|
private TbsCostApplyService costApplyService; |
|
|
|
private VtbVerificationService verificationService; |
|
|
|
private TzcPolicyService policyService; |
|
|
|
private ProjectProperties projectProperties; |
|
|
|
private TbsActivityService activityService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 我的审批列表 |
|
|
@ -56,6 +66,86 @@ public class SeeYonController { |
|
|
|
return listAllCha(query); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 重定向到审批页面 |
|
|
|
* @param targetDTO |
|
|
|
* @param response |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("/redirectToCheckPage") |
|
|
|
public R<String> redirectToCheckPage(@RequestBody CheckTargetDTO targetDTO, HttpServletResponse response){ |
|
|
|
String targetCode = targetDTO.getTargetCode(); |
|
|
|
String targetId = targetDTO.getTargetId(); |
|
|
|
SysUser sysUser = sysUserService.getById(AuthContextUtils.getSysUserId()); |
|
|
|
sysUser.checkSyAccount(); |
|
|
|
R<List<CtpAffair>> result = seeYonRequestService.commonListAffairs(targetId,null,targetCode); |
|
|
|
String jumpUrl = "404"; |
|
|
|
for (CtpAffair affair : result.getData()) { |
|
|
|
//判断是否当前用户
|
|
|
|
if(!affair.getMemberId().equals(sysUser.getSyUserId())){ |
|
|
|
continue; |
|
|
|
} |
|
|
|
//流程未完成
|
|
|
|
if(affair.getFinishedflag().equals(0)){ |
|
|
|
if(affair.getState().equals(3)){ |
|
|
|
//待审
|
|
|
|
if(targetCode.equals(TbsSeeYonConst.CostCheckConf.Code())){ |
|
|
|
VtbVerification object = verificationService.getById(targetId); |
|
|
|
jumpUrl = SyKeyLoginUtil.getPreCheckUrl4Verification(object.getCostApplyId(),object.getActivityId(),object.getId(),affair.getAffairId()); |
|
|
|
}else { |
|
|
|
jumpUrl = SyKeyLoginUtil.getPreCheckUrl(targetCode,targetId,affair.getAffairId()); |
|
|
|
} |
|
|
|
}else if (affair.getState().equals(4)){ |
|
|
|
//已阅或已提交
|
|
|
|
if(targetCode.equals(TbsSeeYonConst.CostCheckConf.Code())){ |
|
|
|
jumpUrl = SyKeyLoginUtil.getCheckedDetailUrl(targetCode,targetId); |
|
|
|
}else { |
|
|
|
VtbVerification object = verificationService.getById(targetId); |
|
|
|
jumpUrl = SyKeyLoginUtil.getCheckedDetailUrl4Verification(object.getCostApplyId(),object.getActivityId(),object.getId()); |
|
|
|
} |
|
|
|
}else if (affair.getState().equals(2)){ |
|
|
|
//发起
|
|
|
|
if(targetCode.equals(TbsSeeYonConst.CostCheckConf.Code())){ |
|
|
|
VtbVerification object = verificationService.getById(targetId); |
|
|
|
jumpUrl = SyKeyLoginUtil.getMyDetailUrl(TbsSeeYonConst.CostApplyConf.Code(),object.getCostApplyId()+""); |
|
|
|
}else { |
|
|
|
jumpUrl = SyKeyLoginUtil.getMyDetailUrl(targetCode,targetId); |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
if (affair.getState().equals(2)){ |
|
|
|
//发起
|
|
|
|
if(targetCode.equals(TbsSeeYonConst.CostCheckConf.Code())){ |
|
|
|
VtbVerification object = verificationService.getById(targetId); |
|
|
|
jumpUrl = SyKeyLoginUtil.getMyDetailUrl(TbsSeeYonConst.CostApplyConf.Code(),object.getCostApplyId()+""); |
|
|
|
}else { |
|
|
|
jumpUrl = SyKeyLoginUtil.getMyDetailUrl(targetCode,targetId); |
|
|
|
} |
|
|
|
}else { |
|
|
|
//已阅或已提交
|
|
|
|
if(targetCode.equals(TbsSeeYonConst.CostCheckConf.Code())){ |
|
|
|
jumpUrl = SyKeyLoginUtil.getCheckedDetailUrl(targetCode,targetId); |
|
|
|
}else { |
|
|
|
VtbVerification object = verificationService.getById(targetId); |
|
|
|
jumpUrl = SyKeyLoginUtil.getCheckedDetailUrl4Verification(object.getCostApplyId(),object.getActivityId(),object.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
String token = ServletUtils.getAuthToken(); |
|
|
|
String fontUrl = "/#/jump?code=001&token="+token+"&jumpTo="+jumpUrl; |
|
|
|
//String fontUrl = projectProperties.getWebUrl() + "/#/jump?code=001&token="+token+"&jumpTo="+jumpUrl;
|
|
|
|
log.warn("fontUrl:{}",fontUrl); |
|
|
|
/*try { |
|
|
|
response.sendRedirect(fontUrl); |
|
|
|
} catch (IOException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
}*/ |
|
|
|
return R.ok(fontUrl,"ok"); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 统计未完成 |
|
|
|
* @param query |
|
|
|