지역주민감면 전출 확인 스케쥴러 추가

main
이범준 7 months ago
parent 8f882fca22
commit 06bfb6c946

@ -0,0 +1,135 @@
package cfs.schd;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import cfs.common.service.CfsCommonService;
import cfs.common.util.CallWebService;
import cfs.common.util.StringUtil;
import cfs.schd.dao.SchdDao;
import cfs.trsmrcv.web.CarInfoSearch;
@Component("localResidentsCarInfo")
public class LocalResidentsCarInfo {
protected Logger logger = LoggerFactory.getLogger(this.getClass());
@Resource(name="schdDao")
private SchdDao schdDao;
@Resource(name="cfsCommonService")
private CfsCommonService cfsCommonService;
public void checkMovingOut(){
this.checkMovingOut_lastDigit("");
}
public void checkMovingOut_lastDigit(String lastDigit){
SimpleDateFormat sdf8 = (new SimpleDateFormat("yyyyMMdd"));
SimpleDateFormat sdf14 = (new SimpleDateFormat("yyyyMMddHHmmss"));
Date now = new Date();
String levyStdde = sdf8.format(now);
String procStrtDttm = sdf14.format(now);
Map<String, String> carNoFilter = new HashMap<String, String>();
if(lastDigit != null && !lastDigit.equals("")){
carNoFilter.put("digit", lastDigit);
}
Map<String, Object> target = schdDao.selectMovingOutCheckTarget(carNoFilter);
if(target == null){
return;
}
String carNo = target.get("CAR_NO").toString();
boolean isMovingOut = false;
//연계
try {
Map<String, String> carSearchMap = new HashMap<String, String>();
String sysId = cfsCommonService.findCommonSecureGet("sysId");
carSearchMap.put("sysId", sysId);
carSearchMap.put("tranDate", procStrtDttm);
String transId = schdDao.selectCarConnectSeq("");
carSearchMap.put("transId", transId);
carSearchMap.put("levyStdde", levyStdde);
carSearchMap.put("inqireSeCode", "3");
carSearchMap.put("vhrno", carNo);
carSearchMap.put("vin", "");
String url = cfsCommonService.findCommonSecureGet("ITF_CFS_O_001");
CallWebService callWebService = new CallWebService(url);
Map<String, String> carSearchResultMap = callWebService.callWebServicePost(carSearchMap);
if(carSearchResultMap == null
|| carSearchResultMap.get("result") == null
|| carSearchResultMap.get("result").toString().equals("")
|| carSearchResultMap.get("result").toString().equals("FAIL")) {
target.put("PROC_STRT_DTTM", procStrtDttm);
schdDao.updateCarSearchFail(target);
return;
}
JSONParser parser = new JSONParser();
JSONObject jsonData = (JSONObject)parser.parse(carSearchResultMap.get("data").toString());
Map<String, String> carSearchResultData = new HashMap<String,String>();
CarInfoSearch.setData(carSearchResultData, jsonData);
if(StringUtil.nullToNull(carSearchResultData.get("mberSeCode")).equals("")
|| StringUtil.nullToNull(carSearchResultData.get("ownerLegaldongCode")).equals("")){
target.put("PROC_STRT_DTTM", procStrtDttm);
schdDao.updateCarSearchFail(target);
return;
}
if(carSearchResultData.get("mberSeCode").equals("11")
&& carSearchResultData.get("ownerLegaldongCode").startsWith("11140")) {
isMovingOut = false;
} else {
isMovingOut = true;
}
} catch (Exception e) {
target.put("PROC_STRT_DTTM", procStrtDttm);
schdDao.updateCarSearchFail(target);
return;
}
if(isMovingOut){
//전출로 인한 삭제
target.put("PROC_STRT_DTTM", procStrtDttm);
target.put("APPLY_DATE", procStrtDttm);
schdDao.deleteMovingOut(target);
//감면마스터에서 삭제(보류)
//schdDao.deleteGammyeon(target);
} else {
//적용일시 업데이트
target.put("PROC_STRT_DTTM", procStrtDttm);
target.put("APPLY_DATE", procStrtDttm);
schdDao.updateApplyDate(target);
//감면마스터에 등록(보류)
//schdDao.insertGammyeon(target);
}
}
}

@ -9,27 +9,19 @@ import java.util.Map;
import javax.annotation.Resource;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import cfs.WASInfo;
import cfs.common.service.CfsCommonService;
import cfs.common.util.CallWebService;
import cfs.common.util.CarNo2Code;
import cfs.schd.dao.SchdDao;
import cfs.trsmrcv.dao.TrsmrcvDao;
import cfs.trsmrcv.service.CommCollectServerService;
@EnableScheduling
@Component
public class CfsServerCron {
@Component("prpCarInfo")
public class PrpCarInfo {
protected Logger logger = LoggerFactory.getLogger(this.getClass());
@Resource(name="commCollectServerService")
@ -44,29 +36,8 @@ public class CfsServerCron {
@Resource(name="schdDao")
private SchdDao schdDao;
@Scheduled(cron = "12 */4 * * * *")
public void prpChgScheduleRun() {
String runWAS = schdDao.selectRunWas("ITF_CFS_O_037");
if(!WASInfo.getWAS().equals(runWAS)){
return;
}
Map<String, String> susinInfo = new HashMap<String, String>();
susinInfo.put("DATETIME", (new SimpleDateFormat("yyyyMMddHHmmss").format(new Date())));
susinInfo.put("RUN_WAS", WASInfo.getWAS());
susinInfo.put("CALL_URI", "없음(schedule)");
susinInfo.put("REQ_IP", "");
trsmrcvDao.insertConnSusinLog(susinInfo);
prpChgScheduleRun_db();
}
@Transactional
public void prpChgScheduleRun_db() {
public void updatePrpChg() {
try{
long start = System.currentTimeMillis(); // 작동 시간 측정용
@ -209,8 +180,4 @@ public class CfsServerCron {
logger.error("scheduleRun Exception : "+e.getClass().getName());
}
}
}

@ -0,0 +1,153 @@
package cfs.schd.config;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import cfs.WASInfo;
import cfs.schd.LocalResidentsCarInfo;
import cfs.schd.dao.SchdDao;
@Component("cfsDaemon")
public class CfsDaemon {
private List<MovingOutDaemonThread> movingOutDaemons;
@Resource(name="schdDao")
private SchdDao schdDao;
@Resource(name="localResidentsCarInfo")
private LocalResidentsCarInfo localResidentsCarInfo;
List<String> digits = Arrays.asList("0","1","2","3","4","5","6","7","8","9");
@PostConstruct
public void init() {
createThread();
}
public void createThread() {
movingOutDaemons = new ArrayList<MovingOutDaemonThread>();
for(String digit : digits){
MovingOutDaemonThread daemon = new MovingOutDaemonThread(digit);
daemon.setDaemon(true);
movingOutDaemons.add(daemon);
}
}
public String startDaemon(String daemonName) {
String result = "";
if(countDaemon(daemonName) != 0){
killDaemon(daemonName);
return "기존 실행 중인 데몬 종료 요청함";
}
String runWAS = schdDao.selectRunWas(daemonName);
if(!WASInfo.getWAS().equals(runWAS)){
return "미실행WAS";
}
if(daemonName.equals("MOVING_OUT")){
if(movingOutDaemons == null || movingOutDaemons.isEmpty()){
result = "쓰레드없음";
} else {
for(MovingOutDaemonThread demon : movingOutDaemons){
if(Thread.State.NEW == demon.getState()){
demon.start();
} else {
demon.run();
}
}
}
result = "시작됨";
}
return result;
}
public int countDaemon(String daemonName) {
int i = 0;
if(daemonName.equals("MOVING_OUT")){
if(movingOutDaemons == null){
return 0;
}
for(MovingOutDaemonThread daemon : movingOutDaemons){
if(daemon.isAlive()){
i++;
}
}
return i;
}
return 0;
}
public String killDaemon(String daemonName) {
String result = "";
if(daemonName.equals("MOVING_OUT")){
if(movingOutDaemons == null || movingOutDaemons.isEmpty()){
result = "쓰레드없음";
return result;
}
if(countDaemon(daemonName) == 0){
result = "이미 종료됨";
return result;
}
for(MovingOutDaemonThread daemon : movingOutDaemons){
daemon.interrupt();
}
result = "종료 요청 완료";
return result;
}
return result;
}
/**
*
*/
class MovingOutDaemonThread extends Thread {
private String lastDigit = null;
public MovingOutDaemonThread(String lastDigit){
super("MOVING_OUT"+lastDigit);
this.lastDigit = lastDigit;
}
@Override
public void run(){
while(true){
localResidentsCarInfo.checkMovingOut_lastDigit(lastDigit);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
break;
}
}
}
}
}

@ -0,0 +1,83 @@
package cfs.schd.config;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import cfs.WASInfo;
import cfs.schd.PrpCarInfo;
import cfs.schd.dao.SchdDao;
import cfs.trsmrcv.dao.TrsmrcvDao;
@EnableScheduling
@Component
public class CfsScheduleCron {
protected Logger logger = LoggerFactory.getLogger(this.getClass());
@Resource(name="prpCarInfo")
private PrpCarInfo prpCarInfo;
@Resource(name="trsmrcvDao")
private TrsmrcvDao trsmrcvDao;
@Resource(name="schdDao")
private SchdDao schdDao;
@Resource(name="cfsDaemon")
private CfsDaemon cfsDaemon;
/**
*
*/
@Scheduled(cron = "12 */4 * * * *")
public void prpChgScheduleRun() {
String runWAS = schdDao.selectRunWas("ITF_CFS_O_037");
if(!WASInfo.getWAS().equals(runWAS)){
return;
}
Map<String, String> susinInfo = new HashMap<String, String>();
susinInfo.put("DATETIME", (new SimpleDateFormat("yyyyMMddHHmmss").format(new Date())));
susinInfo.put("RUN_WAS", WASInfo.getWAS());
susinInfo.put("CALL_URI", "없음(schedule)");
susinInfo.put("REQ_IP", "");
trsmrcvDao.insertConnSusinLog(susinInfo);
prpCarInfo.updatePrpChg();
}
/**
*
*/
//@Scheduled(cron = "0 0 21 * * *")
public void localResidentsMovingOutScheduleStart() {
String runWAS = schdDao.selectRunWas("MOVING_OUT");
if(!WASInfo.getWAS().equals(runWAS)){
return;
}
cfsDaemon.startDaemon("MOVING_OUT");
}
/**
*
*/
//@Scheduled(cron = "0 0 7 * * *")
public void localResidentsMovingOutScheduleStop() {
cfsDaemon.killDaemon("MOVING_OUT");
}
}

@ -0,0 +1,16 @@
package cfs.schd.config;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Component;
@EnableScheduling
@Component
public class CfsScheduleFixedDelaly {
protected Logger logger = LoggerFactory.getLogger(this.getClass());
}

@ -7,14 +7,25 @@ import org.springframework.stereotype.Repository;
@Repository("schdDao")
public interface SchdDao {
public String selectRunWas(String schdulName);
public void updateRunWas(Map<String,String> map);
public String selectMaxCntcMastrIdFromTfcb(String str);
public String selectMaxCntcMastrId(String str);
public Map<String,Object> selectCarNoFromTfcb(String num);
public int mergeLocalResidents(Map<String,Object> map);
public void updateSampleSeq(String maxCntcMastrId);
public Map<String,Object> selectMovingOutCheckTarget(Map<String,String> map);
public String selectCarConnectSeq(String str);
public void updateCarSearchFail(Map<String,Object> map);
public void updateApplyDate(Map<String,Object> map);
public void deleteMovingOut(Map<String,Object> map);
public void deleteGammyeon(Map<String, Object> target);
public void insertGammyeon(Map<String, Object> target);
}

@ -5,18 +5,21 @@
<select id="selectRunWas" parameterType="java.lang.String" resultType="java.lang.String">
SELECT RUN_WAS
FROM TB_CFS_SCHDUL_RUN_INFO
WHERE SCHDUL_NAME = #{schdulName};
WHERE SCHDUL_NAME = #{schdulName}
</select>
<update id="updateRunWas" parameterType="java.util.Map">
UPDATE TB_CFS_SCHDUL_RUN_INFO
SET RUN_WAS = #{runWas}
WHERE SCHDUL_NAME = #{schdulName}
</update>
<select id="selectMaxCntcMastrIdFromTfcb" parameterType="java.lang.String" resultType="java.lang.String">
SELECT MAX(CNTC_MASTR_ID)
FROM DBUSER_FIS.TB_FIS_CAR_BASSMATTER
</select>
<select id="selectMaxCntcMastrId" parameterType="java.lang.String" resultType="java.lang.String">
SELECT MAX_CNTC_MASTR_ID
FROM TB_CFS_LOCAL_RESIDENTS_CAR_SAMPLE
</select>
<select id="selectCarNoFromTfcb" parameterType="java.lang.String" resultType="java.util.Map">
SELECT (CASE
@ -28,7 +31,7 @@ SELECT (CASE
, TO_CHAR(CREAT_DT,'YYYYMMDD') AS CREAT_DT
, CNTC_MASTR_ID
FROM DBUSER_FIS.TB_FIS_CAR_BASSMATTER
WHERE CNTC_MASTR_ID = LPAD(#{num},'0',12)
WHERE CNTC_MASTR_ID = LPAD(#{num},12,'0')
</select>
<insert id="mergeLocalResidents" parameterType="java.util.Map">
@ -43,6 +46,7 @@ UPDATE SET
, PROC_STRT_DTTM = SYSDATE
, UPDATER = 'admin'
, UPDATE_DATE = SYSDATE
, DEL_YN = 'N'
WHERE CAR_NO = #{carNo} AND TO_CHAR(APPLY_DATE,'YYYYMMDD') <![CDATA[ < ]]> #{levyStdde}
WHEN NOT MATCHED THEN
INSERT (
@ -50,17 +54,131 @@ WHEN NOT MATCHED THEN
, APPLY_DATE
, PROC_CMPT_YN
, PROC_STRT_DTTM
, CREATER, CREATE_DATE, UPDATER, UPDATE_DATE
, CREATER, CREATE_DATE, UPDATER, UPDATE_DATE, DEL_YN
) VALUES (
#{carNo}
, #{levyStdde}
, 'Y'
, SYSDATE
, 'admin', SYSDATE, 'admin', SYSDATE
, 'admin', SYSDATE, 'admin', SYSDATE, 'N'
)
</insert>
<update id="updateSampleSeq" parameterType="java.lang.String">
UPDATE TB_CFS_LOCAL_RESIDENTS_CAR_SAMPLE SET MAX_CNTC_MASTR_ID = #{maxCntcMastrId}
<select id="selectMovingOutCheckTarget" parameterType="java.util.Map" resultType="java.util.Map">
SELECT CAR_NO
, APPLY_DATE
, PROC_CMPT_YN
, PROC_STRT_DTTM
, ORDER_DATE
, PRIORITY_NUM
FROM
(
SELECT CAR_NO
, APPLY_DATE
, PROC_CMPT_YN
, PROC_STRT_DTTM
, ORDER_DATE
, ROW_NUMBER() OVER(ORDER BY PROC_CMPT_YN DESC, ORDER_DATE) AS PRIORITY_NUM
FROM
(
SELECT CAR_NO
, APPLY_DATE
, PROC_CMPT_YN
, PROC_STRT_DTTM
, (CASE
WHEN PROC_CMPT_YN = 'Y'
THEN APPLY_DATE
ELSE PROC_STRT_DTTM
END) AS ORDER_DATE
FROM TB_CFS_LOCAL_RESIDENTS_CAR_MST
WHERE DEL_YN = 'N'
AND TO_CHAR(APPLY_DATE,'YYYYMMDD') <![CDATA[ < ]]> TO_CHAR(SYSDATE-7,'YYYYMMDD')
<if test='digit != null and digit != ""'>
AND CAR_NO LIKE '%'||#{digit}
</if>
)
ORDER BY PROC_CMPT_YN DESC, ORDER_DATE
)
WHERE PRIORITY_NUM=1
</select>
<select id="selectCarConnectSeq" parameterType="java.lang.String" resultType="java.lang.String">
SELECT SEQ_CNS_REQ.NEXTVAL FROM DUAL
</select>
<update id="updateCarSearchFail" parameterType="java.util.Map">
UPDATE TB_CFS_LOCAL_RESIDENTS_CAR_MST
SET PROC_CMPT_YN = 'N'
, PROC_STRT_DTTM = TO_DATE(#{PROC_STRT_DTTM},'YYYYMMDDHH24MISS')
, UPDATER = 'admin'
, UPDATE_DATE = SYSDATE
WHERE CAR_NO = #{CAR_NO}
</update>
<update id="updateApplyDate" parameterType="java.util.Map">
UPDATE TB_CFS_LOCAL_RESIDENTS_CAR_MST
SET PROC_CMPT_YN = 'Y'
, PROC_STRT_DTTM = TO_DATE(#{PROC_STRT_DTTM},'YYYYMMDDHH24MISS')
, APPLY_DATE = TO_DATE(#{APPLY_DATE},'YYYYMMDDHH24MISS')
, UPDATER = 'admin'
, UPDATE_DATE = SYSDATE
, DEL_YN = 'N'
WHERE CAR_NO = #{CAR_NO}
</update>
<update id="deleteMovingOut" parameterType="java.util.Map">
UPDATE TB_CFS_LOCAL_RESIDENTS_CAR_MST
SET PROC_CMPT_YN = 'Y'
, PROC_STRT_DTTM = TO_DATE(#{PROC_STRT_DTTM},'YYYYMMDDHH24MISS')
, APPLY_DATE = TO_DATE(#{APPLY_DATE},'YYYYMMDDHH24MISS')
, UPDATER = 'admin'
, UPDATE_DATE = SYSDATE
, DEL_YN = 'Y'
WHERE CAR_NO = #{CAR_NO}
</update>
<delete id="deleteGammyeon" parameterType="java.util.Map">
DELETE
FROM TB_CFS_SCAR_PL_MST_TEMP
WHERE CAR_NO = #{CAR_NO}
AND REDU_CD = '02'
</delete>
<insert id="insertGammyeon" parameterType="java.util.Map">
MERGE INTO TB_CFS_SCAR_PL_MST_TEMP
USING DUAL ON (
CAR_NO = #{CAR_NO}
)
WHEN NOT MATCHED THEN
INSERT (
SCAR_SEQ
, CAR_NO
, CAR_NO_HEX
, REDU_CD
, REQ_DATE
, MODI_YN
, CREATER
, CREATE_DATE
, UPDATER
, UPDATE_DATE
, END_DATE
, REMARKS
) VALUES (
SEQ_SCAR_TEMP.NEXTVAL
, REPLACE(TRIM(#{CAR_NO}),' ','')
, FUN_CAR_CODE(REPLACE(TRIM(#{CAR_NO}),' ',''))
, '02'
, SYSDATE
, 'N'
, 'admin'
, SYSDATE
, 'admin'
, SYSDATE
, ''
, ''
)
</insert>
</mapper>

@ -1,15 +1,11 @@
package cfs.trsmrcv.web;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
@ -17,10 +13,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import cfs.WASInfo;
import cfs.common.util.ResultSmartPlatform;
import cfs.schd.config.CfsDaemon;
import cfs.schd.dao.SchdDao;
import cfs.trsmrcv.dao.TrsmrcvDao;
import websquare.util.StringUtil;
@Controller
public class TrsmrcvController {
@ -33,6 +30,8 @@ public class TrsmrcvController {
@Resource(name = "schdDao")
private SchdDao schdDao;
@Resource(name="cfsDaemon")
private CfsDaemon cfsDaemon;
@RequestMapping(value="/cfs/trsmrcv/sleep.do", method=RequestMethod.GET)
public @ResponseBody Map<String, Object> sleep(HttpServletRequest request) throws Exception {
@ -59,55 +58,78 @@ public class TrsmrcvController {
return result;
}
/**
*
* <pre></pre>
*/
@RequestMapping(value="/cfs/trsmrcv/initLocalResidents.do", method=RequestMethod.GET)
public @ResponseBody Map<String, Object> initLocalResidents(HttpServletRequest request) throws Exception {
SimpleDateFormat sdf8 = (new SimpleDateFormat("yyyyMMdd"));
Date now = new Date();
String curYmd = sdf8.format(now);
String maxCntcMastrId_current = schdDao.selectMaxCntcMastrIdFromTfcb("");
String maxCntcMastrId_lastWork = schdDao.selectMaxCntcMastrId("");
long max = Long.parseLong(maxCntcMastrId_current);
long min = Long.parseLong(maxCntcMastrId_lastWork);
for(long i = max; i >= min; i--){
Map<String, Object> map = new HashMap<String, Object>();
Map<String,Object> carInfo = schdDao.selectCarNoFromTfcb(Long.toString(i));
if(carInfo == null || carInfo.isEmpty()){
continue;
}
String creatDt = carInfo.get("CREAT_DT").toString();
try {
long diff = sdf8.parse(curYmd).getTime() - sdf8.parse(creatDt).getTime();
long diffDays = diff / 86400000L;
if(diffDays > 30 && maxCntcMastrId_lastWork.equals("000000000001")){
break;
}
} catch (ParseException e) {
e.printStackTrace();
}
if(carInfo.get("CAR_NO") == null || carInfo.get("CAR_NO").toString().equals("")){
continue;
}
map.put("carNo", carInfo.get("CAR_NO").toString());
map.put("levyStdde", carInfo.get("LEVY_STDDE").toString());
schdDao.mergeLocalResidents(map);
@RequestMapping(value="/cfs/trsmrcv/updateRunWas.do", method=RequestMethod.GET)
public @ResponseBody Map<String, Object> updateRunWas(HttpServletRequest request) throws Exception {
String schdulName = request.getParameter("schdulName");
Map<String,String> map = new HashMap<String,String>();
map.put("runWas", WASInfo.getWAS());
map.put("schdulName", schdulName);
schdDao.updateRunWas(map);
Map result = new HashMap();
result.put("res", "ok");
return result;
}
@RequestMapping(value="/cfs/daemon/kill.do", method=RequestMethod.GET)
public @ResponseBody Map<String, Object> kill(HttpServletRequest request) throws Exception {
Map result = new HashMap();
result.put("WAS", WASInfo.getWAS());
String daemonName = request.getParameter("daemonName");
if(daemonName == null || daemonName.equals("")){
result.put("res", "fail");
return result;
}
String resultStr = cfsDaemon.killDaemon(daemonName);
result.put("res", resultStr);
return result;
}
@RequestMapping(value="/cfs/daemon/count.do", method=RequestMethod.GET)
public @ResponseBody Map<String, Object> count(HttpServletRequest request) throws Exception {
Map result = new HashMap();
result.put("WAS", WASInfo.getWAS());
String daemonName = request.getParameter("daemonName");
if(daemonName == null || daemonName.equals("")){
result.put("res", "fail");
return result;
}
schdDao.updateSampleSeq(maxCntcMastrId_current);
Map<String, Object> result = new HashMap<String, Object>();
result.put("result", "ok");
int res = 0;
res = cfsDaemon.countDaemon(daemonName);
result.put("res", res);
return result;
}
@RequestMapping(value="/cfs/daemon/start.do", method=RequestMethod.GET)
public @ResponseBody Map<String, Object> start(HttpServletRequest request) throws Exception {
Map result = new HashMap();
result.put("WAS", WASInfo.getWAS());
String daemonName = request.getParameter("daemonName");
if(daemonName == null || daemonName.equals("")){
result.put("res", "fail");
return result;
}
String runWAS = schdDao.selectRunWas(daemonName);
if(!WASInfo.getWAS().equals(runWAS)){
result.put("res", "fail");
return result;
}
String resultStr = cfsDaemon.startDaemon(daemonName);
result.put("res", resultStr);
return result;
}
}

Loading…
Cancel
Save