Search in sources :

Example 1 with MobileCertificateExample

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

the class MobileCertificateController method debLock.

// 解锁证书
@RequestMapping(value = "/deblocking/{id}", produces = "text/html")
@ResponseBody
public String debLock(@PathVariable("id") Long id, @PathVariable("id") Long eid, RedirectAttributes model, Model uiModel) {
    MobileCertificateExample certificateExample = new MobileCertificateExample();
    MobileCertificateExample.Criteria criteria = certificateExample.createCriteria();
    // if(id!=null){
    criteria.andIdEqualTo(id);
    // }
    MobileCertificate certificate = mobileCertificateService.selectByExample(certificateExample);
    if (certificate != null) {
        // certificate.setId(id);
        certificate.setLockStatus(0);
        certificate.setDeblockingTime(new Date());
        mobileCertificateService.updateCertificate(certificate);
        // model.addFlashAttribute("info","解锁成功");
        return null;
    }
    return null;
}
Also used : MobileCertificate(com.itrus.portal.db.MobileCertificate) MobileCertificateExample(com.itrus.portal.db.MobileCertificateExample) Date(java.util.Date) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 2 with MobileCertificateExample

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

the class MobileCertificateController method list.

@RequestMapping(produces = "text/html")
public String list(// ("info") String info,
@ModelAttribute("info") String info, // @RequestParam(value = "message", required = false) Integer message,
@RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, @RequestParam(value = "appName", required = false) String appName, @RequestParam(value = "userId", required = false) String userId, @RequestParam(value = "sequenceNumber", required = false) String sequenceNumber, @RequestParam(value = "certificateCn", required = false) String certificateCn, @RequestParam(value = "passType", required = false) String passType, @RequestParam(value = "lockStatus", required = false) Integer lockStatus, @RequestParam(value = "certificateStatus", required = false) Integer certificateStatus, @RequestParam(value = "queryDate11", required = false) Date queryDate11, @RequestParam(value = "queryDate12", required = false) Date queryDate12, @RequestParam(value = "queryDate21", required = false) Date queryDate21, @RequestParam(value = "queryDate22", required = false) Date queryDate22, // HttpServletRequest httpServletRequest,
Model uiModel) {
    if (queryDate11 == null && queryDate12 == null) {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, 1);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.add(Calendar.MILLISECOND, -1);
        queryDate12 = calendar.getTime();
        calendar.add(Calendar.MILLISECOND, 1);
        calendar.add(Calendar.MONTH, -1);
        queryDate11 = calendar.getTime();
    }
    /*if(queryDate21==null&&queryDate22==null){
			Calendar calendar = Calendar.getInstance();
			calendar.add(Calendar.DATE, 1);
			calendar.set(Calendar.HOUR_OF_DAY, 0);
			calendar.set(Calendar.MINUTE, 0);
			calendar.set(Calendar.SECOND, 0);
			calendar.set(Calendar.MILLISECOND, 0);
			calendar.add(Calendar.MILLISECOND, -1);
			queryDate22 = calendar.getTime();
			calendar.add(Calendar.MILLISECOND, 1);
			calendar.add(Calendar.MONTH, -1);
			queryDate21 = calendar.getTime();   
		}*/
    // 返回搜索条件
    // uiModel.addAttribute("eid1",eid1);
    // uiModel.addAttribute("eid",                    eid);
    uiModel.addAttribute("appName", appName);
    uiModel.addAttribute("userId", userId);
    uiModel.addAttribute("passType", passType);
    uiModel.addAttribute("lockStatus", lockStatus);
    uiModel.addAttribute("queryDate12", queryDate12);
    uiModel.addAttribute("queryDate11", queryDate11);
    uiModel.addAttribute("queryDate22", queryDate22);
    uiModel.addAttribute("queryDate21", queryDate21);
    uiModel.addAttribute("sequenceNumber", sequenceNumber);
    uiModel.addAttribute("certificateCn", certificateCn);
    uiModel.addAttribute("certificateStatus", certificateStatus);
    Map<String, Object> param = new HashMap<String, Object>();
    // page,size
    if (page == null || page < 1)
        page = 1;
    if (size == null || size < 1)
        size = 10;
    if (StringUtils.isNotEmpty(userId)) {
        param.put("userId", "%" + userId + "%");
    }
    if (StringUtils.isNotEmpty(appName)) {
        param.put("appName", "%" + appName + "%");
    }
    if (StringUtils.isNotEmpty(sequenceNumber)) {
        param.put("sequenceNumber", "%" + sequenceNumber + "%");
    }
    if (StringUtils.isNotEmpty(certificateCn)) {
        param.put("certificateCn", "%" + certificateCn + "%");
    }
    if (StringUtils.isNotEmpty(passType)) {
        param.put("passType", passType);
    }
    if (lockStatus != null) {
        param.put("lockStatus", lockStatus);
    }
    if (certificateStatus != null) {
        param.put("certificateStatus", certificateStatus);
    }
    if (queryDate11 != null) {
        param.put("queryDate11", queryDate11);
    }
    if (queryDate12 != null) {
        param.put("queryDate12", queryDate12);
    }
    if (queryDate21 != null) {
        param.put("queryDate21", queryDate21);
    }
    if (queryDate22 != null) {
        param.put("queryDate22", queryDate22);
    }
    Map param1 = new HashMap();
    MobileCertificate mobileCertificate = new MobileCertificate();
    mobileCertificate.setCertificateStatus(1);
    param1.put("record", mobileCertificate);
    param1.put("_parameter", 1);
    MobileCertificateExample example = new MobileCertificateExample();
    MobileCertificateExample.Criteria criteria = example.createCriteria();
    criteria.andLoseefficacyTimeLessThan(new Date());
    param1.put("example", example);
    mobileCertificateService.update(param1);
    // sqlSession.update("com.itrus.portal.db.MobileCertificateMapper.updateByExampleSelective", param1);
    Integer count = sqlSession.selectOne("com.itrus.portal.db.MobileCertificateMapper.selectCount", param);
    uiModel.addAttribute("count", count);
    uiModel.addAttribute("pages", (count + size - 1) / size);
    Integer offset = size * (page - 1);
    param.put("offset", offset);
    param.put("limit", size);
    param.put("desc", "desc");
    List certificates = sqlSession.selectList("com.itrus.portal.db.MobileCertificateMapper.MobileCertificateList", param);
    uiModel.addAttribute("certificates", certificates);
    if (page > 1 && size * (page - 1) >= count) {
        page = (count + size - 1) / size;
    }
    uiModel.addAttribute("lockError", info);
    // uiModel.addAttribute("lockError",message==null?"":"该证书没有应用配置");
    uiModel.addAttribute("page", page);
    uiModel.addAttribute("size", size);
    return "mobilecertificate/list";
}
Also used : HashMap(java.util.HashMap) MobileCertificate(com.itrus.portal.db.MobileCertificate) Calendar(java.util.Calendar) MobileCertificateExample(com.itrus.portal.db.MobileCertificateExample) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map) Date(java.util.Date) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with MobileCertificateExample

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

the class EquipmentManagementController method debLock.

// 解锁证书
@RequestMapping(value = "/deblocking/{id}", produces = "text/html")
@ResponseBody
public String debLock(@PathVariable("id") Long id, @PathVariable("id") Long eid, RedirectAttributes model, Model uiModel) {
    MobileCertificateExample certificateExample = new MobileCertificateExample();
    MobileCertificateExample.Criteria criteria = certificateExample.createCriteria();
    // if(id!=null){
    criteria.andIdEqualTo(id);
    // }
    MobileCertificate certificate = mobileCertificateService.selectByExample(certificateExample);
    if (certificate != null) {
        // certificate.setId(id);
        certificate.setLockStatus(0);
        certificate.setDeblockingTime(new Date());
        mobileCertificateService.updateCertificate(certificate);
        // model.addFlashAttribute("info","解锁成功");
        return null;
    }
    return null;
}
Also used : MobileCertificate(com.itrus.portal.db.MobileCertificate) MobileCertificateExample(com.itrus.portal.db.MobileCertificateExample) Date(java.util.Date) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Example 4 with MobileCertificateExample

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

the class EquipmentManagementController method selectCertificate.

// 查看设备对应的证书
@RequestMapping(value = "/{deviceSerialNnumber}/{appName1}/{userId1}", method = RequestMethod.GET, produces = "text/html")
public String selectCertificate(@PathVariable("deviceSerialNnumber") String deviceSerialNnumber, @PathVariable("appName1") String appName1, @PathVariable("userId1") String userId1, Model uiModel, @ModelAttribute("info") String info, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, @RequestParam(value = "appName", required = false) String appName, @RequestParam(value = "userId", required = false) String userId, @RequestParam(value = "sequenceNumber", required = false) String sequenceNumber, @RequestParam(value = "certificateCn", required = false) String certificateCn, @RequestParam(value = "passType", required = false) String passType, @RequestParam(value = "lockStatus", required = false) Integer lockStatus, @RequestParam(value = "certificateStatus", required = false) Integer certificateStatus, @RequestParam(value = "queryDate11", required = false) Date queryDate11, @RequestParam(value = "queryDate12", required = false) Date queryDate12, @RequestParam(value = "queryDate21", required = false) Date queryDate21, @RequestParam(value = "queryDate22", required = false) Date queryDate22, HttpServletRequest request, HttpSession session) {
    /*Map param1 = new HashMap();
		MobileCertificate mobileCertificate = new MobileCertificate();
	 	mobileCertificate.setCertificateStatus(1);
		param1.put("record", mobileCertificate);
		param1.put("_parameter", 1);
		MobileCertificateExample example = new MobileCertificateExample();
		MobileCertificateExample.Criteria criteria = example.createCriteria();
		criteria.andLoseefficacyTimeLessThan(new Date());
		param1.put("example", example);
		mobileCertificateService.update(param1);
		Map<String, Object> param = new HashMap<String, Object>();
		param.put("desc","desc");
	//	param.put("eid",id1);
		List certificates=sqlSession.selectList("com.itrus.portal.db.MobileCertificateMapper.MobileCertificateList", param);
		uiModel.addAttribute("certificates",certificates);*/
    if (queryDate11 == null && queryDate12 == null) {
        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.DATE, 1);
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        calendar.add(Calendar.MILLISECOND, -1);
        queryDate12 = calendar.getTime();
        calendar.add(Calendar.MILLISECOND, 1);
        calendar.add(Calendar.MONTH, -1);
        queryDate11 = calendar.getTime();
    }
    /*if(queryDate21==null&&queryDate22==null){
			Calendar calendar = Calendar.getInstance();
			calendar.add(Calendar.DATE, 1);
			calendar.set(Calendar.HOUR_OF_DAY, 0);
			calendar.set(Calendar.MINUTE, 0);
			calendar.set(Calendar.SECOND, 0);
			calendar.set(Calendar.MILLISECOND, 0);
			calendar.add(Calendar.MILLISECOND, -1);
			queryDate22 = calendar.getTime();
			calendar.add(Calendar.MILLISECOND, 1);
			calendar.add(Calendar.MONTH, -1);
			queryDate21 = calendar.getTime();   
		}
		*/
    // 返回搜索条件
    // uiModel.addAttribute("eid1",eid1);
    // uiModel.addAttribute("eid",                    eid);
    uiModel.addAttribute("appName1", appName1);
    uiModel.addAttribute("userId1", userId1);
    uiModel.addAttribute("eid", deviceSerialNnumber);
    uiModel.addAttribute("appName", appName);
    uiModel.addAttribute("userId", userId);
    uiModel.addAttribute("passType", passType);
    uiModel.addAttribute("lockStatus", lockStatus);
    uiModel.addAttribute("queryDate12", queryDate12);
    uiModel.addAttribute("queryDate11", queryDate11);
    uiModel.addAttribute("queryDate22", queryDate22);
    uiModel.addAttribute("queryDate21", queryDate21);
    uiModel.addAttribute("sequenceNumber", sequenceNumber);
    uiModel.addAttribute("certificateCn", certificateCn);
    uiModel.addAttribute("certificateStatus", certificateStatus);
    Map<String, Object> param = new HashMap<String, Object>();
    // page,size
    if (page == null || page < 1)
        page = 1;
    if (size == null || size < 1)
        size = 10;
    if (StringUtils.isNotEmpty(userId)) {
        param.put("userId", "%" + userId + "%");
    }
    if (StringUtils.isNotEmpty(userId1)) {
        param.put("userId", "%" + userId1 + "%");
    }
    if (StringUtils.isNotEmpty(appName)) {
        param.put("appName", "%" + appName + "%");
    }
    if (StringUtils.isNotEmpty(appName1)) {
        param.put("appName", "%" + appName1 + "%");
    }
    if (StringUtils.isNotEmpty(sequenceNumber)) {
        param.put("sequenceNumber", "%" + sequenceNumber + "%");
    }
    if (StringUtils.isNotEmpty(certificateCn)) {
        param.put("certificateCn", "%" + certificateCn + "%");
    }
    if (StringUtils.isNotEmpty(passType)) {
        param.put("passType", passType);
    }
    if (lockStatus != null) {
        param.put("lockStatus", lockStatus);
    }
    if (certificateStatus != null) {
        param.put("certificateStatus", certificateStatus);
    }
    if (queryDate11 != null) {
        param.put("queryDate11", queryDate11);
    }
    if (queryDate12 != null) {
        param.put("queryDate12", queryDate12);
    }
    if (queryDate21 != null) {
        param.put("queryDate21", queryDate21);
    }
    if (queryDate22 != null) {
        param.put("queryDate22", queryDate22);
    }
    if (deviceSerialNnumber != null) {
        param.put("eid", deviceSerialNnumber);
    }
    Map param1 = new HashMap();
    MobileCertificate mobileCertificate = new MobileCertificate();
    mobileCertificate.setCertificateStatus(1);
    param1.put("record", mobileCertificate);
    param1.put("_parameter", 1);
    MobileCertificateExample example = new MobileCertificateExample();
    MobileCertificateExample.Criteria criteria = example.createCriteria();
    criteria.andLoseefficacyTimeLessThan(new Date());
    param1.put("example", example);
    mobileCertificateService.update(param1);
    // sqlSession.update("com.itrus.portal.db.MobileCertificateMapper.updateByExampleSelective", param1);
    Integer count = sqlSession.selectOne("com.itrus.portal.db.MobileCertificateMapper.selectCount", param);
    uiModel.addAttribute("count", count);
    uiModel.addAttribute("pages", (count + size - 1) / size);
    Integer offset = size * (page - 1);
    param.put("offset", offset);
    param.put("limit", size);
    param.put("desc", "desc");
    List certificates = sqlSession.selectList("com.itrus.portal.db.MobileCertificateMapper.MobileCertificateList", param);
    uiModel.addAttribute("certificates", certificates);
    if (page > 1 && size * (page - 1) >= count) {
        page = (count + size - 1) / size;
    }
    uiModel.addAttribute("lockError", info);
    // uiModel.addAttribute("lockError",message==null?"":"该证书没有应用配置");
    uiModel.addAttribute("page", page);
    uiModel.addAttribute("size", size);
    return "equipmentmanagement/list1";
}
Also used : HashMap(java.util.HashMap) MobileCertificate(com.itrus.portal.db.MobileCertificate) Calendar(java.util.Calendar) MobileCertificateExample(com.itrus.portal.db.MobileCertificateExample) ArrayList(java.util.ArrayList) List(java.util.List) HashMap(java.util.HashMap) Map(java.util.Map) Date(java.util.Date) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 5 with MobileCertificateExample

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

the class MobileRiskStatisticsLogService method selectbyCertNumber.

// 根据风控记录的证书序列号查询该条记录对应的证书信息
public MobileCertificate selectbyCertNumber(String CertNumber) {
    if (CertNumber != null) {
        MobileCertificateExample certificateExample = new MobileCertificateExample();
        MobileCertificateExample.Criteria criteria = certificateExample.createCriteria();
        criteria.andSequenceNumberEqualTo(CertNumber);
        MobileCertificate certificate = sqlSession.selectOne("com.itrus.portal.db.MobileCertificateMapper.selectByExample", certificateExample);
        return certificate;
    }
    return null;
}
Also used : MobileCertificate(com.itrus.portal.db.MobileCertificate) MobileCertificateExample(com.itrus.portal.db.MobileCertificateExample)

Aggregations

MobileCertificate (com.itrus.portal.db.MobileCertificate)7 MobileCertificateExample (com.itrus.portal.db.MobileCertificateExample)7 Date (java.util.Date)4 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)4 Calendar (java.util.Calendar)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)2 JSONObject (com.alibaba.fastjson.JSONObject)1 MobileUser (com.itrus.portal.db.MobileUser)1 MobileService (com.itrus.portal.mobile.service.MobileService)1 ArrayList (java.util.ArrayList)1