Ver código fonte

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java
wangzhinan 4 anos atrás
pai
commit
5e68c53f09

+ 217 - 0
business/base-service/src/main/java/com/yihu/jw/pay/OnePayShopService.java

@ -0,0 +1,217 @@
/*
package com.yihu.jw.Pay;
import com.alibaba.fastjson.JSON;
import com.yihu.wlyy.entity.health.ShopPayLog;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.health.ShopPayLogDao;
import com.ylzinfo.onepay.sdk.HisOnepayClient;
import com.ylzinfo.onepay.sdk.domain.ResponseParams;
import com.ylzinfo.onepay.sdk.domain.ext.*;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Map;
*/
/**
 * Created by wangzhinan on 2020/1/13.
 *//*
@Service
public class OnePayShopService {
	@Autowired
	private PayLogService logService;
	@Value("${onepay1.onepay_url}")
	private String onepayUrl;
	@Value("${onepay1.appId}")
	private String appId;
	@Value("${onepay1.appSecret}")
	private String appSecret;
	@Value("${wlyy.url}")
	private String wlyyUrl;
	@Autowired
	private SystemDictDao systemDictDao;
	@Autowired
	private ShopPayLogDao shopPayLogDao;
	*/
/**
	 * 支付
	 *
	 * @param operatorId 操作员编码
	 * @param operatorName  操作员姓名
	 * @param cardType 卡类型
	 * @param accountType 账户类型
	 * @param cardNo 卡号
	 * @param idNo 身份证号
	 * @param depositType 充值方式 WX_PUB
	 * @param amount 充值金额
	 * @param outChargeNo 商户充值业务流水号
	 * @param userName 用户姓名
	 * @param openId 微信公共号支付需入参openId
	 * @return
	 *//*
	public String recharge(String operatorId,String operatorName,String cardType,String accountType,String cardNo,String idNo,String depositType,String amount,String outChargeNo,String openId,String userName){
		Boolean isSuccess = true;
		String jsonObject = null;
		RechargeParams param = new RechargeParams();
		String error = null;
		try {
			HisOnepayClient onepayClient = new HisOnepayClient(onepayUrl, appId, appSecret,"MD5","AES");
			param.setOperatorId(operatorId);
			param.setOperatorName(operatorName);
			param.setCardType(cardType);
			param.setAccountType(accountType);
			param.setCardNo(cardNo);
			param.setIdNo(idNo);
			param.setDepositType(depositType);
			param.setAmount(amount);
			param.setOutChargeNo(outChargeNo);
			param.setUserName(userName);
			Map<String, String> extra = new HashedMap();
			extra.put("openId",openId);
		*/
/*	String value = systemDictDao.findByDictNameAndCode("RETURN_URL","RETURN_URL");
			extra.put("returnUrl",value);*//*
			extra.put("notifyUrl", wlyyUrl+"/third/order/receiveNotify");
			param.setExtra(extra);
			ResponseParams<RechargeResult> respnse = onepayClient.recharge(param);
			if (respnse.getRespCode().equals("000000")){
				jsonObject = JSON.toJSONString(respnse);
			}else {
				isSuccess = false;
				jsonObject = JSON.toJSONString(respnse);
				error = "请求失败,返回结果:" + respnse.getRespCode() + "," + respnse.getRespMsg();
			}
			if (respnse!=null){
				ShopPayLog payLog =shopPayLogDao.selectByCode(respnse.getParam().getOutChargeNo());
				payLog.setTradeNo(respnse.getParam().getTraceNo());
				shopPayLogDao.save(payLog);
			}
		} catch (Exception e) {
			isSuccess = false;
			StringWriter sw = new StringWriter();
			PrintWriter pw = new PrintWriter(sw);
			e.printStackTrace(pw);
			error = sw.toString();
		}
		logService.saveHttpLog(isSuccess, "hop.trade.recharge", "商城充值", "POST", null,JSON.toJSONString(param), jsonObject, error,logService.shoppatType);
		return jsonObject;
	}
	*/
/**
	 *
	 * 退款
	 *
	 * @param operatorId 操作者id
	 * @param operatorName 操作者名字
	 * @param cardType 卡类型
	 * @param accountType 账号类型
	 * @param cardNo 卡号
	 * @param idNo 身份证号
	 * @param amount 退款金额
	 * @param outChargeNo 原充值订单号
	 * @param userName 用户名字
	 * @param withdrawMode 退款方式         0 现金退回1 原路退回2 银企转账3 医保自费退回
	 * @param traceNo 平台交易跟踪号
	 * @param outRefundNo 退款订单号
	 * @return
	 *//*
	public String refund(String operatorId,String operatorName,String cardType,String accountType,String cardNo,String idNo,String amount,String outChargeNo,String userName,String withdrawMode,String traceNo,String outRefundNo,String hisCustId){
		Boolean isSuccess = true;
		String jsonObject = null;
		RefundParams param = new RefundParams();
		String error = null;
		try {
			ShopPayLog shopPayLog = shopPayLogDao.selectByCode(outChargeNo);
			HisOnepayClient onepayClient = new HisOnepayClient(onepayUrl, appId, appSecret,"MD5","AES");
			param.setOperatorId(operatorId);
			param.setOperatorName(operatorName);
			param.setOutChargeNo(outChargeNo);
			param.setCardType(cardType);
			param.setCardNo(cardNo);
			param.setAccountType(accountType);
			param.setAmount(amount);
			param.setWithdrawMode(withdrawMode);
			param.setOutChargeNo(outChargeNo);
			param.setTraceNo(shopPayLog.getTradeNo());
			param.setOutRefundNo(outRefundNo);
			param.setHisCustId(hisCustId);
			param.setIdNo(idNo);
			param.setUserName(userName);
			ResponseParams<RefundResult> respnse = onepayClient.refund(param);
			if (respnse.getRespCode().equals("000000")){
				jsonObject = JSON.toJSONString(respnse);
				shopPayLog.setOutRefundNo(respnse.getParam().getOutRefundNo());
				shopPayLog.setRefundNo(respnse.getParam().getOutRefundNo());
				shopPayLog.setRefundAmount(amount);
				shopPayLogDao.save(shopPayLog);
			}else {
				jsonObject = JSON.toJSONString(respnse);
				isSuccess = false;
				error = "请求失败,返回结果:" + respnse.getRespCode() + "," + respnse.getRespMsg();
			}
		} catch (Exception e) {
			isSuccess = false;
			StringWriter sw = new StringWriter();
			PrintWriter pw = new PrintWriter(sw);
			e.printStackTrace(pw);
			error = sw.toString();
		}
		logService.saveHttpLog(isSuccess, "hop.trade.refund", "商城退款", "POST", null,JSON.toJSONString(param), jsonObject, error, logService.shoppatType);
		return jsonObject;
	}
	*/
/**
	 * 查询余额
	 *
	 * @param operatorId
	 * @param operatorName
	 * @param termNo
	 * @param tradeType
	 * @param outTradeNo
	 * @param traceNo
	 * @return
	 *//*
	public String tradeQuery(String operatorId,String operatorName,String termNo,String tradeType,String outTradeNo,String traceNo){
		Boolean isSuccess = true;
		String jsonObject = null;
		TradeQueryParams param = new TradeQueryParams();
		String error = null;
		try {
			HisOnepayClient onepayClient = new HisOnepayClient(onepayUrl, appId, appSecret,"MD5","AES");
			param.setOperatorId(operatorId);
			param.setOperatorName(operatorName);
			param.setTradeType(tradeType);
			param.setOutTradeNo(outTradeNo);
			param.setTraceNo(traceNo);
			ResponseParams<TradeQueryResult> respnse = onepayClient.tradeQuery(param);
			if (respnse.getRespCode().equals("000000")){
				jsonObject = JSON.toJSONString(respnse);
			}else {
				isSuccess = false;
				jsonObject = JSON.toJSONString(respnse);
				error = "请求失败,返回结果:" + respnse.getRespCode() + "," + respnse.getRespMsg();
			}
		} catch (Exception e) {
			isSuccess = false;
			StringWriter sw = new StringWriter();
			PrintWriter pw = new PrintWriter(sw);
			e.printStackTrace(pw);
			error = sw.toString();
		}
		logService.saveHttpLog(isSuccess, "hop.trade.query", "商城充值查询", "POST", null,JSON.toJSONString(param), jsonObject, error,logService.shoppatType);
		return jsonObject;
	}
}*/

+ 6 - 0
business/base-service/src/main/java/com/yihu/jw/utils/hibernate/HibenateUtils.java

@ -154,4 +154,10 @@ public class HibenateUtils {
        }
    }
    public void save(Object object) {
        Session session = (Session) entityManager.getDelegate();
        session.saveOrUpdate(object);
    }
}

+ 88 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/order/BusinessOrderDO.java

@ -0,0 +1,88 @@
package com.yihu.jw.entity.order;
import com.yihu.jw.entity.IntegerIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
/**
 * 业务订单表
 */
@Entity
@Table(name = "base_business_order_pay")
public class BusinessOrderDO extends IntegerIdentityEntityWithOperator {
    private String orderNo;//订单号
    private Integer orderType;//订单类型
    private String relationCode;//业务关联code
    private String relationName;//业务关联名称
    private Integer payType;//支付类型1微信2支付宝
    private Double payPrice;//支付金额
    private Integer status;//0待支付1支付成功2支付失败3取消
    @Column(name = "order_no")
    public String getOrderNo() {
        return orderNo;
    }
    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }
    @Column(name = "order_type")
    public Integer getOrderType() {
        return orderType;
    }
    public void setOrderType(Integer orderType) {
        this.orderType = orderType;
    }
    @Column(name = "relation_code")
    public String getRelationCode() {
        return relationCode;
    }
    public void setRelationCode(String relationCode) {
        this.relationCode = relationCode;
    }
    @Column(name = "relation_name")
    public String getRelationName() {
        return relationName;
    }
    public void setRelationName(String relationName) {
        this.relationName = relationName;
    }
    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }
    @Column(name = "pay_type")
    public Integer getPayType() {
        return payType;
    }
    public void setPayType(Integer payType) {
        this.payType = payType;
    }
    @Column(name = "pay_price")
    public Double getPayPrice() {
        return payPrice;
    }
    public void setPayPrice(Double payPrice) {
        this.payPrice = payPrice;
    }
}

+ 5 - 0
svr/svr-internet-hospital/pom.xml

@ -87,6 +87,11 @@
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-rest-model</artifactId>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>wxpay-sdk</artifactId>
            <version>3.0.9</version>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-request-mapping</artifactId>

+ 14 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/dao/order/businessOrderDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.hospital.dao.order;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface businessOrderDao extends PagingAndSortingRepository<BusinessOrderDO, Integer>, JpaSpecificationExecutor<BusinessOrderDO>  {
}

+ 32 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/order/BusinessOrderService.java

@ -0,0 +1,32 @@
package com.yihu.jw.hospital.service.order;
import com.alibaba.fastjson.JSONObject;
import com.github.wxpay.sdk.WXPay;
import com.github.wxpay.sdk.WXPayConfig;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
import com.yihu.jw.hospital.prescription.dao.OauthYlzConfigDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.ylzinfo.ehc.EhcHandler;
import com.ylzinfo.ehc.common.utils.DateUtils;
import com.ylzinfo.ehc.trans.TransRequest;
import com.ylzinfo.ehc.trans.TransResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.UUID;
/**
 *
 * 业务订单
 */
@Service
public class BusinessOrderService {
}