Merge branch 'main' into yoon
This commit is contained in:
commit
019300e662
@ -27,6 +27,7 @@ import io.company.localhost.common.annotation.ParameterCheck;
|
||||
import io.company.localhost.common.annotation.ReqMap;
|
||||
import io.company.localhost.common.dto.ApiResponse;
|
||||
import io.company.localhost.common.dto.MapDto;
|
||||
import io.company.localhost.service.commoncodService;
|
||||
import io.company.localhost.service.localbordService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@ -38,6 +39,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
public class BoardController {
|
||||
|
||||
private final localbordService boardService;
|
||||
private final commoncodService commoncodService;
|
||||
|
||||
/**
|
||||
* 공지사항 목록 조회
|
||||
@ -230,4 +232,14 @@ public class BoardController {
|
||||
public ApiResponse<Boolean> checkBoardPassword(@PathVariable("boardId") int boardId, @ReqMap MapDto map) {
|
||||
return ApiResponse.ok(boardService.getBoardPassword(boardId).equals(map.getString("LOCBRDPWD")));
|
||||
}
|
||||
|
||||
/**
|
||||
* 카테고리 목록 조회
|
||||
* @return 카테고리 리스트
|
||||
*/
|
||||
@GetMapping("/categories")
|
||||
public ApiResponse<List<MapDto>> getCategories() {
|
||||
List<MapDto> categories = commoncodService.getCategoryList();
|
||||
return ApiResponse.ok(categories);
|
||||
}
|
||||
}
|
||||
@ -23,13 +23,9 @@ public class VacationController {
|
||||
private final localvacaService localVacaService;
|
||||
|
||||
@PostMapping
|
||||
public ApiResponse<String> saveVacations(@RequestBody List<MapDto> vacationRequests) {
|
||||
// 요청 데이터 유효성 검사
|
||||
if (vacationRequests == null || vacationRequests.isEmpty()) {
|
||||
throw new IllegalArgumentException("휴가 요청 데이터가 비어 있습니다.");
|
||||
}
|
||||
public ApiResponse<String> saveVacations(@RequestBody List<MapDto> map) {
|
||||
|
||||
for (MapDto request : vacationRequests) {
|
||||
for (MapDto request : map) {
|
||||
// 각 요청 데이터의 필수 값 검증
|
||||
Integer employeeId = (Integer) request.get("employeeId");
|
||||
String date = request.getString("date");
|
||||
@ -51,10 +47,10 @@ public class VacationController {
|
||||
* 휴가 정보를 조회하여 프론트엔드로 전달
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public ApiResponse<List<MapDto>> getVacationList() {
|
||||
public ApiResponse<List<MapDto>> getVacationList(@ReqMap MapDto map) {
|
||||
|
||||
// 서비스 호출을 통해 데이터 조회
|
||||
List<MapDto> vacationList = localVacaService.getVacationList();
|
||||
List<MapDto> vacationList = localVacaService.getVacationList(map);
|
||||
|
||||
return ApiResponse.ok(vacationList);
|
||||
}
|
||||
|
||||
@ -254,9 +254,14 @@ public class UserController {
|
||||
*/
|
||||
@ParameterCheck
|
||||
@GetMapping("/allUserList")
|
||||
public ApiResponse<List<MapDto>> getallUserList() {
|
||||
public ApiResponse<MapDto> getallUserList() {
|
||||
List<MapDto> allUserList = netmemberservice.getallUserList();
|
||||
return ApiResponse.ok(allUserList);
|
||||
MemberVo user = AuthUtil.getUser();
|
||||
|
||||
MapDto outData = new MapDto();
|
||||
outData.put("allUserList", allUserList);
|
||||
outData.put("user", user);
|
||||
return ApiResponse.ok(outData);
|
||||
}
|
||||
|
||||
@Guest
|
||||
|
||||
@ -34,4 +34,6 @@ public interface commoncodMapper {
|
||||
List<MapDto> getPwhintList();
|
||||
|
||||
int updateColorYon(String color);
|
||||
|
||||
List<MapDto> getCategories();
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ import io.company.localhost.common.dto.MapDto;
|
||||
public interface localvacaMapper {
|
||||
void insertVacation(MapDto map);
|
||||
|
||||
List<MapDto> findVacations();
|
||||
List<MapDto> findVacations(MapDto map);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -19,7 +19,6 @@ import java.util.List;
|
||||
|
||||
import org.springframework.security.crypto.password.DelegatingPasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import io.company.localhost.common.dto.MapDto;
|
||||
|
||||
@ -47,5 +47,7 @@ public class commoncodService {
|
||||
public List<MapDto> getPwhintList() {
|
||||
return commoncodmapper.getPwhintList();
|
||||
}
|
||||
|
||||
public List<MapDto> getCategoryList() {
|
||||
return commoncodmapper.getCategories();
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@ public class localbordService {
|
||||
}
|
||||
|
||||
public PageInfo<MapDto> getGeneralPosts(MapDto map) {
|
||||
System.out.println(map);
|
||||
int page = map.getString("page") != null ? Integer.parseInt(map.getString("page")) : 1;
|
||||
int size = map.getString("size") != null ? Integer.parseInt(map.getString("size")) : 10;
|
||||
|
||||
|
||||
@ -14,12 +14,12 @@ public class localvacaService {
|
||||
private final localvacaMapper localvacaMapper;
|
||||
|
||||
|
||||
public void insertVacation(MapDto vacationRequest) {
|
||||
localvacaMapper.insertVacation(vacationRequest);
|
||||
public void insertVacation(MapDto map) {
|
||||
localvacaMapper.insertVacation(map);
|
||||
}
|
||||
|
||||
public List<MapDto> getVacationList() {
|
||||
return localvacaMapper.findVacations();
|
||||
public List<MapDto> getVacationList(MapDto map) {
|
||||
return localvacaMapper.findVacations(map);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -74,5 +74,10 @@
|
||||
WHERE CMNCODVAL = #{color};
|
||||
</update>
|
||||
|
||||
<select id="getCategories" resultType="Map">
|
||||
SELECT CMNCODVAL, CMNCODNAM FROM commoncod
|
||||
WHERE CMNCODVAL BETWEEN 300101 AND 300103
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
LOCBRDUDT AS date,
|
||||
LOCBRDCNT AS cnt
|
||||
FROM localbord
|
||||
WHERE LOCBRDTYP = 'N'
|
||||
WHERE LOCBRDTYP = '300103'
|
||||
<if test="searchKeyword != null and searchKeyword != ''">
|
||||
AND LOCBRDTTL LIKE CONCAT('%', #{searchKeyword}, '%')
|
||||
</if>
|
||||
@ -27,7 +27,7 @@
|
||||
LOCBRDUDT AS date,
|
||||
LOCBRDCNT AS cnt
|
||||
FROM localbord
|
||||
WHERE LOCBRDTYP IN ('F', 'S')
|
||||
WHERE LOCBRDTYP IN ('300101', '300102')
|
||||
<if test="searchKeyword != null and searchKeyword != ''">
|
||||
AND LOCBRDTTL LIKE CONCAT('%', #{searchKeyword}, '%')
|
||||
</if>
|
||||
@ -62,7 +62,7 @@
|
||||
|
||||
<!-- 게시물 상세정보 조회 -->
|
||||
<select id="selectBoardDetail" resultType="io.company.localhost.common.dto.MapDto">
|
||||
SELECT LOCBRDSEQ AS id, LOCBRDTTL AS title, LOCBRDCON AS content, LOCBRDUDT AS date, LOCBRDTYP AS type
|
||||
SELECT LOCBRDSEQ AS id, LOCBRDTTL AS title, LOCBRDCON AS content, LOCBRDUDT AS date, LOCBRDTYP AS type, LOCBRDCNT AS cnt
|
||||
FROM localbord
|
||||
WHERE LOCBRDSEQ = #{boardId}
|
||||
</select>
|
||||
|
||||
@ -8,10 +8,10 @@
|
||||
VALUES (#{employeeId}, #{date}, #{type}, NOW())
|
||||
</insert>
|
||||
|
||||
<!-- 직원 ID로 휴가 정보 조회 -->
|
||||
<select id="findVacationsByEmployeeId" parameterType="int" resultType="map">
|
||||
<!-- 휴가 정보 조회 -->
|
||||
<select id="findVacations" parameterType="io.company.localhost.common.dto.MapDto">
|
||||
SELECT
|
||||
MEMBERSEQ
|
||||
MEMBERSEQ,
|
||||
LOCVACUDT,
|
||||
LOCVACTYP
|
||||
FROM
|
||||
|
||||
@ -112,16 +112,23 @@
|
||||
WHERE MEMBERIDS = #{id}
|
||||
</update>
|
||||
|
||||
<!-- 전체 회원 목록 -->
|
||||
<select id="getallUserList" resultType="Map">
|
||||
SELECT *
|
||||
SELECT
|
||||
m.*
|
||||
,c.CMNCODNAM usercolor
|
||||
FROM
|
||||
netmember
|
||||
netmember m
|
||||
left join
|
||||
commoncod c
|
||||
on
|
||||
M.MEMBERCOL = C.CMNCODVAL
|
||||
WHERE
|
||||
MEMBERDEL = "N"
|
||||
m.MEMBERDEL = "N"
|
||||
AND
|
||||
MEMBERPRM = "Y"
|
||||
m.MEMBERPRM = "Y"
|
||||
AND
|
||||
MEMBERLEA ="N"
|
||||
m.MEMBERLEA ="N"
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user