|
@@ -1042,6 +1042,38 @@ public class UseMoneyServiceImpl implements UseMoneyService {
|
|
|
@Override
|
|
|
public List<UseMoneyRespVO> getListByContractId(String contractId) {
|
|
|
List<UseMoneyDO> result = useMoneyDao.getListByContractId(contractId);
|
|
|
- return UseMoneyConvert.INSTANCE.convertList(result);
|
|
|
+ List<UseMoneyRespVO> resultList = UseMoneyConvert.INSTANCE.convertList(result);
|
|
|
+ resultList.forEach(useMoneyRespVO -> {
|
|
|
+ Integer isAgent = useMoneyRespVO.getIsAgent();
|
|
|
+ //不是代办项目
|
|
|
+ if (0 == isAgent) {
|
|
|
+ Project projectList = projectService.selectById(useMoneyRespVO.getProjectId());
|
|
|
+ //Project projectDO = projectList.stream().filter(project -> project.getId().equals(useMoneyRespVO.getProjectId())).findFirst().get();
|
|
|
+ if(projectList!=null){
|
|
|
+ useMoneyRespVO.setProjectName(projectList.getXmmc());
|
|
|
+ useMoneyRespVO.setProjectDeptName(projectList.getZrbm());
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ List<UseMoneyDetailDO> detailList=useMoneyDetailService.getListByUseMoeneyId(useMoneyRespVO.getId());
|
|
|
+ String xmmc="";
|
|
|
+ for(UseMoneyDetailDO detail:detailList){
|
|
|
+ if(detail.getProjectId()!=null){
|
|
|
+ Project projectList = projectService.selectById(detail.getProjectId());
|
|
|
+ if(projectList!=null){
|
|
|
+ xmmc+=","+projectList.getXmmc();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ useMoneyRespVO.setProjectName(xmmc.length() > 1 ? xmmc.substring(1) : xmmc);
|
|
|
+ }
|
|
|
+ Integer flowStatus = useMoneyRespVO.getFlowStatus();
|
|
|
+ if (FLOW_FINISHED == flowStatus) {
|
|
|
+ useMoneyRespVO.setStatus("已付");
|
|
|
+ }
|
|
|
+ if (FLOW_PAYMENT == flowStatus) {
|
|
|
+ useMoneyRespVO.setStatus("未付款");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return resultList;
|
|
|
}
|
|
|
}
|