YqPayController.java 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  1. package com.ym.mec.collectfee.controller;
  2. import com.alibaba.druid.sql.visitor.functions.Now;
  3. import com.alibaba.fastjson.JSON;
  4. import com.alibaba.fastjson.JSONObject;
  5. import com.ym.mec.collectfee.common.sms.SmsExample;
  6. import com.ym.mec.collectfee.common.web.BaseController;
  7. import com.ym.mec.collectfee.entity.*;
  8. import com.ym.mec.collectfee.service.*;
  9. import com.ym.mec.collectfee.utils.Constants;
  10. import com.ym.mec.collectfee.utils.GenerateNum;
  11. import com.ym.mec.collectfee.utils.ShortUrlUtil;
  12. import com.ym.mec.collectfee.utils.yqpay.*;
  13. import lombok.extern.slf4j.Slf4j;
  14. import org.apache.commons.io.IOUtils;
  15. import org.slf4j.Logger;
  16. import org.slf4j.LoggerFactory;
  17. import org.springframework.beans.factory.annotation.Autowired;
  18. import org.springframework.core.io.ClassPathResource;
  19. import org.springframework.http.HttpStatus;
  20. import org.springframework.scheduling.annotation.EnableScheduling;
  21. import org.springframework.scheduling.annotation.Scheduled;
  22. import org.springframework.transaction.annotation.Transactional;
  23. import org.springframework.validation.annotation.Validated;
  24. import org.springframework.web.bind.annotation.ModelAttribute;
  25. import org.springframework.web.bind.annotation.PostMapping;
  26. import org.springframework.web.bind.annotation.RequestMapping;
  27. import org.springframework.web.bind.annotation.RestController;
  28. import java.io.InputStreamReader;
  29. import java.lang.reflect.Array;
  30. import java.math.BigDecimal;
  31. import java.text.SimpleDateFormat;
  32. import java.time.LocalDateTime;
  33. import java.util.*;
  34. //@Api("支付")
  35. @Slf4j
  36. @RestController
  37. @RequestMapping("yqpay")
  38. @EnableScheduling // 2.开启定时任务
  39. public class YqPayController extends BaseController {
  40. protected final Logger logger = LoggerFactory.getLogger(this.getClass());
  41. @Autowired
  42. private YqPayService yqPayService;
  43. @Autowired
  44. private YqQueryService yqQueryService;
  45. @Autowired
  46. private OrderService orderService;
  47. @Autowired
  48. private AccountService accountService;
  49. @Autowired
  50. private CourseGroupInfoService CourseGroupInfoService;
  51. @Autowired
  52. private ApplyInfoService applyInfoService;
  53. @Autowired
  54. private RenewalsService renewalsService;
  55. @Autowired
  56. private SchoolService schoolService;
  57. /**
  58. * 统一下单(乐团缴费)
  59. *
  60. * @return String
  61. * @throws Exception
  62. */
  63. // @ApiOperation(value = "提交支付", notes = "易乾支付统一下单")
  64. @PostMapping("/toPay")
  65. @Transactional(rollbackFor = Exception.class)
  66. public Object toPay(@ModelAttribute @Validated Order order) throws Exception {
  67. logger.info(order.toString());
  68. BigDecimal amount = new BigDecimal("0");
  69. School school = schoolService.get(order.getClassId());
  70. //计划招生人数有更新,更新
  71. orderService.getSchoolDetail(school.getSchoolId());
  72. //判断用户是否已存在订单
  73. Order userOrder = orderService.findOrderByStatus(order.getUserId(), 1);
  74. if (userOrder != null) {
  75. return failed("您有待支付的订单,请完成支付");
  76. }
  77. //1、判断已报名人数
  78. CourseGroupInfo courseGroupInfo = CourseGroupInfoService.get(order.getCourseId());
  79. if (courseGroupInfo.getRegNum().compareTo(courseGroupInfo.getPlanNum()) >= 0) {
  80. Integer nums = orderService.getPayingOrderNums(order.getCourseId());
  81. if (nums != null && nums > 0) {
  82. return failed(HttpStatus.FORBIDDEN, "当前排队人数" + nums + "人,请您耐心等待");
  83. } else {
  84. return succeed("招生人数已满!");
  85. }
  86. }
  87. //课程组价格
  88. BigDecimal courseFee = courseGroupInfo.getFeeAmount();
  89. amount = amount.add(courseFee);
  90. //获取乐器的价格
  91. ClassPathResource classPathResource = new ClassPathResource("instruments.json"); //解析乐器数据
  92. BigDecimal instrumentPrice = new BigDecimal("0");//乐器价格
  93. String instrumentName = "";//乐器名称
  94. String instrumentId = order.getInstrument();
  95. String jsonString = IOUtils.toString(new InputStreamReader(classPathResource.getInputStream(), "UTF-8"));
  96. Instrument instrument = JSONObject.parseObject(jsonString, Instrument.class);
  97. if (order.getInstrument() != null && !order.getInstrument().isEmpty()) {
  98. instrumentPrice = new BigDecimal(instrument.getInstruments().get(instrumentId).get("referencePrice"));
  99. instrumentName = (String) instrument.getInstruments().get(instrumentId).get("index") + "-" +
  100. (String) instrument.getInstruments().get(instrumentId).get("name");
  101. }
  102. //2 版本为3.0( 26),不收乐器费用,收押金800放乐器费用
  103. if (courseGroupInfo.getFeeType().equals(26)) {
  104. instrumentPrice = new BigDecimal("800");
  105. }
  106. amount = amount.add(instrumentPrice);
  107. //辅件价格
  108. String adjunctIds = order.getAdjunct();
  109. BigDecimal adjunctPrice = new BigDecimal("0");//辅件价格
  110. String adjunctName = "";//辅件名称
  111. if (adjunctIds != null && !adjunctIds.isEmpty()) {
  112. String[] adjunctIdArr = adjunctIds.split(",");
  113. for (String adjunctId : adjunctIdArr) {
  114. adjunctPrice = adjunctPrice.add(new BigDecimal(instrument.getAuxiliaries().get(adjunctId).get("referencePrice")));
  115. adjunctName += (String) instrument.getAuxiliaries().get(adjunctId).get("name") + "|";
  116. }
  117. }
  118. amount = amount.add(adjunctPrice);
  119. ApplyInfo applyInfo = applyInfoService.get(order.getUserId());
  120. order.setPoName(school.getName());
  121. order.setVoicyPart(courseGroupInfo.getSubName());
  122. order.setGroupId(courseGroupInfo.getId());
  123. order.setAmount(amount);
  124. order.setRemark(instrumentName);
  125. order.setTuiFee(courseFee);
  126. order.setGoodsFee(instrumentPrice);
  127. order.setSdName(adjunctName + "教材|琴谱");
  128. order.setSdFee(adjunctPrice);
  129. order.setType(1);
  130. order.setUserName(applyInfo.getName());
  131. String orderNo = GenerateNum.getInstance().GenerateOrderNo(); //自己系统订单号
  132. order.setOrderNo(orderNo);
  133. order.setCreateTime(new Date()); //订单提交时间
  134. order.setStatus(1); //订单状态
  135. //获取分佣账户
  136. Integer branchId = 1001;//order.getBranchId();
  137. Account routingAccount = accountService.getRoutingAccount(branchId);
  138. order.setAccount(routingAccount.getSellerNo());
  139. order.setUAccount(routingAccount.getId().toString());
  140. //1、插入订单
  141. orderService.insert(order);
  142. //2、修改已报名人数
  143. courseGroupInfo.setRegNum(courseGroupInfo.getRegNum() + 1);
  144. CourseGroupInfoService.upByIdAndVersion(courseGroupInfo);
  145. //3、修改分佣账户已收金额
  146. BigDecimal HasRouting = routingAccount.getHasRouting().add(order.getAmount());
  147. routingAccount.setHasRouting(HasRouting);
  148. accountService.upByIdAndVersion(routingAccount);
  149. Map rqMap = orderService.getPayMap(routingAccount, order, school); //获取支付map
  150. return succeed(rqMap);
  151. }
  152. /**
  153. * 续费支付
  154. *
  155. * @return String
  156. * @throws Exception
  157. */
  158. // @ApiOperation(value = "续费支付", notes = "续费支付")
  159. @PostMapping("/renewalsPay")
  160. public Object renewalsPay(@ModelAttribute @Validated Renewals renewals) throws Exception {
  161. MecUser mecUser = applyInfoService.findMecUser(renewals.getUserId());
  162. if (mecUser == null) {
  163. return failed("续费用户不存在");
  164. }
  165. renewals.setBranchId(mecUser.getBranchId());
  166. //课程组价格
  167. List<MecCourse> courses = applyInfoService.queryUserCourse(renewals.getUserId());//获取续费课程
  168. if (courses == null) {
  169. return failed("您没有续费的课程");
  170. }
  171. MecCourse mecCourse4json = JSON.parseObject(renewals.getCourses(), MecCourse.class);
  172. if (mecCourse4json == null) {
  173. return failed("请选择续费课程");
  174. }
  175. //classType 小课1 大课2
  176. Integer buyCount = mecCourse4json.getBuyCount();
  177. if (buyCount <= 0 || buyCount > 20) {
  178. return failed("购买课程次数不能小于1,大于20");
  179. }
  180. BigDecimal amount = new BigDecimal("0"); //课程总价
  181. String remark = "";
  182. List<MecCourse> pickCourses = new ArrayList<>();
  183. for (int i = 0; i < courses.size(); i++) {
  184. MecCourse course = courses.get(i);
  185. if (mecCourse4json.getCourseId().equals(course.getCourseId().intValue())) {
  186. BigDecimal price = course.getClassType().equals(1) ? course.getPrice().multiply(BigDecimal.valueOf(buyCount)) : course.getPrice().multiply(BigDecimal.valueOf(course.getBuyCount()));
  187. amount = amount.add(price);
  188. remark += course.getClassName();
  189. if (course.getClassType().equals(1)) {
  190. course.setBuyCount(buyCount);
  191. }
  192. pickCourses.add(course);
  193. }
  194. }
  195. if (pickCourses.size() == 0) {
  196. return failed("请选择续费课程");
  197. }
  198. String orderNo = GenerateNum.getInstance().GenerateOrderNo(); //自己系统订单号
  199. //获取分佣账户
  200. Integer branchId = 1001;//order.getBranchId();
  201. Account routingAccount = accountService.getRoutingAccount(branchId);
  202. Order order = renewalsService.addRenewalsOrder(renewals, amount, orderNo, pickCourses, routingAccount, remark);
  203. Map rqMap = orderService.getPayMap(routingAccount, order, null); //获取支付map
  204. return succeed(rqMap);
  205. }
  206. /**
  207. * 交易查询
  208. *
  209. * @param merOrderNoList 用户订单号
  210. * @return
  211. * @throws Exception
  212. */
  213. //@PostMapping("/query")
  214. //@Scheduled(cron = "0/3 40 11 * * ?")
  215. public Object query(String merOrderNoList) throws Exception {
  216. String notifyUrl = ""; //回调地址
  217. Map<String, Object> resultMap = new LinkedHashMap<>();
  218. resultMap.put("merOrderNoList", merOrderNoList);
  219. Map<String, Object> requestMap = new YqPayUtil(notifyUrl, resultMap).getRequestMap();
  220. return yqQueryService.orderQuery(requestMap);
  221. }
  222. /**
  223. * 用户信息(商户)查询
  224. *
  225. * @param sonMerNo 子商户号
  226. * @return
  227. * @throws Exception
  228. */
  229. @PostMapping("/queryaccount")
  230. public String queryAccount(String sonMerNo) throws Exception {
  231. String notifyUrl = ""; //回调地址
  232. Map<String, Object> resultMap = new LinkedHashMap<>();
  233. resultMap.put("merOrderNoList", sonMerNo);
  234. Map<String, Object> requestMap = new YqPayUtil(notifyUrl, resultMap).getRequestMap();
  235. return yqQueryService.queryAccount(requestMap);
  236. }
  237. /**
  238. * 对账查询(定时任务每天对账)
  239. *
  240. * @return
  241. */
  242. public String queryBill() throws Exception {
  243. String notifyUrl = ""; //回调地址
  244. Map<String, Object> resultMap = new LinkedHashMap<>();
  245. resultMap.put("tradeDate", ""); //交易日期
  246. resultMap.put("payState", ""); //订单状态
  247. resultMap.put("tradeType", ""); //交易类型,不填为全部
  248. resultMap.put("channelType", ""); //通道类型,不填为全部
  249. Map<String, Object> requestMap = new YqPayUtil(notifyUrl, resultMap).getRequestMap();
  250. return yqQueryService.billQuery(requestMap);
  251. }
  252. /**
  253. * 平台转账
  254. *
  255. * @return
  256. * @throws Exception
  257. */
  258. @PostMapping("/platformtransferacc")
  259. public String platformTransferAcc() throws Exception {
  260. String notifyUrl = ""; //回调地址
  261. Map<String, Object> resultMap = new LinkedHashMap<>();
  262. resultMap.put("payeeNo", ""); //收款方商户号
  263. resultMap.put("payeeName", ""); //收款方姓名
  264. resultMap.put("amount", ""); //金额
  265. resultMap.put("merOrderNo", ""); //商户订单号
  266. resultMap.put("remarks", ""); //备注
  267. Map<String, Object> requestMap = new YqPayUtil(notifyUrl, resultMap).getRequestMap();
  268. return yqPayService.platformTransferAcc(requestMap);
  269. }
  270. /**
  271. * 提现短信
  272. *
  273. * @return
  274. * @throws Exception
  275. */
  276. @PostMapping("/sendsms")
  277. public Msg sendSms(@ModelAttribute Intfc intfc) throws Exception {
  278. String notifyUrl = ""; //回调地址
  279. String merMerOrderNo = GenerateNum.getInstance().GenerateOrderNo();
  280. Map<String, Object> resultMap = new LinkedHashMap<>();
  281. resultMap.put("wdMerNo", intfc.getWdMerNo()); //提现商户号
  282. resultMap.put("merMerOrderNo", merMerOrderNo); //商户订单号
  283. resultMap.put("amount", intfc.getAmount()); //提现金额
  284. resultMap.put("cardNo", intfc.getCardNo()); //提现银行卡号
  285. // resultMap.put("phone", intfc.getPhone()); //预留手机号(选填)
  286. // resultMap.put("cardType", intfc.getCardType()); //卡类型 0-个人银行卡,1-企业银行卡。(选填)
  287. Map<String, Object> requestMap = new YqPayUtil(notifyUrl, resultMap).getRequestMap();
  288. return yqPayService.intfc(requestMap);
  289. }
  290. /**
  291. * 提现
  292. *
  293. * @return
  294. * @throws Exception
  295. */
  296. @PostMapping("/intfc")
  297. public Msg intfc(@ModelAttribute Intfc intfc) throws Exception {
  298. String notifyUrl = "http://47.99.212.176:9000/yqpay/notify"; //回调地址
  299. String merMerOrderNo = GenerateNum.getInstance().GenerateOrderNo();
  300. Map<String, Object> resultMap = new LinkedHashMap<>();
  301. resultMap.put("wdMerNo", intfc.getWdMerNo()); //提现商户号
  302. resultMap.put("merMerOrderNo", merMerOrderNo); //商户订单号
  303. resultMap.put("amount", intfc.getAmount()); //提现金额
  304. resultMap.put("cardNo", intfc.getCardNo()); //提现银行卡号
  305. // resultMap.put("phone", intfc.getPhone()); //预留手机号(选填)
  306. // resultMap.put("cardType", intfc.getCardType()); //卡类型 0-个人银行卡,1-企业银行卡。(选填)
  307. resultMap.put("seqNo", ""); //流水号(选填)
  308. resultMap.put("smsCode", ""); //验证码(选填)
  309. Map<String, Object> requestMap = new YqPayUtil(notifyUrl, resultMap).getRequestMap();
  310. return yqPayService.intfc(requestMap);
  311. }
  312. /**
  313. * 易乾异步通知接口
  314. *
  315. * @param msg
  316. * @return String
  317. * @throws Exception
  318. */
  319. @PostMapping("/notify")
  320. public Msg notify(@ModelAttribute Msg msg) throws Exception {
  321. logger.info(msg.toString());
  322. Map<String, Object> rqMap = new LinkedHashMap<String, Object>();
  323. rqMap.put("code", msg.getCode());
  324. rqMap.put("msg", msg.getMsg());
  325. rqMap.put("responseType", msg.getResponseType());
  326. rqMap.put("responseParameters", msg.getResponseParameters());
  327. rqMap.put("sign", msg.getSign());
  328. boolean rs = YqPayUtil.verify(rqMap);
  329. msg.setMsg("fail");
  330. Map<String, String> notifyMap = new HashMap<>();
  331. if (rs) {
  332. notifyMap = JSON.parseObject(msg.getResponseParameters(), Map.class);
  333. }
  334. //支付中订单存在,更新状态
  335. if (msg.getResponseType().equals("1") && notifyMap.size() > 0) {
  336. String tradeState = msg.getCode().equals("88") ? "1" : "0";
  337. notifyMap.put("tradeState", tradeState);
  338. notifyMap.put("totalMoney", notifyMap.get("payAmount"));
  339. notifyMap.put("merOrderNo", notifyMap.get("merMerOrderNo"));
  340. this.updateOrder(notifyMap);
  341. msg.setCode("000000");
  342. msg.setMsg("success");
  343. }
  344. return msg;
  345. }
  346. @Scheduled(cron = "0/5 * * * * ?")
  347. //@RequestMapping("/getOrderStatus")
  348. public void getOrderStatus() throws Exception {
  349. List<Order> payingOrders = orderService.findPayingOrders();
  350. String merOrderNos = ""; //
  351. ArrayList<String> orderNoList = new ArrayList<String>();
  352. for (Order payingOrder : payingOrders) {
  353. String orderNo = payingOrder.getOrderNo();
  354. orderNoList.add(orderNo);
  355. merOrderNos += orderNo + ",";
  356. }
  357. if (merOrderNos.isEmpty()) {
  358. return;
  359. }
  360. merOrderNos = merOrderNos.substring(0, merOrderNos.length() - 1);
  361. String notifyUrl = ""; //回调地址
  362. Map<String, Object> resultMap = new LinkedHashMap<>();
  363. resultMap.put("merOrderNoList", merOrderNos);
  364. Map<String, Object> requestMap = new YqPayUtil(notifyUrl, resultMap).getRequestMap();
  365. Msg queryRs = yqQueryService.orderQuery(requestMap);
  366. logger.info("查询易乾结果" + queryRs.toString());
  367. if (queryRs.getCode().equals("88")) {
  368. //更新订单状态
  369. String[] statusArr = {"0", "1", "7"};
  370. String responseParameters = queryRs.getResponseParameters();
  371. List<Map<String, String>> responseList = JSON.parseObject(responseParameters, List.class);
  372. for (Map<String, String> response : responseList) {
  373. Map<String, String> rpMap = response;
  374. if (Arrays.asList(statusArr).contains(rpMap.get("tradeState"))) {
  375. this.updateOrder(rpMap);
  376. }
  377. if (orderNoList.contains(rpMap.get("merOrderNo"))) {
  378. orderNoList.remove(rpMap.get("merOrderNo"));
  379. }
  380. }
  381. this.failOrders(orderNoList);
  382. }
  383. }
  384. @Transactional(rollbackFor = Exception.class)
  385. public void updateOrder(Map<String, String> rpMap) throws Exception {
  386. int status = rpMap.get("tradeState").equals("1") ? 2 : 0;
  387. Order order = orderService.getOrderByOrderNo(rpMap.get("merOrderNo"));
  388. if (order == null) {
  389. return;
  390. }
  391. HashMap<String, Object> upMap = new HashMap<>();
  392. upMap.put("id", order.getId());
  393. upMap.put("oldStatus", 1);
  394. upMap.put("status", status);
  395. upMap.put("bank", rpMap.get("channelType"));
  396. if (order.getPayId() == null) {
  397. upMap.put("payId", rpMap.get("orderNo"));
  398. }
  399. ApplyInfo applyInfo = applyInfoService.get(order.getUserId());
  400. if (status == 2) {
  401. upMap.put("pay", rpMap.get("totalMoney"));
  402. upMap.put("payTime", new Date());
  403. if (order.getTuiFee() != null) { //乐团报名
  404. applyInfo.setStatus(1);
  405. applyInfoService.update(applyInfo);
  406. }
  407. }
  408. if (status == 0) {
  409. //失败减去已收款金额
  410. Account account = accountService.get(Integer.parseInt(order.getUAccount()));
  411. BigDecimal HasRouting = account.getHasRouting().subtract(order.getAmount());
  412. account.setHasRouting(HasRouting);
  413. accountService.upByIdAndVersion(account);
  414. //减去报名人数
  415. if (order.getTuiFee() != null) {
  416. CourseGroupInfo courseGroupInfo = CourseGroupInfoService.get(order.getGroupId());
  417. courseGroupInfo.setRegNum(courseGroupInfo.getRegNum() - 1);
  418. CourseGroupInfoService.upByIdAndVersion(courseGroupInfo);
  419. }
  420. }
  421. orderService.updateByIdAndStatus(upMap);
  422. //推送mec
  423. if (status == 2) {
  424. if (order.getTuiFee() != null) { //乐团报名
  425. applyInfoService.userRegister(applyInfo.getPatriarchPhone(), order.getId()); //推送mec
  426. schoolService.sendPayMsg(applyInfo.getPatriarchPhone(), order.getAmount().toString());
  427. } else {
  428. Renewals renewals = renewalsService.getRenewalsByOrderId(order.getId());
  429. RenewBean renewBean = new RenewBean();
  430. renewBean.setUserId(renewals.getUserId());
  431. renewBean.setClassId(renewals.getClassId());
  432. renewBean.setWay(renewals.getWay());
  433. renewBean.setPay(renewals.getPay());
  434. renewBean.setChargeMode(renewals.getChangeMode());
  435. renewBean.setBuy(new BigDecimal(renewals.getBuy()));
  436. renewBean.setPrice(renewals.getPrice());
  437. applyInfoService.pushRenew(renewBean);
  438. }
  439. }
  440. }
  441. @Transactional(rollbackFor = Exception.class)
  442. public void failOrders(ArrayList<String> orderNoList) throws Exception {
  443. if (orderNoList.size() == 0) {
  444. return;
  445. }
  446. Calendar beforeTime = Calendar.getInstance();
  447. beforeTime.add(Calendar.MINUTE, -5);// 5分钟之前的时间
  448. Date beforeDate = beforeTime.getTime();
  449. Map<String, Object> rqMap = new HashMap<>();
  450. rqMap.put("orderNoList", orderNoList);
  451. rqMap.put("beforeTime", beforeDate);
  452. List<Order> payingOrders = orderService.findPayingOrdersOver(rqMap);
  453. for (Order order : payingOrders) {
  454. HashMap<String, Object> upMap = new HashMap<>();
  455. upMap.put("id", order.getId());
  456. upMap.put("oldStatus", 1);
  457. upMap.put("status", 0);
  458. //失败减去已收款金额
  459. Account account = accountService.get(Integer.parseInt(order.getUAccount()));
  460. BigDecimal HasRouting = account.getHasRouting().subtract(order.getAmount());
  461. account.setHasRouting(HasRouting);
  462. accountService.upByIdAndVersion(account);
  463. //减去报名人数
  464. if (order.getTuiFee() != null) {
  465. CourseGroupInfo courseGroupInfo = CourseGroupInfoService.get(order.getGroupId());
  466. courseGroupInfo.setRegNum(courseGroupInfo.getRegNum() - 1);
  467. CourseGroupInfoService.upByIdAndVersion(courseGroupInfo);
  468. }
  469. orderService.updateByIdAndStatus(upMap);
  470. }
  471. }
  472. }