|
@@ -5,8 +5,12 @@ import com.oqpo.api.entity.inoutmng.DeliDtlMgntEntity;
|
5
|
5
|
import com.oqpo.api.entity.inoutmng.DeliInfoMgntEntity;
|
6
|
6
|
import com.oqpo.api.entity.inoutmng.ShmtOdrBaseEntity;
|
7
|
7
|
import com.oqpo.api.entity.inoutmng.ShmtOdrDtlEntity;
|
|
8
|
+import com.oqpo.api.entity.oper.FileEntity;
|
8
|
9
|
import com.oqpo.api.entity.pomng.PchOdrBaseInfoEntity;
|
9
|
10
|
import com.oqpo.api.entity.pomng.PchOdrDtlPtclEntity;
|
|
11
|
+import com.oqpo.api.entity.stinfo.BrandEntity;
|
|
12
|
+import com.oqpo.api.entity.stinfo.SpplyEntity;
|
|
13
|
+import com.oqpo.api.entity.stinfo.StoreBaseInfoEntity;
|
10
|
14
|
import com.oqpo.api.entity.stockmng.StckMgntBaseInfoEntity;
|
11
|
15
|
import com.oqpo.api.entity.stockmng.StckMgntDtlHistEntity;
|
12
|
16
|
import com.oqpo.api.enums.ChgDvsn;
|
|
@@ -14,17 +18,24 @@ import com.oqpo.api.enums.InOutCd;
|
14
|
18
|
import com.oqpo.api.enums.SystemMessageCode;
|
15
|
19
|
import com.oqpo.api.exception.GlobalException;
|
16
|
20
|
import com.oqpo.api.mapper.CommonMapper;
|
|
21
|
+import com.oqpo.api.mapper.FileMapper;
|
17
|
22
|
import com.oqpo.api.mapper.inoutmng.ShmtOdrMapper;
|
18
|
23
|
import com.oqpo.api.mapper.pomng.PchOrdMapper;
|
|
24
|
+import com.oqpo.api.mapper.stinfo.BrandMapper;
|
|
25
|
+import com.oqpo.api.mapper.stinfo.StoreBaseInfoMapper;
|
|
26
|
+import com.oqpo.api.mapper.stinfo.SupplyMapper;
|
19
|
27
|
import com.oqpo.api.mapper.stockmng.StockMngMapper;
|
20
|
28
|
import com.oqpo.api.service.CommonService;
|
21
|
29
|
import com.oqpo.api.service.pomng.PchOrdService;
|
22
|
30
|
import com.oqpo.api.web.dto.request.GridRequest;
|
23
|
31
|
import com.oqpo.api.web.dto.request.inoutmng.InstShmtOdrRequest;
|
24
|
32
|
import com.oqpo.api.web.dto.response.GridResponse;
|
|
33
|
+import com.oqpo.api.web.dto.response.inoutmng.InvInfoResponse;
|
25
|
34
|
import com.oqpo.api.web.dto.response.inoutmng.ShmtOdrSearchListResponse;
|
26
|
35
|
import com.oqpo.api.web.dto.response.inoutmng.ShmtOutSearchListResponse;
|
|
36
|
+import com.oqpo.api.web.dto.response.pomng.pchReq.PchReqInfoResponse;
|
27
|
37
|
import lombok.extern.slf4j.Slf4j;
|
|
38
|
+import org.apache.catalina.StoreManager;
|
28
|
39
|
import org.springframework.beans.factory.annotation.Autowired;
|
29
|
40
|
import org.springframework.stereotype.Service;
|
30
|
41
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -49,28 +60,16 @@ public class ShmtOdrService extends CommonService {
|
49
|
60
|
private PchOrdService pchOrdService;
|
50
|
61
|
|
51
|
62
|
@Autowired
|
52
|
|
- private CommonMapper commonMapper;
|
|
63
|
+ private BrandMapper brandMapper;
|
53
|
64
|
|
54
|
65
|
@Autowired
|
55
|
|
- private CommonService commonService;
|
56
|
|
-
|
57
|
|
- /*
|
58
|
|
- @Autowired
|
59
|
|
- private UserMngMapper userMngMapper;
|
60
|
|
-
|
61
|
|
- @Autowired
|
62
|
|
- private StockMngMapper stockMngMapper;
|
63
|
|
-
|
64
|
|
- @Autowired
|
65
|
|
- private PchReqMapper pchReqMapper;
|
|
66
|
+ private SupplyMapper supplyMapper;
|
66
|
67
|
|
67
|
68
|
@Autowired
|
68
|
69
|
private StoreBaseInfoMapper storeBaseInfoMapper;
|
69
|
70
|
|
70
|
71
|
@Autowired
|
71
|
|
- private LoanStateMapper loanStateMapper;
|
72
|
|
-
|
73
|
|
-*/
|
|
72
|
+ private FileMapper fileMapper;
|
74
|
73
|
/*
|
75
|
74
|
출하 대상 그리드 리스트 조회
|
76
|
75
|
*/
|
|
@@ -301,7 +300,7 @@ public class ShmtOdrService extends CommonService {
|
301
|
300
|
deliBaseEntity.setDlvSttmtUnqNo(dlvSttmtUnqNo);
|
302
|
301
|
deliBaseEntity.setSpplyId(null);
|
303
|
302
|
deliBaseEntity.setSpplyNm(null);
|
304
|
|
- //deliBaseEntity.setDlvRegDt();
|
|
303
|
+ deliBaseEntity.setStoreId(entity.getStoreId());
|
305
|
304
|
deliBaseEntity.setDlvAmt(shmtTotalAmt);
|
306
|
305
|
deliBaseEntity.setDlvMgrNm(instShmtOdrRequest.getDlvMgrNm());
|
307
|
306
|
deliBaseEntity.setDlvMgrTelNo(instShmtOdrRequest.getDlvMgrTelNo().replaceAll("-",""));
|
|
@@ -390,14 +389,14 @@ public class ShmtOdrService extends CommonService {
|
390
|
389
|
for ( int m = 0 ; m < stockList.size() ; m++) {
|
391
|
390
|
StckMgntBaseInfoEntity baseEntity = stockList.get(m);
|
392
|
391
|
StckMgntDtlHistEntity sourceHist = new StckMgntDtlHistEntity();
|
393
|
|
- String stckMgntDtlNo = fnGetDealNo(32,"");
|
|
392
|
+ //String stckMgntDtlNo = fnGetDealNo(32,"");
|
394
|
393
|
//String stckMgntDtlNo = commonMapper.selectDealNo(32, "");
|
395
|
394
|
|
396
|
395
|
|
397
|
396
|
//String stckMgntDtlNo1 = commonMapper.selectDealNo(33, "");
|
398
|
397
|
|
399
|
|
- sourceHist.setStckMgntDtlNo(stckMgntDtlNo); // 재고관리상세번호
|
400
|
|
- System.out.println("seqno =========>" +sourceHist.getStckMgntDtlNo() + "===" + stckMgntDtlNo );
|
|
398
|
+ sourceHist.setStckMgntDtlNo(fnGetDealNo(32,"")); // 재고관리상세번호
|
|
399
|
+ //System.out.println("seqno =========>" +sourceHist.getStckMgntDtlNo() + "===" + stckMgntDtlNo );
|
401
|
400
|
sourceHist.setBrandId(baseEntity.getBrandId());
|
402
|
401
|
sourceHist.setWhsId(baseEntity.getWhsId());
|
403
|
402
|
sourceHist.setLocation(baseEntity.getLocation());
|
|
@@ -475,8 +474,66 @@ public class ShmtOdrService extends CommonService {
|
475
|
474
|
.whsAmt(m.getWhsProcInfo() == null ? 0 : m.getWhsProcInfo().getWhsAmt() == null ? 0 : m.getWhsProcInfo().getWhsAmt())
|
476
|
475
|
.whsDt(m.getWhsProcInfo() == null ? "" : m.getWhsProcInfo().getWhsDt() == null ? "" : m.getWhsProcInfo().getWhsDt() )
|
477
|
476
|
.whsCnfmNm(m.getWhsProcInfo() == null ? "" : m.getWhsProcInfo().getWhsCnfmNm() == null ? "" : m.getWhsProcInfo().getWhsCnfmNm() )
|
|
477
|
+ .dlvSttmtUnqNo(m.getDlvSttmtUnqNo() == null ? "" : m.getDlvSttmtUnqNo())
|
478
|
478
|
.build())
|
479
|
479
|
.collect(Collectors.toList());
|
480
|
480
|
return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
|
481
|
481
|
}
|
|
482
|
+
|
|
483
|
+ /* 납품서 정보 */
|
|
484
|
+ public InvInfoResponse selectInvInfo(String brandId, String dlvSttmtUnqNo) throws Exception {
|
|
485
|
+
|
|
486
|
+ DeliInfoMgntEntity entity = shmtOdrMapper.selectInvInfo(brandId, dlvSttmtUnqNo);
|
|
487
|
+ List<DeliDtlMgntEntity> dtlEntity = shmtOdrMapper.selectInvDtlList(brandId, dlvSttmtUnqNo);
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+ // 공급사
|
|
491
|
+ // 배송처 정보
|
|
492
|
+ BrandEntity brandEntity = brandMapper.selectBrandInfo(brandId);
|
|
493
|
+
|
|
494
|
+ if ("DL01".equals(entity.getDeliDvsn())) {
|
|
495
|
+ //브랜드정보 배송
|
|
496
|
+ entity.setDlvBsnsRegno(brandEntity.getBsnsRegNo());
|
|
497
|
+ entity.setDlvNm(brandEntity.getBrandNm());
|
|
498
|
+ entity.setDlvOwnerNm(brandEntity.getOwnerNm());
|
|
499
|
+ entity.setDlvAddr(brandEntity.getAddr1() + " " + brandEntity.getAddr2());
|
|
500
|
+
|
|
501
|
+ } else {
|
|
502
|
+ //공급사 배송
|
|
503
|
+ SpplyEntity dlv_spplyEntity = supplyMapper.selectSpplyInfo(brandId, entity.getSpplyId());
|
|
504
|
+ entity.setDlvBsnsRegno(dlv_spplyEntity.getBsnsRegNo());
|
|
505
|
+ entity.setDlvNm(dlv_spplyEntity.getSpplyNm());
|
|
506
|
+ entity.setDlvOwnerNm(dlv_spplyEntity.getOwnerNm());
|
|
507
|
+ entity.setDlvAddr(dlv_spplyEntity.getAddr1() + " " + dlv_spplyEntity.getAddr2());
|
|
508
|
+ }
|
|
509
|
+
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+ //발주처 정보
|
|
514
|
+ if ("W01".equals(entity.getWhsDvsn())) {
|
|
515
|
+ //납품창고 본사
|
|
516
|
+ entity.setPoBsnsRegno(brandEntity.getBsnsRegNo());
|
|
517
|
+ entity.setPoNm(brandEntity.getBrandNm());
|
|
518
|
+ entity.setPoOwnerNm(brandEntity.getOwnerNm());
|
|
519
|
+ entity.setPoAddr(brandEntity.getAddr1() + " " + brandEntity.getAddr2());
|
|
520
|
+ } else {
|
|
521
|
+ //납품창고 매장
|
|
522
|
+ StoreBaseInfoEntity whs_storeBaseInfoEntity = storeBaseInfoMapper.selectStoreInfo(brandId, entity.getStoreId());
|
|
523
|
+ entity.setPoBsnsRegno(whs_storeBaseInfoEntity.getBsnsRegNo());
|
|
524
|
+ entity.setPoNm(whs_storeBaseInfoEntity.getStoreNm());
|
|
525
|
+ entity.setPoOwnerNm(whs_storeBaseInfoEntity.getOwnerNm());
|
|
526
|
+ entity.setPoAddr(whs_storeBaseInfoEntity.getAddr1() + " " + whs_storeBaseInfoEntity.getAddr2());
|
|
527
|
+ }
|
|
528
|
+
|
|
529
|
+ // 브랜드 로고 brand_logo_file_no
|
|
530
|
+ List<FileEntity> logFileList = null;
|
|
531
|
+ if (!"".equals(brandEntity.getBrandLogoFileNo())) {
|
|
532
|
+ logFileList = fileMapper.selectFileList(brandEntity.getBrandLogoFileNo()) ;
|
|
533
|
+ } else {
|
|
534
|
+ logFileList = new ArrayList<FileEntity>();
|
|
535
|
+ }
|
|
536
|
+
|
|
537
|
+ return InvInfoResponse.toDTO(entity,dtlEntity,logFileList);
|
|
538
|
+ }
|
482
|
539
|
}
|