| 
					
				 | 
			
			
				@ -183,13 +183,13 @@ public class MedOrderService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject strinObj = JSONObject.parseObject(deviceParam.get("yb_strin").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject netData = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("opter","010XXX"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("opter",orgCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("msgid",strinObj.getString("outBizNo")+ DateUtil.getYyyymmddhhmmss(new Date())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("opmsgidter","123123"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("fixmedins_code",strinObj.getString("outBizNo")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("opter_name","XX"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("opter_name","自助机"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("infver","V1.0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("opter_type","1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("opter_type","2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("mdtrtarea_admvs","350200"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("fixmedins_name","XX"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("signtype","SM2"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -336,13 +336,13 @@ public class MedOrderService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         **/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject strinObj = JSONObject.parseObject(deviceParam.get("yb_strin").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject netData = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("opter","010XXX"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("opter",orgCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("msgid",strinObj.getString("outBizNo")+ DateUtil.getYyyymmddhhmmss(new Date())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("opmsgidter","123123"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("fixmedins_code",strinObj.getString("outBizNo")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("opter_name","XX"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("opter_name","自助机"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("infver","V1.0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("opter_type","1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("opter_type","2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("mdtrtarea_admvs","350200"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("fixmedins_name","XX"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        netData.put("signtype","SM2"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -462,7 +462,7 @@ public class MedOrderService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Transactional(rollbackFor = Exception.class) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public com.alibaba.fastjson.JSONArray getSettlementInfoSecond(String recipe_no,String readcardResult,String registerResult) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public com.alibaba.fastjson.JSONArray getSettlementInfoSecond(String recipe_no,String mdtrt_cert_type,String readcardResult,String registerResult) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findByLog_no(recipe_no); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONArray result = new JSONArray(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject resultTmp = new JSONObject(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -573,13 +573,13 @@ public class MedOrderService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<YlzMedicalMxDO> ylzMedicalMxDOSTmp = chrgBchnoKey.get(key); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject strinObj = JSONObject.parseObject(deviceParam.get("yb_strin").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject netData = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                netData.put("opter","010XXX"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                netData.put("opter",ylzMedicalRelationDO.getOrgCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                netData.put("msgid",ylzMedicalMxDOSTmp.get(0).getSetlMsgid());//发送方结算报文id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                netData.put("opmsgidter","123123"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                netData.put("fixmedins_code",strinObj.getString("outBizNo")); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                netData.put("opter_name","XX"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                netData.put("opter_name","自助机"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                netData.put("infver","V1.0"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                netData.put("opter_type","1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                netData.put("opter_type","2"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                netData.put("mdtrtarea_admvs","350200"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                netData.put("fixmedins_name","XX"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                netData.put("signtype","SM2"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -590,8 +590,14 @@ public class MedOrderService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject dataInfo = new JSONObject();//结算基本信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                dataInfo.put("psn_no",ylzMedicalRelationDO.getPsnNo());  //人员编号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                dataInfo.put("mdtrt_cert_type","03"); //就诊凭证类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                dataInfo.put("mdtrt_cert_no",ylzMedicalRelationDO.getCardNo());   //就诊凭证编号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (StringUtils.isNotBlank(mdtrt_cert_type)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if ("01".equals(mdtrt_cert_type)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        dataInfo.put("mdtrt_cert_type",mdtrt_cert_type); //就诊凭证类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    dataInfo.put("mdtrt_cert_type","03"); //就诊凭证类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    dataInfo.put("mdtrt_cert_no",ylzMedicalRelationDO.getCardNo());   //就诊凭证编号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                dataInfo.put("med_type",ylzMedicalRelationDO.getMedType());    //医疗类别 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                Double medfee_sumamt = ylzMedicalMxDOSTmp.stream().mapToDouble(e-> Double.valueOf(e.getTotalMoney())).sum(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 |