Commit 0e08d283 by jinxin

运维后台登录人信息处理

parent b8ee2c53
......@@ -78,7 +78,7 @@ public interface LicenceOrderApiService {
* @param orderId 订单id
* @return
*/
ServiceResponse<String> payLicenceOrder(Long orderId, String wxEnterpriseId);
ServiceResponse<String> payLicenceOrder(Long orderId);
/**
* 查询企业是否存在订单未支付接口
......@@ -127,7 +127,7 @@ public interface LicenceOrderApiService {
* @param reason 不通过原因
* @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 {
/**
* 取消企业微信订单
*/
ServiceResponse<Boolean> cancelQywxOrder(Long orderId,String wxEnterpriseId);
ServiceResponse<Boolean> cancelQywxOrder(Long orderId);
}
......@@ -130,7 +130,7 @@ public interface LicenceOrderService {
* @param reason 不通过原因
* @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;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
......@@ -28,6 +29,8 @@ import com.gic.marketing.api.dto.SmsSendResponseDTO;
import com.gic.marketing.api.service.AccountOverdueSmsSendService;
import com.github.pagehelper.PageHelper;
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.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -42,7 +45,7 @@ import java.util.*;
*/
@Service
public class LicenceOrderServiceImpl implements LicenceOrderService {
private static Logger logger = LogManager.getLogger(LicenceOrderServiceImpl.class);
@Autowired
private TabHaobanLicenceOrderMapper tabHaobanLicenceOrderMapper;
@Autowired
......@@ -263,11 +266,18 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
}
@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);
if (null ==order){
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){
//更新微信订单状态
tabHaobanLicenceOrderMapper.saveOrderCheckReason(orderId,reason,0);
......@@ -277,10 +287,11 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(order.getCreatorId());
if (clerkDTO!=null){
Map<String, String> params = new HashMap<>();
params.put("1", "企微企业名称");
params.put("2", "订单号");
params.put("1", wxEnterpriseName);
params.put("2", order.getOrderNumber());
SmsSendResponseDTO resp = accountOverdueSmsSendService.smsSend("-1", clerkDTO.getPhoneNumber(),
"86", 106, params);
logger.info("许可账号支付凭证审核不通过短信通知返回信息:{}", JSON.toJSONString(resp));
}
}else {
//更新微信订单状态
......
......@@ -134,12 +134,12 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
}
@Override
public ServiceResponse<String> payLicenceOrder(Long orderId, String wxEnterpriseId) {
public ServiceResponse<String> payLicenceOrder(Long orderId) {
TabHaobanLicenceOrder order = licenceOrderService.getLicenceOrderDetail(orderId);
if (order == null) {
return ServiceResponse.failure("-9999", "参数有误!!");
}
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(order.getWxEnterpriseId());
if (wxEnterpriseDTO == null) {
return ServiceResponse.failure("-9999", "微信企业不存在!!");
}
......@@ -304,8 +304,8 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
}
@Override
public ServiceResponse<Boolean> checkLicenceOrder(Long orderId, Integer flag, String reason, String enterpriseId, String wxEnterpriseId, String creatorName) {
licenceOrderService.checkLicenceOrder(orderId, flag, reason, enterpriseId, wxEnterpriseId, creatorName);
public ServiceResponse<Boolean> checkLicenceOrder(Long orderId, Integer flag, String reason, String creatorName) {
licenceOrderService.checkLicenceOrder(orderId, flag, reason,creatorName);
return ServiceResponse.success(true);
}
......@@ -346,13 +346,13 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
}
@Override
public ServiceResponse<Boolean> cancelQywxOrder(Long orderId,String wxEnterpriseId) {
public ServiceResponse<Boolean> cancelQywxOrder(Long orderId) {
TabHaobanLicenceOrder order = licenceOrderService.getLicenceOrderDetail(orderId);
if (null == order) {
return ServiceResponse.failure("-9999", "订单id有误!");
}
//企业微信订单取消
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(order.getWxEnterpriseId());
if (wxEnterpriseDTO == null) {
return ServiceResponse.failure("-9999", "微信企业不存在!!");
}
......@@ -362,7 +362,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
logger.info("企业微信订单取消返回信息:{}",JSON.toJSONString(response));
if (response.isSuccess()){
//更新企业微信订单状态
updateLicenceOrderType(orderId, 2, order.getEnterpriseId(), wxEnterpriseId, order.getCreatorName(), 1);
updateLicenceOrderType(orderId, 2, order.getEnterpriseId(), order.getWxEnterpriseId(), order.getCreatorName(), 1);
//微信退款
wxRefund(orderId);
return ServiceResponse.success(true);
......
......@@ -285,19 +285,28 @@
<select id="getTransactionIdList" resultMap="BaseResultMap">
SELECT
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 id="getQywxOrderId" resultMap="BaseResultMap">
SELECT
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 id="getWxOrderId" resultMap="BaseResultMap">
SELECT
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>
<update id="saveOrderCheckReason">
......
......@@ -43,7 +43,7 @@ public class LicenceOrderServiceTest {
}
@Test
public void test4(){
ServiceResponse<String> result = licenceOrderApiService.payLicenceOrder(512360219787935783L, "ca66a01b79474c40b3e7c7f93daf1a3b");
ServiceResponse<String> result = licenceOrderApiService.payLicenceOrder(512360219787935783L);
}
@Test
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