강석 최 2023-05-09 18:26:24 +09:00
commit 7bc757c34a
23 changed files with 4084 additions and 386 deletions

View File

@ -1,38 +1,400 @@
package com.dbnt.faisp.main.budget; package com.dbnt.faisp.main.budget;
import com.dbnt.faisp.main.budget.common.ResultResponseCode;
import com.dbnt.faisp.main.budget.model.ResultResponse;
import com.dbnt.faisp.main.budget.model.BudgetDto;
import com.dbnt.faisp.main.budget.repository.BudgetRepository.*;
import com.dbnt.faisp.main.budget.service.BudgetService;
import com.dbnt.faisp.main.userInfo.model.UserInfo; import com.dbnt.faisp.main.userInfo.model.UserInfo;
import com.dbnt.faisp.main.userInfo.service.UserInfoService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Pageable;
import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@RestController import java.time.LocalDate;
import java.util.List;
@SuppressWarnings("unchecked")
@RequiredArgsConstructor @RequiredArgsConstructor
@RestController
@RequestMapping("/budget") @RequestMapping("/budget")
public class BudgetController { public class BudgetController {
private final UserInfoService userInfoService;
private final BudgetService budgetService;
/* 예산편성 - 화면 */
@GetMapping("/budgeting") @GetMapping("/budgeting")
public ModelAndView budgetingPage(@AuthenticationPrincipal UserInfo loginUser){ public ModelAndView viewShipList(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.BudgetingSearchReqeust requestDto, Pageable pageable) {
ModelAndView mav = new ModelAndView("budget/budgeting"); ModelAndView mav = new ModelAndView("budget/budgeting");
if (requestDto.getYear() == null || requestDto.getYear().equals("")) {
LocalDate date = LocalDate.now();
requestDto.setYear(String.valueOf(date.getYear()));
}
System.out.println(requestDto.getYear());
List<BudgetingList> list = budgetService.selectBudgetingList(loginUser, requestDto);
List<YearResult> yearList = budgetService.selectBudgetingYearList(loginUser);
long sum = 0;
for (int i = 0; i < list.size(); i++) {
sum += list.get(i).getAmount();
}
requestDto.setSum(sum);
// System.out.println(yearList.get(1).getYear());
// System.out.println(yearList.size());
mav.addObject("list", list);
mav.addObject("yearList", yearList);
mav.addObject("searchParams", requestDto);
return mav; return mav;
} }
// 예산편성 - 연도 추가
@PostMapping("/budgeting/year")
public ResultResponse<?> copyBudgeting(@AuthenticationPrincipal UserInfo loginUser, @RequestBody BudgetDto.BudgetingCopyReqeust requestDto) {
budgetService.copyYearBudgeting(loginUser, requestDto);
return new ResultResponse().successResponse(ResultResponseCode.SUCCESS);
}
// 예산편성 - 연도 삭제
@DeleteMapping("/budgeting/year")
public ResultResponse<?> deleteYearBudgeting(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.BudgetingCopyReqeust requestDto) {
budgetService.deleteBudgetingYear(loginUser, requestDto);
return new ResultResponse().successResponse(ResultResponseCode.SUCCESS);
}
//예산편성 - 항목추가/변경 모달(버튼)
@GetMapping("/budgeting/modal/edit")
public ModelAndView editModal(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.BudgetingInsertReqeust requestDto) {
ModelAndView mav = new ModelAndView("budget/budgetingEditModal");
// System.out.println(requestDto.getNameL1());
if (requestDto.getNameL1() != null) {
mav.addObject("info", requestDto);
mav.addObject("cmd", "update");
} else {
mav.addObject("info");
mav.addObject("cmd", "insert");
}
return mav;
}
//예산편성 - 항목추가
@PostMapping("/budgeting/code")
public ResultResponse<?> insertBudgeting(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.BudgetingInsertReqeust requestDto) {
budgetService.insertBudgetingList(loginUser, requestDto);
return new ResultResponse().successResponse(ResultResponseCode.SUCCESS);
}
//예산편성 - 항목변경
@PutMapping("/budgeting/code")
public ResultResponse<?> updateBudgeting(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.BudgetingUpdateReqeust requestDto) {
budgetService.updateBudgetingList(loginUser, requestDto);
return new ResultResponse().successResponse(ResultResponseCode.SUCCESS);
}
//예산편성 - 항목삭제
@DeleteMapping("/budgeting/code")
public ResultResponse<?> deleteBudgeting(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.BudgetingInsertReqeust requestDto) {
budgetService.deleteBudgetingList(loginUser, requestDto);
return new ResultResponse().successResponse(ResultResponseCode.SUCCESS);
}
// 예산편성 - 예산편성 버튼(modal)
@GetMapping("/budgeting/modal/org")
public ModelAndView orgModal(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.BudgetingSearchReqeust requestDto) {
ModelAndView mav = new ModelAndView("budget/budgetingOrgModal");
List<BudgetingList> list = budgetService.selectBudgetingList(loginUser, requestDto);
mav.addObject("list", list);
mav.addObject("searchParams", requestDto);
return mav;
}
// 예산편성 - 예산편성(저장)
@PostMapping("/budgeting/save")
public ResultResponse<?> saveBudgeting(@AuthenticationPrincipal UserInfo loginUser, @RequestBody BudgetDto.BudgetingSaveReqeust requestDto) {
budgetService.saveBudgetingList(loginUser, requestDto);
return new ResultResponse().successResponse(ResultResponseCode.SUCCESS);
}
// 예산편성 - 예산삭제 (0원 세팅)
@DeleteMapping("/budgeting") //@AuthenticationPrincipal
public ResultResponse<?> deleteBudgeting(UserInfo loginUser, BudgetDto.BudgetingSaveReqeust requestDto) {
budgetService.deleteBudgeting(loginUser, requestDto);
return new ResultResponse().successResponse(ResultResponseCode.SUCCESS);
}
// 예산배정
@GetMapping("/assign") @GetMapping("/assign")
public ModelAndView assignPage(@AuthenticationPrincipal UserInfo loginUser){ public ModelAndView viewAssignList(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.AssignSearchReqeust requestDto, Pageable pageable) {
ModelAndView mav = new ModelAndView("budget/assign"); ModelAndView mav = new ModelAndView("budget/assign");
String userOrgCode;
if (requestDto.getYear() != null) {
userOrgCode = requestDto.getCode();
List<AssignResult> list = budgetService.selectBudgetAssignInfo(loginUser, requestDto);
mav.addObject("list", list);
} else {
// 로그인된 해당청 기본선택
userOrgCode = userInfoService.selectUserInfo(loginUser.getUserSeq()).getOgCd();
String HighOrgCode = budgetService.selectGetHighOrgCode(userOrgCode);
if (HighOrgCode == null) { // 1, 2단계시
requestDto.setCode(userOrgCode);
} else { // 3단계 이하 관서시
requestDto.setCode(HighOrgCode);
userOrgCode = HighOrgCode;
}
mav.addObject("list");
// 첫해 첫날 ~ 오늘날짜 기본세팅
LocalDate date = LocalDate.now();
String CurrentYear = String.valueOf(date.getYear()) + "-01-01";
requestDto.setStDate(LocalDate.parse(CurrentYear));
requestDto.setEdDate(date);
}
//하위청 리스트
List<CodeResult> downOrgList = budgetService.selectDownOrg(userOrgCode);
mav.addObject("downOrgList", downOrgList);
//Select box 관서 리스트
List<CodeResult> codeList = budgetService.selectGetLowerOrgCodeByName(loginUser);
mav.addObject("codeList", codeList);
mav.addObject("searchParams", requestDto);
return mav; return mav;
} }
// 예산배정 - 리스트 수정
@GetMapping("/assign/modal/edit")
public ModelAndView viewAssignModal(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.AssignSearchReqeust requestDto, Pageable pageable) {
ModelAndView mav = new ModelAndView("budget/assignEditModal");
String userOrgCode;
LocalDate date = LocalDate.now();
requestDto.setModalDate(date);
if (requestDto.getYear() != null) {
userOrgCode = requestDto.getCode();
List<AssignResult> list = budgetService.selectBudgetAssignInfo(loginUser, requestDto);
mav.addObject("list", list);
} else {
// 로그인된 해당청 기본선택
userOrgCode = userInfoService.selectUserInfo(loginUser.getUserSeq()).getOgCd();
String HighOrgCode = budgetService.selectGetHighOrgCode(userOrgCode);
if (HighOrgCode == null) { // 1, 2단계시
requestDto.setCode(userOrgCode);
} else { // 3단계 이하 관서시
requestDto.setCode(HighOrgCode);
userOrgCode = HighOrgCode;
}
mav.addObject("list");
}
//하위청 리스트
List<CodeResult> downOrgList = budgetService.selectDownOrg(userOrgCode);
mav.addObject("downOrgList", downOrgList);
List<CodeResult> codeList = budgetService.selectGetLowerOrgCodeByName(loginUser);
mav.addObject("codeList", codeList);
mav.addObject("searchParams", requestDto);
return mav;
}
// 예산배정 - 등록(저장버튼)
@PostMapping("/assign/save")
public ResultResponse<?> saveAssign(@AuthenticationPrincipal UserInfo loginUser, @RequestBody BudgetDto.AssignSaveReqeust requestDto) {
budgetService.updateAssignList(loginUser, requestDto);
return new ResultResponse().successResponse(ResultResponseCode.SUCCESS);
}
// 집행관리
@GetMapping("/expense") @GetMapping("/expense")
public ModelAndView expensePage(@AuthenticationPrincipal UserInfo loginUser){ public ModelAndView viewExpenseList(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.AssignSearchReqeust requestDto, Pageable pageable) {
ModelAndView mav = new ModelAndView("budget/expense"); ModelAndView mav = new ModelAndView("budget/expense");
String userOrgCode;
if (requestDto.getYear() != null) {
userOrgCode = requestDto.getCode();
List<ExpenseResult> list = budgetService.selectBudgetExpenseInfo(loginUser, requestDto);
mav.addObject("list", list);
} else {
// 로그인된 해당청 기본선택
userOrgCode = userInfoService.selectUserInfo(loginUser.getUserSeq()).getOgCd();
String HighOrgCode = budgetService.selectGetHighOrgCode(userOrgCode);
if (HighOrgCode == null) { // 1, 2단계시
requestDto.setCode(userOrgCode);
} else { // 3단계 이하 관서시
requestDto.setCode(HighOrgCode);
userOrgCode = HighOrgCode;
}
mav.addObject("list");
// 첫해 첫날 ~ 오늘날짜 기본세팅
LocalDate date = LocalDate.now();
String CurrentYear = String.valueOf(date.getYear()) + "-01-01";
requestDto.setStDate(LocalDate.parse(CurrentYear));
requestDto.setEdDate(date);
}
//하위청 리스트
List<CodeResult> downOrgList = budgetService.selectDownOrg(userOrgCode);
mav.addObject("downOrgList", downOrgList);
List<CodeResult> codeList = budgetService.selectGetLowerOrgCodeByName(loginUser);
mav.addObject("codeList", codeList);
mav.addObject("searchParams", requestDto);
return mav; return mav;
} }
@PostMapping("/expense")
public ResultResponse<?> saveExpense(@AuthenticationPrincipal UserInfo loginUser, @RequestBody BudgetDto.ExpenseSaveReqeust requestDto) {
budgetService.insertExpense(loginUser, requestDto);
return new ResultResponse().successResponse(ResultResponseCode.SUCCESS);
}
/* 예산편성 - 팝업화면 */
@GetMapping("/expense/modal/view")
public ModelAndView viewExpenseModal(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.ExpenseSearchReqeust requestDto, Pageable pageable) {
ModelAndView mav = new ModelAndView("budget/expenseEditModal");
List<ExpenseInfoResult> list = budgetService.selectBudgetExpense(loginUser, requestDto);
mav.addObject("list", list);
mav.addObject("searchParams", requestDto);
return mav;
}
/* 집행표 - 화면 */
@GetMapping("/stats") @GetMapping("/stats")
public ModelAndView statsPage(@AuthenticationPrincipal UserInfo loginUser){ public ModelAndView viewStatsAllList(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.StatsSearchReqeust requestDto, Pageable pageable) {
ModelAndView mav = new ModelAndView("budget/stats"); ModelAndView mav = new ModelAndView("budget/stats");
String userOrgCode;
if (requestDto.getYear() != null) {
userOrgCode = requestDto.getCode();
List<ExpenseResult> list = budgetService.selectSpGetbudgetStatOrg(loginUser, requestDto);
mav.addObject("list", list);
} else {
// 로그인된 해당청 기본선택
userOrgCode = userInfoService.selectUserInfo(loginUser.getUserSeq()).getOgCd();
String HighOrgCode = budgetService.selectGetHighOrgCode(userOrgCode);
if (HighOrgCode == null) { // 1, 2단계시
requestDto.setCode(userOrgCode);
} else { // 3단계 이하 관서시
requestDto.setCode(HighOrgCode);
userOrgCode = HighOrgCode;
}
mav.addObject("list");
// 첫해 첫날 ~ 오늘날짜 기본세팅
LocalDate date = LocalDate.now();
String CurrentYear = String.valueOf(date.getYear()) + "-01-01";
requestDto.setStDate(LocalDate.parse(CurrentYear));
requestDto.setEdDate(date);
}
//하위청 리스트
List<CodeResult> downOrgList = budgetService.selectDownOrg(userOrgCode);
mav.addObject("downOrgList", downOrgList);
List<CodeResult> codeList = budgetService.selectGetLowerOrgCodeByName(loginUser);
mav.addObject("codeList", codeList);
mav.addObject("searchParams", requestDto);
return mav; return mav;
} }
/* 집행표 - 화면 */
@GetMapping("/stats/org")
public ModelAndView viewExpenseList(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.StatsSearchReqeust requestDto, Pageable pageable) {
ModelAndView mav = new ModelAndView("budget/statsOrg");
String userOrgCode;
if (requestDto.getYear() != null) {
userOrgCode = requestDto.getCode();
List<ExpenseResult> list = budgetService.selectSpGetbudgetStatOrg(loginUser, requestDto);
mav.addObject("list", list);
} else {
// 로그인된 해당청 기본선택
userOrgCode = userInfoService.selectUserInfo(loginUser.getUserSeq()).getOgCd();
String HighOrgCode = budgetService.selectGetHighOrgCode(userOrgCode);
if (HighOrgCode == null) { // 1, 2단계시
requestDto.setCode(userOrgCode);
} else { // 3단계 이하 관서시
requestDto.setCode(HighOrgCode);
userOrgCode = HighOrgCode;
}
mav.addObject("list");
// 첫해 첫날 ~ 오늘날짜 기본세팅
LocalDate date = LocalDate.now();
String CurrentYear = String.valueOf(date.getYear()) + "-01-01";
requestDto.setStDate(LocalDate.parse(CurrentYear));
requestDto.setEdDate(date);
}
//하위청 리스트
List<CodeResult> downOrgList = budgetService.selectDownOrg(userOrgCode);
mav.addObject("downOrgList", downOrgList);
List<CodeResult> codeList = budgetService.selectGetLowerOrgCodeByName(loginUser);
mav.addObject("codeList", codeList);
mav.addObject("searchParams", requestDto);
return mav;
}
/* 세부내역별현황 - 화면 */
@GetMapping("/stats/detail")
public ModelAndView viewStatsDetailList(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.StatsSearchReqeust requestDto, Pageable pageable) {
ModelAndView mav = new ModelAndView("budget/statsDetail");
List<YearResult> yearList = budgetService.selectBudgetingYearList(loginUser);
if (requestDto.getStDate() != null) {
List<StatsItemResult> list = budgetService.selectSpGetbudgetStatDetail(loginUser, requestDto);
List<L3CodeResult> codeList = budgetService.selectSpGetL3Code(loginUser, requestDto.getYear());
mav.addObject("list", list);
mav.addObject("codeList", codeList);
} else {
LocalDate date = LocalDate.now();
List<L3CodeResult> codeList = budgetService.selectSpGetL3Code(loginUser, String.valueOf(date.getYear()));
requestDto.setYear(String.valueOf(date.getYear()));
mav.addObject("list");
mav.addObject("codeList", codeList);
// 첫해 첫날 ~ 오늘날짜 기본세팅
String CurrentYear = String.valueOf(date.getYear()) + "-01-01";
requestDto.setStDate(LocalDate.parse(CurrentYear));
requestDto.setEdDate(date);
}
List<CodeResult> codeList = budgetService.selectGetLowerOrgCodeByName(loginUser);
mav.addObject("yearList", yearList);
mav.addObject("searchParams", requestDto);
return mav;
}
@GetMapping("/stats/code")
@ResponseBody
public List<L3CodeResult> selectCodeL3(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.L3CodeRequest requestDto) {
List<L3CodeResult> list = budgetService.selectSpGetL3Code(loginUser, requestDto.getYear());
return list;
}
} }

View File

@ -0,0 +1,18 @@
package com.dbnt.faisp.main.budget.common;
import com.dbnt.faisp.main.budget.common.ResultResponseCode;
public class BaseException extends RuntimeException {
private static final long serialVersionUID = 163922632784183581L;
private ResultResponseCode code;
public BaseException(ResultResponseCode code) {
this.code = code;
}
public ResultResponseCode getCode(){
return code;
}
}

View File

@ -0,0 +1,53 @@
package com.dbnt.faisp.main.budget.common;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.Collections;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
@AllArgsConstructor
@Getter
public enum ResultResponseCode {
SUCCESS(200, "정상처리되었습니다.","Success"),
DATA_NOT_FOUND(604, "존재하지 않는 데이터입니다.","InternalNotFound"),
FORBIDDEN(403,"해당요청에 대한 권한이 없습니다.","Forbidden"),
PARAM_NOT_NULL(900, " - 필수 입력 사항입니다.", "NotNull"),
PARAM_NOT_EMPTY(900, " - 필수 입력 사항입니다.", "NotEmpty"),
INTERNAL_PARAM_EMPTY(900, "필수 항목이 누락되었습니다.", "InternalParamEmpty"),
FILE_EMPTY(900, "필수 파일이 존재하지 않습니다.", "FileEmpty"),
PARAM_PERMIT_TYPE(901, "잘못된 형식의 데이터입니다.", "ParamType"),
NOT_FOUND_SENDER(903, "발송대상이 없습니다.","NotFoundSender"),
TYPE_MISMATCH(905, "잘못된 형식의 데이터입니다..", "typeMismatch"),
DUPLICATE_CODE(906, "이미 등록된 코드명칭입니다.", "DuplicateCode"),
DELETE_FOUND_VALUE(907, "예산표에 값이 있습니다. 예산삭제 후 해당 코드를 삭제하십시요.", "DELETE_FOUND_VALUE"),
NOT_FOUND_CODE(908, "없는 코드 또는 명칭입니다." ,"NotFoundCodE"),
NOT_FOUND_YEAR(909 , " 없는 연도의 코드입니다.", "NotFoundYear"),
FOUND_YEAR(910, "이미 등록되어 있는 연도의 코드입니다.", "FoundYear"),
EXPENSE_OVER_VALUE(911, "총 지출금액이 배정된 예산보다 큽니다.", "ExepenseOverValue"),
ERROR(999, "오류가 발생하였습니다.","ERROR");
private static final Map<String, String> CODE_MAP = Collections.unmodifiableMap(Stream.of(values()).collect(Collectors.toMap(ResultResponseCode::getType, ResultResponseCode::name)));
private int code;
private String message;
private String type;
public static ResultResponseCode of(final String code) {
try {
return ResultResponseCode.valueOf(CODE_MAP.get(code));
}catch(NullPointerException NPE) {
return ResultResponseCode.valueOf("ERROR");
}
}
}

View File

@ -0,0 +1,158 @@
package com.dbnt.faisp.main.budget.model;
import com.dbnt.faisp.config.BaseModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
public class BudgetDto {
@Data
@AllArgsConstructor
@ToString
public static class BudgetingListResponse {
private String budget_name_l1;
private String budget_name_l2;
private String budget_name_l3;
}
@Data
@AllArgsConstructor
@ToString
public static class BudgetingSearchReqeust {
private String year;
private Long sum;
}
@Data
@AllArgsConstructor
@ToString
public static class BudgetingInsertReqeust {
private String year;
private String nameL1;
private String nameL2;
private String nameL3;
}
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public static class BudgetingSaveReqeust {
private String year;
private String nameL1;
private String nameL2;
private String nameL3;
private Integer amount;
}
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public static class AssignSaveReqeust {
private String year;
private String code;
private Integer amount;
private String org;
private String org1;
}
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public static class BudgetingCopyReqeust {
private String year;
private String copyYear;
}
@Data
@AllArgsConstructor
@ToString
public static class BudgetingUpdateReqeust {
private String year;
private String nameL1;
private String nameL2;
private String nameL3;
private String prevNameL1;
private String prevNameL2;
private String prevNameL3;
}
@Data
@AllArgsConstructor
@ToString
public static class AssignSearchReqeust {
private String year;
private String code;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate stDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate edDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate modalDate;
}
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public static class ExpenseSaveReqeust {
private String year;
private String nameL1;
private String nameL2;
private String nameL3;
private String item;
private Integer amount;
private String org;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate expenseDate;
}
@Data
@AllArgsConstructor
@ToString
public static class StatsSearchReqeust {
private String year;
private String code;
private String item;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate stDate;
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate edDate;
private Integer won;
}
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public static class ExpenseSearchReqeust {
private String year;
private String nameL1;
private String nameL2;
private String nameL3;
private Integer amount;
}
@Data
@AllArgsConstructor
@ToString
public static class L3CodeRequest {
private String year;
}
}

View File

@ -0,0 +1,37 @@
package com.dbnt.faisp.main.budget.model;
import com.dbnt.faisp.main.budget.common.ResultResponseCode;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class ResultResponse<T> {
private int code;
private String message;
private T data;
public ResultResponse(int code, String message) {
this.code = code;
this.message = message;
}
public ResultResponse(ResultResponseCode responseCode) {
this.code = responseCode.getCode();
this.message = responseCode.getMessage();
}
public ResultResponse<?> successResponse(T data) {
this.code = ResultResponseCode.SUCCESS.getCode();
this.message = ResultResponseCode.SUCCESS.getMessage();
this.data = data;
return new ResultResponse<>(this.code, this.message, this.data);
}
}

View File

@ -0,0 +1,346 @@
package com.dbnt.faisp.main.budget.repository;
import com.dbnt.faisp.main.codeMgt.model.CodeCatg;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import java.sql.Date;
import java.util.List;
@Repository
public interface BudgetRepository extends JpaRepository<CodeCatg, String> {
@Query(value = " select "
+ "budget_name_l1 as budgetNameL1,"
+ "budget_name_l2 as budgetNameL2,"
+ "budget_name_l3 as budgetNameL3,"
+ "budget_code_l3 as budgetCodeL3,"
+ "amount,"
+ "remark,"
+ "modi_id as modiId,"
+ "modi_date as modiDate "
+ " from public.sp_get_budget_plan_info(:code1, :code2, :code3) ", nativeQuery = true)
List<BudgetingList> callSpGetBudgetPlanInfo(
@Param("code1") String code1,
@Param("code2") String code2,
@Param("code3") String code3);
//(공통) - 생선된 년도 (셀렉트박스)
@Query(value ="select l1_year as year from public.sp_get_budget_code_year_list( );", nativeQuery = true)
List<YearResult> callSpGetBudgetCodeYearList();
//예산편성 - 연도추가
@Query(value ="call public.sp_copy_budget_item (:year,:copyYear,:id,NULL,NULL,NULL);", nativeQuery = true)
UpdateResult callSpCopyBudgetItem(
@Param("year") String year,
@Param("copyYear") String org,
@Param("id") String id);
//예산편성 - 연도삭제
@Query(value ="call public.sp_brute_force_delete_budget_item(:year, :id,NULL,NULL,NULL);", nativeQuery = true)
UpdateResult callBruteForceDeleteBudgetItem(
@Param("year") String year,
@Param("id") String id);
//예산편성 - 항목추가
@Query(value ="call public.sp_add_budget_plan_codename (:year, :code1, :code2, :code3, :org, :id ,NULL, NULL, NULL);", nativeQuery = true)
UpdateResult callSpAddBudgetPlanCodeName(
@Param("year") String year,
@Param("code1") String nameL1,
@Param("code2") String nameL2,
@Param("code3") String nameL3,
@Param("org") String org,
@Param("id") String id);
//예산편성 - 항목변경
@Query(value ="call public.sp_update_budget_plan_codename(:year, :code1, :code2, :code3, :newCode1, :newCode2, :newCode3, :org,:id,NULL,NULL,NULL);", nativeQuery = true)
UpdateResult callSpUpdateBudgetPlanCodeName(
@Param("year") String year,
@Param("code1") String prevNameL1,
@Param("code2") String prevNameL2,
@Param("code3") String prevNameL3,
@Param("newCode1") String nameL1,
@Param("newCode2") String nameL2,
@Param("newCode3") String nameL3,
@Param("org") String org,
@Param("id") String id);
//예산편성 - 항목삭제
@Query(value ="call public.sp_delete_budget_plan_codename(:year, :code1, :code2, :code3, :org,:id,NULL,NULL,NULL);", nativeQuery = true)
UpdateResult callSpDeleteBudgetPlanCodeName(
@Param("year") String year,
@Param("code1") String nameL1,
@Param("code2") String nameL2,
@Param("code3") String nameL3,
@Param("org") String org,
@Param("id") String id);
//예산편성 - 예산저장
@Query(value ="call public.sp_update_budget_plan_item (:year, :code1, :code2, :code3, :amount, :org, :id,NULL, NULL, NULL);", nativeQuery = true)
UpdateResult callSpUpdateBudgetPlanCodeItem(
@Param("year") String year,
@Param("code1") String nameL1,
@Param("code2") String nameL2,
@Param("code3") String nameL3,
@Param("amount") Integer amount,
@Param("org") String org,
@Param("id") String id);
//예산편성 - 예산삭제
@Query(value ="call public.sp_clear_budget_plan(:year, :org, :id,NULL,NULL,NULL);", nativeQuery = true)
UpdateResult callSpDeleteBudgetPlan(
@Param("year") String year,
@Param("org") String org,
@Param("id") String id);
// 예산배정
@Query(value ="select * from public.sp_get_budget_assign_info(:year, :code, :user ,:stDate, :edDate)", nativeQuery = true)
List<AssignResult> callSpGetBudgetAssignInfo(
@Param("year") String year,
@Param("code") String code,
@Param("user") String user,
@Param("stDate") Date stDate,
@Param("edDate") Date edDate
);
//(공통) 2단계로 하위청 뿌려주기
@Query(value ="select org_code as orgCode, org_name as orgName from public.sp_get_down_org(:org);", nativeQuery = true)
List<CodeResult> callSpGetDownOrg(
@Param("org") String org
);
//
@Query(value ="select org_code as orgCode, org_name as orgName from public.sp_get_lower_org_code_by_name('본청');", nativeQuery = true)
List<CodeResult> callSpGetLowerOrgCodeByName(
);
//상위 기관 코드 가져오기 (3단계인경우만)
@Query(value ="select * from public.sp_get_high_org_code(:org);", nativeQuery = true)
String callSpGetHighOrgCode(
@Param("org") String org
);
// 예산배정 - 등록(저장버튼)
@Query(value ="call public.sp_add_budget_assign(:code, :org, :org1, cast (:amount as bigint), to_date(:dt,'YYYY-MM-DD'), 'admin', NULL,NULL,NULL);", nativeQuery = true)
UpdateResult callSpAddBudgetAssign(
@Param("code") String year,
@Param("org") String org,
@Param("org1") String org1,
@Param("amount") Integer amount,
@Param("dt") String dt);
// 집행관리
@Query(value ="select * from public.sp_get_budget_expense_info(:year,:code,:user,:stDate,:edDate);", nativeQuery = true)
List<ExpenseResult> callSpGetBudgetExpenseInfo(
@Param("year") String year,
@Param("code") String code,
@Param("user") String user,
@Param("stDate") Date stDate,
@Param("edDate") Date edDate
);
@Query(value ="select * from public.sp_get_budget_expense(:year,:code1,:code2,:code3,:org,1,2,20,1);", nativeQuery = true)
List<ExpenseInfoResult> callSpGetBudgetExpense(
@Param("year") String year,
@Param("code1") String code1,
@Param("code2") String code2,
@Param("code3") String code3,
@Param("org") String org
);
@Query(value ="call public.sp_add_budget_EXPENSE(:year,:code1,:code2,:code3, :org, :item ,cast (:amount as bigint), to_date(:dt,'YYYY-MM-DD'),'admin',NULL,NULL,NULL);", nativeQuery = true)
UpdateResult callSpAddBudgetExpense(
@Param("year") String year,
@Param("code1") String code1,
@Param("code2") String code2,
@Param("code3") String code3,
@Param("org") String org,
@Param("item") String item,
@Param("amount") Integer amount,
@Param("dt") Date dt
);
@Query(value ="call public.sp_update_budget_expense(:seq,:item ,cast (:amount as bigint),NULL,NULL,NULL,NULL,NULL);;", nativeQuery = true)
List<ExpenseResult> callSpUpdateBudgetExpense(
@Param("seq") Integer seq,
@Param("item") String item,
@Param("amount") Integer amount
);
@Query(value ="select * from public.sp_get_budget_statistics_by_org(:year,:code,:user,:stDate,:edDate,:won);", nativeQuery = true)
List<ExpenseResult> callSpGetbudgetStatOrg(
@Param("year") String year,
@Param("code") String code,
@Param("user") String user,
@Param("stDate") Date stDate,
@Param("edDate") Date edDate,
@Param("won") int won
);
@Query(value ="select * from public.sp_get_budget_statistics_by_item(:year,:code,:item, :user,:stDate,:edDate,:won);", nativeQuery = true)
List<StatsItemResult> callSpGetbudgetStatDetail(
@Param("year") String year,
@Param("code") String code,
@Param("item") String item,
@Param("user") String user,
@Param("stDate") Date stDate,
@Param("edDate") Date edDate,
@Param("won") int won
);
@Query(value ="select * from public.sp_get_budget_code_l3(:year,null,null,null);", nativeQuery = true)
List<L3CodeResult> callSpGetBudgetCodeL3(
@Param("year") String year
);
public static interface BudgetingList {
String getBudgetNameL1();
String getBudgetNameL2();
String getBudgetNameL3();
String getBudgetCodeL3();
Integer getAmount();
String getRemark();
String getModiId();
String getModiDate();
}
public static interface UpdateResult {
Integer get_result_count();
String get_result_code();
String get_error_message();
}
public static interface YearResult {
String getYear();
}
public static interface AssignResult {
String getorg_count();
String getbudget_name_l1();
String getbudget_name_l2();
String getbudget_name_l3();
String getbudget_code_l3();
String getplan_amount();
String gettotal_assign_amount();
String getperiod_assign_amount1();
String getsum_assign_amount1();
String getperiod_assign_amount2();
String getsum_assign_amount2();
String getperiod_assign_amount3();
String getsum_assign_amount3();
String getperiod_assign_amount4();
String getsum_assign_amount4();
String getperiod_assign_amount5();
String getsum_assign_amount5();
String getperiod_assign_amount6();
String getsum_assign_amount6();
String getperiod_assign_amount7();
String getsum_assign_amount7();
String getperiod_assign_amount8();
String getsum_assign_amount8();
String getperiod_assign_amount9();
String getsum_assign_amount9();
}
public static interface L3CodeResult {
String getl3_name();
String getl3_code();
}
public static interface StatsItemResult {
String getorg_name();
String getplan_amount();
String gettotal_assign_amount();
String getexpense_t_amount();
String getbalance_t_amount();
String getexpense_total_rate();
}
public static interface ExpenseResult {
String getorg_count();
String getbudget_name_l1();
String getbudget_name_l2();
String getbudget_name_l3();
String getbudget_code_l3();
String getplan_amount();
String gettotal_assign_amount();
String getexpense_t_amount();
String getbalance_t_amount();
Integer getperiod_assign_amount1();
Integer getexpense_p_amount1();
Integer getblance_amount1();
Integer getexpense_rate1();
String getperiod_assign_amount2();
String getexpense_p_amount2();
String getblance_amount2();
String getexpense_rate2();
String getperiod_assign_amount3();
String getexpense_p_amount3();
String getblance_amount3();
String getexpense_rate3();
String getperiod_assign_amount4();
String getexpense_p_amount4();
String getblance_amount4();
String getexpense_rate4();
String getperiod_assign_amount5();
String getexpense_p_amount5();
String getblance_amount5();
String getexpense_rate5();
String getperiod_assign_amount6();
String getexpense_p_amount6();
String getblance_amount6();
String getexpense_rate6();
String getperiod_assign_amount7();
String getexpense_p_amount7();
String getblance_amount7();
String getexpense_rate7();
String getperiod_assign_amount8();
String getexpense_p_amount8();
String getblance_amount8();
String getexpense_rate8();
String getperiod_assign_amount9();
String getexpense_p_amount9();
String getblance_amount9();
String getexpense_rate9();
}
public static interface ExpenseInfoResult {
String getseq();
String getexpense_date();
String getexpense_item();
String getamount();
String getmodi_id();
String getmodi_date();
}
public static interface CodeResult {
String getOrgName();
String getOrgCode();
}
}

View File

@ -0,0 +1,299 @@
package com.dbnt.faisp.main.budget.service;
import com.dbnt.faisp.main.budget.common.BaseException;
import com.dbnt.faisp.main.budget.common.ResultResponseCode;
import com.dbnt.faisp.main.budget.model.BudgetDto;
import com.dbnt.faisp.main.budget.repository.BudgetRepository;
import com.dbnt.faisp.main.budget.repository.BudgetRepository.*;
import com.dbnt.faisp.main.equip.model.Equip;
import com.dbnt.faisp.main.userInfo.model.UserInfo;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
@Service
@Transactional
@RequiredArgsConstructor
public class BudgetService {
private final BudgetRepository budgetRepository;
public List<BudgetingList> selectBudgetingList(UserInfo loginUser, BudgetDto.BudgetingSearchReqeust requestDto){
return budgetRepository.callSpGetBudgetPlanInfo(requestDto.getYear(), "OG001", "admin");
}
public List<YearResult> selectBudgetingYearList(UserInfo loginUser){
return budgetRepository.callSpGetBudgetCodeYearList();
}
// 예산편성 - 연도추가(버튼)
@Transactional
public void copyYearBudgeting(UserInfo loginUser, BudgetDto.BudgetingCopyReqeust requestDto){
// System.out.println(requestDto.getYear());
// System.out.println(requestDto.getCopyYear());
UpdateResult result = budgetRepository.callSpCopyBudgetItem(requestDto.getYear(), requestDto.getCopyYear(), loginUser.getUserId());
if(result.get_result_code().equals("100")) {
return;
} else {
System.out.println(result.get_error_message());
System.out.println(result.get_result_code());
System.out.println(result.get_result_count());
throw new BaseException(ResultResponseCode.FOUND_YEAR);
}
}
//예산편성 - 연도삭제(버튼)
@Transactional
public void deleteBudgetingYear(UserInfo loginUser, BudgetDto.BudgetingCopyReqeust requestDto){
// System.out.println(requestDto.getYear());
// System.out.println(requestDto.getCopyYear());
UpdateResult result = budgetRepository.callBruteForceDeleteBudgetItem(requestDto.getYear(), "admin");
if(result.get_result_code().equals("100")) {
return;
}else if( result.get_result_code().equals("93")){
System.out.println(result.get_error_message());
System.out.println(result.get_result_code());
System.out.println(result.get_result_count());
throw new BaseException(ResultResponseCode.NOT_FOUND_YEAR);
} else {
System.out.println(result.get_error_message());
System.out.println(result.get_result_code());
System.out.println(result.get_result_count());
throw new BaseException(ResultResponseCode.DELETE_FOUND_VALUE);
}
}
//예산편성 - 항목추가
@Transactional
public void insertBudgetingList(UserInfo loginUser, BudgetDto.BudgetingInsertReqeust requestDto){
System.out.println(requestDto.getYear());
System.out.println(requestDto.getNameL1());
System.out.println(requestDto.getNameL2());
System.out.println(requestDto.getNameL3());
UpdateResult result = budgetRepository.callSpAddBudgetPlanCodeName(requestDto.getYear(),requestDto.getNameL1(),requestDto.getNameL2(),requestDto.getNameL3(), "OG001", "admin");
System.out.println(result.get_error_message());
System.out.println(result.get_result_code());
System.out.println(result.get_result_count());
if(result.get_result_code().equals("100")) {
return;
} else {
throw new BaseException(ResultResponseCode.DUPLICATE_CODE);
}
}
//예산편성 - 항목변경
public void updateBudgetingList(UserInfo loginUser, BudgetDto.BudgetingUpdateReqeust requestDto){
System.out.println(requestDto.getYear()+","+ requestDto.getPrevNameL1()+","+requestDto.getPrevNameL2()+","+requestDto.getPrevNameL3()+","+requestDto.getNameL1()+","+requestDto.getNameL2()+","+requestDto.getNameL3());
UpdateResult result = budgetRepository.callSpUpdateBudgetPlanCodeName( requestDto.getYear(), requestDto.getPrevNameL1(), requestDto.getPrevNameL2(), requestDto.getPrevNameL3(),requestDto.getNameL1(),requestDto.getNameL2(),requestDto.getNameL3(), "OG001", "admin");
System.out.println(result.get_error_message());
System.out.println(result.get_result_code());
System.out.println(result.get_result_count());
System.out.println(result);
if(result.get_result_code().equals("100")) {
return;
} else if (result.get_result_code().equals("91")) {
throw new BaseException(ResultResponseCode.DUPLICATE_CODE);
}
}
//예산편성 - 항목삭제
public void deleteBudgetingList(UserInfo loginUser, BudgetDto.BudgetingInsertReqeust requestDto){
System.out.println(requestDto.getYear());
System.out.println(requestDto.getNameL1());
System.out.println(requestDto.getNameL2());
System.out.println(requestDto.getNameL3());
UpdateResult result = budgetRepository.callSpDeleteBudgetPlanCodeName(requestDto.getYear(),requestDto.getNameL1(),requestDto.getNameL2(),requestDto.getNameL3(), "OG001", "admin");
System.out.println(result.get_error_message());
System.out.println(result.get_result_code());
System.out.println(result.get_result_count());
if(result.get_result_code().equals("100")) {
return;
} else {
throw new BaseException(ResultResponseCode.DELETE_FOUND_VALUE);
}
}
// 예산편성 - 예산편성 저장(modal)
@Transactional
public void saveBudgetingList(UserInfo loginUser, BudgetDto.BudgetingSaveReqeust requestDto){
// System.out.println(requestDto.getAmount());
// System.out.println(requestDto.getNameL1());
// System.out.println(requestDto.getNameL2());
// System.out.println(requestDto.getNameL3());
UpdateResult result = budgetRepository.callSpUpdateBudgetPlanCodeItem(requestDto.getYear(), requestDto.getNameL1(),requestDto.getNameL2(),requestDto.getNameL3(), requestDto.getAmount(),"OG001", "admin");
// System.out.println(result.get_error_message());
// System.out.println(result.get_result_code());
// System.out.println(result.get_result_count());
if(result.get_result_code().equals("100")) {
return;
} else {
System.out.println(result.get_error_message());
System.out.println(result.get_result_code());
System.out.println(result.get_result_count());
throw new BaseException(ResultResponseCode.DUPLICATE_CODE);
}
}
//예산편성 - 예산삭제(버튼)
@Transactional
public void deleteBudgeting(UserInfo loginUser, BudgetDto.BudgetingSaveReqeust requestDto){
// System.out.println(requestDto.getYear());
// System.out.println(requestDto.getNameL1());
// System.out.println(requestDto.getNameL2());
// System.out.println(requestDto.getNameL3());
UpdateResult result = budgetRepository.callSpDeleteBudgetPlan(requestDto.getYear(), "OG001", "admin");
if(result.get_result_code().equals("100")) {
return;
} else {
System.out.println(result.get_error_message());
System.out.println(result.get_result_code());
System.out.println(result.get_result_count());
throw new BaseException(ResultResponseCode.NOT_FOUND_CODE);
}
}
// 예산배정
public List<AssignResult> selectBudgetAssignInfo(UserInfo loginUser, BudgetDto.AssignSearchReqeust requestDto){
// System.out.println(requestDto.getCode());
// System.out.println(requestDto.getYear());
// System.out.println(requestDto.getStDate());
// System.out.println(requestDto.getEdDate());
return budgetRepository.callSpGetBudgetAssignInfo(requestDto.getYear(), requestDto.getCode(), "admin", java.sql.Date.valueOf(requestDto.getStDate()),java.sql.Date.valueOf(requestDto.getEdDate()));
}
//(공통) 2단계로 하위청 뿌려주기
public List<CodeResult> selectDownOrg(String userOrgCode){
return budgetRepository.callSpGetDownOrg(userOrgCode);
}
//
public List<CodeResult> selectGetLowerOrgCodeByName(UserInfo loginUser){
return budgetRepository.callSpGetLowerOrgCodeByName();
}
//상위 기관 코드 가져오기 (3단계인경우만)
public String selectGetHighOrgCode(String userOrgCode){
return budgetRepository.callSpGetHighOrgCode(userOrgCode);
}
// 예산배정 - 등록(저장버튼)
@Transactional
public void updateAssignList(UserInfo loginUser, BudgetDto.AssignSaveReqeust requestDto){
System.out.println(requestDto.getCode());
System.out.println(requestDto.getOrg());
System.out.println(requestDto.getYear());
// System.out.println(requestDto.getAmount());
UpdateResult result = budgetRepository.callSpAddBudgetAssign(requestDto.getCode(),requestDto.getOrg(),requestDto.getOrg1(), requestDto.getAmount(), "2023-03-15");
System.out.println(result.get_error_message());
System.out.println(result.get_result_code());
System.out.println(result.get_result_count());
if(result.get_result_code().equals("100")) {
return;
}else if(result.get_result_code().equals("72")) {
System.out.println(result.get_error_message());
System.out.println(result.get_result_code());
System.out.println(result.get_result_count());
throw new BaseException(ResultResponseCode.EXPENSE_OVER_VALUE);
} else {
System.out.println(result.get_error_message());
System.out.println(result.get_result_code());
System.out.println(result.get_result_count());
throw new BaseException(ResultResponseCode.DUPLICATE_CODE);
}
}
//집행관리
public List<ExpenseResult> selectBudgetExpenseInfo(UserInfo loginUser, BudgetDto.AssignSearchReqeust requestDto){
System.out.println(requestDto.getYear());
System.out.println(requestDto.getCode());
System.out.println(java.sql.Date.valueOf(requestDto.getStDate()));
System.out.println(requestDto.getEdDate());
return budgetRepository.callSpGetBudgetExpenseInfo(requestDto.getYear(), requestDto.getCode(), "admin", java.sql.Date.valueOf(requestDto.getStDate()),java.sql.Date.valueOf(requestDto.getEdDate()));
}
public List<ExpenseInfoResult> selectBudgetExpense(UserInfo loginUser, BudgetDto.ExpenseSearchReqeust requestDto){
System.out.println(requestDto.getYear());
System.out.println(requestDto.getNameL1());
System.out.println(requestDto.getNameL2());
System.out.println(requestDto.getNameL3());
return budgetRepository.callSpGetBudgetExpense(requestDto.getYear(), requestDto.getNameL1(), requestDto.getNameL2(), requestDto.getNameL3(), "본청");
}
@Transactional
public void insertExpense(UserInfo loginUser, BudgetDto.ExpenseSaveReqeust requestDto){
// System.out.println(requestDto.getYear());
// System.out.println(requestDto.getNameL1());
// System.out.println(requestDto.getNameL2());
// System.out.println(requestDto.getNameL3());
UpdateResult result = budgetRepository.callSpAddBudgetExpense(requestDto.getYear(),requestDto.getNameL1(),requestDto.getNameL2(),requestDto.getNameL3(), "본청", requestDto.getItem(), requestDto.getAmount(), java.sql.Date.valueOf(requestDto.getExpenseDate()));
System.out.println(result.get_error_message());
System.out.println(result.get_result_code());
System.out.println(result.get_result_count());
if(result.get_result_code().equals("100")) {
return;
}else if(result.get_result_code().equals("71")) {
throw new BaseException(ResultResponseCode.EXPENSE_OVER_VALUE);
} else {
throw new BaseException(ResultResponseCode.ERROR);
}
}
public List<ExpenseResult> selectSpGetbudgetStatOrg(UserInfo loginUser,BudgetDto.StatsSearchReqeust requestDto){
System.out.println(requestDto.getYear());
System.out.println(requestDto.getCode());
System.out.println(java.sql.Date.valueOf(requestDto.getStDate()));
System.out.println(requestDto.getEdDate());
System.out.println(requestDto.getWon());
return budgetRepository.callSpGetbudgetStatOrg(requestDto.getYear(), requestDto.getCode(), "admin", java.sql.Date.valueOf(requestDto.getStDate()), java.sql.Date.valueOf(requestDto.getEdDate()), requestDto.getWon());
}
public List<StatsItemResult> selectSpGetbudgetStatDetail(UserInfo loginUser,BudgetDto.StatsSearchReqeust requestDto){
System.out.println(requestDto.getYear());
System.out.println(requestDto.getCode());
System.out.println(java.sql.Date.valueOf(requestDto.getStDate()));
System.out.println(requestDto.getEdDate());
System.out.println(requestDto.getWon());
return budgetRepository.callSpGetbudgetStatDetail(requestDto.getYear(), requestDto.getCode(), requestDto.getItem(), "admin", java.sql.Date.valueOf(requestDto.getStDate()), java.sql.Date.valueOf(requestDto.getEdDate()), requestDto.getWon());
}
public List<L3CodeResult> selectSpGetL3Code(UserInfo loginUser,String year){
return budgetRepository.callSpGetBudgetCodeL3(year);
}
// public void insertBudgetingYear(UserInfo loginUser, BudgetDto.BudgetingUpdateReqeust requestDto){
// UpdateResult result = budgetRepository.callSpUpdateBudgetPlanCodeName( requestDto.getPrevNameL1(), requestDto.getPrevNameL2(), requestDto.getPrevNameL3(),requestDto.getYear(),requestDto.getNameL1(),requestDto.getNameL2(),requestDto.getNameL3(), "OG001", "admin");
// System.out.println(result);
// }
//
// public void deleteBudgetingYear(UserInfo loginUser, BudgetDto.BudgetingUpdateReqeust requestDto){
// UpdateResult result = budgetRepository.callSpUpdateBudgetPlanCodeName( requestDto.getPrevNameL1(), requestDto.getPrevNameL2(), requestDto.getPrevNameL3(),requestDto.getYear(),requestDto.getNameL1(),requestDto.getNameL2(),requestDto.getNameL3(), "OG001", "admin");
// System.out.println(result);
// }
}

View File

@ -0,0 +1,388 @@
$(function(){
$("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
})
$(document).on('click', '#addBtn', function (){
if($("#assignlistcnt").val() == 0){
alert('조회된 내역이 없습니다.');
return;
}
getEditModal(0)
})
$(document).ready(function(){
if ($("#ResultRow").text().trim() == "") {
assignSearch();
} else {
WithoutMask();
}
});
$(document).on('click', '#assignsearchBtn', function () {
assignSearch();
})
function assignSearch() {
let stDate = $("#stDate").val()
let edDate = $("#edDate").val()
if ($("#stDate").val() == "") {
alert('시작일을 선택해주세요');
return;
}
if ($("#edDate").val() == "") {
alert('종료일을 선택해주세요');
return;
}
stDate = new Date(stDate);
edDate = new Date(edDate);
if (stDate.getFullYear() != edDate.getFullYear()) {
alert('같은 년도의 데이터만 조회가능합니다. ex)2021-01-01 ~ 2021-12-31');
return;
}
$("#year").val(stDate.getFullYear());
LoadingWithMask();
location.href = "/budget/assign?year=" + $("#year").val() + "&stDate=" + $("#stDate").val() + "&edDate=" + $("#edDate").val() + "&code=" + $("#code").val();
}
$(document).on('click', '#deleteBtn', function (){
if($("input[name='budget']:checked").val() == undefined || $("input[name='budget']:checked").val()==null){
alert('삭제할 항목을 선택해주세요');
return;
}
console.dir($("input[name='budget']:checked")[0].dataset.name1);
console.dir($("input[name='budget']:checked")[0].dataset.name2);
console.dir($("input[name='budget']:checked")[0].dataset.name3);
if(confirm('삭제하시겠습니까?')){
let params = {};
params.year = $("#searchYear").val();
params.nameL1 = $("input[name='budget']:checked")[0].dataset.name1;
params.nameL2 = $("input[name='budget']:checked")[0].dataset.name2;
params.nameL3 = $("input[name='budget']:checked")[0].dataset.name3;
console.dir(params);
$.ajax({
type : 'DELETE',
data : params,
url : "/budget/budgeting/code",
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function(data) {
if(data.code == "200"){
alert("삭제되었습니다.");
location.reload();
}else{
alert(data.message);
}
//location.reload();
},
error : function(xhr) {
alert("삭제에 실패하였습니다.");
}
})
}
})
$(document).on('click', '#updateBtn', function (){
if($("input[name='budget']:checked").val() == undefined || $("input[name='budget']:checked").val()==null){
alert('수정할 항목을 선택해주세요');
return;
}
params = {}
params.year = $("#searchYear").val()
params.nameL1 = $("input[name='budget']:checked")[0].dataset.name1;
params.nameL2 = $("input[name='budget']:checked")[0].dataset.name2;
params.nameL3 = $("input[name='budget']:checked")[0].dataset.name3;
$.ajax({
url: '/budget/budgeting/modal/edit',
data: params,
type: 'GET',
dataType:"html",
success: function(html){
$("#editModalContent").empty().append(html);
$("#year").val($("#searchYear").val())
$(".dateSelector").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
$("#editModal").modal('show');
},
error:function(){
}
});
})
//
// function getList(){
// $.ajax({
// type : 'GET',
// data : {},
// url : "/pds/ship/list",
// processData: false,
// contentType: false,
// beforeSend: function (xhr){
// xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
// },
// success : function(response) {
// console.dir(response)
//
// },
// error : function() {
// alert("저장에 실패하였습니다.");
// },
// complete : function () {
// loaddingOff();
// }
// })
// }
// function getViewModal(no){
// params = {}
// params.no = no;
// $.ajax({
// url: '/pds/ship/modal/view',
// data: params,
// type: 'GET',
// dataType:"html",
// success: function(html){
// $("#editModalContent").empty().append(html);
// $(".dateSelector").datepicker({
// format: "yyyy-mm-dd",
// language: "ko",
// autoclose: true
// });
// $("#editModal").modal('show');
// },
// error:function(){
//
// }
// });
// }
// $(document).on('click', '.grid', function(event) {
// const target = event.target;
// const no = (Number($(this).find(".key").val()));
//
// })
function getEditModal(no){
params = {}
params.stDate = $("#stDate").val();
params.edDate = $("#edDate").val();
let stDate = new Date($("#stDate").val());
params.year = stDate.getFullYear();
params.code = $("#code").val();
$.ajax({
url: '/budget/assign/modal/edit',
data: params,
type: 'GET',
dataType:"html",
success: function(html){
$("#editModalContent").empty().append(html);
$("#year").val($("#searchYear").val())
$(".dateSelector").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
$("#editModal").modal('show');
},
error:function(){
}
});
}
$(document).on('click', '#saveBtn', function (){
if($("#nameL1").val() == ""){
alert('사업명을 입력해주세요.');
$("#position").focus();
return;
}
if($("#nameL2").val() == ""){
alert('구분을 입력해주세요.');
$("#name").focus();
return;
}
if($("#nameL3").val() == ""){
alert('세부내역을 입력해주세요.');
$("#name").focus();
return;
}
if(confirm("저장하시겠습니까?")){
const formData = new FormData($("#budgetForm")[0]);
$.ajax({
type : 'POST',
data : formData,
url : "/budget/budgeting/code",
processData: false,
contentType: false,
success : function(data) {
if(data.code == "200"){
alert("저장되었습니다.");
location.reload();
}else{
alert(data.message);
}
//location.reload();
},
error : function(xhr) {
alert("저장에 실패하였습니다.");
}
})
}
});
$(document).on('click', '#modifyBtn', function (){
if($("#nameL1").val() == ""){
alert('사업명을 입력해주세요.');
$("#position").focus();
return;
}
if($("#nameL2").val() == ""){
alert('구분을 입력해주세요.');
$("#name").focus();
return;
}
if($("#nameL3").val() == ""){
alert('세부내역을 입력해주세요.');
$("#name").focus();
return;
}
if(confirm("수정하시겠습니까?")){
const formData = new FormData($("#budgetForm")[0]);
$.ajax({
type : 'PUT',
data : formData,
url : "/budget/budgeting/code",
processData: false,
contentType: false,
success : function(data) {
if(data.code == "200"){
alert("저장되었습니다.");
location.reload();
}else{
alert(data.message);
}
//location.reload();
},
error : function(xhr) {
alert("저장에 실패하였습니다.");
}
})
}
});
$(document).on('click', '#tempBtn', function (){
if(confirm("임시 저장하시겠습니까?")){
$("#status").val("TEMP");
const formData = new FormData($("#investigationEditForm")[0]);
$.ajax({
type : 'POST',
data : formData,
url : "/pds/ship",
processData: false,
contentType: false,
success : function(data) {
alert("저장되었습니다.");
location.reload();
},
error : function(xhr) {
alert("저장에 실패하였습니다.");
}
})
}
});
$(document).on('click', '#assignSaveBtn', function (){
let success = 0;
let fail =0;
let fail1 =0;
if($("#assignCount").val()==0){
alert('저장할 내역이 없습니다.');
}
for(let i =0 ; i < $("#assignCount").val() ; i ++){
for(let j=0 ; j < $("#orgCount").val() ; j ++){
params = {}
params.year = $("#orgYear").val();
// console.dir($("#org"+j+"_amount"+i)[0].dataset.code);
params.code = $("#org"+j+"_amount"+i)[0].dataset.code;
params.amount = $("#org"+j+"_amount"+i).val() == "" ? 0 :$("#org"+j+"_amount"+i).val()
params.org = $("#code").val();
params.org1 = $("#orgSave"+j).text();
// console.dir(params.org);
$.ajax({
type : 'POST',
data : JSON.stringify(params),
url : "/budget/assign/save",
processData: false,
contentType: 'application/json',
async : false,
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function(data) {
// console.log(data.code);
if(data.code == "200"){
success ++;
}else if(data.code == "911"){
fail1 ++;
}else{
fail++;
}
//location.reload();
},
error : function(xhr) {
//alert("저장에 실패하였습니다.");
fail++;
}
})
}
}
// console.dir("success: "+ success +", fail:" + fail+fail1);
if (fail1 > 0 || fail > 0) {
alert("저장에 성공하였습니다. \n일부는 저장에 실패 (금액 초과 [" + fail1 + "건], 에러 [" + fail + "건]) 하였습니다.");
} else {
alert("저장에 성공하였습니다.");
}
location.reload();
});

View File

@ -0,0 +1,422 @@
$(document).on('click', '#addBtn', function () {
getEditModal(0)
})
$(document).on('click', '#deleteBtn', function () {
if ($("input[name='budget']:checked").val() == undefined || $("input[name='budget']:checked").val() == null) {
alert('삭제할 항목을 선택해주세요');
return;
}
// console.dir($("input[name='budget']:checked")[0].dataset.name1);
// console.dir($("input[name='budget']:checked")[0].dataset.name2);
// console.dir($("input[name='budget']:checked")[0].dataset.name3);
if (confirm('삭제하시겠습니까?')) {
let params = {};
params.year = $("#searchYear").val();
params.nameL1 = $("input[name='budget']:checked")[0].dataset.name1;
params.nameL2 = $("input[name='budget']:checked")[0].dataset.name2;
params.nameL3 = $("input[name='budget']:checked")[0].dataset.name3;
console.dir(params);
$.ajax({
type: 'DELETE',
data: params,
url: "/budget/budgeting/code",
beforeSend: function (xhr) {
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success: function (data) {
if (data.code == "200") {
alert("삭제되었습니다.");
location.reload();
} else {
alert(data.message);
}
//location.reload();
},
error: function (xhr) {
alert("삭제에 실패하였습니다.");
}
})
}
})
// 예산편성 - 엑셀 다운로드(버튼)
$(document).on('click', '#excelDownload', function (){
let selected_year = $("#searchYear").val();
exportExcel(selected_year+"년 예산편성", "data-table-default");
});
// 예산편성 - 연도추가(버튼)
$(document).on('click', '#copyYearBtn', function () {
// let now = new Date();
let selected_year = $("#searchYear").val();
if (confirm(parseInt(selected_year) + 1 + '년도 예산을 생성하시겠습니까?')) {
let params = {};
params.copyYear = selected_year;
params.year = parseInt(selected_year) + 1;
// console.dir(params);
$.ajax({
type: 'POST',
url: "/budget/budgeting/year",
data: JSON.stringify(params),
contentType: 'application/json; charset=utf-8',
beforeSend: function (xhr) {
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success: function (data) {
if (data.code == "200") {
alert("생성되었습니다.");
location.reload();
} else {
alert(data.message);
}
//location.reload();
},
error: function (xhr) {
alert("생성에 실패하였습니다.");
}
})
}
})
// 예산편성 - 예산삭제(버튼)
$(document).on('click', '#deleteYearBtn', function () {
let selected_year = $("#searchYear").val();
if (confirm(selected_year + "년도 예산 삭제시 관련된 모든 예산 이력 정보가 삭제됩니다.\n그래도 삭제하시겠습니까?")) {
let params = {};
//params.copyYear = "??";
params.year = selected_year;
console.dir(params);
$.ajax({
type: 'DELETE',
data: params,
// data: JSON.stringify(params),
// contentType: 'application/json; charset=utf-8',
url: "/budget/budgeting/year",
beforeSend: function (xhr) {
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success: function (data) {
if (data.code == "200") {
alert("삭제되었습니다.");
location.href = '/budget/budgeting?year='+(parseInt(selected_year)-1);
// location.reload();
} else {
alert(data.message);
}
//location.reload();
},
error: function (xhr) {
alert("삭제에 실패하였습니다.");
}
// error:function(xhr,status,error){
// alert("code:"+status+"\n"+"xhr:"+xhr+"\n"+"error:"+error);
// }
})
}
})
$(document).on('click', '#budgetDeleteBtn', function () {
if (confirm("예산을 삭제하시겠습니까? 삭제된 예산은 복구할수 없습니다.")) {
let params = {};
params.year = $("#searchYear").val();
// console.dir(params);
$.ajax({
type: 'DELETE',
data: params,
url: "/budget/budgeting",
beforeSend: function (xhr) {
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success: function (data) {
if (data.code == "200") {
alert("삭제되었습니다.");
location.reload();
} else {
alert(data.message);
}
//location.reload();
},
error: function (xhr) {
alert("삭제에 실패하였습니다.");
}
})
}
})
$(document).on('click', '#updateBtn', function () {
if ($("input[name='budget']:checked").val() == undefined || $("input[name='budget']:checked").val() == null) {
alert('수정할 항목을 선택해주세요');
return;
}
params = {}
params.year = $("#searchYear").val()
params.nameL1 = $("input[name='budget']:checked")[0].dataset.name1;
params.nameL2 = $("input[name='budget']:checked")[0].dataset.name2;
params.nameL3 = $("input[name='budget']:checked")[0].dataset.name3;
$.ajax({
url: '/budget/budgeting/modal/edit',
data: params,
type: 'GET',
dataType: "html",
success: function (html) {
$("#editModalContent").empty().append(html);
$("#year").val($("#searchYear").val());
$(".dateSelector").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
$("#editModal").modal('show');
},
error: function () {
}
});
})
$(document).on('click', '#budgetBtn', function () {
getBudgetModal();
});
function getList() {
$.ajax({
type: 'GET',
data: {},
url: "/pds/ship/list",
processData: false,
contentType: false,
beforeSend: function (xhr) {
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success: function (response) {
console.dir(response)
},
error: function () {
alert("저장에 실패하였습니다.");
},
complete: function () {
loaddingOff();
}
})
}
function getBudgetModal(no) {
params = {}
params.no = no;
params.year = $("#searchYear").val();
$.ajax({
url: '/budget/budgeting/modal/org',
data: params,
type: 'GET',
dataType: "html",
success: function (html) {
$("#budgetModalContent").empty().append(html);
$("#orgYear").val($("#searchYear").val());
$(".dateSelector").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
// $("#budgetYear").val(params.year);
$("#budgetModal").modal('show');
},
error: function () {
}
});
}
$(document).on('click', '.grid', function (event) {
const target = event.target;
const no = (Number($(this).find(".key").val()));
})
function getEditModal(no) {
params = {}
params.no = no;
$.ajax({
url: '/budget/budgeting/modal/edit',
data: params,
type: 'GET',
dataType: "html",
success: function (html) {
$("#editModalContent").empty().append(html);
$("#year").val($("#searchYear").val())
$(".dateSelector").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
$("#editModal").modal('show');
},
error: function () {
}
});
}
$(document).on('click', '#budgetSaveBtn', function () {
let success = 0;
let fail = 0;
for (let i = 0; i < $("#budgetCount").val(); i++) {
(function(i) {
params = {}
params.year = $("#orgYear").val();
params.nameL1 = $("#amount" + i)[0].dataset.name1;
params.nameL2 = $("#amount" + i)[0].dataset.name2;
params.nameL3 = $("#amount" + i)[0].dataset.name3;
params.amount = $("#amount" + i).val() == "" ? 0 : $("#amount" + i).val()
$.ajax({
type: 'POST',
data: JSON.stringify(params),
url: "/budget/budgeting/save",
processData: false,
contentType: 'application/json',
async: false,
beforeSend: function (xhr) {
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success: function (data) {
if (data.code == "200") {
success++;
} else {
fail++;
}
},
error: function (xhr) {
fail++;
},
});
})(i);
}
// console.dir("success: " + success + ", fail:" + fail);
if (fail > 0) {
alert("저장이 성공하였습니다. [" + fail + "건 오류]");
} else {
alert("저장에 성공하였습니다.");
}
location.reload();
});
$(document).on('change', '#searchYear', function () {
location.href = '/budget/budgeting?year=' + $("#searchYear").val();
});
$(document).on('click', '#saveBtn', function () {
if ($("#nameL1").val() == "") {
alert('사업명을 입력해주세요.');
$("#position").focus();
return;
}
if ($("#nameL2").val() == "") {
alert('구분을 입력해주세요.');
$("#name").focus();
return;
}
if ($("#nameL3").val() == "") {
alert('세부내역을 입력해주세요.');
$("#name").focus();
return;
}
if (confirm("저장하시겠습니까?")) {
const formData = new FormData($("#budgetForm")[0]);
$.ajax({
type: 'POST',
data: formData,
url: "/budget/budgeting/code",
processData: false,
contentType: false,
success: function (data) {
if (data.code == "200") {
alert("저장되었습니다.");
location.reload();
} else {
alert(data.message);
}
//location.reload();
},
error: function (xhr) {
alert("저장에 실패하였습니다.");
}
})
}
});
$(document).on('click', '#modifyBtn', function () {
if ($("#nameL1").val() == "") {
alert('사업명을 입력해주세요.');
$("#position").focus();
return;
}
if ($("#nameL2").val() == "") {
alert('구분을 입력해주세요.');
$("#name").focus();
return;
}
if ($("#nameL3").val() == "") {
alert('세부내역을 입력해주세요.');
$("#name").focus();
return;
}
if (confirm("수정하시겠습니까?")) {
const formData = new FormData($("#budgetForm")[0]);
$.ajax({
type: 'PUT',
data: formData,
url: "/budget/budgeting/code",
processData: false,
contentType: false,
success: function (data) {
if (data.code == "200") {
alert("저장되었습니다.");
location.reload();
} else {
alert(data.message);
}
//location.reload();
},
error: function (xhr) {
alert("저장에 실패하였습니다.");
}
})
}
});
$(document).on('click', '#tempBtn', function () {
if (confirm("임시 저장하시겠습니까?")) {
$("#status").val("TEMP");
const formData = new FormData($("#investigationEditForm")[0]);
$.ajax({
type: 'POST',
data: formData,
url: "/pds/ship",
processData: false,
contentType: false,
success: function (data) {
alert("저장되었습니다.");
location.reload();
},
error: function (xhr) {
alert("저장에 실패하였습니다.");
}
})
}
});

View File

@ -0,0 +1,321 @@
$(function(){
$("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
})
$(document).on('click', '#addBtn', function (){
getEditModal(0)
})
$(document).on('click', '#searchBtn', function (){
var stDate = $("#stDate").val()
var edDate = $("#edDate").val()
if($("#stDate").val() ==""){
alert('시작일을 선택해주세요');
return;
}
if($("#edDate").val() ==""){
alert('종료일을 선택해주세요');
return;
}
stDate = new Date(stDate);
edDate = new Date(edDate);
if(stDate.getFullYear() != edDate.getFullYear()){
alert('같은 년도의 데이터만 조회가능합니다. ex)2021-01-01 ~ 2021-12-31');
return;
}
$("#year").val(stDate.getFullYear());
location.href="/budget/expense?year="+$("#year").val() + "&stDate=" + $("#stDate").val() + "&edDate=" + $("#edDate").val() + "&code=" +$("#code").val();
})
$(document).on('click', '#deleteBtn', function (){
if($("input[name='budget']:checked").val() == undefined || $("input[name='budget']:checked").val()==null){
alert('삭제할 항목을 선택해주세요');
return;
}
console.dir($("input[name='budget']:checked")[0].dataset.name1);
console.dir($("input[name='budget']:checked")[0].dataset.name2);
console.dir($("input[name='budget']:checked")[0].dataset.name3);
if(confirm('삭제하시겠습니까?')){
var params = {};
params.year = $("#searchYear").val();
params.nameL1 = $("input[name='budget']:checked")[0].dataset.name1;
params.nameL2 = $("input[name='budget']:checked")[0].dataset.name2;
params.nameL3 = $("input[name='budget']:checked")[0].dataset.name3;
console.dir(params);
$.ajax({
type : 'DELETE',
data : params,
url : "/budget/budgeting/code",
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function(data) {
if(data.code == "200"){
alert("삭제되었습니다.");
location.reload();
}else{
alert(data.message);
}
//location.reload();
},
error : function(xhr) {
alert("삭제에 실패하였습니다.");
}
})
}
})
$(document).on('click', '#updateBtn', function (){
if($("input[name='budget']:checked").val() == undefined || $("input[name='budget']:checked").val()==null){
alert('수정할 항목을 선택해주세요');
return;
}
params = {}
params.year = $("#searchYear").val()
params.nameL1 = $("input[name='budget']:checked")[0].dataset.name1;
params.nameL2 = $("input[name='budget']:checked")[0].dataset.name2;
params.nameL3 = $("input[name='budget']:checked")[0].dataset.name3;
$.ajax({
url: '/budget/budgeting/modal/edit',
data: params,
type: 'GET',
dataType:"html",
success: function(html){
$("#editModalContent").empty().append(html);
$("#year").val($("#searchYear").val())
$(".dateSelector").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
$("#editModal").modal('show');
},
error:function(){
}
});
})
function getList(){
$.ajax({
type : 'GET',
data : {},
url : "/pds/ship/list",
processData: false,
contentType: false,
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function(response) {
console.dir(response)
},
error : function() {
alert("저장에 실패하였습니다.");
},
complete : function () {
loaddingOff();
}
})
}
function getViewModal(no){
params = {}
params.no = no;
$.ajax({
url: '/pds/ship/modal/view',
data: params,
type: 'GET',
dataType:"html",
success: function(html){
$("#editModalContent").empty().append(html);
$(".dateSelector").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
$("#editModal").modal('show');
},
error:function(){
}
});
}
$(document).on('click', '.grid', function(event) {
const target = event.target;
const no = (Number($(this).find(".key").val()));
})
function getEditModal(v){
params = {}
params.year = $("#year").val();
params.nameL1 = v.dataset.name1
params.nameL2 = v.dataset.name2
params.nameL3 = v.dataset.name3
$.ajax({
url: '/budget/expense/modal/view',
data: params,
type: 'GET',
dataType:"html",
success: function(html){
$("#editModalContent").empty().append(html);
$(".dateSelector").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
$("#editModal").modal('show');
},
error:function(){
}
});
}
$(document).on('click', '#expenseSaveBtn', function (){
if($("#item").val() == ""){
alert('집행내역을 입력해주세요.');
$("#item").focus();
return;
}
if($("#amount").val() == ""){
alert('집행액을 입력해주세요.');
$("#amount").focus();
return;
}
if($("#expenseDate").val() == ""){
alert('등록일을 입력해주세요.');
$("#expenseDate").focus();
return;
}
var params = {}
params.item = $("#item").val();
params.amount = $("#amount").val();
params.expenseDate = $("#expenseDate").val();
params.nameL1 = $("#prevNameL1").val();
params.nameL2 = $("#prevNameL2").val();
params.nameL3 = $("#prevNameL3").val();
params.year = $("#prevYear").val();
if(confirm("저장하시겠습니까?")){
$.ajax({
type : 'POST',
data : JSON.stringify(params),
url : "/budget/expense",
processData: false,
contentType: 'application/json',
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function(data) {
if(data.code == "200"){
alert("저장되었습니다.");
location.reload();
}else{
alert(data.message);
}
//location.reload();
},
error : function(xhr) {
alert("저장에 실패하였습니다.");
}
})
}
});
$(document).on('click', '#modifyBtn', function (){
if($("#nameL1").val() == ""){
alert('사업명을 입력해주세요.');
$("#position").focus();
return;
}
if($("#nameL2").val() == ""){
alert('구분을 입력해주세요.');
$("#name").focus();
return;
}
if($("#nameL3").val() == ""){
alert('세부내역을 입력해주세요.');
$("#name").focus();
return;
}
if(confirm("수정하시겠습니까?")){
const formData = new FormData($("#budgetForm")[0]);
$.ajax({
type : 'PUT',
data : formData,
url : "/budget/budgeting/code",
processData: false,
contentType: false,
success : function(data) {
if(data.code == "200"){
alert("저장되었습니다.");
location.reload();
}else{
alert(data.message);
}
//location.reload();
},
error : function(xhr) {
alert("저장에 실패하였습니다.");
}
})
}
});
$(document).on('click', '#tempBtn', function (){
if(confirm("임시 저장하시겠습니까?")){
$("#status").val("TEMP");
const formData = new FormData($("#investigationEditForm")[0]);
$.ajax({
type : 'POST',
data : formData,
url : "/pds/ship",
processData: false,
contentType: false,
success : function(data) {
alert("저장되었습니다.");
location.reload();
},
error : function(xhr) {
alert("저장에 실패하였습니다.");
}
})
}
});

View File

@ -0,0 +1,297 @@
$(function(){
$("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
})
$(document).on('click', '#addBtn', function (){
getEditModal(0)
})
$(document).on('click', '#searchBtn', function (){
var stDate = $("#stDate").val()
var edDate = $("#edDate").val()
if($("#stDate").val() ==""){
alert('시작일을 선택해주세요');
return;
}
if($("#edDate").val() ==""){
alert('종료일을 선택해주세요');
return;
}
stDate = new Date(stDate);
edDate = new Date(edDate);
if(stDate.getFullYear() != edDate.getFullYear()){
alert('같은 년도의 데이터만 조회가능합니다. ex)2021-01-01 ~ 2021-12-31');
return;
}
//location.href="/budget/stats/detail?year="+$("#year").val() + "&stDate=" + $("#stDate").val() + "&edDate=" + $("#edDate").val() + "&code=" +$("#code").val() + "&won="+$("#won").val();
location.href="/budget/stats/detail?year="+$("#year").val() + "&stDate=" + $("#stDate").val() + "&edDate=" + $("#edDate").val() + "&code=본청&won="+$("#won").val()+"&item="+$("#item").val();
})
$(document).on('click', '#deleteBtn', function (){
if($("input[name='budget']:checked").val() == undefined || $("input[name='budget']:checked").val()==null){
alert('삭제할 항목을 선택해주세요');
return;
}
console.dir($("input[name='budget']:checked")[0].dataset.name1);
console.dir($("input[name='budget']:checked")[0].dataset.name2);
console.dir($("input[name='budget']:checked")[0].dataset.name3);
if(confirm('삭제하시겠습니까?')){
var params = {};
params.year = $("#searchYear").val();
params.nameL1 = $("input[name='budget']:checked")[0].dataset.name1;
params.nameL2 = $("input[name='budget']:checked")[0].dataset.name2;
params.nameL3 = $("input[name='budget']:checked")[0].dataset.name3;
console.dir(params);
$.ajax({
type : 'DELETE',
data : params,
url : "/budget/budgeting/code",
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function(data) {
if(data.code == "200"){
alert("삭제되었습니다.");
location.reload();
}else{
alert(data.message);
}
//location.reload();
},
error : function(xhr) {
alert("삭제에 실패하였습니다.");
}
})
}
})
function changeYear(){
location.href="/budget/stats/detail?year="+$("#year").val();
}
$(document).on('click', '#updateBtn', function (){
if($("input[name='budget']:checked").val() == undefined || $("input[name='budget']:checked").val()==null){
alert('수정할 항목을 선택해주세요');
return;
}
params = {}
params.year = $("#searchYear").val()
params.nameL1 = $("input[name='budget']:checked")[0].dataset.name1;
params.nameL2 = $("input[name='budget']:checked")[0].dataset.name2;
params.nameL3 = $("input[name='budget']:checked")[0].dataset.name3;
$.ajax({
url: '/budget/budgeting/modal/edit',
data: params,
type: 'GET',
dataType:"html",
success: function(html){
$("#editModalContent").empty().append(html);
$("#year").val($("#searchYear").val())
$(".dateSelector").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
$("#editModal").modal('show');
},
error:function(){
}
});
})
function goAll() {
location.href="/budget/stats/all"
}
function goOrg(){
location.href="/budget/stats/org"
}
function goDetail() {
location.href="/budget/stats/detail"
}
function getViewModal(no){
params = {}
params.no = no;
$.ajax({
url: '/pds/ship/modal/view',
data: params,
type: 'GET',
dataType:"html",
success: function(html){
$("#editModalContent").empty().append(html);
$(".dateSelector").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
$("#editModal").modal('show');
},
error:function(){
}
});
}
$(document).on('click', '.grid', function(event) {
const target = event.target;
const no = (Number($(this).find(".key").val()));
})
function getEditModal(no){
params = {}
params.no = no;
$.ajax({
url: '/budget/budgeting/modal/edit',
data: params,
type: 'GET',
dataType:"html",
success: function(html){
$("#editModalContent").empty().append(html);
$("#year").val($("#searchYear").val())
$(".dateSelector").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
$("#editModal").modal('show');
},
error:function(){
}
});
}
$(document).on('click', '#saveBtn', function (){
if($("#nameL1").val() == ""){
alert('사업명을 입력해주세요.');
$("#position").focus();
return;
}
if($("#nameL2").val() == ""){
alert('구분을 입력해주세요.');
$("#name").focus();
return;
}
if($("#nameL3").val() == ""){
alert('세부내역을 입력해주세요.');
$("#name").focus();
return;
}
if(confirm("저장하시겠습니까?")){
const formData = new FormData($("#budgetForm")[0]);
$.ajax({
type : 'POST',
data : formData,
url : "/budget/budgeting/code",
processData: false,
contentType: false,
success : function(data) {
if(data.code == "200"){
alert("저장되었습니다.");
location.reload();
}else{
alert(data.message);
}
//location.reload();
},
error : function(xhr) {
alert("저장에 실패하였습니다.");
}
})
}
});
$(document).on('click', '#modifyBtn', function (){
if($("#nameL1").val() == ""){
alert('사업명을 입력해주세요.');
$("#position").focus();
return;
}
if($("#nameL2").val() == ""){
alert('구분을 입력해주세요.');
$("#name").focus();
return;
}
if($("#nameL3").val() == ""){
alert('세부내역을 입력해주세요.');
$("#name").focus();
return;
}
if(confirm("수정하시겠습니까?")){
const formData = new FormData($("#budgetForm")[0]);
$.ajax({
type : 'PUT',
data : formData,
url : "/budget/budgeting/code",
processData: false,
contentType: false,
success : function(data) {
if(data.code == "200"){
alert("저장되었습니다.");
location.reload();
}else{
alert(data.message);
}
//location.reload();
},
error : function(xhr) {
alert("저장에 실패하였습니다.");
}
})
}
});
$(document).on('click', '#tempBtn', function (){
if(confirm("임시 저장하시겠습니까?")){
$("#status").val("TEMP");
const formData = new FormData($("#investigationEditForm")[0]);
$.ajax({
type : 'POST',
data : formData,
url : "/pds/ship",
processData: false,
contentType: false,
success : function(data) {
alert("저장되었습니다.");
location.reload();
},
error : function(xhr) {
alert("저장에 실패하였습니다.");
}
})
}
});

View File

@ -0,0 +1,316 @@
$(function(){
$("#dateSelectorDiv").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
})
$(document).on('click', '#addBtn', function (){
getEditModal(0)
})
$(document).on('click', '#searchBtn', function (){
var stDate = $("#stDate").val()
var edDate = $("#edDate").val()
if($("#stDate").val() ==""){
alert('시작일을 선택해주세요');
return;
}
if($("#edDate").val() ==""){
alert('종료일을 선택해주세요');
return;
}
stDate = new Date(stDate);
edDate = new Date(edDate);
if(stDate.getFullYear() != edDate.getFullYear()){
alert('같은 년도의 데이터만 조회가능합니다. ex)2021-01-01 ~ 2021-12-31');
return;
}
$("#year").val(stDate.getFullYear());
location.href="/budget/stats/org?year="+$("#year").val() + "&stDate=" + $("#stDate").val() + "&edDate=" + $("#edDate").val() + "&code=" +$("#code").val() + "&won="+$("#won").val();
})
$(document).on('click', '#deleteBtn', function (){
if($("input[name='budget']:checked").val() == undefined || $("input[name='budget']:checked").val()==null){
alert('삭제할 항목을 선택해주세요');
return;
}
console.dir($("input[name='budget']:checked")[0].dataset.name1);
console.dir($("input[name='budget']:checked")[0].dataset.name2);
console.dir($("input[name='budget']:checked")[0].dataset.name3);
if(confirm('삭제하시겠습니까?')){
var params = {};
params.year = $("#searchYear").val();
params.nameL1 = $("input[name='budget']:checked")[0].dataset.name1;
params.nameL2 = $("input[name='budget']:checked")[0].dataset.name2;
params.nameL3 = $("input[name='budget']:checked")[0].dataset.name3;
console.dir(params);
$.ajax({
type : 'DELETE',
data : params,
url : "/budget/budgeting/code",
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function(data) {
if(data.code == "200"){
alert("삭제되었습니다.");
location.reload();
}else{
alert(data.message);
}
//location.reload();
},
error : function(xhr) {
alert("삭제에 실패하였습니다.");
}
})
}
})
$(document).on('click', '#updateBtn', function (){
if($("input[name='budget']:checked").val() == undefined || $("input[name='budget']:checked").val()==null){
alert('수정할 항목을 선택해주세요');
return;
}
params = {}
params.year = $("#searchYear").val()
params.nameL1 = $("input[name='budget']:checked")[0].dataset.name1;
params.nameL2 = $("input[name='budget']:checked")[0].dataset.name2;
params.nameL3 = $("input[name='budget']:checked")[0].dataset.name3;
$.ajax({
url: '/budget/budgeting/modal/edit',
data: params,
type: 'GET',
dataType:"html",
success: function(html){
$("#editModalContent").empty().append(html);
$("#year").val($("#searchYear").val())
$(".dateSelector").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
$("#editModal").modal('show');
},
error:function(){
}
});
})
function getList(){
$.ajax({
type : 'GET',
data : {},
url : "/pds/ship/list",
processData: false,
contentType: false,
beforeSend: function (xhr){
xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val());
},
success : function(response) {
console.dir(response)
},
error : function() {
alert("저장에 실패하였습니다.");
},
complete : function () {
loaddingOff();
}
})
}
function goAll() {
location.href="/budget/stats/all"
}
function goOrg() {
location.href="/budget/stats/org"
}
function goDetail(){
location.href="/budget/stats/detail"
}
function getViewModal(no){
params = {}
params.no = no;
$.ajax({
url: '/pds/ship/modal/view',
data: params,
type: 'GET',
dataType:"html",
success: function(html){
$("#editModalContent").empty().append(html);
$(".dateSelector").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
$("#editModal").modal('show');
},
error:function(){
}
});
}
$(document).on('click', '.grid', function(event) {
const target = event.target;
const no = (Number($(this).find(".key").val()));
})
function getEditModal(no){
params = {}
params.no = no;
$.ajax({
url: '/budget/budgeting/modal/edit',
data: params,
type: 'GET',
dataType:"html",
success: function(html){
$("#editModalContent").empty().append(html);
$("#year").val($("#searchYear").val())
$(".dateSelector").datepicker({
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
});
$("#editModal").modal('show');
},
error:function(){
}
});
}
$(document).on('click', '#saveBtn', function (){
if($("#nameL1").val() == ""){
alert('사업명을 입력해주세요.');
$("#position").focus();
return;
}
if($("#nameL2").val() == ""){
alert('구분을 입력해주세요.');
$("#name").focus();
return;
}
if($("#nameL3").val() == ""){
alert('세부내역을 입력해주세요.');
$("#name").focus();
return;
}
if(confirm("저장하시겠습니까?")){
const formData = new FormData($("#budgetForm")[0]);
$.ajax({
type : 'POST',
data : formData,
url : "/budget/budgeting/code",
processData: false,
contentType: false,
success : function(data) {
if(data.code == "200"){
alert("저장되었습니다.");
location.reload();
}else{
alert(data.message);
}
//location.reload();
},
error : function(xhr) {
alert("저장에 실패하였습니다.");
}
})
}
});
$(document).on('click', '#modifyBtn', function (){
if($("#nameL1").val() == ""){
alert('사업명을 입력해주세요.');
$("#position").focus();
return;
}
if($("#nameL2").val() == ""){
alert('구분을 입력해주세요.');
$("#name").focus();
return;
}
if($("#nameL3").val() == ""){
alert('세부내역을 입력해주세요.');
$("#name").focus();
return;
}
if(confirm("수정하시겠습니까?")){
const formData = new FormData($("#budgetForm")[0]);
$.ajax({
type : 'PUT',
data : formData,
url : "/budget/budgeting/code",
processData: false,
contentType: false,
success : function(data) {
if(data.code == "200"){
alert("저장되었습니다.");
location.reload();
}else{
alert(data.message);
}
//location.reload();
},
error : function(xhr) {
alert("저장에 실패하였습니다.");
}
})
}
});
$(document).on('click', '#tempBtn', function (){
if(confirm("임시 저장하시겠습니까?")){
$("#status").val("TEMP");
const formData = new FormData($("#investigationEditForm")[0]);
$.ajax({
type : 'POST',
data : formData,
url : "/pds/ship",
processData: false,
contentType: false,
success : function(data) {
alert("저장되었습니다.");
location.reload();
},
error : function(xhr) {
alert("저장에 실패하였습니다.");
}
})
}
});

View File

@ -356,4 +356,38 @@ function ajaxErrorAction(e){
location.href="/"; location.href="/";
} }
} }
}
function LoadingWithMask() {
//화면의 높이와 너비를 구합니다.
let maskHeight = $(document).height();
let maskWidth = window.document.body.clientWidth;
//화면에 출력할 마스크를 설정해줍니다.
let mask = "<div id='mask' style='position:fixed; z-index:99; background-color:#000; display:none; left:0; top:0;'><div id='loadingImg' class='panel-body'><div class='fa-3x'><i class='fas fa-spinner fa-pulse'></i></div></div></div>";
//화면에 레이어 추가
$("body")
.append(mask)
//마스크의 높이와 너비를 화면 것으로 만들어 전체 화면을 채웁니다.
$("#mask").css({
'width' : maskWidth,
'height': maskHeight,
'opacity' : '0.7'
});
$("#loadingImg").css({
'position' : 'absolute',
'z-index' : '100',
'top' : '50%', //parseInt(maskHeight)/2-20
'left' : '50%', //parseInt(maskWidth)/2-20,
});
//마스크 표시
$("#mask").show();
}
function WithoutMask() {
$("#mask, #loadingImg").hide();
$("#mask, #loadingImg").remove();
} }

View File

@ -3,8 +3,7 @@
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/layout}"> layout:decorate="~{layout/layout}">
<th:block layout:fragment="script"> <th:block layout:fragment="script">
<!--<script type="text/javascript" th:src="@{/js/faRpt/faRpt.js}"></script> <script type="text/javascript" th:src="@{/js/budget/assign.js}"></script>
<script type="text/javascript" th:src="@{/js/modal/userModal.js}"></script>-->
</th:block> </th:block>
<div layout:fragment="content"> <div layout:fragment="content">
<main> <main>
@ -25,49 +24,37 @@
<div class="row mx-0"> <div class="row mx-0">
<div class="col-12 card bg-light text-center"> <div class="col-12 card bg-light text-center">
<div class="card-body"> <div class="card-body">
<!--<form method="get" th:action="${searchUrl}"> <form id="assginForm" method="get" action="/budget/assign" onsubmit="return false;">
<input type="hidden" name="activeTab" id="activeTab" th:value="${searchParams.activeTab}"> <input type="hidden" name="year" id="year" value=""/>
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
<div class="row justify-content-between py-1"> <div class="row justify-content-between py-1">
<div class="col-auto"> <div class="col-auto">
<select class="form-select form-select-sm" name="rowCnt" id="rowCnt">
<th:block th:each="num : ${#numbers.sequence(1,5)}">
<option th:value="${num*10}" th:text="${num*10}" th:selected="${searchParams.rowCnt eq num*10}"></option>
</th:block>
</select>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<div class="row justify-content-end"> <div class="row justify-content-end">
<div class="col-auto" th:if="${searchParams.activeTab ne 'send'}"> <div class="col-auto">
<select class="form-select form-select-sm" name="wrtOrgan"> <select class="form-select form-select-sm" name="code" id="code">>
<option value="">관서 선택</option> <option value="OG001">본청</option>
<th:block th:each="commonCode:${session.commonCode.get('OG')}"> <option th:each="code : ${codeList}" th:value="${code?.orgCode}"
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq searchParams.wrtOrgan}"></option> th:text="${code?.orgName}"
</th:block> th:selected="${searchParams?.code eq code.orgCode}">2023
</option>
</select> </select>
</div> </div>
<div class="col-auto">
<input type="text" class="form-control form-control-sm" placeholder="제목" name="title" th:value="${searchParams.title}">
</div>
<div class="col-auto">
<input type="text" class="form-control form-control-sm" placeholder="해시태그" name="hashTags" th:value="${searchParams.hashTags}">
</div>
<div class="col-auto" th:if="${accessAuth eq 'ACC003'}">
<input type="text" class="form-control form-control-sm" placeholder="작성자" name="wrtUserNm" th:value="${searchParams.wrtUserNm}">
</div>
<div class="col-auto"> <div class="col-auto">
<div class="input-group w-auto input-daterange" id="dateSelectorDiv"> <div class="input-group w-auto input-daterange" id="dateSelectorDiv">
<input type="text" class="form-control form-control-sm" id="startDate" name="startDate" placeholder="시작일" autocomplete="off" readonly th:value="${searchParams.startDate}"> <input type="text" class="form-control form-control-sm" id="stDate" name="stDate" placeholder="시작일" autocomplete="off" readonly
<input type="text" class="form-control form-control-sm" id="endDate" name="endDate" placeholder="종료일" autocomplete="off" readonly th:value="${searchParams.endDate}"> th:value="${searchParams.stDate}">
<input type="text" class="form-control form-control-sm" id="edDate" name="edDate" placeholder="종료일" autocomplete="off" readonly
th:value="${searchParams.edDate}">
</div> </div>
</div> </div>
<div class=" col-auto"> <div class=" col-auto">
<input type="submit" class="btn btn-sm btn-primary" id="searchBtn" value="검색"> <input type="submit" class="btn btn-sm btn-primary" id="assignsearchBtn" value="검색">
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</form>--> </form>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<table class="table table-sm table-bordered table-hover"> <table class="table table-sm table-bordered table-hover">
@ -78,61 +65,77 @@
<th rowspan="2">세부내역</th> <th rowspan="2">세부내역</th>
<th rowspan="2">예산총액</th> <th rowspan="2">예산총액</th>
<th rowspan="2">예산총배정액<br>(누적)</th> <th rowspan="2">예산총배정액<br>(누적)</th>
<th colspan="2">본청</th> <th:block th:each="orglist : ${downOrgList}">
<th colspan="2">중부청</th> <th colspan="2" th:text="${orglist.orgName}"></th>
<th colspan="2">서해청</th> </th:block>
<th colspan="2">남해청</th>
<th colspan="2">동해청</th>
<th colspan="2">제주청</th>
</tr> </tr>
<tr class="table-secondary"> <tr class="table-secondary">
<td>기간배정액</td> <th:block th:each="orglist : ${downOrgList}">
<td>누적액</td> <th>기간배정액</th>
<td>기간배정액</td> <th>누적액</th>
<td>누적액</td> </th:block>
<td>기간배정액</td>
<td>누적액</td>
<td>기간배정액</td>
<td>누적액</td>
<td>기간배정액</td>
<td>누적액</td>
<td>기간배정액</td>
<td>누적액</td>
</tr> </tr>
</thead> </thead>
<tbody class="table-group-divider"> <tbody class="table-group-divider" id="ResultRow">
<!--<tr class="faRptTr" th:each="faRpt,cnt:${faRptList}"> <tr th:each="info, i : ${list}">
<input type="hidden" class="faRptKey" th:value="${faRpt.faRptKey}"> <td th:text="${info.getbudget_name_l1}"></td>
&lt;!&ndash; <td th:text="${info.getbudget_name_l2}"></td>
<td><input type="checkbox" class="trChkBox"></td> <td th:text="${info.getbudget_name_l3}"></td>
&ndash;&gt; <td th:text="${#numbers.formatInteger(info.getplan_amount,1,'COMMA')}"
<td th:text="${cnt.count}"></td> class="text-end"></td>
<td> <td th:text="${#numbers.formatInteger(info.gettotal_assign_amount,1,'COMMA')}"
<th:block th:each="code:${session.commonCode.get('OG')}"> class="text-end"></td>
<th:block th:if="${faRpt.wrtOrgan eq code.itemCd}" th:text="${code.itemValue}"></th:block> <th:block th:each="orglist, j : ${downOrgList}">
<th:block th:if="${j.index} == '0'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount1,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getsum_assign_amount1,1,'COMMA')}"
class="text-end"></td>
</th:block> </th:block>
</td> <th:block th:if="${j.index} == '1'">
<td> <td th:text="${#numbers.formatInteger(info.getperiod_assign_amount2,1,'COMMA')}"
<th:block th:each="code:${session.commonCode.get('FRC')}"> class="text-end"></td>
<th:text th:if="${code.itemCd eq faRpt.faRptType}" th:text="${code.itemValue}"></th:text> <td th:text="${#numbers.formatInteger(info.getsum_assign_amount2,1,'COMMA')}"
class="text-end"></td>
</th:block> </th:block>
</td> <th:block th:if="${j.index} == '2'">
<td class="titleLeft" th:text="${faRpt.title}"></td> <td th:text="${#numbers.formatInteger(info.getperiod_assign_amount3,1,'COMMA')}"
<td th:text="${faRpt.fileCnt eq null?'파일 없음':#strings.concat(faRpt.fileCnt,' 건')}"></td> class="text-end"></td>
<td th:text="|${faRpt.readCnt}/${faRpt.userCnt}|"></td> <td th:text="${#numbers.formatInteger(info.getsum_assign_amount3,1,'COMMA')}"
<td> class="text-end"></td>
<th:block th:each="code:${session.commonCode.get(faRpt.wrtOrgan)}">
<th:block th:if="${faRpt.wrtPart eq code.itemCd}" th:text="${code.itemValue}"></th:block>
</th:block> </th:block>
</td> <th:block th:if="${j.index} == '3'">
<td th:text="${faRpt.wrtUserNm}"></td> <td th:text="${#numbers.formatInteger(info.getperiod_assign_amount4,1,'COMMA')}"
<td th:text="${#temporals.format(faRpt.wrtDt, 'yyyy-MM-dd HH:mm')}"></td> class="text-end"></td>
<td th:if="${faRpt.status ne 'receive'}"> <td th:text="${#numbers.formatInteger(info.getsum_assign_amount4,1,'COMMA')}"
<th:block th:each="commonCode:${session.commonCode.get('DST')}"> class="text-end"></td>
<th:text th:if="${commonCode.itemCd eq faRpt.status}" th:text="${commonCode.itemValue}"></th:text>
</th:block> </th:block>
</td> <th:block th:if="${j.index} == '4'">
</tr>--> <td th:text="${#numbers.formatInteger(info.getperiod_assign_amount5,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getsum_assign_amount5,1,'COMMA')}"
class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '5'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount6,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getsum_assign_amount6,1,'COMMA')}"
class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '6'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount7,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getsum_assign_amount7,1,'COMMA')}"
class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '7'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount8,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getsum_assign_amount8,1,'COMMA')}"
class="text-end"></td>
</th:block>
</th:block>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -140,32 +143,15 @@
<div class="row justify-content-between"> <div class="row justify-content-between">
<div class="col-auto"></div> <div class="col-auto"></div>
<div class="col-auto"> <div class="col-auto">
<!--<nav aria-label="Page navigation">
<ul class="pagination mb-0">
<th:block th:if="${searchParams.pageIndex>3}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)-3}">
<a class="page-link" href="#" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
</th:block>
<th:block th:each="num : ${#numbers.sequence(searchParams.startNum, searchParams.endNum)}">
<li class="page-item" th:data-pageindex="${num}" th:classappend="${searchParams.pageIndex eq num?'active':''}">
<a class="page-link" href="#" th:text="${num}"></a>
</li>
</th:block>
<th:block th:if="${searchParams.maxNum>searchParams.endNum+2}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)+3}">
<a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
</th:block>
</ul>
</nav>-->
</div> </div>
<div class="col-auto"> <div class="col-auto">
<!--<input type="button" class="btn btn-success" value="등록" id="addFaRptBtn">--> <input type="button" class="btn btn-success" value="등록" id="addBtn">
</div>
</div>
<div class="modal fade" id="editModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="faRptEditModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xxl modal-dialog-scrollable">
<div class="modal-content" id="editModalContent"></div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -0,0 +1,159 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<style>
.scroll {
overflow-x: hidden;
overflow-y: auto;
height: 170px;
}
</style>
<div class="modal-header">
<h4 class="modal-title" th:text="${info eq null?'예산항목 추가':'예산항목 수정'}"></h4>
<button type="button" class="btn btn-danger" data-bs-dismiss="modal" aria-hidden="true">x</button>
</div>
<div class="modal-body">
<form id="budgetForm" action="#">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" id="assignYear" name="assignYear" th:value="${searchParams.year}"/>
<input type="hidden" id="prevNameL1" name="prevNameL1" th:value="${info?.nameL1}"/>
<input type="hidden" id="prevNameL2" name="prevNameL2" th:value="${info?.nameL2}"/>
<input type="hidden" id="prevNameL3" name="prevNameL3" th:value="${info?.nameL3}"/>
<input type="hidden" id="assignCount" name="assignCount" th:value="${#lists.size(list)}"/>
<input type="hidden" id="orgCount" name="orgCount" th:value="${#lists.size(downOrgList)}"/>
<div class="row ">
<div class="row col-10 ">
<div class="col-auto">
<div class="input-group input-daterange" id="dateSelectorDiv">
<input type="text" class="form-control form-control-sm w-35 dateSelector" id="dt" name="dt"
placeholder="시작일" autocomplete="off" readonly th:value="${searchParams.modalDate}">
</div>
</div>
</div>
</div>
<table id="data-table-default" class="table table-striped table-bordered align-middle" style="width:2500px">
<thead>
<tr class="table-secondary text-center">
<th rowspan="2">사업명</th>
<th rowspan="2">구분</th>
<th rowspan="2">세부내역</th>
<th rowspan="2">예산총액</th>
<th rowspan="2">예산총배정액<br/>(누적)</th>
<th:block th:each="orglist, i : ${downOrgList}">
<th colspan="3" th:text="${orglist.orgName}" th:id="'orgSave'+${i.index}"></th>
</th:block>
</tr>
<tr class="table-secondary text-center">
<th:block th:each="orglist : ${downOrgList}">
<th>기간배정액</th>
<th>금회배정액</th>
<th>누적액</th>
</th:block>
</tr>
</thead>
<tbody>
<tr class="odd gradeX reporterTr grid" th:each="info, i : ${list}">
<td th:text="${info.getbudget_name_l1}"></td>
<td th:text="${info.getbudget_name_l2}"></td>
<td th:text="${info.getbudget_name_l3}"></td>
<td th:text="${#numbers.formatInteger(info.getplan_amount,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.gettotal_assign_amount,1,'COMMA')}" class="text-end"></td>
<th:block th:each="orglist, j : ${downOrgList}">
<th:block th:if="${j.index} == '0'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount1,1,'COMMA')}" class="text-end"></td>
<td>
<input type="text" th:id="'org0_amount'+${i.index}" name="year" value="" class="w-100 text-end"
th:data-code="${info?.getbudget_code_l3}"
oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');"
/></td>
<td th:text="${#numbers.formatInteger(info.getsum_assign_amount1,1,'COMMA')}" class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '1'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount2,1,'COMMA')}" class="text-end"></td>
<td>
<input type="text" th:id="'org1_amount'+${i.index}" name="year" value="" class="w-100 text-end"
th:data-code="${info?.getbudget_code_l3}"
oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');"
/></td>
</td>
<td th:text="${#numbers.formatInteger(info.getsum_assign_amount2,1,'COMMA')}" class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '2'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount3,1,'COMMA')}" class="text-end"></td>
<td>
<input type="text" th:id="'org2_amount'+${i.index}" name="year" value="" class="w-100 text-end"
th:data-code="${info?.getbudget_code_l3}"
oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');"
/></td>
</td>
<td th:text="${#numbers.formatInteger(info.getsum_assign_amount3,1,'COMMA')}" class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '3'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount4,1,'COMMA')}" class="text-end"></td>
<td>
<input type="text" th:id="'org3_amount'+${i.index}" name="year" value="" class="w-100 text-end"
th:data-code="${info?.getbudget_code_l3}"
oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');"
/></td>
</td>
<td th:text="${#numbers.formatInteger(info.getsum_assign_amount4,1,'COMMA')}" class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '4'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount5,1,'COMMA')}" class="text-end"></td>
<td>
<input type="text" th:id="'org4_amount'+${i.index}" name="year" value="" class="w-100 text-end"
th:data-code="${info?.getbudget_code_l3}"
oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');"
/></td>
</td>
<td th:text="${#numbers.formatInteger(info.getsum_assign_amount5,1,'COMMA')}" class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '5'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount6,1,'COMMA')}" class="text-end"></td>
<td>
<input type="text" th:id="'org5_amount'+${i.index}" name="year" value="" class="w-100 text-end"
th:data-code="${info?.getbudget_code_l3}"
oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');"
/></td>
</td>
<td th:text="${#numbers.formatInteger(info.getsum_assign_amount6,1,'COMMA')}" class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '6'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount7,1,'COMMA')}" class="text-end"></td>
<td>
<input type="text" th:id="'org6_amount'+${i.index}" name="year" value="" class="w-100 text-end"
th:data-code="${info?.getbudget_code_l3}"
oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');"
/></td>
</td>
<td th:text="${#numbers.formatInteger(info.getsum_assign_amount7,1,'COMMA')}" class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '7'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount8,1,'COMMA')}" class="text-end"></td>
<td>
<input type="text" th:id="'org7_amount'+${i.index}" name="year" value="" class="w-100 text-end"
th:data-code="${info?.getbudget_code_l3}"
oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');"
/></td>
</td>
<td th:text="${#numbers.formatInteger(info.getsum_assign_amount8,1,'COMMA')}" class="text-end"></td>
</th:block>
</th:block>
</tr>
</tbody>
</table>
</form>
</div>
<div class="modal-footer">
<!-- <a href="javascript:;" class="btn btn-yellow" id="tempBtn">임시저장</a> -->
<a href="javascript:;" class="btn btn-blue" id="assignSaveBtn">저장</a>
<a href="javascript:;" class="btn btn-blue" id="modifyBtn" th:if="${cmd eq 'update'}">수정</a>
</div>
<!--<div class="modal-footer">
<a class="btn btn-yellow">임시저장</a>
<a class="btn btn-success">결재</a>
<a class="btn btn-blue">작성</a>
</div>-->
</html>

View File

@ -3,8 +3,7 @@
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/layout}"> layout:decorate="~{layout/layout}">
<th:block layout:fragment="script"> <th:block layout:fragment="script">
<!--<script type="text/javascript" th:src="@{/js/faRpt/faRpt.js}"></script> <script type="text/javascript" th:src="@{/js/budget/budgeting.js}"></script>
<script type="text/javascript" th:src="@{/js/modal/userModal.js}"></script>-->
</th:block> </th:block>
<div layout:fragment="content"> <div layout:fragment="content">
<main> <main>
@ -25,49 +24,30 @@
<div class="row mx-0"> <div class="row mx-0">
<div class="col-12 card bg-light text-center"> <div class="col-12 card bg-light text-center">
<div class="card-body"> <div class="card-body">
<!--<form method="get" th:action="${searchUrl}"> <form method="get" th:action="@{/budget/budgeting}">
<input type="hidden" name="activeTab" id="activeTab" th:value="${searchParams.activeTab}">
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
<div class="row justify-content-between py-1"> <div class="row justify-content-between py-1">
<div class="col-auto">
<select class="form-select form-select-sm" name="rowCnt" id="rowCnt">
<th:block th:each="num : ${#numbers.sequence(1,5)}">
<option th:value="${num*10}" th:text="${num*10}" th:selected="${searchParams.rowCnt eq num*10}"></option>
</th:block>
</select>
</div>
<div class="col-auto"> <div class="col-auto">
<div class="row justify-content-end"> <div class="row justify-content-end">
<div class="col-auto" th:if="${searchParams.activeTab ne 'send'}"> <div class="col-auto">
<select class="form-select form-select-sm" name="wrtOrgan"> <select class="form-select" name="year" id="searchYear">
<option value="">관서 선택</option> <option th:each="info, i : ${yearList}" th:value="${info.year}"
<th:block th:each="commonCode:${session.commonCode.get('OG')}"> th:selected="${searchParams?.year eq info.year}"
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq searchParams.wrtOrgan}"></option> th:text="${info.year}"></option>
</th:block>
</select> </select>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<input type="text" class="form-control form-control-sm" placeholder="제목" name="title" th:value="${searchParams.title}"> <button class="btn btn-primary" id="copyYearBtn">연도추가</button>
</div>
<div class="col-auto">
<input type="text" class="form-control form-control-sm" placeholder="해시태그" name="hashTags" th:value="${searchParams.hashTags}">
</div>
<div class="col-auto" th:if="${accessAuth eq 'ACC003'}">
<input type="text" class="form-control form-control-sm" placeholder="작성자" name="wrtUserNm" th:value="${searchParams.wrtUserNm}">
</div>
<div class="col-auto">
<div class="input-group w-auto input-daterange" id="dateSelectorDiv">
<input type="text" class="form-control form-control-sm" id="startDate" name="startDate" placeholder="시작일" autocomplete="off" readonly th:value="${searchParams.startDate}">
<input type="text" class="form-control form-control-sm" id="endDate" name="endDate" placeholder="종료일" autocomplete="off" readonly th:value="${searchParams.endDate}">
</div>
</div> </div>
<div class=" col-auto"> <div class=" col-auto">
<input type="submit" class="btn btn-sm btn-primary" id="searchBtn" value="검색"> <button class="btn btn-primary" id="deleteYearBtn">연도삭제</button>
</div> </div>
</div> </div>
</div> </div>
<div class="col-auto">
<button class="btn btn-green" id="excelDownload">엑셀다운로드</button>
</div>
</div> </div>
</form>--> </form>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<table class="table table-sm table-bordered table-hover"> <table class="table table-sm table-bordered table-hover">
@ -81,71 +61,51 @@
</tr> </tr>
</thead> </thead>
<tbody class="table-group-divider"> <tbody class="table-group-divider">
<!--<tr class="faRptTr" th:each="faRpt,cnt:${faRptList}"> <th:block>
<input type="hidden" class="faRptKey" th:value="${faRpt.faRptKey}"> <tr th:each="info, i : ${list}">
&lt;!&ndash; <td><input type="radio" th:value="${i.index}" name="budget"
<td><input type="checkbox" class="trChkBox"></td> th:data-name1="${info?.budgetNameL1}"
&ndash;&gt; th:data-name2="${info?.budgetNameL2}"
<td th:text="${cnt.count}"></td> th:data-name3="${info?.budgetNameL3}"
<td>
<th:block th:each="code:${session.commonCode.get('OG')}"> ></td>
<th:block th:if="${faRpt.wrtOrgan eq code.itemCd}" th:text="${code.itemValue}"></th:block> <td th:text="${info?.budgetNameL1}"></td>
</th:block> <td th:text="${info?.budgetNameL2}"></td>
</td> <td th:text="${info?.budgetNameL3}"></td>
<td> <td th:text="${#numbers.formatInteger(info?.amount, 1, 'COMMA')}" class="text-end"></td>
<th:block th:each="code:${session.commonCode.get('FRC')}"> </tr>
<th:text th:if="${code.itemCd eq faRpt.faRptType}" th:text="${code.itemValue}"></th:text> </th:block>
</th:block> <tr>
</td> <td colspan="4" class="text-end fw-bold"> 합계</td>
<td class="titleLeft" th:text="${faRpt.title}"></td> <td th:text="${#numbers.formatInteger(searchParams?.sum, 1, 'COMMA')}" class="text-end fw-bold"></td>
<td th:text="${faRpt.fileCnt eq null?'파일 없음':#strings.concat(faRpt.fileCnt,' 건')}"></td> </tr>
<td th:text="|${faRpt.readCnt}/${faRpt.userCnt}|"></td>
<td>
<th:block th:each="code:${session.commonCode.get(faRpt.wrtOrgan)}">
<th:block th:if="${faRpt.wrtPart eq code.itemCd}" th:text="${code.itemValue}"></th:block>
</th:block>
</td>
<td th:text="${faRpt.wrtUserNm}"></td>
<td th:text="${#temporals.format(faRpt.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
<td th:if="${faRpt.status ne 'receive'}">
<th:block th:each="commonCode:${session.commonCode.get('DST')}">
<th:text th:if="${commonCode.itemCd eq faRpt.status}" th:text="${commonCode.itemValue}"></th:text>
</th:block>
</td>
</tr>-->
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
<div class="row justify-content-between"> <div class="row justify-content-between">
<div class="col-auto"></div>
<div class="col-auto"> <div class="col-auto">
<!--<nav aria-label="Page navigation"> <button class="btn btn-success" id="addBtn">항목추가</button>
<ul class="pagination mb-0"> <button class="btn btn-success" id="updateBtn">항목명변경</button>
<th:block th:if="${searchParams.pageIndex>3}"> <button class="btn btn-success" id="deleteBtn">항목삭제</button>
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)-3}">
<a class="page-link" href="#" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
</th:block>
<th:block th:each="num : ${#numbers.sequence(searchParams.startNum, searchParams.endNum)}">
<li class="page-item" th:data-pageindex="${num}" th:classappend="${searchParams.pageIndex eq num?'active':''}">
<a class="page-link" href="#" th:text="${num}"></a>
</li>
</th:block>
<th:block th:if="${searchParams.maxNum>searchParams.endNum+2}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)+3}">
<a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
</th:block>
</ul>
</nav>-->
</div> </div>
<div class="col-auto"> <div class="col-auto">
<!--<input type="button" class="btn btn-success" value="등록" id="addFaRptBtn">-->
</div>
<div class="col-auto">
<button class="btn btn-primary" id="budgetBtn">예산편성</button>
<button class="btn btn-primary" id="budgetDeleteBtn">예산삭제</button>
</div>
</div>
<div class="modal fade" id="editModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="faRptEditModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xxl modal-dialog-scrollable">
<div class="modal-content" id="editModalContent"></div>
</div>
</div>
<div class="modal fade" id="budgetModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="faRptEditModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xxl modal-dialog-scrollable">
<div class="modal-content" id="budgetModalContent"></div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<style>
.scroll {
overflow-x: hidden;
overflow-y: auto;
height: 170px;
}
</style>
<div class="modal-header">
<h4 class="modal-title" th:text="${info eq null?'예산항목 추가':'예산항목 수정'}"></h4>
<button type="button" class="btn btn-danger" data-bs-dismiss="modal" aria-hidden="true">x</button>
</div>
<div class="modal-body">
<form id="budgetForm" action="#">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" id="year" name="year" value=""/>
<input type="hidden" id="prevNameL1" name="prevNameL1" th:value="${info?.nameL1}"/>
<input type="hidden" id="prevNameL2" name="prevNameL2" th:value="${info?.nameL2}"/>
<input type="hidden" id="prevNameL3" name="prevNameL3" th:value="${info?.nameL3}"/>
<div class="form-group row mb-2">
<div class="col-md-1 pe-0">
<label class="col-form-label">사업명
</label>
</div>
<div class="col-md-2">
<input type="text" class="form-control" id="nameL1" name="nameL1" th:value="${info?.nameL1}"
th:classappend="${cmd.equals('view') ?'view-mode' : ''}" th:disabled="${cmd.equals('view')}">
</div>
<div class="col-md-1 pe-0">
<label class="col-form-label">구분
</label>
</div>
<div class="col-md-2">
<input type="text" class="form-control" id="nameL2" name="nameL2" th:value="${info?.nameL2}"
th:classappend="${cmd.equals('view') ?'view-mode' : ''}" th:disabled="${cmd.equals('view')}">
</div>
<div class="col-md-1 pe-0">
<label class="col-form-label">세부내역
</label>
</div>
<div class="col-md-2">
<input type="text" class="form-control" id="nameL3" name="nameL3" th:value="${info?.nameL3}"
th:classappend="${cmd.equals('view') ?'view-mode' : ''}" th:disabled="${cmd.equals('view')}">
</div>
</div>
</form>
</div>
<div class="modal-footer">
<!-- <a href="javascript:;" class="btn btn-yellow" id="tempBtn">임시저장</a> -->
<a href="javascript:;" class="btn btn-blue" id="saveBtn" th:if="${cmd eq 'insert'}">저장</a>
<a href="javascript:;" class="btn btn-blue" id="modifyBtn" th:if="${cmd eq 'update'}">수정</a>
</div>
<!--<div class="modal-footer">
<a class="btn btn-yellow">임시저장</a>
<a class="btn btn-success">결재</a>
<a class="btn btn-blue">작성</a>
</div>-->
</html>

View File

@ -0,0 +1,62 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<style>
.scroll {
overflow-x: hidden;
overflow-y: auto;
height: 170px;
}
</style>
<div class="modal-header">
<h4 class="modal-title" th:text="예산편성"></h4>
<button type="button" class="btn btn-danger" data-bs-dismiss="modal" aria-hidden="true">x</button>
</div>
<div class="modal-body">
<form id="budgetForm" action="#">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" id="orgYear" name="orgYear" th:value="${searchParams.year}"/>
<input type="hidden" id="budgetCount" name="budgetCount" th:value="${#lists.size(list)}"/>
<div class=" panel-body text-center">
<table id="data-table-default" class="table table-striped table-bordered align-middle">
<thead>
<tr>
<th class="text-nowrap" width="20%">사업명</th>
<th class="text-nowrap" width="20%">구분</th>
<th class="text-nowrap" width="20%">세부내역</th>
<th class="text-nowrap" width="20%">편성액</th>
</tr>
</thead>
<tbody>
<tr class="odd gradeX reporterTr grid" th:each="info, i : ${list}">
<th:block>
</th:block>
<td th:text="${info?.budgetNameL1}"></td>
<td th:text="${info?.budgetNameL2}"></td>
<td th:text="${info?.budgetNameL3}"></td>
<td><input type="text"
th:data-name1="${info?.budgetNameL1}"
th:data-name2="${info?.budgetNameL2}"
th:data-name3="${info?.budgetNameL3}"
class="form-control text-end" th:id="'amount'+${i.index}" th:value="${info?.amount}"
oninput="this.value = parseInt(this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1'));">
</td>
</tr>
</tbody>
</table>
</div>
</form>
</div>
<div class="modal-footer">
<!-- <a href="javascript:;" class="btn btn-yellow" id="tempBtn">임시저장</a> -->
<a href="javascript:;" class="btn btn-blue" id="budgetSaveBtn">저장</a>
<a href="javascript:;" class="btn btn-blue" id="modifyBtn" th:if="${cmd eq 'update'}">수정</a>
</div>
<!--<div class="modal-footer">
<a class="btn btn-yellow">임시저장</a>
<a class="btn btn-success">결재</a>
<a class="btn btn-blue">작성</a>
</div>-->
</html>

View File

@ -3,8 +3,7 @@
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/layout}"> layout:decorate="~{layout/layout}">
<th:block layout:fragment="script"> <th:block layout:fragment="script">
<!--<script type="text/javascript" th:src="@{/js/faRpt/faRpt.js}"></script> <script type="text/javascript" th:src="@{/js/budget/expense.js}"></script>
<script type="text/javascript" th:src="@{/js/modal/userModal.js}"></script>-->
</th:block> </th:block>
<div layout:fragment="content"> <div layout:fragment="content">
<main> <main>
@ -25,40 +24,32 @@
<div class="row mx-0"> <div class="row mx-0">
<div class="col-12 card bg-light text-center"> <div class="col-12 card bg-light text-center">
<div class="card-body"> <div class="card-body">
<!--<form method="get" th:action="${searchUrl}"> <form id="assginForm" method="get" action="/budget/assign" onsubmit="return false;">
<input type="hidden" name="activeTab" id="activeTab" th:value="${searchParams.activeTab}"> <input type="hidden" name="year" id="year" th:value="${param.year}"/>
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}">
<div class="row justify-content-between py-1"> <div class="row justify-content-between py-1">
<div class="col-auto"> <div class="col-auto">
<select class="form-select form-select-sm" name="rowCnt" id="rowCnt">
<th:block th:each="num : ${#numbers.sequence(1,5)}">
<option th:value="${num*10}" th:text="${num*10}" th:selected="${searchParams.rowCnt eq num*10}"></option>
</th:block>
</select>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<div class="row justify-content-end"> <div class="row justify-content-end">
<div class="col-auto" th:if="${searchParams.activeTab ne 'send'}"> <div class="col-auto">
<select class="form-select form-select-sm" name="wrtOrgan"> </div>
<option value="">관서 선택</option> <div class="col-auto">
<th:block th:each="commonCode:${session.commonCode.get('OG')}"> </div>
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq searchParams.wrtOrgan}"></option> <div class="col-auto">
</th:block> </div>
<div class="col-auto">
<select class="form-select form-select-sm" name="code" id="code">
<option value="OG001" th:selected="${searchParams?.code eq '본청'}">본청</option>
<option th:each="code, i : ${codeList}" th:value="${code?.orgCode}"
th:text="${code?.orgName}"
th:selected="${searchParams?.code eq code.orgCode}">
</option>
</select> </select>
</div> </div>
<div class="col-auto">
<input type="text" class="form-control form-control-sm" placeholder="제목" name="title" th:value="${searchParams.title}">
</div>
<div class="col-auto">
<input type="text" class="form-control form-control-sm" placeholder="해시태그" name="hashTags" th:value="${searchParams.hashTags}">
</div>
<div class="col-auto" th:if="${accessAuth eq 'ACC003'}">
<input type="text" class="form-control form-control-sm" placeholder="작성자" name="wrtUserNm" th:value="${searchParams.wrtUserNm}">
</div>
<div class="col-auto"> <div class="col-auto">
<div class="input-group w-auto input-daterange" id="dateSelectorDiv"> <div class="input-group w-auto input-daterange" id="dateSelectorDiv">
<input type="text" class="form-control form-control-sm" id="startDate" name="startDate" placeholder="시작일" autocomplete="off" readonly th:value="${searchParams.startDate}"> <input type="text" class="form-control form-control-sm" id="stDate" name="stDate" placeholder="시작일" autocomplete="off" readonly th:value="${searchParams.stDate}">
<input type="text" class="form-control form-control-sm" id="endDate" name="endDate" placeholder="종료일" autocomplete="off" readonly th:value="${searchParams.endDate}"> <input type="text" class="form-control form-control-sm" id="edDate" name="edDate" placeholder="종료일" autocomplete="off" readonly th:value="${searchParams.edDate}">
</div> </div>
</div> </div>
<div class=" col-auto"> <div class=" col-auto">
@ -67,9 +58,9 @@
</div> </div>
</div> </div>
</div> </div>
</form>--> </form>
<div class="row"> <div class="row">
<div class="col-12"> <div class="table-responsive col-12">
<table class="table table-sm table-bordered table-hover"> <table class="table table-sm table-bordered table-hover">
<thead> <thead>
<tr class="table-secondary"> <tr class="table-secondary">
@ -79,75 +70,118 @@
<th rowspan="2">예산총액</th> <th rowspan="2">예산총액</th>
<th rowspan="2">예산총배정액<br>(누적)</th> <th rowspan="2">예산총배정액<br>(누적)</th>
<th colspan="2">집행액(총계)</th> <th colspan="2">집행액(총계)</th>
<th colspan="4">본청</th> <th colspan="4" class="w-400px" th:each="orglist : ${downOrgList}" th:text="${orglist.orgName}"></th>
<th colspan="4">중부청</th>
<th colspan="4">서해청</th>
<th colspan="4">남해청</th>
<th colspan="4">동해청</th>
<th colspan="4">제주청</th>
</tr> </tr>
<tr class="table-secondary"> <tr class="table-secondary">
<td>지출총액</td> <td>지출총액</td>
<td>보유잔액</td> <td>보유잔액</td>
<td>배정액</td> <th:block th:each="orglist : ${downOrgList}">
<td>지출총액</td> <th class="w-100px">배정액</th>
<td>잔액</td> <th class="w-100px">지출총액</th>
<td>집행률</td> <th class="w-100px">잔액</th>
<td>배정액</td> <th class="w-100px">집행률</th>
<td>지출총액</td> </th:block>
<td>잔액</td>
<td>집행률</td>
<td>배정액</td>
<td>지출총액</td>
<td>잔액</td>
<td>집행률</td>
<td>배정액</td>
<td>지출총액</td>
<td>잔액</td>
<td>집행률</td>
<td>배정액</td>
<td>지출총액</td>
<td>잔액</td>
<td>집행률</td>
<td>배정액</td>
<td>지출총액</td>
<td>잔액</td>
<td>집행률</td>
</tr> </tr>
</thead> </thead>
<tbody class="table-group-divider"> <tbody class="table-group-divider">
<!--<tr class="faRptTr" th:each="faRpt,cnt:${faRptList}"> <tr class="faRptTr" th:each="info, i : ${list}" onclick="getEditModal(this)"
<input type="hidden" class="faRptKey" th:value="${faRpt.faRptKey}"> th:data-name1="${info.getbudget_name_l1}"
&lt;!&ndash; th:data-name2="${info.getbudget_name_l2}"
<td><input type="checkbox" class="trChkBox"></td> th:data-name3="${info.getbudget_name_l3}">
&ndash;&gt; <td th:text="${info.getbudget_name_l1}"></td>
<td th:text="${cnt.count}"></td> <td th:text="${info.getbudget_name_l2}"></td>
<td> <td th:text="${info.getbudget_name_l3}"></td>
<th:block th:each="code:${session.commonCode.get('OG')}"> <td th:text="${#numbers.formatInteger(info.getplan_amount,1,'COMMA')}"
<th:block th:if="${faRpt.wrtOrgan eq code.itemCd}" th:text="${code.itemValue}"></th:block> class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.gettotal_assign_amount,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_t_amount,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getbalance_t_amount,1,'COMMA')}"
class="text-end"></td>
<th:block th:each="orglist, j : ${downOrgList}">
<th:block th:if="${j.index} == '0'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount1,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_p_amount1,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getblance_amount1,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_rate1,1,'COMMA')}"
class="text-end"></td>
</th:block> </th:block>
</td> <th:block th:if="${j.index} == '1'">
<td> <td th:text="${#numbers.formatInteger(info.getperiod_assign_amount2,1,'COMMA')}"
<th:block th:each="code:${session.commonCode.get('FRC')}"> class="text-end"></td>
<th:text th:if="${code.itemCd eq faRpt.faRptType}" th:text="${code.itemValue}"></th:text> <td th:text="${#numbers.formatInteger(info.getexpense_p_amount2,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getblance_amount2,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_rate2,1,'COMMA')}"
class="text-end"></td>
</th:block> </th:block>
</td> <th:block th:if="${j.index} == '2'">
<td class="titleLeft" th:text="${faRpt.title}"></td> <td th:text="${#numbers.formatInteger(info.getperiod_assign_amount3,1,'COMMA')}"
<td th:text="${faRpt.fileCnt eq null?'파일 없음':#strings.concat(faRpt.fileCnt,' 건')}"></td> class="text-end"></td>
<td th:text="|${faRpt.readCnt}/${faRpt.userCnt}|"></td> <td th:text="${#numbers.formatInteger(info.getexpense_p_amount3,1,'COMMA')}"
<td> class="text-end"></td>
<th:block th:each="code:${session.commonCode.get(faRpt.wrtOrgan)}"> <td th:text="${#numbers.formatInteger(info.getblance_amount3,1,'COMMA')}"
<th:block th:if="${faRpt.wrtPart eq code.itemCd}" th:text="${code.itemValue}"></th:block> class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_rate3,1,'COMMA')}"
class="text-end"></td>
</th:block> </th:block>
</td> <th:block th:if="${j.index} == '3'">
<td th:text="${faRpt.wrtUserNm}"></td> <td th:text="${#numbers.formatInteger(info.getperiod_assign_amount4,1,'COMMA')}"
<td th:text="${#temporals.format(faRpt.wrtDt, 'yyyy-MM-dd HH:mm')}"></td> class="text-end"></td>
<td th:if="${faRpt.status ne 'receive'}"> <td th:text="${#numbers.formatInteger(info.getexpense_p_amount4,1,'COMMA')}"
<th:block th:each="commonCode:${session.commonCode.get('DST')}"> class="text-end"></td>
<th:text th:if="${commonCode.itemCd eq faRpt.status}" th:text="${commonCode.itemValue}"></th:text> <td th:text="${#numbers.formatInteger(info.getblance_amount4,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_rate4,1,'COMMA')}"
class="text-end"></td>
</th:block> </th:block>
</td> <th:block th:if="${j.index} == '4'">
</tr>--> <td th:text="${#numbers.formatInteger(info.getperiod_assign_amount5,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_p_amount5,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getblance_amount5,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_rate5,1,'COMMA')}"
class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '5'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount6,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_p_amount6,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getblance_amount6,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_rate6,1,'COMMA')}"
class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '6'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount7,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_p_amount7,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getblance_amount7,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_rate7,1,'COMMA')}"
class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '7'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount8,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_p_amount8,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getblance_amount8,1,'COMMA')}"
class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_rate8,1,'COMMA')}"
class="text-end"></td>
</th:block>
</th:block>
</tr>
</tbody> </tbody>
</table> </table>
</div> </div>
@ -155,29 +189,6 @@
<div class="row justify-content-between"> <div class="row justify-content-between">
<div class="col-auto"></div> <div class="col-auto"></div>
<div class="col-auto"> <div class="col-auto">
<!--<nav aria-label="Page navigation">
<ul class="pagination mb-0">
<th:block th:if="${searchParams.pageIndex>3}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)-3}">
<a class="page-link" href="#" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
</th:block>
<th:block th:each="num : ${#numbers.sequence(searchParams.startNum, searchParams.endNum)}">
<li class="page-item" th:data-pageindex="${num}" th:classappend="${searchParams.pageIndex eq num?'active':''}">
<a class="page-link" href="#" th:text="${num}"></a>
</li>
</th:block>
<th:block th:if="${searchParams.maxNum>searchParams.endNum+2}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)+3}">
<a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
</th:block>
</ul>
</nav>-->
</div> </div>
<div class="col-auto"> <div class="col-auto">
<!--<input type="button" class="btn btn-success" value="등록" id="addFaRptBtn">--> <!--<input type="button" class="btn btn-success" value="등록" id="addFaRptBtn">-->

View File

@ -0,0 +1,142 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity5">
<style>
.scroll {
overflow-x: hidden;
overflow-y: auto;
height: 170px;
}
</style>
<div class="modal-header">
<h4 class="modal-title" th:text="${info eq null?'집행항목 등록/수정':'집행항목 등록/수정'}"></h4>
<button type="button" class="btn btn-danger" data-bs-dismiss="modal" aria-hidden="true">x</button>
</div>
<div class="modal-body">
<form id="budgetForm" action="#">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" id="prevYear" name="prevYear" th:value="${searchParams?.year}"/>
<input type="hidden" id="prevNameL1" name="prevNameL1" th:value="${searchParams?.nameL1}" />
<input type="hidden" id="prevNameL2" name="prevNameL2" th:value="${searchParams?.nameL2}" />
<input type="hidden" id="prevNameL3" name="prevNameL3" th:value="${searchParams?.nameL3}" />
<div class="row ">
<div class="row col-10 ">
<div class="col-auto">
<div class="input-group " id="">
사업명:
</div>
</div>
<div class="col-auto">
<div class="input-group " id="" th:text="${searchParams.nameL1}">
</div>
</div>
<div class="col-auto">
<div class="input-group " id="">
구분:
</div>
</div>
<div class="col-auto">
<div class="input-group " id="" th:text="${searchParams.nameL2}">
</div>
</div>
<div class="col-auto">
<div class="input-group " id="">
세부내역:
</div>
</div>
<div class="col-auto">
<div class="input-group " id="" th:text="${searchParams.nameL3}">
</div>
</div>
</div>
</div>
<table id="data-table-default" class="table table-striped table-bordered align-middle" >
<thead>
<tr class="table-secondary">
<th>등록일</th>
<th>집행내역</th>
<th>집행액</th>
<th>등록자</th>
<th>최종수정일</th>
</tr>
</thead>
<tbody>
<tr class="odd gradeX reporterTr grid" th:each="info, i : ${list}">
<td th:text="${info.getexpense_date}"></td>
<td th:text="${info.getexpense_item}"></td>
<td th:text="${info.getamount}"></td>
<td th:text="${info.getmodi_id}"></td>
<td th:text="${info.getmodi_date}"></td>
</tr>
<th:block th:if="${#lists.isEmpty(list)}">
<tr>
<td colspan="5">등록된 내역이 없습니다.</td>
</tr>
</th:block>
</tbody>
</table>
<div class="form-group row mb-2">
<div class="col-md-1 pe-0">
<label class="col-form-label">집행내역
</label>
</div>
<div class="col-md-2">
<input type="text" class="form-control" id="item" name="item">
</div>
<div class="col-md-1 pe-0">
<label class="col-form-label">집행액
</label>
</div>
<div class="col-md-2">
<input type="text" class="form-control" id="amount" name="amount" oninput="this.value = this.value.replace(/[^0-9.]/g, '').replace(/(\..*)\./g, '$1');">
</div>
<div class="col-md-1 pe-0">
<label class="col-form-label">등록일
</label>
</div>
<div class="col-md-2">
<div class="input-group input-daterange" id="dateSelectorDiv">
<input type="text" class="form-control form-control-sm w-35 dateSelector" id="expenseDate" name="expenseDate" placeholder="등록일" autocomplete="off" readonly >
</div>
</div>
<div class="col-md-2">
<a href="javascript:;" class="btn btn-blue" id="expenseSaveBtn">등록</a>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<!-- <a href="javascript:;" class="btn btn-yellow" id="tempBtn">임시저장</a> -->
<!-- <a href="javascript:;" class="btn btn-blue" id="assignSaveBtn">등록</a>
<a href="javascript:;" class="btn btn-blue" id="modifyBtn" th:if="${cmd eq 'update'}">수정</a> -->
</div>
<!--<div class="modal-footer">
<a class="btn btn-yellow">임시저장</a>
<a class="btn btn-success">결재</a>
<a class="btn btn-blue">작성</a>
</div>-->
</html>

View File

@ -3,8 +3,7 @@
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/layout}"> layout:decorate="~{layout/layout}">
<th:block layout:fragment="script"> <th:block layout:fragment="script">
<!--<script type="text/javascript" th:src="@{/js/faRpt/faRpt.js}"></script> <script type="text/javascript" th:src="@{/js/budget/statsOrg.js}"></script>
<script type="text/javascript" th:src="@{/js/modal/userModal.js}"></script>-->
</th:block> </th:block>
<div layout:fragment="content"> <div layout:fragment="content">
<main> <main>
@ -25,40 +24,52 @@
<div class="row mx-0"> <div class="row mx-0">
<div class="col-12 card bg-light text-center"> <div class="col-12 card bg-light text-center">
<div class="card-body"> <div class="card-body">
<!--<form method="get" th:action="${searchUrl}"> <form id="assginForm" method="get" action="/budget/assign" onsubmit="return false;">
<input type="hidden" name="activeTab" id="activeTab" th:value="${searchParams.activeTab}"> <input type="hidden" name="year" id="year" value=""/>
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}"> <ul class="nav nav-tabs" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link ivsgtTab active"
data-bs-toggle="tab" type="button" role="tab">총괄표</button>
</li>
<li class="nav-item" role="presentation" onclick="goOrg()">
<button class="nav-link ivsgtTab"
data-bs-toggle="tab" type="button" role="tab">관서별현황</button>
</li>
<li class="nav-item" role="presentation" onclick="goDetail()">
<button class="nav-link ivsgtTab"
data-bs-toggle="tab" type="button" role="tab">세부내역별현황</button>
</li>
</ul>
<div class="row justify-content-between py-1"> <div class="row justify-content-between py-1">
<div class="col-auto"> <div class="col-auto">
<select class="form-select form-select-sm" name="rowCnt" id="rowCnt">
<th:block th:each="num : ${#numbers.sequence(1,5)}">
<option th:value="${num*10}" th:text="${num*10}" th:selected="${searchParams.rowCnt eq num*10}"></option>
</th:block>
</select>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<div class="row justify-content-end"> <div class="row justify-content-end">
<div class="col-auto" th:if="${searchParams.activeTab ne 'send'}"> <div class="col-auto">
<select class="form-select form-select-sm" name="wrtOrgan"> </div>
<option value="">관서 선택</option> <div class="col-auto">
<th:block th:each="commonCode:${session.commonCode.get('OG')}"> </div>
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq searchParams.wrtOrgan}"></option> <div class="col-auto">
</th:block> <select class="form-select form-select-sm" name="won" id="won">
<option value="1" th:selected="${searchParams?.won eq '1'}"></option>
<option value="2" th:selected="${searchParams?.won eq '2'}">백원</option>
<option value="3" th:selected="${searchParams?.won eq '3'}">천원</option>
<option value="4" th:selected="${searchParams?.won eq '4'}">만원</option>
</select> </select>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<input type="text" class="form-control form-control-sm" placeholder="제목" name="title" th:value="${searchParams.title}"> <select class="form-select form-select-sm" name="code" id="code">
</div> <option value="OG001" th:selected="${searchParams?.code eq 'OG001'}">본청</option>
<div class="col-auto"> <option th:each="code, i : ${codeList}" th:value="${code?.orgCode}"
<input type="text" class="form-control form-control-sm" placeholder="해시태그" name="hashTags" th:value="${searchParams.hashTags}"> th:text="${code?.orgName}"
</div> th:selected="${searchParams?.code eq code.orgCode}">2023
<div class="col-auto" th:if="${accessAuth eq 'ACC003'}"> </option>
<input type="text" class="form-control form-control-sm" placeholder="작성자" name="wrtUserNm" th:value="${searchParams.wrtUserNm}"> </select>
</div> </div>
<div class="col-auto"> <div class="col-auto">
<div class="input-group w-auto input-daterange" id="dateSelectorDiv"> <div class="input-group w-auto input-daterange" id="dateSelectorDiv">
<input type="text" class="form-control form-control-sm" id="startDate" name="startDate" placeholder="시작일" autocomplete="off" readonly th:value="${searchParams.startDate}"> <input type="text" class="form-control form-control-sm" id="stDate" name="stDate" placeholder="시작일" autocomplete="off" readonly th:value="${searchParams.stDate}">
<input type="text" class="form-control form-control-sm" id="endDate" name="endDate" placeholder="종료일" autocomplete="off" readonly th:value="${searchParams.endDate}"> <input type="text" class="form-control form-control-sm" id="edDate" name="edDate" placeholder="종료일" autocomplete="off" readonly th:value="${searchParams.edDate}">
</div> </div>
</div> </div>
<div class=" col-auto"> <div class=" col-auto">
@ -67,7 +78,7 @@
</div> </div>
</div> </div>
</div> </div>
</form>--> </form>
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<table class="table table-sm table-bordered table-hover"> <table class="table table-sm table-bordered table-hover">
@ -82,38 +93,8 @@
</tr> </tr>
</thead> </thead>
<tbody class="table-group-divider"> <tbody class="table-group-divider">
<!--<tr class="faRptTr" th:each="faRpt,cnt:${faRptList}"> <tr class="faRptTr" th:each="info, i : ${list}">
<input type="hidden" class="faRptKey" th:value="${faRpt.faRptKey}"> </tr>
&lt;!&ndash;
<td><input type="checkbox" class="trChkBox"></td>
&ndash;&gt;
<td th:text="${cnt.count}"></td>
<td>
<th:block th:each="code:${session.commonCode.get('OG')}">
<th:block th:if="${faRpt.wrtOrgan eq code.itemCd}" th:text="${code.itemValue}"></th:block>
</th:block>
</td>
<td>
<th:block th:each="code:${session.commonCode.get('FRC')}">
<th:text th:if="${code.itemCd eq faRpt.faRptType}" th:text="${code.itemValue}"></th:text>
</th:block>
</td>
<td class="titleLeft" th:text="${faRpt.title}"></td>
<td th:text="${faRpt.fileCnt eq null?'파일 없음':#strings.concat(faRpt.fileCnt,' 건')}"></td>
<td th:text="|${faRpt.readCnt}/${faRpt.userCnt}|"></td>
<td>
<th:block th:each="code:${session.commonCode.get(faRpt.wrtOrgan)}">
<th:block th:if="${faRpt.wrtPart eq code.itemCd}" th:text="${code.itemValue}"></th:block>
</th:block>
</td>
<td th:text="${faRpt.wrtUserNm}"></td>
<td th:text="${#temporals.format(faRpt.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
<td th:if="${faRpt.status ne 'receive'}">
<th:block th:each="commonCode:${session.commonCode.get('DST')}">
<th:text th:if="${commonCode.itemCd eq faRpt.status}" th:text="${commonCode.itemValue}"></th:text>
</th:block>
</td>
</tr>-->
</tbody> </tbody>
</table> </table>
</div> </div>
@ -121,29 +102,6 @@
<div class="row justify-content-between"> <div class="row justify-content-between">
<div class="col-auto"></div> <div class="col-auto"></div>
<div class="col-auto"> <div class="col-auto">
<!--<nav aria-label="Page navigation">
<ul class="pagination mb-0">
<th:block th:if="${searchParams.pageIndex>3}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)-3}">
<a class="page-link" href="#" aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
</li>
</th:block>
<th:block th:each="num : ${#numbers.sequence(searchParams.startNum, searchParams.endNum)}">
<li class="page-item" th:data-pageindex="${num}" th:classappend="${searchParams.pageIndex eq num?'active':''}">
<a class="page-link" href="#" th:text="${num}"></a>
</li>
</th:block>
<th:block th:if="${searchParams.maxNum>searchParams.endNum+2}">
<li class="page-item" th:data-pageindex="${(searchParams.pageIndex)+3}">
<a class="page-link" href="#" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
</li>
</th:block>
</ul>
</nav>-->
</div> </div>
<div class="col-auto"> <div class="col-auto">
<!--<input type="button" class="btn btn-success" value="등록" id="addFaRptBtn">--> <!--<input type="button" class="btn btn-success" value="등록" id="addFaRptBtn">-->

View File

@ -0,0 +1,124 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/layout}">
<th:block layout:fragment="script">
<script type="text/javascript" th:src="@{/js/budget/statsDetail.js}"></script>
</th:block>
<div layout:fragment="content">
<main>
<input type="hidden" id="menuKey" value="1">
<div class="row justify-content-between">
<div class="col-auto">
<div class="mb-2">
<div class="d-inline align-middle"><i class="bi bi-square-fill"></i></div>
<h5 class="d-inline align-middle"> 예산통계</h5>
</div>
</div>
<div class="col-auto">
<p class="mb-0 mt-2">정보예산관리 > 예산통계</p>
</div>
</div>
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<div class="row mx-0">
<div class="col-12 card bg-light text-center">
<div class="card-body">
<form id="assginForm" method="get" action="/budget/assign" onsubmit="return false;">
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item" role="presentation" onclick="goAll()">
<button class="nav-link ivsgtTab"
data-bs-toggle="tab" type="button" role="tab">총괄표</button>
</li>
<li class="nav-item" role="presentation" onclick="goOrg()">
<button class="nav-link ivsgtTab"
data-bs-toggle="tab" type="button" role="tab">관서별현황</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link ivsgtTab active"
data-bs-toggle="tab" type="button" role="tab">세부내역별현황</button>
</li>
</ul>
<div class="row justify-content-between py-1">
<div class="col-auto">
</div>
<div class="col-auto">
<div class="row justify-content-end">
<div class="col-auto">
</div>
<div class="col-auto">
<select class="form-select form-select-sm" name="won" id="won">
<option value="1" th:selected="${searchParams?.won eq '1'}"></option>
<option value="2" th:selected="${searchParams?.won eq '2'}">백원</option>
<option value="3" th:selected="${searchParams?.won eq '3'}">천원</option>
<option value="4" th:selected="${searchParams?.won eq '4'}">만원</option>
</select>
</div>
<div class="col-auto">
<select class="form-select form-select-sm" name="year" id="year" onchange="changeYear()">
<option th:each="info, i : ${yearList}" th:value="${info.year}" th:selected="${searchParams?.year eq info.year}" th:text="${info.year}">2023</option>
</select>
</div>
<div class="col-auto">
<select class="form-select form-select-sm" name="item" id="item">
<option th:each="code, i : ${codeList}" th:value="${code?.getl3_code}" th:text="${code?.getl3_name}" th:selected="${searchParams?.item eq code.getl3_code}">2023</option>
</select>
</div>
<div class="col-auto">
<div class="input-group w-auto input-daterange" id="dateSelectorDiv">
<input type="text" class="form-control form-control-sm" id="stDate" name="stDate" placeholder="시작일" autocomplete="off" readonly th:value="${searchParams.stDate}">
<input type="text" class="form-control form-control-sm" id="edDate" name="edDate" placeholder="종료일" autocomplete="off" readonly th:value="${searchParams.edDate}">
</div>
</div>
<div class=" col-auto">
<input type="submit" class="btn btn-sm btn-primary" id="searchBtn" value="검색">
</div>
</div>
</div>
</div>
</form>
<div class="row">
<div class="col-12">
<table class="table table-sm table-bordered table-hover">
<thead>
<tr class="table-secondary">
<th rowspan="2">재무관서</th>
<th rowspan="2">예산총액</th>
<th rowspan="2">예산배정액<br/>(누적)</th>
<th rowspan="1" colspan="3">집행액(총계)</th>
</tr>
<tr class="table-secondary">
<th>지출액</th>
<th>보유잔액</th>
<th>집행비율</th>
</tr>
</tr>
</thead>
<tbody class="table-group-divider">
<tr class="faRptTr" th:each="info, i : ${list}">
<td th:text="${info.getorg_name}"></td>
<td th:text="${#numbers.formatInteger(info.getplan_amount,1,'COMMA')}"></td>
<td th:text="${#numbers.formatInteger(info.gettotal_assign_amount,1,'COMMA')}"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_t_amount,1,'COMMA')}"></td>
<td th:text="${#numbers.formatInteger(info.getbalance_t_amount,1,'COMMA')}"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_total_rate,1,'COMMA')}"></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row justify-content-between">
<div class="col-auto"></div>
<div class="col-auto">
</div>
<div class="col-auto">
<!--<input type="button" class="btn btn-success" value="등록" id="addFaRptBtn">-->
</div>
</div>
</div>
</div>
</div>
</main>
</div>
</html>

View File

@ -0,0 +1,182 @@
<!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"
xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
layout:decorate="~{layout/layout}">
<th:block layout:fragment="script">
<script type="text/javascript" th:src="@{/js/budget/statsOrg.js}"></script>
</th:block>
<div layout:fragment="content">
<main>
<input type="hidden" id="menuKey" value="1">
<div class="row justify-content-between">
<div class="col-auto">
<div class="mb-2">
<div class="d-inline align-middle"><i class="bi bi-square-fill"></i></div>
<h5 class="d-inline align-middle"> 예산통계</h5>
</div>
</div>
<div class="col-auto">
<p class="mb-0 mt-2">정보예산관리 > 예산통계</p>
</div>
</div>
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<div class="row mx-0">
<div class="col-12 card bg-light text-center">
<div class="card-body">
<form id="assginForm" method="get" action="/budget/assign" onsubmit="return false;">
<input type="hidden" name="year" id="year" value=""/>
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item" role="presentation" onclick="goAll()">
<button class="nav-link ivsgtTab"
data-bs-toggle="tab" type="button" role="tab">총괄표></button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link ivsgtTab active"
data-bs-toggle="tab" type="button" role="tab">관서별현황</button>
</li>
<li class="nav-item" role="presentation" onclick="goDetail()">
<button class="nav-link ivsgtTab"
data-bs-toggle="tab" type="button" role="tab">세부내역별현황</button>
</li>
</ul>
<div class="row justify-content-between py-1">
<div class="col-auto">
</div>
<div class="col-auto">
<div class="row justify-content-end">
<div class="col-auto">
</div>
<div class="col-auto">
</div>
<div class="col-auto">
<select class="form-select form-select-sm" name="won" id="won">
<option value="1" th:selected="${searchParams?.won eq '1'}"></option>
<option value="2" th:selected="${searchParams?.won eq '2'}">백원</option>
<option value="3" th:selected="${searchParams?.won eq '3'}">천원</option>
<option value="4" th:selected="${searchParams?.won eq '4'}">만원</option>
</select>
</div>
<div class="col-auto">
<select class="form-select form-select-sm" name="code" id="code">
<option value="OG001" th:selected="${searchParams?.code eq 'OG001'}">본청</option>
<option th:each="code, i : ${codeList}" th:value="${code?.orgCode}" th:text="${code?.orgName}" th:selected="${searchParams?.code eq code.orgCode}">2023</option>
</select>
</div>
<div class="col-auto">
<div class="input-group w-auto input-daterange" id="dateSelectorDiv">
<input type="text" class="form-control form-control-sm" id="stDate" name="stDate" placeholder="시작일" autocomplete="off" readonly th:value="${searchParams.stDate}">
<input type="text" class="form-control form-control-sm" id="edDate" name="edDate" placeholder="종료일" autocomplete="off" readonly th:value="${searchParams.edDate}">
</div>
</div>
<div class=" col-auto">
<input type="submit" class="btn btn-sm btn-primary" id="searchBtn" value="검색">
</div>
</div>
</div>
</div>
</form>
<div class="row">
<div class="col-12">
<table class="table table-sm table-bordered table-hover">
<thead>
<tr class="table-secondary">
<th rowspan="2">사업명</th>
<th rowspan="2">구분</th>
<th rowspan="2">세부내역</th>
<th rowspan="2">예산총액</th>
<th rowspan="2">예산총배정액<br/>(누적)</th>
<th rowspan="1" colspan="3">집행액(총계)</th>
<th colspan="4" th:each="orglist : ${downOrgList}" th:text="${orglist.orgName}"></th>
</tr>
<tr class="table-secondary">
<th>지출총액</th>
<th>보유잔액</th>
<th>진행률</th>
<th:block th:each="orglist : ${downOrgList}">
<th>배정액</th>
<th>지출총액</th>
<th>잔액</th>
<th>집행률</th>
</th:block>
</tr>
</thead>
<tbody class="table-group-divider">
<tr class="faRptTr" th:each="info, i : ${list}">
<td th:text="${info.getbudget_name_l1}"></td>
<td th:text="${info.getbudget_name_l2}"></td>
<td th:text="${info.getbudget_name_l3}"></td>
<td th:text="${#numbers.formatInteger(info.getplan_amount,1,'COMMA')}"></td>
<td th:text="${#numbers.formatInteger(info.gettotal_assign_amount,1,'COMMA')}"></td>
<td th:text="${info.getexpense_t_amount}"></td>
<td th:text="${#numbers.formatInteger(info.getbalance_t_amount,1,'COMMA')}"></td>
<th:block th:each="orglist, j : ${downOrgList}">
<th:block th:if="${j.index} == '0'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount1,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_p_amount1,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getblance_amount1,1,'COMMA')}" class="text-end">11</td>
<td th:text="${#numbers.formatInteger(info.getexpense_rate1,1,'COMMA')}" class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '1'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount2,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_p_amount2,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getblance_amount2,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_rate2,1,'COMMA')}" class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '2'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount3,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_p_amount3,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getblance_amount3,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_rate3,1,'COMMA')}" class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '3'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount4,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_p_amount4,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getblance_amount4,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_rate4,1,'COMMA')}" class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '4'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount5,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_p_amount5,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getblance_amount5,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_rate5,1,'COMMA')}" class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '5'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount6,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_p_amount6,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getblance_amount6,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_rate6,1,'COMMA')}" class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '6'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount7,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_p_amount7,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getblance_amount7,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_rate7,1,'COMMA')}" class="text-end"></td>
</th:block>
<th:block th:if="${j.index} == '7'">
<td th:text="${#numbers.formatInteger(info.getperiod_assign_amount8,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_p_amount8,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getblance_amount8,1,'COMMA')}" class="text-end"></td>
<td th:text="${#numbers.formatInteger(info.getexpense_rate8,1,'COMMA')}" class="text-end"></td>
</th:block>
</th:block>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row justify-content-between">
<div class="col-auto"></div>
<div class="col-auto">
</div>
<div class="col-auto">
<!--<input type="button" class="btn btn-success" value="등록" id="addFaRptBtn">-->
</div>
</div>
</div>
</div>
</div>
</main>
</div>
</html>