SttlReqService.java 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. package com.oqpo.api.service.sttlmng;
  2. import com.oqpo.api.entity.loanmng.LoanMgntBaseInfoEntity;
  3. import com.oqpo.api.entity.loanmng.LoanMgntDtlHstEntity;
  4. import com.oqpo.api.entity.oper.UserMngEntity;
  5. import com.oqpo.api.entity.rtnmng.RtnProcInfoPtclEntity;
  6. import com.oqpo.api.entity.settmng.StlMgntBaseInfoEntity;
  7. import com.oqpo.api.entity.settmng.StlMgntDtlPtclEntity;
  8. import com.oqpo.api.entity.stinfo.StoreBaseInfoEntity;
  9. import com.oqpo.api.entity.stockmng.WhsProcInfoPtclEntity;
  10. import com.oqpo.api.enums.*;
  11. import com.oqpo.api.mapper.loanmng.DsptMngMapper;
  12. import com.oqpo.api.mapper.oper.UserMngMapper;
  13. import com.oqpo.api.mapper.stinfo.StoreBaseInfoMapper;
  14. import com.oqpo.api.mapper.sttlmng.SttlReqMapper;
  15. import com.oqpo.api.service.CommonService;
  16. import com.oqpo.api.util.DateUtil;
  17. import com.oqpo.api.util.StringUtil;
  18. import com.oqpo.api.web.dto.request.GridRequest;
  19. import com.oqpo.api.web.dto.request.loanmng.ApproveDsptRequest;
  20. import com.oqpo.api.web.dto.request.sttlmng.SttlReqData;
  21. import com.oqpo.api.web.dto.request.sttlmng.SttlReqProcData;
  22. import com.oqpo.api.web.dto.request.sttlmng.SttlReqProcRequest;
  23. import com.oqpo.api.web.dto.request.sttlmng.SttlReqRequest;
  24. import com.oqpo.api.web.dto.response.GridResponse;
  25. import com.oqpo.api.web.dto.response.loanmng.StlDtlListResponse;
  26. import com.oqpo.api.web.dto.response.sttlmng.SttlMngInfoResponse;
  27. import com.oqpo.api.web.dto.response.sttlmng.SttlReqResponse;
  28. import lombok.extern.slf4j.Slf4j;
  29. import org.springframework.beans.factory.annotation.Autowired;
  30. import org.springframework.stereotype.Service;
  31. import org.springframework.transaction.annotation.Transactional;
  32. import java.util.List;
  33. import java.util.stream.Collectors;
  34. @Service
  35. @Slf4j
  36. public class SttlReqService extends CommonService {
  37. @Autowired
  38. private SttlReqMapper sttlReqMapper;
  39. @Autowired
  40. private UserMngMapper userMngMapper;
  41. @Autowired
  42. private StoreBaseInfoMapper storeBaseInfoMapper;
  43. @Autowired
  44. private DsptMngMapper dsptMngMapper;
  45. /*
  46. 정산요청 그리드 리스트 조회
  47. */
  48. public GridResponse selectSttlReqGridList(String sBrandId, String sStoreId, String sSpplyId, String sItemNm, String fromDt, String toDt, GridRequest gridRequest) throws Exception {
  49. int gridPage = gridRequest.getGridPage();
  50. int gridSize = gridRequest.getGridSize();
  51. fromDt = fromDt == null ? null : fromDt.replace(".", "");
  52. toDt = toDt == null ? null : toDt.replace(".", "");
  53. int gridRecords = sttlReqMapper.selectSttlReqGridCnt(sBrandId, sStoreId, sSpplyId, sItemNm, fromDt, toDt);
  54. int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
  55. List<StlMgntDtlPtclEntity> entities = sttlReqMapper.selectSttlReqGridList(sBrandId, sStoreId, sSpplyId, sItemNm, fromDt, toDt, gridRequest);
  56. List<Object> gridRows = entities.stream()
  57. .map(m -> StlDtlListResponse.builder()
  58. .viewCd("R")
  59. .sttlMgntUnqNo(m.getSttlMgntUnqNo()) /* 정산관리고유번호 */
  60. .sttlMgntDtlNo(m.getSttlMgntDtlNo()) /* 정산관리상세번호 */
  61. .brandId(m.getBrandId())
  62. .brandNm(m.getBrandNm())
  63. .storeId(m.getStoreId())
  64. .storeNm(m.getStoreNm())
  65. .spplyId(m.getSpplyId())
  66. .spplyNm(m.getSpplyNm())
  67. .loanDvsn(m.getLoanDvsn()) /* 여신구분 : 선불/후불/무정산 */
  68. .loanDvsnNm(m.getLoanDvsnNm())
  69. .sttlStCd(m.getSttlStCd()) /* 정산상태코드 */
  70. .sttlStNm(m.getSttlStNm()) /* 정산상태명 */
  71. .itemId(m.getItemId())
  72. .itemNm(m.getItemNm())
  73. .unit(m.getUnit())
  74. .unitAmt(m.getUnitAmt())
  75. .podrQty(m.getPodrQty()) /* 발주수량 */
  76. .dlvQty(m.getDlvQty()) /* 납품수량 */
  77. .whsColQty(m.getWhsColQty()) /* 입고/수거수량 */
  78. .whsColDt(m.getWhsColDt()) /* 입고/수거일자 */
  79. .whsColAmt(m.getWhsColAmt()) /* 입고/수거금액 */
  80. .sttlDvsn(m.getSttlDvsn()) /* 정산구분 : 수거/입고 */
  81. .sttlDvsnNm(m.getSttlDvsnNm()) /* 정산구분명 */
  82. .podrUnqNo(m.getPodrUnqNo()) /* 구매발주고유번호 */
  83. .podrDtlNo(m.getPodrDtlNo()) /* 구매발주상세번호 */
  84. .mgntUnqNo(m.getMgntUnqNo()) /* 입고/반품관리고유번호 */
  85. .build())
  86. .collect(Collectors.toList());
  87. return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
  88. }
  89. /* 정산요청 */
  90. @Transactional
  91. public SttlReqResponse requestSttl(String userId, SttlReqRequest sttlReqRequest) throws Exception {
  92. // 사용자 정보 조회
  93. UserMngEntity user = userMngMapper.selectUserInfo(userId);
  94. // 정산관리고유번호(STTL_MGNT_UNQ_NO) 채번
  95. String sttlMgntUnqNo = fnGetDealNo(37, "");
  96. List<SttlReqData> sttlReqDataList = sttlReqRequest.getSttlReqDataList();
  97. int idx = 1; // 정산관리상세번호
  98. long sttlReqAmt = 0; // 정산요청금액
  99. for (SttlReqData item : sttlReqDataList) {
  100. // 기존 정산 요청건인 경우 정산상태를 체크한다.
  101. if (!StringUtil.isEmpty(item.getSttlMgntUnqNo()) && !StringUtil.isEmpty(item.getSttlMgntDtlNo())) {
  102. StlMgntDtlPtclEntity dtlPtcl = sttlReqMapper.selectStlMgntDtlPtcl(item.getSttlMgntUnqNo(), item.getSttlMgntDtlNo());
  103. // 정산요청/정산확정된 경우 제외함
  104. if (SttlStCd.STTL_REQ.getCd().equals(dtlPtcl.getSttlStCd()) || SttlStCd.STTL_CONFIRM.getCd().equals(dtlPtcl.getSttlStCd())) {
  105. continue;
  106. }
  107. }
  108. // 입고/수거에 따라 데이터 조회
  109. if (SttlDvsn.WHS.getCd().equals(item.getSttlDvsn())) {
  110. WhsProcInfoPtclEntity procInfo = sttlReqMapper.selectWhsProcInfoPtcl(item.getMgntUnqNo());
  111. // 입고 데이터 업데이트
  112. procInfo.setSttlMgntUnqNo(sttlMgntUnqNo);
  113. procInfo.setSttlMgntDtlNo(idx + "");
  114. sttlReqMapper.updateWhsProcInfoPtcl4SttlReq(userId, procInfo);
  115. // 정산요청금액
  116. sttlReqAmt += procInfo.getWhsAmt(); // 입고금액
  117. // 정산관리상세내역 저장
  118. StlMgntDtlPtclEntity entity = new StlMgntDtlPtclEntity();
  119. entity.setSttlMgntUnqNo(sttlMgntUnqNo); // 정산관리고유번호
  120. entity.setSttlMgntDtlNo(idx + ""); // 정산관리상세번호
  121. entity.setBrandId(procInfo.getBrandId()); // 브랜드아이디
  122. entity.setWhsMgntUnqNo(procInfo.getWhsMgntUnqNo()); // 입고관리고유번호
  123. entity.setStoreId(procInfo.getStoreId()); // 매장아이디
  124. entity.setSpplyId(procInfo.getSpplyId()); // TODO 공급사아이디
  125. entity.setItemId(procInfo.getItemId()); // 품목아이디
  126. entity.setItemNm(procInfo.getItemNm()); // 품목명
  127. entity.setUnit(procInfo.getUnit()); // 단위
  128. entity.setUnitAmt(procInfo.getUnitAmt().longValue()); // 단가금액
  129. entity.setPodrQty(procInfo.getPodrQty()); // 발주수량
  130. entity.setDlvQty(procInfo.getDlvQty()); // 납품수량
  131. entity.setWhsQty(procInfo.getWhsQty()); // 입고수량
  132. entity.setDlvCmpltDt(procInfo.getDlvCmpltDt()); // 납품완료일자
  133. entity.setWhsAmt(procInfo.getWhsAmt().longValue()); // 입고금액
  134. entity.setSttlDvsn(SttlDvsn.WHS.getCd()); // 정산구분 - 입고
  135. entity.setPchPodrUnqNo(procInfo.getPchPodrUnqNo()); // 구매발주고유번호
  136. entity.setPchPodrDtlNo(procInfo.getPchPodrDtlNo()); // 구매발주상세번호
  137. entity.setPchReqUnqNo(procInfo.getPchReqUnqNo()); // 구매요청고유번호
  138. entity.setPchReqDtlNo(procInfo.getPchReqDtlNo()); // 구매요청상세번호
  139. sttlReqMapper.insertStlMgntDtlPtcl(userId, entity);
  140. } else if (SttlDvsn.RTN.getCd().equals(item.getSttlDvsn())) {
  141. RtnProcInfoPtclEntity procInfo = sttlReqMapper.selectRtnProcInfoPtcl(item.getMgntUnqNo());
  142. // 수거 데이터 업데이트
  143. procInfo.setSttlMgntUnqNo(sttlMgntUnqNo);
  144. procInfo.setSttlMgntDtlNo(idx + "");
  145. sttlReqMapper.updateRtnProcInfoPtcl4SttlReq(userId, procInfo);
  146. // 정산요청금액
  147. sttlReqAmt += procInfo.getColAmt(); // 수거금액
  148. // 정산관리상세내역 저장
  149. StlMgntDtlPtclEntity entity = new StlMgntDtlPtclEntity();
  150. entity.setSttlMgntUnqNo(sttlMgntUnqNo); // 정산관리고유번호
  151. entity.setSttlMgntDtlNo(idx + ""); // 정산관리상세번호
  152. entity.setBrandId(procInfo.getBrandId()); // 브랜드아이디
  153. entity.setRtnMgntUnqNo(procInfo.getRtnMgntUnqNo()); // 반품관리고유번호
  154. entity.setStoreId(procInfo.getStoreId()); // 매장아이디
  155. entity.setSpplyId(procInfo.getSpplyId()); // TODO 공급사아이디
  156. entity.setItemId(procInfo.getItemId()); // 품목아이디
  157. entity.setItemNm(procInfo.getItemNm()); // 품목명
  158. entity.setUnit(procInfo.getUnit()); // 단위
  159. entity.setUnitAmt(procInfo.getUnitAmt()); // 단가금액
  160. entity.setColQty(procInfo.getColQty()); // 수거수량
  161. entity.setColDt(procInfo.getColDt()); // 수거일자
  162. entity.setColAmt(procInfo.getColAmt()); // 수거금액
  163. entity.setSttlDvsn(SttlDvsn.RTN.getCd()); // 정산구분 - 수거
  164. entity.setRtnPodrUnqNo(procInfo.getRtnPodrUnqNo()); // 반품발주고유번호
  165. entity.setRtnPodrDtlNo(procInfo.getRtnPodrDtlNo()); // 반품발주상세번호
  166. entity.setRtnReqUnqNo(procInfo.getRtnReqUnqNo()); // 반품요청고유번호
  167. entity.setRtnReqDtlNo(procInfo.getRtnReqDtlNo()); // 반품요청상세번호
  168. sttlReqMapper.insertStlMgntDtlPtcl(userId, entity);
  169. }
  170. idx++;
  171. }
  172. // 정산관리기본정보 저장
  173. StlMgntBaseInfoEntity baseInfo = new StlMgntBaseInfoEntity();
  174. baseInfo.setSttlMgntUnqNo(sttlMgntUnqNo);
  175. baseInfo.setBrandId(sttlReqRequest.getBrandId());
  176. baseInfo.setStoreId(sttlReqRequest.getStoreId());
  177. baseInfo.setSpplyId(sttlReqRequest.getSpplyId()); // TODO 공급사아이디
  178. baseInfo.setSttlStCd(SttlStCd.TEMP_SAVE.getCd());
  179. baseInfo.setSttlReqAmt(sttlReqAmt);
  180. baseInfo.setSttlRegMgrId(userId);
  181. baseInfo.setSttlRegMgrNm(user.getUserNm());
  182. if (!StringUtil.isEmpty(sttlReqRequest.getStoreId())) {
  183. baseInfo.setSttlTargetCd(SttlTargetCd.STORE_STTL.getCd()); // 매장정산
  184. } else if (!StringUtil.isEmpty(sttlReqRequest.getSpplyId())) {
  185. baseInfo.setSttlTargetCd(SttlTargetCd.SUPPLY_STTL.getCd()); // 공급사정산
  186. }
  187. sttlReqMapper.insertStlMgntBaseInfo(userId, baseInfo);
  188. return SttlReqResponse.toDTO(baseInfo);
  189. }
  190. /* 정산요청 처리 */
  191. @Transactional
  192. public void procSttlRequest(String userId, SttlReqProcRequest sttlReqProcRequest) throws Exception {
  193. if (!StringUtil.isEmpty(sttlReqProcRequest.getStoreId())) { // 매장 정산
  194. procSttlRequest4Store(userId, sttlReqProcRequest);
  195. } else if (!StringUtil.isEmpty(sttlReqProcRequest.getSpplyId())) { // 공급사 정산
  196. // 공급사 정산은 후불로 조치한다.
  197. procSttlRequest4Spply(userId, sttlReqProcRequest);
  198. }
  199. }
  200. private void procSttlRequest4Spply(String userId, SttlReqProcRequest sttlReqProcRequest) throws Exception {
  201. StlMgntBaseInfoEntity baseInfo = new StlMgntBaseInfoEntity();
  202. baseInfo.setSttlMgntUnqNo(sttlReqProcRequest.getSttlMgntUnqNo());
  203. baseInfo.setSttlStCd(SttlStCd.STTL_REQ.getCd());
  204. baseInfo.setSttlReqDt(sttlReqProcRequest.getSttlReqDt().replace(".", ""));
  205. baseInfo.setSttlDt(null);
  206. baseInfo.setSttlAmt(null);
  207. sttlReqMapper.updateStlMgntBaseInfo4SttlReqProc(userId, baseInfo);
  208. }
  209. private void procSttlRequest4Store(String userId, SttlReqProcRequest sttlReqProcRequest) throws Exception {
  210. // 매장 정산타입 조회
  211. StoreBaseInfoEntity storeInfo = storeBaseInfoMapper.selectStoreInfo(sttlReqProcRequest.getBrandId(), sttlReqProcRequest.getStoreId());
  212. long sttlAmt = 0; // 정산금액
  213. // 정산타입에 따라
  214. if (LoanDvsn.PRE_PAYMENT.getCd().equals(storeInfo.getLoanDvsn())) {
  215. // 1. 선불
  216. // 정산관리상세내역 처리
  217. List<SttlReqProcData> list = sttlReqProcRequest.getSttlReqDataList();
  218. for (SttlReqProcData item : list) {
  219. // 정산관리상세내역 조회
  220. StlMgntDtlPtclEntity dtlPtcl = sttlReqMapper.selectStlMgntDtlPtcl(sttlReqProcRequest.getSttlMgntUnqNo(), item.getSttlMgntDtlNo());
  221. // 정산금액
  222. sttlAmt += dtlPtcl.getWhsColAmt();
  223. // 정산구분에 따라 처리 (STTL_DVSN)
  224. if (SttlDvsn.WHS.getCd().equals(dtlPtcl.getSttlDvsn())) { // 입고
  225. // 입고처리정보내역 업데이트
  226. sttlReqMapper.updateWhsProcInfoPtcl4SttlReqProc(userId, dtlPtcl);
  227. } else if (SttlDvsn.RTN.getCd().equals(dtlPtcl.getSttlDvsn())) { // 수거
  228. // 반품처리정보내역 업데이트
  229. sttlReqMapper.updateRtnProcInfoPtcl4SttlReqProc(userId, dtlPtcl);
  230. }
  231. }
  232. // 여신관리기본정보(매장) 차감 : loan_mgnt_base_info
  233. // 매장의 여신관리기본정보 조회 - 없으면 에러 처리
  234. LoanMgntBaseInfoEntity loanBase = dsptMngMapper.selectLoanMgntBaseInfo(sttlReqProcRequest.getBrandId(), sttlReqProcRequest.getStoreId());
  235. long trscBfBal = loanBase.getAcctBal();
  236. long trscAfBal = loanBase.getAcctBal() - sttlAmt; // 잔액에서 입고/수거금액 차감
  237. long useAmtTotal = loanBase.getUseAmtTotal() - sttlAmt; // 사용금액합계에서 입고/수거금액 차감
  238. loanBase.setAcctBal(trscAfBal);
  239. loanBase.setUseAmtTotal(useAmtTotal);
  240. sttlReqMapper.updateLoanMgntBaseInfo4SttlReqProc(userId, loanBase);
  241. // 여신관리상세이력 등록 (지급/대체/정산지급)
  242. // 여신관리상세이력 등록
  243. LoanMgntDtlHstEntity hstEntity = new LoanMgntDtlHstEntity();
  244. hstEntity.setLoanMgntUnqNo(storeInfo.getLoanMgntUnqNo());
  245. hstEntity.setLoanRegDt(DateUtil.getCurrentDate());
  246. hstEntity.setLoanRegTm(DateUtil.getCurrentTime());
  247. hstEntity.setDpstPayDvsn(DpstPayDvsn.PAYMENT.getCd());
  248. hstEntity.setMediaDvsn(MediaDvsn.SETTLMENT.getCd());
  249. hstEntity.setPayType(PayType.STTL_PAY.getCd());
  250. hstEntity.setTrscAmt(sttlAmt); // 거래금액
  251. hstEntity.setPaymAmt(sttlAmt); // 지급금액
  252. hstEntity.setTrscBfBal(trscBfBal);
  253. hstEntity.setTrscAfBal(trscAfBal);
  254. dsptMngMapper.insertLoanMgntDtlHst(userId, hstEntity);
  255. } else if (LoanDvsn.POST_PAYMENT.getCd().equals(storeInfo.getLoanDvsn())) {
  256. // 2. 후불
  257. // 정산상태코드만 변경하고 매장에서 정상확정시 여신처리를 한다.
  258. }
  259. // 정산관리기본정보 업데이트 (정산상태코드)
  260. // 정산타입에 따라
  261. if (LoanDvsn.PRE_PAYMENT.getCd().equals(storeInfo.getLoanDvsn())) {
  262. StlMgntBaseInfoEntity baseInfo = new StlMgntBaseInfoEntity();
  263. baseInfo.setSttlMgntUnqNo(sttlReqProcRequest.getSttlMgntUnqNo());
  264. baseInfo.setSttlStCd(SttlStCd.STTL_CONFIRM.getCd());
  265. baseInfo.setSttlReqDt(sttlReqProcRequest.getSttlReqDt().replace(".", ""));
  266. baseInfo.setSttlDt(DateUtil.getCurrentDate());
  267. baseInfo.setSttlAmt(sttlAmt);
  268. sttlReqMapper.updateStlMgntBaseInfo4SttlReqProc(userId, baseInfo);
  269. } else if (LoanDvsn.POST_PAYMENT.getCd().equals(storeInfo.getLoanDvsn())) {
  270. StlMgntBaseInfoEntity baseInfo = new StlMgntBaseInfoEntity();
  271. baseInfo.setSttlMgntUnqNo(sttlReqProcRequest.getSttlMgntUnqNo());
  272. baseInfo.setSttlStCd(SttlStCd.STTL_REQ.getCd());
  273. baseInfo.setSttlReqDt(sttlReqProcRequest.getSttlReqDt().replace(".", ""));
  274. baseInfo.setSttlDt(null);
  275. baseInfo.setSttlAmt(null);
  276. sttlReqMapper.updateStlMgntBaseInfo4SttlReqProc(userId, baseInfo);
  277. }
  278. }
  279. /* 정산요청 정보 조회 */
  280. public SttlMngInfoResponse selectSttlReqInfo(String sttlMgntUnqNo) throws Exception {
  281. StlMgntBaseInfoEntity entity = sttlReqMapper.selectStlMgntBaseInfo(sttlMgntUnqNo);
  282. return SttlMngInfoResponse.toDTO(entity);
  283. }
  284. /*
  285. 정산대상내역 그리드 리스트 조회
  286. */
  287. public GridResponse selectStlDtlGridList(String sttlMgntUnqNo, GridRequest gridRequest) throws Exception {
  288. int gridPage = gridRequest.getGridPage();
  289. int gridSize = gridRequest.getGridSize();
  290. List<StlMgntDtlPtclEntity> entities = sttlReqMapper.selectStlMgntDtlPtclList(sttlMgntUnqNo);
  291. int gridRecords = entities.size();
  292. int gridTotal = fnCalculateGridTotal(gridSize, gridRecords);
  293. List<Object> gridRows = entities.stream()
  294. .map(m -> StlDtlListResponse.builder()
  295. .viewCd("R")
  296. .sttlMgntUnqNo(m.getSttlMgntUnqNo())
  297. .sttlMgntDtlNo(m.getSttlMgntDtlNo())
  298. .brandId(m.getBrandId())
  299. .brandNm(m.getBrandNm())
  300. .whsMgntUnqNo(m.getWhsMgntUnqNo())
  301. .rtnMgntUnqNo(m.getRtnMgntUnqNo())
  302. .storeId(m.getStoreId())
  303. .storeNm(m.getStoreNm())
  304. .itemId(m.getItemId())
  305. .itemNm(m.getItemNm())
  306. .unit(m.getUnit())
  307. .unitAmt(m.getUnitAmt())
  308. .podrQty(m.getPodrQty())
  309. .dlvQty(m.getDlvQty())
  310. .whsQty(m.getWhsQty())
  311. .colQty(m.getColQty())
  312. .whsColQty(m.getWhsColQty()) /* 입고/수거수량 */
  313. .dlvCmpltDt(m.getDlvCmpltDt())
  314. .colDt(m.getColDt())
  315. .whsColDt(m.getWhsColDt()) /* 입고/수거일자 */
  316. .whsAmt(m.getWhsAmt())
  317. .colAmt(m.getColAmt())
  318. .whsColAmt(m.getWhsColAmt()) /* 입고/수거금액 */
  319. .sttlDvsn(m.getSttlDvsn())
  320. .sttlDvsnNm(m.getSttlDvsnNm())
  321. .podrUnqNo(m.getPodrUnqNo()) /* 발주번호 */
  322. .podrDtlNo(m.getPodrDtlNo()) /* 발주항번 */
  323. .pchReqUnqNo(m.getPchReqUnqNo())
  324. .pchReqDtlNo(m.getPchReqDtlNo())
  325. .rtnPodrUnqNo(m.getRtnPodrUnqNo())
  326. .rtnPodrDtlNo(m.getRtnPodrDtlNo())
  327. .rtnReqUnqNo(m.getRtnReqUnqNo())
  328. .rtnReqDtlNo(m.getRtnReqDtlNo())
  329. .sysRegDttm(m.getSysRegDttm())
  330. .sysRegId(m.getSysRegId())
  331. .sysChgDttm(m.getSysChgDttm())
  332. .sysChgId(m.getSysChgId())
  333. .build())
  334. .collect(Collectors.toList());
  335. return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
  336. }
  337. }