Browse Source

출하 납품서 출력 데이타

dwkim 2 years ago
parent
commit
0c21b10cf3

+ 1 - 0
src/main/java/com/oqpo/api/entity/inoutmng/DeliDtlMgntEntity.java

@@ -35,4 +35,5 @@ public class DeliDtlMgntEntity implements Serializable {
35 35
     private String sysChgDttm;
36 36
     private String sysChgId;
37 37
 
38
+
38 39
 }

+ 17 - 0
src/main/java/com/oqpo/api/entity/inoutmng/DeliInfoMgntEntity.java

@@ -36,10 +36,27 @@ public class DeliInfoMgntEntity implements Serializable {
36 36
     private String whsDvsnNm;
37 37
     private String brandId;
38 38
     private String brandNm;
39
+    private String storeId;
40
+    private String storeNm;
39 41
     private String sysRegDttm;
40 42
     private String sysRegId;
41 43
     private String sysChgDttm;
42 44
     private String sysChgId;
43 45
     private String dlvDesc;
46
+    private String mgrTelNo;
47
+    private String deliDvsn;
48
+    private String whsAddr;
49
+    private String whsMgrTelNo;
50
+
51
+    private String dlvBsnsRegno;
52
+    private String dlvNm;
53
+    private String dlvOwnerNm;
54
+    private String dlvAddr;
55
+
56
+    private String poBsnsRegno;
57
+    private String poNm;
58
+    private String poOwnerNm;
59
+    private String poAddr;
60
+
44 61
 
45 62
 }

+ 1 - 0
src/main/java/com/oqpo/api/entity/inoutmng/ShmtOdrBaseEntity.java

@@ -44,6 +44,7 @@ public class ShmtOdrBaseEntity implements Serializable {
44 44
     private String sysRegId;
45 45
     private String sysChgDttm;
46 46
     private String sysChgId;
47
+    private String dlvSttmtUnqNo;
47 48
 
48 49
     private ShmtOdrDtlEntity shmtOdrDtlInfo;
49 50
     private WhsProcInfoEntity whsProcInfo;

+ 2 - 20
src/main/java/com/oqpo/api/mapper/inoutmng/ShmtOdrMapper.java

@@ -28,26 +28,8 @@ public interface ShmtOdrMapper {
28 28
 
29 29
     List<ShmtOdrBaseEntity> selectShmtSearchGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sShmtWhsId") String sShmtWhsId, @Param("sShmtReqStCd") String sShmtReqStCd,  @Param("swhsId") String swhsId, @Param("sItemNm") String sItemNm, GridRequest gridRequest )throws Exception;
30 30
     int selectShmtSearchGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sShmtWhsId") String sShmtWhsId, @Param("sShmtReqStCd") String sShmtReqStCd,  @Param("swhsId") String swhsId, @Param("sItemNm") String sItemNm )throws Exception;
31
-    /*
32
-    List<PchOdrBaseInfoEntity> selectRecPchInitInfo(@Param("brandId") String brandId, List<PchOdrDtlPtclEntity> gridUpdateData)throws Exception;
33
-    List<PchOdrDtlPtclEntity> selectRecPchDtlInitInfo(@Param("brandId") String brandId, List<PchOdrDtlPtclEntity> gridUpdateData)throws Exception;
34
-    PchOdrBaseInfoEntity selectPoInitInfo(@Param("brandId") String brandId)throws Exception;
35
-    PchOdrDtlPtclEntity selectPoPchDtlSaveInfo(@Param("pchReqUnqNo") String pchReqUnqNo, @Param("pchReqDtlNo") String pchReqDtlNo)throws Exception;
36
-    PchOdrDtlPtclEntity selectPoItemDtlSaveInfo(@Param("brandId") String brandId, @Param("itemId") String itemId, @Param("brandUnitUnqNo") String brandUnitUnqNo)throws Exception;
37 31
 
38
-    int insertPchOdrBaseInfo(@Param("userId") String userId, PchOdrBaseInfoEntity entity)throws Exception;
39
-    int insertPchOdrDtlPtcl(@Param("userId") String userId, List<PchOdrDtlPtclEntity> gridInsertData)throws Exception;
32
+    DeliInfoMgntEntity selectInvInfo(@Param("brandId") String brandId, @Param("dlvSttmtUnqNo") String dlvSttmtUnqNo )throws Exception;
33
+    List<DeliDtlMgntEntity> selectInvDtlList(@Param("brandId") String brandId, @Param("dlvSttmtUnqNo") String dlvSttmtUnqNo)throws Exception;
40 34
 
41
-    List<PchOdrBaseInfoEntity>  selectPchOdrGridList(@Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sPchOdrStCd") String sPchOdrStCd, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm, GridRequest gridRequest);
42
-    int selectPchOdrGridCnt(@Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sPchOdrStCd") String sPchOdrStCd, @Param("sSpplyId") String sSpplyId, @Param("sWhsId") String sWhsId, @Param("sItemNm") String sItemNm);
43
-
44
-    PchOdrBaseInfoEntity selectPchOdrInfo(@Param("pchPodrUnqNo") String pchPodrUnqNo);
45
-    List<PchOdrDtlPtclEntity> selectOdrDtlList(@Param("pchPodrUnqNo") String pchPodrUnqNo);
46
-
47
-    List<PchOdrDtlPtclEntity> selectOdrDtlStatusList(@Param("pchPodrUnqNo") String pchPodrUnqNo);
48
-
49
-    int updateCancelPodrDtl(@Param("userId") String userId, List<PchOdrDtlPtclEntity> gridUpdateData) throws Exception;
50
-    int updateChgPodrStCd(@Param("userId") String userId, @Param("pchOdrStCd") String pchOdrStCd, @Param("pchPodrUnqNo") String pchPodrUnqNo) throws Exception;
51
-
52
-*/
53 35
 }

+ 1 - 1
src/main/java/com/oqpo/api/service/CommonService.java

@@ -18,7 +18,7 @@ public class CommonService {
18 18
         return commonMapper.selectKeyNo(numNo);
19 19
     }
20 20
 
21
-    @Transactional(propagation = Propagation.NOT_SUPPORTED)
21
+    @Transactional(propagation = Propagation.REQUIRES_NEW)
22 22
     public String fnGetDealNo(Integer numNo, String afflAbbr) {
23 23
         System.out.println("fnGetDealNo==numNo===============================" + Integer.toString(numNo));
24 24
             String searNo = commonMapper.selectDealNo(numNo, afflAbbr);

+ 76 - 19
src/main/java/com/oqpo/api/service/inoutmng/ShmtOdrService.java

@@ -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
 }

+ 20 - 0
src/main/java/com/oqpo/api/web/controller/inoutmng/ShmtOdrController.java

@@ -8,6 +8,8 @@ import com.oqpo.api.web.dto.request.inoutmng.ShmtOutSearchGridRequest;
8 8
 import com.oqpo.api.web.dto.request.pomng.pchOrd.SavePchOrdRequest;
9 9
 import com.oqpo.api.web.dto.response.GridResponse;
10 10
 import com.oqpo.api.web.dto.response.SaveResponse;
11
+import com.oqpo.api.web.dto.response.inoutmng.InvInfoResponse;
12
+import com.oqpo.api.web.dto.response.stinfo.brand.BrandInfoResponse;
11 13
 import io.swagger.annotations.Api;
12 14
 import io.swagger.annotations.ApiImplicitParam;
13 15
 import io.swagger.annotations.ApiImplicitParams;
@@ -82,4 +84,22 @@ public class ShmtOdrController {
82 84
         return ResponseEntity.ok(shmtOdrService.selectShmtSearchGridList(shmtOutSearchGridRequest.getSBrandId(), shmtOutSearchGridRequest.getFromDt(), shmtOutSearchGridRequest.getToDt(), shmtOutSearchGridRequest.getSShmtWhsId(), shmtOutSearchGridRequest.getSShmtReqStCd(),  shmtOutSearchGridRequest.getSWhsId(), shmtOutSearchGridRequest.getSItemNm(),  shmtOutSearchGridRequest.toDTO(shmtOutSearchGridRequest)));
83 85
     }
84 86
 
87
+
88
+    /**
89
+     * 설명 : 납품서정보 정보
90
+     *
91
+     * @param brandId, dlvSttmtUnqNo
92
+     * @return
93
+     * @throws Exception
94
+     */
95
+    @ApiImplicitParams({
96
+            @ApiImplicitParam(name = "X-AUTH-TOKEN", value = "CONN-KEY", required = true, dataType = "String", paramType = "header"),
97
+            @ApiImplicitParam(name = "brandId", value = "브랜드번호", required = true, dataType = "String", paramType = "query"),
98
+            @ApiImplicitParam(name = "dlvSttmtUnqNo", value = "납품서정보", required = true, dataType = "String", paramType = "query")
99
+    })
100
+    @ApiOperation(value = "납품서출력 정보")
101
+    @GetMapping("/info-inv")
102
+    public ResponseEntity<InvInfoResponse> infoInv(@RequestParam(value = "brandId") String brandId, @RequestParam(value = "dlvSttmtUnqNo") String dlvSttmtUnqNo) throws Exception {
103
+        return ResponseEntity.ok(shmtOdrService.selectInvInfo(brandId, dlvSttmtUnqNo));
104
+    }
85 105
 }

+ 118 - 0
src/main/java/com/oqpo/api/web/dto/response/inoutmng/InvInfoResponse.java

@@ -0,0 +1,118 @@
1
+package com.oqpo.api.web.dto.response.inoutmng;
2
+
3
+import com.fasterxml.jackson.annotation.JsonInclude;
4
+import com.oqpo.api.entity.inoutmng.DeliDtlMgntEntity;
5
+import com.oqpo.api.entity.inoutmng.DeliInfoMgntEntity;
6
+import com.oqpo.api.entity.loanmng.LoanMgntBaseInfoEntity;
7
+import com.oqpo.api.entity.oper.FileEntity;
8
+import com.oqpo.api.entity.oper.UserMngEntity;
9
+import com.oqpo.api.entity.pomng.PchReqBaseInfoEntity;
10
+import com.oqpo.api.entity.pomng.PchReqDtlPtclEntity;
11
+import com.oqpo.api.web.dto.response.stinfo.brand.BrandInfoResponse;
12
+import io.swagger.annotations.ApiModelProperty;
13
+import lombok.*;
14
+
15
+import java.util.List;
16
+import java.util.stream.Collectors;
17
+
18
+
19
+@Getter
20
+@Setter
21
+@Builder
22
+@AllArgsConstructor(access = AccessLevel.PROTECTED)
23
+@JsonInclude(JsonInclude.Include.ALWAYS)
24
+public class InvInfoResponse {
25
+
26
+    @ApiModelProperty(value = "발행일") private String dlvRegDt;
27
+    @ApiModelProperty(value = "납품서번호") private String dlvSttmtUnqNo;
28
+    @ApiModelProperty(value = "납품일") private String dvlSchDt;
29
+    @ApiModelProperty(value = "납품담당자") private String dlvMgrNm;  // dlv_mgr_tel_no
30
+    @ApiModelProperty(value = "납품장소") private String whsAddr;
31
+    @ApiModelProperty(value = "납품전화번호") private String whsMgrTelNo;
32
+    @ApiModelProperty(value = "공급-등록번호") private String dlvBsnsRegno;
33
+    @ApiModelProperty(value = "공급-상호") private String dlvNm;
34
+    @ApiModelProperty(value = "공급-성명") private String dlvOwnerNm;
35
+    @ApiModelProperty(value = "공급-주소") private String dlvAddr;
36
+    @ApiModelProperty(value = "발주-등록번호") private String poBsnsRegno;
37
+    @ApiModelProperty(value = "발주-상호") private String poNm;
38
+    @ApiModelProperty(value = "발주-성명") private String poOwnerNm;
39
+    @ApiModelProperty(value = "발주-주소") private String poAddr;
40
+
41
+
42
+    @ApiModelProperty(value = "납품 품목 정보")
43
+    private List<InvDtlInfo> invDtlInfoList;
44
+
45
+    @ApiModelProperty(value = "로그파일 정보")
46
+    private List<FileLogInfo> fileLogNoList;
47
+
48
+    public static InvInfoResponse toDTO(DeliInfoMgntEntity entity, List<DeliDtlMgntEntity>  dtlList, List<FileEntity>  logFileList) {
49
+        if (entity == null) return null;
50
+        return InvInfoResponse.builder()
51
+                .dlvRegDt(entity.getDlvRegDt() == null ? "" : entity.getDlvRegDt())
52
+                .dlvSttmtUnqNo(entity.getDlvSttmtUnqNo() == null ? "" : entity.getDlvSttmtUnqNo())
53
+                .dvlSchDt(entity.getDlvSchDt() == null ? "" :  entity.getDlvSchDt())
54
+                .dlvMgrNm(entity.getDlvMgrNm() == null ? "" : entity.getDlvMgrNm() + "( " + entity.getDlvMgrTelNo() + " )")
55
+                .whsAddr(entity.getWhsAddr() == null ? "" : entity.getWhsAddr())
56
+                .whsMgrTelNo(entity.getWhsMgrTelNo() == null ? "" : entity.getWhsMgrTelNo())
57
+                .dlvBsnsRegno(entity.getDlvBsnsRegno() == null ? "" : entity.getDlvBsnsRegno())
58
+                .dlvNm(entity.getDlvNm() == null ? "" : entity.getDlvNm())
59
+                .dlvOwnerNm(entity.getDlvOwnerNm() == null ? "" : entity.getDlvOwnerNm())
60
+                .dlvAddr(entity.getDlvAddr() == null ? "" : entity.getDlvAddr())
61
+                .poBsnsRegno(entity.getPoBsnsRegno() == null ? "" : entity.getPoBsnsRegno())
62
+                .poNm(entity.getPoNm() == null ? "" : entity.getPoNm())
63
+                .poOwnerNm(entity.getPoOwnerNm() == null ? "" : entity.getPoOwnerNm())
64
+                .poAddr(entity.getPoAddr() == null ? "" : entity.getPoAddr())
65
+                .fileLogNoList(logFileList.stream()
66
+                        .map(m -> InvInfoResponse.FileLogInfo.builder()
67
+                                .fileNo(m.getFileNo())
68
+                                .fileSeq(m.getFileSeq())
69
+                                .filePath(m.getFilePath())
70
+                                .fileNm(m.getFileNm())
71
+                                .fileOrgNm(m.getFileOrgNm())
72
+                                .build())
73
+                        .collect(Collectors.toList()))
74
+                .invDtlInfoList(dtlList.stream()
75
+                        .map(m -> InvInfoResponse.InvDtlInfo.builder()
76
+                                .pchPodrUnqNo(m.getPchPodrUnqNo() == null ? "" : m.getPchPodrUnqNo())
77
+                                .itemId(m.getItemId() == null ? "" :m.getItemId())
78
+                                .itemNm(m.getItemNm() == null ? "" :m.getItemNm())
79
+                                .podrQty(m.getPodrQty() == null ? 0 :m.getPodrQty())
80
+                                .dlvQty(m.getDlvQty() == null ? 0 :m.getDlvQty())
81
+                                .expryDate(m.getExpryDate() == null ? "" : m.getExpryDate())
82
+                                .build())
83
+                        .collect(Collectors.toList()))
84
+                .build();
85
+    }
86
+
87
+    @Getter
88
+    @Builder
89
+    @AllArgsConstructor(access = AccessLevel.PROTECTED)
90
+    static class InvDtlInfo {
91
+        @ApiModelProperty(value = "구매발주번호") private String pchPodrUnqNo;
92
+        @ApiModelProperty(value = "품목아이디") private String itemId;
93
+        @ApiModelProperty(value = "품목명") private String itemNm;
94
+        @ApiModelProperty(value = "발주수량") private Integer podrQty;
95
+        @ApiModelProperty(value = "납품수량") private Integer dlvQty;
96
+        @ApiModelProperty(value = "유통기간") private String expryDate;
97
+    }
98
+
99
+    @Getter
100
+    @Builder
101
+    @AllArgsConstructor(access = AccessLevel.PROTECTED)
102
+    static class FileLogInfo {
103
+        @ApiModelProperty(value = "파일번호")
104
+        private String fileNo;
105
+
106
+        @ApiModelProperty(value = "파일순번")
107
+        private Integer fileSeq;
108
+
109
+        @ApiModelProperty(value = "파일경로")
110
+        private String filePath;
111
+
112
+        @ApiModelProperty(value = "파일명")
113
+        private String fileNm;
114
+
115
+        @ApiModelProperty(value = "원파일명")
116
+        private String fileOrgNm;
117
+    }
118
+}

+ 2 - 0
src/main/java/com/oqpo/api/web/dto/response/inoutmng/ShmtOutSearchListResponse.java

@@ -33,6 +33,8 @@ public class ShmtOutSearchListResponse {
33 33
     @ApiModelProperty(value = "입고금액") private Integer whsAmt;
34 34
     @ApiModelProperty(value = "입고일자") private String whsDt;
35 35
     @ApiModelProperty(value = "입고담당자") private String whsCnfmNm;
36
+    @ApiModelProperty(value = "납품서번호") private String dlvSttmtUnqNo;
37
+
36 38
 
37 39
 
38 40
 

+ 29 - 3
src/main/resources/mybatis/sqlmaps/inoutmng/ShmtOdr.xml

@@ -136,13 +136,13 @@
136 136
         (dlv_sttmt_unq_no, spply_id, spply_nm, dlv_reg_dt, dlv_amt
137 137
         , dlv_mgr_nm, dlv_mgr_tel_no, dlv_mgr_emal, dlv_mgr_mbl_no, vndr_tel_no
138 138
         , dlv_st_cd, podr_reg_dt, dlv_req_dt, dlv_sch_dt, dlv_cmplt_dt
139
-        , whs_id, location, whs_dvsn, brand_id
139
+        , whs_id, location, whs_dvsn, brand_id,store_id
140 140
         , sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
141 141
         VALUES
142 142
         (#{entity.dlvSttmtUnqNo}, #{entity.spplyId}, #{entity.spplyNm}, date_format(now(),'%Y%m%d'), #{entity.dlvAmt}
143 143
         , #{entity.dlvMgrNm}, #{entity.dlvMgrTelNo}, #{entity.dlvMgrEmal}, #{entity.dlvMgrMblNo}, #{entity.vndrTelNo}
144 144
         , #{entity.dlvStCd}, #{entity.podrRegDt}, #{entity.dlvReqDt}, #{entity.dlvSchDt}, #{entity.dlvCmpltDt}
145
-        , #{entity.whsId}, #{entity.location}, #{entity.whsDvsn}, #{entity.brandId}
145
+        , #{entity.whsId}, #{entity.location}, #{entity.whsDvsn}, #{entity.brandId}, #{entity.storeId}
146 146
         , NOW(), #{userId}, NOW(), #{userId})
147 147
     </insert>
148 148
 
@@ -171,7 +171,8 @@
171 171
                ,ptcl.item_nm as 'shmtOdrDtlInfo.item_nm'  , base.whs_id, fn_whs_nm(base.brand_id, base.whs_id) as whs_nm
172 172
                ,base.location, fn_whs_location_nm(base.brand_id, base.whs_id, base.location) as location_nm  , ptcl.shmt_qty as 'shmtOdrDtlInfo.shmt_qty'
173 173
                ,ptcl.shmt_amt as 'shmtOdrDtlInfo.shmt_amt' , nvl(proc.whs_qty,0) as 'whsProcInfo.whs_qty' , nvl(proc.whs_amt,0) as 'whsProcInfo.whs_amt'
174
-                 ,date_format(proc.whs_dt,'%Y.%m.%d') as 'whsProcInfo.whs_dt', proc.whs_cnfm_nm as 'whsProcInfo.whs_cnfm_nm'
174
+               ,date_format(proc.whs_dt,'%Y.%m.%d') as 'whsProcInfo.whs_dt', proc.whs_cnfm_nm as 'whsProcInfo.whs_cnfm_nm'
175
+               ,deli.dlv_sttmt_unq_no
175 176
         from  shmt_odr_base_info base
176 177
          join shmt_odr_dtl_ptcl ptcl on base.shmt_req_unq_no = ptcl.shmt_req_unq_no
177 178
          join deli_dtl_ptcl deli on deli.pch_podr_unq_no = ptcl.pch_podr_unq_no and deli.pch_podr_dtl_no = ptcl.pch_podr_dtl_no
@@ -239,4 +240,29 @@
239 240
         </if>
240 241
     </select>
241 242
 
243
+    <select id="selectInvInfo" resultType="com.oqpo.api.entity.inoutmng.DeliInfoMgntEntity">
244
+        select  date_format(deli.dlv_reg_dt,'%Y.%m.%d') as dlv_reg_dt, deli.dlv_sttmt_unq_no, date_format(deli.dlv_sch_dt,'%Y.%m.%d') as dvl_sch_dt
245
+            , deli.dlv_mgr_nm,  fn_get_telno( deli.dlv_mgr_tel_no) as dlv_mgr_tel_no
246
+            , fn_whs_nm(deli.brand_id, deli.whs_id) as whs_nm,  fn_whs_location_nm(deli.brand_id, deli.whs_id, deli.location) as location_nm
247
+            , whs.mgr_tel_no
248
+            , case when  deli.spply_id is null or deli.spply_id = ''  then 'DL01' else 'DL02'  end as deli_dvsn  -- 배송주체
249
+            , deli.whs_dvsn -- 납품정보
250
+            , concat(whs.addr1 ,' ',whs.addr2) as whs_addr
251
+            , fn_get_telno(whs.mgr_tel_no) as whs_mgr_tel_no
252
+        from   deli_info_mgnt deli
253
+        join   whs_mgnt_base_info whs on whs.brand_id = deli.brand_id and whs.whs_id = deli.whs_id
254
+        where  deli.brand_id = #{brandId}
255
+        and    deli.dlv_sttmt_unq_no = #{dlvSttmtUnqNo}
256
+    </select>
257
+
258
+    <select id="selectInvDtlList" resultType="com.oqpo.api.entity.inoutmng.DeliDtlMgntEntity">
259
+        select ptcl.pch_podr_unq_no, ptcl.item_id, ptcl.item_nm, ptcl.podr_qty, ptcl.dlv_qty, date_format(ptcl.expry_date,'%Y.%m.%d') as expry_date
260
+        from deli_info_mgnt info
261
+            , deli_dtl_ptcl ptcl
262
+        where 1 = 1
263
+        and info.dlv_sttmt_unq_no = ptcl.dlv_sttmt_unq_no
264
+        and info.brand_id = #{brandId}
265
+        and info.dlv_sttmt_unq_no = #{dlvSttmtUnqNo}
266
+    </select>
267
+
242 268
 </mapper>

+ 1 - 1
src/main/resources/mybatis/sqlmaps/stockmng/StockMng.xml

@@ -315,7 +315,7 @@
315 315
              rtn_mgnt_unq_no, chg_dvsn, relation_no, sys_reg_dttm,
316 316
              sys_reg_id, sys_chg_dttm, sys_chg_id)
317 317
         VALUES
318
-        <foreach collection="gridInsertData" item="item" separator=";">
318
+        <foreach collection="gridInsertData" item="item" separator=",">
319 319
             (#{item.stckMgntDtlNo}, #{item.brandId}, #{item.whsId}, #{item.location}, #{item.itemId},
320 320
              #{item.itemNm}, #{item.inoutCd}, #{item.inoutQty}, #{item.whsMgntUnqNo}, #{item.rtnMgntUnqNo}, #{item.chgDvsn}, #{item.relationNo},
321 321
              NOW(), #{userId}, NOW(), #{userId})