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);
} }
...@@ -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