|
|
|
|
@ -1,11 +1,15 @@
|
|
|
|
|
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;
|
|
|
|
|
@ -14,7 +18,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
|
|
import cfs.common.util.ResultSmartPlatform;
|
|
|
|
|
import cfs.schd.dao.SchdDao;
|
|
|
|
|
import cfs.trsmrcv.dao.TrsmrcvDao;
|
|
|
|
|
import websquare.util.StringUtil;
|
|
|
|
|
|
|
|
|
|
@Controller
|
|
|
|
|
public class TrsmrcvController {
|
|
|
|
|
@ -24,6 +30,9 @@ public class TrsmrcvController {
|
|
|
|
|
@Resource(name = "trsmrcvDao")
|
|
|
|
|
private TrsmrcvDao trsmrcvDao;
|
|
|
|
|
|
|
|
|
|
@Resource(name = "schdDao")
|
|
|
|
|
private SchdDao schdDao;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequestMapping(value="/cfs/trsmrcv/sleep.do", method=RequestMethod.GET)
|
|
|
|
|
public @ResponseBody Map<String, Object> sleep(HttpServletRequest request) throws Exception {
|
|
|
|
|
@ -47,7 +56,57 @@ public class TrsmrcvController {
|
|
|
|
|
|
|
|
|
|
Map result = new HashMap();
|
|
|
|
|
result.put("res", "ok");
|
|
|
|
|
return result;
|
|
|
|
|
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 > 7 && 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);
|
|
|
|
|
}
|
|
|
|
|
schdDao.updateSampleSeq(maxCntcMastrId_current);
|
|
|
|
|
|
|
|
|
|
Map<String, Object> result = new HashMap<String, Object>();
|
|
|
|
|
result.put("result", "ok");
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|