瀏覽代碼

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

chenweida 7 年之前
父節點
當前提交
b3261894dd

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -327,7 +327,7 @@ public class PrescriptionInfoService extends BaseService {
     * @param code
     * @return
     */
    public int cancelPrescriotion(String code,String reason){
    public int cancelPrescriotion(String code,String reason)throws Exception{
        Prescription p = prescriptionDao.findByCode(code);
        p.setStatus(PrescriptionLog.PrescriptionLogStatus.patient_canel.getValue());
        p.setCancelReason(reason);
@ -349,7 +349,7 @@ public class PrescriptionInfoService extends BaseService {
        prescriptionLogDao.save(log);
        //同步智业接口
        //upLoadPrescriotionState();
        jwPrescriptionService.fadeRecipe(code);
        return 1;
    }

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

@ -1,9 +1,11 @@
package com.yihu.wlyy.service.third.jw;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.util.HttpClientUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.slf4j.Logger;
@ -170,22 +172,36 @@ public class JwPrescriptionService {
    /**
     * 挂号作废处方接口
     * @param visitNo 挂号号
     * @param fadeDept 作废科室编码
     * @param fadeOperator 作废人员编码
     * @param prescriptionCode 续方号码
     * @return
     * @throws Exception
     */
    public String fadeRecipe(String prescriptionCode)throws Exception{
        Prescription prescription = prescriptionDao.findByCode(prescriptionCode);
        String url = jwUrl + "/third/prescription/fadeRecipe";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("visitNo", prescription.getVisitNo()));//挂号号
        params.add(new BasicNameValuePair("fadeDept", prescription.getJwDeptCode()));//作废科室编码
        params.add(new BasicNameValuePair("fadeOperator", prescription.getJwDoctorCode()));//作废人员编码
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
        if(StringUtils.isNotBlank(prescription.getVisitNo())){
            String url = jwUrl + "/third/prescription/fadeRecipe";
            List<NameValuePair> params = new ArrayList<>();
            params.add(new BasicNameValuePair("visitNo", prescription.getVisitNo()));//挂号号
            params.add(new BasicNameValuePair("fadeDept", prescription.getJwDeptCode()));//作废科室编码
            params.add(new BasicNameValuePair("fadeOperator", prescription.getJwDoctorCode()));//作废人员编码
            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{
                throw new Exception("基卫接口(挂号作废)请求失败,无数据返回!");
            }
            return response;
        }
        return "";
    }
    /**

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionInfoController.java

@ -99,7 +99,7 @@ public class PatientPrescriptionInfoController extends BaseController {
            return write(200, "查询成功!", "data", prescriptionInfoService.cancelPrescriotion(code,reason));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
            return error(-1, "取消失败!");
        }
    }