修复退费bug,收费室模块新增预估余额功能
This commit is contained in:
@@ -89,10 +89,13 @@ public class GuahaoTask {
|
|||||||
// 2. 执行退费
|
// 2. 执行退费
|
||||||
Map<String, Object> refundResult = reserve8Service.MOP_BillsPayedRefund(vo);
|
Map<String, Object> refundResult = reserve8Service.MOP_BillsPayedRefund(vo);
|
||||||
log.info("退费结果: {}", refundResult + ",判断结果:" + (refundResult != null ? refundResult.get("return_code") : "null"));
|
log.info("退费结果: {}", refundResult + ",判断结果:" + (refundResult != null ? refundResult.get("return_code") : "null"));
|
||||||
|
boolean isSuccess = refundResult != null &&
|
||||||
|
("1".equals(refundResult.get("returncode")) ||
|
||||||
|
"SUCCESS".equals(refundResult.get("return_code"))) &&
|
||||||
|
("success".equals(refundResult.get("refundResult")) ||
|
||||||
|
"SUCCESS".equals(refundResult.get("result_code")));
|
||||||
|
|
||||||
if (refundResult == null ||
|
if (!isSuccess) {
|
||||||
!"SUCCESS".equals(refundResult.get("return_code")) ||
|
|
||||||
!"SUCCESS".equals(refundResult.get("result_code"))) {
|
|
||||||
reserve8Mapper.insertRefundError(vo);
|
reserve8Mapper.insertRefundError(vo);
|
||||||
log.warn("退费接口返回失败: {}", refundResult);
|
log.warn("退费接口返回失败: {}", refundResult);
|
||||||
log.warn("退费失败,继续处理下一个记录");
|
log.warn("退费失败,继续处理下一个记录");
|
||||||
|
|||||||
@@ -748,7 +748,10 @@ public class WxPayService {
|
|||||||
// getMzjfListByFlow
|
// getMzjfListByFlow
|
||||||
HsjcVo hsjcvo = hsjcMapper.getMzjfListByFlow2(outTradeNo);
|
HsjcVo hsjcvo = hsjcMapper.getMzjfListByFlow2(outTradeNo);
|
||||||
// hsjcvo = list.get(0);
|
// hsjcvo = list.get(0);
|
||||||
|
if (hsjcvo != null && hsjcvo.getAppStatus() == 5){
|
||||||
|
log.info("门诊已经退过费用");
|
||||||
|
return "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>";
|
||||||
|
}
|
||||||
hsjcMapper.updateByOutTradeNo(outTradeNo,5);
|
hsjcMapper.updateByOutTradeNo(outTradeNo,5);
|
||||||
// refundVo.setPatientid(hsjcvo.getPatientid());
|
// refundVo.setPatientid(hsjcvo.getPatientid());
|
||||||
// refundVo.setBillsmsg(hsjcvo.getReferno());
|
// refundVo.setBillsmsg(hsjcvo.getReferno());
|
||||||
@@ -767,6 +770,10 @@ public class WxPayService {
|
|||||||
|
|
||||||
}else if (outTradeNo.substring(0, 2).equals("BA")){
|
}else if (outTradeNo.substring(0, 2).equals("BA")){
|
||||||
BingAnVO bingAnVO = binganMapper.selectByOrderNo(outTradeNo);
|
BingAnVO bingAnVO = binganMapper.selectByOrderNo(outTradeNo);
|
||||||
|
if (bingAnVO != null && bingAnVO.getStatus() == 0){
|
||||||
|
log.info("病案已经退过费用");
|
||||||
|
return "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>";
|
||||||
|
}
|
||||||
// 手动病案退款
|
// 手动病案退款
|
||||||
binganMapper.updateByOrderNoAndStatus(outTradeNo);
|
binganMapper.updateByOrderNoAndStatus(outTradeNo);
|
||||||
|
|
||||||
@@ -1016,7 +1023,10 @@ public class WxPayService {
|
|||||||
// getMzjfListByFlow
|
// getMzjfListByFlow
|
||||||
HsjcVo hsjcvo = hsjcMapper.getMzjfListByFlow2(outTradeNo);
|
HsjcVo hsjcvo = hsjcMapper.getMzjfListByFlow2(outTradeNo);
|
||||||
// hsjcvo = list.get(0);
|
// hsjcvo = list.get(0);
|
||||||
|
if (hsjcvo != null && hsjcvo.getAppStatus() == 5){
|
||||||
|
log.info("门诊已经退过费用");
|
||||||
|
return "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>";
|
||||||
|
}
|
||||||
hsjcMapper.updateByOutTradeNo(outTradeNo,5);
|
hsjcMapper.updateByOutTradeNo(outTradeNo,5);
|
||||||
refundVo.setPatientid(hsjcvo.getPatientid());
|
refundVo.setPatientid(hsjcvo.getPatientid());
|
||||||
refundVo.setBillsmsg(hsjcvo.getReferno());
|
refundVo.setBillsmsg(hsjcvo.getReferno());
|
||||||
@@ -1035,6 +1045,11 @@ public class WxPayService {
|
|||||||
|
|
||||||
}else if (outTradeNo.substring(0, 2).equals("BA")){
|
}else if (outTradeNo.substring(0, 2).equals("BA")){
|
||||||
BingAnVO bingAnVO = binganMapper.selectByOrderNo(outTradeNo);
|
BingAnVO bingAnVO = binganMapper.selectByOrderNo(outTradeNo);
|
||||||
|
if (bingAnVO != null && bingAnVO.getStatus() == 0){
|
||||||
|
log.info("病案已经退过费用");
|
||||||
|
return "<xml><return_code><![CDATA[SUCCESS]]></return_code><return_msg><![CDATA[OK]]></return_msg></xml>";
|
||||||
|
}
|
||||||
|
|
||||||
// 手动病案退款
|
// 手动病案退款
|
||||||
binganMapper.updateByOrderNoAndStatus(outTradeNo);
|
binganMapper.updateByOrderNoAndStatus(outTradeNo);
|
||||||
|
|
||||||
|
|||||||
@@ -195,9 +195,13 @@ public class ReserveController {
|
|||||||
// 2. 执行退费
|
// 2. 执行退费
|
||||||
refundResult = reserve8Service.MOP_BillsPayedRefund(vo);
|
refundResult = reserve8Service.MOP_BillsPayedRefund(vo);
|
||||||
log.info("退费结果: {}", refundResult + ",判断结果:" + refundResult.get("return_code"));
|
log.info("退费结果: {}", refundResult + ",判断结果:" + refundResult.get("return_code"));
|
||||||
if (refundResult == null ||
|
boolean isSuccess = refundResult != null &&
|
||||||
!"SUCCESS".equals(refundResult.get("return_code")) ||
|
("1".equals(refundResult.get("returncode")) ||
|
||||||
!"SUCCESS".equals(refundResult.get("result_code"))) {
|
"SUCCESS".equals(refundResult.get("return_code"))) &&
|
||||||
|
("success".equals(refundResult.get("refundResult")) ||
|
||||||
|
"SUCCESS".equals(refundResult.get("result_code")));
|
||||||
|
|
||||||
|
if (!isSuccess) {
|
||||||
log.warn("退费接口返回失败: {}", refundResult);
|
log.warn("退费接口返回失败: {}", refundResult);
|
||||||
// 将失败内容存到数据库,进行每1小时一次退款任务
|
// 将失败内容存到数据库,进行每1小时一次退款任务
|
||||||
reserve8Service.insertRefundError(vo);
|
reserve8Service.insertRefundError(vo);
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.guahao.h5.yb.model.OrderInfoVO;
|
|||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.guahao.h5.hsjc.mapper.HsjcMapper;
|
|||||||
import com.guahao.h5.hsjc.vo.HsjcVo;
|
import com.guahao.h5.hsjc.vo.HsjcVo;
|
||||||
import com.guahao.h5.reserve.mapper.Reserve8Mapper;
|
import com.guahao.h5.reserve.mapper.Reserve8Mapper;
|
||||||
import com.guahao.h5.reserve.vo.Reserve8Vo;
|
import com.guahao.h5.reserve.vo.Reserve8Vo;
|
||||||
|
import com.guahao.h5.sfs.service.SfsService;
|
||||||
import com.guahao.h5.token.service.TokenService;
|
import com.guahao.h5.token.service.TokenService;
|
||||||
import com.guahao.h5.token.vo.TokenVo;
|
import com.guahao.h5.token.vo.TokenVo;
|
||||||
import com.guahao.h5.yb.model.OrderInfoVO;
|
import com.guahao.h5.yb.model.OrderInfoVO;
|
||||||
@@ -17,7 +18,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author SangChengZhi
|
* @author SangChengZhi
|
||||||
@@ -33,6 +36,8 @@ public class SfsController {
|
|||||||
private Reserve8Mapper reserve8Mapper;
|
private Reserve8Mapper reserve8Mapper;
|
||||||
@Autowired
|
@Autowired
|
||||||
private HsjcMapper hsjcMapper;
|
private HsjcMapper hsjcMapper;
|
||||||
|
@Autowired
|
||||||
|
private SfsService sfsService;
|
||||||
|
|
||||||
@RequestMapping(value = "/selectGuaHaoList", method = RequestMethod.POST)
|
@RequestMapping(value = "/selectGuaHaoList", method = RequestMethod.POST)
|
||||||
@WebLog(description = "收费室查询用户的挂号记录")
|
@WebLog(description = "收费室查询用户的挂号记录")
|
||||||
@@ -116,6 +121,26 @@ public class SfsController {
|
|||||||
return ResponseResult.sysError(e.getLocalizedMessage());
|
return ResponseResult.sysError(e.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@RequestMapping(value = "/SumWxBalance", method = RequestMethod.POST)
|
||||||
|
@WebLog(description = "查询微信当前账户余额")
|
||||||
|
public Object SumWxBalance() {
|
||||||
|
try {
|
||||||
|
Map<String, BigDecimal> balances = sfsService.SumWxBalance();
|
||||||
|
return ResponseResult.success(balances);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ResponseResult.sysError(e.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@RequestMapping(value = "/DelWxBalance", method = RequestMethod.POST)
|
||||||
|
@WebLog(description = "查询微信当前账户退费")
|
||||||
|
public Object DelWxBalance() {
|
||||||
|
try {
|
||||||
|
Map<String, BigDecimal> balances = sfsService.DelWxBalance();
|
||||||
|
return ResponseResult.success(balances);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ResponseResult.sysError(e.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* token验证
|
* token验证
|
||||||
|
|||||||
Reference in New Issue
Block a user