|  | @ -10530,6 +10530,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                             jsondate.put("serialNo",registerDO.getRegisterNo());
 | 
	
		
			
				|  |  |                             jsondate.put("dept",map.get("deptCode").toString());
 | 
	
		
			
				|  |  |                             jsondate.put("doctor",map.get("doctorMappingCode").toString());
 | 
	
		
			
				|  |  |                             baseNatAppointmentDO.setRegisterNo(registerDO.getRegisterNo());
 | 
	
		
			
				|  |  |                             baseNatAppointmentDO.setDoctorId(map.get("doctorMappingCode").toString());
 | 
	
		
			
				|  |  |                             baseNatAppointmentDO.setDoctorName(map.get("doctorName").toString());
 | 
	
		
			
				|  |  |                         }else {
 | 
	
	
		
			
				|  | @ -10554,6 +10555,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                             jsondate.put("serialNo",serialNo);
 | 
	
		
			
				|  |  |                             jsondate.put("dept",map.get("deptCode").toString());
 | 
	
		
			
				|  |  |                             jsondate.put("doctor",map.get("doctorMappingCode").toString());
 | 
	
		
			
				|  |  |                             baseNatAppointmentDO.setRegisterNo(serialNo);
 | 
	
		
			
				|  |  |                             //存储就诊记录
 | 
	
		
			
				|  |  |                             WlyyPatientRegisterDO registerDO = new WlyyPatientRegisterDO();
 | 
	
		
			
				|  |  |                             // 存储挂号医生与挂号科室
 | 
	
	
		
			
				|  | @ -10651,13 +10653,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                     wlyyHttpLogDao.save(log);
 | 
	
		
			
				|  |  |                     if ("0".equals(prers)) {
 | 
	
		
			
				|  |  |                         String realOrder = jsonObject.getString("@real_order");
 | 
	
		
			
				|  |  |                         String voucherNo = jsonObject.getString("@xtgzh0");
 | 
	
		
			
				|  |  |                         baseNatAppointmentDO.setRealOrder(realOrder);
 | 
	
		
			
				|  |  |                         baseNatAppointmentDO.setIsSuccess("1");
 | 
	
		
			
				|  |  |                         baseNatAppointmentDO.setVoucherNo(voucherNo);
 | 
	
		
			
				|  |  |                         baseNatAppointmentDao.save(baseNatAppointmentDO);
 | 
	
		
			
				|  |  |                         String recipeTime = DateUtil.dateToStr(new Date(), "yyyyMMddHHmmss");
 | 
	
		
			
				|  |  |                         String applyDepaName = map.get("deptName").toString();
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                         String voucherNo = jsonObject.getString("@xtgzh0");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                         String applyDoctorName = map.get("doctorName").toString();
 | 
	
		
			
				|  |  |                         BasePatientDO patientDO = basePatientDao.findById(patientId);
 | 
	
		
			
				|  |  |                         String userName = null;
 | 
	
	
		
			
				|  | @ -10677,7 +10681,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                         net.sf.json.JSONObject res = jsonObject1.getJSONObject("resquest");
 | 
	
		
			
				|  |  |                         logger.info("获取待结算数据 res: " + res.toString());
 | 
	
		
			
				|  |  |                         String rsCode = res.getString("@RESULT");
 | 
	
		
			
				|  |  |                         String free= "";
 | 
	
		
			
				|  |  |                         String free= 0+"";
 | 
	
		
			
				|  |  |                         if ("0".equals(rsCode)) {
 | 
	
		
			
				|  |  |                             free = res.getString("@total_charge");
 | 
	
		
			
				|  |  |                         }
 | 
	
	
		
			
				|  | @ -10703,7 +10707,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return returnMap;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     public MixEnvelop getNatRecords(String patientId,Integer page ,Integer pageSize){
 | 
	
		
			
				|  |  |     public MixEnvelop getNatRecords(String patientId,String id,Integer page ,Integer pageSize){
 | 
	
		
			
				|  |  |         String sql = "select t.name as \"name\"," +
 | 
	
		
			
				|  |  |                 "t.card_no as \"cardNo\"," +
 | 
	
		
			
				|  |  |                 "t.card_type as \"cardType\"," +
 | 
	
	
		
			
				|  | @ -10713,12 +10717,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 "t.is_success as \"isSuccess\"," +
 | 
	
		
			
				|  |  |                 "t.create_time as \"createTime\"," +
 | 
	
		
			
				|  |  |                 "t.pay_status as \"payStatus\"," +
 | 
	
		
			
				|  |  |                 "t.medicare as \"medicare\","+
 | 
	
		
			
				|  |  |                 "t.voucher_no as \"voucherNo\","+
 | 
	
		
			
				|  |  |                 "t.id as \"id\"," +
 | 
	
		
			
				|  |  |                 "t.appointment_time as \"appointmentTime\" " +
 | 
	
		
			
				|  |  |                 " from base_nat_appointment t where 1=1 ";
 | 
	
		
			
				|  |  |         if (StringUtils.isNoneBlank(patientId)){
 | 
	
		
			
				|  |  |             sql+=" and t.patient_id ='"+patientId+"'";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (StringUtils.isNoneBlank(id)){
 | 
	
		
			
				|  |  |             sql+=" and t.id ='"+id+"'";
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         List<Map<String ,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
 | 
	
		
			
				|  |  |         List<Map<String ,Object>> listCount = hibenateUtils.createSQLQuery(sql);
 | 
	
		
			
				|  |  |         MixEnvelop mixnvelop = new MixEnvelop();
 | 
	
	
		
			
				|  | @ -10773,6 +10782,33 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                             baseNatAppointmentDO.setCancelTime(new Date());
 | 
	
		
			
				|  |  |                             baseNatAppointmentDO.setCancelBy(patientId);
 | 
	
		
			
				|  |  |                             baseNatAppointmentDao.save(baseNatAppointmentDO);
 | 
	
		
			
				|  |  |                             //删除处方
 | 
	
		
			
				|  |  |                             logger.info("删除处方开始");
 | 
	
		
			
				|  |  |                             net.sf.json.JSONObject jsondate = new JSONObject();
 | 
	
		
			
				|  |  |                             jsondate.put("checkPart","鼻/咽拭子");
 | 
	
		
			
				|  |  |                             jsondate.put("cardNo",baseNatAppointmentDO.getMedicare());
 | 
	
		
			
				|  |  |                             jsondate.put("chargeFlag","2");
 | 
	
		
			
				|  |  |                             jsondate.put("chargeCode","361322");
 | 
	
		
			
				|  |  |                             jsondate.put("icdCode","Z00.000");
 | 
	
		
			
				|  |  |                             jsondate.put("socialNo",baseNatAppointmentDO.getCardNo());
 | 
	
		
			
				|  |  |                             jsondate.put("tellPhone",baseNatAppointmentDO.getMobile());
 | 
	
		
			
				|  |  |                             jsondate.put("address1",baseNatAppointmentDO.getProvinceName());
 | 
	
		
			
				|  |  |                             jsondate.put("address2",baseNatAppointmentDO.getCityName());
 | 
	
		
			
				|  |  |                             jsondate.put("address3",baseNatAppointmentDO.getTownName());
 | 
	
		
			
				|  |  |                             jsondate.put("address4",baseNatAppointmentDO.getStreetName());
 | 
	
		
			
				|  |  |                             jsondate.put("address5",2);
 | 
	
		
			
				|  |  |                             jsondate.put("area",baseNatAppointmentDO.getAddress());
 | 
	
		
			
				|  |  |                             jsondate.put("winNo",6);
 | 
	
		
			
				|  |  |                             jsondate.put("target",2);
 | 
	
		
			
				|  |  |                             jsondate.put("quantity",1);
 | 
	
		
			
				|  |  |                             jsondate.put("serialNo",baseNatAppointmentDO.getRegisterNo());
 | 
	
		
			
				|  |  |                             jsondate.put("dept",baseNatAppointmentDO.getDept());
 | 
	
		
			
				|  |  |                             jsondate.put("doctor",baseNatAppointmentDO.getDoctorId());
 | 
	
		
			
				|  |  |                             jsondate.put("realOrder",baseNatAppointmentDO.getRealOrder());
 | 
	
		
			
				|  |  |                             JSONArray array = new JSONArray();
 | 
	
		
			
				|  |  |                             array.add(jsondate);
 | 
	
		
			
				|  |  |                             JSONObject object1  = entranceService.BS10112(array.toString(),demoFlag);
 | 
	
		
			
				|  |  |                             logger.info("删除处方结束");
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  | 
 |