작업중 설정 진행 중 & 배치 모니터링 수정

This commit is contained in:
2023-05-09 20:23:00 +09:00
parent 96fe1ec899
commit 081e9b8712
7 changed files with 126 additions and 137 deletions

View File

@@ -14,6 +14,7 @@ import kr.co.uplus.ez.common.components.ValidComponents;
import kr.co.uplus.ez.common.components.WebClientRequestService;
import kr.co.uplus.ez.common.data.ApiResponseCode;
import kr.co.uplus.ez.common.data.Const;
import springfox.documentation.spring.web.json.Json;
import org.apache.http.HttpStatus;
import org.apache.http.protocol.HTTP;
@@ -274,8 +275,8 @@ public class SysMgtController {
/**
* data: 2022. 10.24.
* auth: Lee minha
* desc: 배치 리스트 조회
* auth: Lee
* desc: 배치 리스트 조회.
* @return
*/
@ApiOperation(value = "batchList", notes = "배치 리스트 조회")
@@ -286,9 +287,9 @@ public class SysMgtController {
}
/**
* data : 2022. 10. 26
* auth : Lee minha
* desc : 배치 상세내용
* date : 2022. 10. 26
* auth : Lee
* desc : 배치 상세내용.
* @return
*/
@@ -299,16 +300,21 @@ public class SysMgtController {
public BatchDetailResDto batchDetail(@RequestBody @Valid BatchDetailReqDto batchDetailReqDto,
BindingResult bindingResult) {
if (validComponents.validParameter(bindingResult)) {
return new BatchDetailResDto(ApiResponseCode.CM_PARAMETER_ERROR);
}
// batchDetailReqDto.setBatchId("BATCH_010");
logger.debug("param 확인 : "+ batchDetailReqDto);
return sysService.batchDetail(batchDetailReqDto);
}
/**
* date : 2022. 10. 26
* auth : Lee
* @param batchReqMap
* @return
*/
@RequestMapping(value = "batchExecuteJob", method = {RequestMethod.POST})
@ResponseBody
public BatchExeLogResDto batchExecuteJob(@RequestBody @Valid Map<Object, Object> batchReqMap) {
@@ -324,35 +330,22 @@ public class SysMgtController {
String dayBatch = "yyyyMMdd";
String timeBatch = "yyyyMMddHHmmss";
SimpleDateFormat monthDateFormat = new SimpleDateFormat(monthBatch);
SimpleDateFormat dayDateFormat = new SimpleDateFormat(dayBatch);
SimpleDateFormat timeDateFormat = new SimpleDateFormat(timeBatch);
logger.info("callUrl={}",callUrl);
String jobId = (String) batchReqMap.get("batchId");
String batchType = (String) batchReqMap.get("batchType");
String strDate = (String) batchReqMap.get("strDate");
logger.info("유입날짜 확인 {}",batchReqMap.get("strDate"));
logger.info("batchExecuteJob input Date Check = {}",batchReqMap.get("strDate"));
logger.debug("확인 batchType={}",batchType);
if(
//월배치일 경우 날짜
jobId.equals("BATCH_001")||
jobId.equals("BATCH_002")||
jobId.equals("BATCH_004")||
jobId.equals("BATCH_005")||
jobId.equals("BATCH_006")||
jobId.equals("BATCH_009")||
jobId.equals("BATCH_011")||
jobId.equals("BATCH_017")||
jobId.equals("BATCH_020")) {
// 배치 타입 : 일배치, 월배치, 매시간
if("월배치".equals(batchType)) {
logger.debug("월배치 batchType={}",batchType);
try {
Date date = new SimpleDateFormat("yyyy-MM-dd").parse(strDate);
strDate = (String)monthDateFormat.format(date);
@@ -360,32 +353,17 @@ public class SysMgtController {
// TODO Auto-generated catch block
e1.printStackTrace();
}
} else if (
//일배치일 경우 날짜
jobId.equals("BATCH_003")||
jobId.equals("BATCH_008")||
jobId.equals("BATCH_010")||
jobId.equals("BATCH_012")||
jobId.equals("BATCH_013")||
jobId.equals("BATCH_014")||
jobId.equals("BATCH_015")||
jobId.equals("BATCH_018")||
jobId.equals("BATCH_019")||
jobId.equals("BATCH_021")||
jobId.equals("BATCH_022")||
jobId.equals("BATCH_023")){
}else if("일배치".equals(batchType)) {
logger.debug("일배치 batchType={}",batchType);
try {
Date date = new SimpleDateFormat("yyyy-MM-dd").parse(strDate);
strDate = (String)dayDateFormat.format(date);
} catch (ParseException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
} else {
}
}else if("매시간".equals(batchType)) {
logger.debug("매시간 batchType={}",batchType);
try {
Date date = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.S").parse(strDate);
strDate = (String)timeDateFormat.format(date);
@@ -394,7 +372,7 @@ public class SysMgtController {
e1.printStackTrace();
}
}
try {
jsonObject.put("strDate", strDate);
@@ -449,4 +427,10 @@ public class SysMgtController {
return sysService.notiList(notiListReqDto);
}
@RequestMapping(value = "/setWorkState", method = {RequestMethod.POST})
@ResponseBody
public void setWorkState(@RequestBody @Valid Object setWorkParam) {
logger.debug("setWorkParam={}",setWorkParam);
}
}

View File

@@ -15,6 +15,12 @@ public class BatchDetailReqDto implements Serializable{
//배치 아이디
private String batchId;
//배치명
private String batchNm;
//배치 유형
private String batchType;
//검색 시작일
private String startDt;