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