|
|
|
@ -1,6 +1,7 @@ |
|
|
|
package com.example.demo.serviceImpl.cash; |
|
|
|
|
|
|
|
import com.example.demo.domain.entity.CashRecord; |
|
|
|
import com.example.demo.domain.entity.GOrder; |
|
|
|
import com.example.demo.domain.entity.User; |
|
|
|
import com.example.demo.domain.vo.cash.CashCollection; |
|
|
|
import com.example.demo.domain.vo.coin.Result; |
|
|
|
@ -11,6 +12,8 @@ import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
import java.util.UUID; |
|
|
|
@ -227,4 +230,50 @@ public class CashCollectionServiceImpl implements CashCollectionService { |
|
|
|
public List<String> getActivityList() { |
|
|
|
return cashCollectionMapper.getActivityList(); |
|
|
|
} |
|
|
|
} |
|
|
|
//同步g_order订单到cash_record表 |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public Object syncToCashRecord() { |
|
|
|
while (true) { |
|
|
|
List<GOrder> gOrders = cashCollectionMapper.getUnSync(100); |
|
|
|
if (CollectionUtils.isEmpty(gOrders)) { |
|
|
|
break; |
|
|
|
} |
|
|
|
for (GOrder gOrder : gOrders) { |
|
|
|
CashRecord cashRecord = new CashRecord(); |
|
|
|
cashRecord.setOrderType(1); |
|
|
|
cashRecord.setJwcode(gOrder.getJwcode()); |
|
|
|
cashRecord.setName(cashCollectionMapper.getNameByJwcode(gOrder.getJwcode())); |
|
|
|
cashRecord.setMarket(cashCollectionMapper.getMarketByJwcode(gOrder.getJwcode())); |
|
|
|
cashRecord.setActivity("Link充值金币"); |
|
|
|
cashRecord.setOrderCode(gOrder.getOrderNo()); |
|
|
|
if (gOrder != null) { |
|
|
|
switch (gOrder.getPayStyle()) { |
|
|
|
case 3: |
|
|
|
cashRecord.setPayType("IOS内购"); |
|
|
|
cashRecord.setBankCode(gOrder.getIosTransactionId()); |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
cashRecord.setPayType("Paypal"); |
|
|
|
cashRecord.setBankCode(gOrder.getPaypalOrderId()); |
|
|
|
break; |
|
|
|
case 5: |
|
|
|
cashRecord.setPayType("Stripe-链接收款"); |
|
|
|
break; |
|
|
|
case 6: |
|
|
|
cashRecord.setPayType("PaymentAsia-链接收款"); |
|
|
|
break; |
|
|
|
case 7: |
|
|
|
cashRecord.setPayType("Ipay88-链接收款"); |
|
|
|
break; |
|
|
|
case 9: |
|
|
|
cashRecord.setPayType("FistData"); |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
cashRecord.setGoodsName("Link充值金币"); |
|
|
|
} |
|
|
|
}return "同步成功"; |
|
|
|
}} |