Search in sources :

Example 1 with MobileUser

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

the class MobileCertificateService method selectByUserId.

// 根据用户id查询对应的用户信息
public MobileUser selectByUserId(Long id) {
    MobileUserExample userExample = new MobileUserExample();
    MobileUserExample.Criteria ue = userExample.createCriteria();
    ue.andIdEqualTo(id);
    MobileUser mobileUser = sqlSession.selectOne("com.itrus.portal.db.MobileUserMapper.selectByExample", userExample);
    return mobileUser;
}
Also used : MobileUserExample(com.itrus.portal.db.MobileUserExample) MobileUser(com.itrus.portal.db.MobileUser)

Example 2 with MobileUser

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

the class MobileCertificateController method show.

// 显示详情
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) {
    MobileCertificate certificate = mobileCertificateService.selectById(id);
    uiModel.addAttribute("certificate", certificate);
    if (certificate.getAppId() != null) {
        ApplicationInfo app = mobileCertificateService.selectByAppId(certificate.getAppId());
        uiModel.addAttribute("app", app);
    }
    if (certificate.getUserId() != null) {
        MobileUser mobileUser = mobileCertificateService.selectByUserId(certificate.getUserId());
        uiModel.addAttribute("mobileUser", mobileUser);
    }
    if (certificate.getApplyConfigId() != null) {
        MobileApplyConfigManage applyConfigManage = mobileCertificateService.selectByMobileApplyConfigId(certificate.getApplyConfigId());
        uiModel.addAttribute("applyConfigManage", applyConfigManage);
    }
    return "mobilecertificate/show";
}
Also used : MobileCertificate(com.itrus.portal.db.MobileCertificate) ApplicationInfo(com.itrus.portal.db.ApplicationInfo) MobileUser(com.itrus.portal.db.MobileUser) MobileApplyConfigManage(com.itrus.portal.db.MobileApplyConfigManage) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with MobileUser

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

the class MobileRiskStatisticsLogService method selectByUserId.

// 根据控记录的用户ID查询该记录所对应的用户信息
public MobileUser selectByUserId(String userId) {
    if (userId != null) {
        MobileUserExample example = new MobileUserExample();
        MobileUserExample.Criteria criteria = example.createCriteria();
        criteria.andUserIdEqualTo(userId);
        MobileUser mobileUser = sqlSession.selectOne("com.itrus.portal.db.MobileUserMapper.selectByExample", example);
        return mobileUser;
    }
    return null;
}
Also used : MobileUserExample(com.itrus.portal.db.MobileUserExample) MobileUser(com.itrus.portal.db.MobileUser)

Example 4 with MobileUser

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

the class MobileRiskStatisticsLogController method show.

/*
	 * 查看详情
	 */
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uimodel) {
    // 得到该条风控记录
    MobileRiskStatisticsLog mobileRiskStatisticsLog = mobileRiskStatisticsLogService.selectByRiskStatisticsLogId(id);
    uimodel.addAttribute("mobileRiskStatisticsLog", mobileRiskStatisticsLog);
    // 根据风控记录的用户ID查询该记录所对应的用户信息
    if (mobileRiskStatisticsLog != null) {
        MobileUser mobileUser = mobileRiskStatisticsLogService.selectByUserId(mobileRiskStatisticsLog.getUserId());
        uimodel.addAttribute("mobileUser", mobileUser);
        // 根据风控记录的证书序列号查询该条记录对应的证书信息
        MobileCertificate mobileCertificate = mobileRiskStatisticsLogService.selectbyCertNumber(mobileRiskStatisticsLog.getCertSequenceNumber());
        uimodel.addAttribute("mobileCertificate", mobileCertificate);
    }
    return "mobileriskstatisticslog/show";
}
Also used : MobileRiskStatisticsLog(com.itrus.portal.db.MobileRiskStatisticsLog) MobileCertificate(com.itrus.portal.db.MobileCertificate) MobileUser(com.itrus.portal.db.MobileUser) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 5 with MobileUser

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

the class MobileUserController method list.

// 列表
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, @RequestParam(value = "userId", required = false) String userId, @RequestParam(value = "name", required = false) String name, @RequestParam(value = "phone", required = false) String phone, @RequestParam(value = "idNumber", required = false) String idNumber, @RequestParam(value = "appId", required = false) Long appId, @RequestParam(value = "queryDate1", required = false) Date queryDate1, @RequestParam(value = "queryDate2", required = false) Date queryDate2, Model uiModel) {
    if (queryDate1 == null && queryDate2 == 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);
        queryDate2 = calendar.getTime();
        calendar.add(Calendar.MILLISECOND, 1);
        calendar.add(Calendar.MONTH, -1);
        queryDate1 = calendar.getTime();
    }
    // 返回页面搜索条件
    uiModel.addAttribute("appId", appId);
    uiModel.addAttribute("userId", userId);
    uiModel.addAttribute("name", name);
    uiModel.addAttribute("phone", phone);
    uiModel.addAttribute("idNumber", idNumber);
    uiModel.addAttribute("queryDate1", queryDate1);
    uiModel.addAttribute("queryDate2", queryDate2);
    Map<String, Object> param = new HashMap<String, Object>();
    // page,size
    if (page == null || page < 1)
        page = 1;
    if (size == null || size < 1)
        size = 10;
    Integer offset = size * (page - 1);
    param.put("offset", offset);
    param.put("limit", size);
    param.put("appId", appId);
    param.put("queryDate1", queryDate1);
    param.put("queryDate2", queryDate2);
    if (StringUtils.isNotEmpty(userId)) {
        param.put("userId", "%" + userId + "%");
    }
    if (StringUtils.isNotEmpty(name)) {
        param.put("name", "%" + name + "%");
    }
    if (StringUtils.isNotEmpty(phone)) {
        param.put("phone", "%" + phone + "%");
    }
    if (StringUtils.isNotEmpty(idNumber)) {
        param.put("idNumber", "%" + idNumber + "%");
    }
    Integer count = mobileUserService.selectMobileUserListCountByMap(param);
    uiModel.addAttribute("count", count);
    uiModel.addAttribute("pages", (count + size - 1) / size);
    // page, size
    if (page > 1 && size * (page - 1) >= count) {
        page = (count + size - 1) / size;
    }
    uiModel.addAttribute("page", page);
    uiModel.addAttribute("size", size);
    List<MobileUser> mobileUsers = mobileUserService.selectMobileUserListByMap(param);
    uiModel.addAttribute("mobileUsers", mobileUsers);
    // 得到所有应用
    List<ApplicationInfo> applicationInfos = applicationInfoService.selectByExample(new ApplicationInfoExample());
    uiModel.addAttribute("applicationInfos", applicationInfos);
    return "mobileuser/list";
}
Also used : ApplicationInfoExample(com.itrus.portal.db.ApplicationInfoExample) HashMap(java.util.HashMap) Calendar(java.util.Calendar) ApplicationInfo(com.itrus.portal.db.ApplicationInfo) MobileUser(com.itrus.portal.db.MobileUser) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

MobileUser (com.itrus.portal.db.MobileUser)6 MobileCertificate (com.itrus.portal.db.MobileCertificate)3 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)3 ApplicationInfo (com.itrus.portal.db.ApplicationInfo)2 MobileUserExample (com.itrus.portal.db.MobileUserExample)2 JSONObject (com.alibaba.fastjson.JSONObject)1 ApplicationInfoExample (com.itrus.portal.db.ApplicationInfoExample)1 MobileApplyConfigManage (com.itrus.portal.db.MobileApplyConfigManage)1 MobileCertificateExample (com.itrus.portal.db.MobileCertificateExample)1 MobileRiskStatisticsLog (com.itrus.portal.db.MobileRiskStatisticsLog)1 MobileService (com.itrus.portal.mobile.service.MobileService)1 Calendar (java.util.Calendar)1 HashMap (java.util.HashMap)1