You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

524 lines
24 KiB

1 month ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
1 month ago
  1. package com.example.demo.serviceImpl.cash;
  2. import com.example.demo.Util.JWTUtil;
  3. import com.example.demo.Util.LanguageTranslationUtil;
  4. import com.example.demo.config.RabbitMQConfig;
  5. import com.example.demo.domain.DTO.PerformanceDTO;
  6. import com.example.demo.domain.entity.*;
  7. import com.example.demo.domain.vo.cash.CashCollection;
  8. import com.example.demo.domain.vo.cash.CashCollectionMessage;
  9. import com.example.demo.domain.vo.cash.PerformanceVO;
  10. import com.example.demo.domain.vo.coin.GoldUser;
  11. import com.example.demo.domain.vo.coin.Messages;
  12. import com.example.demo.mapper.cash.CashCollectionMapper;
  13. import com.example.demo.mapper.coin.MarketMapper;
  14. import com.example.demo.mapper.coin.UserMapper;
  15. import com.example.demo.service.cash.CashCollectionService;
  16. import com.github.pagehelper.PageHelper;
  17. import com.github.pagehelper.PageInfo;
  18. import jakarta.servlet.http.HttpServletRequest;
  19. import lombok.extern.slf4j.Slf4j;
  20. import org.springframework.amqp.rabbit.core.RabbitTemplate;
  21. import org.springframework.beans.factory.annotation.Autowired;
  22. import org.springframework.stereotype.Service;
  23. import org.springframework.transaction.annotation.Transactional;
  24. import org.springframework.util.CollectionUtils;
  25. import org.springframework.web.bind.annotation.RequestHeader;
  26. import org.springframework.web.context.request.RequestContextHolder;
  27. import org.springframework.web.context.request.ServletRequestAttributes;
  28. import java.math.BigDecimal;
  29. import java.time.LocalDateTime;
  30. import java.time.ZoneOffset;
  31. import java.util.Arrays;
  32. import java.util.List;
  33. import java.util.UUID;
  34. import java.util.stream.Collectors;
  35. /**
  36. * @program: gold-java
  37. * @ClassName cashCollectionServiceImpl
  38. * @description: 处理收款相关业务逻辑
  39. * @author: Ethan
  40. * @create: 202509-26 11:23
  41. * @Version 1.0
  42. **/
  43. @Service
  44. @Slf4j
  45. public class CashCollectionServiceImpl implements CashCollectionService {
  46. @Autowired
  47. private CashCollectionMapper cashCollectionMapper;
  48. @Autowired
  49. private UserMapper userMapper;
  50. @Autowired
  51. private MarketMapper marketMapper;
  52. @Autowired
  53. private RabbitTemplate rabbitTemplate;
  54. @Autowired
  55. private LanguageTranslationUtil languageTranslationUtil;
  56. //新增收款订单
  57. @Override
  58. public String add(CashCollection cashCollection,@RequestHeader(defaultValue = "zh_CN") String lang) {
  59. if (cashCollection.getJwcode() == null) {
  60. throw new IllegalArgumentException("精网号不能为空");
  61. }
  62. if (cashCollection.getJwcode() < 10000000 || cashCollection.getJwcode() > 99999999) {
  63. throw new IllegalArgumentException("精网号必须为8位");
  64. }
  65. if (cashCollection.getName() == null || cashCollection.getName().isEmpty()){
  66. throw new IllegalArgumentException("客户姓名不能为空");
  67. }
  68. if (cashCollection.getActivity() == null || cashCollection.getActivity().isEmpty()) {
  69. throw new IllegalArgumentException("活动不能为空");
  70. }
  71. if (cashCollection.getGoodsName() == null|| cashCollection.getGoodsName().isEmpty()) {
  72. throw new IllegalArgumentException("产品名称不能为空");
  73. }
  74. if (cashCollection.getGoodsName().equals("金币充值")) {
  75. if (cashCollection.getPermanentGold() == 0 && cashCollection.getFreeGold() == 0) {
  76. throw new IllegalArgumentException("金币数量不能为空");
  77. }
  78. }
  79. if (!cashCollection.getGoodsName().equals("金币充值")) {
  80. if (cashCollection.getGoodNum() == 0) {
  81. throw new IllegalArgumentException("产品数量不能为空");
  82. }
  83. if (cashCollection.getNumUnit() == null|| cashCollection.getNumUnit().isEmpty()) {
  84. throw new IllegalArgumentException("数量单位不能为空");
  85. }
  86. }
  87. if (cashCollection.getPaymentCurrency() == null || cashCollection.getPaymentCurrency().isEmpty()) {
  88. throw new IllegalArgumentException("支付币种不能为空");
  89. }
  90. if (cashCollection.getPaymentAmount() == null || cashCollection.getPaymentAmount().compareTo(BigDecimal.ZERO) == 0) {
  91. throw new IllegalArgumentException("支付金额不能为空");
  92. }
  93. if (cashCollection.getPayType() == null|| cashCollection.getPayType().isEmpty()) {
  94. throw new IllegalArgumentException("支付方式不能为空");
  95. }
  96. if (cashCollection.getReceivedMarket() == null||cashCollection.getReceivedMarket().isEmpty()) {
  97. throw new IllegalArgumentException("到账地区不能为空");
  98. }
  99. if (cashCollection.getPayTime() == null) {
  100. throw new IllegalArgumentException("付款时间不能为空");
  101. }
  102. //生成订单号后半部分
  103. String orderNumber = UUID.randomUUID().toString().replaceAll("-", "");
  104. CashRecord cashRecord = new CashRecord();
  105. //构建订单信息
  106. cashRecord.setOrderCode("XJ_" + orderNumber); //订单号
  107. cashRecord.setJwcode(cashCollection.getJwcode()); //精网号
  108. cashRecord.setName(cashCollection.getName()); //客户姓名
  109. cashRecord.setActivity(cashCollection.getActivity()); // 活动
  110. cashRecord.setGoodsName(cashCollection.getGoodsName()); //商品名称
  111. cashRecord.setGoodNum(cashCollection.getGoodNum()); //商品数量
  112. cashRecord.setNumUnit(cashCollection.getNumUnit()); //数量单位
  113. cashRecord.setPermanentGold(cashCollection.getPermanentGold()); //永久金币
  114. cashRecord.setFreeGold(cashCollection.getFreeGold()); //免费金币
  115. cashRecord.setPaymentCurrency(cashCollection.getPaymentCurrency()); //付款币种
  116. cashRecord.setPaymentAmount(cashCollection.getPaymentAmount()); //付款金额
  117. cashRecord.setReceivedMarket(cashCollection.getReceivedMarket()); //到账地区
  118. cashRecord.setPayType(cashCollection.getPayType()); //支付方式
  119. cashRecord.setPayTime(cashCollection.getPayTime()); //付款时间
  120. cashRecord.setVoucher(cashCollection.getVoucher()); //转账凭证
  121. cashRecord.setRemark(cashCollection.getRemark()); //备注
  122. cashRecord.setStatus(0); //订单状态:付款线下财务待审核
  123. cashRecord.setSubmitterId(cashCollection.getSubmitterId()); //提交人ID
  124. cashRecord.setSubmitterMarket(cashCollection.getSubmitterMarket());
  125. cashRecord.setOrderType(1); //订单类型:1-收款
  126. cashRecord.setMarket(cashCollection.getMarket());
  127. //地区,根据jwcode插入
  128. //cashRecord.setMarket(cashCollectionMapper.getMarketByJwcode(cashRecord.getJwcode()));
  129. //插入新收款订单
  130. cashCollectionMapper.add(cashRecord);
  131. // 发送收款创建消息
  132. Messages message = new Messages();
  133. message.setJwcode(cashRecord.getJwcode());
  134. message.setName(cashRecord.getName());
  135. message.setStatus(cashRecord.getStatus());
  136. message.setDesc(cashRecord.getJwcode()+languageTranslationUtil.translate("用户的现金收款申请待审核,请前往审核", lang));
  137. message.setTitle(languageTranslationUtil.translate("现金收款--新增收款", lang));
  138. message.setType(1);
  139. message.setTypeId(cashRecord.getId());
  140. message.setMarket(Integer.valueOf(cashRecord.getMarket()));
  141. String marketName = marketMapper.getMarketNameById(String.valueOf(message.getMarket()));
  142. message.setMarketName(languageTranslationUtil.translate(marketName, lang));
  143. rabbitTemplate.convertAndSend(RabbitMQConfig.CASH_COLLECTION_EXCHANGE, "cash.collection.save", message);
  144. return "添加成功";
  145. }
  146. @Override
  147. public String addFreeCoin(CashCollection cashCollection,@RequestHeader(defaultValue = "zh_CN") String lang) {
  148. if (cashCollection.getJwcode() == null) {
  149. throw new IllegalArgumentException("精网号不能为空");
  150. }
  151. if (cashCollection.getJwcode() < 10000000 || cashCollection.getJwcode() > 99999999) {
  152. throw new IllegalArgumentException("精网号必须为8位");
  153. }
  154. if (cashCollection.getName() == null || cashCollection.getName().isEmpty()){
  155. throw new IllegalArgumentException("客户姓名不能为空");
  156. }
  157. if (cashCollection.getActivity() == null || cashCollection.getActivity().isEmpty()) {
  158. throw new IllegalArgumentException("活动不能为空");
  159. }
  160. if (cashCollection.getFreeGold() == 0) {
  161. throw new IllegalArgumentException("免费金币数量不能为空");
  162. }
  163. //生成订单号后半部分
  164. String orderNumber = UUID.randomUUID().toString().replaceAll("-", "");
  165. CashRecord cashRecord = new CashRecord();
  166. //构建订单信息
  167. cashRecord.setOrderCode("XJ_" + orderNumber); //订单号
  168. cashRecord.setJwcode(cashCollection.getJwcode()); //精网号
  169. cashRecord.setName(cashCollection.getName()); //客户姓名
  170. cashRecord.setActivity(cashCollection.getActivity()); // 活动
  171. cashRecord.setGoodsName("免费金币赠送"); //商品名称
  172. cashRecord.setFreeGold(cashCollection.getFreeGold()); //免费金币
  173. cashRecord.setRemark(cashCollection.getRemark()); //备注
  174. cashRecord.setStatus(0); //订单状态:付款线下财务待审核
  175. cashRecord.setSubmitterId(cashCollection.getSubmitterId()); //提交人ID
  176. cashRecord.setSubmitterMarket(cashCollection.getSubmitterMarket());
  177. cashRecord.setOrderType(1); //订单类型:1-收款
  178. cashRecord.setMarket(cashCollection.getMarket());
  179. //地区,根据jwcode插入
  180. //cashRecord.setMarket(cashCollectionMapper.getMarketByJwcode(cashRecord.getJwcode()));
  181. //插入新收款订单
  182. cashCollectionMapper.add(cashRecord);
  183. // 发送收款创建消息
  184. Messages message = new Messages();
  185. message.setJwcode(cashRecord.getJwcode());
  186. message.setName(cashRecord.getName());
  187. message.setStatus(cashRecord.getStatus());
  188. message.setDesc(cashRecord.getJwcode()+languageTranslationUtil.translate("用户的现金收款申请待审核,请前往审核", lang));
  189. message.setTitle(languageTranslationUtil.translate("现金收款--赠送免费金币", lang));
  190. message.setType(1);
  191. message.setTypeId(cashRecord.getId());
  192. message.setMarket(Integer.valueOf(cashRecord.getMarket()));
  193. String marketName = marketMapper.getMarketNameById(String.valueOf(message.getMarket()));
  194. message.setMarketName(languageTranslationUtil.translate(marketName, lang));
  195. rabbitTemplate.convertAndSend(RabbitMQConfig.CASH_COLLECTION_EXCHANGE, "cash.collection.save", message);
  196. return "添加成功";
  197. }
  198. //撤回未审核的订单
  199. @Override
  200. public String cancel(String orderCode) {
  201. CashRecord cashRecord = cashCollectionMapper.selectByOrderCode(orderCode);
  202. if (cashRecord == null) {
  203. throw new IllegalArgumentException("订单不存在");
  204. }
  205. if (cashRecord.getStatus() != 0) {
  206. throw new IllegalArgumentException("订单状态不符合条件");
  207. }
  208. //修改订单状态
  209. int rows = cashCollectionMapper.updateStatus(orderCode, 5);
  210. return rows > 0 ? "撤回成功" : "撤回失败";
  211. }
  212. //编辑并重新提交收款订单
  213. @Override
  214. public String reSubmit(CashRecord cashRecord,@RequestHeader(defaultValue = "zh_CN") String lang) {
  215. if (cashRecord.getJwcode() == null) {
  216. throw new IllegalArgumentException("精网号不能为空");
  217. }
  218. if (cashRecord.getJwcode() < 10000000 || cashRecord.getJwcode() > 99999999) {
  219. throw new IllegalArgumentException("精网号必须为8位");
  220. }
  221. if (cashRecord.getName() == null) {
  222. throw new IllegalArgumentException("客户姓名不能为空");
  223. }
  224. if (cashRecord.getActivity() == null) {
  225. throw new IllegalArgumentException("活动不能为空");
  226. }
  227. if (cashRecord.getGoodsName() == null) {
  228. throw new IllegalArgumentException("商品名不能为空");
  229. }
  230. if (cashRecord.getGoodsName().equals("金币充值")) {
  231. if (cashRecord.getPermanentGold() == 0 && cashRecord.getFreeGold() == 0) {
  232. throw new IllegalArgumentException("金币数量不能为空");
  233. }
  234. }
  235. if (!cashRecord.getGoodsName().equals("金币充值")) {
  236. if (cashRecord.getGoodNum() == 0) {
  237. throw new IllegalArgumentException("产品数量不能为空");
  238. }
  239. if (cashRecord.getNumUnit() == null) {
  240. throw new IllegalArgumentException("数量单位不能为空");
  241. }
  242. }
  243. if (cashRecord.getPaymentCurrency() == null) {
  244. throw new IllegalArgumentException("支付币种不能为空");
  245. }
  246. if (cashRecord.getPaymentAmount() == null || cashRecord.getPaymentAmount().compareTo(BigDecimal.ZERO) == 0) {
  247. throw new IllegalArgumentException("支付金额不能为空");
  248. }
  249. if (cashRecord.getPayType() == null) {
  250. throw new IllegalArgumentException("支付方式不能为空");
  251. }
  252. if (cashRecord.getReceivedMarket() == null) {
  253. throw new IllegalArgumentException("到账地区不能为空");
  254. }
  255. if (cashRecord.getPayTime() == null) {
  256. throw new IllegalArgumentException("付款时间不能为空");
  257. }
  258. CashRecord status = cashCollectionMapper.selectByOrderCode(cashRecord.getOrderCode());
  259. if (!status.getStatus().equals(5)) {
  260. throw new IllegalArgumentException("只允许编辑已撤回订单");
  261. }
  262. //地区,根据jwcode插入(弃用,插入前调用接口获取地区和姓名,之后前端传入)
  263. //cashRecord.setMarket(cashCollectionMapper.getMarketByJwcode(cashRecord.getJwcode()));
  264. int rows = cashCollectionMapper.updateByOrderCode(cashRecord);
  265. if (rows > 0) {
  266. // 发送重新提交消息
  267. CashCollectionMessage message = new CashCollectionMessage();
  268. message.setId(cashRecord.getId());
  269. message.setOrderCode(cashRecord.getOrderCode());
  270. message.setStatus(0); // 重新提交后状态变为待审核
  271. message.setStatusDescription(languageTranslationUtil.translate("线下财务待审核", lang));
  272. message.setMessage(languageTranslationUtil.translate("收款订单已重新提交", lang));
  273. message.setSubmitterId(cashRecord.getSubmitterId());
  274. message.setTimestamp(LocalDateTime.now());
  275. rabbitTemplate.convertAndSend(
  276. RabbitMQConfig.CASH_COLLECTION_EXCHANGE,
  277. "collection.created",
  278. message
  279. );
  280. }
  281. return rows > 0 ? "重新提交成功" : "重新提交失败";
  282. }
  283. //多条件查询收款订单列表
  284. @Override
  285. public PageInfo<CashCollection> selectCollection(Integer pageNum, Integer pageSize, CashCollection cashCollection) {
  286. /* //将操作人的地区列表改为id
  287. List<String> markets = marketMapper.getMarketIds(cashCollection.getMarkets());
  288. if (markets.contains("9") || markets.contains("9999")) {
  289. markets = null;
  290. }*/
  291. // cashCollection.setReceivedMarket(marketMapper.getMarketId(cashCollection.getReceivedMarket()));
  292. if (cashCollection.getCashRoleId() == 2) {
  293. //角色是总部时,若不特地传状态,传1346,sql处理为(1,3,4,6)筛选,
  294. if (cashCollection.getStatus() == null) {
  295. cashCollection.setStatus(1346);
  296. }
  297. cashCollection.setSubmitterId(null);
  298. cashCollection.setReceivedMarket(null);
  299. cashCollection.setSubmitterMarket(null);
  300. }
  301. if (cashCollection.getCashRoleId() == 1) {
  302. //角色是地方财务,提交人置空不设筛选条件,仅按收款地区、提交人地区筛选()
  303. if (cashCollection.getStatus() == null) {
  304. cashCollection.setStatus(123460);
  305. }
  306. //状态为待审核和已驳回时按照提交人地区筛选
  307. if (cashCollection.getStatus() == 0 || cashCollection.getStatus() == 2) {
  308. cashCollection.setReceivedMarket(null);
  309. }
  310. //状态为已通过和Link通过时,满足收款地区或提交人地区即可
  311. /* if (cashCollection.getStatus() == 13) {
  312. cashCollection.setSubmitterId(null);
  313. }*/
  314. //状态为13 或46,已通过或已完成和已退款,满足收款地区或提交人地区即可,
  315. cashCollection.setSubmitterId(null);
  316. }
  317. if (cashCollection.getCashRoleId() == 0) {
  318. //角色是地方财务,提交人置空不设筛选条件---仅当角色是0 地方客服时,按提交人筛选
  319. if (cashCollection.getStatus() == null) {
  320. cashCollection.setStatus(1234560);
  321. }
  322. cashCollection.setSubmitterId(cashCollection.getSubmitterId());
  323. cashCollection.setReceivedMarket(null);
  324. }
  325. // cashCollection.setMarkets(markets);
  326. PageHelper.startPage(pageNum, pageSize); //必须要直接跟mapper
  327. List<CashCollection> cashCollections = cashCollectionMapper.selectCollection1(pageNum, pageSize, cashCollection);
  328. return new PageInfo<>(cashCollections);
  329. }
  330. //补全手续费等内容
  331. @Override
  332. public String complete(CashRecord cashRecord) {
  333. int rows = cashCollectionMapper.complete(cashRecord);
  334. return rows > 0 ? "编辑成功" : "编辑失败";
  335. }
  336. //根据精网号查询姓名和地区
  337. @Override
  338. public User getNameAndMarket(Integer jwcode) {
  339. try {
  340. HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
  341. String token = request.getHeader("token");
  342. Admin admin = (Admin) JWTUtil.getUserDetailsList(String.valueOf(token), Admin.class);
  343. if (admin != null) {
  344. List<String> list = Arrays.asList(admin.getMarkets().split(","));
  345. List<String> markets = marketMapper.getMarketIds(list);
  346. if (markets.contains("9") || markets.contains("9999")) {
  347. markets = null;
  348. }
  349. GoldUser gUser = userMapper.selectUserCard(jwcode.toString(), markets);
  350. if (gUser != null) {
  351. User user = new User();
  352. user.setMarket(cashCollectionMapper.getMarketByJwcode(jwcode));
  353. user.setName(cashCollectionMapper.getNameByJwcode(jwcode));
  354. user.setMarketName(cashCollectionMapper.getMarketNameByJwcode(jwcode));
  355. return user;
  356. }
  357. }
  358. } catch (Exception e) {
  359. e.printStackTrace();
  360. }
  361. // 如果没有返回有效用户信息,则抛出异常
  362. throw new RuntimeException("无法获取用户信息");
  363. }
  364. //获取收款活动列表
  365. @Override
  366. public List<RechargeActivity> getActivityList() {
  367. LocalDateTime now = LocalDateTime.now();
  368. return cashCollectionMapper.getActivityList(now);
  369. }
  370. //同步g_order订单到cash_record表
  371. @Override
  372. public Object syncToCashRecord() {
  373. int total = 0;
  374. while (true) {
  375. List<GOrder> gOrders = cashCollectionMapper.getUnSync(50);
  376. if (CollectionUtils.isEmpty(gOrders)) {
  377. break;
  378. }
  379. try {
  380. // 每批独立事务
  381. processBatch(gOrders);
  382. total += gOrders.size();
  383. log.info("✅ 同步完成一批,数量: {}, 累计: {}", gOrders.size(), total);
  384. } catch (Exception e) {
  385. List<Integer> failedIds = gOrders.stream().map(GOrder::getId).collect(Collectors.toList());
  386. log.error("失败订单ID: {}", failedIds);
  387. // 可存入 error_log 表,供人工处理
  388. // 这里选择继续下一批(容忍部分失败)
  389. }
  390. if (gOrders.size() < 50) {
  391. break; // 最后一批
  392. }
  393. }
  394. return "同步完毕,成功处理 " + total + " 条";
  395. }
  396. @Override
  397. @Transactional(rollbackFor = Exception.class)
  398. public void processBatch(List<GOrder> gOrders) {
  399. for (GOrder gOrder : gOrders) {
  400. CashRecord cashRecord = new CashRecord();
  401. //构建基础信息
  402. cashRecord.setOrderType(1);
  403. cashRecord.setJwcode(gOrder.getJwcode());
  404. String name=cashCollectionMapper.getNameByJwcode(gOrder.getJwcode());
  405. if (name!=null){
  406. cashRecord.setName(name);
  407. }else cashRecord.setName("未知");
  408. cashRecord.setMarket(cashCollectionMapper.getMarketByJwcode(gOrder.getJwcode()));
  409. if (gOrder.getType().equals("gold")){ //充金豆
  410. cashRecord.setActivity("Link日常充值");
  411. cashRecord.setGoodsName("Link充值金豆");
  412. cashRecord.setRemark("Link充值金豆");
  413. cashRecord.setNumUnit("个");
  414. cashRecord.setPermanentGold(0);
  415. cashRecord.setGoodNum(gOrder.getCount());
  416. }
  417. if (gOrder.getType().equals("gold_coin")){//充金币
  418. cashRecord.setActivity("Link日常充值");
  419. cashRecord.setGoodsName("Link充值金币");
  420. cashRecord.setRemark("Link充值金币");
  421. cashRecord.setPermanentGold(gOrder.getCount()*100);
  422. cashRecord.setGoodNum(0);
  423. }
  424. cashRecord.setOrderCode(gOrder.getOrderNo());
  425. if (gOrder != null) {
  426. switch (gOrder.getPayStyle()) {
  427. case 3:
  428. cashRecord.setPayType("IOS内购");
  429. cashRecord.setBankCode(gOrder.getIosTransactionId());
  430. cashRecord.setReceivedMarket("4");
  431. cashRecord.setPayload("IOS");
  432. break;
  433. case 5:
  434. cashRecord.setPayType("Stripe");
  435. cashRecord.setReceivedMarket("13");
  436. cashRecord.setPayload("Stripe");
  437. break;
  438. case 6:
  439. cashRecord.setPayType("PaymentAsia");
  440. cashRecord.setReceivedMarket("13");
  441. cashRecord.setPayload("PaymentAsia");
  442. break;
  443. case 7:
  444. cashRecord.setPayType("Ipay88");
  445. cashRecord.setReceivedMarket("5");
  446. cashRecord.setPayload("Ipay88");
  447. break;
  448. case 9:
  449. cashRecord.setPayType("FirstData");
  450. cashRecord.setReceivedMarket("4");
  451. cashRecord.setBankCode(gOrder.getFirstdataIpgTransactionId());
  452. cashRecord.setPayload("FirstData");
  453. break;
  454. default:
  455. break;
  456. }
  457. }
  458. cashRecord.setFreeGold(0);
  459. cashRecord.setPaymentCurrency("");
  460. cashRecord.setPaymentAmount(BigDecimal.valueOf(0));
  461. //转换时间戳,加上时区偏移
  462. cashRecord.setPayTime(LocalDateTime.ofEpochSecond(gOrder.getSuccessTime(), 0, ZoneOffset.of("+08:00")));
  463. cashRecord.setAuditTime(LocalDateTime.ofEpochSecond(gOrder.getSuccessTime(), 0, ZoneOffset.of("+08:00")));
  464. cashRecord.setStatus(3);
  465. cashRecord.setSubmitterId(99999);
  466. //存入现金库
  467. cashCollectionMapper.add(cashRecord);
  468. cashCollectionMapper.markSynced(gOrder.getId());
  469. }
  470. }
  471. @Override
  472. public CashCollection selectById(CashCollection cashCollection) {
  473. return cashCollectionMapper.selectById(cashCollection.getId());
  474. }
  475. //根据goldcoin订单号查询收款订单
  476. @Override
  477. public CashCollection selectByGoldCoinOrderCode(String orderNo) {
  478. return cashCollectionMapper.selectByGoldCoinOrderCode(orderNo);
  479. }
  480. //多条件查询收款订单列表
  481. @Override
  482. public PageInfo<PerformanceVO> performanceSelect(Integer pageNum, Integer pageSize, PerformanceDTO performanceDTO) {
  483. PageHelper.startPage(pageNum, pageSize); //必须要直接跟mapper
  484. List<PerformanceVO> performanceVOs = cashCollectionMapper.performanceSelect(performanceDTO);
  485. return new PageInfo<>(performanceVOs);
  486. }
  487. }