Commit 2582e3d0 by jinxin

查询企业微信订单状态是否过期

parent 021660e6
...@@ -151,5 +151,11 @@ public interface LicenceOrderApiService { ...@@ -151,5 +151,11 @@ public interface LicenceOrderApiService {
*/ */
ServiceResponse<HashMap<String, Integer>> hasPopup(String wxEnterpriseId); ServiceResponse<HashMap<String, Integer>> hasPopup(String wxEnterpriseId);
/**
* 查询企业微信订单状态是否过期
* @return
*/
ServiceResponse<Boolean> checkQywxOrderStatus(Long orderId);
} }
...@@ -32,6 +32,7 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -32,6 +32,7 @@ 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 javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -92,6 +93,7 @@ public class LicenceOrderController { ...@@ -92,6 +93,7 @@ public class LicenceOrderController {
if (ObjectUtil.isNotNull(wxEnterpriseDTO)) { if (ObjectUtil.isNotNull(wxEnterpriseDTO)) {
vo.setWxEnterpriseName(wxEnterpriseDTO.getCorpName()); vo.setWxEnterpriseName(wxEnterpriseDTO.getCorpName());
} }
vo.setNowTime(new Date());
} }
} }
return RestResponse.successResult(result); return RestResponse.successResult(result);
......
...@@ -132,6 +132,14 @@ public class LicenceOrderPageVO implements Serializable { ...@@ -132,6 +132,14 @@ public class LicenceOrderPageVO implements Serializable {
* 微信订单id * 微信订单id
*/ */
private String wxOrderId; private String wxOrderId;
/**
* 企业微信订单过期时间
*/
private Date qywxExpireTime;
/**
* 当前时间
*/
private Date nowTime;
} }
...@@ -198,25 +198,11 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService { ...@@ -198,25 +198,11 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
@Override @Override
public ServiceResponse<Boolean> uploadLicenceOrderVoucher(Long orderId, String voucher, String enterpriseId, String wxEnterpriseId, String creatorName) { public ServiceResponse<Boolean> uploadLicenceOrderVoucher(Long orderId, String voucher, String enterpriseId, String wxEnterpriseId, String creatorName) {
//查询企业微信订单状态是否过期,过期则不能上传订单支付凭证 ServiceResponse<Boolean> response = checkQywxOrderStatus(orderId);
TabHaobanLicenceOrder order = licenceOrderService.getLicenceOrderDetail(orderId); if (response.isSuccess()){
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
if (wxEnterpriseDTO == null) {
return ServiceResponse.failure("-9999", "微信企业不存在!!");
}
String openCorpid = wxEnterpriseDTO.getOpenCorpid();
String serviceCorpid = config.getCorpid();
FeeOrderDeatilResponseDTO dto = qywxUserApiService.getOrder(openCorpid, serviceCorpid, order.getQywxOrderId());
if (null != dto && null != dto.getOrder() && dto.getOrder().getOrderStatus() == 3){
//订单失效,记录订单状态
licenceOrderService.updateLicenceOrderType(order.getOrderId(), 3, order.getEnterpriseId(),
order.getWxEnterpriseId(), "系统", 0);
licenceOrderService.updateLicenceOrderType(order.getOrderId(), 2, order.getEnterpriseId(),
order.getWxEnterpriseId(), "系统", 1);
return ServiceResponse.failure("9999","企业微信订单已过期!");
}
licenceOrderService.uploadLicenceOrderVoucher(orderId, voucher, enterpriseId, wxEnterpriseId, creatorName); licenceOrderService.uploadLicenceOrderVoucher(orderId, voucher, enterpriseId, wxEnterpriseId, creatorName);
return ServiceResponse.success(true); }
return response;
} }
@Override @Override
...@@ -523,4 +509,29 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService { ...@@ -523,4 +509,29 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
return ServiceResponse.success(map); return ServiceResponse.success(map);
} }
@Override
public ServiceResponse<Boolean> checkQywxOrderStatus(Long orderId) {
//查询企业微信订单状态是否过期,过期则不能上传订单支付凭证
TabHaobanLicenceOrder order = licenceOrderService.getLicenceOrderDetail(orderId);
if (null == order){
return ServiceResponse.failure("9999", "订单不存在!!");
}
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseService.selectById(order.getWxEnterpriseId());
if (wxEnterpriseDTO == null) {
return ServiceResponse.failure("9999", "微信企业不存在!!");
}
String openCorpid = wxEnterpriseDTO.getOpenCorpid();
String serviceCorpid = config.getCorpid();
FeeOrderDeatilResponseDTO dto = qywxUserApiService.getOrder(openCorpid, serviceCorpid, order.getQywxOrderId());
if (null != dto && null != dto.getOrder() && dto.getOrder().getOrderStatus() == 3){
//订单失效,记录订单状态
licenceOrderService.updateLicenceOrderType(order.getOrderId(), 3, order.getEnterpriseId(),
order.getWxEnterpriseId(), "系统", 0);
licenceOrderService.updateLicenceOrderType(order.getOrderId(), 2, order.getEnterpriseId(),
order.getWxEnterpriseId(), "系统", 1);
return ServiceResponse.failure("-9999","企业微信订单已过期!");
}
return ServiceResponse.success();
}
} }
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