package com.reefun.provider.module.pay.service.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.reefun.provider.constant.Constant;
import com.reefun.provider.constant.PayOrderStatus;
import com.reefun.provider.constant.PayOrderType;
import com.reefun.provider.constant.SexEnum;
import com.reefun.provider.exception.BizException;
import com.reefun.provider.module.account.dao.AccountInfoDao;
import com.reefun.provider.module.account.dao.AccountReportsDao;
import com.reefun.provider.module.account.dao.AccountTradeDao;
import com.reefun.provider.module.account.model.AccountReports;
import com.reefun.provider.module.account.service.interfaces.AccountInfoSV;
import com.reefun.provider.module.account.service.interfaces.AccountReportsSV;
import com.reefun.provider.module.account.service.interfaces.AccountTradeSV;
import com.reefun.provider.module.account.vo.AccountInfoVO;
import com.reefun.provider.module.account.vo.AccountReportsVO;
import com.reefun.provider.module.account.vo.AccountTradeVO;
import com.reefun.provider.module.auth.model.UserInfo;
import com.reefun.provider.module.auth.service.interfaces.DeptInfoSV;
import com.reefun.provider.module.auth.service.interfaces.UserInfoSV;
import com.reefun.provider.module.enteral.model.EnteralPrint;
import com.reefun.provider.module.enteral.service.interfaces.EnteralPrintSV;
import com.reefun.provider.module.enteral.service.interfaces.EnteralRefundSV;
import com.reefun.provider.module.enteral.vo.EnteralPrintVO;
import com.reefun.provider.module.enteral.vo.EnteralRefundVO;
import com.reefun.provider.module.home.service.interfaces.HomeRecipeSV;
import com.reefun.provider.module.home.service.interfaces.HomeRefundSV;
import com.reefun.provider.module.home.vo.HomeRecipeVO;
import com.reefun.provider.module.patient.model.PatientInfo;
import com.reefun.provider.module.patient.service.interfaces.PatientInfoSV;
import com.reefun.provider.module.pay.dao.PayOrderDao;
import com.reefun.provider.module.pay.model.PayOff;
import com.reefun.provider.module.pay.model.PayOrder;
import com.reefun.provider.module.pay.model.PayRefund;
import com.reefun.provider.module.pay.service.interfaces.*;
import com.reefun.provider.module.pay.vo.PayOrderVO;
import com.reefun.provider.module.powder.dao.PowderRefundDao;
import com.reefun.provider.module.powder.model.PowderRecipe;
import com.reefun.provider.module.powder.model.PowderRefund;
import com.reefun.provider.module.powder.service.interfaces.PowderRecipeSV;
import com.reefun.provider.module.powder.service.interfaces.PowderRefundSV;
import com.reefun.provider.module.powder.vo.PowderRecipeVO;
import com.reefun.provider.module.powder.vo.PowderRefundVO;
import com.reefun.provider.module.redis.service.interfaces.RedisSV;
import com.reefun.provider.module.system.service.interfaces.ParamInfoSV;
import com.reefun.provider.module.system.service.interfaces.SequenceSV;
import com.reefun.provider.util.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
/**
* 支付单服务实现类
* <p>
* Copyright (c) 2020年4月22日 Lan.GuanHeng
*
* @author 蓝冠恒
*/
@Service("payOrderSV")
public class PayOrderSVImpl implements PayOrderSV {
Logger logger = LoggerFactory.getLogger(PayOrderSVImpl.class);
@Autowired
private PayOrderDao payOrderDao;
@Autowired
private RedisSV redisSV;
@Autowired
private ParamInfoSV paramInfoSV;
@Autowired
private PayWaySV payWaySV;
@Autowired
private PayOffSV payOffSV;
@Autowired
private SequenceSV sequenceSV;
@Autowired
private PatientInfoSV patientInfoSV;
@Autowired
private DeptInfoSV deptInfoSV;
@Autowired
private AccountInfoSV accountInfoSV;
@Autowired
private HomeRecipeSV homeRecipeSV;
@Autowired
private PayWeixinSV payWeixinSV;
@Autowired
private PayOrderSV payOrderSV;
@Autowired
private EnteralPrintSV enteralPrintSV;
@Autowired
private HomeRefundSV homeRefundSV;
@Autowired
private AccountTradeSV accountTradeSV;
@Autowired
private PowderRecipeSV powderRecipeSV;
@Autowired
private EnteralRefundSV enteralRefundSV;
@Autowired
private AccountReportsSV accountReportsSV;
@Autowired
private AccountReportsDao accountReportsDao;
@Autowired
private PowderRefundSV powderRefundSV;
@Autowired
private PayRefundSV payRefundSV;
@Autowired
private UserInfoSV userInfoSV;
@Autowired
private PowderRefundDao powderRefundDao;
/**
* 通过预存账号进行支付
*
* @param payOrderVO 支付单信息
* @return 支付单编码
* @throws Exception 抛出异常
*/
@Transactional(rollbackFor = Exception.class)
public long payAccountOrder(PayOrderVO payOrderVO) throws Exception {
if (payOrderVO == null) {
throw new BizException("支付单信息为空");
}
String patientId = payOrderVO.getPatientId();
if (StringUtil.isBlank(patientId)) {
throw new BizException("住院号为空");
}
String plusMinus = payOrderVO.getPlusMinus();
if (!"0".equals(plusMinus) && !"1".equals(plusMinus)) {
throw new BizException("支付单金额加减标识错误,取值范围[0|1]");
}
if (StringUtil.isBlank(payOrderVO.getPayWay())) {
throw new BizException("付款支付方式编码错误");
}
boolean isExist = payWaySV.checkPayWay(payOrderVO.getPayWay());
if (!isExist) {
throw new BizException("支付方式编码错误");
}
String orderType = payOrderVO.getOrderType();
if (StringUtil.isBlank(orderType)) {
throw new BizException("付款单类型为空");
}
if (StringUtil.isBlank(PayOrderType.getName(orderType))) {
throw new BizException("付款单类型错误");
}
String operator = payOrderVO.getOperator();
if (StringUtil.isBlank(operator)) {
throw new BizException("操作人为空");
}
UserInfo user = userInfoSV.getUser(operator);
if (user!=null){
payOrderVO.setExecutor(user.getUserName());
}
PayOrder payOrder = new PayOrder();
BeanUtil.copyObject(payOrderVO, payOrder);
//启用资金账户
payOrder.setAccountFlag("1");
//无过渡状态
payOrder.setStatus(PayOrderStatus.STATUS02.getIndex());
double payMoney = payOrderVO.getMoney();
if ("0".equals(plusMinus)) {
// 数据库存支付金额自带符号,便于计算
payOrder.setMoney(0 - payMoney);
}
if ("1".equals(payOrderVO.getInvoiceFlag()) && StringUtil.isBlank(payOrderVO.getInvoiceCode())) {
throw new BizException("发票编码为空");
}
if (StringUtil.isNotBlank(payOrderVO.getInvoiceCode())) {
payOrder.setInvoiceFlag("1");
} else {
payOrder.setInvoiceFlag("0");
}
if(PayOrderType.getName(orderType).equals("02")||PayOrderType.getName(orderType).equals("03")){
//判断患者是否存在未审核的肠内/粉剂退款申请
HashMap<String, Object> enteralRefund=new HashMap<>();
enteralRefund.put("offset", 0);
enteralRefund.put("rows", 10);
enteralRefund.put("patientId",payOrderVO.getPatientId());
enteralR
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
本设计源码提供了一个基于Java技术的广西中医药大学第一附属医院东葛院区系统,包含814个文件,其中包括686个java源文件,120个xml配置文件,2个md文档,2个bat批处理文件,2个sh脚本文件,以及1个gitignore文件和1个yml配置文件。该系统旨在为广西中医药大学第一附属医院东葛院区提供一套完整的信息化解决方案,包括患者管理、医疗记录、药品管理等功能,帮助医院提高运营效率和医疗服务质量。
资源推荐
资源详情
资源评论
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 813 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/326bc6aa99bd4e068708ab91a88ba159_weixin_44087733.jpg!1)
沐知全栈开发
- 粉丝: 5260
- 资源: 5025
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)