방첩활동 목록상 순번 규칙 변경

사용자 정보에 견문결재 정보 추가
견문 작성시 사용자 정보의 견문결재 옵션에 따라 결재기관 변경되도록 수정.
master
최강석 2023-05-30 19:01:34 +09:00
parent b5c9121bb2
commit a37361bdd8
9 changed files with 50 additions and 15 deletions

View File

@ -44,11 +44,9 @@ public class AffairController { // 첩보수집활동 > 외사경찰 견문관
switch (tab){ switch (tab){
case "myReport": case "myReport":
affairBoard.setWrtUserSeq(loginUser.getUserSeq()); affairBoard.setWrtUserSeq(loginUser.getUserSeq());
affairBoard.setRatingOrgan(loginUser.getOgCd());
break; break;
case "stayReport": case "stayReport":
if(Utils.isEmpty(apprvAuth)) { if(Utils.isEmpty(apprvAuth)) {
affairBoard.setRatingOrgan(loginUser.getOgCd());
affairBoard.setWrtUserSeq(loginUser.getUserSeq()); affairBoard.setWrtUserSeq(loginUser.getUserSeq());
affairBoard.setQueryType("normalStayList"); affairBoard.setQueryType("normalStayList");
}else { }else {

View File

@ -9,8 +9,10 @@ import com.dbnt.faisp.main.fpiMgt.affair.mapper.AffairMapper;
import com.dbnt.faisp.main.fpiMgt.affair.model.*; import com.dbnt.faisp.main.fpiMgt.affair.model.*;
import com.dbnt.faisp.main.fpiMgt.affair.repository.*; import com.dbnt.faisp.main.fpiMgt.affair.repository.*;
import com.dbnt.faisp.main.hashTag.service.HashTagService; import com.dbnt.faisp.main.hashTag.service.HashTagService;
import com.dbnt.faisp.main.organMgt.model.OrganConfig;
import com.dbnt.faisp.main.organMgt.service.OrganConfigService; import com.dbnt.faisp.main.organMgt.service.OrganConfigService;
import com.dbnt.faisp.main.userInfo.model.UserInfo; import com.dbnt.faisp.main.userInfo.model.UserInfo;
import com.dbnt.faisp.main.userInfo.repository.UserInfoRepository;
import com.dbnt.faisp.main.userInfo.service.UserAlarmService; import com.dbnt.faisp.main.userInfo.service.UserAlarmService;
import com.dbnt.faisp.util.Utils; import com.dbnt.faisp.util.Utils;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -28,6 +30,7 @@ public class AffairService extends BaseService { // 견문보고
private final UserAlarmService userAlarmService; private final UserAlarmService userAlarmService;
private final HashTagService hashTagService; private final HashTagService hashTagService;
private final UserInfoRepository userInfoRepository;
private final OrganConfigService organConfigService; private final OrganConfigService organConfigService;
private final CodeMgtService codeMgtService; private final CodeMgtService codeMgtService;
private final AffairBoardRepository affairBoardRepository; private final AffairBoardRepository affairBoardRepository;
@ -73,11 +76,29 @@ public class AffairService extends BaseService { // 견문보고
saveUploadFiles(affairKey, affair.getMultipartFileList()); saveUploadFiles(affairKey, affair.getMultipartFileList());
} }
AffairRating rating = affairRatingRepository.findById(new AffairRating.AffairRatingId(affairKey,affair.getWrtOrgan())).orElse(null); // 230530 사용자 정보에 견문결재기관 정보가 추가되어 관련 로직 추가.
UserInfo wrtUser = userInfoRepository.findById(affair.getWrtUserSeq()).orElse(new UserInfo());
String ratingOrgan = affair.getWrtOrgan();
switch (wrtUser.getAffairOrgan()){
//소속서는 switch 탈 필요 없음.
case "ARO002": //지방청
OrganConfig organInfo = organConfigService.selectOrganConfig(ratingOrgan);
if(organInfo.getOrganType().equals("OGC003")){
// 소속기관이 말단 서일 때 상위청으로 결재기관 설정.
// 지방청이나 본청 사용자는 결재기관을 지방청으로 설정하더라도 소속기관으로 결재기관이 설정됨.
ratingOrgan = organInfo.getParentOrgan();
}
break;
case "ARO003": //본청
ratingOrgan = "OG001";
break;
}
AffairRating rating = affairRatingRepository.findById(new AffairRating.AffairRatingId(affairKey, ratingOrgan)).orElse(null);
if(rating == null){ if(rating == null){
rating = new AffairRating(); rating = new AffairRating();
rating.setAffairKey(affairKey); rating.setAffairKey(affairKey);
rating.setRatingOrgan(affair.getWrtOrgan()); rating.setRatingOrgan(ratingOrgan);
} }
rating.setAffairStatus(affair.getAffairStatus()); rating.setAffairStatus(affair.getAffairStatus());
affairRatingRepository.save(rating); affairRatingRepository.save(rating);

View File

@ -79,4 +79,8 @@ public class OrganConfigService {
.collect(Collectors.toList()); .collect(Collectors.toList());
return configList; return configList;
} }
public OrganConfig selectOrganConfig(String organCd) {
return organConfigRepository.findById(organCd).orElse(null);
}
} }

View File

@ -130,6 +130,9 @@ public class UserInfoService implements UserDetailsService {
if(!Utils.isEmpty(userInfo.getSpecialism())){ if(!Utils.isEmpty(userInfo.getSpecialism())){
savedInfo.setSpecialism(userInfo.getSpecialism()); savedInfo.setSpecialism(userInfo.getSpecialism());
} }
if(!Utils.isEmpty(userInfo.getAffairOrgan())){
savedInfo.setAffairOrgan(userInfo.getAffairOrgan());
}
userInfoRepository.save(savedInfo); userInfoRepository.save(savedInfo);
saveUserInfoHistory(savedInfo, loginUser); saveUserInfoHistory(savedInfo, loginUser);
} }

View File

@ -183,22 +183,32 @@
</div> </div>
</div> </div>
<div class="row mb-1"> <div class="row mb-1">
<label for="languageCd" class="col-sm-2 col-form-label col-form-label-sm text-center">학력사항</label> <label for="educationGrd" class="col-sm-2 col-form-label col-form-label-sm text-center">학력사항</label>
<div class="col-sm-2"> <div class="col-sm-2">
<select class="form-select form-select-sm" name="educationGrd"> <select class="form-select form-select-sm" id="educationGrd" name="educationGrd">
<option value="">해당없음</option> <option value="">해당없음</option>
<th:block th:each="code:${session.commonCode.get('UED')}"> <th:block th:each="code:${session.commonCode.get('UED')}">
<option th:if="${code.useChk eq 'T'}" th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${code.itemCd eq userInfo.educationGrd}"></option> <option th:if="${code.useChk eq 'T'}" th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${code.itemCd eq userInfo.educationGrd}"></option>
</th:block> </th:block>
</select> </select>
</div> </div>
<label for="languageCd" class="col-sm-2 col-form-label col-form-label-sm text-center">학교</label> <label for="school" class="col-sm-2 col-form-label col-form-label-sm text-center">학교</label>
<div class="col-sm-2"> <div class="col-sm-2">
<input type="text" class="form-control form-control-sm" name="school" th:value="${userInfo.school}"> <input type="text" class="form-control form-control-sm" id="school" name="school" th:value="${userInfo.school}">
</div> </div>
<label for="languageCd" class="col-sm-2 col-form-label col-form-label-sm text-center">전공</label> <label for="specialism" class="col-sm-2 col-form-label col-form-label-sm text-center">전공</label>
<div class="col-sm-2"> <div class="col-sm-2">
<input type="text" class="form-control form-control-sm" name="specialism" th:value="${userInfo.specialism}"> <input type="text" class="form-control form-control-sm" id="specialism" name="specialism" th:value="${userInfo.specialism}">
</div>
</div>
<div class="row mb-1">
<label for="affairOrgan" class="col-sm-2 col-form-label col-form-label-sm text-center">견문결재기관</label>
<div class="col-sm-2">
<select class="form-select form-select-sm" id="affairOrgan" name="affairOrgan">
<th:block th:each="code:${session.commonCode.get('ARO')}">
<option th:if="${code.useChk eq 'T'}" th:value="${code.itemCd}" th:text="${code.itemValue}" th:selected="${code.itemCd eq userInfo.affairOrgan}"></option>
</th:block>
</select>
</div> </div>
</div> </div>
</form> </form>

View File

@ -87,7 +87,7 @@
</thead> </thead>
<tbody class="table-group-divider"> <tbody class="table-group-divider">
<tr class="eiTr" th:each="list,cnt:${eiList}"> <tr class="eiTr" th:each="list,cnt:${eiList}">
<td th:text="${cnt.count}"></td> <td th:text="${searchParams.contentCnt-(searchParams.rowCnt*(searchParams.pageIndex-1))-cnt.count+1}"></td>
<td th:text="${list.eduDate}"></td> <td th:text="${list.eduDate}"></td>
<td th:text="${list.mgtOrgan}"></td> <td th:text="${list.mgtOrgan}"></td>
<td th:text="${list.eduType}"></td> <td th:text="${list.eduType}"></td>

View File

@ -96,7 +96,7 @@
</thead> </thead>
<tbody class="table-group-divider"> <tbody class="table-group-divider">
<tr class="fiTr" th:each="list,cnt:${fiList}"> <tr class="fiTr" th:each="list,cnt:${fiList}">
<td th:text="${cnt.count}"></td> <td th:text="${searchParams.contentCnt-(searchParams.rowCnt*(searchParams.pageIndex-1))-cnt.count+1}"></td>
<td th:text="${list.mgtOrgan}"></td> <td th:text="${list.mgtOrgan}"></td>
<td th:text="${list.manager}"></td> <td th:text="${list.manager}"></td>
<td th:text="${list.commuLocation}"></td> <td th:text="${list.commuLocation}"></td>

View File

@ -76,7 +76,6 @@
<tr class="table-secondary"> <tr class="table-secondary">
<th>순번</th> <th>순번</th>
<th>관서</th> <th>관서</th>
<th>업체명</th> <th>업체명</th>
<th>소재지</th> <th>소재지</th>
<th>관련<br>분야</th> <th>관련<br>분야</th>
@ -89,7 +88,7 @@
</thead> </thead>
<tbody class="table-group-divider"> <tbody class="table-group-divider">
<tr class="mciTr" th:each="list,cnt:${mciList}"> <tr class="mciTr" th:each="list,cnt:${mciList}">
<td th:text="${cnt.count}"></td> <td th:text="${searchParams.contentCnt-(searchParams.rowCnt*(searchParams.pageIndex-1))-cnt.count+1}"></td>
<td th:text="${list.mgtOrgan}"></td> <td th:text="${list.mgtOrgan}"></td>
<td th:text="${list.companyNm}"></td> <td th:text="${list.companyNm}"></td>
<td th:text="${list.companyLocation}"></td> <td th:text="${list.companyLocation}"></td>

View File

@ -82,7 +82,7 @@
</thead> </thead>
<tbody class="table-group-divider"> <tbody class="table-group-divider">
<tr class="sdiTr" th:each="list ,cnt:${sdiList}"> <tr class="sdiTr" th:each="list ,cnt:${sdiList}">
<td th:text="${cnt.count}"></td> <td th:text="${searchParams.contentCnt-(searchParams.rowCnt*(searchParams.pageIndex-1))-cnt.count+1}"></td>
<td th:text="${list.wrtOrgan}"></td> <td th:text="${list.wrtOrgan}"></td>
<td> <td>
<th:block th:if="${#strings.length(list.localInfo)>35}" th:utext="|${#strings.substring(list.localInfo, 0, 35)}...|"></th:block> <th:block th:if="${#strings.length(list.localInfo)>35}" th:utext="|${#strings.substring(list.localInfo, 0, 35)}...|"></th:block>