From 8228468a105e9130ed540813cc9efa1b6037cffe Mon Sep 17 00:00:00 2001 From: sjh88 Date: Mon, 20 Mar 2023 15:15:31 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EB=8B=A8=EC=86=8D=EB=82=B4=EC=9A=A9=20?= =?UTF-8?q?=EB=8B=B5=EB=B3=80=20=EB=82=B4=EC=9A=A9=20=EC=88=98=EC=A0=95,?= =?UTF-8?q?=20=EC=8B=AC=EC=9D=98=EB=AA=A9=EB=A1=9D=20=EC=8B=AC=EC=82=AC?= =?UTF-8?q?=EA=B8=B0=EA=B0=84=20=EB=B0=8F=20=EB=A7=88=EA=B0=90=EC=9D=BC?= =?UTF-8?q?=EC=8B=9C=20=EC=88=98=EC=A0=95=20=EA=B8=B0=EB=8A=A5,=20?= =?UTF-8?q?=EC=8B=AC=EC=9D=98=20=EC=B2=98=EB=A6=AC=20=EC=8B=9C=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=EB=82=98=EB=A9=B4=20Exception=EB=82=98=EB=8A=94=20?= =?UTF-8?q?=EB=B6=80=EB=B6=84=20=EC=A0=9C=EA=B1=B0=20=ED=9B=84=20log=20ins?= =?UTF-8?q?ert=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ResidentAndDisabledController.java | 16 +++++++++--- .../biz/ctgy/v2/repository/ParkingDao.java | 20 +++++++++++++- .../v2/repository/ResidentAndDisabledDao.java | 20 ++++++++++---- .../service/IResidentAndDisabledService.java | 7 +++-- .../impl/ResidentAndDisabledService.java | 10 +++++++ src/main/resources/sql/parking-mapper.xml | 26 +++++++++++++++++++ .../sql/residentAndDisabled-mapper.xml | 12 +++++++++ 7 files changed, 97 insertions(+), 14 deletions(-) diff --git a/src/main/java/com/xit/biz/ctgy/v2/controller/ResidentAndDisabledController.java b/src/main/java/com/xit/biz/ctgy/v2/controller/ResidentAndDisabledController.java index 5753e9d..4fb8725 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/controller/ResidentAndDisabledController.java +++ b/src/main/java/com/xit/biz/ctgy/v2/controller/ResidentAndDisabledController.java @@ -1,9 +1,6 @@ package com.xit.biz.ctgy.v2.controller; -import com.xit.biz.ctgy.dto.GnRecallScDto; -import com.xit.biz.ctgy.dto.JudgeListDto; -import com.xit.biz.ctgy.dto.JudgeStdDto; -import com.xit.biz.ctgy.dto.JudgeTargetDto; +import com.xit.biz.ctgy.dto.*; import com.xit.biz.ctgy.v2.service.IResidentAndDisabledService; import com.xit.core.annotation.Secured; import com.xit.core.annotation.SecurityPolicy; @@ -222,4 +219,15 @@ public class ResidentAndDisabledController { service.saveJudgeResult(dto); return RestResponse.of(HttpStatus.OK); } + + @Secured(policy = SecurityPolicy.TOKEN) + @Operation(summary = "관리자 심사 기간 및 마감일시 처리" , description = "관리자 심사 기간 및 마감일시 처리") + @PostMapping(value="/admin/date", produces = MediaType.APPLICATION_JSON_VALUE) + public ResponseEntity saveDateStds( + @Valid + @RequestBody + final JudgeDetailDto dto) { + service.saveDateStds(dto); + return RestResponse.of(HttpStatus.OK); + } } diff --git a/src/main/java/com/xit/biz/ctgy/v2/repository/ParkingDao.java b/src/main/java/com/xit/biz/ctgy/v2/repository/ParkingDao.java index c8d0e50..a7db2eb 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/repository/ParkingDao.java +++ b/src/main/java/com/xit/biz/ctgy/v2/repository/ParkingDao.java @@ -117,7 +117,13 @@ public class ParkingDao extends BaseMpowerDaoSupport { Map rslt = executeSp(spSql, inParams, outParams); if(!"1".equals(rslt.get("result"))){ log.error("{}", rslt); - throw new CustomBaseException(String.valueOf(rslt.get("message"))); + //throw new CustomBaseException(String.valueOf(rslt.get("message"))); + final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "insertErrorLog") + .setParameter("msMaincode", msMaincode) + .setParameter("msSeq", msSeq) + .setParameter("message", (String) rslt.get("message")) + .getQueryString(); + update(sql); } /* @@ -252,4 +258,16 @@ public class ParkingDao extends BaseMpowerDaoSupport { public List> findContadImageByRcMaincode(@NotNull final Long rcMaincode) { return getParkingJudgeImgList(String.valueOf(rcMaincode), "contad"); } + + public void updateDateByMsuYear(@NotNull final JudgeDetailDto dto) { + final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateDateByMsuYear") + .setParameter("msYear", dto.getMsYear()) + .setParameter("msChasu", dto.getMsChasu()) + .setParameter("msSdate", dto.getMsSdate()) + .setParameter("msEdate", dto.getMsEdate()) + .setParameter("msCdate", dto.getMsCdate()) + .setParameter("msClosesi", dto.getMsClosesi()) + .getQueryString(); + update(sql); + } } diff --git a/src/main/java/com/xit/biz/ctgy/v2/repository/ResidentAndDisabledDao.java b/src/main/java/com/xit/biz/ctgy/v2/repository/ResidentAndDisabledDao.java index 64ecf71..45e889a 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/repository/ResidentAndDisabledDao.java +++ b/src/main/java/com/xit/biz/ctgy/v2/repository/ResidentAndDisabledDao.java @@ -1,10 +1,6 @@ package com.xit.biz.ctgy.v2.repository; -import com.xit.biz.ctgy.dto.DashboardJudgeListDto; -import com.xit.biz.ctgy.dto.GnRecallScDto; -import com.xit.biz.ctgy.dto.JudgeListDto; -import com.xit.biz.ctgy.dto.JudgeTargetDto; -import com.xit.biz.ctgy.dto.MinSimsaUser680ScDto; +import com.xit.biz.ctgy.dto.*; import com.xit.core.config.database.BaseMpowerDaoSupport; import com.xit.core.oauth2.config.properties.MasterDatabaseProperties; import com.xit.core.oauth2.config.properties.SlaveDatabaseProperties; @@ -296,6 +292,7 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport { .setParameter("scContad6", dto.getScContad6()) .setParameter("scContad7", dto.getScContad7()) .setParameter("scContad8", dto.getScContad8()) + .setParameter("scAnswer", dto.getScAnswer()) .getQueryString(); } @@ -333,4 +330,17 @@ public class ResidentAndDisabledDao extends BaseMpowerDaoSupport { .getQueryString(); update(sql); } + + public void updateDateByMsuYear(@NotNull final JudgeDetailDto dto) { + final String sql = QueryGenerator.createNamedQuery(NAME_SPACE, "updateDateByMsuYear") + .setParameter("msDatagb", dto.getMsDatagb()) + .setParameter("msYear", dto.getMsYear()) + .setParameter("msChasu", dto.getMsChasu()) + .setParameter("msSdate", dto.getMsSdate()) + .setParameter("msEdate", dto.getMsEdate()) + .setParameter("msCdate", dto.getMsCdate()) + .setParameter("msClosesi", dto.getMsClosesi()) + .getQueryString(); + update(sql); + } } diff --git a/src/main/java/com/xit/biz/ctgy/v2/service/IResidentAndDisabledService.java b/src/main/java/com/xit/biz/ctgy/v2/service/IResidentAndDisabledService.java index a55b344..8522c0c 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/service/IResidentAndDisabledService.java +++ b/src/main/java/com/xit/biz/ctgy/v2/service/IResidentAndDisabledService.java @@ -1,9 +1,6 @@ package com.xit.biz.ctgy.v2.service; -import com.xit.biz.ctgy.dto.GnRecallScDto; -import com.xit.biz.ctgy.dto.JudgeListDto; -import com.xit.biz.ctgy.dto.JudgeStdDto; -import com.xit.biz.ctgy.dto.JudgeTargetDto; +import com.xit.biz.ctgy.dto.*; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; @@ -89,4 +86,6 @@ public interface IResidentAndDisabledService { void saveJudgeResult(JudgeListDto dto); + void saveDateStds(final JudgeDetailDto dto); + } diff --git a/src/main/java/com/xit/biz/ctgy/v2/service/impl/ResidentAndDisabledService.java b/src/main/java/com/xit/biz/ctgy/v2/service/impl/ResidentAndDisabledService.java index c320f6c..1dc5509 100644 --- a/src/main/java/com/xit/biz/ctgy/v2/service/impl/ResidentAndDisabledService.java +++ b/src/main/java/com/xit/biz/ctgy/v2/service/impl/ResidentAndDisabledService.java @@ -332,4 +332,14 @@ public class ResidentAndDisabledService implements IResidentAndDisabledService { public void saveJudgeResult(JudgeListDto dto){ residentAndDisabledDao.updateMsuResonAndMsuResultByMsuCode(dto); } + + @Override + //@Transactional + public void saveDateStds(JudgeDetailDto dto){ + if (Checks.isEmpty(dto.getMsDatagb())) { + parkingDao.updateDateByMsuYear(dto); + }else{ + residentAndDisabledDao.updateDateByMsuYear(dto); + } + } } diff --git a/src/main/resources/sql/parking-mapper.xml b/src/main/resources/sql/parking-mapper.xml index c023c0a..6ea44f4 100644 --- a/src/main/resources/sql/parking-mapper.xml +++ b/src/main/resources/sql/parking-mapper.xml @@ -394,4 +394,30 @@ FROM tf680_recall WHERE rc_code = #{msMaincode} + + + /* parking-mapper|updateDateByMsuYear|jhseo */ + UPDATE min_simsa680 + SET MS_SDATE = #{msSdate} + , MS_EDATE = #{msEdate} + , MS_CDATE = #{msCdate} + , MS_CLOSESI = #{msClosesi} + WHERE MS_YEAR = #{msYear} + AND MS_CHASU = #{msChasu} + + + + /* minuserinfo-mapper|insertErrorLog|jhseo */ + INSERT + INTO min_simsa680_log ( + ms_maincode, + ms_seq, + massage + ) VALUES ( + #{msMaincode}, + #{msSeq}, + #{massage} + ) + + \ No newline at end of file diff --git a/src/main/resources/sql/residentAndDisabled-mapper.xml b/src/main/resources/sql/residentAndDisabled-mapper.xml index ab3fa7e..7aa8ad6 100644 --- a/src/main/resources/sql/residentAndDisabled-mapper.xml +++ b/src/main/resources/sql/residentAndDisabled-mapper.xml @@ -242,6 +242,7 @@ , sc_contad6 = NVL(#{scContad6}, sc_contad6) , sc_contad7 = NVL(#{scContad7}, sc_contad7) , sc_contad8 = NVL(#{scContad8}, sc_contad8) + , sc_answer = NVL(#{scAnswer}, sc_answer) WHERE sc_code = #{scCode} @@ -650,5 +651,16 @@ AND msu_userid = #{msuUserid} + + /* residentAndDisabled-mapper|updateDateByMsuYear|jhseo */ + UPDATE min_simsa680_sc + SET MS_SDATE = #{msSdate} + , MS_EDATE = #{msEdate} + , MS_CDATE = #{msCdate} + , MS_CLOSESI = #{msClosesi} + WHERE MS_YEAR = #{msYear} + AND MS_CHASU = #{msChasu} + AND MS_DATAGB = #{msDatagb} + \ No newline at end of file