huiwon.seo 4 years ago
parent
commit
d759095808

+ 5 - 0
src/main/java/com/lemon/lifecenter/controller/StaffController.java

@@ -249,8 +249,10 @@ public class StaffController extends LifeCenterController {
             @RequestParam(value="page", required=false, defaultValue="1") int page,
             HttpServletRequest request, HttpServletResponse response) {
         String sesId  = LifeCenterSessionController.getSession( request, "sesId" );
+        String sesGroupIdx  = LifeCenterSessionController.getSession( request, "sesGroupIdx" );
         String sesCenterCode  = LifeCenterSessionController.getSession( request, "sesCenterCode" );
         
+        System.out.println( "groupIdx : " + sesGroupIdx );
         if (selectState.equals("sId")) {
             dto.setId(sData);
         } else if (selectState.equals("sName")) {
@@ -259,6 +261,8 @@ public class StaffController extends LifeCenterController {
             dto.setCenterName(sData);
         }
         
+        dto.setGroupIdx(Integer.parseInt( sesGroupIdx ));
+        dto.setSesId(sesId);
         dto.setCenterCode(Integer.parseInt(sesCenterCode));
         dto.setLimit( ( Integer.valueOf( page ) - 1 ) * config.pageDataSize );
         dto.setLimitMax( config.pageDataSize );
@@ -280,6 +284,7 @@ public class StaffController extends LifeCenterController {
         mv.addObject("item", list);
         mv.addObject("paging", paging);
         mv.addObject( "sesId", sesId );
+        mv.addObject("sesGroupIdx", sesGroupIdx );
         
         return mv;
     }

+ 8 - 0
src/main/java/com/lemon/lifecenter/dto/StaffDTO.java

@@ -18,7 +18,15 @@ public class StaffDTO {
     private String selectState = "";
     private int limit = 0;
     private int limitMax = 0;
+    private String sesId="";
     
+    
+    public String getSesId() {
+        return sesId;
+    }
+    public void setSesId(String sesId) {
+        this.sesId = sesId;
+    }
     public String getNum() {
         return num;
     }

+ 11 - 0
src/main/resources/mybatis/mapper/staff/staff.xml

@@ -23,6 +23,12 @@
                AND (M.GROUP_IDX = 2 OR M.GROUP_IDX = 3)
                AND M.CENTER_CODE = #{centerCode}
         ]]>
+        <if test='groupIdx != null and groupIdx != "" and groupIdx == "3"'>
+            <![CDATA[
+                AND M.ID = #{sesId}
+            ]]>
+        </if>
+        
         <if test='useYn != null and useYn != ""'>
             <![CDATA[
                 AND M.USE_YN = #{useYn}
@@ -69,6 +75,11 @@
                AND (M.GROUP_IDX = 2 OR M.GROUP_IDX = 3)
                AND M.CENTER_CODE = #{centerCode}
         ]]>
+        <if test='groupIdx != null and groupIdx != "" and groupIdx == "3"'>
+            <![CDATA[
+                AND M.ID = #{sesId}
+            ]]>
+        </if>
         <if test='useYn != null and useYn != ""'>
             <![CDATA[
                 AND M.USE_YN = #{useYn}

+ 1 - 1
src/main/webapp/WEB-INF/jsp/staff/edit.jsp

@@ -72,7 +72,7 @@ $( function(){
                                             <tr>
                                                 <th>휴대폰번호</th>
                                                 <td>
-                                                    <input type="text" class="form-control" name="phoneNumber" value="${info.phoneNumber}" placeholder="01012341234" onkeypress="onlyNumber();">
+                                                    <input type="text" class="form-control" name="phoneNumber" value="${info.phoneNumber}" placeholder="'-'를 제외한 숫자만 입력하세요" onkeypress="onlyNumber();">
                                                 </td>
                                                 <th>치료센터</th>
                                                 <td>

+ 3 - 1
src/main/webapp/WEB-INF/jsp/staff/list.jsp

@@ -88,7 +88,9 @@
                                             <fmt:formatNumber value="${total}" pattern="#,###" />
                                         </div>
                                         <div class="col-6 text-right">
-                                            <button class="btn btn-primary" onclick="location.href='./new';">의료진 신규 등록</button>
+                                            <c:if test="${sesGroupIdx eq '1' or sesGroupIdx eq '2'}">
+                                                <button class="btn btn-primary" onclick="location.href='./new';">의료진 신규 등록</button>
+                                            </c:if>
                                         </div>
                                     </div>
                                     <div class="table-responsive">