Commit 0e08d283 by jinxin

运维后台登录人信息处理

parent b8ee2c53
...@@ -78,7 +78,7 @@ public interface LicenceOrderApiService { ...@@ -78,7 +78,7 @@ public interface LicenceOrderApiService {
* @param orderId 订单id * @param orderId 订单id
* @return * @return
*/ */
ServiceResponse<String> payLicenceOrder(Long orderId, String wxEnterpriseId); ServiceResponse<String> payLicenceOrder(Long orderId);
/** /**
* 查询企业是否存在订单未支付接口 * 查询企业是否存在订单未支付接口
...@@ -127,7 +127,7 @@ public interface LicenceOrderApiService { ...@@ -127,7 +127,7 @@ public interface LicenceOrderApiService {
* @param reason 不通过原因 * @param reason 不通过原因
* @return * @return
*/ */
ServiceResponse<Boolean> checkLicenceOrder(Long orderId, Integer flag, String reason, String enterpriseId, String wxEnterpriseId, String creatorName); ServiceResponse<Boolean> checkLicenceOrder(Long orderId, Integer flag, String reason, String creatorName);
/** /**
* 微信退款 * 微信退款
...@@ -142,7 +142,7 @@ public interface LicenceOrderApiService { ...@@ -142,7 +142,7 @@ public interface LicenceOrderApiService {
/** /**
* 取消企业微信订单 * 取消企业微信订单
*/ */
ServiceResponse<Boolean> cancelQywxOrder(Long orderId,String wxEnterpriseId); ServiceResponse<Boolean> cancelQywxOrder(Long orderId);
} }
...@@ -4,16 +4,15 @@ package com.gic.haoban.manage.web.controller; ...@@ -4,16 +4,15 @@ package com.gic.haoban.manage.web.controller;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
import com.gic.authcenter.commons.dto.AuthcenterUserDetails;
import com.gic.authcenter.commons.util.SessionContextUtil;
import com.gic.commons.util.PageHelperUtils; import com.gic.commons.util.PageHelperUtils;
import com.gic.commons.webapi.reponse.RestResponse; import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.api.dto.EnterpriseDTO; import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.service.EnterpriseService; import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.haoban.base.api.common.pojo.dto.WebLoginDTO;
import com.gic.haoban.common.utils.AuthWebRequestUtil;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO; import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.licence.LicenceOrderDTO; import com.gic.haoban.manage.api.dto.licence.LicenceOrderDTO;
import com.gic.haoban.manage.api.dto.licence.LicenceOrderPageDTO; import com.gic.haoban.manage.api.dto.licence.LicenceOrderPageDTO;
...@@ -24,7 +23,6 @@ import com.gic.haoban.manage.web.errCode.HaoBanErrCode; ...@@ -24,7 +23,6 @@ import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.licence.LicenceOrderPageQO; import com.gic.haoban.manage.web.qo.licence.LicenceOrderPageQO;
import com.gic.haoban.manage.web.vo.licence.LicenceOrderPageVO; import com.gic.haoban.manage.web.vo.licence.LicenceOrderPageVO;
import com.gic.haoban.manage.web.vo.licence.LicenceOrderVO; import com.gic.haoban.manage.web.vo.licence.LicenceOrderVO;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -33,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -33,6 +31,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
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 javax.servlet.http.HttpServletRequest;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -60,10 +59,6 @@ public class LicenceOrderController { ...@@ -60,10 +59,6 @@ public class LicenceOrderController {
*/ */
@RequestMapping("licence-order-detail") @RequestMapping("licence-order-detail")
public RestResponse<LicenceOrderVO> getLicenceOrderDetail(@RequestParam Long orderId) { public RestResponse<LicenceOrderVO> getLicenceOrderDetail(@RequestParam Long orderId) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
ServiceResponse<LicenceOrderDTO> licenceOrderDetail = licenceOrderApiService.getLicenceOrderDetail(orderId, null); ServiceResponse<LicenceOrderDTO> licenceOrderDetail = licenceOrderApiService.getLicenceOrderDetail(orderId, null);
LicenceOrderVO licenceOrderVO = JSONObject.parseObject(JSONObject.toJSONString(licenceOrderDetail.getResult()), LicenceOrderVO.class); LicenceOrderVO licenceOrderVO = JSONObject.parseObject(JSONObject.toJSONString(licenceOrderDetail.getResult()), LicenceOrderVO.class);
return RestResponse.successResult(licenceOrderVO); return RestResponse.successResult(licenceOrderVO);
...@@ -74,15 +69,7 @@ public class LicenceOrderController { ...@@ -74,15 +69,7 @@ public class LicenceOrderController {
*/ */
@RequestMapping("licence-order-page") @RequestMapping("licence-order-page")
public RestResponse<Page<LicenceOrderPageVO>> getLicenceOrderPage(@RequestBody LicenceOrderPageQO licenceOrderPageQO) { public RestResponse<Page<LicenceOrderPageVO>> getLicenceOrderPage(@RequestBody LicenceOrderPageQO licenceOrderPageQO) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
String wxEnterpriseId = loginUser.getWxEnterpriseId();
String clerkName = loginUser.getClerkName();
LicenceOrderPageQDTO qdto = JSONObject.parseObject(JSONObject.toJSONString(licenceOrderPageQO), LicenceOrderPageQDTO.class); LicenceOrderPageQDTO qdto = JSONObject.parseObject(JSONObject.toJSONString(licenceOrderPageQO), LicenceOrderPageQDTO.class);
qdto.setWxEnterpriseId(wxEnterpriseId);
qdto.setCreatorName(clerkName);
ServiceResponse<Page<LicenceOrderPageDTO>> licenceOrderPage = licenceOrderApiService.getLicenceOrderPage(qdto); ServiceResponse<Page<LicenceOrderPageDTO>> licenceOrderPage = licenceOrderApiService.getLicenceOrderPage(qdto);
Page<LicenceOrderPageVO> result = PageHelperUtils.changePageToCurrentPage(licenceOrderPage.getResult(), LicenceOrderPageVO.class); Page<LicenceOrderPageVO> result = PageHelperUtils.changePageToCurrentPage(licenceOrderPage.getResult(), LicenceOrderPageVO.class);
if (CollUtil.isNotEmpty(result.getResult())) { if (CollUtil.isNotEmpty(result.getResult())) {
...@@ -106,12 +93,7 @@ public class LicenceOrderController { ...@@ -106,12 +93,7 @@ public class LicenceOrderController {
*/ */
@RequestMapping("licence-order-cancel") @RequestMapping("licence-order-cancel")
public RestResponse<Boolean> cancelLicenceOrder(@RequestParam Long orderId) { public RestResponse<Boolean> cancelLicenceOrder(@RequestParam Long orderId) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); ServiceResponse<Boolean> response = licenceOrderApiService.cancelQywxOrder(orderId);
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
String wxEnterpriseId = loginUser.getWxEnterpriseId();
ServiceResponse<Boolean> response = licenceOrderApiService.cancelQywxOrder(orderId, wxEnterpriseId);
if (!response.isSuccess()) { if (!response.isSuccess()) {
return RestResponse.failure(response.getCode(), response.getMessage()); return RestResponse.failure(response.getCode(), response.getMessage());
} }
...@@ -123,11 +105,7 @@ public class LicenceOrderController { ...@@ -123,11 +105,7 @@ public class LicenceOrderController {
*/ */
@RequestMapping("licence-order-pay") @RequestMapping("licence-order-pay")
public RestResponse<String> payLicenceOrder(@RequestParam Long orderId) { public RestResponse<String> payLicenceOrder(@RequestParam Long orderId) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); ServiceResponse<String> response = licenceOrderApiService.payLicenceOrder(orderId);
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
ServiceResponse<String> response = licenceOrderApiService.payLicenceOrder(orderId, loginUser.getWxEnterpriseId());
if (response.isSuccess()) { if (response.isSuccess()) {
return RestResponse.successResult(response.getResult()); return RestResponse.successResult(response.getResult());
} }
...@@ -143,17 +121,16 @@ public class LicenceOrderController { ...@@ -143,17 +121,16 @@ public class LicenceOrderController {
* @return * @return
*/ */
@RequestMapping("licence-order-check") @RequestMapping("licence-order-check")
public RestResponse<Boolean> checkLicenceOrder(@RequestParam Long orderId, Integer flag, String reason) { public RestResponse<Boolean> checkLicenceOrder(@RequestParam Long orderId, Integer flag, String reason, HttpServletRequest request) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); AuthcenterUserDetails loginUser = (AuthcenterUserDetails) SessionContextUtil.getUser(request);
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) { if (loginUser == null) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg()); return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
} }
String enterpriseId = loginUser.getEnterpriseId(); String clerkName = loginUser.getLoginName();
String wxEnterpriseId = loginUser.getWxEnterpriseId(); Boolean result = licenceOrderApiService.checkLicenceOrder(orderId, flag, reason, clerkName).getResult();
String clerkName = loginUser.getClerkName();
Boolean result = licenceOrderApiService.checkLicenceOrder(orderId, flag, reason, enterpriseId, wxEnterpriseId, clerkName).getResult();
return RestResponse.successResult(result); return RestResponse.successResult(result);
} }
/** /**
* 订单退款 * 订单退款
* *
...@@ -161,41 +138,22 @@ public class LicenceOrderController { ...@@ -161,41 +138,22 @@ public class LicenceOrderController {
* @return * @return
*/ */
@RequestMapping("licence-order-refund") @RequestMapping("licence-order-refund")
public RestResponse<Boolean> refundLicenceOrder(@RequestParam Long orderId) { public RestResponse<Boolean> refundLicenceOrder(@RequestParam Long orderId, HttpServletRequest request) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); AuthcenterUserDetails loginUser = (AuthcenterUserDetails) SessionContextUtil.getUser(request);
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) { if (loginUser == null) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg()); return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
} }
String enterpriseId = loginUser.getEnterpriseId(); String clerkName = loginUser.getLoginName();
String wxEnterpriseId = loginUser.getWxEnterpriseId(); ServiceResponse<LicenceOrderDTO> response = licenceOrderApiService.getLicenceOrderDetail(orderId, null);
String clerkName = loginUser.getClerkName(); if (response.isSuccess() && null != response.getResult()) {
Boolean result = licenceOrderApiService.updateLicenceOrderType(orderId, 4, enterpriseId, wxEnterpriseId, clerkName, 0).getResult(); LicenceOrderDTO orderDTO = response.getResult();
return RestResponse.successResult(result); String enterpriseId = orderDTO.getEnterpriseId();
} String wxEnterpriseId = orderDTO.getWxEnterpriseId();
Boolean result = licenceOrderApiService.updateLicenceOrderType(orderId, 4, enterpriseId, wxEnterpriseId, clerkName, 0).getResult();
return RestResponse.successResult(result);
/**
* 查询企业品牌名称
*/
@RequestMapping("get-enterprise-name")
public RestResponse<HashMap<String, String>> getEnterpriseName() {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
} }
HashMap<String, String> result = new HashMap<>(8); return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_5.getCode()), HaoBanErrCode.ERR_5.getMsg());
//查询gic品牌名称
EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(loginUser.getEnterpriseId());
if (ObjectUtil.isNotNull(enterpriseDTO)) {
logger.info("gic企业查询返回实体:{}", JSON.toJSONString(enterpriseDTO));
result.put("enterpriseName", enterpriseDTO.getEnterpriseName());
}
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseApiService.getOne(loginUser.getWxEnterpriseId());
if (ObjectUtil.isNotNull(wxEnterpriseDTO)) {
logger.info("企业微信查询返回实体:{}", JSON.toJSONString(wxEnterpriseDTO));
result.put("wxEnterpriseName", wxEnterpriseDTO.getCorpName());
}
return RestResponse.successResult(result);
} }
/** /**
...@@ -207,22 +165,15 @@ public class LicenceOrderController { ...@@ -207,22 +165,15 @@ public class LicenceOrderController {
*/ */
@RequestMapping("get-order-id-list") @RequestMapping("get-order-id-list")
public RestResponse<List<String>> getOrderIdList(String param, Integer type) { public RestResponse<List<String>> getOrderIdList(String param, Integer type) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser(); ServiceResponse<List<String>> orderIdList = licenceOrderApiService.getOrderIdList(param, type, null);
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
ServiceResponse<List<String>> orderIdList = licenceOrderApiService.getOrderIdList(param, type, loginUser.getWxEnterpriseId());
return RestResponse.successResult(orderIdList.getResult()); return RestResponse.successResult(orderIdList.getResult());
} }
/** /**
* 查询开户信息 * 查询开户信息
*/ */
@RequestMapping("get-account-info") @RequestMapping("get-account-info")
public RestResponse<HashMap<String, String>> getAccountInfo() { public RestResponse<HashMap<String, String>> getAccountInfo() {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
HashMap<String, String> result = licenceOrderApiService.getAccountInfo().getResult(); HashMap<String, String> result = licenceOrderApiService.getAccountInfo().getResult();
return RestResponse.successResult(result); return RestResponse.successResult(result);
} }
......
...@@ -130,7 +130,7 @@ public interface LicenceOrderService { ...@@ -130,7 +130,7 @@ public interface LicenceOrderService {
* @param reason 不通过原因 * @param reason 不通过原因
* @return * @return
*/ */
Boolean checkLicenceOrder(Long orderId,Integer flag,String reason,String enterpriseId,String wxEnterpriseId,String creatorName); Boolean checkLicenceOrder(Long orderId,Integer flag,String reason,String creatorName);
/** /**
* 记录回调时间 * 记录回调时间
......
...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.service.service.licence.impl; ...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.service.service.licence.impl;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
...@@ -28,6 +29,8 @@ import com.gic.marketing.api.dto.SmsSendResponseDTO; ...@@ -28,6 +29,8 @@ import com.gic.marketing.api.dto.SmsSendResponseDTO;
import com.gic.marketing.api.service.AccountOverdueSmsSendService; import com.gic.marketing.api.service.AccountOverdueSmsSendService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.checkerframework.checker.units.qual.A; import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -42,7 +45,7 @@ import java.util.*; ...@@ -42,7 +45,7 @@ import java.util.*;
*/ */
@Service @Service
public class LicenceOrderServiceImpl implements LicenceOrderService { public class LicenceOrderServiceImpl implements LicenceOrderService {
private static Logger logger = LogManager.getLogger(LicenceOrderServiceImpl.class);
@Autowired @Autowired
private TabHaobanLicenceOrderMapper tabHaobanLicenceOrderMapper; private TabHaobanLicenceOrderMapper tabHaobanLicenceOrderMapper;
@Autowired @Autowired
...@@ -263,11 +266,18 @@ public class LicenceOrderServiceImpl implements LicenceOrderService { ...@@ -263,11 +266,18 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
} }
@Override @Override
public Boolean checkLicenceOrder(Long orderId, Integer flag, String reason, String enterpriseId, String wxEnterpriseId, String creatorName) { public Boolean checkLicenceOrder(Long orderId, Integer flag, String reason,String creatorName) {
TabHaobanLicenceOrder order = tabHaobanLicenceOrderMapper.selectById(orderId); TabHaobanLicenceOrder order = tabHaobanLicenceOrderMapper.selectById(orderId);
if (null ==order){ if (null ==order){
return false; return false;
} }
String enterpriseId = order.getEnterpriseId();
String wxEnterpriseId = order.getWxEnterpriseId();
String wxEnterpriseName = "";
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseApiService.getOne(wxEnterpriseId);
if (ObjectUtil.isNotNull(wxEnterpriseDTO)){
wxEnterpriseName=wxEnterpriseDTO.getCorpName();
}
if (flag == 0){ if (flag == 0){
//更新微信订单状态 //更新微信订单状态
tabHaobanLicenceOrderMapper.saveOrderCheckReason(orderId,reason,0); tabHaobanLicenceOrderMapper.saveOrderCheckReason(orderId,reason,0);
...@@ -277,10 +287,11 @@ public class LicenceOrderServiceImpl implements LicenceOrderService { ...@@ -277,10 +287,11 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(order.getCreatorId()); ClerkDTO clerkDTO = clerkService.getClerkByClerkId(order.getCreatorId());
if (clerkDTO!=null){ if (clerkDTO!=null){
Map<String, String> params = new HashMap<>(); Map<String, String> params = new HashMap<>();
params.put("1", "企微企业名称"); params.put("1", wxEnterpriseName);
params.put("2", "订单号"); params.put("2", order.getOrderNumber());
SmsSendResponseDTO resp = accountOverdueSmsSendService.smsSend("-1", clerkDTO.getPhoneNumber(), SmsSendResponseDTO resp = accountOverdueSmsSendService.smsSend("-1", clerkDTO.getPhoneNumber(),
"86", 106, params); "86", 106, params);
logger.info("许可账号支付凭证审核不通过短信通知返回信息:{}", JSON.toJSONString(resp));
} }
}else { }else {
//更新微信订单状态 //更新微信订单状态
......
...@@ -134,12 +134,12 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService { ...@@ -134,12 +134,12 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
} }
@Override @Override
public ServiceResponse<String> payLicenceOrder(Long orderId, String wxEnterpriseId) { public ServiceResponse<String> payLicenceOrder(Long orderId) {
TabHaobanLicenceOrder order = licenceOrderService.getLicenceOrderDetail(orderId); TabHaobanLicenceOrder order = licenceOrderService.getLicenceOrderDetail(orderId);
if (order == null) { if (order == null) {
return ServiceResponse.failure("-9999", "参数有误!!"); return ServiceResponse.failure("-9999", "参数有误!!");
} }
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId); WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(order.getWxEnterpriseId());
if (wxEnterpriseDTO == null) { if (wxEnterpriseDTO == null) {
return ServiceResponse.failure("-9999", "微信企业不存在!!"); return ServiceResponse.failure("-9999", "微信企业不存在!!");
} }
...@@ -304,8 +304,8 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService { ...@@ -304,8 +304,8 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
} }
@Override @Override
public ServiceResponse<Boolean> checkLicenceOrder(Long orderId, Integer flag, String reason, String enterpriseId, String wxEnterpriseId, String creatorName) { public ServiceResponse<Boolean> checkLicenceOrder(Long orderId, Integer flag, String reason, String creatorName) {
licenceOrderService.checkLicenceOrder(orderId, flag, reason, enterpriseId, wxEnterpriseId, creatorName); licenceOrderService.checkLicenceOrder(orderId, flag, reason,creatorName);
return ServiceResponse.success(true); return ServiceResponse.success(true);
} }
...@@ -346,13 +346,13 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService { ...@@ -346,13 +346,13 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
} }
@Override @Override
public ServiceResponse<Boolean> cancelQywxOrder(Long orderId,String wxEnterpriseId) { public ServiceResponse<Boolean> cancelQywxOrder(Long orderId) {
TabHaobanLicenceOrder order = licenceOrderService.getLicenceOrderDetail(orderId); TabHaobanLicenceOrder order = licenceOrderService.getLicenceOrderDetail(orderId);
if (null == order) { if (null == order) {
return ServiceResponse.failure("-9999", "订单id有误!"); return ServiceResponse.failure("-9999", "订单id有误!");
} }
//企业微信订单取消 //企业微信订单取消
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId); WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(order.getWxEnterpriseId());
if (wxEnterpriseDTO == null) { if (wxEnterpriseDTO == null) {
return ServiceResponse.failure("-9999", "微信企业不存在!!"); return ServiceResponse.failure("-9999", "微信企业不存在!!");
} }
...@@ -362,7 +362,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService { ...@@ -362,7 +362,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
logger.info("企业微信订单取消返回信息:{}",JSON.toJSONString(response)); logger.info("企业微信订单取消返回信息:{}",JSON.toJSONString(response));
if (response.isSuccess()){ if (response.isSuccess()){
//更新企业微信订单状态 //更新企业微信订单状态
updateLicenceOrderType(orderId, 2, order.getEnterpriseId(), wxEnterpriseId, order.getCreatorName(), 1); updateLicenceOrderType(orderId, 2, order.getEnterpriseId(), order.getWxEnterpriseId(), order.getCreatorName(), 1);
//微信退款 //微信退款
wxRefund(orderId); wxRefund(orderId);
return ServiceResponse.success(true); return ServiceResponse.success(true);
......
...@@ -285,19 +285,28 @@ ...@@ -285,19 +285,28 @@
<select id="getTransactionIdList" resultMap="BaseResultMap"> <select id="getTransactionIdList" resultMap="BaseResultMap">
SELECT SELECT
order_number order_number
FROM tab_haoban_licence_order WHERE order_number like concat (#{orderNumber},'%') and delete_flag=0 and wx_enterprise_id = #{wxEnterpriseId} FROM tab_haoban_licence_order WHERE order_number like concat (#{orderNumber},'%') and delete_flag=0
<if test="wxEnterpriseId != null and wxEnterpriseId !='' ">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
</select> </select>
<select id="getQywxOrderId" resultMap="BaseResultMap"> <select id="getQywxOrderId" resultMap="BaseResultMap">
SELECT SELECT
qywx_order_id qywx_order_id
FROM tab_haoban_licence_order WHERE qywx_order_id like concat (#{qywxOrderId},'%') and delete_flag=0 and wx_enterprise_id = #{wxEnterpriseId} FROM tab_haoban_licence_order WHERE qywx_order_id like concat (#{qywxOrderId},'%') and delete_flag=0
<if test="wxEnterpriseId != null and wxEnterpriseId !='' ">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
</select> </select>
<select id="getWxOrderId" resultMap="BaseResultMap"> <select id="getWxOrderId" resultMap="BaseResultMap">
SELECT SELECT
wx_order_id wx_order_id
FROM tab_haoban_licence_order WHERE wx_order_id like concat (#{wxOrderId},'%') and delete_flag=0 and wx_enterprise_id = #{wxEnterpriseId} FROM tab_haoban_licence_order WHERE wx_order_id like concat (#{wxOrderId},'%') and delete_flag=0
<if test="wxEnterpriseId != null and wxEnterpriseId !='' ">
and wx_enterprise_id = #{wxEnterpriseId}
</if>
</select> </select>
<update id="saveOrderCheckReason"> <update id="saveOrderCheckReason">
......
...@@ -43,7 +43,7 @@ public class LicenceOrderServiceTest { ...@@ -43,7 +43,7 @@ public class LicenceOrderServiceTest {
} }
@Test @Test
public void test4(){ public void test4(){
ServiceResponse<String> result = licenceOrderApiService.payLicenceOrder(512360219787935783L, "ca66a01b79474c40b3e7c7f93daf1a3b"); ServiceResponse<String> result = licenceOrderApiService.payLicenceOrder(512360219787935783L);
} }
@Test @Test
public void test5(){ public void test5(){
......
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