대시보드 견문목록 오류 수정 작업중.

master
강석 최 2023-02-27 18:59:19 +09:00
parent e58f782934
commit 9189c0426c
10 changed files with 197 additions and 22 deletions

View File

@ -1,9 +1,11 @@
package com.dbnt.faisp.config;
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
import com.dbnt.faisp.main.codeMgt.model.CodeMgt;
import com.dbnt.faisp.main.faRpt.model.FaRptBoard;
import com.dbnt.faisp.main.faRpt.service.FaRptService;
import com.dbnt.faisp.main.fpiMgt.affair.model.AffairBoard;
import com.dbnt.faisp.main.fpiMgt.affair.model.DashboardAffair;
import com.dbnt.faisp.main.fpiMgt.affair.service.AffairService;
import com.dbnt.faisp.main.menuMgt.service.MenuMgtService;
import com.dbnt.faisp.main.organMgt.service.OrganConfigService;
@ -37,6 +39,7 @@ public class BaseController {
private final FaRptService faRptService;
private final AffairService affairService;
private final UserAlarmService userAlarmService;
private final AuthMgtService authMgtService;
@GetMapping("/")
public ModelAndView loginCheck(@AuthenticationPrincipal UserInfo loginUser) {
@ -76,29 +79,39 @@ public class BaseController {
PublicBoard noticeParams = new PublicBoard();
noticeParams.setPublicType("PLB001");
noticeParams.setRowCnt(7);
noticeParams.setRowCnt(8);
noticeParams.setDownOrganCdList(loginUser.getDownOrganCdList());
noticeParams.setUpOrganCdList(loginUser.getUpOrganCdList());
mav.addObject("noticeList", publicBoardService.selectContentList(noticeParams));
UserAlarm alarm = new UserAlarm();
alarm.setUserSeq(loginUser.getUserSeq());
alarm.setViewYn("N");
alarm.setRowCnt(7);
alarm.setRowCnt(8);
mav.addObject("dashboardAlarmList", userAlarmService.selectAlarmList(alarm));
FaRptBoard faRpt = new FaRptBoard();
faRpt.setActiveTab("receive");
faRpt.setRowCnt(7);
faRpt.setRowCnt(8);
faRpt.setStatus("DST007");
faRpt.setReceiveUserSeq(loginUser.getUserSeq());
mav.addObject("faRptList", faRptService.selectFaRptList(faRpt));
AffairBoard affair = new AffairBoard();
DashboardAffair affair = new DashboardAffair();
affair.setPlanApprv(authMgtService.selectApprovalConfigList(loginUser.getUserSeq(), "/affairPlan/planMgt").get(0).getApprovalAuth());
affair.setAffairApprv(authMgtService.selectApprovalConfigList(loginUser.getUserSeq(), "/affair/affairMgt/myReport?affairCategory=CAT215").get(0).getApprovalAuth());
affair.setResultApprv(authMgtService.selectApprovalConfigList(loginUser.getUserSeq(), "/affairResult/resultMgt").get(0).getApprovalAuth());
affair.setUserSeq(loginUser.getUserSeq());
affair.setOgCd(loginUser.getOgCd());
mav.addObject("affair1List", affairService.selectDashboardAffairList(affair));
affair.setAffairApprv(authMgtService.selectApprovalConfigList(loginUser.getUserSeq(), "/affair/affairMgt/myReport?affairCategory=CAT216").get(0).getApprovalAuth());
mav.addObject("affair2List", affairService.selectDashboardIntelligenceNetworkList(affair));
/*AffairBoard affair = new AffairBoard();
affair.setAffairCategory("CAT215");
affair.setRatingOrgan(loginUser.getOgCd());
affair.setRowCnt(7);
affair.setRowCnt(8);
mav.addObject("affair1List", affairService.selectAffairBoardList(affair));
affair.setAffairCategory("CAT216");
mav.addObject("affair2List", affairService.selectAffairBoardList(affair));
mav.addObject("affair2List", affairService.selectAffairBoardList(affair));*/
return mav;
}

View File

@ -1,6 +1,7 @@
package com.dbnt.faisp.main.fpiMgt.affair.mapper;
import com.dbnt.faisp.main.fpiMgt.affair.model.AffairBoard;
import com.dbnt.faisp.main.fpiMgt.affair.model.DashboardAffair;
import com.dbnt.faisp.main.fpiMgt.affair.model.TypeStatistics;
import org.apache.ibatis.annotations.Mapper;
@ -35,4 +36,8 @@ public interface AffairMapper {
List<TypeStatistics> selectArrCntList(TypeStatistics typeStatistics);
String selectDocNo(Map<String, Object> params);
List<DashboardAffair> selectDashboardAffairList(DashboardAffair affair);
List<DashboardAffair> selectDashboardIntelligenceNetworkList(DashboardAffair affair);
}

View File

@ -0,0 +1,23 @@
package com.dbnt.faisp.main.fpiMgt.affair.model;
import com.dbnt.faisp.config.BaseModel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@NoArgsConstructor
public class DashboardAffair extends BaseModel {
private String board;
private Integer key;
private String title;
private String wrtUserNm;
private String wrtUserGrd;
private String planApprv;
private String affairApprv;
private String resultApprv;
private Integer userSeq;
private String ogCd;
}

View File

@ -36,6 +36,14 @@ public class AffairService extends BaseService { // 견문보고
private final HashTagLinkRepository hashTagLinkRepository;
private final AffairMapper affairMapper;
public List<DashboardAffair> selectDashboardAffairList(DashboardAffair affair){
return affairMapper.selectDashboardAffairList(affair);
}
public List<DashboardAffair> selectDashboardIntelligenceNetworkList(DashboardAffair affair) {
return affairMapper.selectDashboardIntelligenceNetworkList(affair);
}
public List<AffairBoard> selectAffairBoardList(AffairBoard affair){
return affairMapper.selectAffairBoardList(affair);
}
@ -319,5 +327,4 @@ public class AffairService extends BaseService { // 견문보고
public List<TypeStatistics> selectArrCntList(TypeStatistics typeStatistics) {
return affairMapper.selectArrCntList(typeStatistics);
}
}

View File

@ -162,6 +162,7 @@ public class PlanController { // 첩보수집활동 > 외사경찰 견문관리
planBoard.setWrtOrgan(loginUser.getOgCd());
planBoard.setWrtPart(loginUser.getOfcCd());
planBoard.setWrtUserSeq(loginUser.getUserSeq());
planBoard.setWrtUserGrd(loginUser.getTitleCd());
planBoard.setWrtUserNm(loginUser.getUserNm());
planBoard.setWrtDt(LocalDateTime.now());
}
@ -196,6 +197,7 @@ public class PlanController { // 첩보수집활동 > 외사경찰 견문관리
public Integer planStateChange(@AuthenticationPrincipal UserInfo loginUser, PlanApprv apprv){
apprv.setUserSeq(loginUser.getUserSeq());
apprv.setUserNm(loginUser.getUserNm());
apprv.setUserGrd(loginUser.getTitleCd());
apprv.setSaveDt(LocalDateTime.now());
return planService.planStateChange(apprv);
}

View File

@ -29,6 +29,8 @@ public class PlanApprv {
private Integer userSeq;
@Column(name = "user_nm")
private String userNm;
@Column(name = "user_grd")
private String userGrd;
@Column(name = "etc")
private String etc;
@Column(name = "save_dt")

View File

@ -44,6 +44,8 @@ public class PlanBoard extends BaseModel {
private String planState;
@Column(name = "wrt_user_seq")
private Integer wrtUserSeq;
@Column(name = "wrt_user_grd")
private String wrtUserGrd;
@Transient
private String userType;

View File

@ -656,4 +656,109 @@
on c.wrt_organ = a.item_cd and c.affair_rate = b.item_cd
order by wrt_organ,affairType asc
</select>
<select id="selectDashboardAffairList" parameterType="DashboardAffair" resultType="DashboardAffair">
select 'plan' as board,
a.plan_key as key,
a.content_title as title,
a.wrt_user_grd as wrtUserGrd,
a.wrt_user_nm as wrtUserNm,
a.wrt_dt
from plan_board a inner join plan_apprv b on a.plan_key = b.plan_key
<where>
<choose>
<when test='planApprv == null or planApprv == ""'>
and a.wrt_user_seq = #{userSeq}
</when>
<when test='planApprv == "APC004APC001" or planApprv == "APC003APC002"'>
and a.wrt_organ = #{ogCd} and (b.state = 'DST002' or b.state = 'DST004')
</when>
<when test='planApprv == "APC004" or planApprv == "APC003"'>
and a.wrt_organ = #{ogCd} and b.state = 'DST002'
</when>
<when test='planApprv == "APC002" or planApprv == "APC001"'>
and a.wrt_organ = #{ogCd} and b.state = 'DST004'
</when>
</choose>
</where>
union all
select 'affair' as board,
a.affair_key as key,
a.title as title,
a.wrt_user_grd as wrtUserGrd,
a.wrt_user_nm as wrtUserNm,
a.wrt_dt
from affair_board a inner join affair_rating b on a.affair_key = b.affair_key and b.rating_organ = #{ogCd}
<where>
affair_category = 'CAT215'
<choose>
<when test='affairApprv == null or affairApprv == ""'>
and a.wrt_user_seq = #{userSeq}
</when>
<when test='affairApprv == "APC004APC001" or affairApprv == "APC003APC002"'>
and (b.affair_status = 'DST002' or b.affair_status = 'DST004')
</when>
<when test='affairApprv == "APC004" or affairApprv == "APC003"'>
and b.affair_status = 'DST002'
</when>
<when test='affairApprv == "APC002" or affairApprv == "APC001"'>
and b.affair_status = 'DST004'
</when>
</choose>
</where>
union all
select 'result' as board,
a.result_key as key,
a.clear_title as title,
a.wrt_user_grd as wrtUserGrd,
a.wrt_user_nm as wrtUserNm,
a.wrt_dt
from result_board a inner join result_apprv b on a.result_key = b.result_key
<where>
<choose>
<when test='resultApprv == null or resultApprv == ""'>
and a.wrt_user_seq = #{userSeq}
</when>
<when test='resultApprv == "APC004APC001" or resultApprv == "APC003APC002"'>
and a.wrt_organ = #{ogCd} and (b.state = 'DST002' or b.state = 'DST004')
</when>
<when test='resultApprv == "APC004" or resultApprv == "APC003"'>
and a.wrt_organ = #{ogCd} and b.state = 'DST002'
</when>
<when test='resultApprv == "APC002" or resultApprv == "APC001"'>
and a.wrt_organ = #{ogCd} and b.state = 'DST004'
</when>
</choose>
</where>
order by wrt_dt desc
limit 8
</select>
<select id="selectDashboardIntelligenceNetworkList" parameterType="DashboardAffair" resultType="DashboardAffair">
select 'affair' as board,
a.affair_key as key,
a.title as title,
a.wrt_user_grd as wrtUserGrd,
a.wrt_user_nm as wrtUserNm,
a.wrt_dt
from affair_board a inner join affair_rating b on a.affair_key = b.affair_key and b.rating_organ = #{ogCd}
<where>
affair_category = 'CAT216'
<choose>
<when test='affairApprv == null or affairApprv == ""'>
and a.wrt_user_seq = #{userSeq}
</when>
<when test='affairApprv == "APC004APC001" or affairApprv == "APC003APC002"'>
and (b.affair_status = 'DST002' or b.affair_status = 'DST004')
</when>
<when test='affairApprv == "APC004" or affairApprv == "APC003"'>
and b.affair_status = 'DST002'
</when>
<when test='affairApprv == "APC002" or affairApprv == "APC001"'>
and b.affair_status = 'DST004'
</when>
</choose>
</where>
order by wrt_dt desc
limit 8
</select>
</mapper>

View File

@ -12,6 +12,7 @@
<input type="hidden" name="wrtOrgan" th:value="${plan.wrtOrgan}">
<input type="hidden" name="wrtPart" th:value="${plan.wrtPart}">
<input type="hidden" name="wrtUserSeq" th:value="${plan.wrtUserSeq}">
<input type="hidden" name="wrtUserGrd" th:value="${plan.wrtUserGrd}">
<input type="hidden" name="planState" id="planState" th:value="${plan.planState}">
<div class="row mb-1">
<label for="wrtUserNm" class="col-sm-2 col-form-label col-form-label-sm text-center">작성자</label>

View File

@ -130,21 +130,28 @@
<table class="table table-sm table-hover">
<thead>
<tr>
<th>게시판</th>
<th>제목</th>
<th>작성일시</th>
<th>상태</th>
<th>작성자</th>
</tr>
</thead>
<tbody>
<tr class="affairTr" th:each="affair:${affair1List}">
<input type="hidden" class="affairKey" th:value="${affair.affairKey}">
<input type="hidden" class="affairKey" th:value="${affair.key}">
<td>
<th:block th:if="${affair.board eq 'plan'}">계획수립</th:block>
<th:block th:if="${affair.board eq 'affair'}">견문관리</th:block>
<th:block th:if="${affair.board eq 'result'}">청산보고서</th:block>
</td>
<td ><i class="bi bi-dot" style="color: #3d73d7"></i>
<th:block th:text="${affair.title}"></th:block>
</td>
<td th:text="${#temporals.format(affair.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
<th:block th:each="commonCode:${session.commonCode.get('DST')}">
<td th:if="${affair.affairStatus eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
<td>
<th:block th:each="code:${session.commonCode.get('JT')}">
<th:block th:if="${code.itemCd eq affair.wrtUserGrd}" th:text="${code.itemValue}"></th:block>
</th:block>
<th:block th:text="${affair.wrtUserNm}"></th:block>
</td>
</tr>
</tbody>
</table>
@ -163,21 +170,29 @@
<table class="table table-sm table-hover">
<thead>
<tr>
<th>게시판</th>
<th>제목</th>
<th>작성일시</th>
<th>상태</th>
<th>작성자</th>
</tr>
</thead>
<tbody>
<tr class="affairTr" th:each="affair:${affair2List}">
<input type="hidden" class="affairKey" th:value="${affair.affairKey}">
<td><i class="bi bi-dot" style="color: #3d73d7"></i>
<input type="hidden" class="affairKey" th:value="${affair.key}">
<td>
<th:block th:if="${affair.board eq 'plan'}">운영계획</th:block>
<th:block th:if="${affair.board eq 'affair'}">견문관리</th:block>
<th:block th:if="${affair.board eq 'analyze'}">운영실적</th:block>
<th:block th:if="${affair.board eq 'fire'}">해고/연장보고</th:block>
</td>
<td ><i class="bi bi-dot" style="color: #3d73d7"></i>
<th:block th:text="${affair.title}"></th:block>
</td>
<td th:text="${#temporals.format(affair.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
<th:block th:each="commonCode:${session.commonCode.get('DST')}">
<td th:if="${affair.affairStatus eq commonCode.itemCd}" th:text="${commonCode.itemValue}"></td>
<td>
<th:block th:each="code:${session.commonCode.get('JT')}">
<th:block th:if="${code.itemCd eq affair.wrtUserGrd}" th:text="${code.itemValue}"></th:block>
</th:block>
<th:block th:text="${affair.wrtUserNm}"></th:block>
</td>
</tr>
</tbody>
</table>