修改退款,退款失败,增加发送短信通知,兼容社区人员退款

This commit is contained in:
yuyang 2021-12-24 18:14:26 +08:00
parent 4c8350a1dc
commit b0e9684017
9 changed files with 248 additions and 52 deletions

View File

@ -118,6 +118,10 @@ public class StatusConstants {
*/
public static final Integer FLOWING_WATER_CHARGE = 3;
/**
* 流水类型退款失败
*/
public static final Integer FLOWING_WATER_REFUND_ERROE = 4;
/**
* 对账状态待确认
*/

View File

@ -70,6 +70,9 @@ public class XhpcSmsController extends BaseController {
} else if (content.contains("设定的SOC")) {
signatureName = "小华充电";
templateId = "SMS_227005968";
}else if (content.contains("退款-尊敬的用户")) {
signatureName = "小华充电";
templateId = "SMS_231445428";
}
xhpcSmsService.sendNotice(phone, signatureName, templateId, paramMap);

View File

@ -7,6 +7,7 @@ import com.alipay.api.domain.AlipayFundTransUniTransferModel;
import com.alipay.api.domain.Participant;
import com.alipay.api.request.AlipayFundTransUniTransferRequest;
import com.alipay.api.response.AlipayFundTransUniTransferResponse;
import com.xhpc.common.api.SmsService;
import com.xhpc.common.core.constant.HttpStatus;
import com.xhpc.common.core.constant.StatusConstants;
import com.xhpc.common.core.utils.DateUtils;
@ -38,7 +39,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import org.springframework.web.bind.annotation.*;
@ -49,6 +49,7 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.security.KeyStore;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -73,6 +74,9 @@ public class XhpcRefundAuditController extends BaseController {
@Autowired
private Environment environment;
@Autowired
private SmsService smsService;
private static final Logger logger = LoggerFactory.getLogger(XhpcRefundAuditController.class);
/**
* 退款审核
@ -119,8 +123,6 @@ public class XhpcRefundAuditController extends BaseController {
return AjaxResult.error();
}
if (StatusConstants.REFUND_ORDER_STATUS_SUCCESS == xhpcRefundAudit.getStatus()) {
String amount = "-" + StringUtils.valueOf(map.get("amount"));
xhpcUserAccountStatementService.add(xhpcRefundAudit.getRefundOrderId(), amount, userId, StatusConstants.FLOWING_WATER_REFUND);
String type = StringUtils.valueOf(map.get("type"));
if (StatusConstants.OPERATION_WX_TYPE.equals(type)) {
return enterpriseCheckOut(xhpcRefundAudit);
@ -129,7 +131,22 @@ public class XhpcRefundAuditController extends BaseController {
return zhbCheckOut(xhpcRefundAudit);
}
}
updateXhpcRefundOrder(refundOrderId,2);
XhpcRefundOrder refundOrder=new XhpcRefundOrder();
refundOrder.setRefundOrderId(refundOrderId);
refundOrder.setStatus(2);
refundOrder.setExamineStatus(2);
refundOrder.setRemark("退款订单状态不对");
String amount = "-" + StringUtils.valueOf(map.get("amount"));
int source = Integer.parseInt(map.get("source").toString());
String phone="";
if(source==0){
phone=map.get("phone").toString();
}else{
phone=map.get("communityPhone").toString();
}
updateXhpcRefundOrder(refundOrder,amount,userId,phone,2);
return AjaxResult.success();
}
@ -186,22 +203,35 @@ public class XhpcRefundAuditController extends BaseController {
*/
public AjaxResult enterpriseCheckOut(@RequestBody XhpcRefundAudit xhpcRefundAudit) {
//只有审核通过才能退款
XhpcRefundOrder refundOrder=new XhpcRefundOrder();
Long refundOrderId = xhpcRefundAudit.getRefundOrderId();
refundOrder.setRefundOrderId(refundOrderId);
Map<String, Object> xhpcRefundOrder = iXhpcRefundOrderService.info(xhpcRefundAudit.getRefundOrderId());
if (StringUtils.isNull(xhpcRefundOrder)) {
updateXhpcRefundOrder(refundOrderId,2);
return AjaxResult.error(HttpStatus.DATA_ERROR, "订单不存在");
}
int source = Integer.parseInt(xhpcRefundOrder.get("source").toString());
String phone="";
if(source==0){
phone=xhpcRefundOrder.get("phone").toString();
}else{
phone=xhpcRefundOrder.get("communityPhone").toString();
}
String userId = StringUtils.valueOf(xhpcRefundOrder.get("userId"));
Double amount = Double.parseDouble(StringUtils.valueOf(xhpcRefundOrder.get("amount")));
String amountRefundOrder = "-" + amount.toString();
String examineStatus = StringUtils.valueOf(xhpcRefundOrder.get("examineStatus"));
if (!"1".equals(examineStatus)) {
updateXhpcRefundOrder(refundOrderId,2);
refundOrder.setStatus(2);
refundOrder.setRemark("订单状态不能退款");
updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,2);
return AjaxResult.error(HttpStatus.ERROR_STATUS, "订单状态不能退款");
}
String status = StringUtils.valueOf(xhpcRefundOrder.get("status"));
if (!"0".equals(status)) {
updateXhpcRefundOrder(refundOrderId,2);
refundOrder.setStatus(2);
refundOrder.setRemark("订单状态不能退款");
updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,2);
return AjaxResult.error(HttpStatus.ERROR_STATUS, "订单状态不能退款");
}
@ -217,25 +247,31 @@ public class XhpcRefundAuditController extends BaseController {
}
String orderOutNumber = StringUtils.valueOf(xhpcRefundOrder.get("refundOrderNumber"));
String openId = StringUtils.valueOf(xhpcRefundOrder.get("openId"));
Double amount = Double.parseDouble(StringUtils.valueOf(xhpcRefundOrder.get("amount")));
//Double amount = Double.parseDouble(StringUtils.valueOf(xhpcRefundOrder.get("amount")));
//退款金额单位为分
Double value = amount * 100;
Integer refund_fee = value.intValue();
if (refund_fee <= 0) {
updateXhpcRefundOrder(refundOrderId,2);
refundOrder.setStatus(2);
refundOrder.setRemark("订单金额出错");
updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,2);
return AjaxResult.error(HttpStatus.ERROR_STATUS, "订单金额出错");
}
String userId = StringUtils.valueOf(xhpcRefundOrder.get("userId"));
Map<String, Object> appUserInfo = xhpcUserAccountStatementMapper.appUserInfo(Long.parseLong(userId));
String balance = StringUtils.valueOf(appUserInfo.get("balance"));
if (StringUtils.isNull(appUserInfo)) {
updateXhpcRefundOrder(refundOrderId,2);
refundOrder.setStatus(2);
refundOrder.setRemark("用户不存在");
updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,2);
return AjaxResult.error(HttpStatus.DATA_ERROR, "用户不存在");
}
BigDecimal surplus = BigDecimal.valueOf(Double.valueOf(balance)).subtract(BigDecimal.valueOf(amount));
if (surplus.compareTo(BigDecimal.ZERO) == -1) {
updateXhpcRefundOrder(refundOrderId,2);
refundOrder.setStatus(2);
refundOrder.setRemark("余额不足");
updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,2);
return AjaxResult.error(HttpStatus.ERROR_STATUS, "余额不足");
}
String result = "";
@ -259,7 +295,7 @@ public class XhpcRefundAuditController extends BaseController {
} finally {
httpPost.abort();
}
return parseXml(result, xhpcRefundAudit.getRefundOrderId(), BigDecimal.valueOf(amount), userId);
return parseXml(result, xhpcRefundAudit.getRefundOrderId(), BigDecimal.valueOf(amount), userId,phone);
}
@ -345,17 +381,28 @@ public class XhpcRefundAuditController extends BaseController {
* @param result 请求后的结果
* @return
*/
private AjaxResult parseXml(String result, Long id, BigDecimal amount, String userId) {
private AjaxResult parseXml(String result, Long id, BigDecimal amount, String userId,String phone) {
XhpcRefundOrder refundOrder=new XhpcRefundOrder();
refundOrder.setRefundOrderId(id);
String amountRefundOrder = "-" + amount.toString();
try {
Map<String, String> map = WXPayUtil.xmlToMap(result);
String result_code = map.get("result_code");
if ("FAIL".equals(result_code)) {
refundOrder.setStatus(2);
refundOrder.setRemark(map.get("err_code_des").toString());
updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,2);
logger.info("++++++++++++审核失败原因++++++++++++++++"+map.get("err_code_des").toString());
return AjaxResult.error(map.get("err_code_des"));
} else {
//退款成功修改订单
Map<String, Object> appUserInfo = xhpcUserAccountStatementMapper.appUserInfo(Long.parseLong(userId));
if (StringUtils.isNotNull(appUserInfo)) {
refundOrder.setStatus(1);
refundOrder.setRemark("微信退款成功");
refundOrder.setPaymentNo(map.get("payment_no").toString());
refundOrder.setPaymentTime(map.get("payment_time").toString());
updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,1);
String balance = StringUtils.valueOf(appUserInfo.get("balance"));
//减少用户余额
XhpcAppUser xhpcAppUser = new XhpcAppUser();
@ -363,15 +410,17 @@ public class XhpcRefundAuditController extends BaseController {
BigDecimal surplus =new BigDecimal(balance).subtract(amount);
xhpcAppUser.setBalance(surplus);
xhpcUserAccountStatementMapper.updateAppUserBalance(xhpcAppUser);
updateXhpcRefundOrder(id,1);
}
return AjaxResult.success("退款成功");
}
} catch (Exception e) {
AjaxResult.error(e.getMessage());
e.printStackTrace();
logger.info("++++++++++++审核异常++++++++++++++++"+e.getMessage());
}
updateXhpcRefundOrder(id,1);
refundOrder.setStatus(2);
refundOrder.setRemark("审核异常");
updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,2);
return AjaxResult.error();
}
@ -381,47 +430,67 @@ public class XhpcRefundAuditController extends BaseController {
* 27
*/
public AjaxResult zhbCheckOut(@RequestBody XhpcRefundAudit xhpcRefundAudit){
XhpcRefundOrder refundOrder =new XhpcRefundOrder();
//修改订单状态
Long refundOrderId = xhpcRefundAudit.getRefundOrderId();
refundOrder.setRefundOrderId(refundOrderId);
//只有审核通过才能退款
Map<String, Object> xhpcRefundOrder = iXhpcRefundOrderService.info(xhpcRefundAudit.getRefundOrderId());
int source = Integer.parseInt(xhpcRefundOrder.get("source").toString());
String phone="";
if(source==0){
phone=xhpcRefundOrder.get("phone").toString();
}else{
phone=xhpcRefundOrder.get("communityPhone").toString();
}
if (StringUtils.isNull(xhpcRefundOrder)) {
updateXhpcRefundOrder(refundOrderId,2);
return AjaxResult.error(HttpStatus.DATA_ERROR, "订单不存在");
}
String userId = StringUtils.valueOf(xhpcRefundOrder.get("userId"));
String money = StringUtils.valueOf(xhpcRefundOrder.get("amount"));
String amountRefundOrder = "-" + money;
String examineStatus = StringUtils.valueOf(xhpcRefundOrder.get("examineStatus"));
if (!"1".equals(examineStatus)) {
updateXhpcRefundOrder(refundOrderId,2);
refundOrder.setStatus(2);
refundOrder.setRemark("订单状态不能退款");
updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,2);
return AjaxResult.error(HttpStatus.ERROR_STATUS, "订单状态不能退款");
}
String status = StringUtils.valueOf(xhpcRefundOrder.get("status"));
if (!"0".equals(status)) {
updateXhpcRefundOrder(refundOrderId,2);
refundOrder.setStatus(2);
refundOrder.setRemark("订单状态不能退款");
updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,2);
return AjaxResult.error(HttpStatus.ERROR_STATUS, "订单状态不能退款");
}
String orderOutNumber = StringUtils.valueOf(xhpcRefundOrder.get("refundOrderNumber"));
String uid = StringUtils.valueOf(xhpcRefundOrder.get("alipayId"));
String money = StringUtils.valueOf(xhpcRefundOrder.get("amount"));
Double amount = Double.parseDouble(StringUtils.valueOf(xhpcRefundOrder.get("amount")));
//退款金额单位为分
Double value = amount * 100;
Integer refund_fee = value.intValue();
if (refund_fee <= 0) {
updateXhpcRefundOrder(refundOrderId,2);
refundOrder.setStatus(2);
refundOrder.setRemark("订单金额出错");
updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,2);
return AjaxResult.error(HttpStatus.ERROR_STATUS, "订单金额出错");
}
String userId = StringUtils.valueOf(xhpcRefundOrder.get("userId"));
Map<String, Object> appUserInfo = xhpcUserAccountStatementMapper.appUserInfo(Long.parseLong(userId));
String balance = StringUtils.valueOf(appUserInfo.get("balance"));
if (StringUtils.isNull(appUserInfo)) {
updateXhpcRefundOrder(refundOrderId,2);
refundOrder.setStatus(2);
refundOrder.setRemark("用户不存在");
updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,2);
return AjaxResult.error(HttpStatus.DATA_ERROR, "用户不存在");
}
BigDecimal surplus = BigDecimal.valueOf(Double.valueOf(balance)).subtract(BigDecimal.valueOf(amount));
if (surplus.compareTo(BigDecimal.ZERO) == -1) {
updateXhpcRefundOrder(refundOrderId,2);
refundOrder.setStatus(2);
refundOrder.setRemark("余额不足");
updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,2);
return AjaxResult.error(HttpStatus.ERROR_STATUS, "余额不足");
}
try {
@ -477,6 +546,13 @@ public class XhpcRefundAuditController extends BaseController {
Map<String, Object> appUserInfo1 = xhpcUserAccountStatementMapper.appUserInfo(Long.parseLong(userId));
//退款成功修改订单
if (StringUtils.isNotNull(appUserInfo1)) {
refundOrder.setStatus(1);
refundOrder.setRemark("支付宝退款成功");
refundOrder.setOrderId(response.getOrderId());
refundOrder.setPayFundOrderId(response.getPayFundOrderId());
refundOrder.setTransPayTime(response.getTransDate());
updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,1);
String balance1 = StringUtils.valueOf(appUserInfo1.get("balance"));
//减少用户余额
XhpcAppUser xhpcAppUser = new XhpcAppUser();
@ -485,7 +561,6 @@ public class XhpcRefundAuditController extends BaseController {
xhpcAppUser.setBalance(surplus1);
xhpcUserAccountStatementMapper.updateAppUserBalance(xhpcAppUser);
updateXhpcRefundOrder(refundOrderId,1);
}
return AjaxResult.success("退款成功");
} else {
@ -494,25 +569,50 @@ public class XhpcRefundAuditController extends BaseController {
}
}catch (Exception e){
e.printStackTrace();
logger.info("++++++++++++支付宝审核异常++++++++++++++++"+e.getMessage());
}
updateXhpcRefundOrder(refundOrderId,2);
refundOrder.setStatus(2);
refundOrder.setRemark("调用失败");
updateXhpcRefundOrder(refundOrder,amountRefundOrder,userId,phone,2);
return AjaxResult.error("退款失败");
}
public void updateXhpcRefundOrder(Long refundOrderId,Integer status){
XhpcRefundOrder refundOrder =new XhpcRefundOrder();
refundOrder.setRefundOrderId(refundOrderId);
refundOrder.setStatus(status);
iXhpcRefundOrderService.update(refundOrder);
}
/**
* 修改退款订单号
* @param refundOrder
*/
/**
* 修改退款订单号增加用户流水发送短信
* @param refundOrder
* @param amount
* @param userId
* @param phone
* @param type 1成功 2失败
*/
public void updateXhpcRefundOrder(XhpcRefundOrder refundOrder,String amount,String userId,String phone,Integer type){
iXhpcRefundOrderService.update(refundOrder);
if(type ==1){
xhpcUserAccountStatementService.add(refundOrder.getRefundOrderId(), amount, userId, StatusConstants.FLOWING_WATER_REFUND);
}else{
xhpcUserAccountStatementService.add(refundOrder.getRefundOrderId(), amount, userId, StatusConstants.FLOWING_WATER_REFUND_ERROE);
try{
//发送短信
HashMap<String, String> paramMap = new HashMap<>();
paramMap.put("phone", phone);
paramMap.put("content", "【小华充电】退款-尊敬的用户,当前退款人数较多,申请退款失败,请您重新提交申请!");
smsService.sendNotice(paramMap);
}catch (Exception e){
}
}
}
/**
* 定时任务每5分钟扫描一次退款订单金额小于100自动审核通过
*
*/
@Scheduled(cron = "0 */5 * * * ?")
//@Scheduled(cron = "0 */5 * * * ?")
@GetMapping("/moneyPage")
public void moneyPage(){
logger.info("++++++++++++每5分钟扫描一次退款订单金额小于100自动审核通过++++++++++++++++");

View File

@ -68,6 +68,27 @@ public class XhpcRefundOrder extends BaseEntity {
*/
private Integer source;
/**
* 微信付款单号
*/
private String paymentNo;
/**
* 微信付款成功时间
*/
private String paymentTime;
/**
* 支付宝-该笔转账在支付宝系统内部的单据ID
*/
private String orderId;
/**
* 支付宝-支付宝支付资金流水号
*/
private String payFundOrderId;
/**
* 支付宝-订单支付时间
*/
private String transPayTime;
public Long getRefundOrderId() {
return refundOrderId;
}
@ -155,4 +176,44 @@ public class XhpcRefundOrder extends BaseEntity {
public void setSource(Integer source) {
this.source = source;
}
public String getPaymentNo() {
return paymentNo;
}
public void setPaymentNo(String paymentNo) {
this.paymentNo = paymentNo;
}
public String getPaymentTime() {
return paymentTime;
}
public void setPaymentTime(String paymentTime) {
this.paymentTime = paymentTime;
}
public String getOrderId() {
return orderId;
}
public void setOrderId(String orderId) {
this.orderId = orderId;
}
public String getPayFundOrderId() {
return payFundOrderId;
}
public void setPayFundOrderId(String payFundOrderId) {
this.payFundOrderId = payFundOrderId;
}
public String getTransPayTime() {
return transPayTime;
}
public void setTransPayTime(String transPayTime) {
this.transPayTime = transPayTime;
}
}

View File

@ -65,6 +65,11 @@ public class XhpcUserAccountStatement extends BaseEntity {
*/
private Integer delFlag;
/**
* 订单来源0 C端用户 1 流量方用户 2社区用户 3B端用户
*/
private Integer source;
public Long getUserAccountStatementId() {
return userAccountStatementId;
}
@ -144,4 +149,12 @@ public class XhpcUserAccountStatement extends BaseEntity {
public void setRemainingSum(BigDecimal remainingSum) {
this.remainingSum = remainingSum;
}
public Integer getSource() {
return source;
}
public void setSource(Integer source) {
this.source = source;
}
}

View File

@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
@ -42,14 +43,14 @@ public class XhpcRefundAuditServiceImpl implements IXhpcRefundAuditService {
XhpcRefundOrder xhpcRefundOrder = new XhpcRefundOrder();
xhpcRefundOrder.setRefundOrderId(xhpcRefundAudit.getRefundOrderId());
xhpcRefundOrder.setExamineStatus(xhpcRefundAudit.getStatus());
xhpcRefundOrder.setCreateTime(new Date());
xhpcRefundOrder.setStatus(StatusConstants.REFUND_ORDER_STATUS_WAIT);
int updateStatus = xhpcRefundOrderMapper.updateExamineStatus(xhpcRefundOrder);
if (updateStatus == 0) {
return AjaxResult.error();
}
xhpcRefundAudit.setCreateTime(new Date());
xhpcRefundAuditMapper.insert(xhpcRefundAudit);
return null;
}

View File

@ -175,7 +175,7 @@
<if test="source != null and phone == null">
and xro.source=#{source}
</if>
<if test="source == null and and phone != null">
<if test="source == null and phone != null">
and xau.app_user_id in (
select app_user_id from xhpc_app_user where phone like concat(concat('%', #{phone}), '%') and app_user_id in (select user_id from xhpc_recharge_order where source=0)
union

View File

@ -21,6 +21,11 @@
<result column="update_by" property="updateBy"/>
<result column="remark" property="remark"/>
<result column="source" property="source" />
<result column="payment_no" property="paymentNo" />
<result column="payment_time" property="paymentTime" />
<result column="order_id" property="orderId" />
<result column="pay_fund_order_id" property="payFundOrderId" />
<result column="trans_pay_time" property="transPayTime" />
</resultMap>
<insert id="insert" parameterType="com.xhpc.payment.domain.XhpcRefundOrder" useGeneratedKeys="true"
@ -125,9 +130,7 @@
<update id="update" parameterType="com.xhpc.payment.domain.XhpcRefundOrder">
UPDATE xhpc_refund_order
<set>
<if test="null != refundOrderNumber and '' != refundOrderNumber">refund_order_number =
#{refundOrderNumber},
</if>
<if test="null != refundOrderNumber and '' != refundOrderNumber">refund_order_number =#{refundOrderNumber},</if>
<if test="null != userId and '' != userId">user_id = #{userId},</if>
<if test="null != openId and '' != openId">open_id = #{openId},</if>
<if test="null != alipayId and '' != alipayId">alipay_id = #{alipayId},</if>
@ -140,7 +143,12 @@
<if test="null != createBy and '' != createBy">create_by = #{createBy},</if>
<if test="null != updateTime">update_time = #{updateTime},</if>
<if test="null != updateBy and '' != updateBy">update_by = #{updateBy},</if>
<if test="null != remark and '' != remark">remark = #{remark}</if>
<if test="null != remark and '' != remark">remark = #{remark},</if>
<if test="null != paymentNo and '' != paymentNo">payment_no = #{paymentNo},</if>
<if test="null != paymentTime and '' != paymentTime">payment_time = #{paymentTime},</if>
<if test="null != orderId and '' != orderId">order_id = #{orderId},</if>
<if test="null != payFundOrderId and '' != payFundOrderId">pay_fund_order_id = #{payFundOrderId},</if>
<if test="null != transPayTime and '' != transPayTime">trans_pay_time = #{transPayTime}</if>
</set>
WHERE refund_order_id = #{refundOrderId}
</update>
@ -164,11 +172,12 @@
<select id="info" parameterType="java.lang.Long" resultType="java.util.Map">
select xro.refund_order_id refundOrderId ,xro.refund_order_number refundOrderNumber,
xro.alipay_id alipayId ,xro.open_id openId,xro.user_id userId,xro.amount,
xro.alipay_id alipayId ,xro.open_id openId,xro.user_id userId,xro.amount,xro.source source,cop.phone communityPhone,
xro.type,xro.examine_status examineStatus,xro.`status`,xro.source source,xro.create_time createTime,xau.phone,
sdd.dict_label statusName,sdds.dict_label examineStatusName
from xhpc_refund_order xro
LEFT JOIN xhpc_app_user xau on xau.app_user_id = xro.user_id
LEFT JOIN xhpc_app_user xau on xau.app_user_id = xro.user_id and xro.source=0
LEFT JOIN xhpc_community_personnel cop on cop.community_personnel_id = xro.user_id and xro.source=2
LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = 'refund_order_status' and sdd.dict_value = xro.`status`
LEFT JOIN sys_dict_data sdds on sdds.`dict_type` = 'refund_examine_status' and sdds.dict_value = xro.examine_status
where xro.del_flag = 0 and xro.refund_order_id = #{refundOrderId}
@ -184,8 +193,7 @@
LEFT JOIN xhpc_community_personnel cop on cop.community_personnel_id = xro.user_id and xro.source =2
LEFT JOIN xhpc_customers_personnel cup on cup.customers_personnel_id = xro.user_id and xro.source =3
LEFT JOIN sys_dict_data sdd on sdd.`dict_type` = 'refund_order_status' and sdd.dict_value = xro.`status`
LEFT JOIN sys_dict_data sdds on sdds.`dict_type` = 'refund_examine_status' and sdds.dict_value =
xro.examine_status
LEFT JOIN sys_dict_data sdds on sdds.`dict_type` = 'refund_examine_status' and sdds.dict_value =xro.examine_status
where xro.del_flag = 0
<if test="source != null and phone != null">
<if test="source==0 ">
@ -201,7 +209,7 @@
<if test="source != null and phone == null">
and xro.source=#{source}
</if>
<if test="source == null and and phone != null">
<if test="source == null and phone != null">
and xau.app_user_id in (
select app_user_id from xhpc_app_user where phone like concat(concat('%', #{phone}), '%') and app_user_id in
(select user_id from xhpc_recharge_order where source=0)

View File

@ -66,7 +66,10 @@
update_by,
</if>
<if test="null != remark and '' != remark">
remark
remark,
</if>
<if test="null != source">
source
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -110,7 +113,10 @@
#{updateBy},
</if>
<if test="null != remark and '' != remark">
#{remark}
#{remark},
</if>
<if test="null != source">
#{source}
</if>
</trim>
</insert>