|
|
@ -250,38 +250,34 @@ public class TbsCostApplyController { |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@GetMapping("/ListAffairs") |
|
|
|
public R<PageVo<CtpAffairVo>> pageMemberAffair(Long costApplyId){ |
|
|
|
public R<List<CtpAffairVo>> pageMemberAffair(Long costApplyId){ |
|
|
|
SysUser sysUser = sysUserService.getById(AuthContextUtils.getSysUserId()); |
|
|
|
if(!StringUtils.hasText(sysUser.getSyUserId())||!StringUtils.hasText(sysUser.getSyAccount())){ |
|
|
|
return R.error("当前账号未绑定致远用户信息"); |
|
|
|
} |
|
|
|
TbsCostApply costApplyParam = tbsCostApplyService.getById(costApplyId); |
|
|
|
CtpAffairQo param = new CtpAffairQo(); |
|
|
|
param.setMemberId(sysUser.getSyUserId()); |
|
|
|
param.setFormMainId(costApplyParam.getSyFormId()); |
|
|
|
param.setTemplateCodes(Arrays.asList(TbsSeeYonConst.COST_APPLY_FORM)); |
|
|
|
R<PageVo<CtpAffair>> syResult = seeYonService.pageMemberAffair(param); |
|
|
|
PageVo<CtpAffair> pageVo = syResult.getData(); |
|
|
|
List<CtpAffair> ctpAffairs = pageVo.getList(); |
|
|
|
R<List<CtpAffair>> syResult = seeYonService.listFormAffair(param); |
|
|
|
List<CtpAffair> ctpAffairs = syResult.getData(); |
|
|
|
if(ctpAffairs.size()>0){ |
|
|
|
List<String> costApplyIds = ctpAffairs.stream().map(CtpAffair::getCostApplyId).collect(Collectors.toList()); |
|
|
|
List<TbsCostApply> costApplyList = tbsCostApplyService.listByIds(costApplyIds); |
|
|
|
List<String> oaUserIds = ctpAffairs.stream().map(CtpAffair::getMemberId).collect(Collectors.toList()); |
|
|
|
List<SysUser> userList = sysUserService.listByOaMemberIds(oaUserIds); |
|
|
|
List<CtpAffairVo> result = new ArrayList<>(); |
|
|
|
for (CtpAffair ctpAffair : ctpAffairs) { |
|
|
|
CtpAffairVo ctpAffairVo = new CtpAffairVo(); |
|
|
|
for (TbsCostApply costApply : costApplyList) { |
|
|
|
if(costApply.getId().toString().equals(ctpAffair.getCostApplyId())){ |
|
|
|
ctpAffairVo.setCostApply(costApply); |
|
|
|
break; |
|
|
|
ctpAffairVo.setAffairInfo(ctpAffair); |
|
|
|
for (SysUser user : userList) { |
|
|
|
if(ctpAffair.getMemberId().equals(user.getSyUserId())){ |
|
|
|
ctpAffairVo.setUserInfo(user.toSysUserVo()); |
|
|
|
} |
|
|
|
} |
|
|
|
ctpAffairVo.setAffairInfo(ctpAffair); |
|
|
|
result.add(ctpAffairVo); |
|
|
|
} |
|
|
|
PageVo<CtpAffairVo> costApplyPageVo = PageVo.initNewList(pageVo,result); |
|
|
|
return R.ok(costApplyPageVo); |
|
|
|
return R.ok(result); |
|
|
|
} |
|
|
|
return R.byEmptyList(); |
|
|
|
return R.ok(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -307,6 +303,8 @@ public class TbsCostApplyController { |
|
|
|
PageVo<CtpAffair> pageVo = syResult.getData(); |
|
|
|
List<CtpAffair> ctpAffairs = pageVo.getList(); |
|
|
|
if(ctpAffairs.size()>0){ |
|
|
|
List<String> oaUserIds = ctpAffairs.stream().map(CtpAffair::getMemberId).collect(Collectors.toList()); |
|
|
|
List<SysUser> userList = sysUserService.listByOaMemberIds(oaUserIds); |
|
|
|
List<String> costApplyIds = ctpAffairs.stream().map(CtpAffair::getCostApplyId).collect(Collectors.toList()); |
|
|
|
List<TbsCostApply> costApplyList = tbsCostApplyService.listByIds(costApplyIds); |
|
|
|
List<CtpAffairVo> result = new ArrayList<>(); |
|
|
@ -318,6 +316,11 @@ public class TbsCostApplyController { |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
for (SysUser user : userList) { |
|
|
|
if(ctpAffair.getMemberId().equals(user.getSyUserId())){ |
|
|
|
ctpAffairVo.setUserInfo(user.toSysUserVo()); |
|
|
|
} |
|
|
|
} |
|
|
|
ctpAffairVo.setAffairInfo(ctpAffair); |
|
|
|
result.add(ctpAffairVo); |
|
|
|
} |
|
|
|