Search in sources :

Example 26 with ApplicationInfoExample

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

the class MobileApplyConfigController method creatForm.

// 返回新建页面
@RequestMapping(params = "form", produces = "text/html")
public String creatForm(Model uiModel) {
    // 得到所有应用
    List<ApplicationInfo> applicationInfos = applicationInfoService.selectByExample(new ApplicationInfoExample());
    uiModel.addAttribute("applicationInfos", applicationInfos);
    Iterator<ApplicationInfo> iterator = applicationInfos.iterator();
    while (iterator.hasNext()) {
        ApplicationInfo mobileApply = iterator.next();
        MobileApplyConfigManage appserviceChargings = mobileApplyConfigService.selectByappId(mobileApply.getAppId());
        if (null != appserviceChargings) {
            iterator.remove();
        }
    }
    uiModel.addAttribute("applicationInfos", applicationInfos);
    // 得到所有RA 服务信息
    List<RaAccount> accounts = raAccountService.getRaAccounts();
    uiModel.addAttribute("accounts", accounts);
    return "applyconfig/create";
}
Also used : ApplicationInfoExample(com.itrus.portal.db.ApplicationInfoExample) RaAccount(com.itrus.portal.db.RaAccount) ApplicationInfo(com.itrus.portal.db.ApplicationInfo) MobileApplyConfigManage(com.itrus.portal.db.MobileApplyConfigManage) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 27 with ApplicationInfoExample

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

the class MobileApplyConfigController method list.

// 列表显示
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "appId", required = false) Long appId, @RequestParam(value = "queryDate1", required = false) Date queryDate1, @RequestParam(value = "queryDate2", required = false) Date queryDate2, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, 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("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);
    Integer count = mobileApplyConfigService.selectMobileApplyConfigManageListCountByMap(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<Map<String, Object>> applyConfigManages = mobileApplyConfigService.selectMobileApplyConfigManageListByMap(param);
    uiModel.addAttribute("applyConfigManages", applyConfigManages);
    // 得到所有应用
    List<ApplicationInfo> applicationInfos = applicationInfoService.selectByExample(new ApplicationInfoExample());
    uiModel.addAttribute("applicationInfos", applicationInfos);
    return "applyconfig/list";
}
Also used : ApplicationInfoExample(com.itrus.portal.db.ApplicationInfoExample) HashMap(java.util.HashMap) Calendar(java.util.Calendar) ApplicationInfo(com.itrus.portal.db.ApplicationInfo) HashMap(java.util.HashMap) Map(java.util.Map) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 28 with ApplicationInfoExample

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

the class CertificationChargingServiceImpl method getApplicationInfoByAppId.

/**
 * 根据appid,获取ApplicationInfo
 *
 * @param appId
 * @return
 */
public ApplicationInfo getApplicationInfoByAppId(String appId) {
    ApplicationInfo applicationInfo = new ApplicationInfo();
    ApplicationInfoExample aie = new ApplicationInfoExample();
    ApplicationInfoExample.Criteria criteria = aie.or();
    criteria.andAppIdEqualTo(appId);
    applicationInfo = sqlSession.selectOne("com.itrus.portal.db.ApplicationInfoMapper.selectByExample", aie);
    return applicationInfo;
}
Also used : ApplicationInfoExample(com.itrus.portal.db.ApplicationInfoExample) ApplicationInfo(com.itrus.portal.db.ApplicationInfo)

Example 29 with ApplicationInfoExample

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

Example 30 with ApplicationInfoExample

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

the class TakeChargingServiceImpl method getApplicationInfoByAppId.

/**
 * 根据appid,获取ApplicationInfo
 *
 * @param appId
 * @return
 */
public ApplicationInfo getApplicationInfoByAppId(String appId) {
    ApplicationInfo applicationInfo = new ApplicationInfo();
    ApplicationInfoExample aie = new ApplicationInfoExample();
    ApplicationInfoExample.Criteria criteria = aie.or();
    criteria.andAppIdEqualTo(appId);
    applicationInfo = sqlSession.selectOne("com.itrus.portal.db.ApplicationInfoMapper.selectByExample", aie);
    return applicationInfo;
}
Also used : ApplicationInfoExample(com.itrus.portal.db.ApplicationInfoExample) ApplicationInfo(com.itrus.portal.db.ApplicationInfo)

Aggregations

ApplicationInfoExample (com.itrus.portal.db.ApplicationInfoExample)31 ApplicationInfo (com.itrus.portal.db.ApplicationInfo)25 HashMap (java.util.HashMap)21 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)12 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)12 JSONObject (com.alibaba.fastjson.JSONObject)10 Map (java.util.Map)8 PostMapping (org.springframework.web.bind.annotation.PostMapping)8 Calendar (java.util.Calendar)7 Bill (com.itrus.portal.db.Bill)6 EvidenceBasicInformation (com.itrus.portal.db.EvidenceBasicInformation)6 Date (java.util.Date)6 UserInfoServiceException (com.itrus.portal.exception.UserInfoServiceException)5 ArrayList (java.util.ArrayList)5 JSONException (org.json.JSONException)5 Enterprise (com.itrus.portal.db.Enterprise)4 UserinfoEnterprise (com.itrus.portal.db.UserinfoEnterprise)4 IOException (java.io.IOException)4 List (java.util.List)4 Agent (com.itrus.portal.db.Agent)3