Browse Source

Merge branch 'master' of http://211.38.140.247:3000/sgc/sgc-portal

SH 9 months ago
parent
commit
123ea41e90

+ 5 - 0
src/main/java/sgc/portal/ei/ei0102/persistence/EI01020001UMapper.java

@@ -22,6 +22,9 @@ public interface EI01020001UMapper {
     
     
     List<EasyHashMap<String, Object>> getListCnt(EI01020001U eI01020001U);
     List<EasyHashMap<String, Object>> getListCnt(EI01020001U eI01020001U);
     
     
+    List<EasyHashMap<String, Object>> getSpecCd(EI01020001USearch search);
+    
+    int getBacklogCnt(EI01020001USearch search);
     
     
     /*
     /*
      * UPDATE
      * UPDATE
@@ -43,4 +46,6 @@ public interface EI01020001UMapper {
      * INSERT
      * INSERT
      */
      */
     int insert1(EI01020001U eI01020001U);
     int insert1(EI01020001U eI01020001U);
+    
+    int insertBacklogFcst(EI01020001U eI01020001U);
 }
 }

+ 26 - 2
src/main/java/sgc/portal/ei/ei0102/service/EI01020001UService.java

@@ -40,6 +40,15 @@ public class EI01020001UService {
         return mapper.getList3(search);
         return mapper.getList3(search);
     }
     }
     
     
+    public List<EasyHashMap<String, Object>> getSpecCd(EI01020001USearch search) {
+        return mapper.getSpecCd(search);
+    }
+    
+    public int getBacklogCnt(EI01020001USearch search) {
+        return mapper.getBacklogCnt(search);
+    }
+    
+    
     /*
     /*
      * SAVE LIST
      * SAVE LIST
      */
      */
@@ -65,8 +74,6 @@ public class EI01020001UService {
     
     
     @Transactional
     @Transactional
     public Map<String, String> update3(List<EI01020001U> eI01020001U) {
     public Map<String, String> update3(List<EI01020001U> eI01020001U) {
-    	log.info("EI01020001UService - update3()");
-    	
     	Map<String,String> result = new HashMap<>();
     	Map<String,String> result = new HashMap<>();
     	for (EI01020001U vo : eI01020001U) {
     	for (EI01020001U vo : eI01020001U) {
     		update3(vo);
     		update3(vo);
@@ -75,6 +82,19 @@ public class EI01020001UService {
     	return result;
     	return result;
     }
     }
     
     
+    @Transactional
+    public Map<String, String> update4(List<EI01020001U> eI01020001U) {
+    	log.info("EI01020001UService - update4()");
+    	
+    	Map<String,String> result = new HashMap<>();
+    	for (EI01020001U vo : eI01020001U) {
+    		update4(vo);
+        }
+    	
+    	return result;
+    }
+    
+    
     /*
     /*
      * UPDATE
      * UPDATE
      */
      */
@@ -96,4 +116,8 @@ public class EI01020001UService {
     	mapper.insertOrUpdate3(eI01020001U);
     	mapper.insertOrUpdate3(eI01020001U);
     }
     }
     
     
+    private void update4(EI01020001U eI01020001U) {
+    	mapper.insertBacklogFcst(eI01020001U);
+    }
+    
 }
 }

+ 28 - 0
src/main/java/sgc/portal/ei/ei0102/web/EI01020001UController.java

@@ -1,5 +1,6 @@
 package sgc.portal.ei.ei0102.web;
 package sgc.portal.ei.ei0102.web;
 
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
@@ -37,6 +38,33 @@ public class EI01020001UController {
     
     
     @PostMapping("/EI01020001U/list2")
     @PostMapping("/EI01020001U/list2")
     public List<EasyHashMap<String, Object>> getList2(@RequestBody EI01020001USearch search) {
     public List<EasyHashMap<String, Object>> getList2(@RequestBody EI01020001USearch search) {
+    	// EIS_MI_BACKLOG (경영정보 - Backlog) 데이터 유무 확인 
+    	log.info("=== EIS_MI_BACKLOG (경영정보 - Backlog) 데이터 유무 확인 ===");
+    	
+    	int backlogCnt  = service.getBacklogCnt(search);
+    	log.info("backlogCnt : " + backlogCnt);
+    	
+    	if(backlogCnt < 1) {
+    		// 사업본부 구분코드 조회
+    		log.info("=== 사업본부 구분코드 조회 ===");
+    		List<EasyHashMap<String, Object>> list = service.getSpecCd(search);  // 사업본부 구분코드
+    		
+    		List<EI01020001U> eI01020001U = new ArrayList<>();
+    		
+    		for(int i = 0; i < list.size(); i++) {
+    			EI01020001U ei = new EI01020001U();
+    			ei.setCmpnCd(search.getCmpnCd());
+    			ei.setPyear(search.getPyear());
+    			ei.setPmonth(search.getPmonth());
+    			ei.setCcgrpGbCd(list.get(i).get("specCd").toString());
+    			ei.setBacklogFcst("0");
+    			
+    			eI01020001U.add(ei);
+    		}
+    		
+    		service.update4(eI01020001U);
+    	}
+    	
         return service.getList2(search);
         return service.getList2(search);
     }
     }
     
     

+ 40 - 11
src/main/resources/sqlmap/mappers/ei/ei0102/EI01020001UMapper.xml

@@ -246,7 +246,7 @@ SELECT AA.CMPN_CD
 	 , AA.CCGRP_GB_CD                                                                   /* 사업본부 구분코드[EI002] */
 	 , AA.CCGRP_GB_CD                                                                   /* 사업본부 구분코드[EI002] */
 	 , AA.SORT_NUM                                                                      /* 정렬 순번                        */
 	 , AA.SORT_NUM                                                                      /* 정렬 순번                        */
 	 
 	 
-	 , NVL(BB.BACKLOG_PFMC_00, 0)   AS BACKLOG_PFMC_00                                                               /* 연말 실적                        */
+	 , NVL(BB.BACKLOG_PFMC_00, 0)   AS BACKLOG_PFMC_00                                  /* 연말 실적                        */
 	 
 	 
 	 , NVL(BB.BACKLOG_PFMC_00, 0) + NVL(AA.CNTRT_AMT_01, 0) - NVL(CC.SLAMT_SUM_01, 0)  AS BACKLOG_PFMC_01     /* 월별 Backlog 실적(1월) */  /*  당월(당월이전) = 전월Backlog + 수주실적 – 매출실적 */
 	 , NVL(BB.BACKLOG_PFMC_00, 0) + NVL(AA.CNTRT_AMT_01, 0) - NVL(CC.SLAMT_SUM_01, 0)  AS BACKLOG_PFMC_01     /* 월별 Backlog 실적(1월) */  /*  당월(당월이전) = 전월Backlog + 수주실적 – 매출실적 */
 	 , NVL(BB.BACKLOG_FCST_01, 0)   AS BACKLOG_FCST_01                                                        /* 월별 Backlog 전망(1월) */
 	 , NVL(BB.BACKLOG_FCST_01, 0)   AS BACKLOG_FCST_01                                                        /* 월별 Backlog 전망(1월) */
@@ -761,7 +761,6 @@ SELECT AA.CMPN_CD
    ORDER BY AA.SORT_NUM
    ORDER BY AA.SORT_NUM
 	</select>
 	</select>
 	
 	
-	
 	<select id="getList3" resultType="easyHashMap">
 	<select id="getList3" resultType="easyHashMap">
 		SELECT A.CMPN_CD                            /* 회사 코드           */
 		SELECT A.CMPN_CD                            /* 회사 코드           */
              , A.PYEAR                              /* 기준 연도           */
              , A.PYEAR                              /* 기준 연도           */
@@ -868,6 +867,26 @@ SELECT AA.CMPN_CD
                 , A.CCGRP_GB_CD             /* 사업본부 구분코드  */
                 , A.CCGRP_GB_CD             /* 사업본부 구분코드  */
 	</select>
 	</select>
 	
 	
+	<select id="getSpecCd" resultType="easyHashMap">
+	SELECT SPEC_CD   /* 사업본부 구분코드   */
+      FROM SM_COM_COMMCD_D   /* 공통)공통코드상세 */
+     WHERE COMM_CD_ID = '1111'
+       AND ESBS_CD1 = 'Y'
+	</select>
+	
+	<select id="getBacklogCnt" resultType="int">
+	SELECT COUNT(1)  AS CNT
+      FROM EIS_MI_BACKLOG /* EIS) 경영정보 - Backlog */ 
+     WHERE CMPN_CD = #{cmpnCd}  /* 회사 코드 */
+       AND PYEAR = #{pyear}     /* 기준 연도 */
+       AND PMONTH = #{pmonth}   /* 기준 월   */
+       AND CCGRP_GB_CD IN (
+             	            SELECT SPEC_CD   /* 사업본부 구분코드   */
+                              FROM SM_COM_COMMCD_D   /* 공통)공통코드상세 */
+                             WHERE COMM_CD_ID = '1111'
+                               AND ESBS_CD1 = 'Y'
+                           )
+	</select>
 		
 		
 	<update id="update1">
 	<update id="update1">
 		UPDATE EIS_MI_RCORD
 		UPDATE EIS_MI_RCORD
@@ -888,15 +907,12 @@ SELECT AA.CMPN_CD
      USING dual
      USING dual
         ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND CCSCTR_GB_CD = #{ccsctrGbCd} AND CCGRP_GB_CD = #{ccgrpGbCd})
         ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND CCSCTR_GB_CD = #{ccsctrGbCd} AND CCGRP_GB_CD = #{ccgrpGbCd})
       WHEN MATCHED THEN
       WHEN MATCHED THEN
-	  
 		UPDATE 
 		UPDATE 
 		   SET A.RCORD_PLAN = #{rcordPlan}
 		   SET A.RCORD_PLAN = #{rcordPlan}
 		     , A.RCORD_FCST = #{rcordFcst}
 		     , A.RCORD_FCST = #{rcordFcst}
 		     , A.MDFT_DT = #{mdftDt}
 		     , A.MDFT_DT = #{mdftDt}
 		     , A.MDFT_PR = #{mdftPr}
 		     , A.MDFT_PR = #{mdftPr}
-		 		
       WHEN NOT MATCHED THEN
       WHEN NOT MATCHED THEN
-	  
            INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.CCSCTR_GB_CD, A.CCGRP_GB_CD, A.RCORD_PLAN, A.RCORD_FCST, A.WRTE_DT, A.WRTE_PR)
            INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.CCSCTR_GB_CD, A.CCGRP_GB_CD, A.RCORD_PLAN, A.RCORD_FCST, A.WRTE_DT, A.WRTE_PR)
            VALUES (#{cmpnCd} , #{pyear} , #{pmonth} , #{ccsctrGbCd} , #{ccgrpGbCd} , #{rcordPlan} , #{rcordFcst} , #{wrteDt}, #{wrtePr})
            VALUES (#{cmpnCd} , #{pyear} , #{pmonth} , #{ccsctrGbCd} , #{ccgrpGbCd} , #{rcordPlan} , #{rcordFcst} , #{wrteDt}, #{wrtePr})
     </update>
     </update>
@@ -946,6 +962,25 @@ SELECT AA.CMPN_CD
 	    )
 	    )
     </insert>
     </insert>
     
     
+    <insert id="insertBacklogFcst">
+		INSERT INTO EIS_MI_BACKLOG(
+	            CMPN_CD
+	          , PYEAR
+	          , PMONTH
+	          , CCGRP_GB_CD
+	          , BACKLOG_FCST
+	          , WRTE_DT
+	          , WRTE_PR
+	    )VALUES(
+	            #{cmpnCd}
+	          , #{pyear}
+	          , #{pmonth}
+	          , #{ccgrpGbCd}
+	          , #{backlogFcst}
+	          , #{wrteDt}
+	          , #{wrtePr}
+	    )
+    </insert>
     
     
     <update id="update2">
     <update id="update2">
 		UPDATE EIS_MI_BACKLOG
 		UPDATE EIS_MI_BACKLOG
@@ -964,14 +999,11 @@ SELECT AA.CMPN_CD
      USING dual
      USING dual
         ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND CCGRP_GB_CD = #{ccgrpGbCd})
         ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND CCGRP_GB_CD = #{ccgrpGbCd})
       WHEN MATCHED THEN
       WHEN MATCHED THEN
-	  
 		UPDATE 
 		UPDATE 
 		   SET A.BACKLOG_FCST = #{backlogFcst}
 		   SET A.BACKLOG_FCST = #{backlogFcst}
 		     , A.MDFT_DT = #{mdftDt}
 		     , A.MDFT_DT = #{mdftDt}
 		     , A.MDFT_PR = #{mdftPr}
 		     , A.MDFT_PR = #{mdftPr}
-		 		
       WHEN NOT MATCHED THEN
       WHEN NOT MATCHED THEN
-	  
            INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.CCGRP_GB_CD, A.BACKLOG_FCST, A.WRTE_DT, A.WRTE_PR)
            INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.CCGRP_GB_CD, A.BACKLOG_FCST, A.WRTE_DT, A.WRTE_PR)
            VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{ccgrpGbCd} ,#{backlogFcst}, #{wrteDt}, #{wrtePr})
            VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{ccgrpGbCd} ,#{backlogFcst}, #{wrteDt}, #{wrtePr})
     </update>
     </update>
@@ -994,14 +1026,11 @@ SELECT AA.CMPN_CD
      USING dual
      USING dual
         ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND CCGRP_GB_CD = #{ccgrpGbCd})
         ON (A.CMPN_CD = #{cmpnCd} AND A.PYEAR = #{pyear} AND A.PMONTH = #{pmonth} AND CCGRP_GB_CD = #{ccgrpGbCd})
       WHEN MATCHED THEN
       WHEN MATCHED THEN
-	  
 		UPDATE 
 		UPDATE 
 		   SET A.BACKLOG_PFMC = #{backlogPfmc}
 		   SET A.BACKLOG_PFMC = #{backlogPfmc}
 		     , A.MDFT_DT = #{mdftDt}
 		     , A.MDFT_DT = #{mdftDt}
 		     , A.MDFT_PR = #{mdftPr}
 		     , A.MDFT_PR = #{mdftPr}
-		 		
       WHEN NOT MATCHED THEN
       WHEN NOT MATCHED THEN
-	  
            INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.CCGRP_GB_CD, A.BACKLOG_PFMC, A.WRTE_DT, A.WRTE_PR)
            INSERT (A.CMPN_CD, A.PYEAR, A.PMONTH, A.CCGRP_GB_CD, A.BACKLOG_PFMC, A.WRTE_DT, A.WRTE_PR)
            VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{ccgrpGbCd} ,#{backlogPfmc} ,#{wrteDt}, #{wrtePr})
            VALUES (#{cmpnCd} ,#{pyear} ,#{pmonth} ,#{ccgrpGbCd} ,#{backlogPfmc} ,#{wrteDt}, #{wrtePr})
     </update>
     </update>

+ 3 - 1
src/main/webapp/ux/ei/ei0201/EI02010001U.xml

@@ -352,11 +352,13 @@
 	 ***************************************************************************/
 	 ***************************************************************************/
 	scwin.btnDownExcelForm_onclick = function() {
 	scwin.btnDownExcelForm_onclick = function() {
 		var removeColumns = "0,1,2,3,4,5,35"
 		var removeColumns = "0,1,2,3,4,5,35"
+		var totalRow = dcdataList1.getTotalRow();  // 100건 이상 설정 관련
 	
 	
         var options = {
         var options = {
             common: {
             common: {
                 fileName : "자금관리.xls",
                 fileName : "자금관리.xls",
-                multipleSheet : "true"
+                multipleSheet : "true",
+                rowsByN : totalRow // 100건 이상 설정 관련
             },
             },
             excelInfo: [
             excelInfo: [
                 {	
                 {