fix : 방첩활동 중간저장

master
TaehunPark 2023-01-05 11:42:12 +09:00
parent fb75171ad9
commit b218a81ebb
9 changed files with 129 additions and 17 deletions

View File

@ -149,12 +149,15 @@ public class CounterIntelligenceController {
} }
Integer ciKey = ciService.saveCiActivity(cia, deleteFileSeq); Integer ciKey = ciService.saveCiActivity(cia, deleteFileSeq);
switch (cia.getCiType()) { switch (cia.getCiType()) {
case "SDI": // 공지사항 case "SDI": // 치안수요분석
ciService.saveSaftyDemand(cia); ciService.saveSaftyDemand(cia);
break; break;
case "MCI": // 공용게시판 case "MCI": // 해양산업보호관리업체
ciService.saveManageCompany(cia); ciService.saveManageCompany(cia);
break; break;
case "FI": // 외국인커뮤니티모니터링
ciService.saveForeigner(cia);
break;
} }
return ciKey; return ciKey;
@ -209,8 +212,8 @@ public class CounterIntelligenceController {
cia.setDownOrganCdList(loginUser.getDownOrganCdList()); cia.setDownOrganCdList(loginUser.getDownOrganCdList());
cia.setQueryInfo(); cia.setQueryInfo();
mav.addObject("mciList", ciService.selectCiaManageCompanyList(cia)); mav.addObject("fiList", ciService.selectCiaForeignerList(cia));
cia.setContentCnt(ciService.selectCiaManageCompanyListCnt(cia)); cia.setContentCnt(ciService.selectCiaForeignerListCnt(cia));
cia.setPaginationInfo(); cia.setPaginationInfo();
mav.addObject("searchParams", cia); mav.addObject("searchParams", cia);
return mav; return mav;

View File

@ -3,6 +3,8 @@ package com.dbnt.faisp.main.counterIntelligence.mapper;
import com.dbnt.faisp.main.counterIntelligence.model.CiWorkStatistics; import com.dbnt.faisp.main.counterIntelligence.model.CiWorkStatistics;
import com.dbnt.faisp.main.counterIntelligence.model.CounterIntelligenceActivity; import com.dbnt.faisp.main.counterIntelligence.model.CounterIntelligenceActivity;
import com.dbnt.faisp.main.counterIntelligence.model.CounterIntelligenceWork; import com.dbnt.faisp.main.counterIntelligence.model.CounterIntelligenceWork;
import com.dbnt.faisp.main.counterIntelligence.model.ForeignerInfo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List; import java.util.List;
@ -28,4 +30,8 @@ public interface CounterIntelligenceMapper {
List<CounterIntelligenceActivity> selectCiaManageCompanyList(CounterIntelligenceActivity cia); List<CounterIntelligenceActivity> selectCiaManageCompanyList(CounterIntelligenceActivity cia);
Integer selectCiaManageCompanyListCnt(CounterIntelligenceActivity cia); Integer selectCiaManageCompanyListCnt(CounterIntelligenceActivity cia);
List<ForeignerInfo> selectCiaForeignerList(CounterIntelligenceActivity cia);
Integer selectCiaForeignerListCnt(CounterIntelligenceActivity cia);
} }

View File

@ -55,6 +55,8 @@ public class CounterIntelligenceActivity extends BaseModel {
@Transient @Transient
private ManageCompanyInfo manageCompanyInfo; private ManageCompanyInfo manageCompanyInfo;
@Transient @Transient
private ForeignerInfo foreignerInfo;
@Transient
private String mgtOrgan; private String mgtOrgan;
@Transient @Transient
private String companyNm; private String companyNm;
@ -71,6 +73,21 @@ public class CounterIntelligenceActivity extends BaseModel {
@Transient @Transient
private String name; private String name;
@Transient @Transient
private String manager;
@Transient
private String commuLocation;
@Transient
private String commuNational;
@Transient
private String commuAddress;
@Transient
private String selectReason;
@Transient
private String monitoringInfo;
@Transient
@DateTimeFormat(pattern = "yyyy-MM-dd")
private LocalDate fixDate;
@Transient
private List<CiaFile> fileList; private List<CiaFile> fileList;
@Transient @Transient
private List<MultipartFile> multipartFileList; private List<MultipartFile> multipartFileList;

View File

@ -23,6 +23,8 @@ public class ForeignerInfo {
@Id @Id
@Column(name = "ci_key") @Column(name = "ci_key")
private Integer ciKey; private Integer ciKey;
@Column(name = "mgt_organ")
private String mgtOrgan;
@Column(name = "manager") @Column(name = "manager")
private String manager; private String manager;
@Column(name = "commu_location") @Column(name = "commu_location")

View File

@ -8,6 +8,7 @@ import com.dbnt.faisp.main.counterIntelligence.model.CiaFile;
import com.dbnt.faisp.main.counterIntelligence.model.CiwFile; import com.dbnt.faisp.main.counterIntelligence.model.CiwFile;
import com.dbnt.faisp.main.counterIntelligence.model.CounterIntelligenceActivity; import com.dbnt.faisp.main.counterIntelligence.model.CounterIntelligenceActivity;
import com.dbnt.faisp.main.counterIntelligence.model.CounterIntelligenceWork; import com.dbnt.faisp.main.counterIntelligence.model.CounterIntelligenceWork;
import com.dbnt.faisp.main.counterIntelligence.model.ForeignerInfo;
import com.dbnt.faisp.main.counterIntelligence.model.HashTagLinkCiw; import com.dbnt.faisp.main.counterIntelligence.model.HashTagLinkCiw;
import com.dbnt.faisp.main.counterIntelligence.model.ManageCompanyInfo; import com.dbnt.faisp.main.counterIntelligence.model.ManageCompanyInfo;
import com.dbnt.faisp.main.counterIntelligence.model.SaftyDemandInfo; import com.dbnt.faisp.main.counterIntelligence.model.SaftyDemandInfo;
@ -246,4 +247,27 @@ public class CounterIntelligenceService extends BaseService {
return dbCia; return dbCia;
} }
@Transactional
public void saveForeigner(CounterIntelligenceActivity cia) {
ForeignerInfo fi = new ForeignerInfo();
fi.setCiKey(cia.getCiKey());
fi.setMgtOrgan(cia.getMgtOrgan());
fi.setManager(cia.getManager());
fi.setCommuLocation(cia.getCommuLocation());
fi.setCommuNational(cia.getCommuNational());
fi.setCommuAddress(cia.getCommuAddress());
fi.setSelectReason(cia.getSelectReason());
fi.setMonitoringInfo(cia.getMonitoringInfo());
fi.setFixDate(cia.getFixDate());
foreignerInfoRepository.save(fi);
}
public List<ForeignerInfo> selectCiaForeignerList(CounterIntelligenceActivity cia) {
return ciMapper.selectCiaForeignerList(cia);
}
public Integer selectCiaForeignerListCnt(CounterIntelligenceActivity cia) {
return ciMapper.selectCiaForeignerListCnt(cia);
}
} }

View File

@ -235,4 +235,50 @@
)a )a
</select> </select>
<select id="selectCiaForeignerList" parameterType="CounterIntelligenceActivity" resultType="CounterIntelligenceActivity">
select cia.ci_key,
(select item_value from code_mgt where item_cd = fi.mgt_organ) as mgt_organ,
fi.manager,
fi.commu_location,
fi.commu_national,
fi.commu_address,
fi.select_reason,
fi.monitoring_info,
fi.fix_date,
cia.wrt_dt
from counter_intelligence_activity cia,
foreigner_info fi
where cia.ci_key = fi.ci_key
and fi.mgt_organ in
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
ORDER BY cia.ci_key DESC
LIMIT #{rowCnt} OFFSET #{firstIndex}
</select>
<select id="selectCiaForeignerListCnt" parameterType="CounterIntelligenceActivity" resultType="Integer">
select count(*)
from(
select cia.ci_key,
(select item_value from code_mgt where item_cd = fi.mgt_organ) as mgt_organ,
fi.manager,
fi.commu_location,
fi.commu_national,
fi.commu_address,
fi.select_reason,
fi.monitoring_info,
fi.fix_date,
cia.wrt_dt
from counter_intelligence_activity cia,
foreigner_info fi
where cia.ci_key = fi.ci_key
and fi.mgt_organ in
<foreach collection="downOrganCdList" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
ORDER BY cia.ci_key DESC
)a
</select>
</mapper> </mapper>

View File

@ -27,7 +27,7 @@ function getCiaForeignerEditModal(ciKey){
$(document).on('click', '#saveBtn', function (){ $(document).on('click', '#saveBtn', function (){
if(confirm("저장하시겠습니까?")){ if(confirm("저장하시겠습니까?")){
const formData = new FormData($("#ciaManageCompanyEditForm")[0]); const formData = new FormData($("#ciaForeignerEditForm")[0]);
for(const file of files) { for(const file of files) {
if(!file.isDelete) if(!file.isDelete)
formData.append('uploadFiles', file, file.name); formData.append('uploadFiles', file, file.name);
@ -35,6 +35,7 @@ $(document).on('click', '#saveBtn', function (){
$(".text-decoration-line-through").each(function (idx, el){ $(".text-decoration-line-through").each(function (idx, el){
formData.append('fileSeq', $(el).attr("data-fileseq")); formData.append('fileSeq', $(el).attr("data-fileseq"));
}) })
formData.append('monitoringInfo', CrossEditor.GetBodyValue());
$.ajax({ $.ajax({
type : 'POST', type : 'POST',
data : formData, data : formData,

View File

@ -5,10 +5,10 @@
<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" id="ivsgtEditBody"> <div class="modal-body" id="ivsgtEditBody">
<form action="#" method="post" id="ciaManageCompanyEditForm"> <form action="#" method="post" id="ciaForeignerEditForm">
<input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/> <input type="hidden" name="_csrf_header" th:value="${_csrf.headerName}"/>
<input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/> <input type="hidden" th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
<input type="hidden" name="ciType" value="MCI"> <input type="hidden" name="ciType" value="FI">
<!-- <input type="hidden" name="ciKey" th:value="${cia.ciKey}"> <!-- <input type="hidden" name="ciKey" th:value="${cia.ciKey}">
<input type="hidden" name="wrtOrgan" th:value="${cia.wrtOrgan}"> <input type="hidden" name="wrtOrgan" th:value="${cia.wrtOrgan}">
<input type="hidden" name="wrtPart" th:value="${cia.wrtPart}"> <input type="hidden" name="wrtPart" th:value="${cia.wrtPart}">
@ -33,6 +33,10 @@
<div class="col-sm-2"> <div class="col-sm-2">
<input type="text" class="form-control form-control-sm" id="fixDate" name="fixDate" readonly> <input type="text" class="form-control form-control-sm" id="fixDate" name="fixDate" readonly>
</div> </div>
<label for="wrtDt" class="col-sm-1 col-form-label col-form-label-sm text-center">담당관</label>
<div class="col-sm-2">
<input type="text" class="form-control form-control-sm" id="manager" name="manager">
</div>
<label for="wrtDt" class="col-sm-1 col-form-label col-form-label-sm text-center">작성일</label> <label for="wrtDt" class="col-sm-1 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" placeholder="작성일자동입력" readonly> <input type="text" class="form-control form-control-sm" placeholder="작성일자동입력" readonly>
@ -42,28 +46,28 @@
<div class="row mb-1"> <div class="row mb-1">
<label for="wrtNm" class="col-sm-1 col-form-label col-form-label-sm text-center">소재지</label> <label for="wrtNm" class="col-sm-1 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" id="cellPhone" name="cellPhone"> <input type="text" class="form-control form-control-sm" id="commuLocation" name="commuLocation">
</div> </div>
<label for="wrtDt" class="col-sm-1 col-form-label col-form-label-sm text-center">국적</label> <label for="wrtDt" class="col-sm-1 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" id="department" name="department"> <input type="text" class="form-control form-control-sm" id="commuNational" name="commuNational">
</div> </div>
<label for="wrtDt" class="col-sm-1 col-form-label col-form-label-sm text-center">주소지</label> <label for="wrtDt" class="col-sm-1 col-form-label col-form-label-sm text-center">주소지</label>
<div class="col-sm-2"> <div class="col-sm-5">
<input type="text" class="form-control form-control-sm" id="name" name="name"> <input type="text" class="form-control form-control-sm" id="commuAddress" name="commuAddress">
</div> </div>
</div> </div>
<div class="row mb-1"> <div class="row mb-1">
<label for="contentInfoDiv" class="col-sm-1 col-form-label col-form-label-sm text-center">선정사유</label> <label for="contentInfoDiv" class="col-sm-1 col-form-label col-form-label-sm text-center">선정사유</label>
<div class="col-sm-11" id="contentInfoDiv"> <div class="col-sm-11" id="contentInfoDiv">
<textarea class="form-control form-control-sm" rows="5" cols="30" name="relatedField"></textarea> <textarea class="form-control form-control-sm" rows="5" cols="30" name="selectReason"></textarea>
</div> </div>
</div> </div>
<div class="row mb-1"> <div class="row mb-1">
<label for="content" class="col-sm-1 col-form-label col-form-label-sm text-center">모니터링 사항</label> <label for="content" class="col-sm-1 col-form-label col-form-label-sm text-center">모니터링 사항</label>
<div class="col-sm-11"> <div class="col-sm-11">
<div id="editor"></div> <div id="editor"></div>
<textarea class="d-none" id="content"></textarea> <textarea class="d-none" id="monitoringInfo"></textarea>
</div> </div>
</div> </div>
</th:block> </th:block>

View File

@ -108,11 +108,11 @@
<thead> <thead>
<tr class="table-secondary"> <tr class="table-secondary">
<th rowspan="2">관리관서</th> <th rowspan="2">관리관서</th>
<th rowspan="2">담당관</th>
<th colspan="3">대상커뮤니티</th> <th colspan="3">대상커뮤니티</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> <th rowspan="2">작성자</th>
<th rowspan="2">작성일</th> <th rowspan="2">작성일</th>
</tr> </tr>
@ -123,11 +123,20 @@
</tr> </tr>
</thead> </thead>
<tbody class="table-group-divider"> <tbody class="table-group-divider">
<tr class="mciTr"> <tr class="fiTr" th:each="list:${fiList}">
<th:block> <th:block>
<input type="hidden" class="ciKey" > <input type="hidden" class="ciKey" th:value="${list.ciKey}">
</th:block> </th:block>
<td th:text="${list.mgtOrgan}"></td>
<td th:text="${list.manager}"></td>
<td th:text="${list.commuLocation}"></td>
<td th:text="${list.commuNational}"></td>
<td th:text="${list.commuAddress}"></td>
<td th:text="${list.selectReason}"></td>
<td th:utext="${list.monitoringInfo}"></td>
<td th:text="${list.fixDate}"></td>
<td th:text="${list.mgtOrgan}"></td>
<td th:text="${#temporals.format(list.wrtDt, 'yyyy-MM-dd HH:mm')}"></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>