| 
					
				 | 
			
			
				@ -38,6 +38,7 @@ import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.rm.iot.IotRequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.common.IdCardUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.date.DateUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.http.HttpClientUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.utils.StringUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.utils.hibernate.HibenateUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.utils.network.HttpResponse; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -72,6 +73,8 @@ public class YkyyEntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private final static String updateUrl="http://192.168.20.55:10023/ykyy/updateBySql"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private final static String updateEntityUrl="http://192.168.20.55:10023/ykyy/update"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private final static String orgCode ="350211A5004"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private final static String orgName ="厦门大学附属厦门眼科中心"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -103,9 +106,6 @@ public class YkyyEntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private PrescriptionDao prescriptionDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private PrescriptionInfoDao prescriptionInfoDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private BaseEvaluateScoreDao baseEvaluateScoreDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -116,11 +116,14 @@ public class YkyyEntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private HibenateUtils hibenateUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private ObjectMapper objectMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private HttpClientUtil httpClientUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private YkDictIcd10Dao ykDictIcd10Dao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private PrescriptionInfoDao prescriptionInfoDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return hibenateUtils.createSQLQuery(sql,params,page,size); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -131,8 +134,8 @@ public class YkyyEntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        hibenateUtils.save(object); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void update(String id,Integer status){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        hibenateUtils.update(id,status); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void update(Object object){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        hibenateUtils.update(object); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void updateBySql(String sql){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -439,6 +442,130 @@ public class YkyyEntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return "success"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String updateYkTDoctor()throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String response=""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String url = "http://www.yanketong.com:133/api/doc_jkzl/doctor_list_had_bind_account?hospital_code=sb&page=1"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        response = httpClientUtil.get(url,"GBK"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info("response:"+response); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject rs = JSON.parseObject(response); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer status = rs.getInteger("code"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(status!=null&&status == 200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject object = rs.getJSONObject("data"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONArray array = object.getJSONArray("list"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("doctor size:"+array.size()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(array!=null&&array.size()>0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                for (int i = 0; i < array.size(); i++) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    JSONObject doctorJson = array.getJSONObject(i); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    String idcard = doctorJson.getString("idcard"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    //过滤身份证脏数据 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if(idcard.length()>=15){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        List<BaseDoctorDO> doctorDOs = baseDoctorDao.findByIdcard(idcard); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if(doctorDOs!=null&&doctorDOs.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            BaseDoctorDO doctor = doctorDOs.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String salt = randomString(5); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String pw = idcard.substring(idcard.length() - 6); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setPassword(MD5.md5Hex(pw + "{" + salt + "}")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setSalt(salt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setJobTitleCode(doctorJson.getString("jobtitlecode")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setJobTitleName(doctorJson.getString("jobTitleName")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                            doctor.setExpertise(doctorJson.getString("expertise")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                            doctor.setIntroduce(doctorJson.getString("introduce")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                            doctor.setMobile(doctorJson.getString("mobile")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            BaseDoctorDO temp = baseDoctorDao.save(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            List<BaseDoctorHospitalDO> hospitalDOs = baseDoctorHospitalDao.findByOrgCodeAndDeptCodeAndDoctorCode(orgCode,doctorJson.getString("dept"),doctor.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            if(hospitalDOs!=null&&hospitalDOs.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                //机构信息部门信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                BaseDoctorHospitalDO hospitalDO = hospitalDOs.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                hospitalDO.setDeptCode(doctorJson.getString("dept")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                hospitalDO.setDeptName(doctorJson.getString("deptName")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                hospitalDO.setDel("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                baseDoctorHospitalDao.save(hospitalDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            //新增医生 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            BaseDoctorDO doctor = new BaseDoctorDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setName(doctorJson.getString("name")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setIdcard(idcard); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(idcard))); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setBirthday(IdCardUtil.getBirthdayForIdcard(idcard)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setProvinceCode("350000"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setProvinceName("福建省"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setTownCode("350203"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setTownName("思明区"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setCityCode("350200"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setCityName("厦门市"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                            doctor.setExpertise(doctorJson.getString("expertise")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                            doctor.setIntroduce(doctorJson.getString("introduce")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//                            doctor.setMobile(doctorJson.getString("mobile")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            //认证信息设置 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String salt = randomString(5); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String pw = idcard.substring(idcard.length() - 6); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setPassword(MD5.md5Hex(pw + "{" + salt + "}")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setSalt(salt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setDel("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setEnabled(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setLocked(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setJobTitleCode(doctorJson.getString("jobtitlecode")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctor.setJobTitleName(doctorJson.getString("jobTitleName")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            BaseDoctorDO temp = baseDoctorDao.save(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            //机构信息部门信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            BaseDoctorHospitalDO hospitalDO = new BaseDoctorHospitalDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            hospitalDO.setDoctorCode(temp.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            hospitalDO.setOrgCode(orgCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            hospitalDO.setOrgName(orgName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            hospitalDO.setDeptCode(doctorJson.getString("dept")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            hospitalDO.setDeptName(doctorJson.getString("deptName")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            hospitalDO.setDel("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            baseDoctorHospitalDao.save(hospitalDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            //保存角色 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            BaseDoctorRoleDO role = new BaseDoctorRoleDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            role.setDoctorCode(temp.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            role.setRoleCode("specialist"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            baseDoctorRoleDao.save(role); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            //保存mapping 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            DoctorMappingDO mappingDO = new DoctorMappingDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            mappingDO.setIdcard(idcard); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            mappingDO.setDoctor(temp.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            mappingDO.setDoctorName(temp.getName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            mappingDO.setOrgCode(orgCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            mappingDO.setOrgName(orgName); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            mappingDO.setMappingCode(doctorJson.getString("code")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            mappingDO.setMappingName(temp.getName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            mappingDO.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            doctorMappingDao.save(mappingDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return "success"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String randomString(int length) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        StringBuffer buffer = new StringBuffer(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1052,6 +1179,12 @@ public class YkyyEntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                hlwCf01DO.setSJLY(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                hlwCf01DO.setJZXH(Integer.parseInt(wlyyPrescriptionVO.getAdmNo())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				               /* hibenateUtils.save(hlwCf01DO);*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (StringUtils.isNoneBlank(wlyyPrescriptionVO.getRealOrder())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    hlwCf01DO.setCFSB(Integer.parseInt(wlyyPrescriptionVO.getRealOrder())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (StringUtils.isNoneBlank(wlyyPrescriptionVO.getOriginRealOrder())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    hlwCf01DO.setCFHM(wlyyPrescriptionVO.getOriginRealOrder()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String jsonString = JSONObject.toJSONString(hlwCf01DO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                Map<String,Object> params = new HashedMap(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1062,28 +1195,44 @@ public class YkyyEntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 {"message":null,"status":200,"obj":{"cfhm":1898356,"cfsb":5390518}} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                HttpResponse response = HttpUtils.doGet(saveUrl,params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String cfsb = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (response.getStatus()==200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    logger.info("content"+response.getContent()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    String content = response.getContent(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    JSONObject jsonObject = JSONObject.parseObject(content); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    JSONObject object = jsonObject.getJSONObject("obj"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (object!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        cfsb = object.getString("cfsb"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        logger.info("kaishi=========="+cfsb); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            wlyyPrescriptionDO.setRealOrder(cfsb); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            prescriptionDao.save(wlyyPrescriptionDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String cfhm = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (!StringUtils.isNoneBlank(wlyyPrescriptionVO.getRealOrder())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    HttpResponse response = HttpUtils.doGet(saveUrl,params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (response.getStatus()==200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        logger.info("content"+response.getContent()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        String content = response.getContent(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        JSONObject jsonObject = JSONObject.parseObject(content); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        JSONObject object = jsonObject.getJSONObject("obj"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (object!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            cfsb = object.getString("cfsb"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            cfhm = object.getString("cfhm"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            logger.info("kaishi=========="+cfsb); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                WlyyPrescriptionDO wlyyPrescriptionDO = wlyyPrescriptionDOS.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                wlyyPrescriptionDO.setRealOrder(cfsb); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                wlyyPrescriptionDO.setOriginRealOrder(cfhm); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                prescriptionDao.save(wlyyPrescriptionDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    logger.info("表HLW_CF01同步成功!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        logger.info("表HLW_CF01同步成功!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        logger.info("表HLW_CF01同步失败!"+response.getErrorMsg()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    logger.info("表HLW_CF01同步失败!"+response.getErrorMsg()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    cfsb = wlyyPrescriptionVO.getRealOrder(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    HttpResponse response = HttpUtils.doGet(updateEntityUrl,params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (response.getStatus()==200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        logger.info("content"+response.getContent()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        logger.info("表HLW_CF01更新成功!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        logger.info("表HLW_CF01更新失败!"+response.getErrorMsg()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                logger.info("处方:"+cfsb); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (StringUtils.isEmpty(cfsb)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    throw new Exception("添加失败"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1113,6 +1262,9 @@ public class YkyyEntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    hlwCf02DO.setGYTJ(wlyyPrescriptionInfoVO.getYpyf()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    hlwCf02DO.setPSPB(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    hlwCf02DO.setYYTS(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (wlyyPrescriptionInfoVO.getHisCode()!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        hlwCf02DO.setSBXH(wlyyPrescriptionInfoVO.getHisCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    /*hlwCf02DO.setYPZH(Integer.parseInt(wlyyPrescriptionInfoVO.getFrequency()));*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    hlwCf02DO.setYFGG(wlyyPrescriptionInfoVO.getSpecification()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                  /*  hibenateUtils.save(hlwCf02DO);*/ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1122,12 +1274,37 @@ public class YkyyEntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    params1.put("json",jsonString1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    params1.put("table","HLW_CF02"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    logger.info("HLW_CF02:"+jsonString1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    HttpResponse response1 = HttpUtils.doGet(saveUrl,params1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (response1.getStatus()==200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        logger.info("表HLW_CF02同步成功!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (wlyyPrescriptionInfoVO.getHisCode()==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        HttpResponse response1 = HttpUtils.doGet(saveUrl,params1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        Integer sbxh = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (response1.getStatus()==200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            logger.info("content"+response1.getContent()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String content = response1.getContent(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            JSONObject jsonObject = JSONObject.parseObject(content); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            JSONObject object = jsonObject.getJSONObject("obj"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            if (object!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                sbxh = object.getInteger("sbxh"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                logger.info("kaishi=========="+cfsb); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                WlyyPrescriptionInfoDO wlyyPrescriptionInfoDO = prescriptionInfoDao.findOne(wlyyPrescriptionInfoVO.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                if (wlyyPrescriptionInfoDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    wlyyPrescriptionInfoDO.setHisCode(sbxh); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    prescriptionInfoDao.save(wlyyPrescriptionInfoDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            logger.info("表HLW_CF02同步成功!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            logger.info("表HLW_CF02同步失败!"+response1.getErrorMsg()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        logger.info("表HLW_CF02同步失败!"+response1.getErrorMsg()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        HttpResponse response1 = HttpUtils.doGet(updateEntityUrl,params1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (response1.getStatus()==200){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            logger.info("content"+response1.getContent()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            logger.info("表HLW_CF02更新成功!"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            logger.info("表HLW_CF02更新失败!"+response1.getErrorMsg()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    }catch (Exception e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        e.getMessage(); 
			 |