fix : 외사첩보망 견문관리 해고/연장보고 완료

master
TaehunPark 2023-01-26 18:30:27 +09:00
parent c7b79001c6
commit 3464ce0e24
10 changed files with 133 additions and 24 deletions

View File

@ -7,6 +7,7 @@ import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.IntelligenceAnalyzeA
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.OperationPlan; import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.OperationPlan;
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.OperationPlanApprv; import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.OperationPlanApprv;
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.FireExtensionReport; import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.FireExtensionReport;
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.FireExtensionReportApprv;
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.service.IntelligenceNetworkService; import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.service.IntelligenceNetworkService;
import com.dbnt.faisp.main.userInfo.model.UserInfo; import com.dbnt.faisp.main.userInfo.model.UserInfo;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -158,7 +159,7 @@ public class IntelligenceNetworkController {
@GetMapping("/intelligenceAnalyzeList/{type}") @GetMapping("/intelligenceAnalyzeList/{type}")
public ModelAndView intelligenceAnalyzeList(@AuthenticationPrincipal UserInfo loginUser,@PathVariable("type") String type, IntelligenceAnalyze ia){ public ModelAndView intelligenceAnalyzeList(@AuthenticationPrincipal UserInfo loginUser,@PathVariable("type") String type, IntelligenceAnalyze ia){
ModelAndView mav = new ModelAndView("igActivities/fpiMgt/intelligenceNetwork/intelligenceAnalyzeList"); ModelAndView mav = new ModelAndView("igActivities/fpiMgt/intelligenceNetwork/analyzeList");
//메뉴권한 확인 //메뉴권한 확인
String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/intelligenceNetwork/intelligenceAnalyzeList/all").get(0).getAccessAuth(); String accessAuth = authMgtService.selectAccessConfigList(loginUser.getUserSeq(), "/intelligenceNetwork/intelligenceAnalyzeList/all").get(0).getAccessAuth();
@ -437,5 +438,14 @@ public class IntelligenceNetworkController {
return mav; return mav;
} }
@PostMapping("/fireExtensionReportStateChange")
public Integer fireExtensionReportStateChange(@AuthenticationPrincipal UserInfo loginUser, FireExtensionReportApprv apprv){
apprv.setUserSeq(loginUser.getUserSeq());
apprv.setUserGrd(loginUser.getTitleCd());
apprv.setUserNm(loginUser.getUserNm());
apprv.setSaveDt(LocalDateTime.now());
return intelligenceNetworkService.fireExtensionReportStateChange(apprv);
}
} }

View File

@ -81,6 +81,8 @@ public class FireExtensionReport extends BaseModel {
private String opSdate; private String opSdate;
@Transient @Transient
private OperationPlan operationPlan; private OperationPlan operationPlan;
@Transient
List<FireExtensionReportApprv> apprvList;
} }

View File

@ -0,0 +1,45 @@
package com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;
@Getter
@Setter
@Entity
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Table(name = "fire_extension_report_apprv")
@IdClass(FireExtensionReportApprv.FireExtensionReportApprvId.class)
public class FireExtensionReportApprv {
@Id
@Column(name = "fer_key")
private Integer ferKey;
@Id
@Column(name = "apprv_seq")
private Integer apprvSeq;
@Column(name = "state")
private String state;
@Column(name = "user_seq")
private Integer userSeq;
@Column(name = "user_grd")
private String userGrd;
@Column(name = "user_nm")
private String userNm;
@Column(name = "save_dt")
private LocalDateTime saveDt;
@Embeddable
@Data
@NoArgsConstructor
@AllArgsConstructor
public static class FireExtensionReportApprvId implements Serializable {
private Integer ferKey;
private Integer apprvSeq;
}
}

View File

@ -0,0 +1,19 @@
package com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.repository;
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.FireExtensionReportApprv;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
import java.util.Optional;
public interface FireExtensionReportApprvRepository extends JpaRepository<FireExtensionReportApprv, FireExtensionReportApprv.FireExtensionReportApprvId> {
Optional<FireExtensionReportApprv> findTopByFerKeyOrderByApprvSeqDesc(Integer ferKey);
List<FireExtensionReportApprv> findByFerKey(Integer ferKey);
}

View File

@ -12,6 +12,8 @@ import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.OperationPlanApprv;
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.OperationPlanFile; import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.OperationPlanFile;
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.OperationPlanFile.OperationPlanFileId; import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.OperationPlanFile.OperationPlanFileId;
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.FireExtensionReport; import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.FireExtensionReport;
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.model.FireExtensionReportApprv;
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.repository.FireExtensionReportApprvRepository;
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.repository.FireExtensionReportRepository; import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.repository.FireExtensionReportRepository;
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.repository.IntelligenceAnalyzeApprvRepository; import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.repository.IntelligenceAnalyzeApprvRepository;
import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.repository.IntelligenceAnalyzeRepository; import com.dbnt.faisp.main.fpiMgt.intelligenceNetwork.repository.IntelligenceAnalyzeRepository;
@ -40,6 +42,7 @@ public class IntelligenceNetworkService extends BaseService {
private final IntelligenceAnalyzeToAffairRepository intelligenceAnalyzeToAffairRepository; private final IntelligenceAnalyzeToAffairRepository intelligenceAnalyzeToAffairRepository;
private final IntelligenceAnalyzeApprvRepository intelligenceAnalyzeApprvRepository; private final IntelligenceAnalyzeApprvRepository intelligenceAnalyzeApprvRepository;
private final FireExtensionReportRepository fireExtensionReportRepository; private final FireExtensionReportRepository fireExtensionReportRepository;
private final FireExtensionReportApprvRepository fireExtensionReportApprvRepository;
private final IntelligenceNetworkMapper intelligenceNetworkMapper; private final IntelligenceNetworkMapper intelligenceNetworkMapper;
@Transactional @Transactional
@ -218,10 +221,32 @@ public class IntelligenceNetworkService extends BaseService {
FireExtensionReport savedFireExtensionReport = fireExtensionReportRepository.findByFerKey(fer.getFerKey()).orElse(null); FireExtensionReport savedFireExtensionReport = fireExtensionReportRepository.findByFerKey(fer.getFerKey()).orElse(null);
if (savedFireExtensionReport != null) { if (savedFireExtensionReport != null) {
savedFireExtensionReport.setOperationPlan(operationPlanRepository.findById(savedFireExtensionReport.getOpKey()).orElse(null)); savedFireExtensionReport.setOperationPlan(operationPlanRepository.findById(savedFireExtensionReport.getOpKey()).orElse(null));
savedFireExtensionReport.setApprvList(fireExtensionReportApprvRepository.findByFerKey(fer.getFerKey()));
} }
return savedFireExtensionReport; return savedFireExtensionReport;
} }
@Transactional
public Integer fireExtensionReportStateChange(FireExtensionReportApprv apprv) {
FireExtensionReport saveFireExtensionReport = fireExtensionReportRepository.findById(apprv.getFerKey()).orElse(null);
saveFireExtensionReport.setFerState(apprv.getState());
FireExtensionReportApprv lastApprv = fireExtensionReportApprvRepository.findTopByFerKeyOrderByApprvSeqDesc(apprv.getFerKey()).orElse(null);
apprv.setApprvSeq(lastApprv==null?1:lastApprv.getApprvSeq()+1);
fireExtensionReportApprvRepository.save(apprv);
switch (apprv.getState()){
case "DST005":
// 반려시 작성자에게 반려 알림 발송
userAlarmService.sendAlarmToWrtUser(saveFireExtensionReport.getFerKey(), saveFireExtensionReport.getWrtUserSeq(), 35,"외사첩보망 견문관리 외사첩보망 해고(연장)보고에 문서가 반려되었습니다.");
break;
case "DST006":
// 부장승인시 작성자에게 승인 알림 발송
userAlarmService.sendAlarmToWrtUser(saveFireExtensionReport.getFerKey(), saveFireExtensionReport.getWrtUserSeq(), 35,"외사첩보망 견문관리 외사첩보망 해고(연장)보고에 문서가 승인되었습니다.");
break;
}
return apprv.getFerKey();
}

View File

@ -421,15 +421,18 @@
<if test='wrtOrgan != null and wrtOrgan != ""'> <if test='wrtOrgan != null and wrtOrgan != ""'>
and fer.wrt_organ = #{wrtOrgan} and fer.wrt_organ = #{wrtOrgan}
</if> </if>
<if test='opName != null and opName != ""'>
and op.op_name like '%'||#{opName}||'%'
</if>
<if test='ferState != null and ferState != ""'> <if test='ferState != null and ferState != ""'>
and fer_state = #{ferState} and fer_state = #{ferState}
</if> </if>
<if test='dateSelector == "iaDt"'> <if test='dateSelector == "ferDt"'>
<if test='startDate != null and startDate != ""'> <if test='startDate != null and startDate != ""'>
and op_sdate >= #{startDate}::date and op.op_sdate >= #{startDate}::date
</if> </if>
<if test='endDate != null and endDate != ""'> <if test='endDate != null and endDate != ""'>
and op_edate &lt;= #{endDate}::date and fer.op_edate &lt;= #{endDate}::date
</if> </if>
</if> </if>
<if test='dateSelector == "wrtDt"'> <if test='dateSelector == "wrtDt"'>

View File

@ -66,7 +66,7 @@ $(document).on('click', '#operationPlanModalBtn', function (){
$(document).on('click', '#getOperationPlanBtn', function (){ $(document).on('click', '#getOperationPlanBtn', function (){
if($(".rowChkBox:checked").length < 1){ if($(".rowChkBox:checked").length < 1){
alert("견문을 선택해주세요"); alert("정보협력자를 선택해주세요.");
return false; return false;
} }
const opKey = $(".rowChkBox:checked").val(); const opKey = $(".rowChkBox:checked").val();
@ -184,7 +184,7 @@ $(document).on('click', '.apprvBtn', function (){
$.ajax({ $.ajax({
type : 'POST', type : 'POST',
data : formData, data : formData,
url : "/intelligenceNetwork/operationPlanStateChange", url : "/intelligenceNetwork/fireExtensionReportStateChange",
processData: false, processData: false,
contentType: false, contentType: false,
beforeSend: function (xhr){ beforeSend: function (xhr){
@ -192,7 +192,6 @@ $(document).on('click', '.apprvBtn', function (){
}, },
success : function(result) { success : function(result) {
alert(approval+"되었습니다"); alert(approval+"되었습니다");
getOperationPlanViewModal(result);
contentFade("out"); contentFade("out");
}, },
error : function(xhr, status) { error : function(xhr, status) {

View File

@ -28,7 +28,7 @@
</li> </li>
</ul> </ul>
<div class="tab-content bg-white border border-top-0 p-2" id="planContent"> <div class="tab-content bg-white border border-top-0 p-2" id="planContent">
<!-- <form method="get" th:action="${searchUrl}"> <form method="get" th:action="${searchUrl}">
<input type="hidden" name="pageIndex" id="pageIndex" th:value="${searchParams.pageIndex}"> <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">
@ -53,19 +53,23 @@
</select> </select>
</div> </div>
<div class="col-2"> <div class="col-2">
<input type="text" class="form-control form-control-sm" placeholder="협력자 성명" name="opName" th:value="${searchParams.opName}"> <input type="text" class="form-control form-control-sm" placeholder="협력자 성명" name="OpName" th:value="${searchParams.opName}">
</div> </div>
<div class="col-2"> <div class="col-2">
<select class="form-select form-select-sm" name="opState"> <select class="form-select form-select-sm" name="ferState">
<option value="">상태 선택</option> <option value="">상태 선택</option>
<th:block th:each="commonCode:${session.commonCode.get('DST')}"> <th:block th:each="commonCode:${session.commonCode.get('DST')}">
<option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq searchParams.opState}"></option> <option th:value="${commonCode.itemCd}" th:text="${commonCode.itemValue}" th:selected="${commonCode.itemCd eq searchParams.ferState}"></option>
</th:block> </th:block>
</select> </select>
</div> </div>
<div class="col-4"> <div class="col-4">
<div class="input-group input-daterange" id="dateSelectorDiv"> <div class="input-group input-daterange" id="dateSelectorDiv">
등록일: <select class="form-select form-select-sm w-30" name="dateSelector">
<option value="">조건선택</option>
<option value="ferDt" th:selected="${searchParams.dateSelector eq 'ferDt'}">운용기간</option>
<option value="wrtDt" th:selected="${searchParams.dateSelector eq 'wrtDt'}">등록일</option>
</select>
<input type="text" class="form-control form-control-sm w-35" id="startDate" name="startDate" placeholder="시작일" autocomplete="off" readonly th:value="${searchParams.startDate}"> <input type="text" class="form-control form-control-sm w-35" id="startDate" name="startDate" placeholder="시작일" autocomplete="off" readonly th:value="${searchParams.startDate}">
<input type="text" class="form-control form-control-sm w-35" id="endDate" name="endDate" placeholder="종료일" autocomplete="off" readonly th:value="${searchParams.endDate}"> <input type="text" class="form-control form-control-sm w-35" id="endDate" name="endDate" placeholder="종료일" autocomplete="off" readonly th:value="${searchParams.endDate}">
</div> </div>
@ -78,7 +82,7 @@
</div> </div>
</div> </div>
</div> </div>
</form> --> </form>
<div class="row justify-content-start"> <div class="row justify-content-start">
<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">
@ -86,7 +90,7 @@
<tr class="table-secondary"> <tr class="table-secondary">
<th rowspan="2">문서번호</th> <th rowspan="2">문서번호</th>
<th colspan="4">목표 인적사항</th> <th colspan="4">목표 인적사항</th>
<th rowspan="2">기간</th> <th rowspan="2">기간</th>
<th rowspan="2">소요예산</th> <th rowspan="2">소요예산</th>
<th rowspan="2">조치</th> <th rowspan="2">조치</th>
<th rowspan="2">등록일</th> <th rowspan="2">등록일</th>
@ -107,7 +111,9 @@
<td th:text="${list.opJob}"></td> <td th:text="${list.opJob}"></td>
<td th:text="|${list.opSdate}~${list.opEdate}"></td> <td th:text="|${list.opSdate}~${list.opEdate}"></td>
<td th:text="|${list.executionAmount}만원|"></td> <td th:text="|${list.executionAmount}만원|"></td>
<td th:text="${list.ferState}"></td> <th:block th:each="commonCode:${session.commonCode.get('DST')}">
<td th:if="${commonCode.itemCd eq list.ferState}" th:text="${commonCode.itemValue}"></td>
</th:block>
<td th:text="${#temporals.format(list.wrtDt, 'yyyy-MM-dd HH:mm')}"></td> <td th:text="${#temporals.format(list.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
<th:block> <th:block>
<input type="hidden" class="ferKey" th:value="${list.ferKey}"> <input type="hidden" class="ferKey" th:value="${list.ferKey}">

View File

@ -1,7 +1,7 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="ko" xmlns:th="http://www.thymeleaf.org"> <html lang="ko" xmlns:th="http://www.thymeleaf.org">
<div class="modal-header bg-dark"> <div class="modal-header bg-dark">
<h5 class="modal-title text-white" id="affairViewModalLabel">운영 계획서 열람</h5> <h5 class="modal-title text-white" id="affairViewModalLabel">외사첩보망 해고(연장) 보고 열람</h5>
<button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close f-invert" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
@ -94,17 +94,17 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <div class="row"> <div class="row">
<div class="col-12" th:unless="${#lists.isEmpty(op.apprvList)}"> <div class="col-12" th:unless="${#lists.isEmpty(fer.apprvList)}">
<hr> <hr>
<th:block th:each="apprv:${op.apprvList}"> <th:block th:each="apprv:${fer.apprvList}">
<div class="row"> <div class="row">
<th:block th:each="commonCode:${session.commonCode.get('DST')}"> <th:block th:each="commonCode:${session.commonCode.get('DST')}">
<label class="col-sm-2 col-form-label col-form-label-sm text-center" th:if="${commonCode.itemCd eq apprv.state}" th:text="|결재결과: ${commonCode.itemValue}|"></label> <label class="col-sm-2 col-form-label col-form-label-sm text-center" th:if="${commonCode.itemCd eq apprv.state}" th:text="|결재결과: ${commonCode.itemValue}|"></label>
</th:block> </th:block>
<label class="col-sm-2 col-form-label col-form-label-sm text-center"> <label class="col-sm-2 col-form-label col-form-label-sm text-center">
<th:block th:each="commonCode:${session.commonCode.get('JT')}"> <th:block th:each="commonCode:${session.commonCode.get('JT')}">
<th:block th:if="${commonCode.itemCd eq apprv.userGrd}" th:text="|결자: ${commonCode.itemValue} ${apprv.userNm}|"></th:block> <th:block th:if="${commonCode.itemCd eq apprv.userGrd}" th:text="|결자: ${commonCode.itemValue} ${apprv.userNm}|"></th:block>
</th:block> </th:block>
</label> </label>
<label class="col-sm-2 col-form-label col-form-label-sm text-center"> <label class="col-sm-2 col-form-label col-form-label-sm text-center">
@ -114,15 +114,15 @@
</div> </div>
</th:block> </th:block>
</div> </div>
</div> --> </div>
<!-- <form action="#" method="post" id="apprvForm"> <form action="#" method="post" id="apprvForm">
<div class="row"> <div class="row">
<div class="col-10"> <div class="col-10">
<input type="hidden" name="opKey" th:value="${op.opKey}"> <input type="hidden" name="ferKey" th:value="${fer.ferKey}">
<input type="hidden" name="state" id="viewModalApprvValue"> <input type="hidden" name="state" id="viewModalApprvValue">
</div> </div>
</div> </div>
</form> --> </form>
</div> </div>
</div> </div>
<div class="modal-footer justify-content-between bg-light"> <div class="modal-footer justify-content-between bg-light">