| 
					
				 | 
			
			
				@ -4,6 +4,7 @@ package com.yihu.jw.hospital.prescription.service.entrance; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.fasterxml.jackson.core.type.TypeReference; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.fasterxml.jackson.databind.ObjectMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.dict.dao.DictHospitalDeptDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.dict.service.DictHospitalDeptService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.dict.DictHospitalDeptDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.hospital.mapping.HospitalDeptMappingDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.mapping.dao.HospitalDeptMappingDao; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -23,6 +24,7 @@ import org.springframework.core.io.ClassPathResource; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.core.io.Resource; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.stereotype.Service; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import javax.transaction.Transactional; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.io.BufferedReader; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.io.InputStream; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.io.InputStreamReader; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -37,6 +39,7 @@ import java.util.stream.Collectors; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 * Created by zdm on 2019/5/20. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@Service 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@Transactional 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				public class EntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    //门诊余额查询 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private static String BS15017="BS15017"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -71,7 +74,7 @@ public class EntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Value("${hospital.TargetSysCode}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private String targetSysCode; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private DictHospitalDeptDao DictHospitalDeptDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private DictHospitalDeptDao dictHospitalDeptDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 获取本地示例返参 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -703,7 +706,7 @@ public class EntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @org.springframework.transaction.annotation.Transactional(rollbackFor = Exception.class) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//    @org.springframework.transaction.annotation.Transactional(rollbackFor = Exception.class) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<DictHospitalDeptDO> MS02001(boolean demoFlag) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String fid=MS02001; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String resp=""; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -727,11 +730,16 @@ public class EntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String orgCode="350211A1002"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map<String,String> orgCodeMap=new HashMap<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //6总部7金榜8夏禾 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        orgCodeMap.put("6","350211A1002"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        orgCodeMap.put("6",orgCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        orgCodeMap.put("7",""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        orgCodeMap.put("8",""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //删除旧数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        DictHospitalDeptDao.deleteBySource(orgCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       List<String> strings=new ArrayList<>(orgCodeMap.values()) ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       for(String s:strings) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           if(StringUtils.isNotBlank(s)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               dictHospitalDeptDao.deleteByOrgCode(s); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for(Object object:jsonArray){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            hdmDo=new DictHospitalDeptDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            net.sf.json.JSONObject jsonObjectBody=(net.sf.json.JSONObject)object; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -742,6 +750,7 @@ public class EntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                hdmDo.setName(null==jsonObjectBody.get("Dept_Name")?"":jsonObjectBody.get("Dept_Name").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                hdmDo.setDeptTypeCode(deptTypeCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                hdmDo.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                DictHospitalDeptDao.save(hdmDo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                hospitalDeptMappingDOS.add(hdmDo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -773,8 +782,8 @@ public class EntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            hdmDo.setSource("1");*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        DictHospitalDeptDao.save(hospitalDeptMappingDOS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//        hospitalDeptMappingDao.save(hospitalDeptMappingDOS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        dictHospitalDeptDao.save(hospitalDeptMappingDOS); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return hospitalDeptMappingDOS; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 |