Search in sources :

Example 1 with SignatureRecord

use of com.itrus.portal.db.SignatureRecord in project portal by ixinportal.

the class RecordController method getOnlineBean.

public SignatureRecord getOnlineBean(List<Map<String, Object>> sixMonthList) {
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Calendar cal = Calendar.getInstance();
    SignatureRecord record = new SignatureRecord();
    int i = 0;
    // 现在的年份
    String now_year = String.valueOf(cal.get(Calendar.YEAR));
    // 现在的月份
    String now_month = String.valueOf((cal.get(Calendar.MONTH)) + 1);
    Long oneCount = 0L;
    Long a = null;
    Long b = null;
    Long sixCount = 0L;
    for (Map<String, Object> map : sixMonthList) {
        String record_time = ((String) map.get("datas"));
        String record_year = record_time.substring(0, 4);
        String record_month = record_time.substring(5, 7);
        i++;
        a = (Long) map.get("sums");
        sixCount += a.longValue();
        if (record_year.equals(now_year) && record_month.equals(now_month)) {
            b = (Long) map.get("sums");
            oneCount = b.longValue();
        }
        if (sixMonthList.size() == i) {
            record.setDateTime(formatter.format((Date) map.get("on_line_time")));
        }
        record.setOneCount(oneCount);
        record.setSixCount(sixCount);
    }
    return record;
}
Also used : SimpleDateFormat(java.text.SimpleDateFormat) SignatureRecord(com.itrus.portal.db.SignatureRecord)

Example 2 with SignatureRecord

use of com.itrus.portal.db.SignatureRecord 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 3 with SignatureRecord

use of com.itrus.portal.db.SignatureRecord 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 SignatureRecord

use of com.itrus.portal.db.SignatureRecord in project portal by ixinportal.

the class SignatureRecordService method getsignatureBean.

public SignatureRecord getsignatureBean(List<Map<String, Object>> sixMonthList) {
    SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    Calendar cal = Calendar.getInstance();
    SignatureRecord record = new SignatureRecord();
    int i = 0;
    // 现在的年份
    String now_year = String.valueOf(cal.get(Calendar.YEAR));
    // 现在的月份
    String now_month = String.valueOf((cal.get(Calendar.MONTH)) + 1);
    Long oneCount = 0L;
    BigDecimal a = null;
    BigDecimal b = null;
    Long sixCount = 0L;
    for (Map<String, Object> map : sixMonthList) {
        String record_time = ((String) map.get("date_time"));
        String record_year = record_time.substring(0, 4);
        String record_month = record_time.substring(5, 7);
        i++;
        a = (BigDecimal) map.get("sums");
        sixCount += a.longValue();
        if (record_year.equals(now_year) && record_month.equals(now_month)) {
            b = (BigDecimal) map.get("sums");
            oneCount = b.longValue();
        }
        if (sixMonthList.size() == i) {
            record.setEnterpriseName((String) map.get("enterprise_name"));
            record.setUserId((Long) map.get("user_id"));
            record.setDateTime(formatter.format((Date) map.get("sign_time")));
        }
        record.setOneCount(oneCount);
        record.setSixCount(sixCount);
    }
    return record;
}
Also used : SimpleDateFormat(java.text.SimpleDateFormat) SignatureRecord(com.itrus.portal.db.SignatureRecord) BigDecimal(java.math.BigDecimal)

Example 5 with SignatureRecord

use of com.itrus.portal.db.SignatureRecord 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

SignatureRecord (com.itrus.portal.db.SignatureRecord)9 ConditionRecord (com.itrus.portal.db.ConditionRecord)5 Record (com.itrus.portal.entity.Record)4 RecordData (com.itrus.portal.entity.RecordData)4 SimpleDateFormat (java.text.SimpleDateFormat)3 BigDecimal (java.math.BigDecimal)2 ActivityMsgTemp (com.itrus.portal.db.ActivityMsgTemp)1 ChargingFlow (com.itrus.portal.db.ChargingFlow)1 SignatureRecordExample (com.itrus.portal.db.SignatureRecordExample)1 HashMap (java.util.HashMap)1