Commit 2b5420a1 by jinxin

存储微信url

parent 3f36b210
......@@ -149,6 +149,18 @@ public class LicenceOrderDTO implements Serializable {
* 订单进度list
*/
private List<LicenceOrderProgressDTO> OrderProgressList;
/**
* 微信url
*/
private String wxUrl;
public String getWxUrl() {
return wxUrl;
}
public void setWxUrl(String wxUrl) {
this.wxUrl = wxUrl;
}
public Long getOrderId() {
return orderId;
......
......@@ -8,6 +8,7 @@ import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO;
import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
......@@ -106,7 +107,7 @@ public interface LicenceOrderApiService {
* @param wxOrderId 微信支付id
* @return
*/
ServiceResponse<Boolean> saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId, Date payTime);
ServiceResponse<Boolean> saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId, Date payTime,String wxUrl);
/**
* 查询订单编号id
......@@ -134,6 +135,10 @@ public interface LicenceOrderApiService {
* @return
*/
ServiceResponse<Boolean> wxRefund(Long orderId);
/**
* 查询开户信息
*/
ServiceResponse<HashMap<String, String>> getAccountInfo();
}
......@@ -158,6 +158,24 @@ public class LicenceOrderController {
Boolean result = licenceOrderApiService.checkLicenceOrder(orderId, flag, reason, enterpriseId, wxEnterpriseId, clerkName).getResult();
return RestResponse.successResult(result);
}
/**
* 订单退款
*
* @param orderId 订单id
* @return
*/
@RequestMapping("licence-order-refund")
public RestResponse<Boolean> refundLicenceOrder(@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());
}
String enterpriseId = loginUser.getEnterpriseId();
String wxEnterpriseId = loginUser.getWxEnterpriseId();
String clerkName = loginUser.getClerkName();
Boolean result = licenceOrderApiService.updateLicenceOrderType(orderId, 4, enterpriseId, wxEnterpriseId, clerkName, 0).getResult();
return RestResponse.successResult(result);
}
/**
......@@ -203,17 +221,14 @@ public class LicenceOrderController {
/**
* 查询开户信息
*/
/*@RequestMapping("get-account-info")
@RequestMapping("get-account-info")
public RestResponse<HashMap<String, String>> getAccountInfo() {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
HashMap<String, String> result = new HashMap<>(8);
result.put("accountName",config.getAccountName());
result.put("accountNumber",config.getAccountNumber());
result.put("bankName",config.getBankName());
HashMap<String, String> result = licenceOrderApiService.getAccountInfo().getResult();
return RestResponse.successResult(result);
}*/
}
}
......@@ -31,6 +31,39 @@ public class Config {
@Value("${buyerUserid}")
private String buyerUserid;
/**
* 企业微信许可账号购买信息
*/
@Value("${accountName}")
private String accountName;
@Value("${accountNumber}")
private String accountNumber;
@Value("${bankName}")
private String bankName;
public String getAccountName() {
return accountName;
}
public void setAccountName(String accountName) {
this.accountName = accountName;
}
public String getAccountNumber() {
return accountNumber;
}
public void setAccountNumber(String accountNumber) {
this.accountNumber = accountNumber;
}
public String getBankName() {
return bankName;
}
public void setBankName(String bankName) {
this.bankName = bankName;
}
public String getBuyerUserid() {
return buyerUserid;
......
......@@ -86,8 +86,8 @@ public interface TabHaobanLicenceOrderMapper {
List<TabHaobanLicenceOrder> getLicenceOrderPage(LicenceOrderPageQDTO licenceOrderPageQDTO);
Integer saveTransactionCode(@Param("orderId") Long orderId, @Param("transactionCode") String transactionCode,
@Param("prepayId") String prepayId, @Param("wxOrderId") String wxOrderId, @Param("payTime") Date payTime);
Integer saveTransactionCode(@Param("orderId") Long orderId, @Param("transactionCode") String transactionCode, @Param("prepayId") String prepayId,
@Param("wxOrderId") String wxOrderId, @Param("payTime") Date payTime,@Param("wxUrl") String wxUrl);
/**
* 获取订单详情
......
......@@ -166,6 +166,10 @@ public class TabHaobanLicenceOrder implements Serializable {
* 微信支付id
*/
private String wxOrderId;
/**
* 微信url
*/
private String wxUrl;
}
......@@ -88,7 +88,7 @@ public interface LicenceOrderService {
* @param wxOrderId 微信支付id
* @return
*/
Integer saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId, Date payTime);
Integer saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId, Date payTime,String wxUrl);
/**
* 查询微信订单详情
......
......@@ -230,8 +230,8 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
}
@Override
public Integer saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId,Date payTime) {
return tabHaobanLicenceOrderMapper.saveTransactionCode(orderId,transactionCode,prepayId,wxOrderId,payTime);
public Integer saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId,Date payTime,String wxUrl) {
return tabHaobanLicenceOrderMapper.saveTransactionCode(orderId,transactionCode,prepayId,wxOrderId,payTime,wxUrl);
}
@Override
......
......@@ -41,6 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
/**
......@@ -209,7 +210,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
//更新订单状态
licenceOrderService.updateLicenceOrderType(licenceOrder.getOrderId(), 1, licenceOrder.getEnterpriseId(), licenceOrder.getWxEnterpriseId(), "系统", 1);
//保存微信订单id
licenceOrderService.saveTransactionCode(licenceOrder.getOrderId(), null, null, transactionId, payTime);
licenceOrderService.saveTransactionCode(licenceOrder.getOrderId(), null, null, transactionId, payTime,null);
//查询gic品牌名称
String enterpriseName = "";
String wxEnterpriseName = "";
......@@ -291,8 +292,8 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
}
@Override
public ServiceResponse<Boolean> saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId, Date payTime) {
licenceOrderService.saveTransactionCode(orderId, transactionCode, prepayId, wxOrderId, payTime);
public ServiceResponse<Boolean> saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId, Date payTime,String wxUrl) {
licenceOrderService.saveTransactionCode(orderId, transactionCode, prepayId, wxOrderId, payTime,wxUrl);
return ServiceResponse.success(true);
}
......@@ -330,4 +331,13 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
return ServiceResponse.success(true);
}
@Override
public ServiceResponse<HashMap<String, String>> getAccountInfo() {
HashMap<String, String> result = new HashMap<>(8);
result.put("accountName",config.getAccountName());
result.put("accountNumber",config.getAccountNumber());
result.put("bankName",config.getBankName());
return ServiceResponse.success(result);
}
}
......@@ -32,6 +32,7 @@
<result column="expire_time" property="expireTime"/>
<result column="prepay_id" property="prepayId"/>
<result column="wx_order_id" property="wxOrderId"/>
<result column="wx_url" property="wxUrl"/>
</resultMap>
<sql id="Base_Column_List">
order_id,
......@@ -63,7 +64,8 @@
creator_name,
expire_time,
prepay_id,
wx_order_id
wx_order_id,
wx_url
</sql>
<!-- ===================== 新增 ======================== -->
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder"
......@@ -247,6 +249,9 @@
<if test="payTime != null">
pay_time = #{payTime},
</if>
<if test="wxUrl != null">
wx_url = #{wxUrl},
</if>
update_time = now()
WHERE order_id = #{orderId}
and delete_flag = 0
......
......@@ -122,12 +122,12 @@ public class LicenceOrderController {
licenceOrderQDTO.setCreatorName(loginUser.getClerkName());
String result = licenceOrderApiService.saveOrUpdateLicenceOrder(licenceOrderQDTO).getResult();
String time = "";
if (licenceOrderQO.getTimeType() == 1){
time = licenceOrderQO.getTimeValue()+"个月";
}else {
time = licenceOrderQO.getTimeValue()+"天";
if (licenceOrderQO.getTimeType() == 1) {
time = licenceOrderQO.getTimeValue() + "个月";
} else {
time = licenceOrderQO.getTimeValue() + "天";
}
String logValue ="【购买企微许可账号】:订单编号"+result+",企业员工账号"+licenceOrderQO.getExternalContactCount()+"个,时长"+time;
String logValue = "【购买企微许可账号】:订单编号" + result + ",企业员工账号" + licenceOrderQO.getExternalContactCount() + "个,时长" + time;
GicLogRecordEvaluationContext.putAttribute("logValue", logValue);
return RestResponse.successResult(result);
}
......@@ -164,16 +164,16 @@ public class LicenceOrderController {
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
ServiceResponse<LicenceOrderDTO> licenceOrderDetail = licenceOrderApiService.getLicenceOrderDetail(orderId,null);
ServiceResponse<LicenceOrderDTO> licenceOrderDetail = licenceOrderApiService.getLicenceOrderDetail(orderId, null);
LicenceOrderDTO dto = licenceOrderDetail.getResult();
if (null == dto){
if (null == dto) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_5.getCode()), HaoBanErrCode.ERR_5.getMsg());
}
String enterpriseId = loginUser.getEnterpriseId();
String wxEnterpriseId = loginUser.getWxEnterpriseId();
String clerkName = loginUser.getClerkName();
Boolean result = licenceOrderApiService.updateLicenceOrderType(orderId, type, enterpriseId, wxEnterpriseId, clerkName, 1).getResult();
String logValue ="【取消购买企微许可账号订单】:订单编号"+orderId+",取消时间"+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);
}
......@@ -189,16 +189,16 @@ public class LicenceOrderController {
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
ServiceResponse<LicenceOrderDTO> licenceOrderDetail = licenceOrderApiService.getLicenceOrderDetail(orderId,null);
ServiceResponse<LicenceOrderDTO> licenceOrderDetail = licenceOrderApiService.getLicenceOrderDetail(orderId, null);
LicenceOrderDTO dto = licenceOrderDetail.getResult();
if (null == dto){
if (null == dto) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_5.getCode()), HaoBanErrCode.ERR_5.getMsg());
}
String enterpriseId = loginUser.getEnterpriseId();
String wxEnterpriseId = loginUser.getWxEnterpriseId();
String clerkName = loginUser.getClerkName();
Boolean result = licenceOrderApiService.uploadLicenceOrderVoucher(orderId, voucher, enterpriseId, wxEnterpriseId, clerkName).getResult();
String logValue ="【上传购买企微许可账号支付凭证】:订单编号"+orderId+",上传时间"+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);
}
......@@ -216,6 +216,14 @@ public class LicenceOrderController {
if (result == null) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_5.getCode()), HaoBanErrCode.ERR_5.getMsg());
}
//判断url是否存在,存在直接返回
if (null != result.getWxUrl() && null != result.getExpireTime() && new Date().before(result.getExpireTime())) {
Map<String, Object> map = new HashMap<String, Object>();
map.put("transactionCode", result.getTransactionId());
map.put("url", result.getWxUrl());
map.put("money", result.getPrice());
return RestResponse.successResult(map);
}
Integer money = result.getPrice();
if (null != loginUser.getPhoneNumber() && Arrays.asList("13456789987", "13429152802").contains(loginUser.getPhoneNumber())) {
//测试账号付款一分
......@@ -247,7 +255,7 @@ public class LicenceOrderController {
map.put("url", prePaymentOrderForQYWX.getCode_url());
map.put("money", money);
//记录订单号transactionCode和预支付交易会话标识
licenceOrderApiService.saveTransactionCode(orderId, transactionCode, prePaymentOrderForQYWX.getPrepay_id(), null, null);
licenceOrderApiService.saveTransactionCode(orderId, transactionCode, prePaymentOrderForQYWX.getPrepay_id(), null, null, url);
return RestResponse.successResult(map);
}
......@@ -306,6 +314,7 @@ public class LicenceOrderController {
ServiceResponse<String> payLicenceOrder = licenceOrderApiService.isPayLicenceOrder(loginUser.getWxEnterpriseId());
return RestResponse.successResult(payLicenceOrder.getResult());
}
/**
* 查询开户信息
*/
......@@ -316,20 +325,21 @@ public class LicenceOrderController {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
}
HashMap<String, String> result = new HashMap<>(8);
result.put("accountName",config.getAccountName());
result.put("accountNumber",config.getAccountNumber());
result.put("bankName",config.getBankName());
result.put("accountName", config.getAccountName());
result.put("accountNumber", config.getAccountNumber());
result.put("bankName", config.getBankName());
return RestResponse.successResult(result);
}
/**
* 订单编号和企业微信订单编号模糊搜索
*
* @param param 模糊查询
* @param type 0 微信订单编号 1 企业微信订单编号
* @param type 0 微信订单编号 1 企业微信订单编号
* @return
*/
@RequestMapping("get-order-id-list")
public RestResponse<List<String>> getOrderIdList(String param,Integer type) {
public RestResponse<List<String>> getOrderIdList(String param, Integer type) {
WebLoginDTO loginUser = AuthWebRequestUtil.getLoginUser();
if (loginUser == null || StringUtils.isBlank(loginUser.getEnterpriseId())) {
return RestResponse.failure(Convert.toStr(HaoBanErrCode.ERR_4.getCode()), HaoBanErrCode.ERR_4.getMsg());
......
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