admin 사용자 추가시 gw id 자동으로 등록추가
This commit is contained in:
parent
82bda62e3f
commit
c0334268f5
@ -1,6 +1,5 @@
|
|||||||
package com.itn.admin.gw.holiday.mapper;
|
package com.itn.admin.gw.holiday.mapper;
|
||||||
|
|
||||||
import com.itn.admin.commute.mapper.domain.CommuteVO;
|
|
||||||
import com.itn.admin.gw.holiday.mapper.domain.HolidayVO;
|
import com.itn.admin.gw.holiday.mapper.domain.HolidayVO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
@ -21,4 +20,6 @@ import java.util.List;
|
|||||||
public interface HolidayMapper {
|
public interface HolidayMapper {
|
||||||
|
|
||||||
List<HolidayVO> selectHolidaysByDateRange(String targetDate);
|
List<HolidayVO> selectHolidaysByDateRange(String targetDate);
|
||||||
|
|
||||||
|
String findByUserIdFromUsrGlobalWhereName(String userName);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import com.itn.admin.commute.mapper.CommuteMapper;
|
|||||||
import com.itn.admin.commute.mapper.domain.CommuteVO;
|
import com.itn.admin.commute.mapper.domain.CommuteVO;
|
||||||
import com.itn.admin.commute.mapper.domain.UserEnum;
|
import com.itn.admin.commute.mapper.domain.UserEnum;
|
||||||
import com.itn.admin.commute.service.CommuteService;
|
import com.itn.admin.commute.service.CommuteService;
|
||||||
|
import com.itn.admin.gw.holiday.mapper.HolidayMapper;
|
||||||
import com.itn.admin.itn.user.mapper.UserMapper;
|
import com.itn.admin.itn.user.mapper.UserMapper;
|
||||||
import com.itn.admin.itn.user.mapper.domain.Role;
|
import com.itn.admin.itn.user.mapper.domain.Role;
|
||||||
import com.itn.admin.itn.user.mapper.domain.UserVO;
|
import com.itn.admin.itn.user.mapper.domain.UserVO;
|
||||||
@ -36,6 +37,9 @@ public class UserServiceImpl implements UserService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
TCodeUtils tCodeUtils;
|
TCodeUtils tCodeUtils;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
HolidayMapper holidayMapper;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PasswordEncoder passwordEncoder;
|
private PasswordEncoder passwordEncoder;
|
||||||
|
|
||||||
@ -166,6 +170,21 @@ public class UserServiceImpl implements UserService {
|
|||||||
userVO.setUniqId("ITN_"+ UUID.randomUUID().toString().replace("-", "").substring(0, 10));
|
userVO.setUniqId("ITN_"+ UUID.randomUUID().toString().replace("-", "").substring(0, 10));
|
||||||
userVO.setPassword(passwordEncoder.encode("itn123")); // 초기 비밀번호
|
userVO.setPassword(passwordEncoder.encode("itn123")); // 초기 비밀번호
|
||||||
userVO.setRole(Role.ROLE_GUEST);
|
userVO.setRole(Role.ROLE_GUEST);
|
||||||
|
|
||||||
|
String gwUserId ="";
|
||||||
|
try {
|
||||||
|
gwUserId = holidayMapper.findByUserIdFromUsrGlobalWhereName(userVO.getUserName());
|
||||||
|
|
||||||
|
}catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return RestResponse.builder()
|
||||||
|
.status(HttpStatus.BAD_REQUEST) // 실패
|
||||||
|
.data(userVO.getUserName())
|
||||||
|
.msg("실패하였습니다.")
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
userVO.setGwId(gwUserId);
|
||||||
|
|
||||||
log.info("userVO : [{}]", userVO);
|
log.info("userVO : [{}]", userVO);
|
||||||
userMapper.insertUser(userVO);
|
userMapper.insertUser(userVO);
|
||||||
return RestResponse.builder()
|
return RestResponse.builder()
|
||||||
|
|||||||
@ -41,4 +41,16 @@
|
|||||||
AND appr_stat = '2' -- 결제 완료 2
|
AND appr_stat = '2' -- 결제 완료 2
|
||||||
ORDER BY INS_DATE DESC
|
ORDER BY INS_DATE DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 특정 날짜가 범위 내에 있는 휴가 목록 조회 -->
|
||||||
|
<select id="findByUserIdFromUsrGlobalWhereName" parameterType="string" resultType="string">
|
||||||
|
SELECT
|
||||||
|
USER_ID
|
||||||
|
FROM INTRAWARE.USR_GLOBAL
|
||||||
|
WHERE NAME = #{userName}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@ -572,9 +572,13 @@
|
|||||||
contentType: 'application/json; charset=utf-8',
|
contentType: 'application/json; charset=utf-8',
|
||||||
data: JSON.stringify(formData),
|
data: JSON.stringify(formData),
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
$('#regUserInfoModal').modal('hide');
|
if(response.status === "OK") {
|
||||||
fn_successAlert("등록 완료", response.data + "님 등록됨");
|
$('#regUserInfoModal').modal('hide');
|
||||||
location.reload();
|
fn_successAlert("등록 완료", response.data + "님 등록됨");
|
||||||
|
location.reload();
|
||||||
|
}else{
|
||||||
|
fn_successAlert(response.msg);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
alert("등록 실패");
|
alert("등록 실패");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user