Search in sources :

Example 1 with RecordData

use of com.itrus.portal.entity.RecordData in project portal by ixinportal.

the class RecordController method dealSignature.

public void dealSignature(Map<String, Object> param, Records records, List<RecordData> recordDataList, List<RecordData> srecordDataList) {
    List<Record> signatureList = new ArrayList<>();
    List<Record> s_signatureList = new ArrayList<>();
    List<Map<String, Object>> signaturemonthList = sqlSession.selectList("com.itrus.portal.db.SignatureRecordMapper.selectOneMonth", param);
    Map<String, String> signaturemap = dealMonthList(signaturemonthList);
    convertList(signatureList, signaturemap);
    List<Map<String, Object>> sixMonthList = sqlSession.selectList("com.itrus.portal.db.SignatureRecordMapper.selectSixMonth", param);
    Map<String, String> ssignaturemap = dealSixList(sixMonthList);
    convertList(s_signatureList, ssignaturemap);
    RecordData recordData = new RecordData();
    RecordData srecordData = new RecordData();
    SignatureRecord record = getsignatureBean(sixMonthList);
    recordData.setType("2");
    recordData.setValue(("null").equals(String.valueOf(record.getOneCount())) ? "0" : String.valueOf(record.getOneCount()));
    recordData.setTime(record.getDateTime());
    recordData.setName("电子签名");
    recordDataList.add(recordData);
    srecordData.setType("2");
    srecordData.setValue(("null").equals(String.valueOf(record.getOneCount())) ? "0" : String.valueOf(record.getSixCount()));
    // srecordData.setTime(record.getDateTime());
    srecordData.setName("电子签名");
    srecordDataList.add(srecordData);
    records.setSignatureList(signatureList);
    records.setSsignatureList(s_signatureList);
}
Also used : RecordData(com.itrus.portal.entity.RecordData) ConditionRecord(com.itrus.portal.db.ConditionRecord) Record(com.itrus.portal.entity.Record) SignatureRecord(com.itrus.portal.db.SignatureRecord) SignatureRecord(com.itrus.portal.db.SignatureRecord)

Example 2 with RecordData

use of com.itrus.portal.entity.RecordData in project portal by ixinportal.

the class RecordController method month.

@RequestMapping("/month")
@ResponseBody
public String month(String enterpriseName, String keySn) {
    Map<String, Object> param = new HashMap<>();
    Calendar calendar = Calendar.getInstance();
    // 今天日期
    Date queryDate2 = calendar.getTime();
    // 当月第一天 的0时0分0秒
    calendar.add(Calendar.MONTH, 0);
    calendar.set(Calendar.DAY_OF_MONTH, 1);
    calendar.set(Calendar.HOUR_OF_DAY, 0);
    calendar.set(Calendar.MINUTE, 0);
    calendar.set(Calendar.SECOND, 0);
    calendar.set(Calendar.MILLISECOND, 0);
    Date queryDate1 = calendar.getTime();
    Calendar cal = Calendar.getInstance();
    cal.add(Calendar.MONTH, -6);
    // 前6个月
    Date queryDate = cal.getTime();
    param.put("queryDate1", queryDate1);
    param.put("queryDate2", queryDate2);
    param.put("queryDate", queryDate);
    param.put("enterpriseName", enterpriseName);
    param.put("keySn", keySn);
    Records records = new Records();
    List<RecordData> recordData = new ArrayList<>();
    List<RecordData> srecordData = new ArrayList<>();
    // 处理安全在线数据
    dealOnLine(param, records, recordData, srecordData);
    // 处理签名记录数据
    dealSignature(param, records, recordData, srecordData);
    // 处理环境检测数据
    dealCondition(param, records, recordData, srecordData);
    records.setRecordData(recordData);
    records.setSrecordData(srecordData);
    return JSON.toJSON(records).toString();
}
Also used : RecordData(com.itrus.portal.entity.RecordData) Records(com.itrus.portal.entity.Records) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 3 with RecordData

use of com.itrus.portal.entity.RecordData in project portal by ixinportal.

the class SignatureRecordService method dealSignature.

public void dealSignature(Map<String, Object> param, Records records, List<RecordData> recordDataList, List<RecordData> srecordDataList) {
    List<Record> signatureList = new ArrayList<>();
    List<Record> s_signatureList = new ArrayList<>();
    List<Map<String, Object>> signaturemonthList = sqlSession.selectList("com.itrus.portal.db.SignatureRecordMapper.selectOneMonth", param);
    Map<String, String> signaturemap = dealMonthList(signaturemonthList);
    convertList(signatureList, signaturemap);
    List<Map<String, Object>> sixMonthList = sqlSession.selectList("com.itrus.portal.db.SignatureRecordMapper.selectSixMonth", param);
    Map<String, String> ssignaturemap = dealSixList(sixMonthList);
    convertList(s_signatureList, ssignaturemap);
    RecordData recordData = new RecordData();
    RecordData srecordData = new RecordData();
    SignatureRecord record = getsignatureBean(sixMonthList);
    recordData.setType("2");
    recordData.setValue(String.valueOf(record.getOneCount()));
    recordData.setTime(record.getDateTime());
    recordData.setName("电子签名");
    recordDataList.add(recordData);
    srecordData.setType("2");
    srecordData.setValue(String.valueOf(record.getSixCount()));
    srecordData.setTime(record.getDateTime());
    srecordData.setName("电子签名");
    srecordDataList.add(srecordData);
    records.setSignatureList(signatureList);
    records.setSsignatureList(s_signatureList);
}
Also used : RecordData(com.itrus.portal.entity.RecordData) ConditionRecord(com.itrus.portal.db.ConditionRecord) Record(com.itrus.portal.entity.Record) SignatureRecord(com.itrus.portal.db.SignatureRecord) SignatureRecord(com.itrus.portal.db.SignatureRecord)

Example 4 with RecordData

use of com.itrus.portal.entity.RecordData in project portal by ixinportal.

the class SignatureRecordService method getRecord.

/**
 * 传入企业名称获取相对应的安全在线、签名记录、环境检测信息
 * @param enterpriseName
 * @return
 */
public Records getRecord(Long enterpriseName) {
    Map<String, Object> param = new HashMap<>();
    Calendar calendar = Calendar.getInstance();
    // 今天日期
    Date queryDate2 = calendar.getTime();
    // 当月第一天
    calendar.add(Calendar.MONTH, 0);
    calendar.set(Calendar.DAY_OF_MONTH, 1);
    Date queryDate1 = calendar.getTime();
    Calendar cal = Calendar.getInstance();
    cal.add(Calendar.MONTH, -6);
    // 前6个月
    Date queryDate = cal.getTime();
    param.put("queryDate1", queryDate1);
    param.put("queryDate2", queryDate2);
    param.put("queryDate", queryDate);
    param.put("enterpriseName", enterpriseName);
    Records records = new Records();
    List<RecordData> recordData = new ArrayList<>();
    List<RecordData> srecordData = new ArrayList<>();
    dealOnLine(param, records, recordData, srecordData);
    dealSignature(param, records, recordData, srecordData);
    dealCondition(param, records, recordData, srecordData);
    records.setRecordData(recordData);
    records.setSrecordData(srecordData);
    return records;
}
Also used : RecordData(com.itrus.portal.entity.RecordData) Records(com.itrus.portal.entity.Records)

Example 5 with RecordData

use of com.itrus.portal.entity.RecordData in project portal by ixinportal.

the class SignatureRecordService method dealOnLine.

public void dealOnLine(Map<String, Object> param, Records records, List<RecordData> recordDataList, List<RecordData> srecordDataList) {
    List<Record> onlineList = new ArrayList<>();
    List<Record> s_onlineList = new ArrayList<>();
    List<Map<String, Object>> onlinemonthlist = sqlSession.selectList("com.itrus.portal.db.SignatureRecordMapper.selectOneMonth", param);
    Map<String, String> onlinemap = dealMonthList(onlinemonthlist);
    convertList(onlineList, onlinemap);
    List<Map<String, Object>> sixMonthList = sqlSession.selectList("com.itrus.portal.db.SignatureRecordMapper.selectSixMonth", param);
    Map<String, String> sonlinemap = dealSixList(sixMonthList);
    convertList(s_onlineList, sonlinemap);
    RecordData recordData = new RecordData();
    RecordData srecordData = new RecordData();
    SignatureRecord record = getsignatureBean(sixMonthList);
    recordData.setType("1");
    recordData.setValue(String.valueOf(record.getOneCount()));
    recordData.setTime(record.getDateTime());
    recordData.setName("安全在线");
    recordDataList.add(recordData);
    srecordData.setType("1");
    srecordData.setValue(String.valueOf(record.getSixCount()));
    srecordData.setTime(record.getDateTime());
    srecordData.setName("安全在线");
    srecordDataList.add(srecordData);
    records.setOnlineList(onlineList);
    records.setSonlineList(s_onlineList);
}
Also used : RecordData(com.itrus.portal.entity.RecordData) ConditionRecord(com.itrus.portal.db.ConditionRecord) Record(com.itrus.portal.entity.Record) SignatureRecord(com.itrus.portal.db.SignatureRecord) SignatureRecord(com.itrus.portal.db.SignatureRecord)

Aggregations

RecordData (com.itrus.portal.entity.RecordData)8 ConditionRecord (com.itrus.portal.db.ConditionRecord)6 SignatureRecord (com.itrus.portal.db.SignatureRecord)6 Record (com.itrus.portal.entity.Record)6 Records (com.itrus.portal.entity.Records)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1