From 40d2402793b1211bba0ff84ceed8f15f27c538a7 Mon Sep 17 00:00:00 2001 From: minuk926 Date: Tue, 10 Jan 2023 13:47:44 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=AF=BC=EC=9B=90=EC=8B=A0=EC=B2=AD=20?= =?UTF-8?q?=EB=8B=B5=EB=B3=80=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/kr/xit/fims/biz/FimsConst.java | 19 +++++- .../biz/ec/mapper/IEcCtznSttemntMapper.java | 3 + .../kr/xit/fims/biz/ec/model/CtznStmtDTO.java | 5 ++ .../ec/service/EcCctvCrackdownService.java | 4 +- .../biz/ec/service/EcCtznSttemntService.java | 21 ++++++- .../ec/service/EcNatlNewspaperService.java | 4 +- .../biz/ec/ec-ctzn-sttemnt-mysql-mapper.xml | 62 ++++++++++++------- .../jsp/fims/biz/ec/ecCtznSttemntMgtForm.jsp | 23 +++++-- 8 files changed, 107 insertions(+), 34 deletions(-) diff --git a/src/main/java/kr/xit/fims/biz/FimsConst.java b/src/main/java/kr/xit/fims/biz/FimsConst.java index 58b9eea4..14c73d05 100644 --- a/src/main/java/kr/xit/fims/biz/FimsConst.java +++ b/src/main/java/kr/xit/fims/biz/FimsConst.java @@ -49,6 +49,23 @@ public class FimsConst { private final String desc; } + /** + *
+	 * 시민신고처리(민원처리)상태 - FIM017
+	 * 
+ */ + @Getter + @AllArgsConstructor + public enum CtznStmtStsCode { + UNPROCESSED("01", "미처리"), + ANS_AVAILABLE("02", "답변가능"), + ANS_COMPLETE("03", "답변완료") + ; + + private final String code; + private final String desc; + } + /** *
 	 * 시민신고상세처리(민원처리상세)상태 - FIM018
@@ -56,7 +73,7 @@ public class FimsConst {
 	 */
 	@Getter
 	@AllArgsConstructor
-	public enum CtznSttemntStatusCode {
+	public enum CtznStmtDtlStsCode {
 		UNPROCESSED("01", "미처리"),
 		ACCEPTANCE("02", "수용"),
 		NOT_ACCEPTABLE("03", "불수용")
diff --git a/src/main/java/kr/xit/fims/biz/ec/mapper/IEcCtznSttemntMapper.java b/src/main/java/kr/xit/fims/biz/ec/mapper/IEcCtznSttemntMapper.java
index a3abe176..65e06da8 100644
--- a/src/main/java/kr/xit/fims/biz/ec/mapper/IEcCtznSttemntMapper.java
+++ b/src/main/java/kr/xit/fims/biz/ec/mapper/IEcCtznSttemntMapper.java
@@ -38,6 +38,7 @@ public interface IEcCtznSttemntMapper {
     CtznStmtDTO.CtznStmtAns selectEcCtznSttemntAnswer(final CtznStmtDTO.Request dto);
 
     void updateStatusAndRegltIdOfEcCtznSttemntDetail(final CtznStmtDTO.Request dto);
+     void updateStmtProcessStsOfEcCtznSttemnt(T t);
 
 
     void saveEcCtznSttemntAnswer(final CtznStmtDTO.CtznStmtAns dto);
@@ -49,4 +50,6 @@ public interface IEcCtznSttemntMapper {
 
 
     List dragAndDropIsExists(CmmFileDTO.FileDtl vo);
+
+
 }
diff --git a/src/main/java/kr/xit/fims/biz/ec/model/CtznStmtDTO.java b/src/main/java/kr/xit/fims/biz/ec/model/CtznStmtDTO.java
index 1489dfc0..deac780c 100644
--- a/src/main/java/kr/xit/fims/biz/ec/model/CtznStmtDTO.java
+++ b/src/main/java/kr/xit/fims/biz/ec/model/CtznStmtDTO.java
@@ -206,6 +206,7 @@ public class CtznStmtDTO implements Serializable { //extends ExtlEsbDataType {
         private String register;
         private String updtDt;
         private String updusr;
+        private String ctznSttemntProcessSttus;
 
         private Set indexs = new HashSet<>();
 
@@ -289,6 +290,9 @@ public class CtznStmtDTO implements Serializable { //extends ExtlEsbDataType {
          */
         private String register;
 
+        private String ctznSttemntStatusCode = FimsConst.CtznStmtStsCode.ANS_COMPLETE.getCode();
+        private String updusr;
+
         public static NatlNewspaperSendXmlDTO getCtznStmtAnsDTO(CtznStmtDTO.CtznStmtAns dto) {
             return NatlNewspaperSendXmlDTO.builder()
                 .interfaceSeqN(dto.getInterfaceSeqN())
@@ -329,6 +333,7 @@ public class CtznStmtDTO implements Serializable { //extends ExtlEsbDataType {
 
         private String regltProcessSttusCode;
         private String ctznSttemntStatusCode;
+        private String ctznSttemntDetailProcessSttus;
         // 단속ID
         private String regltId;
         private String erppId;
diff --git a/src/main/java/kr/xit/fims/biz/ec/service/EcCctvCrackdownService.java b/src/main/java/kr/xit/fims/biz/ec/service/EcCctvCrackdownService.java
index 0a25af2f..b96d0fb1 100644
--- a/src/main/java/kr/xit/fims/biz/ec/service/EcCctvCrackdownService.java
+++ b/src/main/java/kr/xit/fims/biz/ec/service/EcCctvCrackdownService.java
@@ -233,7 +233,7 @@ public class EcCctvCrackdownService implements IEcCctvCrackdownService {
         mapper.insertRtRegltFromEcExtrRegltCntc(dto);
 
         dto.setUpdusr(getUserInfo().getUniqId());
-        dto.setExtrlRegltCntcProcessSttus(FimsConst.CtznSttemntStatusCode.ACCEPTANCE.getCode());
+        dto.setExtrlRegltCntcProcessSttus(FimsConst.CtznStmtDtlStsCode.ACCEPTANCE.getCode());
         mapper.updateStatusAndRegltIdOfEcExtrRegltCntc(dto);
     }
 
@@ -253,7 +253,7 @@ public class EcCctvCrackdownService implements IEcCctvCrackdownService {
 
         // 상태 변경
         dto.setUpdusr(getUserInfo().getUniqId());
-        dto.setExtrlRegltCntcProcessSttus(FimsConst.CtznSttemntStatusCode.NOT_ACCEPTABLE.getCode());
+        dto.setExtrlRegltCntcProcessSttus(FimsConst.CtznStmtDtlStsCode.NOT_ACCEPTABLE.getCode());
         mapper.updateStatusAndRegltIdOfEcExtrRegltCntc(dto);
     }
 
diff --git a/src/main/java/kr/xit/fims/biz/ec/service/EcCtznSttemntService.java b/src/main/java/kr/xit/fims/biz/ec/service/EcCtznSttemntService.java
index 19ddb9be..03258ebd 100644
--- a/src/main/java/kr/xit/fims/biz/ec/service/EcCtznSttemntService.java
+++ b/src/main/java/kr/xit/fims/biz/ec/service/EcCtznSttemntService.java
@@ -99,13 +99,19 @@ public class EcCtznSttemntService implements IEcCtznSttemntService {
     @Override
     @Transactional
     public void saveRtReglt(final CtznStmtDTO.Request dto) {
+        // 단속테이블
         dto.setRegister(getUserInfo().getUniqId());
         dto.setRegltProcessSttusCode(FimsConst.RegltProcessSttusCode.CRACKDOWN.getCode());
         mapper.insertRtRegltFromCtznStmt(dto);
 
+        // 시민신고 상세 상태 변경
         dto.setUpdusr(getUserInfo().getUniqId());
-        dto.setCtznSttemntStatusCode(FimsConst.CtznSttemntStatusCode.ACCEPTANCE.getCode());
+        dto.setCtznSttemntDetailProcessSttus(FimsConst.CtznStmtDtlStsCode.ACCEPTANCE.getCode());
         mapper.updateStatusAndRegltIdOfEcCtznSttemntDetail(dto);
+
+        // 시민신고 상태 답변가능으로 - 시민신고상세의 모든 상태가 수용 또는 미수용인 경우
+        dto.setCtznSttemntStatusCode(FimsConst.CtznStmtStsCode.ANS_AVAILABLE.getCode());
+        mapper.updateStmtProcessStsOfEcCtznSttemnt(dto);
     }
 
     //-----------------------------------------------------
@@ -122,10 +128,14 @@ public class EcCtznSttemntService implements IEcCtznSttemntService {
         // 서손테이블
         mapper.insertRtErppFromCtznStmt(dto);
 
-        // 상태 변경
+        // 시민신고 상세 상태 변경
         dto.setUpdusr(getUserInfo().getUniqId());
-        dto.setCtznSttemntStatusCode(FimsConst.CtznSttemntStatusCode.NOT_ACCEPTABLE.getCode());
+        dto.setCtznSttemntDetailProcessSttus(FimsConst.CtznStmtDtlStsCode.NOT_ACCEPTABLE.getCode());
         mapper.updateStatusAndRegltIdOfEcCtznSttemntDetail(dto);
+
+        // 시민신고 상태 답변가능으로 - 시민신고상세의 모든 상태가 수용 또는 미수용인 경우
+        dto.setCtznSttemntStatusCode(FimsConst.CtznStmtStsCode.ANS_AVAILABLE.getCode());
+        mapper.updateStmtProcessStsOfEcCtznSttemnt(dto);
     }
 
     //-----------------------------------------------------
@@ -172,6 +182,11 @@ public class EcCtznSttemntService implements IEcCtznSttemntService {
         dto.setRegister(getUserInfo().getUniqId());
         mapper.saveEcCtznSttemntAnswer(dto);
 
+        // 시민신고 상태 - 답변완료 update
+        dto.setUpdusr(getUserInfo().getUniqId());
+        dto.setCtznSttemntStatusCode(FimsConst.CtznStmtStsCode.ANS_COMPLETE.getCode());
+        mapper.updateStmtProcessStsOfEcCtznSttemnt(dto);
+
         return tgtPath + "/" + fileName;
     }
 
diff --git a/src/main/java/kr/xit/fims/biz/ec/service/EcNatlNewspaperService.java b/src/main/java/kr/xit/fims/biz/ec/service/EcNatlNewspaperService.java
index d46c0e03..01364957 100644
--- a/src/main/java/kr/xit/fims/biz/ec/service/EcNatlNewspaperService.java
+++ b/src/main/java/kr/xit/fims/biz/ec/service/EcNatlNewspaperService.java
@@ -214,7 +214,7 @@ public class EcNatlNewspaperService implements IEcNatlNewspaperService {
         dto.setCvplReqstDt(xmlDto.getPetiRegD());
         dto.setCvplProcessPd(xmlDto.getPetiEndD());
         dto.setCvplRegistDt(xmlDto.getRegD());
-        dto.setCtznSttemntProcessSttus(FimsConst.CtznSttemntStatusCode.UNPROCESSED.getCode());
+        dto.setCtznSttemntProcessSttus(FimsConst.CtznStmtDtlStsCode.UNPROCESSED.getCode());
         dto.setRegister(getUserInfo().getUniqId());
 
         //---------------------------------
@@ -250,7 +250,7 @@ public class EcNatlNewspaperService implements IEcNatlNewspaperService {
 
             //공통 추가 항목
             dtlDto.setInterfaceSeqN(xmlDto.getInterfaceSeqN());
-            dtlDto.setCtznSttemntDetailProcessSttus(FimsConst.CtznSttemntStatusCode.UNPROCESSED.getCode());
+            dtlDto.setCtznSttemntDetailProcessSttus(FimsConst.CtznStmtDtlStsCode.UNPROCESSED.getCode());
             dtlDto.setSysCode(getUserInfo().getOrgnztId());
             dtlDto.setInsttCode(getUserInfo().getPstinstCode());
             dtlDto.setRegister(getUserInfo().getUniqId());
diff --git a/src/main/resources/sqlmapper/biz/ec/ec-ctzn-sttemnt-mysql-mapper.xml b/src/main/resources/sqlmapper/biz/ec/ec-ctzn-sttemnt-mysql-mapper.xml
index 457ab4d1..6a3e35fc 100644
--- a/src/main/resources/sqlmapper/biz/ec/ec-ctzn-sttemnt-mysql-mapper.xml
+++ b/src/main/resources/sqlmapper/biz/ec/ec-ctzn-sttemnt-mysql-mapper.xml
@@ -98,23 +98,26 @@
 	* tb_ec_ctzn_sttemnt_detail : 시민신고 상세
 	************************************************************************************************************** -->
 	
-        SELECT interface_seq_n
-		     , ctzn_sttemnt_detail_sn
-			 , vhcle_no
-			 , reglt_id
-			 , instt_code
-			 , sys_code
-			 , reglt_de_time
-			 , reglt_place
-			 , violt_dtls_nm
-			 , gps_x
-			 , gps_y
-			 , ctzn_sttemnt_detail_process_sttus
-			 , regist_dt
-			 , register
-			 , updt_dt
-			 , updusr
-		  FROM tb_ec_ctzn_sttemnt_detail
+        SELECT tecsd.interface_seq_n
+		     , tecsd.ctzn_sttemnt_detail_sn
+			 , tecsd.vhcle_no
+			 , tecsd.reglt_id
+			 , tecsd.instt_code
+			 , tecsd.sys_code
+			 , tecsd.reglt_de_time
+			 , tecsd.reglt_place
+			 , tecsd.violt_dtls_nm
+			 , tecsd.gps_x
+			 , tecsd.gps_y
+			 , tecsd.ctzn_sttemnt_detail_process_sttus
+			 , tecsd.regist_dt
+			 , tecsd.register
+			 , tecsd.updt_dt
+			 , tecsd.updusr
+			 , (SELECT ctzn_sttemnt_process_sttus
+			      FROM tb_ec_ctzn_sttemnt
+			     WHERE interface_seq_n = tecsd.interface_seq_n) AS ctzn_sttemnt_process_sttus
+		  FROM tb_ec_ctzn_sttemnt_detail tecsd
 	
 
 	
@@ -133,8 +136,8 @@
 	
 
 	
@@ -300,13 +303,28 @@
 		/* ec-ctzn-sttemnt-mysql-mapper|updateStatusAndRegltIdOfEcCtznSttemntDetail-시민신고 상세 단속ID set|julim */
 		UPDATE tb_ec_ctzn_sttemnt_detail
            SET reglt_id = #{regltId}
-             , ctzn_sttemnt_detail_process_sttus = #{ctznSttemntStatusCode}
+             , ctzn_sttemnt_detail_process_sttus = #{ctznSttemntDetailProcessSttus}
              , updt_dt = DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
              , updusr = #{updusr}
          WHERE interface_seq_n = #{interfaceSeqN}
            AND ctzn_sttemnt_detail_sn = #{ctznSttemntDetailSn}
 	
 
+	
+		/* ec-ctzn-sttemnt-mysql-mapper|updateStmtProcessStsOfEcCtznSttemnt-시민신고 진행상태 update : 답변완료 or 답변가능|julim */
+		UPDATE tb_ec_ctzn_sttemnt
+		   SET ctzn_sttemnt_process_sttus = IF(#{ctznSttemntStatusCode} = '03', #{ctznSttemntStatusCode}
+											, IF((SELECT COUNT(interface_seq_n)
+												  FROM tb_ec_ctzn_sttemnt_detail
+												  WHERE interface_seq_n = #{interfaceSeqN}
+													AND ctzn_sttemnt_detail_process_sttus = '01') > 0, ctzn_sttemnt_process_sttus,
+												 #{ctznSttemntStatusCode})
+										    )
+		     , updt_dt = DATE_FORMAT(NOW(), '%Y%m%d%H%i%s')
+		     , updusr = #{updusr}
+		 WHERE interface_seq_n = #{interfaceSeqN}
+	
+