Merge branch 'main' into yoon

This commit is contained in:
yoon 2025-02-06 14:27:07 +09:00
commit 019300e662
13 changed files with 68 additions and 39 deletions

View File

@ -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;
/**
* 공지사항 목록 조회
@ -74,7 +76,7 @@ public class BoardController {
@PostMapping
public ApiResponse<BigInteger> createBoard(@ReqMap MapDto map) {
//임시
map.put("MEMBERSEQ", 1);
map.put("MEMBERSEQ", 1);
return ApiResponse.ok(boardService.createBoard(map));
}
@ -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);
}
}

View File

@ -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);
}

View File

@ -247,17 +247,22 @@ public class UserController {
}
/**
* 사원 목록 전체 조회
*
*
*
*/
@ParameterCheck
@GetMapping("/allUserList")
public ApiResponse<List<MapDto>> getallUserList() {
List<MapDto> allUserList = netmemberservice.getallUserList();
return ApiResponse.ok(allUserList);
}
* 사원 목록 전체 조회
*
*
*
*/
@ParameterCheck
@GetMapping("/allUserList")
public ApiResponse<MapDto> getallUserList() {
List<MapDto> allUserList = netmemberservice.getallUserList();
MemberVo user = AuthUtil.getUser();
MapDto outData = new MapDto();
outData.put("allUserList", allUserList);
outData.put("user", user);
return ApiResponse.ok(outData);
}
@Guest
@GetMapping("get1")

View File

@ -34,4 +34,6 @@ public interface commoncodMapper {
List<MapDto> getPwhintList();
int updateColorYon(String color);
List<MapDto> getCategories();
}

View File

@ -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);
}

View File

@ -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;

View File

@ -47,5 +47,7 @@ public class commoncodService {
public List<MapDto> getPwhintList() {
return commoncodmapper.getPwhintList();
}
public List<MapDto> getCategoryList() {
return commoncodmapper.getCategories();
}
}

View File

@ -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;

View File

@ -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);
}
}

View File

@ -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>

View File

@ -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>

View File

@ -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

View File

@ -94,7 +94,7 @@
FROM netmember
WHERE MEMBERIDS = #{memberIds}
</select>
<!-- 비밀번호 재설정 member 체크 -->
<select id="selectPwReset" resultType="int">
SELECT COUNT(*)
@ -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>