|  | @@ -15,6 +15,7 @@ import cn.hnthyy.thmz.mapper.his.mz.MzfzPatientOrderMapper;
 | 
	
		
			
				|  |  |  import cn.hnthyy.thmz.mapper.his.mz.MzyReqrecMapper;
 | 
	
		
			
				|  |  |  import cn.hnthyy.thmz.mapper.thmz.ClinicMapper;
 | 
	
		
			
				|  |  |  import cn.hnthyy.thmz.mapper.thmz.TurnToConsultationMapper;
 | 
	
		
			
				|  |  | +import cn.hnthyy.thmz.mapper.thmz.UserDeptRelationMapper;
 | 
	
		
			
				|  |  |  import cn.hnthyy.thmz.service.his.mz.EmployeeService;
 | 
	
		
			
				|  |  |  import cn.hnthyy.thmz.service.his.mz.MzVisitTableService;
 | 
	
		
			
				|  |  |  import cn.hnthyy.thmz.service.thmz.ClinicService;
 | 
	
	
		
			
				|  | @@ -45,6 +46,9 @@ public class ClinicServiceImpl implements ClinicService {
 | 
	
		
			
				|  |  |      @SuppressWarnings("all")
 | 
	
		
			
				|  |  |      @Autowired
 | 
	
		
			
				|  |  |      private TurnToConsultationMapper turnToConsultationMapper;
 | 
	
		
			
				|  |  | +    @SuppressWarnings("all")
 | 
	
		
			
				|  |  | +    @Autowired
 | 
	
		
			
				|  |  | +    private UserDeptRelationMapper userDeptRelationMapper;
 | 
	
		
			
				|  |  |      @Override
 | 
	
		
			
				|  |  |      public int saveClinic(Clinic clinic) {
 | 
	
		
			
				|  |  |          //存在就不插入
 | 
	
	
		
			
				|  | @@ -139,6 +143,13 @@ public class ClinicServiceImpl implements ClinicService {
 | 
	
		
			
				|  |  |          updateMzfzPatientOrder.setSerialNo(Integer.valueOf(serialNo));
 | 
	
		
			
				|  |  |          updateMzfzPatientOrder.setStatusFlag(MzfzStatusEnum.IN_CLINIC.code);
 | 
	
		
			
				|  |  |          updateMzfzPatientOrder.setDoctorCode(tokenUser.getUserIdCode());
 | 
	
		
			
				|  |  | +        if(Constants.JY_EXEC_CODE.equals(mzfzPatientOrder.getDeptCode())){
 | 
	
		
			
				|  |  | +            //简易门诊将医生的科室设置到分诊记录
 | 
	
		
			
				|  |  | +            List<String> deptNos=userDeptRelationMapper.selectAllByUserIdCode(tokenUser.getUserIdCode());
 | 
	
		
			
				|  |  | +            if(deptNos!=null && deptNos.size()>0){
 | 
	
		
			
				|  |  | +                updateMzfzPatientOrder.setDeptCode(deptNos.get(0));
 | 
	
		
			
				|  |  | +            }
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  |          return mzfzPatientOrderMapper.updateMzfzPatientOrder(updateMzfzPatientOrder);
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  
 |