|  | @ -14,6 +14,7 @@ import com.yihu.jw.entity.hospital.healthCare.YlzMedicalRelationDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.message.SystemMessageDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.prescription.*;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.order.BusinessOrderDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.healthCare.YlzMedicailIcdDao;
 | 
	
	
		
			
				|  | @ -87,6 +88,8 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     //请求内网服务
 | 
	
		
			
				|  |  |     public static String entranceUrl = "http://192.168.101.2:10024/dsyy/";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     private final static String updateUrl="http://127.0.0.1:10023/dsyy/updateBySql";
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private HttpClientUtil httpClientUtil;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
	
		
			
				|  | @ -788,16 +791,54 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 回调his预缴金充值
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param orderNo
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public JSONObject rechargeHis(String orderNo) throws Exception {
 | 
	
		
			
				|  |  |         JSONObject jsonObject1 = new JSONObject();
 | 
	
		
			
				|  |  |         BusinessOrderDO businessOrderDO = businessOrderDao.selectByOrderNo(orderNo);
 | 
	
		
			
				|  |  |         if (businessOrderDO.getUploadStatus()==null||businessOrderDO.getStatus()==0){
 | 
	
		
			
				|  |  |             String cardNo = "";
 | 
	
		
			
				|  |  |             if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("2")){
 | 
	
		
			
				|  |  |                 WlyyOutpatientDO outpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode()).get();
 | 
	
		
			
				|  |  |                 cardNo = outpatientDO.getCardNo();
 | 
	
		
			
				|  |  |             }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("3")){
 | 
	
		
			
				|  |  |                 WlyyOutpatientDO outpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode()).get();
 | 
	
		
			
				|  |  |                 cardNo = outpatientDO.getCardNo();
 | 
	
		
			
				|  |  |             }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("6")){
 | 
	
		
			
				|  |  |                 YlzMedicalRelationDO ylzMedicalRelationDO = ylzMedicailRelationDao.findById(businessOrderDO.getRelationCode()).orElse(null);
 | 
	
		
			
				|  |  |                 cardNo=ylzMedicalRelationDO.getCardNo();
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             String depositType = "HL";
 | 
	
		
			
				|  |  |             String channelType="11";
 | 
	
		
			
				|  |  |             String amount=businessOrderDO.getPayPrice()+"";
 | 
	
		
			
				|  |  |             String outChargeNo=businessOrderDO.getOrderNo();
 | 
	
		
			
				|  |  |             String extra="";
 | 
	
		
			
				|  |  |             String notes="预缴金充值";
 | 
	
		
			
				|  |  |             String traceNo=businessOrderDO.getTraceNo();
 | 
	
		
			
				|  |  |             logger.info("发起预缴金充值接口开始======");
 | 
	
		
			
				|  |  |             JSONObject jsonObject = startRechargeToHospital("01",cardNo,depositType,channelType,amount,outChargeNo,extra,notes,traceNo,"");
 | 
	
		
			
				|  |  |             logger.info("发起预缴金充值接口结束======");
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             logger.info("确认预缴金充值接口开始======");
 | 
	
		
			
				|  |  |             jsonObject1 = rechargeToHospital("01",cardNo,depositType,channelType,amount,outChargeNo,extra,notes,traceNo,"");
 | 
	
		
			
				|  |  |             logger.info("确认预缴金充值接口结束======");
 | 
	
		
			
				|  |  |             businessOrderDO.setUploadStatus(1);
 | 
	
		
			
				|  |  |             businessOrderDao.save(businessOrderDO);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return jsonObject1;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * 发起充值接口
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param operatorId 操作人代码
 | 
	
		
			
				|  |  |      * @param operatorName 操作人姓名
 | 
	
		
			
				|  |  |      * @param termNo 终端编号
 | 
	
		
			
				|  |  |      * @param cardType 卡类型 01
 | 
	
		
			
				|  |  |      * @param cardNo 卡号 不为空
 | 
	
		
			
				|  |  |      * @param accountType 充值类型 01门诊 02住院
 | 
	
		
			
				|  |  |      * @param depositType 充值类型
 | 
	
		
			
				|  |  |      * @param channelType 渠道 CASH-现金 POS-pos机 ONE_CREDIT-信用就医 L-移动支付
 | 
	
		
			
				|  |  |      * @param amount 充值金额
 | 
	
	
		
			
				|  | @ -809,18 +850,17 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public JSONObject startRechargeToHospital(String operatorId ,String operatorName,String termNo,String cardType,String cardNo,String accountType,
 | 
	
		
			
				|  |  |                                                      String depositType,String channelType,String amount,String outChargeNo,
 | 
	
		
			
				|  |  |     public JSONObject startRechargeToHospital(String cardType,String cardNo,String depositType,String channelType,String amount,String outChargeNo,
 | 
	
		
			
				|  |  |                                                      String extra,String notes,String traceNo,String status) throws Exception {
 | 
	
		
			
				|  |  |         String url = entranceUrl +"startRecharge";
 | 
	
		
			
				|  |  |         JSONObject object = new JSONObject();
 | 
	
		
			
				|  |  |         Map<String,Object> params = new HashedMap();
 | 
	
		
			
				|  |  |         params.put("operatorId",operatorId);
 | 
	
		
			
				|  |  |         params.put("operatorName",operatorName);
 | 
	
		
			
				|  |  |         params.put("termNo",termNo);
 | 
	
		
			
				|  |  |         params.put("operatorId","HLWYY");
 | 
	
		
			
				|  |  |         params.put("operatorName","互联网医院");
 | 
	
		
			
				|  |  |         params.put("termNo","");
 | 
	
		
			
				|  |  |         params.put("cardType",cardType);
 | 
	
		
			
				|  |  |         params.put("cardNo",cardNo);
 | 
	
		
			
				|  |  |         params.put("accountType",accountType);
 | 
	
		
			
				|  |  |         params.put("accountType","01");
 | 
	
		
			
				|  |  |         params.put("depositType",depositType);
 | 
	
		
			
				|  |  |         params.put("channelType",channelType);
 | 
	
		
			
				|  |  |         params.put("amount",amount);
 | 
	
	
		
			
				|  | @ -833,15 +873,7 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
 | 
	
		
			
				|  |  |         String content = response.getContent();
 | 
	
		
			
				|  |  |         logger.info("response:"+content);
 | 
	
		
			
				|  |  |         JSONObject rs = JSON.parseObject(content);
 | 
	
		
			
				|  |  |         Integer status1 = rs.getInteger("status");
 | 
	
		
			
				|  |  |         if (status1==200){
 | 
	
		
			
				|  |  |             if(rs.get("obj") instanceof JSONObject){
 | 
	
		
			
				|  |  |                 object = rs.getJSONObject("obj");
 | 
	
		
			
				|  |  |             }else {
 | 
	
		
			
				|  |  |                 throw new ServiceException(rs.getString("obj"));
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return object;
 | 
	
		
			
				|  |  |         return rs;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -849,12 +881,9 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * 充值确认接口
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param operatorId 操作人代码
 | 
	
		
			
				|  |  |      * @param operatorName 操作人姓名
 | 
	
		
			
				|  |  |      * @param termNo 终端编号
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |      * @param cardType 卡类型 01
 | 
	
		
			
				|  |  |      * @param cardNo 卡号 不为空
 | 
	
		
			
				|  |  |      * @param accountType 充值类型 01门诊 02住院
 | 
	
		
			
				|  |  |      * @param depositType 充值类型
 | 
	
		
			
				|  |  |      * @param channelType 渠道 CASH-现金 POS-pos机 ONE_CREDIT-信用就医 L-移动支付
 | 
	
		
			
				|  |  |      * @param amount 充值金额
 | 
	
	
		
			
				|  | @ -866,18 +895,17 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public JSONObject rechargeToHospital(String operatorId ,String operatorName,String termNo,String cardType,String cardNo,String accountType,
 | 
	
		
			
				|  |  |                                               String depositType,String channelType,String amount,String outChargeNo,
 | 
	
		
			
				|  |  |     public JSONObject rechargeToHospital(String cardType,String cardNo,String depositType,String channelType,String amount,String outChargeNo,
 | 
	
		
			
				|  |  |                                               String extra,String notes,String traceNo,String status) throws Exception {
 | 
	
		
			
				|  |  |         String url = entranceUrl +"recharge";
 | 
	
		
			
				|  |  |         JSONObject object = new JSONObject();
 | 
	
		
			
				|  |  |         Map<String,Object> params = new HashedMap();
 | 
	
		
			
				|  |  |         params.put("operatorId",operatorId);
 | 
	
		
			
				|  |  |         params.put("operatorName",operatorName);
 | 
	
		
			
				|  |  |         params.put("termNo",termNo);
 | 
	
		
			
				|  |  |         params.put("operatorId","HLWYY");
 | 
	
		
			
				|  |  |         params.put("operatorName","互联网医院");
 | 
	
		
			
				|  |  |         params.put("termNo","");
 | 
	
		
			
				|  |  |         params.put("cardType",cardType);
 | 
	
		
			
				|  |  |         params.put("cardNo",cardNo);
 | 
	
		
			
				|  |  |         params.put("accountType",accountType);
 | 
	
		
			
				|  |  |         params.put("accountType","01");
 | 
	
		
			
				|  |  |         params.put("depositType",depositType);
 | 
	
		
			
				|  |  |         params.put("channelType",channelType);
 | 
	
		
			
				|  |  |         params.put("amount",amount);
 | 
	
	
		
			
				|  | @ -890,15 +918,7 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
 | 
	
		
			
				|  |  |         String content = response.getContent();
 | 
	
		
			
				|  |  |         logger.info("response:"+content);
 | 
	
		
			
				|  |  |         JSONObject rs = JSON.parseObject(content);
 | 
	
		
			
				|  |  |         Integer status1 = rs.getInteger("status");
 | 
	
		
			
				|  |  |         if (status1==200){
 | 
	
		
			
				|  |  |             if(rs.get("obj") instanceof JSONObject){
 | 
	
		
			
				|  |  |                 object = rs.getJSONObject("obj");
 | 
	
		
			
				|  |  |             }else {
 | 
	
		
			
				|  |  |                 throw new ServiceException(rs.getString("obj"));
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return object;
 | 
	
		
			
				|  |  |         return rs;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
	
		
			
				|  | @ -958,6 +978,56 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
 | 
	
		
			
				|  |  |         return result;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 获取医生签名图片
 | 
	
		
			
				|  |  |      * @param doctor
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public JSONObject getSignPicture(String doctor){
 | 
	
		
			
				|  |  |         try {
 | 
	
		
			
				|  |  |             BaseDoctorDO doctorDO = baseDoctorDao.findByIdAndDel(doctor);
 | 
	
		
			
				|  |  |             if (doctorDO==null){
 | 
	
		
			
				|  |  |                 throw new Exception("医生信息不存在!");
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             JSONObject response = synDoctorSearch(doctorDO.getIdcard());
 | 
	
		
			
				|  |  |             JSONObject object = new JSONObject();
 | 
	
		
			
				|  |  |             if (response!=null){
 | 
	
		
			
				|  |  |                 JSONObject data = response.getJSONObject("data");
 | 
	
		
			
				|  |  |                 object.put("code","1000");
 | 
	
		
			
				|  |  |                 JSONObject jsonObject = new JSONObject();
 | 
	
		
			
				|  |  |                 jsonObject.put("image",data.getString("stamp"));
 | 
	
		
			
				|  |  |                 object.put("data",jsonObject);
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             logger.info("医生签名图片 getSignPicture :"+response.toJSONString());
 | 
	
		
			
				|  |  |             return object;
 | 
	
		
			
				|  |  |         }catch (Exception e){
 | 
	
		
			
				|  |  |             e.printStackTrace();
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return null;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 查询ca用户信息
 | 
	
		
			
				|  |  |      * @param idcard
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public JSONObject synDoctorSearch(String idcard) throws Exception {
 | 
	
		
			
				|  |  |         String url = entranceUrl +"synDoctorSearch";
 | 
	
		
			
				|  |  |         JSONObject object = new JSONObject();
 | 
	
		
			
				|  |  |         Map<String,Object> params = new HashedMap();
 | 
	
		
			
				|  |  |         params.put("userIdcardNum",idcard);
 | 
	
		
			
				|  |  |         HttpResponse response = HttpUtils.doPost(url,params);
 | 
	
		
			
				|  |  |         String content = response.getContent();
 | 
	
		
			
				|  |  |         logger.info("response:"+content);
 | 
	
		
			
				|  |  |         JSONObject rs = JSON.parseObject(content);
 | 
	
		
			
				|  |  |         Integer status = rs.getInteger("status");
 | 
	
		
			
				|  |  |         if (status==200){
 | 
	
		
			
				|  |  |             object = rs.getJSONObject("message");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return object;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 数据哈希计算接口
 | 
	
		
			
				|  |  |      *
 | 
	
	
		
			
				|  | @ -976,7 +1046,7 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
 | 
	
		
			
				|  |  |         JSONObject rs = JSON.parseObject(content);
 | 
	
		
			
				|  |  |         Integer status = rs.getInteger("status");
 | 
	
		
			
				|  |  |         if (status==200){
 | 
	
		
			
				|  |  |             object = rs.getJSONObject("obj");
 | 
	
		
			
				|  |  |             object = rs.getJSONObject("message");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return object;
 | 
	
		
			
				|  |  |     }
 | 
	
	
		
			
				|  | @ -1016,7 +1086,7 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
 | 
	
		
			
				|  |  |         JSONObject rs = JSON.parseObject(content);
 | 
	
		
			
				|  |  |         Integer status = rs.getInteger("status");
 | 
	
		
			
				|  |  |         if (status==200){
 | 
	
		
			
				|  |  |             object = rs.getJSONObject("obj");
 | 
	
		
			
				|  |  |             object = rs.getJSONObject("message");
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         return object;
 | 
	
		
			
				|  |  |     }
 | 
	
	
		
			
				|  | @ -1687,8 +1757,20 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public String updateUrl(String sql) throws Exception {
 | 
	
		
			
				|  |  |         Map<String,Object> params = new HashedMap();
 | 
	
		
			
				|  |  |         params.put("sql",sql);
 | 
	
		
			
				|  |  |         logger.info("sql语句:"+sql);
 | 
	
		
			
				|  |  |         HttpResponse response = HttpUtils.doGet(updateUrl,params);
 | 
	
		
			
				|  |  |         String content = response.getContent();
 | 
	
		
			
				|  |  |         logger.info("response:"+content);
 | 
	
		
			
				|  |  |         return content;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 确认医保结算
 | 
	
		
			
				|  |  |      * 确认his结算
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      * @param outpatientId
 | 
	
		
			
				|  |  |      * @return
 | 
	
	
		
			
				|  | @ -1719,35 +1801,124 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
 | 
	
		
			
				|  |  |                 orderNo = businessOrderDO.getOrderNo();
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             if (ylzMedicalRelationDO.getMedicalState()==null||(ylzMedicalRelationDO.getMedicalState()!=null&&ylzMedicalRelationDO.getMedicalState()==0)){
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 String sql = "update SST_JSDP_JBXX_GJYB\n" +
 | 
	
		
			
				|  |  |                         "   set SETL_ID           = '', \n" +
 | 
	
		
			
				|  |  |                         "       ACCT_PAY          = '0',\n" +
 | 
	
		
			
				|  |  |                         "       PSN_CASH_PAY      = '"+ylzMedicalRelationDO.getPersonCash()+"',\n" +
 | 
	
		
			
				|  |  |                         "       FUND_PAY_SUMAMT   = '0',\n" +
 | 
	
		
			
				|  |  |                         "       CVLSERV_PAY       = '0',\n" +
 | 
	
		
			
				|  |  |                         "       PSN_PART_AMT      = '0',\n" +
 | 
	
		
			
				|  |  |                         "       HIFMI_PAY         = '0',\n" +
 | 
	
		
			
				|  |  |                         "       MEDFEE_SUMAMT     = '"+ylzMedicalRelationDO.getBcwkje()+"',\n" +
 | 
	
		
			
				|  |  |                         "       SETL_TIME         = '0',\n" +
 | 
	
		
			
				|  |  |                         "       BALC              = '0',\n" +
 | 
	
		
			
				|  |  |                         "       ACCT_MULAID_PAY   = '0',\n" +
 | 
	
		
			
				|  |  |                         "       HIFOB_PAY         = '0',\n" +
 | 
	
		
			
				|  |  |                         "       MDTRT_ID          = '',\n" +
 | 
	
		
			
				|  |  |                         "       HIFP_PAY          = '0',\n" +
 | 
	
		
			
				|  |  |                         "       MAF_PAY           = '',\n" +
 | 
	
		
			
				|  |  |                         "       OTH_PAY           = '0',\n" +
 | 
	
		
			
				|  |  |                         "       HIFES_PAY         = '0',\n" +
 | 
	
		
			
				|  |  |                         "       OUTCHARGENO       = '"+orderNo+"',\n" +
 | 
	
		
			
				|  |  |                         "       PSN_CERT_TYPE     = '0',\n" +
 | 
	
		
			
				|  |  |                         "       NATY              = '0',\n" +
 | 
	
		
			
				|  |  |                         "       BRDY              = '0',\n" +
 | 
	
		
			
				|  |  |                         "       CVLSERV_FLAG      = '0',\n" +
 | 
	
		
			
				|  |  |                         "       ACT_PAY_DEDC      = '0',\n" +
 | 
	
		
			
				|  |  |                         "       PSN_TYPE          = '0',\n" +
 | 
	
		
			
				|  |  |                         "       HOSP_PART_AMT     = '0',\n" +
 | 
	
		
			
				|  |  |                         "       CLR_OPTINS        = '0',\n" +
 | 
	
		
			
				|  |  |                         "       CLR_WAY           = '0',\n" +
 | 
	
		
			
				|  |  |                         "       CLR_TYPE          = '0',\n" +
 | 
	
		
			
				|  |  |                         "       POOL_PROP_SELFPAY = '0',\n" +
 | 
	
		
			
				|  |  |                         "       INSUPLC_ADMDVS    = '',\n" +
 | 
	
		
			
				|  |  |                         "       INSUTYPE          = '',\n" +
 | 
	
		
			
				|  |  |                         "       PSN_NO            = '',\n" +
 | 
	
		
			
				|  |  |                         "       CHANNEL_TYPE      = '',\n" +
 | 
	
		
			
				|  |  |                         "       ACSIGN_TYPE       = 'null',\n" +
 | 
	
		
			
				|  |  |                         "       MDTRT_CERT_TYPE   = '03',\n" +
 | 
	
		
			
				|  |  |                         "       CVL_ACCT_PAY      = '0',\n" +
 | 
	
		
			
				|  |  |                         "       CVL_ACCT_BALC     = '0',\n" +
 | 
	
		
			
				|  |  |                         "       HL_ACCT_PAY       = '0',\n" +
 | 
	
		
			
				|  |  |                         "       HL_ACCT_BALC      = '0',\n" +
 | 
	
		
			
				|  |  |                         "       FM_ACCT_BALC      = '0',\n" +
 | 
	
		
			
				|  |  |                         "       PUR_ACCT_PAY      = '0'\n" +
 | 
	
		
			
				|  |  |                         " where 1 = 1\n" +
 | 
	
		
			
				|  |  |                         "   and LOG_NO = '"+ylzMedicalRelationDO.getLogNo()+"'";
 | 
	
		
			
				|  |  |                 //结算更新
 | 
	
		
			
				|  |  |                 System.out.println("sql=="+sql);
 | 
	
		
			
				|  |  |                 String res = updateUrl(sql);
 | 
	
		
			
				|  |  |             }else {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 String sql = "update SST_JSDP_JBXX_GJYB\n" +
 | 
	
		
			
				|  |  |                         "   set SETL_ID      = '"+ylzMedicalRelationDO.getBillSerial()+"',\n" +
 | 
	
		
			
				|  |  |                         "       PSN_CASH_PAY      = '"+ylzMedicalRelationDO.getPersonCash()+"',\n" +
 | 
	
		
			
				|  |  |                         "       MEDFEE_SUMAMT     = '"+ylzMedicalRelationDO.getBcwkje()+"',\n" +
 | 
	
		
			
				|  |  |                         "       HIFOB_PAY         = '0',\n" +
 | 
	
		
			
				|  |  |                         "       OUTCHARGENO       = '"+orderNo+"',\n" +
 | 
	
		
			
				|  |  |                         "       BRDY              = '0',\n" +
 | 
	
		
			
				|  |  |                         "       CVLSERV_FLAG      = '0',\n" +
 | 
	
		
			
				|  |  |                         "       HOSP_PART_AMT     = '0',\n" +
 | 
	
		
			
				|  |  |                         "       POOL_PROP_SELFPAY = '0',\n" +
 | 
	
		
			
				|  |  |                         "       INSUPLC_ADMDVS    = '"+ylzMedicalRelationDO.getAdministrativeArea()+"',\n" +
 | 
	
		
			
				|  |  |                         "       INSUTYPE          = '"+ylzMedicalRelationDO.getInsuranceType()+"',\n" +
 | 
	
		
			
				|  |  |                         "       PSN_NO            = '',\n" +
 | 
	
		
			
				|  |  |                         "       CHANNEL_TYPE      = '',\n" +
 | 
	
		
			
				|  |  |                         "       ACSIGN_TYPE       = 'null',\n" +
 | 
	
		
			
				|  |  |                         "       MDTRT_CERT_TYPE   = '03',\n" +
 | 
	
		
			
				|  |  |                         "       CVL_ACCT_PAY      = '0',\n" +
 | 
	
		
			
				|  |  |                         "       CVL_ACCT_BALC     = '0',\n" +
 | 
	
		
			
				|  |  |                         "       HL_ACCT_PAY       = '0',\n" +
 | 
	
		
			
				|  |  |                         "       HL_ACCT_BALC      = '0',\n" +
 | 
	
		
			
				|  |  |                         "       FM_ACCT_BALC      = '0',\n" +
 | 
	
		
			
				|  |  |                         "       PUR_ACCT_PAY      = '0',\n" +
 | 
	
		
			
				|  |  |                         "       CHRG_BCHNO      = '"+ylzMedicalRelationDO.getBillSerial()+"',\n" +
 | 
	
		
			
				|  |  |                         "       MDTRT_ID      = '"+ylzMedicalRelationDO.getInsuranceSerial()+"',\n" +
 | 
	
		
			
				|  |  |                         "       PSN_CERT_TYPE      = '"+ylzMedicalRelationDO.getCertType()+"',\n" +
 | 
	
		
			
				|  |  |                         "       NATY      = '"+ylzMedicalRelationDO.getCertType()+"',\n" +
 | 
	
		
			
				|  |  |                         "       PSN_TYPE      = '"+ylzMedicalRelationDO.getTreatmentType()+"',\n" +
 | 
	
		
			
				|  |  |                         "       RYDYMC      = '"+ylzMedicalRelationDO.getTreatmentTypeName()+"',\n" +
 | 
	
		
			
				|  |  |                         "       YBDYZT      = '"+(StringUtils.isNoneBlank(ylzMedicalRelationDO.getTreatmentStatus())?ylzMedicalRelationDO.getTreatmentStatus():0)+"',\n" +
 | 
	
		
			
				|  |  |                         "       YBDYMC      = '"+(StringUtils.isNoneBlank(ylzMedicalRelationDO.getTreatmentStatusName())?ylzMedicalRelationDO.getTreatmentStatusName():"")+"',\n" +
 | 
	
		
			
				|  |  |                         "       YDJYLX      = '"+ylzMedicalRelationDO.getAllopatryType()+"',\n" +
 | 
	
		
			
				|  |  |                         "       YDLXMC      = '"+ylzMedicalRelationDO.getAllopatryTypeName()+"',\n" +
 | 
	
		
			
				|  |  |                         "       ACT_PAY_DEDC = '"+ylzMedicalRelationDO.getPayStandard()+"',\n" +
 | 
	
		
			
				|  |  |                         "       HIFP_PAY      = '"+ylzMedicalRelationDO.getTcjjPay()+"',\n" +
 | 
	
		
			
				|  |  |                         "       CVLSERV_PAY = '"+ylzMedicalRelationDO.getGwyPay()+"',\n" +
 | 
	
		
			
				|  |  |                         "       HIFES_PAY      = '"+ylzMedicalRelationDO.getEnterpriseSupplement()+"',\n" +
 | 
	
		
			
				|  |  |                         "       HIFMI_PAY      = '"+ylzMedicalRelationDO.getSbjjPay()+"',\n" +
 | 
	
		
			
				|  |  |                         "       MAF_PAY      = '"+ylzMedicalRelationDO.getYljzPay()+"',\n" +
 | 
	
		
			
				|  |  |                         "       OTH_PAY      = '"+ylzMedicalRelationDO.getOtherPay()+"',\n" +
 | 
	
		
			
				|  |  |                         "       PSN_PART_AMT      = '"+ylzMedicalRelationDO.getPersonCash()+"',\n" +
 | 
	
		
			
				|  |  |                         "       ACCT_PAY      = '"+ylzMedicalRelationDO.getPersonAccount()+"',\n" +
 | 
	
		
			
				|  |  |                         "       BALC      = '"+ylzMedicalRelationDO.getAccountBalance()+"',\n" +
 | 
	
		
			
				|  |  |                         "       ACCT_MULAID_PAY = '"+ylzMedicalRelationDO.getJtgjPay()+"',\n" +
 | 
	
		
			
				|  |  |                         "       CLR_WAY = '"+(StringUtils.isNoneBlank(ylzMedicalRelationDO.getClrWay())?ylzMedicalRelationDO.getClrWay():0)+"',\n" +
 | 
	
		
			
				|  |  |                         "       CLR_OPTINS = '"+(StringUtils.isNoneBlank(ylzMedicalRelationDO.getClrOptins())?ylzMedicalRelationDO.getClrOptins():0)+"',\n" +
 | 
	
		
			
				|  |  |                         "       CLR_TYPE = '"+(StringUtils.isNoneBlank(ylzMedicalRelationDO.getClrType())?ylzMedicalRelationDO.getClrType():0)+"',\n" +
 | 
	
		
			
				|  |  |                         "       FUND_PAY_SUMAMT = '"+ylzMedicalRelationDO.getMedicalPrice()+"',\n" +
 | 
	
		
			
				|  |  |                         "       SETL_TIME = '"+DateUtil.dateToStrShort(ylzMedicalRelationDO.getPayDate())+"',\n" +
 | 
	
		
			
				|  |  |                         "       OUTYBSFJSON = '"+ylzMedicalRelationDO.getOutJson()+"'\n" +
 | 
	
		
			
				|  |  |                         " where 1 = 1\n" +
 | 
	
		
			
				|  |  |                         "   and LOG_NO = '"+ylzMedicalRelationDO.getLogNo()+"'";
 | 
	
		
			
				|  |  |                 //结算更新
 | 
	
		
			
				|  |  |                 System.out.println("sql=="+sql);
 | 
	
		
			
				|  |  |                 String res = updateUrl(sql);
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             Map<String,Object> params = new HashedMap();
 | 
	
		
			
				|  |  |             String url ="" +"comfirmSettleMent";
 | 
	
		
			
				|  |  |             params.put("mct","03");
 | 
	
		
			
				|  |  |             params.put("mcn",ylzMedicalRelationDO.getCardNo());
 | 
	
		
			
				|  |  |             params.put("xtgzh0",ylzMedicalRelationDO.getLogNo());
 | 
	
		
			
				|  |  |             HttpResponse response = HttpUtils.doGet(url,params);
 | 
	
		
			
				|  |  |             System.out.println("response=="+response.getContent());
 | 
	
		
			
				|  |  |             String res = response.getContent();
 | 
	
		
			
				|  |  |             String operatorId = "HLWYY";
 | 
	
		
			
				|  |  |             String operatorName = "互联网医院";
 | 
	
		
			
				|  |  |             String termNo = "DSYYHLWYY";
 | 
	
		
			
				|  |  |             JSONObject rsObj = confirmPayGjybToHospital(ylzMedicalRelationDO.getCardNo(),ylzMedicalRelationDO.getLogNo(),depositAmount,outChargeNo, operatorId,operatorName,termNo);
 | 
	
		
			
				|  |  |             logger.info("");
 | 
	
		
			
				|  |  |             boolean flag = true;
 | 
	
		
			
				|  |  |             if (StringUtils.isNoneBlank(res)){
 | 
	
		
			
				|  |  |                 JSONObject jsonObject = JSONObject.parseObject(res);
 | 
	
		
			
				|  |  |                 String status = jsonObject.getString("status");
 | 
	
		
			
				|  |  |                 if (status.equalsIgnoreCase("200")){
 | 
	
		
			
				|  |  |                     JSONObject obj = jsonObject.getJSONObject("obj");
 | 
	
		
			
				|  |  |                     String rs = obj.getString("rs");
 | 
	
		
			
				|  |  |                     JSONObject rsObj = JSONObject.parseObject(rs);
 | 
	
		
			
				|  |  |                     String retCode = rsObj.getString("retCode");
 | 
	
		
			
				|  |  |                     if (retCode.equalsIgnoreCase("99")){
 | 
	
		
			
				|  |  |                         flag=false;
 | 
	
		
			
				|  |  |                         throw new Exception(rsObj.getString("retMsg"));
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }else {
 | 
	
		
			
				|  |  |                     flag = false;
 | 
	
		
			
				|  |  |             if (rsObj!=null){
 | 
	
		
			
				|  |  |                 String retCode = rsObj.getString("retCode");
 | 
	
		
			
				|  |  |                 if (retCode.equalsIgnoreCase("99")){
 | 
	
		
			
				|  |  |                     flag=false;
 | 
	
		
			
				|  |  |                     throw new Exception(rsObj.getString("retMsg"));
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }else {
 | 
	
		
			
				|  |  |                 flag=false;
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |             if (flag){
 | 
	
		
			
				|  |  |                 ylzMedicalRelationDO.setState(1);
 | 
	
	
		
			
				|  | @ -1784,7 +1955,7 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 try {
 | 
	
		
			
				|  |  |                     logger.info("=================电子发票开具开始=================");
 | 
	
		
			
				|  |  |                /*     dsyyEntranceService.OutpatientInvoicing(ylzMedicalRelationDO.getHisBillSerial(),"lb");*/
 | 
	
		
			
				|  |  |                    /* hcyyEntranceService.OutpatientInvoicing(ylzMedicalRelationDO.getHisBillSerial(),"lb");*/
 | 
	
		
			
				|  |  |                     logger.info("=================电子发票开具结束=================");
 | 
	
		
			
				|  |  |                 }catch (Exception e){
 | 
	
		
			
				|  |  |                     e.printStackTrace();
 | 
	
	
		
			
				|  | @ -1799,4 +1970,6 @@ public class DsyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
 | 
	
		
			
				|  |  |             throw new Exception(e.getMessage());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | }
 |