Commit b4bdaf2b by jinxin

微信退款失败钉钉通知

parent c12ed7a6
...@@ -179,7 +179,7 @@ public class LicenceOrderController { ...@@ -179,7 +179,7 @@ public class LicenceOrderController {
} }
/** /**
* 申请微信退款 * 申请退款
*/ */
@RequestMapping("licence-order-wxRefoud") @RequestMapping("licence-order-wxRefoud")
public RestResponse<Boolean> wxRefund(@RequestParam Long orderId, HttpServletRequest request) { public RestResponse<Boolean> wxRefund(@RequestParam Long orderId, HttpServletRequest request) {
......
...@@ -996,6 +996,8 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -996,6 +996,8 @@ public class StaffApiServiceImpl implements StaffApiService {
successMap.put("takeoverStaffName",takeOverStaff.getStaffName()); successMap.put("takeoverStaffName",takeOverStaff.getStaffName());
successMap.put("takeoverStaffPhone",takeOverStaff.getPhoneNumber()); successMap.put("takeoverStaffPhone",takeOverStaff.getPhoneNumber());
successList.add(successMap); successList.add(successMap);
//更新成员群列表 todo
groupChatService.initStaffGroupChat(takeOverStaff.getStaffId());
}else{ }else{
//企微转移失败,记录失败明细 //企微转移失败,记录失败明细
......
...@@ -345,7 +345,29 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService { ...@@ -345,7 +345,29 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
RefundResDataDTO refund = pay4WXService.refund(reqData); RefundResDataDTO refund = pay4WXService.refund(reqData);
logger.info("微信订单退款返回信息:{}",JSON.toJSONString(refund)); logger.info("微信订单退款返回信息:{}",JSON.toJSONString(refund));
if (refund != null && ("FAIL".equals(refund.getReturn_code()) || "FAIL".equals(refund.getResult_code()))) { if (refund != null && ("FAIL".equals(refund.getReturn_code()) || "FAIL".equals(refund.getResult_code()))) {
//微信退款失败 //微信退款失败,钉钉通知财务人员
//查询gic品牌名称
String enterpriseName = "";
String wxEnterpriseName = "";
EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(order.getEnterpriseId());
if (ObjectUtil.isNotNull(enterpriseDTO)) {
enterpriseName = enterpriseDTO.getEnterpriseName();
}
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseApiService.getOne(order.getWxEnterpriseId());
if (ObjectUtil.isNotNull(wxEnterpriseDTO)) {
wxEnterpriseName = wxEnterpriseDTO.getCorpName();
}
//发送钉钉消息通知
String host = config.getHost();
// 最后一个分隔符位置
int lastIndex = host.lastIndexOf("/");
// 倒数第二个分隔符位置
int secondLastIndex = host.lastIndexOf("/", lastIndex - 1);
String subHost = host.substring(0, secondLastIndex + 1);
String url = subHost + "enterprise-operation/#/finance-config/wx-order-detail?tabId=wx_account_order&orderId=" + order.getOrderId();
String msg = "标题:企微账号许可通知\n品牌名称:" + enterpriseName + "\n" + "企业名称:" + wxEnterpriseName + "\n" + "消息内容:订单编号:"+order.getOrderNumber()
+",申请微信退款失败,请查看原因并处理!\n"+"失败原因:"+refund.getErr_code_des()+"\n" + url;
DingUtils.send(msg, "https://oapi.dingtalk.com/robot/send?access_token=63074c9fc1ac2c00aa62477facdf16e5fa2388cf6a621edba1fb05d6e55d031f", false);
return ServiceResponse.failure(refund.getResult_code(), refund.getErr_code_des()); return ServiceResponse.failure(refund.getResult_code(), refund.getErr_code_des());
} }
//更新微信订单状态 //更新微信订单状态
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment