TsfOrderChangeService.java 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. package com.style24.front.biz.service;
  2. import java.text.DateFormat;
  3. import java.text.SimpleDateFormat;
  4. import java.util.ArrayList;
  5. import java.util.Calendar;
  6. import java.util.Collection;
  7. import java.util.Date;
  8. import java.util.List;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.stereotype.Service;
  11. import com.gagaframework.web.parameter.GagaMap;
  12. import com.style24.core.support.env.TscConstants;
  13. import com.style24.front.biz.dao.TsfOrderChangeDao;
  14. import com.style24.front.biz.dao.TsfOrderDao;
  15. import com.style24.persistence.domain.GiftCard;
  16. import com.style24.persistence.domain.Order;
  17. import com.style24.persistence.domain.Point;
  18. import lombok.extern.slf4j.Slf4j;
  19. /**
  20. * 주문 변경 Service
  21. *
  22. * @author card007
  23. * @since 2021. 02. 26
  24. */
  25. @Service
  26. @Slf4j
  27. public class TsfOrderChangeService {
  28. @Autowired
  29. private TsfOrderChangeDao orderChangeDao;
  30. /**
  31. * 마이페이지 취소/반품 목록 조회
  32. *
  33. * @param Order
  34. * @return Collection<Order>
  35. * @author card007
  36. * @since 2021. 02. 26
  37. */
  38. public GagaMap getCancelListForMypage(Order order) {
  39. GagaMap map = new GagaMap();
  40. Boolean shotDelv = false;
  41. Boolean selfMall = false;
  42. Boolean supplyMall = false;
  43. Collection<Order> result = orderChangeDao.getCancelListForMypage(order);
  44. for (Order tmpOrder : result) {
  45. // 총알배송 아이콘 설정
  46. if (!shotDelv && "Y".equals(tmpOrder.getShotDelvYn())) {
  47. shotDelv = true;
  48. }
  49. // STYLE24 일반배송 아이콘 설정
  50. if (!selfMall && "Y".equals(tmpOrder.getSelfGoodsYn())) {
  51. selfMall = true;
  52. }
  53. // 업체직배송 아이콘 설정
  54. if (!supplyMall && "N".equals(tmpOrder.getSelfGoodsYn())) {
  55. supplyMall = true;
  56. }
  57. }
  58. map.set("shotDelv", shotDelv);
  59. map.set("selfMall", selfMall);
  60. map.set("supplyMall", supplyMall);
  61. map.set("oneData", result.iterator().next());
  62. map.set("returnList", result);
  63. return map;
  64. }
  65. /**
  66. * 사용 상품권 정보 조회
  67. *
  68. * @param Order
  69. * @return Collection<GiftCard>
  70. * @author card007
  71. * @since 2021. 03. 02
  72. */
  73. public Collection<GiftCard> getUsedGiftcardInfo(Order order) {
  74. return orderChangeDao.getUsedGiftcardInfo(order);
  75. }
  76. /**
  77. * 사용 포인트 정보 조회
  78. *
  79. * @param Order
  80. * @return Collection<Point>
  81. * @author card007
  82. * @since 2021. 03. 02
  83. */
  84. public Collection<Point> getUsedPointInfo(Order order) {
  85. return orderChangeDao.getUsedPointInfo(order);
  86. }
  87. }