|  | @@ -168,7 +168,7 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	@Override
 | 
	
		
			
				|  |  |  	@Transactional(rollbackFor = Exception.class)
 | 
	
		
			
				|  |  | -	public void addExamOrganizations(List<ExamOrganizationRelation> organizationRelations) {
 | 
	
		
			
				|  |  | +	public void addExamOrganizations(List<ExamOrganizationRelation> organizationRelations, Integer selfOrganId) {
 | 
	
		
			
				|  |  |  		if(CollectionUtils.isEmpty(organizationRelations)){
 | 
	
		
			
				|  |  |  			throw new BizException("请指定考级项目");
 | 
	
		
			
				|  |  |  		}
 | 
	
	
		
			
				|  | @@ -183,6 +183,11 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 | 
	
		
			
				|  |  |  			throw new BizException("当前状态暂不可添加合作单位");
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +		ExamOrganStatisticsDto examOrganizationRelation = examOrganizationRelationDao.getExamOrganizationRelation(examinationBasic.getId(), selfOrganId);
 | 
	
		
			
				|  |  | +		if(Objects.isNull(examOrganizationRelation)){
 | 
	
		
			
				|  |  | +			throw new BizException("操作异常");
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  		Set<Integer> organIdsWithExam = examOrganizationRelationDao.getOrganIdsWithExam(examinationBasic.getId().intValue());
 | 
	
		
			
				|  |  |  		List<Integer> organIds = organizationRelations.stream().filter(e->Objects.nonNull(e.getOrganId())).map(ExamOrganizationRelation::getOrganId).collect(Collectors.toList());
 | 
	
		
			
				|  |  |  		if(organIds.size()!=organizationRelations.size()){
 | 
	
	
		
			
				|  | @@ -215,6 +220,10 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 | 
	
		
			
				|  |  |  				throw new BizException("参数错误");
 | 
	
		
			
				|  |  |  			}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | +			if(examOrganizationRelation.getIsAllowArrangeExam()==0){
 | 
	
		
			
				|  |  | +				og.setIsAllowArrangeExam(0);
 | 
	
		
			
				|  |  | +			}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  			og.setTenantId(TenantContextHolder.getTenantId());
 | 
	
		
			
				|  |  |  			og.setExaminationBasicId(examinationBasic.getId().intValue());
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -319,8 +328,8 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 | 
	
		
			
				|  |  |  			days.add(today.toString());
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		for (String day : days) {
 | 
	
		
			
				|  |  | -			dayTransAmount.put(day, BigDecimal.valueOf(Math.random()*100));
 | 
	
		
			
				|  |  | -			dayPaymentAmount.put(day, BigDecimal.valueOf(Math.random()*100));
 | 
	
		
			
				|  |  | +			dayTransAmount.put(day, BigDecimal.valueOf((long) (Math.random()*100),2));
 | 
	
		
			
				|  |  | +			dayPaymentAmount.put(day, BigDecimal.valueOf((long) (Math.random()*100),2));
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  |  		examOrganStatistics.setDayTransAmount(dayTransAmount);
 | 
	
		
			
				|  |  |  		examOrganStatistics.setDayPaymentAmount(dayPaymentAmount);
 | 
	
	
		
			
				|  | @@ -329,7 +338,7 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  	@Override
 | 
	
		
			
				|  |  | -	public PageInfo<Organization> queryUnRelatedOrgans(ExamOrganizationRelationQueryInfo queryInfo) {
 | 
	
		
			
				|  |  | +	public Map<String, Object> queryUnRelatedOrgans(ExamOrganizationRelationQueryInfo queryInfo) {
 | 
	
		
			
				|  |  |  		PageInfo<Organization> pageInfo = new PageInfo<>(queryInfo.getPage(), queryInfo.getRows());
 | 
	
		
			
				|  |  |  		Map<String, Object> params = new HashMap<String, Object>();
 | 
	
		
			
				|  |  |  		MapUtil.populateMap(params, queryInfo);
 | 
	
	
		
			
				|  | @@ -344,7 +353,15 @@ public class ExamOrganizationRelationServiceImpl extends BaseServiceImpl<Long, E
 | 
	
		
			
				|  |  |  			params.put("offset", pageInfo.getOffset());
 | 
	
		
			
				|  |  |  			dataList = examOrganizationRelationDao.queryUnRelatedOrgans(params);
 | 
	
		
			
				|  |  |  		}
 | 
	
		
			
				|  |  | +		ExamOrganStatisticsDto examOrganizationRelation = examOrganizationRelationDao.getExamOrganizationRelation(queryInfo.getExamId().longValue(), queryInfo.getOrganId());
 | 
	
		
			
				|  |  |  		pageInfo.setRows(dataList);
 | 
	
		
			
				|  |  | -		return pageInfo;
 | 
	
		
			
				|  |  | +		Map<String, Object> result=new HashMap<>();
 | 
	
		
			
				|  |  | +		result.put("pageInfo", pageInfo);
 | 
	
		
			
				|  |  | +		if(Objects.nonNull(examOrganizationRelation)){
 | 
	
		
			
				|  |  | +			result.put("isAllowArrangeExam",examOrganizationRelation.getIsAllowArrangeExam());
 | 
	
		
			
				|  |  | +		}else{
 | 
	
		
			
				|  |  | +			result.put("isAllowArrangeExam",0);
 | 
	
		
			
				|  |  | +		}
 | 
	
		
			
				|  |  | +		return result;
 | 
	
		
			
				|  |  |  	}
 | 
	
		
			
				|  |  |  }
 |