|  | @@ -22,11 +22,14 @@ import com.ym.mec.common.service.impl.BaseServiceImpl;
 | 
	
		
			
				|  |  |  import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 | 
	
		
			
				|  |  |  import com.ym.mec.util.collection.MapUtil;
 | 
	
		
			
				|  |  |  import com.ym.mec.util.date.DateUtil;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  import org.apache.poi.ss.formula.functions.T;
 | 
	
		
			
				|  |  |  import org.slf4j.Logger;
 | 
	
		
			
				|  |  |  import org.slf4j.LoggerFactory;
 | 
	
		
			
				|  |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  import com.ym.mec.biz.dal.dao.ReplacementInstrumentActivityDao;
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |  import org.springframework.stereotype.Service;
 | 
	
		
			
				|  |  |  import org.springframework.transaction.annotation.Transactional;
 | 
	
		
			
				|  |  |  import org.springframework.util.CollectionUtils;
 | 
	
	
		
			
				|  | @@ -63,6 +66,9 @@ public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<In
 | 
	
		
			
				|  |  |      private SysUserCashAccountDetailService sysUserCashAccountDetailService;
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private SysMessageService sysMessageService;
 | 
	
		
			
				|  |  | +    
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private CooperationOrganService cooperationOrganService;
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      private final Logger logger = LoggerFactory.getLogger(this.getClass());
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -80,8 +86,16 @@ public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<In
 | 
	
		
			
				|  |  |          }
 | 
	
		
			
				|  |  |          replacementInstrumentActivity.setUserId(sysUser.getId());
 | 
	
		
			
				|  |  |          //如果用户是43分部,那么修改用户信息
 | 
	
		
			
				|  |  | +        if(sysUser.getOrganId() == 43){
 | 
	
		
			
				|  |  | +        	CooperationOrgan cooperationOrgan = cooperationOrganService.get(replacementInstrumentActivity.getCooperationOrganId());
 | 
	
		
			
				|  |  | +            if (cooperationOrgan != null) {
 | 
	
		
			
				|  |  | +            	sysUser.setOrganId(cooperationOrgan.getOrganId());
 | 
	
		
			
				|  |  | +            	sysUser.setUpdateTime(new Date());
 | 
	
		
			
				|  |  | +            	sysUserFeignService.updateSysUser(sysUser);
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          //如果提交过调查问卷,那么覆盖之前的记录
 | 
	
		
			
				|  |  | -        ReplacementInstrumentActivity activity = replacementInstrumentActivityDao.findByUserId(sysUser.getId());
 | 
	
		
			
				|  |  | +        ReplacementInstrumentActivity activity = replacementInstrumentActivityDao.findByUserId(replacementInstrumentActivity.getCooperationOrganId(), sysUser.getId());
 | 
	
		
			
				|  |  |          if (activity != null) {
 | 
	
		
			
				|  |  |              //覆盖之前的数据
 | 
	
		
			
				|  |  |              replacementInstrumentActivity.setId(activity.getId());
 | 
	
	
		
			
				|  | @@ -93,8 +107,8 @@ public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<In
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  | -    public ReplacementInstrumentActivity findByUserId(Integer userId) {
 | 
	
		
			
				|  |  | -        return replacementInstrumentActivityDao.findByUserId(userId);
 | 
	
		
			
				|  |  | +    public ReplacementInstrumentActivity findByUserId(Integer cooperationOrganId, Integer userId) {
 | 
	
		
			
				|  |  | +        return replacementInstrumentActivityDao.findByUserId(cooperationOrganId, userId);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |      @Override
 |