use of com.itrus.portal.entity.Records 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();
}
use of com.itrus.portal.entity.Records 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;
}
use of com.itrus.portal.entity.Records in project portal by ixinportal.
the class UserFromClientLoginController method toClientHomePage.
/**
* 服务型客户端首页
* type,类型.web.app,客户端,目前是客户端,跟发布平台的值相同:{1:"web", 2:"客户端", 3:"app"}
* @param keySn
* @param certSn
* @param enterpriseName
* @param request
* @param uiModel
* @return
*/
@RequestMapping("/toClientHomePage")
public String toClientHomePage(@RequestParam(value = "type", required = true) String type, @RequestParam(value = "keySn", required = false) String keySn, @RequestParam(value = "certSn", required = false) String certSn, @RequestParam(value = "enterpriseName", required = false) String enterpriseName, HttpServletRequest request, Model uiModel) {
HttpSession session = request.getSession();
try {
UserInfo userInfo = (UserInfo) session.getAttribute(ComNames.WEB_USER_INFO);
if (null == userInfo) {
return ComNames.DENG_LU_CLIENT;
}
Enterprise enterprise = (Enterprise) session.getAttribute(ComNames.WEB_ENTERPRISE);
if (null == enterprise && StringUtils.isNotBlank(enterpriseName)) {
enterprise = enterpriseService.getEntByName(enterpriseName);
}
UserCert userCert = (UserCert) session.getAttribute("userCert");
if (null == userCert && StringUtils.isNotBlank(certSn)) {
userCert = userCertService.getUserCertByCertSn(certSn);
}
uiModel.addAttribute("userCert", userCert);
Project project = null;
if (StringUtils.isNotBlank(keySn)) {
ProjectKeyInfo projectKeyInfo = cacheCustomer.findProjectByKey(keySn);
project = projectService.selectByPrimaryKey(projectKeyInfo.getProject());
} else {
project = projectService.selectByPrimaryKey(userInfo.getProject());
}
if (project.getId() != null) {
List<AppBean> appBeanList = appService.getAppList(project.getId(), type);
uiModel.addAttribute("appBeanList", appBeanList);
}
// TODO 返回足迹信息
if (enterprise.getId() != null) {
Records record = signatureRecordService.getRecord(enterprise.getId());
uiModel.addAttribute("record", record);
}
} catch (Exception e) {
uiModel.addAttribute("errorMsg", "出现异常,异常信息:" + e.getMessage());
return ComNames.CLIENTFW_ERRORPAGE;
}
// 跳转客户端首页
return "clientFW/index";
}
Aggregations