Commit 3f36b210 by jinxin

接口修改

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