Pārlūkot izejas kodu

api 관리 승인버튼 추가

databank102 4 gadi atpakaļ
vecāks
revīzija
42851487e2

+ 2 - 2
src/main/java/com/lemon/lifecenter/controller/ApiManagerController.java

@@ -97,7 +97,7 @@ public class ApiManagerController extends LifeCenterController {
          
         service.insertApiManager(dto);
         
-        LifeCenterFunction.scriptMessage( response, "alertBox({ txt: '협력병원이 등록되었습니다.', callBack : function(){ location.href='/apiManager/list'; } });" );
+        LifeCenterFunction.scriptMessage( response, "alertBox({ txt: '서비스 신청을 완료하였습니다.', callBack : function(){ location.href='/apiManager/list'; } });" );
         return "/common/blank";
         
         //return "redirect:/cooperation/info?cooperativeCode="+dto.getCooperativeCode();
@@ -112,7 +112,7 @@ public class ApiManagerController extends LifeCenterController {
          
         service.updateUseYnApiManager(dto);
         
-        LifeCenterFunction.scriptMessage( response, "alertBox({ txt: '협력병원이 등록되었습니다.', callBack : function(){ location.href='/apiManager/list'; } });" );
+        LifeCenterFunction.scriptMessage( response, "alertBox({ txt: '서비스 신청을 완료하였습니다.', callBack : function(){ location.href='/apiManager/list'; } });" );
         return "/common/blank";
         
         //return "redirect:/cooperation/info?cooperativeCode="+dto.getCooperativeCode();

+ 14 - 0
src/main/resources/mybatis/mapper/api/apiManager.xml

@@ -123,4 +123,18 @@
                 )
         ]]>
     </insert>
+    
+    <insert id="updateUseYnApiManager" parameterType="ApiManagerDTO">
+        <if test='useYn != null and useYn != ""'>
+        <![CDATA[
+            UPDATE
+                API_MANAGER
+            SET
+                USE_YN = #{useYn},
+                ACCEPT_DATE = NOW()
+            WHERE
+                IDX = #{idx}
+        ]]>
+        </if>
+    </insert>
 </mapper>

+ 4 - 3
src/main/webapp/WEB-INF/jsp/api/info.jsp

@@ -64,8 +64,9 @@ $( function(){
                     <div class="row">
                         <div class="col-12">
                             <div class="card">
-                                <form action="./useyn" id="newForm" method="post">
-                                <input type="hidden" value="${info.idx}" name="idx">
+                                <form action="./accept" id="newForm" method="post">
+                                <c:if test="${info.useYn ne 'D'}"><input type="hidden" value="${info.idx}" name="idx">
+                                <input type="hidden" value="<c:if test="${info.useYn eq 'W'}">C</c:if><c:if test="${info.useYn eq 'C'}">D</c:if>" name="useYn"></c:if>
                                     <div class="card-body">
                                         <table class="table mobile-table">
                                             <colgroup>
@@ -138,7 +139,7 @@ $( function(){
                                         <div class="row mt-3">
                                             <div class="col-12">
                                                 <div class="text-right">
-                                                    <button type="button" class="btn btn-primary w100" onclick="location.href='./list';">승인</button>
+                                                    <c:if test="${info.useYn ne 'D'}"><button type="submit" class="btn btn-primary w100"><c:if test="${info.useYn eq 'W'}">승인</c:if><c:if test="${info.useYn eq 'C'}">해제</c:if></button></c:if>
                                                     <button type="button" class="btn btn-primary w100" onclick="location.href='./list';">목록</button>
                                                 </div>
                                             </div>