Commit 3f36b210 by jinxin

接口修改

parent a5f4fdae
......@@ -107,6 +107,66 @@ public class LicenceOrderPageDTO implements Serializable {
* 到期时间
*/
private Date expireTime;
/**
* 企业微信支付时间
*/
private Date qywxPayTime;
/**
* gic商户Id
*/
private String enterpriseId;
/**
* gic品牌名称
*/
private String enterpriseName;
/**
* wx企业Id
*/
private String wxEnterpriseId;
/**
* 微信商户名称
*/
private String wxEnterpriseName;
public Date getQywxPayTime() {
return qywxPayTime;
}
public void setQywxPayTime(Date qywxPayTime) {
this.qywxPayTime = qywxPayTime;
}
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
public String getWxEnterpriseId() {
return wxEnterpriseId;
}
public void setWxEnterpriseId(String wxEnterpriseId) {
this.wxEnterpriseId = wxEnterpriseId;
}
public String getWxEnterpriseName() {
return wxEnterpriseName;
}
public void setWxEnterpriseName(String wxEnterpriseName) {
this.wxEnterpriseName = wxEnterpriseName;
}
public Date getExpireTime() {
return expireTime;
......
......@@ -58,7 +58,16 @@ public class LicenceOrderPageQDTO extends BasePageInfo implements Serializable
* 创建人名称
*/
private String creatorName;
/**
* 支付方式 1在线支付 2对公转账
*/
private Integer payType;
public Integer getPayType() {
return payType;
}
public void setPayType(Integer payType) {
this.payType = payType;
}
public String getEnterpriseId() {
return enterpriseId;
}
......
......@@ -7,7 +7,6 @@ import com.gic.haoban.manage.api.dto.licence.LicenceOrderPageDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO;
import java.text.ParseException;
import java.util.Date;
import java.util.List;
......@@ -27,7 +26,7 @@ public interface LicenceOrderApiService {
* @param orderId 订单id
* @return LicenceOrderDTO
*/
ServiceResponse<LicenceOrderDTO> getLicenceOrderDetail(Long orderId,Integer type);
ServiceResponse<LicenceOrderDTO> getLicenceOrderDetail(Long orderId, Integer type);
/**
* 删除订单
......@@ -61,7 +60,7 @@ public interface LicenceOrderApiService {
* @param wxFlag 1微信订单状态 0 企业微信订单状态
* @return
*/
ServiceResponse<Boolean> updateLicenceOrderType(Long orderId, Integer type,String enterpriseId,String wxEnterpriseId,String creatorName,Integer wxFlag);
ServiceResponse<Boolean> updateLicenceOrderType(Long orderId, Integer type, String enterpriseId, String wxEnterpriseId, String creatorName, Integer wxFlag);
/**
* 订单凭证上传
......@@ -70,7 +69,7 @@ public interface LicenceOrderApiService {
* @param voucher 凭证url
* @return
*/
ServiceResponse<Boolean> uploadLicenceOrderVoucher(Long orderId, String voucher,String enterpriseId,String wxEnterpriseId,String creatorName);
ServiceResponse<Boolean> uploadLicenceOrderVoucher(Long orderId, String voucher, String enterpriseId, String wxEnterpriseId, String creatorName);
/**
* 订单支付接口
......@@ -78,7 +77,7 @@ public interface LicenceOrderApiService {
* @param orderId 订单id
* @return
*/
ServiceResponse<Boolean> payLicenceOrder(Long orderId,String wxEnterpriseId);
ServiceResponse<String> payLicenceOrder(Long orderId, String wxEnterpriseId);
/**
* 查询企业是否存在订单未支付接口
......@@ -92,40 +91,46 @@ public interface LicenceOrderApiService {
* 微信通知回调接口
*/
ServiceResponse<Boolean> wxCallBack(String params);
/**
* 企业微信通知回调接口
*/
ServiceResponse<Boolean> qywxCallBack(String params);
/**
* 保存微信交易信息
* @param orderId 订单id
*
* @param orderId 订单id
* @param transactionCode 订单编号
* @param prepayId 微信预支付id
* @param wxOrderId 微信支付id
* @param prepayId 微信预支付id
* @param wxOrderId 微信支付id
* @return
*/
ServiceResponse<Boolean> saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId, Date payTime);
/**
* 查询订单编号id
* @param param 查询参数
* @param type 0 微信订单编号 1 企业微信订单编号
*
* @param param 查询参数
* @param type 0 微信订单编号 1 企业微信订单编号
* @param wxEnterpriseId
* @return
*/
ServiceResponse<List<String>> getOrderIdList(String param,Integer type,String wxEnterpriseId);
ServiceResponse<List<String>> getOrderIdList(String param, Integer type, String wxEnterpriseId);
/**
* 审核订单
*
* @param orderId 订单id
* @param flag 是否通过 0 否 1是
* @param reason 不通过原因
* @param flag 是否通过 0 否 1是
* @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 enterpriseId, String wxEnterpriseId, String creatorName);
/**
* 微信退款
*
* @return
*/
ServiceResponse<Boolean> wxRefund(Long orderId);
......
package com.gic.haoban.manage.web.controller;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
......@@ -77,15 +78,26 @@ public class LicenceOrderController {
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
String enterpriseId = loginUser.getEnterpriseId();
String wxEnterpriseId = loginUser.getWxEnterpriseId();
String clerkName = loginUser.getClerkName();
LicenceOrderPageQDTO qdto = JSONObject.parseObject(JSONObject.toJSONString(licenceOrderPageQO), LicenceOrderPageQDTO.class);
qdto.setEnterpriseId(enterpriseId);
qdto.setWxEnterpriseId(wxEnterpriseId);
qdto.setCreatorName(clerkName);
ServiceResponse<Page<LicenceOrderPageDTO>> licenceOrderPage = licenceOrderApiService.getLicenceOrderPage(qdto);
Page<LicenceOrderPageVO> result = PageHelperUtils.changePageToCurrentPage(licenceOrderPage.getResult(), LicenceOrderPageVO.class);
if (CollUtil.isNotEmpty(result.getResult())) {
for (LicenceOrderPageVO vo : result.getResult()) {
//查询gic品牌名称
EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(vo.getEnterpriseId());
if (ObjectUtil.isNotNull(enterpriseDTO)) {
vo.setEnterpriseName(enterpriseDTO.getEnterpriseName());
}
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseApiService.getOne(vo.getWxEnterpriseId());
if (ObjectUtil.isNotNull(wxEnterpriseDTO)) {
vo.setWxEnterpriseName(wxEnterpriseDTO.getCorpName());
}
}
}
return RestResponse.successResult(result);
}
......@@ -104,8 +116,8 @@ public class LicenceOrderController {
Boolean result = licenceOrderApiService.updateLicenceOrderType(orderId, 2, enterpriseId, wxEnterpriseId, clerkName, 1).getResult();
//微信退款
ServiceResponse<Boolean> response = licenceOrderApiService.wxRefund(orderId);
if (!response.isSuccess()){
return RestResponse.failure(response.getCode(),response.getMessage());
if (!response.isSuccess()) {
return RestResponse.failure(response.getCode(), response.getMessage());
}
return RestResponse.successResult(result);
}
......@@ -114,24 +126,28 @@ public class LicenceOrderController {
* 支付订单
*/
@RequestMapping("licence-order-pay")
public RestResponse<Boolean> payLicenceOrder(@RequestParam Long orderId) {
public RestResponse<String> payLicenceOrder(@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());
}
Boolean result = licenceOrderApiService.payLicenceOrder(orderId, loginUser.getWxEnterpriseId()).getResult();
return RestResponse.successResult(result);
ServiceResponse<String> response = licenceOrderApiService.payLicenceOrder(orderId, loginUser.getWxEnterpriseId());
if (response.isSuccess()) {
return RestResponse.successResult(response.getResult());
}
return RestResponse.failure(response.getCode(), response.getMessage());
}
/**
* 审核订单
*
* @param orderId 订单id
* @param flag 是否通过 0 否 1是
* @param reason 不通过原因
* @param flag 是否通过 0 否 1是
* @param reason 不通过原因
* @return
*/
@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) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
......@@ -139,7 +155,7 @@ public class LicenceOrderController {
String enterpriseId = loginUser.getEnterpriseId();
String wxEnterpriseId = loginUser.getWxEnterpriseId();
String clerkName = loginUser.getClerkName();
Boolean result = licenceOrderApiService.checkLicenceOrder(orderId, flag, reason,enterpriseId, wxEnterpriseId, clerkName).getResult();
Boolean result = licenceOrderApiService.checkLicenceOrder(orderId, flag, reason, enterpriseId, wxEnterpriseId, clerkName).getResult();
return RestResponse.successResult(result);
}
......
......@@ -108,19 +108,26 @@ public class LicenceOrderPageVO implements Serializable {
* 创建人名称
*/
private String creatorName;
/**
* 企业微信支付时间
*/
private Date qywxPayTime;
/**
* gic商户Id
*/
private String enterpriseId;
/**
* gic品牌名称
*/
private String enterpriseName;
/**
* 企业微信商户名称
* wx企业Id
*/
private String wxEnterpriseName;
private String wxEnterpriseId;
/**
* 企业微信支付时间
* 微信商户名称
*/
private Date qywxPayTime;
private String wxEnterpriseName;
}
......@@ -43,7 +43,7 @@ public class LicenceOrderServiceTest {
}
@Test
public void test4(){
ServiceResponse<Boolean> result = licenceOrderApiService.payLicenceOrder(512360219787935783L, "ca66a01b79474c40b3e7c7f93daf1a3b");
ServiceResponse<String> result = licenceOrderApiService.payLicenceOrder(512360219787935783L, "ca66a01b79474c40b3e7c7f93daf1a3b");
}
@Test
public void test5(){
......
......@@ -127,7 +127,7 @@ public class LicenceOrderController {
}else {
time = licenceOrderQO.getTimeValue()+"天";
}
String logValue ="【购买企微许可账号】:企业员工账号"+licenceOrderQO.getExternalContactCount()+"个,时长"+time;
String logValue ="【购买企微许可账号】:订单编号"+result+",企业员工账号"+licenceOrderQO.getExternalContactCount()+"个,时长"+time;
GicLogRecordEvaluationContext.putAttribute("logValue", logValue);
return RestResponse.successResult(result);
}
......@@ -173,7 +173,7 @@ public class LicenceOrderController {
String wxEnterpriseId = loginUser.getWxEnterpriseId();
String clerkName = loginUser.getClerkName();
Boolean result = licenceOrderApiService.updateLicenceOrderType(orderId, type, enterpriseId, wxEnterpriseId, clerkName, 1).getResult();
String logValue ="【取消购买企微许可账号订单】:订单编号"+dto.getTransactionId()+",取消时间"+DateUtil.dateToStr(new Date(),DateUtil.FORMAT_DATETIME_19);
String logValue ="【取消购买企微许可账号订单】:订单编号"+orderId+",取消时间"+DateUtil.dateToStr(new Date(),DateUtil.FORMAT_DATETIME_19);
GicLogRecordEvaluationContext.putAttribute("logValue", logValue);
return RestResponse.successResult(result);
}
......@@ -198,7 +198,7 @@ public class LicenceOrderController {
String wxEnterpriseId = loginUser.getWxEnterpriseId();
String clerkName = loginUser.getClerkName();
Boolean result = licenceOrderApiService.uploadLicenceOrderVoucher(orderId, voucher, enterpriseId, wxEnterpriseId, clerkName).getResult();
String logValue ="【上传购买企微许可账号支付凭证】:订单编号"+dto.getTransactionId()+",上传时间"+DateUtil.dateToStr(new Date(),DateUtil.FORMAT_DATETIME_19);
String logValue ="【上传购买企微许可账号支付凭证】:订单编号"+orderId+",上传时间"+DateUtil.dateToStr(new Date(),DateUtil.FORMAT_DATETIME_19);
GicLogRecordEvaluationContext.putAttribute("logValue", logValue);
return RestResponse.successResult(result);
}
......
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