외사활동 목록 양식 변경.

master
강석 최 2023-03-07 18:34:54 +09:00
parent ccaec40ca6
commit 583cdd8723
10 changed files with 174 additions and 85 deletions

View File

@ -2,21 +2,15 @@ package com.dbnt.faisp.main.counterIntelligence.activityCase;
import com.dbnt.faisp.main.authMgt.service.AuthMgtService;
import com.dbnt.faisp.main.codeMgt.service.CodeMgtService;
import com.dbnt.faisp.main.counterIntelligence.activityCase.model.ActivityCase;
import com.dbnt.faisp.main.counterIntelligence.activityCase.model.ActivityCaseApprv;
import com.dbnt.faisp.main.counterIntelligence.activityCase.model.ActivityCaseBoard;
import com.dbnt.faisp.main.counterIntelligence.activityCase.model.ActivityCaseInfo;
import com.dbnt.faisp.main.counterIntelligence.activityCase.model.*;
import com.dbnt.faisp.main.counterIntelligence.activityCase.service.ActivityCaseService;
import com.dbnt.faisp.main.counterIntelligence.model.CounterIntelligenceWork;
import com.dbnt.faisp.main.userInfo.model.UserInfo;
import com.dbnt.faisp.main.userInfo.service.UserInfoService;
import lombok.RequiredArgsConstructor;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import java.time.LocalDateTime;
import java.util.List;
@RestController
@ -26,7 +20,6 @@ public class ActivityCaseController {
private final ActivityCaseService activityCaseService;
private final AuthMgtService authMgtService;
private final CodeMgtService codeMgtService;
@GetMapping("/activityCaseList")
public ModelAndView activityCaseListPage(@AuthenticationPrincipal UserInfo loginUser, ActivityCaseBoard activityCase){
@ -94,14 +87,14 @@ public class ActivityCaseController {
}
@GetMapping("/activityCaseSummaryModal")
public ModelAndView activityCaseSummaryModal(@AuthenticationPrincipal UserInfo loginUser, ActivityCaseBoard activityCase){
public ModelAndView activityCaseSummaryModal(@AuthenticationPrincipal UserInfo loginUser, ActivityCaseSummary activityCase){
ModelAndView mav = new ModelAndView("counterIntelligence/activityCase/activityCaseSummaryModal");
mav.addObject("activityCaseList", activityCaseService.selectActivityCaseList(activityCase));
mav.addObject("activityCaseList", activityCaseService.selectActivityCaseInfoList(activityCase.getReceiptKey()));
return mav;
}
@GetMapping("/activityCaseViewModal")
public ModelAndView activityCaseViewModal(@AuthenticationPrincipal UserInfo loginUser, ActivityCaseBoard activityCase){
public ModelAndView activityCaseViewModal(@AuthenticationPrincipal UserInfo loginUser, ActivityCaseSummary activityCase){
ModelAndView mav = null;
ActivityCaseInfo activityCaseInfo = activityCaseService.selectActivityCaseInfo(activityCase.getCaseKey());
switch (activityCaseInfo.getCaseType()){

View File

@ -2,9 +2,7 @@ package com.dbnt.faisp.main.counterIntelligence.activityCase.mapper;
import com.dbnt.faisp.main.counterIntelligence.activityCase.model.ActivityCase;
import com.dbnt.faisp.main.counterIntelligence.activityCase.model.ActivityCaseBoard;
import com.dbnt.faisp.main.counterIntelligence.model.CiWorkStatistics;
import com.dbnt.faisp.main.counterIntelligence.model.CounterIntelligenceActivity;
import com.dbnt.faisp.main.counterIntelligence.model.CounterIntelligenceWork;
import com.dbnt.faisp.main.counterIntelligence.activityCase.model.ActivityCaseSummary;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@ -14,10 +12,11 @@ import java.util.Map;
@Mapper
public interface ActivityCaseMapper {
List<ActivityCase> selectActivityCaseList(ActivityCaseBoard activityCase);
List<ActivityCaseBoard> selectActivityCaseList(ActivityCaseBoard activityCase);
Integer selectActivityCaseCnt(ActivityCaseBoard activityCase);
List<ActivityCaseSummary> selectActivityCaseInfoList(Integer receiptKey);
Integer selectReceiptNum(int year);
Integer selectCaseNum(Map<String, Object> map);
}

View File

@ -25,8 +25,6 @@ public class ActivityCaseApprv {
@Id
@Column(name = "user_seq")
private Integer userSeq;
@Column(name = "apprv_path")
private String apprvPath;
@Column(name = "apprv_type")
private String apprvType;
@Column(name = "og_cd")

View File

@ -4,13 +4,9 @@ import com.dbnt.faisp.config.BaseModel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@Getter
@Setter
@ -23,13 +19,12 @@ public class ActivityCaseBoard extends BaseModel {
private Integer wrtUserSeq;
private String wrtUserGrd;
private String wrtUserNm;
private Integer caseKey;
private String caseNum;
private LocalDate reportDate;
private Integer reportCnt;
private String caseType;
private String caseNum;
private String title;
private LocalDate reportDate;
private LocalDateTime wrtDt;
private Integer apprvCnt;
private Integer allCnt;
private Integer fileCnt;
private String suspectNm;
private Integer suspectCnt;
}

View File

@ -0,0 +1,35 @@
package com.dbnt.faisp.main.counterIntelligence.activityCase.model;
import com.dbnt.faisp.config.BaseModel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
@Getter
@Setter
@NoArgsConstructor
public class ActivityCaseSummary extends BaseModel {
private Integer receiptKey;
private String receiptNum;
private String wrtOrgan;
private String wrtPart;
private Integer wrtUserSeq;
private String wrtUserGrd;
private String wrtUserNm;
private Integer caseKey;
private String caseNum;
private LocalDate reportDate;
private String caseType;
private String title;
private LocalDateTime wrtDt;
private Integer apprvCnt;
private Integer allCnt;
private Integer fileCnt;
}

View File

@ -29,7 +29,7 @@ public class ActivityCaseService extends BaseService {
private final ActivityCaseApprvRepository acaRepository;
private final ActivityCaseMapper acMapper;
public List<ActivityCase> selectActivityCaseList(ActivityCaseBoard activityCase){
public List<ActivityCaseBoard> selectActivityCaseList(ActivityCaseBoard activityCase){
return acMapper.selectActivityCaseList(activityCase);
}
public Integer selectActivityCaseCnt(ActivityCaseBoard activityCase){
@ -135,14 +135,18 @@ public class ActivityCaseService extends BaseService {
}
private String makeReceiptNum(int year){
String receiptNum = "00"+acMapper.selectReceiptNum(year);
return year+"-"+receiptNum.substring(receiptNum.length()-3);
String receiptNum = "000"+acMapper.selectReceiptNum(year);
return year+"-"+receiptNum.substring(receiptNum.length()-4);
}
private String makeCaseNum(int year, String receiptNum){
Map<String, Object> params = new HashMap<>();
params.put("receiptNum", receiptNum);
params.put("year", year);
String caseNum = "00"+acMapper.selectCaseNum(params);
return year+"-"+caseNum.substring(caseNum.length()-3);
String caseNum = "000"+acMapper.selectCaseNum(params);
return year+"-"+caseNum.substring(caseNum.length()-4);
}
public List<ActivityCaseSummary> selectActivityCaseInfoList(Integer receiptKey) {
return acMapper.selectActivityCaseInfoList(receiptKey);
}
}

View File

@ -20,18 +20,18 @@
</if>
<if test='dateSelector == "reportDate"'>
<if test='startDate != null and startDate != ""'>
and b.report_date >= #{startDate}::date
and c.report_date >= #{startDate}::date
</if>
<if test='endDate != null and endDate != ""'>
and b.report_date &lt;= #{endDate}::date+1
and c.report_date &lt;= #{endDate}::date+1
</if>
</if>
<if test='dateSelector == "wrtDt"'>
<if test='startDate != null and startDate != ""'>
and b.wrt_dt >= #{startDate}::date
and c.wrt_dt >= #{startDate}::date
</if>
<if test='endDate != null and endDate != ""'>
and b.wrt_dt &lt;= #{endDate}::date+1
and c.wrt_dt &lt;= #{endDate}::date+1
</if>
</if>
<if test="downOrganCdList != null">
@ -43,6 +43,69 @@
</where>
</sql>
<select id="selectActivityCaseList" parameterType="ActivityCaseBoard" resultType="ActivityCaseBoard">
select a.receipt_key,
a.receipt_num ,
a.wrt_organ ,
a.wrt_part ,
a.wrt_user_seq ,
a.wrt_user_grd ,
a.wrt_user_nm ,
b.reportCnt,
c.case_type ,
c.case_num ,
c.title,
c.report_date ,
c.wrt_dt,
d.suspectCnt,
e.name as suspectNm
from activity_case a
inner join (
select receipt_key,
count(*) as reportCnt,
max(case_key) as case_key
from activity_case_info
group by receipt_key
) b on a.receipt_key = b.receipt_key
inner join activity_case_info c
on c.case_key = b.case_key
inner join (
select receipt_key,
count(*) as suspectCnt,
min(suspect_seq) as suspect_seq
from activity_case_suspect
group by receipt_key
) d on a.receipt_key = d.receipt_key
inner join activity_case_suspect e
on a.receipt_key = e.receipt_key and d.suspect_seq = e.suspect_seq
<include refid="selectActivityCaseListWhere"></include>
order by c.wrt_dt desc
limit #{rowCnt} offset #{firstIndex}
</select>
<select id="selectActivityCaseCnt" parameterType="ActivityCaseBoard" resultType="int">
select count(*)
from activity_case a
inner join (
select receipt_key,
count(*) as reportCnt,
max(case_key) as case_key
from activity_case_info
group by receipt_key
) b on a.receipt_key = b.receipt_key
inner join activity_case_info c
on c.case_key = b.case_key
inner join (
select receipt_key,
count(*) as suspectCnt,
min(suspect_seq) as suspect_seq
from activity_case_suspect
group by receipt_key
) d on a.receipt_key = d.receipt_key
inner join activity_case_suspect e
on a.receipt_key = e.receipt_key and d.suspect_seq = e.suspect_seq
<include refid="selectActivityCaseListWhere"></include>
</select>
<select id="selectActivityCaseInfoList" parameterType="int" resultType="ActivityCaseSummary">
select a.receipt_key,
a.receipt_num ,
a.wrt_organ ,
@ -64,38 +127,19 @@
on a.receipt_key = b.receipt_key
inner join (
select case_key,
count(apprv_yn = 'Y' or apprv_yn = 'N') as apprvCnt,
count(*) as allCnt
count(apprv_yn = 'Y' or apprv_yn = 'N') as apprvCnt,
count(*) as allCnt
from activity_case_apprv
group by case_key
) c on b.case_key = c.case_key
left outer join (
select case_key, count(*) as fileCnt
from activity_case_file
group by case_key
) d on b.case_key = d.case_key
<include refid="selectActivityCaseListWhere"></include>
ORDER BY b.wrt_dt DESC
LIMIT #{rowCnt} OFFSET #{firstIndex}
</select>
<select id="selectActivityCaseCnt" parameterType="ActivityCaseBoard" resultType="int">
select count(*)
from activity_case a
inner join activity_case_info b
on a.receipt_key = b.receipt_key
inner join (
select case_key,
count(apprv_yn = 'Y' or apprv_yn = 'N') as apprvCnt,
count(*) as allCnt
from activity_case_apprv
group by case_key
) c on b.case_key = c.case_key
inner join (
select case_key, count(*) as fileCnt
count(*) as fileCnt
from activity_case_file
group by case_key
) d on b.case_key = d.case_key
<include refid="selectActivityCaseListWhere"></include>
where a.receipt_key = #{receiptKey}
order by b.wrt_dt desc
</select>
<select id="selectReceiptNum" resultType="int" parameterType="int">

View File

@ -80,6 +80,7 @@ function getSuspectDiv(){
success: function(html){
$("#suspectHome").append(html)
$(".suspectBirthDate").datepicker({
startView: 3,
format: "yyyy-mm-dd",
language: "ko",
autoclose: true
@ -174,7 +175,6 @@ function saveActivityCase(status){
})
$(".apprvDiv").each(function (idx, el){
formData.append('apprvList['+idx+'].userSeq', $(el).find(".userSeq").val());
formData.append('apprvList['+idx+'].apprvPath', $(el).find(".apprvPath").val());
formData.append('apprvList['+idx+'].apprvType', $(el).find(".apprvType").val());
formData.append('apprvList['+idx+'].ogCd', $(el).find(".ogCd").val());
formData.append('apprvList['+idx+'].ofcCd', $(el).find(".ofcCd").val());
@ -233,9 +233,21 @@ function contentCheck(){
alert("제목을 입력해주세요.")
return false;
}
if(!$("#reportDt").val()){
if(!$("#reportDate").val()){
alert("보고일자를 입력해주세요.")
return false;
}
if($(".suspectDiv").length===0){
alert("혐의자를 추가해주세요.")
return false;
}else{
}
if($(".apprvDiv").length===0){
alert("결재자를 추가해주세요.")
return false;
}else{
}
switch ($("#caseType").val()) {
case "ACT001":

View File

@ -106,39 +106,46 @@
<table class="table table-sm table-bordered table-hover">
<thead>
<tr class="table-secondary">
<th>순번</th>
<th rowspan="2">순번</th>
<th rowspan="2">접수번호</th>
<th rowspan="2">혐의자</th>
<th rowspan="2">보고서 수</th>
<th rowspan="2">작성자</th>
<th colspan="5">최근보고서</th>
</tr>
<tr class="table-secondary">
<th>구분</th>
<th>접수번호</th>
<th>사건번호</th>
<th>문서번호</th>
<th>제목</th>
<th>보고일</th>
<th>작성자</th>
<th>작성일</th>
<th>결재상태</th>
<th>첨부파일</th>
</tr>
</thead>
<tbody class="table-group-divider">
<tr class="activityCaseTr" th:each="case,cnt:${activityCaseList}">
<input type="hidden" class="receiptKey" th:value="${case.receiptKey}">
<td th:text="${cnt.count+(searchParams.pageIndex-1)*searchParams.rowCnt}"></td>
<td th:text="${case.receiptNum}"></td>
<td>
<th:block th:if="${case.suspectCnt>1}" th:text="${#strings.concat(case.suspectNm, ' 외 총 ', case.suspectCnt, '인')}"></th:block>
<th:block th:if="${case.suspectCnt eq 1}" th:text="${case.suspectNm}"></th:block>
</td>
<td th:text="${case.reportCnt}"></td>
<td>
<th:block th:each="code:${session.commonCode.get('JT')}">
<th:block th:if="${code.itemCd eq case.wrtUserGrd}" th:text="${code.itemValue}"></th:block>
</th:block>
<th:block th:text="${case.wrtUserNm}"></th:block>
</td>
<td>
<th:block th:each="code:${session.commonCode.get('ACT')}">
<th:block th:if="${code.itemCd eq case.caseType}" th:text="${code.itemValue}"></th:block>
</th:block>
</td>
<td th:text="${case.receiptNum}"></td>
<td th:text="${case.caseNum}"></td>
<td th:text="${case.title}"></td>
<td th:text="${#temporals.format(case.reportDate, 'yyyy-MM-dd')}"></td>
<td>
<th:block th:each="code:${session.commonCode.get('JT')}">
<th:block th:if="${code.itemCd eq case.wrtUserGrd}" th:text="${code.itemValue}"></th:block>
</th:block>
</td>
<td th:text="${#temporals.format(case.wrtDt, 'yyyy-MM-dd')}"></td>
<td th:text="${#strings.concat(case.apprvCnt, '/', case.allCnt)}"></td>
<td th:text="${case.fileCnt}"></td>
<td th:text="${#temporals.format(case.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
</tr>
</tbody>
</table>

View File

@ -11,13 +11,6 @@
<div class="col-12 mb-1">
<div class="row">
<label class="col-sm-1 col-form-label col-form-label-sm text-center">경로</label>
<div class="col-2">
<input type="text" class="form-control form-control-sm apprvPath">
</div>
<label class="col-sm-1 col-form-label col-form-label-sm text-center">구분</label>
<div class="col-2">
<input type="text" class="form-control form-control-sm apprvType">
</div>
<label class="col-sm-3 col-form-label col-form-label-sm text-start">
<th:block th:each="code:${session.commonCode.get('OG')}">
<th:block th:if="${code.itemCd eq user.ogCd}" th:text="${code.itemValue}"></th:block>
@ -30,6 +23,15 @@
</th:block>
<th:block th:text="${user.userNm}"></th:block>
</label>
<label class="col-sm-1 col-form-label col-form-label-sm text-center">구분</label>
<div class="col-2">
<select class="form-select form-select-sm apprvType">
<option value="">선택</option>
<th:block th:each="code:${session.commonCode.get('ACAT')}">
<th:block th:if="${code.useChk eq 'Y'}" th:value="${code.itemCd}" th:text="${code.itemValue}"></th:block>
</th:block>
</select>
</div>
<div class="col-1">
<button type="button" class="btn btn-sm btn-outline-danger rowDeleteBtn"><i class="bi bi-x"></i></button>
</div>