|
@ -24,6 +24,7 @@ import com.qs.serve.modules.tbs.entity.TbsCostApply; |
|
|
import com.qs.serve.modules.tbs.entity.bo.TbsAffairCommitBo; |
|
|
import com.qs.serve.modules.tbs.entity.bo.TbsAffairCommitBo; |
|
|
import com.qs.serve.modules.tbs.entity.vo.CtpAffairVo; |
|
|
import com.qs.serve.modules.tbs.entity.vo.CtpAffairVo; |
|
|
import com.qs.serve.task.SysTask; |
|
|
import com.qs.serve.task.SysTask; |
|
|
|
|
|
import org.jetbrains.annotations.NotNull; |
|
|
|
|
|
|
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
import java.util.stream.Collectors; |
|
|
import java.util.stream.Collectors; |
|
@ -165,9 +166,22 @@ public interface SeeYonOperationService extends SeeYonBaseService{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default R<List<CtpAffairVo>> pageAffairV2(String targetId,String targetCode){ |
|
|
default R<List<CtpAffairVo>> pageAffairV2(String targetId,String targetCode){ |
|
|
return null; |
|
|
boolean existFormId = checkSyFormIdIsNotNull(targetId); |
|
|
|
|
|
if (!existFormId){ |
|
|
|
|
|
return R.ok(new ArrayList<>()); |
|
|
|
|
|
} |
|
|
|
|
|
String templateCode = getTemplateCode(); |
|
|
|
|
|
R<List<CtpAffair>> syResult = getRequestService().commonListAffairsV2(targetId,targetCode,null,templateCode); |
|
|
|
|
|
List<CtpAffair> ctpAffairs = syResult.getData(); |
|
|
|
|
|
if(ctpAffairs.size()>0){ |
|
|
|
|
|
List<CtpAffairVo> result = getCtpAffairVos(ctpAffairs); |
|
|
|
|
|
return R.ok(result); |
|
|
|
|
|
} |
|
|
|
|
|
return R.ok(new ArrayList<>()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 审批列表(用于详情页) |
|
|
* 审批列表(用于详情页) |
|
|
* @param targetId |
|
|
* @param targetId |
|
@ -182,42 +196,53 @@ public interface SeeYonOperationService extends SeeYonBaseService{ |
|
|
R<List<CtpAffair>> syResult = getRequestService().commonListAffairs(targetId,null,templateCode); |
|
|
R<List<CtpAffair>> syResult = getRequestService().commonListAffairs(targetId,null,templateCode); |
|
|
List<CtpAffair> ctpAffairs = syResult.getData(); |
|
|
List<CtpAffair> ctpAffairs = syResult.getData(); |
|
|
if(ctpAffairs.size()>0){ |
|
|
if(ctpAffairs.size()>0){ |
|
|
DataAffairCommitMapper dataAffairCommitMapper = SpringUtils.getBean(DataAffairCommitMapper.class); |
|
|
List<CtpAffairVo> result = getCtpAffairVos(ctpAffairs); |
|
|
SysAttachMapper sysAttachMapper = SpringUtils.getBean(SysAttachMapper.class); |
|
|
return R.ok(result); |
|
|
List<DataAffairCommit> affairCommits = dataAffairCommitMapper.selectBatchIds(ctpAffairs.stream() |
|
|
} |
|
|
.map(CtpAffair::getAffairId).collect(Collectors.toList())); |
|
|
return R.ok(new ArrayList<>()); |
|
|
List<String> oaUserIds = ctpAffairs.stream().map(CtpAffair::getMemberId).collect(Collectors.toList()); |
|
|
} |
|
|
List<SysUser> userList = getSysUserService().listByOaMemberIds(oaUserIds); |
|
|
|
|
|
SysPostUserService postUserService = SpringUtils.getBean(SysPostUserService.class); |
|
|
/** |
|
|
List<String> userIds = userList.stream().map(SysUser::getId).collect(Collectors.toList()); |
|
|
* 通用的审批列表封装 |
|
|
List<SysPostUser> postUserList = postUserService.listByUserIds(userIds); |
|
|
* @param ctpAffairs |
|
|
Map<String,List<SysPostUser>> postMap = postUserList.stream().collect(Collectors.groupingBy(SysPostUser::getUserId)); |
|
|
* @return |
|
|
List<CtpAffairVo> result = new ArrayList<>(); |
|
|
*/ |
|
|
for (CtpAffair ctpAffair : ctpAffairs) { |
|
|
@NotNull |
|
|
CtpAffairVo ctpAffairVo = new CtpAffairVo(); |
|
|
default List<CtpAffairVo> getCtpAffairVos(List<CtpAffair> ctpAffairs) { |
|
|
ctpAffairVo.setAffairInfo(ctpAffair); |
|
|
DataAffairCommitMapper dataAffairCommitMapper = SpringUtils.getBean(DataAffairCommitMapper.class); |
|
|
for (SysUser user : userList) { |
|
|
SysAttachMapper sysAttachMapper = SpringUtils.getBean(SysAttachMapper.class); |
|
|
if(ctpAffair.getMemberId().equals(user.getSyUserId())){ |
|
|
List<DataAffairCommit> affairCommits = dataAffairCommitMapper.selectBatchIds(ctpAffairs.stream() |
|
|
ctpAffairVo.setUserInfo(user.toSysUserVo()); |
|
|
.map(CtpAffair::getAffairId).collect(Collectors.toList())); |
|
|
List<SysPostUser> postUsers = postMap.get(user.getId()); |
|
|
List<String> oaUserIds = ctpAffairs.stream().map(CtpAffair::getMemberId).collect(Collectors.toList()); |
|
|
ctpAffairVo.setUserPostList(postUsers); |
|
|
List<SysUser> userList = getSysUserService().listByOaMemberIds(oaUserIds); |
|
|
} |
|
|
SysPostUserService postUserService = SpringUtils.getBean(SysPostUserService.class); |
|
|
|
|
|
List<String> userIds = userList.stream().map(SysUser::getId).collect(Collectors.toList()); |
|
|
|
|
|
List<SysPostUser> postUserList = postUserService.listByUserIds(userIds); |
|
|
|
|
|
Map<String,List<SysPostUser>> postMap = postUserList.stream().collect(Collectors.groupingBy(SysPostUser::getUserId)); |
|
|
|
|
|
List<CtpAffairVo> result = new ArrayList<>(); |
|
|
|
|
|
for (CtpAffair ctpAffair : ctpAffairs) { |
|
|
|
|
|
CtpAffairVo ctpAffairVo = new CtpAffairVo(); |
|
|
|
|
|
ctpAffairVo.setAffairInfo(ctpAffair); |
|
|
|
|
|
for (SysUser user : userList) { |
|
|
|
|
|
if(ctpAffair.getMemberId().equals(user.getSyUserId())){ |
|
|
|
|
|
ctpAffairVo.setUserInfo(user.toSysUserVo()); |
|
|
|
|
|
List<SysPostUser> postUsers = postMap.get(user.getId()); |
|
|
|
|
|
ctpAffairVo.setUserPostList(postUsers); |
|
|
} |
|
|
} |
|
|
for (DataAffairCommit affairCommit : affairCommits) { |
|
|
} |
|
|
if(affairCommit.getId().equals(ctpAffair.getAffairId())){ |
|
|
for (DataAffairCommit affairCommit : affairCommits) { |
|
|
ctpAffairVo.setCommitInfo(affairCommit); |
|
|
if(affairCommit.getId().equals(ctpAffair.getAffairId())){ |
|
|
if(affairCommit.getAttachIds()!=null&&affairCommit.getAttachIds().length>0){ |
|
|
ctpAffairVo.setCommitInfo(affairCommit); |
|
|
ctpAffairVo.setAttachments( |
|
|
if(affairCommit.getAttachIds()!=null&&affairCommit.getAttachIds().length>0){ |
|
|
sysAttachMapper.selectBatchIds( |
|
|
ctpAffairVo.setAttachments( |
|
|
Arrays.asList(affairCommit.getAttachIds()))); |
|
|
sysAttachMapper.selectBatchIds( |
|
|
} |
|
|
Arrays.asList(affairCommit.getAttachIds()))); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
result.add(ctpAffairVo); |
|
|
|
|
|
} |
|
|
} |
|
|
return R.ok(result); |
|
|
result.add(ctpAffairVo); |
|
|
} |
|
|
} |
|
|
return R.ok(new ArrayList<>()); |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|