Browse Source

공급사단가, 매장단가 테스트 후 정상 확인 반영

dwkim 2 years ago
parent
commit
c7810ababa

+ 1 - 0
src/main/java/com/oqpo/api/entity/stinfo/ItemUnitEntity.java

@@ -14,6 +14,7 @@ import java.util.List;
14 14
 public class ItemUnitEntity implements Serializable {
15 15
     private static final long serialVersionUID = -3590936033715917450L;
16 16
 
17
+
17 18
     private String brandUnitUnqNo ;
18 19
     private String brandId ;
19 20
     private String brandNm ;

+ 1 - 1
src/main/java/com/oqpo/api/entity/stinfo/StoreItemUnitEntity.java

@@ -31,7 +31,7 @@ public class StoreItemUnitEntity implements Serializable {
31 31
     private String shortContFileNo ;
32 32
     private String unitStCd ;
33 33
     private String unitStNm ;
34
-    private Integer stddQyt ;
34
+    private Integer stddQty ;
35 35
     private String brandUnitUnqNo ;
36 36
     private String sysRegDttm ;
37 37
     private String sysRegId ;

+ 2 - 2
src/main/java/com/oqpo/api/mapper/stinfo/ItemUnitMapper.java

@@ -10,8 +10,8 @@ import java.util.List;
10 10
 @Mapper
11 11
 public interface ItemUnitMapper {
12 12
 
13
-    List<ItemUnitEntity> selectItemUnitGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sUnitStCd") String sUnitStCd, @Param("sSpplyId") String sSpplyId, @Param("sClass1") String sClass1, @Param("sClass2") String sClass2, @Param("sClass3") String sClass3, @Param("sClass") String sClass4, @Param("sItemNm") String sItemNm , GridRequest gridRequest)throws Exception;
14
-    int selectItemUnitGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sUnitStCd") String sUnitStCd, @Param("sSpplyId") String sSpplyId, @Param("sClass1") String sClass1, @Param("sClass2") String sClass2, @Param("sClass3") String sClass3, @Param("sClass") String sClass4, @Param("sItemNm") String sItemNm)throws Exception;
13
+    List<ItemUnitEntity> selectItemUnitGridList(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sUnitStCd") String sUnitStCd, @Param("sSpplyId") String sSpplyId, @Param("sClass1") String sClass1, @Param("sClass2") String sClass2, @Param("sClass3") String sClass3, @Param("sClass4") String sClass4, @Param("sItemNm") String sItemNm , GridRequest gridRequest)throws Exception;
14
+    int selectItemUnitGridCnt(@Param("sBrandId") String sBrandId, @Param("fromDt") String fromDt, @Param("toDt") String toDt, @Param("sUnitStCd") String sUnitStCd, @Param("sSpplyId") String sSpplyId, @Param("sClass1") String sClass1, @Param("sClass2") String sClass2, @Param("sClass3") String sClass3, @Param("sClass4") String sClass4, @Param("sItemNm") String sItemNm)throws Exception;
15 15
 
16 16
     ItemUnitEntity selectItemUnitInfo(@Param("brandId") String brandId, @Param("brandUnitUnqNo") String brandUnitUnqNo)throws Exception;
17 17
     ItemUnitEntity selectItemUnitDupContInfoNo(@Param("brandId") String brandId, @Param("spplyId") String spplyId, @Param("itemId") String itemId, @Param("contSttDt") String contSttDt, @Param("contEndDt") String contEndDt)throws Exception;

+ 2 - 2
src/main/java/com/oqpo/api/mapper/stinfo/StoreItemUnitMapper.java

@@ -16,8 +16,8 @@ public interface StoreItemUnitMapper {
16 16
 
17 17
     List<StoreItemUnitEntity> selectStoreItemUnitInfo(@Param("brandId") String brandId, @Param("storeId") String storeId, @Param("contSttDt") String contSttDt, @Param("contEndDt") String contEndDt)throws Exception;
18 18
 
19
-    StoreItemUnitEntity selectStoreItemUnitContDateInfo(@Param("brandId") String brandId, @Param("storeId") String storeId, @Param("contSttDt") String contSttDt,  @Param("contEndDt") String contEndDt)throws Exception;
20
-    int updateStoreItemUnitContEnd(@Param("brandId") String brandId, @Param("storeId") String storeId, @Param("contEndDt") String contEndDt) throws Exception;
19
+    String selectStoreItemUnitContDateInfo(@Param("brandId") String brandId, @Param("storeId") String storeId, @Param("contSttDt") String contSttDt,  @Param("contEndDt") String contEndDt)throws Exception;
20
+    int updateStoreItemUnitContEnd(@Param("brandId") String brandId, @Param("storeId") String storeId, @Param("contEndDt") String contEndDt,  @Param("contSttDt") String contSttDt) throws Exception;
21 21
 
22 22
     int insertMergStoreItemUnitInfo(@Param("userId") String userId, @Param("brandId") String brandId, @Param("storeId") String storeId, @Param("contSttDt") String contSttDt, @Param("contEndDt") String contEndDt, List<StoreItemUnitEntity> gridUpdateData) throws Exception;
23 23
 

+ 1 - 0
src/main/java/com/oqpo/api/service/oper/AfflService.java

@@ -93,6 +93,7 @@ public class AfflService extends CommonService {
93 93
                         .stCd(m.getStCd())
94 94
                         .stNm(m.getStNm())
95 95
                         .ownerNm(m.getOwnerNm())
96
+                        .rprstTelNo(m.getRprstTelNo())
96 97
                         .joinDt(m.getJoinDt())
97 98
                         .build())
98 99
                 .collect(Collectors.toList());

+ 29 - 20
src/main/java/com/oqpo/api/service/stinfo/ItemUnitService.java

@@ -69,17 +69,18 @@ public class ItemUnitService extends CommonService {
69 69
                         .itemNm(m.getItemNm())
70 70
                         .spplyId(m.getSpplyId())
71 71
                         .spplyNm(m.getSpplyNm())
72
-                        .contSttDt(m.getContSttDt())
73
-                        .contEndDt(m.getContEndDt())
74
-                        .curr(m.getCurr())
75
-                        .currNm(m.getCurrNm())
76
-                        .unit(m.getUnit())
77
-                        .unitNm(m.getUnitNm())
78
-                        .unitAmt(m.getUnitAmt())
79
-                        .leadTime(m.getLeadTime())
80
-                        .spplyItemId(m.getSpplyItemId())
81
-                        .unitStCd(m.getUnitStCd())
82
-                        .stddQty(m.getStddQty())
72
+                        .contSttDt(m.getContSttDt() == null ? "" :m.getContSttDt())
73
+                        .contEndDt(m.getContEndDt() == null ? "" :m.getContEndDt())
74
+                        .curr(m.getCurr() == null ? "" :m.getCurr())
75
+                        .currNm(m.getCurrNm() == null ? "" :m.getCurrNm() )
76
+                        .unit(m.getUnit() == null ? "" :m.getUnit())
77
+                        .unitNm(m.getUnitNm() == null ? "" :m.getUnitNm())
78
+                        .unitAmt(m.getUnitAmt() == null ? 0 :m.getUnitAmt())
79
+                        .leadTime(m.getLeadTime() == null ? 0 :m.getLeadTime())
80
+                        .spplyItemId(m.getSpplyItemId() == null ? "" :m.getSpplyItemId())
81
+                        .unitStCd(m.getUnitStCd() == null ? "" :m.getUnitStCd())
82
+                        .unitStNm(m.getUnitStNm() == null ? "" :m.getUnitStNm())
83
+                        .stddQty(m.getStddQty() == null ? 0 :m.getStddQty() )
83 84
                         .build())
84 85
                 .collect(Collectors.toList());
85 86
         return GridResponse.toDTO(gridPage, gridTotal, gridRecords, gridRows);
@@ -195,20 +196,27 @@ public class ItemUnitService extends CommonService {
195 196
             StoreItemUnitEntity entity = new StoreItemUnitEntity();
196 197
             entity.setBrandId(saveStoreItemUnitInfolRequest.getBrandId());
197 198
             entity.setStoreId(saveStoreItemUnitInfolRequest.getStoreId());
198
-            entity.setContSttDt(saveStoreItemUnitInfolRequest.getContSttDt());
199
-            entity.setContEndDt(saveStoreItemUnitInfolRequest.getContEndDt());
199
+            entity.setContSttDt(saveStoreItemUnitInfolRequest.getContSttDt().replaceAll("\\.",""));
200
+            entity.setContEndDt(saveStoreItemUnitInfolRequest.getContEndDt().replaceAll("\\.",""));
200 201
 
201
-            StoreItemUnitEntity chkDataEnity =  storeItemUnitMapper.selectStoreItemUnitContDateInfo(entity.getBrandId(), entity.getStoreId(), entity.getContSttDt(), entity.getContEndDt());
202
+            String rcontEndDt =  storeItemUnitMapper.selectStoreItemUnitContDateInfo(entity.getBrandId(), entity.getStoreId(), entity.getContSttDt(), entity.getContEndDt());
203
+            if (!"".equals(rcontEndDt))
204
+            {
205
+                System.out.println("chkDataEnity===getContEndDt==>" + rcontEndDt);
206
+                storeItemUnitMapper.updateStoreItemUnitContEnd(entity.getBrandId(), entity.getStoreId(), rcontEndDt,  entity.getContSttDt());
202 207
 
203
-            if (chkDataEnity != null) {
204
-                if ("".equals(chkDataEnity.getContEndDt()))
205
-                {
206
-                    storeItemUnitMapper.updateStoreItemUnitContEnd(entity.getBrandId(), entity.getStoreId(), chkDataEnity.getContEndDt());
207
-                }
208 208
             }
209 209
 
210
+
210 211
             List<StoreItemUnitEntity> gridUpdateData = saveStoreItemUnitInfolRequest.toCodeEntities(saveStoreItemUnitInfolRequest.getGridUpdateData());
211 212
             if (gridUpdateData.size() > 0) {
213
+
214
+                if (!"".equals(rcontEndDt)) {
215
+                    for (int i = 0; i < gridUpdateData.size(); i++) {
216
+                        gridUpdateData.get(i).setStoreUnitUnqNo("");
217
+                    }
218
+                }
219
+
212 220
                 storeItemUnitMapper.insertMergStoreItemUnitInfo(userId, entity.getBrandId(), entity.getStoreId(), entity.getContSttDt(),entity.getContEndDt(), gridUpdateData) ;
213 221
             }
214 222
 
@@ -216,7 +224,8 @@ public class ItemUnitService extends CommonService {
216 224
             e.getStackTrace();
217 225
             throw new GlobalException(e.getSystemMessageCode());
218 226
         } catch (Exception e) {
219
-            e.getStackTrace();
227
+//            e.getStackTrace();
228
+            e.printStackTrace();
220 229
             throw new RuntimeException();
221 230
         }
222 231
     }

File diff suppressed because it is too large
+ 3 - 3
src/main/java/com/oqpo/api/web/controller/stinfo/ItemUnitController.java


+ 1 - 1
src/main/java/com/oqpo/api/web/dto/request/stinfo/itemUnit/SaveStoreItemUnitInfolRequest.java

@@ -49,7 +49,7 @@ public class SaveStoreItemUnitInfolRequest {
49 49
             entity.setShortContFileNo(x.getShortContFileNo());
50 50
             entity.setUnitTargetCd(x.getUnitTargetCd());
51 51
             entity.setItemId(x.getItemId());
52
-            entity.setStddQyt(x.getStddQty());
52
+            entity.setStddQty(x.getStddQty());
53 53
             entity.setBrandUnitUnqNo(x.getBrandUnitUnqNo());
54 54
             entities.add(entity);
55 55
         });

+ 3 - 0
src/main/java/com/oqpo/api/web/dto/response/stinfo/affl/AfflShopBaseInfoSearchResponse.java

@@ -36,6 +36,9 @@ public class AfflShopBaseInfoSearchResponse {
36 36
     @ApiModelProperty(value = "대표자명")
37 37
     private String ownerNm;
38 38
 
39
+    @ApiModelProperty(value = "대표전화번호")
40
+    private String rprstTelNo;
41
+
39 42
     @ApiModelProperty(value = "가입기간")
40 43
     private String joinDt;
41 44
 }

+ 1 - 0
src/main/java/com/oqpo/api/web/dto/response/stinfo/itemUnit/ItemUnitInfoResponse.java

@@ -111,6 +111,7 @@ public class ItemUnitInfoResponse {
111 111
         return ItemUnitInfoResponse.builder()
112 112
                 .brandUnitUnqNo(entity.getBrandUnitUnqNo())
113 113
                 .brandId(entity.getBrandId())
114
+                .brandNm(entity.getBrandNm())
114 115
                 .itemId(entity.getItemId())
115 116
                 .itemNm(entity.getItemNm())
116 117
                 .spplyId(entity.getSpplyId())

+ 1 - 1
src/main/java/com/oqpo/api/web/dto/response/stinfo/itemUnit/StoreItemUnitInfoResponse.java

@@ -35,7 +35,7 @@ public class StoreItemUnitInfoResponse {
35 35
                                 .contEndDt(m.getContEndDt() == null ? "" :m.getContEndDt())
36 36
                                 .unit(m.getUnit() == null ? "" :m.getUnit())
37 37
                                 .unitNm(m.getUnitNm() == null ? "" :m.getUnitNm())
38
-                                .stddQty(m.getStddQyt() == null ? 0 :m.getStddQyt() )
38
+                                .stddQty(m.getStddQty() == null ? 0 :m.getStddQty() )
39 39
                                 .curr(m.getCurr() == null ? "" :m.getCurr())
40 40
                                 .currNm(m.getCurrNm() == null ? "" :m.getCurrNm())
41 41
                                 .unitAmt(m.getUnitAmt() == null ? 0 :m.getUnitAmt())

+ 2 - 2
src/main/resources/mybatis/sqlmaps/oper/Affl.xml

@@ -69,7 +69,7 @@
69 69
     <select id="selectAfflShopGridList" resultType="com.oqpo.api.entity.oper.AfflEntity">
70 70
         select  /* selectAfflShopGridList */
71 71
         affl_shop_id, affl_shop_nm, corp_type, fn_code_nm('CORP_TYPE', corp_type) as corp_type_nm, st_cd, fn_code_nm('ST_CD', st_cd) as st_nm,  owner_nm
72
-        , concat(date_format(reg_dt,'%Y.%m.%d'), ' ~ ', date_format(reg_dt,'%Y.%m.%d')) as join_dt
72
+        , fn_get_telno(rprst_tel_no) as rprst_tel_no, concat(date_format(reg_dt,'%Y.%m.%d'), ' ~ ', date_format(reg_dt,'%Y.%m.%d')) as join_dt
73 73
         from affl_shop_base_info
74 74
         where 1=1
75 75
         and   st_cd = 'S000'
@@ -192,7 +192,7 @@
192 192
                affl_shop_id , affl_shop_nm, st_cd, fn_code_nm('ST_CD',st_cd) as st_nm
193 193
                , affl_abbr, fn_get_regno(1,bsns_reg_no) as bsns_reg_no, fn_get_regno(2,corp_reg_no) as corp_reg_no
194 194
                , auth_type, fn_code_nm('AUTH_TYPE',auth_type) as auth_type_nm, bsns_cndt, ctgr_bsns, owner_nm
195
-               , fn_get_telno(owner_tel_no) as owner_tel_no, fn_get_telno(rprst_fax_no) as rprst_fax_no, rprst_emai, zip_no, addr1, addr2, rprst_tel_no, lat_x, long_y
195
+               , fn_get_telno(owner_tel_no) as owner_tel_no, fn_get_telno(rprst_fax_no) as rprst_fax_no, rprst_emai, zip_no, addr1, addr2, fn_get_telno(rprst_tel_no) as rprst_tel_no, lat_x, long_y
196 196
                 , date_format(reg_dt,'%Y-%m-%d') as reg_dt, reg_id, date_format(join_stt_dt,'%Y-%m-%d') as join_stt_dt,  date_format(join_end_dt,'%Y-%m-%d') as join_end_dt
197 197
                , cmpny_logo_file_no, del_yn, corp_type,  fn_code_nm('CORP_TYPE',corp_type) as corp_type_nm, sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id
198 198
          from affl_shop_base_info

+ 16 - 16
src/main/resources/mybatis/sqlmaps/stinfo/ItemUnit.xml

@@ -7,13 +7,13 @@
7 7
         select  /*selectItemUnitGridList*/
8 8
                 iunit.brand_unit_unq_no, iunit.brand_id, iunit.item_id, iunit.item_nm, iunit.spply_id,
9 9
                 iunit.spply_nm, date_format(iunit.cont_stt_dt,'%Y.%m.%d') as cont_stt_dt, date_format(iunit.cont_end_dt,'%Y.%m.%d') as cont_end_dt,
10
-                iunit.curr, fn_code_nm('CURR', iunit.curr) as curr_nm, iunit.unit, fn_code_nm('DSTRBT_COST_UNIT', iunit.unit) as unit,
10
+                iunit.curr, fn_code_nm('CURR', iunit.curr) as curr_nm, iunit.unit, fn_code_nm('DSTRBT_COST_UNIT', iunit.unit) as unit_nm,
11 11
                 iunit.unit_amt, iunit.lead_time, iunit.spply_item_id,
12
-                iunit.unit_st_cd, fn_code_nm('UNIT_ST_CD', iunit.unit_st_cd) as unit_st_nm, iunit.stdd_qyt
12
+                iunit.unit_st_cd, fn_code_nm('UNIT_ST_CD', iunit.unit_st_cd) as unit_st_nm, iunit.stdd_qty
13 13
         from  brand_item_unit_info iunit
14 14
         join  item_base_info item on iunit.brand_id = item.brand_id and iunit.item_id = item.item_id
15 15
         left outer join item_class_ptcl iclas on item.item_id = iclas.item_id
16
-        join item_class_mgnt mclas on iclas.item_class_mgnt_no = mclas.item_class_mgnt_no
16
+        left outer join item_class_mgnt mclas on iclas.item_class_mgnt_no = mclas.item_class_mgnt_no
17 17
         where iunit.brand_id = #{sBrandId}
18 18
         <if test="fromDt != null and fromDt != '' and toDt != null and toDt != ''">
19 19
         and   iunit.cont_stt_dt <![CDATA[ >= ]]>  #{fromDt}
@@ -22,7 +22,7 @@
22 22
         <if test="sUnitStCd != null and sUnitStCd != ''">
23 23
         and   iunit.unit_st_cd = #{sUnitStCd}
24 24
         </if>
25
-        <if test="sBrandNm != null and sSpplyId != ''">
25
+        <if test="sSpplyId != null and sSpplyId != ''">
26 26
         and   iunit.spply_id = #{sSpplyId}
27 27
         </if>
28 28
         <if test="sClass1 != null and sClass1 != ''">
@@ -66,7 +66,7 @@
66 66
         from  brand_item_unit_info iunit
67 67
         join  item_base_info item on iunit.brand_id = item.brand_id and iunit.item_id = item.item_id
68 68
         left outer join item_class_ptcl iclas on item.item_id = iclas.item_id
69
-        join item_class_mgnt mclas on iclas.item_class_mgnt_no = mclas.item_class_mgnt_no
69
+        left outer join item_class_mgnt mclas on iclas.item_class_mgnt_no = mclas.item_class_mgnt_no
70 70
         where iunit.brand_id = #{sBrandId}
71 71
         <if test="fromDt != null and fromDt != '' and toDt != null and toDt != ''">
72 72
             and   iunit.cont_stt_dt <![CDATA[ >= ]]>  #{fromDt}
@@ -75,7 +75,7 @@
75 75
         <if test="sUnitStCd != null and sUnitStCd != ''">
76 76
             and   iunit.unit_st_cd = #{sUnitStCd}
77 77
         </if>
78
-        <if test="sBrandNm != null and sSpplyId != ''">
78
+        <if test="sSpplyId != null and sSpplyId != ''">
79 79
             and   iunit.spply_id = #{sSpplyId}
80 80
         </if>
81 81
         <if test="sClass1 != null and sClass1 != ''">
@@ -102,9 +102,9 @@
102 102
                 iunit.curr, fn_code_nm('CURR', iunit.curr) as curr_nm, iunit.unit, fn_code_nm('DSTRBT_COST_UNIT', iunit.unit) as unit,
103 103
                 iunit.unit_amt, iunit.lead_time, iunit.spply_item_id,
104 104
                 iunit.dlv_cndt, fn_code_nm('DLV_CNDT', iunit.dlv_cndt) as dlv_cndt_nm,
105
-                iunit.unit_st_cd, fn_code_nm('UNIT_ST_CD', iunit.unit_st_cd) as unit_st_nm, iunit.stdd_qyt,
106
-                iunit.store_sale_stdd_qty, iunit.store_sale_unit_amt, iunit.short_cont_file_no
107
-                date_format(iunit.sys_reg_dttm,'%Y.%m.%d %H:%i:%s') as sys_reg_dttm. iunit.sys_reg_id, date_format(iunit.sys_chg_dttm,'%Y.%m.%d %H:%i:%s') as  sys_chg_dttm, iunit.sys_chg_id
105
+                iunit.unit_st_cd, fn_code_nm('UNIT_ST_CD', iunit.unit_st_cd) as unit_st_nm, iunit.stdd_qty,
106
+                iunit.store_sale_stdd_qty, iunit.store_sale_unit_amt, iunit.short_cont_file_no,
107
+                date_format(iunit.sys_reg_dttm,'%Y.%m.%d %H:%i:%s') as sys_reg_dttm, iunit.sys_reg_id, date_format(iunit.sys_chg_dttm,'%Y.%m.%d %H:%i:%s') as  sys_chg_dttm, iunit.sys_chg_id
108 108
         from  brand_item_unit_info iunit
109 109
         where iunit.brand_unit_unq_no = #{brandUnitUnqNo}
110 110
         and   iunit.brand_id = #{brandId}
@@ -113,7 +113,7 @@
113 113
     <select id="selectItemUnitDupContInfoNo" resultType="com.oqpo.api.entity.stinfo.StoreItemUnitEntity">
114 114
         select /* selectItemUnitDupContInfoNo */
115 115
                brand_unit_unq_no
116
-        from   store_item_unit_info
116
+        from   brand_item_unit_info
117 117
         where  brand_id = #{brandId}
118 118
         and    spply_id = #{spplyId}
119 119
         and    item_id  = #{itemId}
@@ -122,7 +122,7 @@
122 122
 
123 123
     <update id="updateItemUnitContEnd" >
124 124
         update /* updateItemUnitContEnd */
125
-                store_item_unit_info
125
+                brand_item_unit_info
126 126
         set    cont_end_dt =  DATE_SUB(date_format(#{contEndDt},'%Y%m%d'), INTERVAL 1 DAY)
127 127
         where  brand_id = #{brandId}
128 128
         and    brand_unit_unq_no = #{brandUnitUnqNo}
@@ -136,18 +136,18 @@
136 136
         (brand_unit_unq_no, brand_id, item_id, item_nm, spply_id,
137 137
         spply_nm, cont_stt_dt, cont_end_dt, curr, unit,
138 138
         unit_amt, lead_time, dlv_cndt, short_cont_file_no, spply_item_id,
139
-        unit_st_cd, stdd_qyt, store_sale_stdd_qty, store_sale_unit_amt,
139
+        unit_st_cd, stdd_qty, store_sale_stdd_qty, store_sale_unit_amt,
140 140
         sys_reg_dttm, sys_reg_id, sys_chg_dttm, sys_chg_id)
141 141
         values
142 142
             ( fn_get_dealno(33,''), #{entity.brandId}, #{entity.itemId}, #{entity.itemNm}, #{entity.spplyId},
143 143
             #{entity.spplyNm}, #{entity.contSttDt}, #{entity.contEndDt}, #{entity.curr}, #{entity.unit},
144 144
             #{entity.unitAmt}, #{entity.leadTime}, #{entity.dlvCndt}, #{entity.shortContFileNo}, #{entity.spplyItemId},
145
-            #{entity.unitStCd}, #{entity.stddQyt}, #{entity.storeSaleStddQty}, #{entity.storeSaleUnitAmt},
145
+            #{entity.unitStCd}, #{entity.stddQty}, #{entity.storeSaleStddQty}, #{entity.storeSaleUnitAmt},
146 146
             now(), #{userId}, now(), #{userId})
147 147
         on duplicate key
148 148
         update
149
-            sys_chg_dttm    = now(),
150
-            ,sys_chg_id      = #{userId},
149
+            sys_chg_dttm    = now()
150
+            ,sys_chg_id      = #{userId}
151 151
             ,cont_stt_dt     = VALUES(cont_stt_dt)
152 152
             ,cont_end_dt     = VALUES(cont_end_dt)
153 153
             ,curr            = VALUES(curr)
@@ -157,7 +157,7 @@
157 157
             ,dlv_cndt        = VALUES(dlv_cndt)
158 158
             ,short_cont_file_no = VALUES(short_cont_file_no)
159 159
             ,unit_st_cd      = VALUES(unit_st_cd)
160
-            ,stdd_qyt        = VALUES(stdd_qyt)
160
+            ,stdd_qty        = VALUES(stdd_qty)
161 161
             ,store_sale_stdd_qty =VALUES(store_sale_stdd_qty)
162 162
             ,store_sale_unit_amt = VALUES(store_sale_unit_amt)
163 163
     </insert>

+ 7 - 6
src/main/resources/mybatis/sqlmaps/stinfo/StoreItemUnit.xml

@@ -1,11 +1,11 @@
1 1
 <?xml version="1.0" encoding="UTF-8"?>
2 2
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
3 3
 
4
-<mapper namespace="com.oqpo.api.mapper.stinfo.ItemUnitMapper">
4
+<mapper namespace="com.oqpo.api.mapper.stinfo.StoreItemUnitMapper">
5 5
 
6 6
     <select id="selectStoreItemUnitGridList" resultType="com.oqpo.api.entity.stinfo.StoreItemUnitEntity">
7 7
         select  /* selectStoreItemUnitGridList */
8
-                iunit.brand_id, fn_brand_nm(iunit.brand_id) as brand_nm, iunit.store_id, fn_store_nm(iunit.store_id) as store_nm,
8
+                iunit.brand_id, fn_brand_nm(iunit.brand_id) as brand_nm, iunit.store_id,  fn_store_nm(iunit.brand_id, iunit.store_id) as store_nm,
9 9
                 date_format(iunit.cont_stt_dt,'%Y.%m.%d') as cont_stt_dt, date_format(iunit.cont_end_dt,'%Y.%m.%d') as cont_end_dt,
10 10
                 date_format(iunit.sys_reg_dttm,'%Y.%m.%d') as sys_reg_dttm, iunit.item_cnt
11 11
         from (
@@ -65,15 +65,16 @@
65 65
                 case when unit.unit_amt is null or  unit.unit_amt = 0 then item.store_sale_unit_amt else unit.unit_amt end as unit_amt,
66 66
                 case when unit.unit_target_cd is null or unit.unit_target_cd = '' then 'Y' else unit.unit_target_cd end as unit_target_cd,
67 67
                 case when unit.unit_target_cd is null or unit.unit_target_cd = '' then fn_code_nm('DSTRBT_COST_UNIT','Y') else  fn_code_nm('DSTRBT_COST_UNIT',unit.unit_target_cd)  end as unit_target_nm,
68
-                nvl(unit.unit_amt,0) as spply_unit_amt
68
+                nvl(item.unit_amt,0) as spply_unit_amt
69 69
         from   brand_item_unit_info item
70 70
         left outer join store_item_unit_info unit on  item.brand_unit_unq_no = unit.brand_unit_unq_no and  item.brand_id = unit.brand_id and item.item_id = unit.item_id and unit.store_id = #{storeId}
71
+                          and unit.cont_stt_dt = #{contSttDt} and unit.cont_end_dt = #{contEndDt}
71 72
         where item.brand_id = #{brandId}
72 73
     </select>
73 74
 
74
-    <select id="selectStoreItemUnitContDateInfo" resultType="com.oqpo.api.entity.stinfo.StoreItemUnitEntity">
75
+    <select id="selectStoreItemUnitContDateInfo" resultType="String">
75 76
         select /* selectStoreItemUnitContDateInfo */
76
-                max(cont_end_dt) as cont_end_dt
77
+                nvl(max(cont_end_dt),'') as cont_end_dt
77 78
         from   store_item_unit_info
78 79
         where  brand_id = #{brandId}
79 80
         and    store_id = #{storeId}
@@ -83,7 +84,7 @@
83 84
     <update id="updateStoreItemUnitContEnd" >
84 85
         update /* updateStoreItemUnitContEnd */
85 86
                 store_item_unit_info
86
-        set    cont_end_dt =  DATE_SUB(date_format(#{contEndDt},'%Y%m%d'), INTERVAL 1 DAY)
87
+        set    cont_end_dt =  date_format(DATE_SUB(date_format(#{contSttDt},'%Y%m%d'), INTERVAL 1 DAY),'%Y%m%d')
87 88
         where  brand_id = #{brandId}
88 89
         and    store_id = #{storeId}
89 90
         and    cont_end_dt = #{contEndDt}