2022-09-21 되돌리기 작업 및 트랜잭션 처리 추가
This commit is contained in:
parent
35aae8256b
commit
3a410cc30c
@ -73,8 +73,6 @@ import kcc.kccadr.adjst.service.AdjstReqService;
|
||||
import kcc.kccadr.adjst.service.AdjstReqVO;
|
||||
import kcc.kccadr.advc.service.AdrHstryMgrService;
|
||||
import kcc.kccadr.advc.service.AdrHstryMgrVO;
|
||||
import kcc.kccadr.advc.service.impl.AdrHstryMgrDAO;
|
||||
import kcc.kccadr.advc.service.impl.AdrHstryMgrDetailDAO;
|
||||
import kcc.kccadr.cmm.KccadrConstants;
|
||||
import kcc.kccadr.kccadrCom.service.KccadrCommonSearchVO;
|
||||
import kcc.kccadr.kccadrCom.service.KccadrCommonService;
|
||||
@ -202,14 +200,6 @@ public class ApmController {
|
||||
private static String islocal; // /pdf/out/
|
||||
@Value("#{globalSettings['Globals.prod.islocal']}")
|
||||
public void setIslocal(String path) { islocal = path; }
|
||||
|
||||
//조정 사건 이력 관리
|
||||
@Resource(name = "adrHstryMgrDAO")
|
||||
private AdrHstryMgrDAO adrHstryMgrDAO;
|
||||
|
||||
//조정 사건 이력 상세 관리
|
||||
@Resource(name = "adrHstryMgrDetailDAO")
|
||||
private AdrHstryMgrDetailDAO adrHstryMgrDetailDAO;
|
||||
|
||||
/**
|
||||
* 조정진행목록 목록
|
||||
@ -1597,12 +1587,23 @@ public class ApmController {
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated() ? (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser() : null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getUniqId());
|
||||
try {
|
||||
if (loginVO == null) {
|
||||
|
||||
modelAndView.addObject("result", "fail");
|
||||
modelAndView.addObject("message", "로그인 해주세요.");
|
||||
return modelAndView;
|
||||
}
|
||||
|
||||
System.out.println(adrHstryMgrVO.toString());
|
||||
//취소 대상 데이터 삭제하기
|
||||
adrHstryMgrVO.setFrstRegisterId(userId);
|
||||
int rs = adrHstryMgrService.delete4CancelAll(adrHstryMgrVO);
|
||||
|
||||
//단계 리스트 가져오기
|
||||
List<AdrHstryMgrVO> adrHstryMgrVOList = adrHstryMgrDAO.selectCancelList(adrHstryMgrVO);
|
||||
//List<AdrHstryMgrVO> adrHstryMgrVOList = adrHstryMgrDAO.selectCancelList(adrHstryMgrVO);
|
||||
|
||||
//단계별 상세 처리 가져오기
|
||||
List<AdrHstryMgrVO> adrHstryMgrDetailVOList = adrHstryMgrDetailDAO.selectCancelList(adrHstryMgrVO);
|
||||
//List<AdrHstryMgrVO> adrHstryMgrDetailVOList = adrHstryMgrDetailDAO.selectCancelList(adrHstryMgrVO);
|
||||
|
||||
/*
|
||||
//이력관리를 위한 adr_hstry_mgr 데이터 관리 추가 - 2022-08-09
|
||||
@ -1633,6 +1634,12 @@ public class ApmController {
|
||||
@RequestMapping(value = "apmDetail.do")
|
||||
public String apmDetail(@ModelAttribute("apmVO") ApmVO apmVO, ModelMap model) throws Exception {
|
||||
|
||||
//로그인 정보 불러오기
|
||||
LoginVO loginVO = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null;
|
||||
String userId = loginVO == null ? "" : EgovStringUtil.isNullToString(loginVO.getUniqId());
|
||||
|
||||
apmVO.setFrstRegisterId(userId);
|
||||
|
||||
//가장 마지막 조정회차로 지정
|
||||
//이력관리를 위한 adr_hstry_mgr 데이터 관리 추가 - 2022-08-09
|
||||
String adrSn = cmmService.selectLastAdrSn(apmVO
|
||||
|
||||
@ -37,5 +37,8 @@ public interface AdrHstryMgrService {
|
||||
List<AdrHstryMgrVO> selectPagingList(AdrHstryMgrVO adrHstryMgrVO) throws Exception;
|
||||
|
||||
//L
|
||||
List<AdrHstryMgrVO> selectCancelList(AdrHstryMgrVO adrHstryMgrVO) throws Exception;
|
||||
List<AdrHstryMgrVO> selectCancelList(AdrHstryMgrVO adrHstryMgrVO) throws Exception;
|
||||
|
||||
//D
|
||||
int delete4CancelAll(AdrHstryMgrVO adrHstryMgrVO) throws Exception;
|
||||
}
|
||||
|
||||
@ -202,4 +202,100 @@ public class AdrHstryMgrDAO extends EgovAbstractDAO {
|
||||
List<AdrHstryMgrVO> tlist = (List<AdrHstryMgrVO>) list("AdrHstryMgrDAO.selectCancelList", adrHstryMgrVO);
|
||||
return tlist;
|
||||
}
|
||||
|
||||
/**
|
||||
* 취소 처리
|
||||
* @param addrAgencyVO
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public int delete4CancelAll(AdrHstryMgrVO adrHstryMgrVO) throws Exception {
|
||||
int i_ret = 1;
|
||||
//step1.전체 리스트를 가져온다.
|
||||
|
||||
//step2.각각의 상세 전체 리스트를 가져온다.
|
||||
|
||||
//step3.U,I여부 확인
|
||||
//step3-1.가 아니면 오류발생 rollback 한다. - Q
|
||||
//step3-2.면 처리
|
||||
//step3-2-1.I인경우 delete 구문 실행 - Q
|
||||
//step3-2-2.U인 경우 처리
|
||||
//step3-2-2-1.query가 없으면 삭제
|
||||
//step3-2-2-2.query가 있으면 update 구문 실행 - Q
|
||||
|
||||
//step4.각각의 상세 전체 대상 삭제 - Q
|
||||
|
||||
//step5.전체 대상 삭제 - Q
|
||||
|
||||
try {
|
||||
//step1.전체 리스트를 가져온다.
|
||||
List<AdrHstryMgrVO> tlist = (List<AdrHstryMgrVO>) list("AdrHstryMgrDAO.selectCancelList", adrHstryMgrVO);
|
||||
|
||||
for (int i=0;i<tlist.size();i++) {
|
||||
AdrHstryMgrVO adrHstryMgrTmpVO = tlist.get(i);
|
||||
//step2.각각의 상세 전체 리스트를 가져온다.
|
||||
List<AdrHstryMgrVO> tDetaillist = (List<AdrHstryMgrVO>) list("AdrHstryMgrDetailDAO.selectCancelList", adrHstryMgrTmpVO);
|
||||
|
||||
for (int j=0;j<tDetaillist.size();j++) {
|
||||
AdrHstryMgrVO adrHstryMgrDetailTmpVO = tDetaillist.get(j);
|
||||
|
||||
//step3.U,I여부 확인
|
||||
if (adrHstryMgrDetailTmpVO.getUseCd().equals("I")) {
|
||||
//step3-2-1.I인경우 delete 구문 실행 - Q
|
||||
delete("AdrHstryMgrDAO.deleteQuery", adrHstryMgrDetailTmpVO);
|
||||
|
||||
}else if (adrHstryMgrDetailTmpVO.getUseCd().equals("U")) {
|
||||
//step3-2-2.U인 경우 처리
|
||||
|
||||
if (!adrHstryMgrDetailTmpVO.getUpdateQuery().equals("")) {
|
||||
//step3-2-2-2.query가 있으면 update 구문 실행 - Q
|
||||
update("AdrHstryMgrDAO.updateQuery", adrHstryMgrDetailTmpVO);
|
||||
|
||||
//}else { //step3-2-2-1.query가 없으면 삭제 - 아래에서 삭제
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else {
|
||||
//step3-1.가 아니면 오류발생 rollback 한다. - Q
|
||||
//step3-2.면 처리
|
||||
update("AdrHstryMgrDAO.updateError", adrHstryMgrDetailTmpVO);
|
||||
}
|
||||
|
||||
|
||||
//step4.각각의 상세 전체 대상 삭제 - Q
|
||||
delete("AdrHstryMgrDetailDAO.delete", adrHstryMgrDetailTmpVO);
|
||||
}
|
||||
|
||||
//step5.전체 대상 삭제 - Q
|
||||
delete("AdrHstryMgrDAO.delete", adrHstryMgrTmpVO);
|
||||
|
||||
//테스트용 - 제거할것.
|
||||
update("AdrHstryMgrDAO.updateError", adrHstryMgrTmpVO);
|
||||
}
|
||||
}catch(Exception ex) {
|
||||
ex.printStackTrace();
|
||||
i_ret = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//return delete("AdrHstryMgrDAO.delete", adrHstryMgrVO);
|
||||
|
||||
return i_ret;
|
||||
}
|
||||
|
||||
public int deleteQuery(AdrHstryMgrVO adrHstryMgrVO) throws Exception {
|
||||
return delete("AdrHstryMgrDAO.deleteQuery", adrHstryMgrVO);
|
||||
}
|
||||
|
||||
public int updateQuery(AdrHstryMgrVO adrHstryMgrVO) throws Exception {
|
||||
return delete("AdrHstryMgrDAO.updateQuery", adrHstryMgrVO);
|
||||
}
|
||||
|
||||
public int updateError(AdrHstryMgrVO adrHstryMgrVO) throws Exception {
|
||||
return delete("AdrHstryMgrDAO.updateErro", adrHstryMgrVO);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,16 +7,26 @@ import javax.annotation.Resource;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import kcc.kccadr.adjreqmgr.service.AdjReqMgrVO;
|
||||
import kcc.kccadr.advc.service.AdrHstryMgrService;
|
||||
import kcc.kccadr.advc.service.AdrHstryMgrVO;
|
||||
import kcc.kccadr.kccadrCom.service.KccadrMgrUdtService;
|
||||
//import kcc.ve.instr.tngrVisitEdu.instrInfo.service.adrHstryMgrVO;
|
||||
|
||||
@Service("adrHstryMgrService")
|
||||
public class AdrHstryMgrServiceImpl implements AdrHstryMgrService {
|
||||
|
||||
//강사
|
||||
//이력
|
||||
@Resource(name="adrHstryMgrDAO")
|
||||
private AdrHstryMgrDAO adrHstryMgrDAO;
|
||||
|
||||
//이력 상세
|
||||
@Resource(name="adrHstryMgrDetailDAO")
|
||||
private AdrHstryMgrDetailDAO adrHstryMgrDetailDAO;
|
||||
|
||||
//이력 상세
|
||||
@Resource(name="KccadrMgrUdtService")
|
||||
private KccadrMgrUdtService kccadrMgrUdtService;
|
||||
|
||||
|
||||
/*
|
||||
@ -98,4 +108,95 @@ public class AdrHstryMgrServiceImpl implements AdrHstryMgrService {
|
||||
return adrHstryMgrDAO.selectCancelList(adrHstryMgrVO);
|
||||
}
|
||||
|
||||
//D
|
||||
public int delete4CancelAll(AdrHstryMgrVO adrHstryMgrVO) throws Exception{
|
||||
|
||||
//return adrHstryMgrDAO.delete4CancelAll(adrHstryMgrVO);
|
||||
|
||||
int i_ret = 1;
|
||||
//step1.전체 리스트를 가져온다.
|
||||
|
||||
//step2.각각의 상세 전체 리스트를 가져온다.
|
||||
|
||||
//step3.U,I여부 확인
|
||||
//step3-1.가 아니면 오류발생 rollback 한다. - Q
|
||||
//step3-2.면 처리
|
||||
//step3-2-1.I인경우 delete 구문 실행 - Q
|
||||
//step3-2-2.U인 경우 처리
|
||||
//step3-2-2-1.query가 없으면 삭제
|
||||
//step3-2-2-2.query가 있으면 update 구문 실행 - Q
|
||||
|
||||
//step4.각각의 상세 전체 대상 삭제 - Q
|
||||
|
||||
//step5.전체 대상 삭제 - Q
|
||||
|
||||
//step1.전체 리스트를 가져온다.
|
||||
List<AdrHstryMgrVO> tlist = adrHstryMgrDAO.selectCancelList(adrHstryMgrVO);
|
||||
|
||||
for (int i=0;i<tlist.size();i++) {
|
||||
AdrHstryMgrVO adrHstryMgrTmpVO = tlist.get(i);
|
||||
//step2.각각의 상세 전체 리스트를 가져온다.
|
||||
List<AdrHstryMgrVO> tDetaillist = adrHstryMgrDetailDAO.selectCancelList(adrHstryMgrTmpVO);
|
||||
|
||||
for (int j=0;j<tDetaillist.size();j++) {
|
||||
AdrHstryMgrVO adrHstryMgrDetailTmpVO = tDetaillist.get(j);
|
||||
|
||||
//step3.U,I여부 확인
|
||||
if (adrHstryMgrDetailTmpVO.getUseCd().equals("I")) {
|
||||
//step3-2-1.I인경우 delete 구문 실행 - Q
|
||||
adrHstryMgrDAO.deleteQuery(adrHstryMgrDetailTmpVO);
|
||||
|
||||
}else if (adrHstryMgrDetailTmpVO.getUseCd().equals("U")) {
|
||||
//step3-2-2.U인 경우 처리
|
||||
|
||||
if (!adrHstryMgrDetailTmpVO.getUpdateQuery().equals("")) {
|
||||
//step3-2-2-2.query가 있으면 update 구문 실행 - Q
|
||||
adrHstryMgrDAO.updateQuery(adrHstryMgrDetailTmpVO);
|
||||
|
||||
//}else { //step3-2-2-1.query가 없으면 삭제 - 아래에서 삭제
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}else {
|
||||
//step3-1.가 아니면 오류발생 rollback 한다. - Q
|
||||
//step3-2.면 처리
|
||||
adrHstryMgrDAO.updateError(adrHstryMgrDetailTmpVO);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//step4.각각의 상세 전체 대상 삭제 - Q
|
||||
adrHstryMgrDetailDAO.delete(adrHstryMgrDetailTmpVO);
|
||||
//delete("AdrHstryMgrDetailDAO.delete", adrHstryMgrDetailTmpVO);
|
||||
}
|
||||
|
||||
//step5.전체 대상 삭제 - Q
|
||||
adrHstryMgrDAO.delete(adrHstryMgrTmpVO);
|
||||
|
||||
}
|
||||
|
||||
|
||||
AdjReqMgrVO arv = new AdjReqMgrVO();
|
||||
|
||||
arv.setAdrSeq(adrHstryMgrVO.getAdrSeq()); //조정일련번호
|
||||
arv.setAdrSn(adrHstryMgrVO.getAdrSn()); //조정일련번호 회차
|
||||
arv.setStatCd("000050"); //최종 변경 상태값
|
||||
//arv.setLastUpdusrId(loginVO.getId()); //최종 변경자
|
||||
arv.setLastUpdusrId(adrHstryMgrVO.getFrstRegisterId()); //최종 변경자
|
||||
|
||||
|
||||
|
||||
i_ret = kccadrMgrUdtService.updateAdrMgrUdt4Cancel(arv
|
||||
, ""
|
||||
);
|
||||
|
||||
//제거할것.--rollback 발생용
|
||||
//adrHstryMgrDAO.updateError(adrHstryMgrVO);
|
||||
|
||||
return i_ret;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,11 @@ public interface KccadrMgrUdtService {
|
||||
, String s_adrHstryMgrSeq
|
||||
) throws Exception;
|
||||
|
||||
// 조정사건상태 업데이트
|
||||
public int updateAdrMgrUdt4Cancel(AdjReqMgrVO adjReqMgrVO
|
||||
, String s_adrHstryMgrSeq
|
||||
) throws Exception;
|
||||
|
||||
// 조정사건이력 등록
|
||||
public void insertAdrHstry(AdjReqMgrVO adjReqMgrVO) throws Exception;
|
||||
|
||||
|
||||
@ -137,6 +137,17 @@ public class KccadrMgrUdtServiceImpl implements KccadrMgrUdtService{
|
||||
// return adjReqMgrDAO.updateAdrMgrMasterStatus(adjReqMgrVO);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateAdrMgrUdt4Cancel(AdjReqMgrVO adjReqMgrVO
|
||||
, String s_adrHstryMgrSeq
|
||||
) throws Exception {
|
||||
|
||||
int rs = _updateAdrMgrUdt(adjReqMgrVO);
|
||||
|
||||
return rs;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -210,7 +221,9 @@ public class KccadrMgrUdtServiceImpl implements KccadrMgrUdtService{
|
||||
System.out.println("Exception Occured!!!");
|
||||
}
|
||||
|
||||
if (adjReqMgrVO.getStatCd().indexOf("50")==0) { //50 코드들은 master 테이블의 상태 업데이트를 하지 않는다.
|
||||
System.out.println("Exception Occured!!!"+adjReqMgrVO.getStatCd());
|
||||
|
||||
if (adjReqMgrVO.getStatCd().indexOf("50")==0 || adjReqMgrVO.getStatCd().indexOf("000050")==0) { //50 코드들은 master 테이블의 상태 업데이트를 하지 않는다.
|
||||
return 1;
|
||||
}else {
|
||||
return adjReqMgrDAO.updateAdrMgrMasterStatus(adjReqMgrVO);
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
execution(* kcc.com..*Impl.*(..)) or
|
||||
execution(* kcc.ve..*Impl.*(..)) or
|
||||
execution(* kcc.kccadr..*Impl.*(..))
|
||||
execution(* kccadr..*Impl.*(..))
|
||||
"/>
|
||||
<aop:advisor advice-ref="txAdvice" pointcut-ref="requiredTx" />
|
||||
</aop:config>
|
||||
|
||||
@ -207,6 +207,7 @@
|
||||
AND (
|
||||
stat_cd IN ( '101050')
|
||||
OR stat_cd >'200000'
|
||||
OR stat_cd ='000050'
|
||||
)
|
||||
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@
|
||||
a.adr_hstry_mgr_detail_seq AS adrHstryMgrDetailSeq,
|
||||
a.adr_sn AS adrSn,
|
||||
a.use_cd AS useCd,
|
||||
a.table_name AS tableNm,
|
||||
a.table_name AS tableName,
|
||||
|
||||
a.adr_pk_3 AS adrPk3,
|
||||
a.adr_pk_4 AS adrPk4,
|
||||
@ -204,6 +204,8 @@
|
||||
WHERE
|
||||
a.adr_seq = #adrSeq#
|
||||
AND a.adr_hstry_mgr_seq = #adrHstryMgrSeq#
|
||||
|
||||
ORDER BY a.adr_hstry_mgr_detail_seq desc
|
||||
|
||||
</select>
|
||||
</sqlMap>
|
||||
|
||||
@ -196,8 +196,39 @@
|
||||
WHERE
|
||||
a.adr_seq = #adrSeq#
|
||||
AND a.adr_hstry_mgr_seq >= #adrHstryMgrSeq#
|
||||
|
||||
AND 0>=instr(a.menu_id,'V')
|
||||
|
||||
ORDER BY a.adr_hstry_mgr_seq
|
||||
ORDER BY a.adr_hstry_mgr_seq DESC
|
||||
|
||||
</select>
|
||||
|
||||
<!-- insert 쿼리 -->
|
||||
<update id="AdrHstryMgrDAO.deleteQuery" parameterClass="AdrHstryMgrVO">
|
||||
DELETE
|
||||
$tableName$
|
||||
$updateQuery$
|
||||
|
||||
</update>
|
||||
|
||||
<!-- update 쿼리 -->
|
||||
<update id="AdrHstryMgrDAO.updateQuery" parameterClass="AdrHstryMgrVO">
|
||||
UPDATE
|
||||
$tableName$
|
||||
$updateQuery$
|
||||
|
||||
</update>
|
||||
|
||||
<!-- 오류 발생용 쿼리 -->
|
||||
<update id="AdrHstryMgrDAO.updateError" parameterClass="AdrHstryMgrVO">
|
||||
UPDATE
|
||||
<include refid="AdrHstryMgrDAO.table_name"/>
|
||||
SET
|
||||
aaa
|
||||
|
||||
WHERE
|
||||
adr_seq = #adrSeq#
|
||||
AND adr_hstry_mgr_seq = #adrHstryMgrSeq#
|
||||
|
||||
</update>
|
||||
</sqlMap>
|
||||
|
||||
@ -20,14 +20,14 @@
|
||||
|
||||
function fncCancelDo(p_a, p_b){
|
||||
|
||||
var message = "해당 상태까지 취소 처리합니까?";
|
||||
var message = "해당 상태를 포함하여 이후 단계를 모두 취소 처리합니다.\n관련데이터는 모두 삭제처리 됩니다.\n(삭제된 데이터는 복구할수 없습니다.)\n\n진행합니까?";
|
||||
|
||||
// alert(p_a);
|
||||
|
||||
if(confirm(message)){
|
||||
|
||||
var data = new FormData(document.getElementById("listForm"));
|
||||
data.append("adrSeq", p_a);
|
||||
//data.append("adrSeq", p_a);
|
||||
data.append("adrHstryMgrSeq", p_b);
|
||||
|
||||
|
||||
@ -58,7 +58,8 @@ function fncCancelDo(p_a, p_b){
|
||||
return false;
|
||||
|
||||
}else{
|
||||
alert("취소 처리가 완료되었습니다.");
|
||||
alert("취소 처리가 완료되었습니다.");
|
||||
location.reload();
|
||||
return false;
|
||||
|
||||
}
|
||||
@ -207,7 +208,7 @@ function fncCancelDo(p_a, p_b){
|
||||
<td>
|
||||
<p>
|
||||
<c:if test="${fn:length(list.menuId) eq 6}">
|
||||
<c:if test="${list.menuId*1 gt 200000}">
|
||||
<c:if test="${list.menuId*1 gt 200000 and list.menuId*1 ne 201090}">
|
||||
<a href="javascript:fncCancelDo('${list.adrSeq}','${list.adrHstryMgrSeq}');">취소</a>
|
||||
</c:if>
|
||||
</c:if>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user