diff --git a/src/main/java/com/dbnt/faisp/main/budget/BudgetController.java b/src/main/java/com/dbnt/faisp/main/budget/BudgetController.java index 6c7168c9..7c9dd735 100644 --- a/src/main/java/com/dbnt/faisp/main/budget/BudgetController.java +++ b/src/main/java/com/dbnt/faisp/main/budget/BudgetController.java @@ -37,7 +37,7 @@ public class BudgetController { } System.out.println(requestDto.getYear()); List list = budgetService.selectBudgetingList(loginUser, requestDto); - List yearList = budgetService.selectBudgetingYearList(loginUser); + List yearList = budgetService.selectBudgetingYearList(loginUser); long sum = 0; for (int i = 0; i < list.size(); i++) { sum += list.get(i).getAmount(); @@ -60,7 +60,7 @@ public class BudgetController { } // 예산편성 - 연도 삭제 - @DeleteMapping("/budgeting/year") + @PostMapping("/budgeting/deleteYear") public ResultResponse deleteYearBudgeting(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.BudgetingCopyReqeust requestDto) { budgetService.deleteBudgetingYear(loginUser, requestDto); return new ResultResponse().successResponse(ResultResponseCode.SUCCESS); @@ -89,13 +89,13 @@ public class BudgetController { } //예산편성 - 항목변경 - @PutMapping("/budgeting/code") + @PostMapping("/budgeting/updateCode") public ResultResponse updateBudgeting(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.BudgetingUpdateReqeust requestDto) { return new ResultResponse(budgetService.updateBudgetingList(loginUser, requestDto)); } //예산편성 - 항목삭제 - @DeleteMapping("/budgeting/code") + @PostMapping("/budgeting/deleteCode") public ResultResponse deleteBudgeting(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.BudgetingInsertReqeust requestDto) { return new ResultResponse(budgetService.deleteBudgetingList(loginUser, requestDto)); } @@ -118,7 +118,7 @@ public class BudgetController { } // 예산편성 - 예산삭제 (0원 세팅) - @DeleteMapping("/budgeting") //@AuthenticationPrincipal + @PostMapping("/deleteBudgeting") //@AuthenticationPrincipal public ResultResponse deleteBudgeting(UserInfo loginUser, BudgetDto.BudgetingSaveReqeust requestDto) { budgetService.deleteBudgeting(loginUser, requestDto); return new ResultResponse().successResponse(ResultResponseCode.SUCCESS); @@ -270,33 +270,24 @@ public class BudgetController { @GetMapping("/stats") public ModelAndView viewStatsAllList(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.StatsSearchReqeust requestDto, Pageable pageable) { ModelAndView mav = new ModelAndView("budget/stats"); - String userOrgCode; - if (requestDto.getYear() != null) { - userOrgCode = requestDto.getCode(); - - List list = budgetService.selectSpGetbudgetStatOrg(loginUser, requestDto); - - mav.addObject("list", list); - } else { - // 로그인된 해당청 기본선택 - userOrgCode = loginUser.getOgCd(); - mav.addObject("list"); - - // 첫해 첫날 ~ 오늘날짜 기본세팅 + if(requestDto.getCode()==null){ + //기초 검색 데이터 세팅 + requestDto.setCode(loginUser.getOgCd()); + requestDto.setWon(1); LocalDate date = LocalDate.now(); - String CurrentYear = String.valueOf(date.getYear()) + "-01-01"; - requestDto.setStDate(LocalDate.parse(CurrentYear)); + requestDto.setStDate(LocalDate.parse(date.getYear()+"-01-01")); requestDto.setEdDate(date); } - //하위청 리스트 - List downOrgList = budgetService.selectDownOrg(loginUser.getOgCd()); - mav.addObject("downOrgList", downOrgList); - List codeList = budgetService.selectGetLowerOrgCodeByName(loginUser); - mav.addObject("codeList", codeList); + mav.addObject("budgetCode", budgetService.selectBudgetCodeToYear(requestDto.getStDate().getYear())); + mav.addObject("loginOrgan", loginUser.getOgCd()); + if(loginUser.getOgCd().equals("OG001")){ + //하위청 리스트 + List downOrgList = budgetService.selectDownOrg(loginUser.getOgCd()); + mav.addObject("downOrgList", downOrgList); + } mav.addObject("searchParams", requestDto); - return mav; } @@ -352,8 +343,9 @@ public class BudgetController { @GetMapping("/stats/detail") public ModelAndView viewStatsDetailList(@AuthenticationPrincipal UserInfo loginUser, BudgetDto.StatsSearchReqeust requestDto, Pageable pageable) { ModelAndView mav = new ModelAndView("budget/statsDetail"); + requestDto.setCode(loginUser.getOgCd()); - List yearList = budgetService.selectBudgetingYearList(loginUser); + List yearList = budgetService.selectBudgetingYearList(loginUser); if (requestDto.getStDate() != null) { // List list = budgetService.selectSpGetbudgetStatDetail(loginUser, requestDto); List list = budgetService.selectStatDetailList(requestDto); @@ -363,22 +355,19 @@ public class BudgetController { } else { LocalDate date = LocalDate.now(); List codeList = budgetService.selectSpGetL3Code(loginUser, date.getYear()); - requestDto.setYear(date.getYear()); + requestDto.setYear(requestDto.getYear()==null?date.getYear():requestDto.getYear()); mav.addObject("list"); mav.addObject("codeList", codeList); - requestDto.setCode(loginUser.getOgCd()); // 첫해 첫날 ~ 오늘날짜 기본세팅 - String CurrentYear = date.getYear() + "-01-01"; + String CurrentYear = requestDto.getYear() + "-01-01"; requestDto.setStDate(LocalDate.parse(CurrentYear)); - requestDto.setEdDate(date); + if(requestDto.getYear().equals(date.getYear())){ + requestDto.setEdDate(date); + }else{ + requestDto.setEdDate(LocalDate.parse(requestDto.getYear()+"-12-31")); + } } - //하위청 리스트 - 검색용 - mav.addObject("downOrgList", budgetService.selectDownOrg(loginUser.getOgCd())); - //하위청 리스트 - 목록용 - mav.addObject("downList", budgetService.selectDownOrg(requestDto.getCode())); - mav.addObject("loginOrgan", loginUser.getOgCd()); - mav.addObject("yearList", yearList); mav.addObject("searchParams", requestDto); diff --git a/src/main/java/com/dbnt/faisp/main/budget/mapper/BudgetMapper.java b/src/main/java/com/dbnt/faisp/main/budget/mapper/BudgetMapper.java index 548eda49..f2d7897c 100644 --- a/src/main/java/com/dbnt/faisp/main/budget/mapper/BudgetMapper.java +++ b/src/main/java/com/dbnt/faisp/main/budget/mapper/BudgetMapper.java @@ -9,7 +9,7 @@ import java.util.List; @Mapper public interface BudgetMapper { List callSpGetBudgetPlanInfo(BudgetParams param); - List callSpGetBudgetCodeYearList(); + List callSpGetBudgetCodeYearList(); UpdateResult callSpCopyBudgetItem(BudgetParams param); UpdateResult callBruteForceDeleteBudgetItem(BudgetParams param); UpdateResult callSpUpdateBudgetPlanCodeItem(BudgetParams param); @@ -32,4 +32,7 @@ public interface BudgetMapper { List selectBudgetAssignAmountList(BudgetParams params); List selectBudgetExpenseAmountList(BudgetParams params); List selectStatDetailList(BudgetParams params); + + List selectBudgetCodeL1List(String year); + List selectBudgetCodeL2List(String l1Code); } diff --git a/src/main/java/com/dbnt/faisp/main/budget/model/BudgetCode.java b/src/main/java/com/dbnt/faisp/main/budget/model/BudgetCode.java new file mode 100644 index 00000000..fc79ccf4 --- /dev/null +++ b/src/main/java/com/dbnt/faisp/main/budget/model/BudgetCode.java @@ -0,0 +1,14 @@ +package com.dbnt.faisp.main.budget.model; + +import lombok.Getter; +import lombok.Setter; + +import java.util.List; + +@Getter +@Setter +public class BudgetCode { + List codeL1List; + List codeL2List; + List codeL3List; +} diff --git a/src/main/java/com/dbnt/faisp/main/budget/model/TblBudgetCodeL1.java b/src/main/java/com/dbnt/faisp/main/budget/model/TblBudgetCodeL1.java index 9cb78694..c112bc04 100644 --- a/src/main/java/com/dbnt/faisp/main/budget/model/TblBudgetCodeL1.java +++ b/src/main/java/com/dbnt/faisp/main/budget/model/TblBudgetCodeL1.java @@ -34,6 +34,9 @@ public class TblBudgetCodeL1 { @Column(name = "modi_date") private LocalDateTime modiDate; + @Transient + private Integer colspan; + public void setData(String l1Code, String l1Name, String l1Year, String useTag, Integer seqOrd, String remark, LocalDateTime modiDate){ this.l1Code = l1Code; this.l1Name = l1Name; diff --git a/src/main/java/com/dbnt/faisp/main/budget/model/TblBudgetCodeL2.java b/src/main/java/com/dbnt/faisp/main/budget/model/TblBudgetCodeL2.java index 75b1426b..f2c0e87d 100644 --- a/src/main/java/com/dbnt/faisp/main/budget/model/TblBudgetCodeL2.java +++ b/src/main/java/com/dbnt/faisp/main/budget/model/TblBudgetCodeL2.java @@ -6,10 +6,7 @@ import lombok.Setter; import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicUpdate; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; +import javax.persistence.*; import java.time.LocalDateTime; @Getter @@ -37,6 +34,8 @@ public class TblBudgetCodeL2 { @Column(name = "modi_date") private LocalDateTime modiDate; + @Transient + private Integer colspan; public void setData(String l2Code, String l2Name, String l1Code, String useTag, Integer seqOrd, String remark, LocalDateTime modiDate){ this.l2Code = l2Code; diff --git a/src/main/java/com/dbnt/faisp/main/budget/model/TblBudgetCodeL3.java b/src/main/java/com/dbnt/faisp/main/budget/model/TblBudgetCodeL3.java index 25619ccc..3717784e 100644 --- a/src/main/java/com/dbnt/faisp/main/budget/model/TblBudgetCodeL3.java +++ b/src/main/java/com/dbnt/faisp/main/budget/model/TblBudgetCodeL3.java @@ -6,10 +6,7 @@ import lombok.Setter; import org.hibernate.annotations.DynamicInsert; import org.hibernate.annotations.DynamicUpdate; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.Table; +import javax.persistence.*; import java.time.LocalDateTime; @Getter @@ -37,6 +34,9 @@ public class TblBudgetCodeL3 { @Column(name = "modi_date") private LocalDateTime modiDate; + @Transient + private Integer colspan; + public void setData(String l3Code, String l3Name, String l2Code, String useTag, Integer seqOrd, String remark, LocalDateTime modiDate){ this.l3Code = l3Code; this.l3Name = l3Name; diff --git a/src/main/java/com/dbnt/faisp/main/budget/model/result/StatsDetailResult.java b/src/main/java/com/dbnt/faisp/main/budget/model/result/StatsDetailResult.java index 37ada3c2..025aad22 100644 --- a/src/main/java/com/dbnt/faisp/main/budget/model/result/StatsDetailResult.java +++ b/src/main/java/com/dbnt/faisp/main/budget/model/result/StatsDetailResult.java @@ -6,6 +6,7 @@ import lombok.Setter; @Getter @Setter public class StatsDetailResult { + String parentOrgan; String organCd; Double planAmount = 0d; Double assignAmount = 0d; diff --git a/src/main/java/com/dbnt/faisp/main/budget/repository/TblBudgetCodeL1Repository.java b/src/main/java/com/dbnt/faisp/main/budget/repository/TblBudgetCodeL1Repository.java index f32e60c0..67ca6d0a 100644 --- a/src/main/java/com/dbnt/faisp/main/budget/repository/TblBudgetCodeL1Repository.java +++ b/src/main/java/com/dbnt/faisp/main/budget/repository/TblBudgetCodeL1Repository.java @@ -3,9 +3,11 @@ package com.dbnt.faisp.main.budget.repository; import com.dbnt.faisp.main.budget.model.TblBudgetCodeL1; import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; import java.util.Optional; public interface TblBudgetCodeL1Repository extends JpaRepository { Optional findByL1NameAndL1YearAndUseTag(String l1Name, String l1Year, String useTag); Optional findTop1ByL1YearOrderByL1CodeDesc(String l1Year); + List findByL1YearOrderByL1Code(String year); } diff --git a/src/main/java/com/dbnt/faisp/main/budget/repository/TblBudgetCodeL2Repository.java b/src/main/java/com/dbnt/faisp/main/budget/repository/TblBudgetCodeL2Repository.java index 26b02b63..3296e92e 100644 --- a/src/main/java/com/dbnt/faisp/main/budget/repository/TblBudgetCodeL2Repository.java +++ b/src/main/java/com/dbnt/faisp/main/budget/repository/TblBudgetCodeL2Repository.java @@ -3,10 +3,13 @@ package com.dbnt.faisp.main.budget.repository; import com.dbnt.faisp.main.budget.model.TblBudgetCodeL2; import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; import java.util.Optional; public interface TblBudgetCodeL2Repository extends JpaRepository { Optional findByL2NameAndL1CodeAndUseTag(String codeL2Name, String l1Code, String y); Optional findTop1ByL1CodeOrderByL2CodeDesc(String l1Code); + + List findByL1CodeOrderByL2Code(String l1Code); } diff --git a/src/main/java/com/dbnt/faisp/main/budget/repository/TblBudgetCodeL3Repository.java b/src/main/java/com/dbnt/faisp/main/budget/repository/TblBudgetCodeL3Repository.java index 8b54244b..3d1ef63e 100644 --- a/src/main/java/com/dbnt/faisp/main/budget/repository/TblBudgetCodeL3Repository.java +++ b/src/main/java/com/dbnt/faisp/main/budget/repository/TblBudgetCodeL3Repository.java @@ -3,10 +3,13 @@ package com.dbnt.faisp.main.budget.repository; import com.dbnt.faisp.main.budget.model.TblBudgetCodeL3; import org.springframework.data.jpa.repository.JpaRepository; +import java.util.List; import java.util.Optional; public interface TblBudgetCodeL3Repository extends JpaRepository { Optional findByL3NameAndL2CodeAndUseTag(String codeL3Name, String l2Code, String useTag); Optional findTop1ByL2CodeOrderByL3CodeDesc(String l2Code); + + List findByL2CodeAndUseTagOrderByL3Code(String l2Code, String useTag); } diff --git a/src/main/java/com/dbnt/faisp/main/budget/service/BudgetService.java b/src/main/java/com/dbnt/faisp/main/budget/service/BudgetService.java index d801f071..a6d58a42 100644 --- a/src/main/java/com/dbnt/faisp/main/budget/service/BudgetService.java +++ b/src/main/java/com/dbnt/faisp/main/budget/service/BudgetService.java @@ -43,7 +43,7 @@ public class BudgetService { return budgetMapper.callSpGetBudgetPlanInfo(param); } - public List selectBudgetingYearList(UserInfo loginUser){ + public List selectBudgetingYearList(UserInfo loginUser){ // return budgetRepository.callSpGetBudgetCodeYearList(); return budgetMapper.callSpGetBudgetCodeYearList(); } @@ -572,7 +572,41 @@ public class BudgetService { params.setStDate(requestDto.getStDate()); params.setEdDate(requestDto.getEdDate()); params.setWon(requestDto.getWon()); - List statsList = budgetMapper.selectStatDetailList(params); + List statsList = new ArrayList<>(); + List tempList = budgetMapper.selectStatDetailList(params); + if(requestDto.getCode().equals("OG001")){ + StatsDetailResult total = new StatsDetailResult(); + for(StatsDetailResult stats: tempList){ + if(stats.getParentOrgan()!=null){ + params.setCode(stats.getOrganCd()); + List subList = budgetMapper.selectStatDetailList(params); + StatsDetailResult subTotal = new StatsDetailResult(); + subTotal.setOrganCd(stats.getOrganCd()); + subTotal.setParentOrgan(stats.getOrganCd()); + for(StatsDetailResult sub: subList){ + total.setAssignAmount(total.getAssignAmount()+sub.getAssignAmount()); + total.setExpenseAmount(total.getExpenseAmount()+sub.getExpenseAmount()); + subTotal.setAssignAmount(subTotal.getAssignAmount()+sub.getAssignAmount()); + subTotal.setExpenseAmount(subTotal.getExpenseAmount()+sub.getExpenseAmount()); + } + statsList.add(subTotal); + statsList.addAll(subList); + }else{ + total.setAssignAmount(total.getAssignAmount()+stats.getAssignAmount()); + total.setExpenseAmount(total.getExpenseAmount()+stats.getExpenseAmount()); + statsList.add(stats); + } + } + tempList.clear(); + tempList.addAll(statsList); + statsList.clear(); + statsList.add(total); + statsList.addAll(tempList); + }else{ + statsList.addAll(tempList); + } + + Double wonUnit = params.getWon().doubleValue(); for(StatsDetailResult stat : statsList){ stat.setPlanAmount(stat.getPlanAmount()/wonUnit); @@ -593,6 +627,29 @@ public class BudgetService { return budgetMapper.callSpGetBudgetCodeL3(params); } + public BudgetCode selectBudgetCodeToYear(Integer year) { + BudgetCode budgetCode = new BudgetCode(); + List codeL1List = budgetMapper.selectBudgetCodeL1List(year.toString()); + List codeL2List = new ArrayList<>(); + List codeL3List = new ArrayList<>(); + for(TblBudgetCodeL1 codeL1: codeL1List){ + List temp2List = budgetMapper.selectBudgetCodeL2List(codeL1.getL1Code()); + int l1Colspan = 0; + for(TblBudgetCodeL2 codeL2: temp2List){ + List temp3List = codeL3Repository.findByL2CodeAndUseTagOrderByL3Code(codeL2.getL2Code(), "Y"); + codeL2.setColspan(temp3List.size()); + l1Colspan += temp3List.size(); + codeL3List.addAll(temp3List); + } + codeL2List.addAll(temp2List); + codeL1.setColspan(l1Colspan); + } + budgetCode.setCodeL1List(codeL1List); + budgetCode.setCodeL2List(codeL2List); + budgetCode.setCodeL3List(codeL3List); + return budgetCode; + } + // 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"); diff --git a/src/main/resources/mybatisMapper/BudgetMapper.xml b/src/main/resources/mybatisMapper/BudgetMapper.xml index 4ce4226f..5a5e70cb 100644 --- a/src/main/resources/mybatisMapper/BudgetMapper.xml +++ b/src/main/resources/mybatisMapper/BudgetMapper.xml @@ -16,7 +16,7 @@ modi_date as modiDate from sp_get_budget_plan_info(#{code1}, #{code2}, #{code3}) - select l1_year as year from sp_get_budget_code_year_list( ) @@ -191,43 +191,62 @@ + + + \ No newline at end of file diff --git a/src/main/resources/static/js/budget/assign.js b/src/main/resources/static/js/budget/assign.js index 762915ed..ee13e499 100644 --- a/src/main/resources/static/js/budget/assign.js +++ b/src/main/resources/static/js/budget/assign.js @@ -22,6 +22,14 @@ $(document).ready(function(){ } }); +$(document).on('change', '.amountInput', function (){ + const pattern = /^[+-]?\d*(\.?\d*)?$/; + if(!pattern.test(this.value)){ + this.value = ""; + this.focus(); + } +}) + $(document).on('click', '#assignsearchBtn', function () { assignSearch(); }) @@ -70,10 +78,7 @@ $(document).on('click', '#deleteBtn', function (){ $.ajax({ type : 'DELETE', data : params, - url : "/budget/budgeting/code", - - beforeSend: function (xhr){ xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val()); }, diff --git a/src/main/resources/static/js/budget/budgeting.js b/src/main/resources/static/js/budget/budgeting.js index 554edcee..796c98d9 100644 --- a/src/main/resources/static/js/budget/budgeting.js +++ b/src/main/resources/static/js/budget/budgeting.js @@ -17,9 +17,9 @@ $(document).on('click', '#deleteBtn', function () { params.nameL3 = $("input[name='budget']:checked")[0].dataset.name3; console.dir(params); $.ajax({ - type: 'DELETE', + type: 'POST', data: params, - url: "/budget/budgeting/code", + url: "/budget/budgeting/deleteCode", beforeSend: function (xhr){ xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val()); }, @@ -88,11 +88,11 @@ $(document).on('click', '#deleteYearBtn', function () { params.year = selected_year; console.dir(params); $.ajax({ - type: 'DELETE', + type: 'POST', data: params, // data: JSON.stringify(params), // contentType: 'application/json; charset=utf-8', - url: "/budget/budgeting/year", + url: "/budget/budgeting/deleteYear", beforeSend: function (xhr) { xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val()); }, @@ -122,9 +122,9 @@ $(document).on('click', '#budgetDeleteBtn', function () { params.year = $("#searchYear").val(); // console.dir(params); $.ajax({ - type: 'DELETE', + type: 'POST', data: params, - url: "/budget/budgeting", + url: "/budget/deleteBudgeting", beforeSend: function (xhr) { xhr.setRequestHeader($("[name='_csrf_header']").val(), $("[name='_csrf']").val()); }, @@ -379,9 +379,9 @@ $(document).on('click', '#modifyBtn', function () { if (confirm("수정하시겠습니까?")) { const formData = new FormData($("#budgetForm")[0]); $.ajax({ - type: 'PUT', + type: 'POST', data: formData, - url: "/budget/budgeting/code", + url: "/budget/budgeting/updateCode", processData: false, contentType: false, success: function (data) { diff --git a/src/main/resources/static/js/budget/expense.js b/src/main/resources/static/js/budget/expense.js index 03b2f2aa..80599f68 100644 --- a/src/main/resources/static/js/budget/expense.js +++ b/src/main/resources/static/js/budget/expense.js @@ -1,333 +1,341 @@ $(function(){ - $("#dateSelectorDiv").datepicker({ - format: "yyyy-mm-dd", - language: "ko", - autoclose: true - }); + $("#dateSelectorDiv").datepicker({ + format: "yyyy-mm-dd", + language: "ko", + autoclose: true + }); }) $(document).on('click', '#addBtn', function (){ - getEditModal(0) + getEditModal(0) +}) + +$(document).on('change', '.amountInput', function (){ + const pattern = /^[+-]?\d*(\.?\d*)?$/; + if(!pattern.test(this.value)){ + this.value = ""; + this.focus(); + } }) $(document).ready(function(){ - if ($("#ResultRow").text().trim() == "") { - expenseSearch(); - } else { - contentFade("out"); - } + if ($("#ResultRow").text().trim() == "") { + expenseSearch(); + } else { + contentFade("out"); + } }); $(document).on('click', '#searchBtn', function (){ - expenseSearch(); + expenseSearch(); }) function expenseSearch() { - var stDate = $("#stDate").val() - var edDate = $("#edDate").val() - if($("#stDate").val() ==""){ - alert('시작일을 선택해주세요'); - return; - } + var stDate = $("#stDate").val() + var edDate = $("#edDate").val() + if($("#stDate").val() ==""){ + alert('시작일을 선택해주세요'); + return; + } - if($("#edDate").val() ==""){ - alert('종료일을 선택해주세요'); - return; - } + if($("#edDate").val() ==""){ + alert('종료일을 선택해주세요'); + return; + } - stDate = new Date(stDate); - edDate = new Date(edDate); + 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()); + if(stDate.getFullYear() != edDate.getFullYear()){ + alert('같은 년도의 데이터만 조회가능합니다. ex)2021-01-01 ~ 2021-12-31'); + return; + } + $("#year").val(stDate.getFullYear()); - contentFade("in"); - location.href="/budget/expense?year="+$("#year").val() + "&stDate=" + $("#stDate").val() + "&edDate=" + $("#edDate").val() + "&code=" +$("#code").val(); + contentFade("in"); + 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, + 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", + 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("삭제에 실패하였습니다."); - } - }) - } + 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; + 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(){ + } - 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) + $.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(); - } - }) + }, + 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(){ + 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())); + const target = event.target; + const no = (Number($(this).find(".key").val())); }) function getEditModal(v){ - params = {} + 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){ + 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); + $("#editModalContent").empty().append(html); - $(".dateSelector").datepicker({ - format: "yyyy-mm-dd", - language: "ko", - autoclose: true - }); + $(".dateSelector").datepicker({ + format: "yyyy-mm-dd", + language: "ko", + autoclose: true + }); - $("#editModal").modal('show'); + $("#editModal").modal('show'); - }, - error:function(){ + }, + 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; - } + 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(); + 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("저장하시겠습니까?")){ + 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("저장에 실패하였습니다."); - } - }) - } + $.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($("#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("저장에 실패하였습니다."); - } - }) - } + 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("저장에 실패하였습니다."); - } - }) - } + 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("저장에 실패하였습니다."); + } + }) + } }); diff --git a/src/main/resources/static/js/budget/statsCommon.js b/src/main/resources/static/js/budget/statsCommon.js new file mode 100644 index 00000000..a425303b --- /dev/null +++ b/src/main/resources/static/js/budget/statsCommon.js @@ -0,0 +1,17 @@ +$(function(){ + $("#dateSelectorDiv").datepicker({ + format: "yyyy-mm-dd", + language: "ko", + autoclose: true + }); +}) + +$(document).on('click', '#summaryTab', function (){ + location.href = "/budget/stats"; +}) +$(document).on('click', '#orgTab', function (){ + location.href = "/budget/stats/org"; +}) +$(document).on('click', '#detailTab', function (){ + location.href = "/budget/stats/detail"; +}) \ No newline at end of file diff --git a/src/main/resources/static/js/budget/statsDetail.js b/src/main/resources/static/js/budget/statsDetail.js index 32eb0d3b..ec97f1c9 100644 --- a/src/main/resources/static/js/budget/statsDetail.js +++ b/src/main/resources/static/js/budget/statsDetail.js @@ -1,308 +1,42 @@ -$(function(){ - $("#dateSelectorDiv").datepicker({ - format: "yyyy-mm-dd", - language: "ko", - autoclose: true - }); -}) - -$(document).on('click', '#addBtn', function (){ - getEditModal(0) -}) $(document).ready(function(){ - if ($("#ResultRow").text().trim() == "") { - statsSearch(); - } else { - contentFade("out"); - } + if ($("#ResultRow").text().trim() == "") { + statsSearch(); + } else { + contentFade("out"); + } }); $(document).on('click', '#searchBtn', function (){ - statsSearch(); + statsSearch(); +}) + +$(document).on('change', '#year', function (){ + location.href="/budget/stats/detail?year="+$("#year").val(); }) function statsSearch () { - var stDate = $("#stDate").val() - var edDate = $("#edDate").val() - if($("#stDate").val() ==""){ - alert('시작일을 선택해주세요'); - return; - } + var stDate = $("#stDate").val() + var edDate = $("#edDate").val() + if($("#stDate").val() ==""){ + alert('시작일을 선택해주세요'); + return; + } - if($("#edDate").val() ==""){ - alert('종료일을 선택해주세요'); - return; - } + if($("#edDate").val() ==""){ + alert('종료일을 선택해주세요'); + return; + } - stDate = new Date(stDate); - edDate = new Date(edDate); + stDate = new Date(stDate); + edDate = new Date(edDate); - if(stDate.getFullYear() != edDate.getFullYear()){ - alert('같은 년도의 데이터만 조회가능합니다. ex)2021-01-01 ~ 2021-12-31'); - return; - } + if(stDate.getFullYear() != edDate.getFullYear()){ + alert('같은 년도의 데이터만 조회가능합니다. ex)2021-01-01 ~ 2021-12-31'); + return; + } - contentFade("in"); - //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="+$("#code").val()+"&won="+$("#won").val()+"&item="+$("#item").val(); + contentFade("in"); + //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="+$("#code").val()+"&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("저장에 실패하였습니다."); - } - }) - } -}); diff --git a/src/main/resources/static/js/budget/statsOrg.js b/src/main/resources/static/js/budget/statsOrg.js index edb20ab7..71d5b9b7 100644 --- a/src/main/resources/static/js/budget/statsOrg.js +++ b/src/main/resources/static/js/budget/statsOrg.js @@ -1,14 +1,3 @@ -$(function(){ - $("#dateSelectorDiv").datepicker({ - format: "yyyy-mm-dd", - language: "ko", - autoclose: true - }); -}) - -$(document).on('click', '#addBtn', function (){ - getEditModal(0) -}) $(document).ready(function(){ if ($("#ResultRow").text().trim() == "") { @@ -47,282 +36,3 @@ function statsSearch() { contentFade("in"); 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("저장에 실패하였습니다."); - } - }) - } -}); diff --git a/src/main/resources/templates/budget/assignEditModal.html b/src/main/resources/templates/budget/assignEditModal.html index ab1d765b..bac5eb75 100644 --- a/src/main/resources/templates/budget/assignEditModal.html +++ b/src/main/resources/templates/budget/assignEditModal.html @@ -54,80 +54,42 @@ - - + - - - + - - - + - - - + - - - + - - - + - - - + - - - + diff --git a/src/main/resources/templates/budget/budgeting.html b/src/main/resources/templates/budget/budgeting.html index 61c2d610..b949c655 100644 --- a/src/main/resources/templates/budget/budgeting.html +++ b/src/main/resources/templates/budget/budgeting.html @@ -30,9 +30,8 @@
diff --git a/src/main/resources/templates/budget/expenseEditModal.html b/src/main/resources/templates/budget/expenseEditModal.html index e2693d69..54df5820 100644 --- a/src/main/resources/templates/budget/expenseEditModal.html +++ b/src/main/resources/templates/budget/expenseEditModal.html @@ -21,49 +21,17 @@ - -
-
-
- 사업명: - -
+
-
- - -
+
-
- 구분: - -
+
-
-
- - -
-
-
-
- 세부내역: - -
-
-
-
- - -
-
- -
@@ -83,7 +51,6 @@ - @@ -101,13 +68,12 @@
-
- +
- - - - - - - - - - - - - - -
구분
프로그램단위사업세부사업
-
- -
-
-
-
-
- -
+
+
+

정보예산관리 > 예산통계

+
+ + + +
+
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
구분프로그램합계집행률
단위사업
세부사업
+
+
- +
+
+ \ No newline at end of file diff --git a/src/main/resources/templates/budget/statsDetail.html b/src/main/resources/templates/budget/statsDetail.html index 540403a0..e293f9f3 100644 --- a/src/main/resources/templates/budget/statsDetail.html +++ b/src/main/resources/templates/budget/statsDetail.html @@ -3,138 +3,131 @@ xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout/layout}"> - + +
-
- -
-
-
-
-
예산통계
-
-
-
-

정보예산관리 > 예산통계

-
+
+ +
+
+
+
+
예산통계
- - -
-
-
-
- -
-
-
-
-
-
- - - - - - -
-
- -
-
- -
-
- -
-
-
- - -
-
-
- -
-
-
-
-
-
-
- - - + +
+

정보예산관리 > 예산통계

+
+ + + +
+
+
+
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+ +
+
+
+
+ +
+
+
+ + - - - - - - - - - - - - - - - - - - - - - - -
재무관서예산배정액
(누적)
집행액(총계)
지출액보유잔액집행비율
- - - -
-
-
-
-
-
-
-
- -
-
-
+ 재무관서 + + 예산배정액
(누적) + 집행액(총계) + + + 지출액 + 보유잔액 + 집행비율 + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+ +
+
-
+
+
+ \ No newline at end of file diff --git a/src/main/resources/templates/budget/statsOrg.html b/src/main/resources/templates/budget/statsOrg.html index 9f5e6913..dfc4dd93 100644 --- a/src/main/resources/templates/budget/statsOrg.html +++ b/src/main/resources/templates/budget/statsOrg.html @@ -3,192 +3,190 @@ xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout/layout}"> - + +
-
- -
-
-
-
-
예산통계
+
+ +
+
+
+
+
예산통계
+
+
+
+

정보예산관리 > 예산통계

+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+
+
+
+
+ +
+
+ + + + + + +
+
+
+ + +
+
+
+ +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
사업명구분세부내역예산총액예산총배정액
(누적)
집행액(총계)
지출총액보유잔액진행률배정액지출총액잔액집행률
11
+
+
+
+
+
-

정보예산관리 > 예산통계

+
+
- - -
-
-
-
- - -
-
-
-
-
-
-
-
-
-
- -
-
- - - - - - -
-
-
- - -
-
-
- -
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
사업명구분세부내역예산총액예산총배정액
(누적)
집행액(총계)
지출총액보유잔액진행률배정액지출총액잔액집행률
11
-
-
-
-
-
-
-
- -
-
-
-
-
-
+
+
+
\ No newline at end of file