Commit d01122a2 by jinxin

bug处理

parent ca886b87
......@@ -7,6 +7,8 @@ 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.util.Date;
/**
* <p>
* 服务类
......@@ -100,7 +102,7 @@ public interface LicenceOrderApiService {
* @param wxOrderId 微信支付id
* @return
*/
ServiceResponse<Boolean> saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId);
ServiceResponse<Boolean> saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId, Date payTime);
}
......@@ -4,6 +4,8 @@ import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO;
import com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder;
import org.apache.ibatis.annotations.Param;
import javax.xml.crypto.Data;
import java.util.Date;
import java.util.List;
/**
......@@ -84,7 +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);
Integer saveTransactionCode(@Param("orderId") Long orderId, @Param("transactionCode") String transactionCode,
@Param("prepayId") String prepayId, @Param("wxOrderId") String wxOrderId, @Param("payTime") Date payTime);
/**
* 获取订单详情
......
......@@ -7,6 +7,8 @@ import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO;
import com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
/**
* <p>
* 企业微信许可账号购买
......@@ -84,7 +86,7 @@ public interface LicenceOrderService {
* @param wxOrderId 微信支付id
* @return
*/
Integer saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId);
Integer saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId, Date payTime);
/**
* 查询微信订单详情
......
......@@ -66,6 +66,8 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
TabHaobanLicenceOrder order = JSONObject.parseObject(JSONObject.toJSONString(licenceOrderQDTO), TabHaobanLicenceOrder.class);
Date now = new Date();
order.setOrderId(orderId);
//默认支付状态为待支付
order.setOrderStatus(0);
order.setCreateTime(now);
order.setUpdateTime(now);
Date expireTime;
......@@ -208,8 +210,8 @@ public class LicenceOrderServiceImpl implements LicenceOrderService {
}
@Override
public Integer saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId) {
return tabHaobanLicenceOrderMapper.saveTransactionCode(orderId,transactionCode,prepayId,wxOrderId);
public Integer saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId,Date payTime) {
return tabHaobanLicenceOrderMapper.saveTransactionCode(orderId,transactionCode,prepayId,wxOrderId,payTime);
}
@Override
......
......@@ -174,11 +174,21 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
String orderId = object.getString("orderId");
String transactionId = object.getString("transactionId");
String timeEnd = object.getString("timeEnd");
TabHaobanLicenceOrder licenceOrder = licenceOrderService.selectByTransactionId(transactionId);
TabHaobanLicenceOrder licenceOrder = licenceOrderService.selectByTransactionId(orderId);
if (licenceOrder == null){
logger.info("微信回调的订单编号:{}异常!!",orderId);
return ServiceResponse.success(false);
}
if (licenceOrder.getOrderStatus() == 1){
//微信会多次回调
logger.info("微信回调的订单已处理!");
return ServiceResponse.success(false);
}
Date payTime = DateUtil.strToDate(DateUtil.FORMAT_DATETIME_14, timeEnd);
//更新订单状态
licenceOrderService.updateLicenceOrderType(licenceOrder.getOrderId(),1,licenceOrder.getEnterpriseId(),licenceOrder.getWxEnterpriseId(),"系统",1);
//保存微信订单id
licenceOrderService.saveTransactionCode(licenceOrder.getOrderId(), null,null,orderId);
licenceOrderService.saveTransactionCode(licenceOrder.getOrderId(), null,null,transactionId,payTime);
//生成企业微信订单
// payLicenceOrder(licenceOrder.getOrderId(),licenceOrder.getWxEnterpriseId());
//查询gic品牌名称
......@@ -225,8 +235,8 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
}
@Override
public ServiceResponse<Boolean> saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId) {
licenceOrderService.saveTransactionCode(orderId,transactionCode,prepayId,wxOrderId);
public ServiceResponse<Boolean> saveTransactionCode(Long orderId, String transactionCode, String prepayId, String wxOrderId,Date payTime) {
licenceOrderService.saveTransactionCode(orderId,transactionCode,prepayId,wxOrderId,payTime);
return ServiceResponse.success(true);
}
}
......@@ -243,6 +243,9 @@
<if test="wxOrderId != null">
wx_order_id = #{wxOrderId},
</if>
<if test="payTime != null">
pay_time = #{payTime},
</if>
update_time = now()
WHERE order_id = #{orderId}
and delete_flag = 0
......
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