|  | @ -9457,106 +9457,178 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |             for (BaseDoctorDO doctorDO:doctorDOList){
 | 
	
		
			
				|  |  |                 String yktDoctor = null;
 | 
	
		
			
				|  |  |                 DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctorDO.getId());
 | 
	
		
			
				|  |  |                 String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
 | 
	
		
			
				|  |  |                 com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(doctorResponse);
 | 
	
		
			
				|  |  |                 if (jsonObject.getInteger("code")==200){
 | 
	
		
			
				|  |  |                     com.alibaba.fastjson.JSONArray array1 = jsonObject.getJSONArray("data");
 | 
	
		
			
				|  |  |                     if (array1!=null&&array1.size()!=0){
 | 
	
		
			
				|  |  |                         yktDoctor=array1.getJSONObject(0).getString("DOCTORUSERID");
 | 
	
		
			
				|  |  |                 if (doctorMappingDO!=null){
 | 
	
		
			
				|  |  |                     String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
 | 
	
		
			
				|  |  |                     com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(doctorResponse);
 | 
	
		
			
				|  |  |                     if (jsonObject.getInteger("code")==200){
 | 
	
		
			
				|  |  |                         com.alibaba.fastjson.JSONArray array1 = jsonObject.getJSONArray("data");
 | 
	
		
			
				|  |  |                         if (array1!=null&&array1.size()!=0){
 | 
	
		
			
				|  |  |                             yktDoctor=array1.getJSONObject(0).getString("DOCTORUSERID");
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 if (StringUtils.isNoneBlank(yktDoctor)){
 | 
	
		
			
				|  |  |                     doctorDO.setYktDoctorId(yktDoctor);
 | 
	
		
			
				|  |  |                     //图文
 | 
	
		
			
				|  |  |                     String twResponse =ykyyService.GetVasPriceByTypeForJkzl(yktDoctor,1);
 | 
	
		
			
				|  |  |                     com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(twResponse);
 | 
	
		
			
				|  |  |                     if (object.getInteger("code")==10000){
 | 
	
		
			
				|  |  |                         if (object.containsKey("value")){
 | 
	
		
			
				|  |  |                             com.alibaba.fastjson.JSONObject object1 = object.getJSONObject("value");
 | 
	
		
			
				|  |  |                             Integer twPrcie=object1.getInteger("price");
 | 
	
		
			
				|  |  |                             Double twPrcie1 = Double.parseDouble(twPrcie+"");
 | 
	
		
			
				|  |  |                             WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByReqFee(twPrcie1);
 | 
	
		
			
				|  |  |                             if (chargeDictDO!=null){
 | 
	
		
			
				|  |  |                                 chargeDictDO = new WlyyChargeDictDO();
 | 
	
		
			
				|  |  |                                 chargeDictDO.setCreateTime(new Date());
 | 
	
		
			
				|  |  |                                 chargeDictDO.setReqFee(twPrcie1);
 | 
	
		
			
				|  |  |                                 chargeDictDO.setChargeType(twPrcie+"");
 | 
	
		
			
				|  |  |                                 chargeDictDO.setChargeName(twPrcie+"");
 | 
	
		
			
				|  |  |                                 chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
 | 
	
		
			
				|  |  |                     if (StringUtils.isNoneBlank(yktDoctor)){
 | 
	
		
			
				|  |  |                         doctorDO.setYktDoctorId(yktDoctor);
 | 
	
		
			
				|  |  |                         //图文
 | 
	
		
			
				|  |  |                         String twResponse =ykyyService.GetVasPriceByTypeForJkzl(yktDoctor,1);
 | 
	
		
			
				|  |  |                         com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(twResponse);
 | 
	
		
			
				|  |  |                         if (object.getInteger("code")==10000){
 | 
	
		
			
				|  |  |                             if (object.containsKey("value")){
 | 
	
		
			
				|  |  |                                 com.alibaba.fastjson.JSONObject object1 = object.getJSONObject("value");
 | 
	
		
			
				|  |  |                                 Integer twPrcie=object1.getInteger("price");
 | 
	
		
			
				|  |  |                                 Double twPrcie1 = Double.parseDouble(twPrcie+"");
 | 
	
		
			
				|  |  |                                 WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByReqFee(twPrcie1);
 | 
	
		
			
				|  |  |                                 if (chargeDictDO==null){
 | 
	
		
			
				|  |  |                                     chargeDictDO = new WlyyChargeDictDO();
 | 
	
		
			
				|  |  |                                     chargeDictDO.setCreateTime(new Date());
 | 
	
		
			
				|  |  |                                     chargeDictDO.setReqFee(twPrcie1);
 | 
	
		
			
				|  |  |                                     chargeDictDO.setChargeType(twPrcie+"");
 | 
	
		
			
				|  |  |                                     chargeDictDO.setChargeName(twPrcie+"");
 | 
	
		
			
				|  |  |                                     chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
 | 
	
		
			
				|  |  |                                 }
 | 
	
		
			
				|  |  |                                 doctorDO.setTwzxChargeType(chargeDictDO.getChargeType());
 | 
	
		
			
				|  |  |                                 if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
 | 
	
		
			
				|  |  |                                     if (!doctorDO.getOutpatientType().contains("zj")){
 | 
	
		
			
				|  |  |                                         doctorDO.setOutpatientType(doctorDO.getOutpatientType()+",zj");
 | 
	
		
			
				|  |  |                                     }
 | 
	
		
			
				|  |  |                                 }else {
 | 
	
		
			
				|  |  |                                     doctorDO.setOutpatientType("zj");
 | 
	
		
			
				|  |  |                                 }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                             }else {
 | 
	
		
			
				|  |  |                                 if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
 | 
	
		
			
				|  |  |                                     if (doctorDO.getOutpatientType().contains("zj")){
 | 
	
		
			
				|  |  |                                         doctorDO.getOutpatientType().replace(",zj","");
 | 
	
		
			
				|  |  |                                     }
 | 
	
		
			
				|  |  |                                 }else {
 | 
	
		
			
				|  |  |                                     doctorDO.setOutpatientType("zj");
 | 
	
		
			
				|  |  |                                 }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                             }
 | 
	
		
			
				|  |  |                             doctorDO.setTwzxChargeType(chargeDictDO.getChargeType());
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     //视频
 | 
	
		
			
				|  |  |                     String spResponse =ykyyService.GetVasPriceByTypeForJkzl(yktDoctor,3);
 | 
	
		
			
				|  |  |                     com.alibaba.fastjson.JSONObject jsonObject1 = com.alibaba.fastjson.JSONObject.parseObject(spResponse);
 | 
	
		
			
				|  |  |                     if (jsonObject1.getInteger("code")==10000){
 | 
	
		
			
				|  |  |                         if (jsonObject1.containsKey("value")){
 | 
	
		
			
				|  |  |                             com.alibaba.fastjson.JSONObject object1 = jsonObject1.getJSONObject("value");
 | 
	
		
			
				|  |  |                             Integer spPrcie=object1.getInteger("price");
 | 
	
		
			
				|  |  |                             Double spPrcie1 = Double.parseDouble(spPrcie+"");
 | 
	
		
			
				|  |  |                             WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByReqFee(spPrcie1);
 | 
	
		
			
				|  |  |                             if (chargeDictDO==null){
 | 
	
		
			
				|  |  |                                 chargeDictDO = new WlyyChargeDictDO();
 | 
	
		
			
				|  |  |                                 chargeDictDO.setCreateTime(new Date());
 | 
	
		
			
				|  |  |                                 chargeDictDO.setReqFee(spPrcie1);
 | 
	
		
			
				|  |  |                                 chargeDictDO.setChargeType(spPrcie+"");
 | 
	
		
			
				|  |  |                                 chargeDictDO.setChargeName(spPrcie+"");
 | 
	
		
			
				|  |  |                                 chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
 | 
	
		
			
				|  |  |                         //视频
 | 
	
		
			
				|  |  |                         String spResponse =ykyyService.GetVasPriceByTypeForJkzl(yktDoctor,3);
 | 
	
		
			
				|  |  |                         com.alibaba.fastjson.JSONObject jsonObject1 = com.alibaba.fastjson.JSONObject.parseObject(spResponse);
 | 
	
		
			
				|  |  |                         if (jsonObject1.getInteger("code")==10000){
 | 
	
		
			
				|  |  |                             if (jsonObject1.containsKey("value")){
 | 
	
		
			
				|  |  |                                 com.alibaba.fastjson.JSONObject object1 = jsonObject1.getJSONObject("value");
 | 
	
		
			
				|  |  |                                 Integer spPrcie=object1.getInteger("price");
 | 
	
		
			
				|  |  |                                 Double spPrcie1 = Double.parseDouble(spPrcie+"");
 | 
	
		
			
				|  |  |                                 WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByReqFee(spPrcie1);
 | 
	
		
			
				|  |  |                                 if (chargeDictDO==null){
 | 
	
		
			
				|  |  |                                     chargeDictDO = new WlyyChargeDictDO();
 | 
	
		
			
				|  |  |                                     chargeDictDO.setCreateTime(new Date());
 | 
	
		
			
				|  |  |                                     chargeDictDO.setReqFee(spPrcie1);
 | 
	
		
			
				|  |  |                                     chargeDictDO.setChargeType(spPrcie+"");
 | 
	
		
			
				|  |  |                                     chargeDictDO.setChargeName(spPrcie+"");
 | 
	
		
			
				|  |  |                                     chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
 | 
	
		
			
				|  |  |                                 }
 | 
	
		
			
				|  |  |                                 doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
 | 
	
		
			
				|  |  |                                 if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
 | 
	
		
			
				|  |  |                                     if (!doctorDO.getOutpatientType().contains("zj")){
 | 
	
		
			
				|  |  |                                         doctorDO.setOutpatientType(doctorDO.getOutpatientType()+",zj");
 | 
	
		
			
				|  |  |                                     }
 | 
	
		
			
				|  |  |                                 }else {
 | 
	
		
			
				|  |  |                                     doctorDO.setOutpatientType("zj");
 | 
	
		
			
				|  |  |                                 }
 | 
	
		
			
				|  |  |                             }else {
 | 
	
		
			
				|  |  |                                 if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
 | 
	
		
			
				|  |  |                                     if (doctorDO.getOutpatientType().contains("zj")){
 | 
	
		
			
				|  |  |                                         doctorDO.getOutpatientType().replace(",zj","");
 | 
	
		
			
				|  |  |                                     }
 | 
	
		
			
				|  |  |                                 }else{
 | 
	
		
			
				|  |  |                                     doctorDO.setOutpatientType("zj");
 | 
	
		
			
				|  |  |                                 }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                             }
 | 
	
		
			
				|  |  |                             doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     baseDoctorDao.save(doctorDO);
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 baseDoctorDao.save(doctorDO);
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             return "ok";
 | 
	
		
			
				|  |  |         }else {
 | 
	
		
			
				|  |  |             BaseDoctorDO doctorDO = baseDoctorDao.findByIdcardAndId(idcard);
 | 
	
		
			
				|  |  |             if (doctorDO!=null){
 | 
	
		
			
				|  |  |                 if (!StringUtils.isNoneBlank(doctorDO.getYktDoctorId())){
 | 
	
		
			
				|  |  |                     String yktDoctor = null;
 | 
	
		
			
				|  |  |                     DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctorDO.getId());
 | 
	
		
			
				|  |  |                     String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
 | 
	
		
			
				|  |  |                     com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(doctorResponse);
 | 
	
		
			
				|  |  |                     if (jsonObject.getInteger("code")==200){
 | 
	
		
			
				|  |  |                         com.alibaba.fastjson.JSONArray array1 = jsonObject.getJSONArray("data");
 | 
	
		
			
				|  |  |                         if (array1!=null&&array1.size()!=0){
 | 
	
		
			
				|  |  |                             yktDoctor=array1.getJSONObject(0).getString("DOCTORUSERID");
 | 
	
		
			
				|  |  |             if (price==-1){
 | 
	
		
			
				|  |  |                 if (type==1){
 | 
	
		
			
				|  |  |                     if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
 | 
	
		
			
				|  |  |                         if (doctorDO.getOutpatientType().contains("zj")) {
 | 
	
		
			
				|  |  |                             doctorDO.getOutpatientType().replace(",zj", "");
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }else {
 | 
	
		
			
				|  |  |                         doctorDO.setOutpatientType("zj");
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }else if (type==3){
 | 
	
		
			
				|  |  |                     if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
 | 
	
		
			
				|  |  |                         if (doctorDO.getOutpatientType().contains("zj")) {
 | 
	
		
			
				|  |  |                             doctorDO.getOutpatientType().replace(",zj", "");
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }else {
 | 
	
		
			
				|  |  |                         doctorDO.setOutpatientType("zj");
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     doctorDO.setYktDoctorId(yktDoctor);
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 if (type!=null&&type==1) {
 | 
	
		
			
				|  |  |                     Double price1 = Double.parseDouble(price + "");
 | 
	
		
			
				|  |  |                     WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByReqFee(price1);
 | 
	
		
			
				|  |  |                     if (chargeDictDO == null) {
 | 
	
		
			
				|  |  |                         chargeDictDO = new WlyyChargeDictDO();
 | 
	
		
			
				|  |  |                         chargeDictDO.setCreateTime(new Date());
 | 
	
		
			
				|  |  |                         chargeDictDO.setReqFee(price1);
 | 
	
		
			
				|  |  |                         chargeDictDO.setChargeType(price + "");
 | 
	
		
			
				|  |  |                         chargeDictDO.setChargeName(price + "");
 | 
	
		
			
				|  |  |                         chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
 | 
	
		
			
				|  |  |             }else {
 | 
	
		
			
				|  |  |                 if (doctorDO!=null){
 | 
	
		
			
				|  |  |                     if (!StringUtils.isNoneBlank(doctorDO.getYktDoctorId())){
 | 
	
		
			
				|  |  |                         String yktDoctor = null;
 | 
	
		
			
				|  |  |                         DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctorDO.getId());
 | 
	
		
			
				|  |  |                         if (doctorMappingDO!=null){
 | 
	
		
			
				|  |  |                             String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
 | 
	
		
			
				|  |  |                             com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(doctorResponse);
 | 
	
		
			
				|  |  |                             if (jsonObject.getInteger("code")==200){
 | 
	
		
			
				|  |  |                                 com.alibaba.fastjson.JSONArray array1 = jsonObject.getJSONArray("data");
 | 
	
		
			
				|  |  |                                 if (array1!=null&&array1.size()!=0){
 | 
	
		
			
				|  |  |                                     yktDoctor=array1.getJSONObject(0).getString("DOCTORUSERID");
 | 
	
		
			
				|  |  |                                 }
 | 
	
		
			
				|  |  |                             }
 | 
	
		
			
				|  |  |                             doctorDO.setYktDoctorId(yktDoctor);
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     doctorDO.setTwzxChargeType(chargeDictDO.getChargeType());
 | 
	
		
			
				|  |  |                 }else if (type!=null&&type==3) {
 | 
	
		
			
				|  |  |                     Double price1 = Double.parseDouble(price + "");
 | 
	
		
			
				|  |  |                     WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByReqFee(price1);
 | 
	
		
			
				|  |  |                     if (chargeDictDO == null) {
 | 
	
		
			
				|  |  |                         chargeDictDO = new WlyyChargeDictDO();
 | 
	
		
			
				|  |  |                         chargeDictDO.setCreateTime(new Date());
 | 
	
		
			
				|  |  |                         chargeDictDO.setReqFee(price1);
 | 
	
		
			
				|  |  |                         chargeDictDO.setChargeType(price + "");
 | 
	
		
			
				|  |  |                         chargeDictDO.setChargeName(price + "");
 | 
	
		
			
				|  |  |                         chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
 | 
	
		
			
				|  |  |                     if (type!=null&&type==1) {
 | 
	
		
			
				|  |  |                         Double price1 = Double.parseDouble(price + "");
 | 
	
		
			
				|  |  |                         WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByReqFee(price1);
 | 
	
		
			
				|  |  |                         if (chargeDictDO == null) {
 | 
	
		
			
				|  |  |                             chargeDictDO = new WlyyChargeDictDO();
 | 
	
		
			
				|  |  |                             chargeDictDO.setCreateTime(new Date());
 | 
	
		
			
				|  |  |                             chargeDictDO.setReqFee(price1);
 | 
	
		
			
				|  |  |                             chargeDictDO.setChargeType(price + "");
 | 
	
		
			
				|  |  |                             chargeDictDO.setChargeName(price + "");
 | 
	
		
			
				|  |  |                             chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                         doctorDO.setTwzxChargeType(chargeDictDO.getChargeType());
 | 
	
		
			
				|  |  |                         if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
 | 
	
		
			
				|  |  |                             if (!doctorDO.getOutpatientType().contains("zj")) {
 | 
	
		
			
				|  |  |                                 doctorDO.setOutpatientType(doctorDO.getOutpatientType() + ",zj");
 | 
	
		
			
				|  |  |                             }
 | 
	
		
			
				|  |  |                         }else {
 | 
	
		
			
				|  |  |                             doctorDO.setOutpatientType("zj");
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }else if (type!=null&&type==3) {
 | 
	
		
			
				|  |  |                         Double price1 = Double.parseDouble(price + "");
 | 
	
		
			
				|  |  |                         WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByReqFee(price1);
 | 
	
		
			
				|  |  |                         if (chargeDictDO == null) {
 | 
	
		
			
				|  |  |                             chargeDictDO = new WlyyChargeDictDO();
 | 
	
		
			
				|  |  |                             chargeDictDO.setCreateTime(new Date());
 | 
	
		
			
				|  |  |                             chargeDictDO.setReqFee(price1);
 | 
	
		
			
				|  |  |                             chargeDictDO.setChargeType(price + "");
 | 
	
		
			
				|  |  |                             chargeDictDO.setChargeName(price + "");
 | 
	
		
			
				|  |  |                             chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                         doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
 | 
	
		
			
				|  |  |                         if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
 | 
	
		
			
				|  |  |                             if (!doctorDO.getOutpatientType().contains("zj")) {
 | 
	
		
			
				|  |  |                                 doctorDO.setOutpatientType(doctorDO.getOutpatientType() + ",zj");
 | 
	
		
			
				|  |  |                             }
 | 
	
		
			
				|  |  |                         }else {
 | 
	
		
			
				|  |  |                             doctorDO.setOutpatientType("zj");
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
 | 
	
		
			
				|  |  |                     baseDoctorDao.save(doctorDO);
 | 
	
		
			
				|  |  |                     return "ok";
 | 
	
		
			
				|  |  |                 }else {
 | 
	
		
			
				|  |  |                     return "找不到医生信息!";
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 baseDoctorDao.save(doctorDO);
 | 
	
		
			
				|  |  |                 return "ok";
 | 
	
		
			
				|  |  |             }else {
 | 
	
		
			
				|  |  |                 return "找不到医生信息!";
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             return "ok";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 |