浏览代码

운영배포용 수정사항

huiwonseo 4 年之前
父节点
当前提交
f60c3565d3

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

@@ -28,7 +28,6 @@ import com.lemon.lifecenter.common.LifeCenterSessionController;
 import com.lemon.lifecenter.dto.CenterInfoDTO;
 import com.lemon.lifecenter.dto.GroupListDTO;
 import com.lemon.lifecenter.dto.LoginDTO;
-import com.lemon.lifecenter.dto.PatientDTO;
 import com.lemon.lifecenter.dto.StaffDTO;
 import com.lemon.lifecenter.service.CenterService;
 import com.lemon.lifecenter.service.GroupListService;
@@ -145,6 +144,7 @@ public class StaffController extends LifeCenterController {
         String groupIdx = LifeCenterFunction.aesEncrypt(config.aesKey, config.IV, String.valueOf(dto.getGroupIdx()));
         int centerCode = dto.getCenterCode();
         
+        
         GroupListDTO gDto = new GroupListDTO();
         List<GroupListDTO> groupList = groupListService.selectGroupList(gDto);
         
@@ -158,18 +158,24 @@ public class StaffController extends LifeCenterController {
         mv.addObject("groupIdx", groupIdx);
 //        mv.addObject("centerList", centerList);
         mv.addObject( "groupList", groupList );
-
         return mv;
     }
     
     @RequestMapping( value="edit/update", method=RequestMethod.POST)
     public String editUpdate(
             HttpServletRequest request,HttpServletResponse response,
-            @RequestParam(value="encGroupIdx", required=true) String encGroupIdx,
+            @RequestParam(value="encGroupIdx", required=false, defaultValue = "") String encGroupIdx,
             @ModelAttribute("dto") StaffDTO dto ) throws Exception {
-        String decryptIdx = LifeCenterFunction.aesDecrypt( config.aesKey, config.IV, encGroupIdx );
+        
+        String decryptIdx = "";
+        
+        if( !encGroupIdx.equals("") ) {
+            decryptIdx = LifeCenterFunction.aesDecrypt( config.aesKey, config.IV, encGroupIdx );
+            dto.setGroupIdx( Integer.valueOf( decryptIdx ) );
+        }
+        
         String sesId  = LifeCenterSessionController.getSession( request, "sesId" );
-        dto.setGroupIdx( Integer.valueOf( decryptIdx ) );
+        
         dto.setUpdateById(sesId);
         
         int rts = memberService.updateEditMember(dto);

+ 1 - 1
src/main/resources/mybatis/mapper/staff/staff.xml

@@ -175,7 +175,7 @@
                    , PHONE_NUMBER = #{phoneNumber}
             ]]>
         </if>
-        <if test='groupIdx != null and groupIdx !=""'>
+        <if test='groupIdx != null and groupIdx !="" and groupIdx !=0'>
             <![CDATA[
                    , GROUP_IDX = #{groupIdx}
             ]]>

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

@@ -83,11 +83,14 @@ $( function(){
                                             <tr>
                                                 <th>권한</th>
                                                 <td>
+                                                    <c:if test="${info.groupIdx eq '2'}">관리자 (의료진)</c:if>
+                                                    <c:if test="${info.groupIdx ne '2'}">
                                                     <select class="custom-select" name="encGroupIdx">
                                                         <c:forEach var="gl" items="${groupList}"> 
                                                             <option value="${gl.encryptIdx}" <c:if test="${gl.encryptIdx eq groupIdx}"> selected="selected" </c:if> ><c:out value="${gl.groupName}"/></option>
                                                         </c:forEach>
                                                     </select>
+                                                    </c:if>
                                                 </td>
                                                 <th>상태</th>
                                                 <td>