Selaa lähdekoodia

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

wujunjie 7 vuotta sitten
vanhempi
commit
4af7c90076

+ 4 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionDao.java

@ -24,4 +24,8 @@ public interface PrescriptionDao extends PagingAndSortingRepository<Prescription
    @Query(value = "select p.prescription_code from wlyy_prescription_pay p LEFT JOIN  wlyy_prescription a on a.code = p.prescription_code where p.trade_status = 1 and a.jw_pay_status = 0",nativeQuery = true)
    List<String> findCodesByPayStautsAndExecuteSickStatus();
    @Modifying
    @Query("update Prescription p set p.jwPayStatus=1 where p.code=?1")
    void updatejwPayStatus(String prescriptionCode);
}

+ 13 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java

@ -156,6 +156,7 @@ public class JwPrescriptionService {
        return response;
    }
    /**
     * 院内结算确认接口
     * @param prescriptionCode 处方CODE
@ -167,6 +168,18 @@ public class JwPrescriptionService {
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("prescriptionCode", prescriptionCode));
        String response = httpClientUtil.post(url, params, "UTF-8");
        if(StringUtils.isNotBlank(response)){
            JSONObject reobj =  JSON.parseObject(response);
            Integer status = reobj.getInteger("status");
            String errmsg = reobj.getString("msg");
            if(-1 == status){
                throw new Exception("基卫接口(院内结算确认接口)请求失败,"+errmsg);
            }else{
                prescriptionDao.updatejwPayStatus(prescriptionCode);
            }
        }else{
            throw new Exception("基卫接口(院内结算确认接口)请求失败,无数据返回!");
        }
        return response;
    }

+ 4 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/prescription/PrescriptionDao.java

@ -30,4 +30,8 @@ public interface PrescriptionDao extends PagingAndSortingRepository<Prescription
    @Query("from Prescription p where p.visitNo=?1 and p.recipeNo=?2 ")
    Prescription findByVisitNoAndRecipeNo(String visitNo,String recipeNo);
    @Modifying
    @Query("update Prescription p set p.jwPayStatus=1 where p.code=?1")
    void updatejwPayStatus(String prescriptionCode);
}

+ 13 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java

@ -167,6 +167,19 @@ public class JwPrescriptionService {
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("prescriptionCode", prescriptionCode));
        String response = httpClientUtil.post(url, params, "UTF-8");
        if(StringUtils.isNotBlank(response)){
            JSONObject reobj =  JSON.parseObject(response);
            Integer status = reobj.getInteger("status");
            String errmsg = reobj.getString("msg");
            if(-1 == status){
                throw new Exception("基卫接口(院内结算确认接口)请求失败,"+errmsg);
            }else{
                prescriptionDao.updatejwPayStatus(prescriptionCode);
            }
        }else{
            throw new Exception("基卫接口(院内结算确认接口)请求失败,无数据返回!");
        }
        return response;
    }