|
@ -3,14 +3,18 @@ package com.yihu.ehr.datacollect.dao;
|
|
|
import com.yihu.ehr.datacollect.dao.intf.IDatacollectDao;
|
|
|
import com.yihu.ehr.datacollect.dao.intf.IDatacollectLogDao;
|
|
|
import com.yihu.ehr.datacollect.model.DtoJobDataset;
|
|
|
import com.yihu.ehr.datacollect.model.RsDatapushLog;
|
|
|
import com.yihu.ehr.datacollect.model.RsJobDataset;
|
|
|
import com.yihu.ehr.framework.common.dao.SQLGeneralDAO;
|
|
|
import com.yihu.ehr.framework.constrant.DateConvert;
|
|
|
import com.yihu.ehr.framework.model.ActionResult;
|
|
|
import com.yihu.ehr.framework.model.DataGridResult;
|
|
|
import com.yihu.ehr.resource.model.RsDatasourceDataset;
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
import org.springframework.util.StringUtils;
|
|
|
|
|
|
import java.util.Date;
|
|
|
import java.util.GregorianCalendar;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
@ -38,11 +42,45 @@ public class DatacollectLogDao extends SQLGeneralDAO implements IDatacollectLogD
|
|
|
/**
|
|
|
* 推数据新增日志
|
|
|
*/
|
|
|
public void addDataPushLog() throws Exception
|
|
|
public void addDataPushLog(String type,String success,String content) throws Exception
|
|
|
{
|
|
|
String sql = "";
|
|
|
//super.execute(sql);
|
|
|
RsDatapushLog log = new RsDatapushLog();
|
|
|
log.setType(type);
|
|
|
log.setSuccess(success);
|
|
|
log.setContent(content);
|
|
|
log.setDatetime(new Date());
|
|
|
this.saveEntity(log);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取日志列表
|
|
|
*/
|
|
|
public DataGridResult queryDataPushLog(Map<String, Object> conditionMap, Integer page, Integer pageSize) throws Exception
|
|
|
{
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
sb.append("from RsDatapushLog where 1=1 ");
|
|
|
if (!StringUtils.isEmpty(conditionMap.get("type"))) {
|
|
|
sb.append(" and type ='"+conditionMap.get("type")+"'");
|
|
|
}
|
|
|
|
|
|
if (!StringUtils.isEmpty(conditionMap.get("datetimeFrom"))) {
|
|
|
Date time = DateConvert.toDate(conditionMap.get("datetimeFrom").toString());
|
|
|
time.setHours(0);
|
|
|
time.setMinutes(0);
|
|
|
time.setSeconds(0);
|
|
|
sb.append(" and datetime >= '"+DateConvert.toString(time)+"'");
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(conditionMap.get("datetimeTo"))) {
|
|
|
Date time = DateConvert.toDate(conditionMap.get("datetimeTo").toString());
|
|
|
time.setHours(0);
|
|
|
time.setMinutes(0);
|
|
|
time.setSeconds(0);
|
|
|
GregorianCalendar gc=new GregorianCalendar();
|
|
|
gc.setTime(time);
|
|
|
gc.add(5, 1);
|
|
|
sb.append(" and datetime < '"+DateConvert.toString(gc.getTime())+"'");
|
|
|
}
|
|
|
sb.append("order by datetime desc");
|
|
|
return getDataGridResult(sb.toString(),page,pageSize);
|
|
|
}
|
|
|
}
|