Explorar el Código

Merge branch 'dev' of wujunjie/patient-co-management into dev

yeshijie hace 8 años
padre
commit
443323e703

+ 10 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PatientPrescriptionPayService.java

@ -254,7 +254,8 @@ public class PatientPrescriptionPayService extends BaseService {
     * @param
     * @return
     */
    public void recipeReturnUrl(HttpServletRequest request, HttpServletResponse response, String accessToken) throws Exception {
    public Map recipeReturnUrl(HttpServletRequest request, HttpServletResponse response, String accessToken) throws Exception {
        Map resultMap = new HashMap();
        Prescription prescription = null;
        int flag = 0;
        Boolean isSuccess = false;
@ -415,6 +416,8 @@ public class PatientPrescriptionPayService extends BaseService {
            prescription = prescriptionDao.findByCode(prescriptionCode);
            PrescriptionExpressage expressage = expressageDao.findByPrescriptionPay(prescriptionCode);
            if ("0".equals(tradeStatus)) {
                //支付成功返回续方code给前端
                resultMap.put("prescriptionCode",prescriptionCode);
                prescriptionPay.setTradeStatus("1");//交易状态 成功1 失败0
                prescription.setStatus(30);//续费状态 30支付成功 21支付失败
                expressage.setDel(1);//快递信息状态 1可用 0删除
@ -456,6 +459,7 @@ public class PatientPrescriptionPayService extends BaseService {
        logService.saveHttpLog(isSuccess, config.getReturnUrl(), "长处方支付页面跳转", "POST", null, "", responses, error, logService.onepayType);
        //记录支付log日志到数据库
        payLogService.addLog(prescription, 2, flag, 1);
        return resultMap;
    }
    /**
@ -645,7 +649,8 @@ public class PatientPrescriptionPayService extends BaseService {
     * 长处方支付,成功则返回支付路径
     */
    @Transactional
    public String charge(int type, String addressJson, String orgCode, String prescriptionCode, int totalAmount, String people, String accessToken, String returnUrl) throws Exception {
    public Map charge(int type, String addressJson, String orgCode, String prescriptionCode, int totalAmount, String people, String accessToken, String returnUrl) throws Exception {
        Map resultMap = new HashMap();
        //获取机构映射
        HospitalMapping hos = mappingDao.findByCode(orgCode);
        if (hos == null) {
@ -957,8 +962,9 @@ public class PatientPrescriptionPayService extends BaseService {
        if (!isSuccess) {
            throw new Exception(error);
        }
        return result;
        resultMap.put("outChargeNo", uuid);
        resultMap.put("payUrl", result);
        return resultMap;
    }

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionPayController.java

@ -78,7 +78,7 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
        try {
            String accessToken = getAccessToken();
            String patient = getUID();
            String result = payService.charge(type,addressJson,orgCode, prescriptionCode, totalAmount, patient, accessToken,returnUrl);
            Map result = payService.charge(type,addressJson,orgCode, prescriptionCode, totalAmount, patient, accessToken,returnUrl);
            return write(200, "支付成功!","data",result);
        } catch (Exception e) {
            return error(-1, "支付失败!");
@ -115,8 +115,8 @@ public class PatientPrescriptionPayController extends WeixinBaseController {
    public String recipeReturnUrl(HttpServletRequest request, HttpServletResponse response) throws Exception {
        try {
            String accessToken = getAccessToken();
            payService.recipeReturnUrl(request, response, accessToken);
            return write(200, "页面回调成功!");
            Map result = payService.recipeReturnUrl(request, response, accessToken);
            return write(200, "页面回调成功!","data",result);
        } catch (Exception e) {
            return error(-1, "页面回调失败!");
        }