feat: 집합교육 작업중

main
thkim 2024-10-23 14:53:25 +09:00
parent f9fe8d2f2e
commit f35652a5da
7 changed files with 64 additions and 20 deletions

View File

@ -95,6 +95,40 @@ public class HomeTrainingServiceImpl implements HomeTrainingService {
}
private boolean isValid(HashMap<String, Object> params) throws Exception {
String reqName = MyUtil.getStringFromObject( params.get("reqName") );
if( reqName == null || reqName.isEmpty()) {
throw new Exception( "신청자를 입력하십시오." );
}
String companyName = MyUtil.getStringFromObject( params.get("companyName") );
if( companyName == null || companyName.isEmpty()) {
throw new Exception( "소속기관 입력하십시오." );
}
String reqDept = MyUtil.getStringFromObject( params.get("reqDept") );
if( reqDept == null || reqDept.isEmpty()) {
throw new Exception( "부서를 입력하십시오." );
}
String reqPosition = MyUtil.getStringFromObject( params.get("reqPosition") );
if( reqPosition == null || reqPosition.isEmpty()) {
throw new Exception( "직급을 입력하십시오." );
}
String reqTel = MyUtil.getStringFromObject( params.get("reqTel") );
if( reqTel == null || reqTel.isEmpty()) {
throw new Exception( "연락처를 입력하십시오." );
}
String reqEmail = MyUtil.getStringFromObject( params.get("reqEmail") );
if( reqEmail == null || reqEmail.isEmpty()) {
throw new Exception( "이메일을 입력하십시오." );
}
return true;
}
@Override
public HashMap<String, Object> attendHomeTraining(HttpServletRequest request, HttpServletResponse response, HashMap<String, Object> params) throws Exception {
@ -109,11 +143,7 @@ public class HomeTrainingServiceImpl implements HomeTrainingService {
String userId = (String)request.getSession().getAttribute("USERID");
params.put("userId", userId);
String reqPosition = MyUtil.getStringFromObject( params.get("reqPosition") );
if( reqPosition == null ) {
throw new Exception( "직급을 입력하십시오." );
}
isValid(params);
try {
//신청 여부를 판단하여 stateCode를 T로 변환한다. A:신청중,D:삭제,C:취소,T:참석
@ -146,6 +176,8 @@ public class HomeTrainingServiceImpl implements HomeTrainingService {
String userId = (String)request.getSession().getAttribute("USERID");
params.put("userId", userId);
isValid(params);
Long whtId = null;
try {
List<EgovMap> list = homeTrainingMapper.getWebHomeTrainingReqByWhtRegIdAndUserId(params);
@ -181,11 +213,21 @@ public class HomeTrainingServiceImpl implements HomeTrainingService {
String userId = (String)request.getSession().getAttribute("USERID");
params.put("userId", userId);
Long whtId = null;
try {
long webHomeTrainingReqCount = homeTrainingMapper.getWebHomeTrainingReqCountByWhtRegIdAndUserId(params);
if( webHomeTrainingReqCount == 0 ) {
throw new Exception( "교육 참석 취소 대상이 존재하지 않습니다." );
List<EgovMap> list = homeTrainingMapper.getWebHomeTrainingReqByWhtRegIdAndUserId(params);
if( list.size() == 0 ) {
throw new Exception( "취소할 교육이 존재하지 않습니다." );
}
for( EgovMap item : list ) {
TIMESTAMP oracleTimestamp = (TIMESTAMP) item.get("crtDt");
item.put("crtDt", new Timestamp(oracleTimestamp.timestampValue().getTime())); // oracle.sql.TIMESTAMP -> java.sql.Timestamp 변환
whtId = Long.valueOf( ((BigDecimal)item.get("whtId")).longValue() );
}
params.put("whtId", whtId.intValue());
homeTrainingMapper.callSpCancelHomeTrainingReq(params);
return params;
} catch (SQLException e) {

View File

@ -44,7 +44,7 @@
<![CDATA[
SELECT count(1)
FROM WEB_HOME_TRAINING_REQ whtr
WHERE whtr.WHT_REG_ID = #{whtRegId} AND whtr.CRT_USERID = #{userId}
WHERE whtr.WHT_REG_ID = #{whtRegId} AND whtr.CRT_USERID = #{userId} AND whtr.STATE_CODE NOT IN('C', 'D')
]]>
</select>
@ -52,7 +52,7 @@
<![CDATA[
SELECT *
FROM WEB_HOME_TRAINING_REQ whtr
WHERE whtr.WHT_REG_ID = #{whtRegId} AND whtr.CRT_USERID = #{userId}
WHERE whtr.WHT_REG_ID = #{whtRegId} AND whtr.CRT_USERID = #{userId} AND whtr.STATE_CODE NOT IN('C', 'D')
]]>
</select>
@ -89,7 +89,7 @@
<select id="callSpCancelHomeTrainingReq" statementType="CALLABLE" parameterType="map" resultMap="spCancelHomeTrainingReqResult">
CALL SP_CANCEL_HOME_TRAINING_REQ(
#{whtRegId, jdbcType=INTEGER, mode=IN},
#{whtId, jdbcType=INTEGER, mode=IN},
#{userId, jdbcType=VARCHAR, mode=IN},
#{resultCode, jdbcType=VARCHAR, mode=OUT},
#{errMsg, jdbcType=VARCHAR, mode=OUT}

View File

@ -334,14 +334,14 @@
<li>
<img src="../com/img/common/bg/main_info_visual_20240906.png?v=20240906" alt="건설 시추정보 DB 사용자 방문교육 신청 안내" usemap="#study">
<map name="study" id="study" />
<area shape="rect" coords="300, 250, 555, 295" onClick="gourl('homeEducationApplication')" style="cursor:pointer;"/>
<area shape="rect" coords="0, 0, 853, 330" onClick="gourl('homeEducationApplication')" style="cursor:pointer;"/>
</li>
</c:when>
<c:when test="${cls == 1}">
<li>
<img src="../com/img/common/bg/main_info_visual_20240905.png?v=20240906" alt="건설 시추정보 DB 사용자 방문교육 신청 안내" usemap="#study">
<map name="study" id="study" />
<area shape="rect" coords="300, 250, 555, 295" onClick="gourl('visitEducationApplication')" style="cursor:pointer;"/>
<area shape="rect" coords="0, 0, 853, 330" onClick="gourl('visitEducationApplication')" style="cursor:pointer;"/>
</li>
</c:when>
<c:otherwise>

View File

@ -184,7 +184,7 @@
document.addEventListener('DOMContentLoaded', function () {
debugger;
const rows = document.querySelectorAll('#Table_contents tbody tr td:nth-child(7)');
@ -407,8 +407,8 @@
<table class="Table_Main" id="Table_contents">
<colgroup>
<col style="width:40px;">
<col style="width:235px;">
<col style="width:180px;">
<col style="width:255px;">
<col style="width:150px;">
<col style="width:215px;">
<col style="width:280px;">
<col style="width:70px;">

View File

@ -3778,6 +3778,7 @@ ul.faq-q > li textarea {
.home-education-application-inquiry th,
.home-education-application-inquiry tr {
height: 36px;
text-align: center;
}
.home-education-application-inquiry button {
background-color: #007BFF;
@ -3857,7 +3858,7 @@ ul.faq-q > li textarea {
text-align: center;
}
.input-data-modal-content .input-data-modal .input-data-modal-content .input-data-modal-body .input-data-modal-table .input-data-modal-thead tr th {
padding-left: 13px;
padding-left: 0px;
padding-bottom: 10px;
text-align: center;
}

File diff suppressed because one or more lines are too long

View File

@ -3444,6 +3444,7 @@ ul.faq-q > li textarea {
th,
tr{
height: 36px;
text-align: center;
}
button{
background-color: #007BFF;
@ -3530,7 +3531,7 @@ ul.faq-q > li textarea {
.input-data-modal-thead {
tr {
th {
padding-left: 13px;
padding-left: 0px;
padding-bottom: 10px;
text-align: center;
}