TsaPosService.java 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. package com.style24.admin.biz.service;
  2. import java.util.Collection;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.stereotype.Service;
  5. import lombok.extern.slf4j.Slf4j;
  6. import com.gagaframework.excel.GagaExcelUtil;
  7. import com.gagaframework.excel.env.GagaExcelConstants;
  8. import com.gagaframework.web.parameter.GagaMap;
  9. import com.style24.admin.biz.dao.TsaPosDao;
  10. import com.style24.persistence.domain.Pos;
  11. /**
  12. * 매장POS Service
  13. *
  14. * @author moon
  15. * @since 2020. 11. 13
  16. */
  17. @Service
  18. @Slf4j
  19. public class TsaPosService {
  20. @Autowired
  21. private TsaPosDao posDao;
  22. /**
  23. * 매장로그인 정보 조회
  24. *
  25. * @param pos - 매장정보
  26. * @return Pos
  27. * @author moon
  28. * @since 2020. 11. 13
  29. */
  30. public Pos getStoreLoginInfo(Pos pos) {
  31. return posDao.getStoreLoginInfo(pos);
  32. }
  33. /**
  34. * 출고대기/출고목록
  35. *
  36. * @param pos - 매장정보
  37. * @return Collection<Pos>
  38. * @author moon
  39. * @since 2020. 11. 13
  40. */
  41. public Collection<Pos> getPosDeliveryList(Pos pos) {
  42. return posDao.getPosDeliveryList(pos);
  43. }
  44. /**
  45. * 정산내역
  46. *
  47. * @param pos - 매장정보
  48. * @return Collection<Pos>
  49. * @author moon
  50. * @since 2020. 11. 13
  51. */
  52. public Collection<Pos> getPosUsacList(Pos pos) {
  53. return posDao.getPosUsacList(pos);
  54. }
  55. /**
  56. * CNPlus 엑셀다운로드
  57. *
  58. * @param pos - 매장정보
  59. * @return Pos
  60. * @author moon
  61. * @since 2020. 11. 13
  62. */
  63. public void getOrderExcelList(Pos pos, String excelFilenameWithPath) {
  64. // 헤더 title 설정
  65. String[] listTitles = {"예약구분", "집하예정일", "받는분성명" //3
  66. , "받는분전화번호", "받는분기타연락처", "받는분우편번호" //3
  67. , "받는분주소(전체, 분할)", "운송장번호", "고객주문번호" //3
  68. , "품목명", "박스수량", "박스타입", "기본운임" //4
  69. , "배송메세지1", "배송메세지2", "품목명"}; //3
  70. // DB 처리 시 사용되는 파라미터명(셀명) 설정
  71. String[] cellNames = {"RSRVT_GB", "SCHDL_CLDT", "RECIP_NM" //3
  72. , "RECIP_PHNNO", "RECIP_TELNO", "RECIP_POST_NO" //3
  73. , "RECIP_ADDR", "INVOICE_NO", "ORD_NO" //3
  74. , "GOODS_NM", "BOX_QTY", "BOX_TYPE", "FEE" //4
  75. , "DELV_MEMO", "DELV_MEMO2", "GOODS_CD"}; //3
  76. String[] cellTypes = {GagaExcelConstants.CellType.CHAR_LEFT.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
  77. GagaExcelConstants.CellType.CHAR_LEFT.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
  78. GagaExcelConstants.CellType.CHAR_LEFT.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
  79. GagaExcelConstants.CellType.CHAR_LEFT.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
  80. GagaExcelConstants.CellType.CHAR_LEFT.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
  81. GagaExcelConstants.CellType.CHAR_LEFT.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
  82. GagaExcelConstants.CellType.CHAR_LEFT.name(), GagaExcelConstants.CellType.CHAR_LEFT.name(),
  83. GagaExcelConstants.CellType.CHAR_LEFT.name(), GagaExcelConstants.CellType.CHAR_LEFT.name()
  84. };
  85. Collection<GagaMap> dataList = posDao.getOrderExcelList(pos); // map형식으로 조회
  86. try {
  87. GagaExcelUtil.createExcel(excelFilenameWithPath, dataList, cellNames, cellTypes);
  88. } catch (Exception e) {
  89. throw new IllegalStateException(e);
  90. }
  91. }
  92. public GagaMap getChkShopRt(Pos tsaPos) {
  93. GagaMap result = new GagaMap();
  94. int cnt = posDao.getShopRtCheck(tsaPos);
  95. if(cnt > 0) {
  96. result.set("chk", "Y");
  97. } else {
  98. result.set("chk", "N");
  99. }
  100. return result;
  101. }
  102. }