Search in sources :

Example 1 with DigitalCertExample

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

the class DigitalCertController method list.

// 列表所有信息
@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "message", required = false) Integer message, @RequestParam(value = "page", required = false) Integer page, @RequestParam(value = "size", required = false) Integer size, Model uiModel) throws Exception {
    // page,size
    if (page == null || page < 1)
        page = 1;
    if (size == null || size < 1)
        size = 10;
    // count,pages
    Integer count = sqlSession.selectOne("com.itrus.portal.db.DigitalCertMapper.countByExample", null);
    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);
    // query data
    Integer offset = size * (page - 1);
    DigitalCertExample digitalcertex = new DigitalCertExample();
    // projectex.or().andIdIsNotNull();
    digitalcertex.setOffset(offset);
    digitalcertex.setLimit(size);
    List digitalcertexall = sqlSession.selectList("com.itrus.portal.db.DigitalCertMapper.selectByExample", digitalcertex);
    uiModel.addAttribute("digitalcerts", digitalcertexall);
    // itemcount
    uiModel.addAttribute("itemcount", digitalcertexall.size());
    uiModel.addAttribute("message", message == null ? "" : "要删除的数字证书存在关联,无法删除");
    return "digitalcert/list";
}
Also used : List(java.util.List) DigitalCertExample(com.itrus.portal.db.DigitalCertExample) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with DigitalCertExample

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

the class MakeCertController method list.

@RequestMapping(produces = "text/html")
public String list(@RequestParam(value = "status", required = false) Integer status, @RequestParam(value = "billNo", required = false) String billNo, @RequestParam(value = "keySn", required = false) String keySn, @RequestParam(value = "projectName", required = false) String projectName, @RequestParam(value = "enterpriseName", required = false) String enterpriseName, @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, @RequestParam(value = "businessType", required = false) Integer businessType, @RequestParam(value = "type", required = false) Integer type, @RequestParam(value = "mcstatus", required = false) String mcstatus, Model uiModel) {
    Map<String, Object> param1 = new HashMap<String, Object>();
    // 管理员项目权限
    Long[] projectsOfAdmin = getProjectLongIdsOfAdmin();
    param1.put("hasProjects", Arrays.asList(projectsOfAdmin));
    if (null == status)
        status = 1;
    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();
    }
    if (page == null || page < 1) {
        page = 1;
    }
    if (size == null || size < 1) {
        size = 10;
    }
    param1.put("queryDate1", queryDate1);
    param1.put("queryDate2", queryDate2);
    if (StringUtils.isNotEmpty(billNo)) {
        param1.put("billNo", "%" + billNo + "%");
    }
    if (StringUtils.isNotEmpty(projectName)) {
        param1.put("projectName", "%" + projectName + "%");
    }
    if (StringUtils.isNotEmpty(enterpriseName)) {
        param1.put("enterpriseName", "%" + enterpriseName + "%");
    }
    if (StringUtils.isNotBlank(keySn))
        param1.put("keySn", "%" + keySn + "%");
    // 待制证
    if ("1".equals(status.toString())) {
        // 已审核,待制证
        param1.put("billStatus", ComNames.BILL_STATUS_5);
        // 按照check_time进行排序
        param1.put("check", 1);
    } else // 已制证
    if ("2".equals(status.toString())) {
        param1.put("billStatus", ComNames.BILL_STATUS_6);
        if (type != null) {
            if (type >= 0 && type < 3) {
                param1.put("initBuy", type);
            }
            if (type == 3) {
                param1.put("updateWay", 0);
            }
        }
        param1.put("businessType", businessType);
    } else // 待更新
    if ("3".equals(status.toString())) {
        // 订单状态是12的时候,表示是待更新的订单;
        param1.put("billStatus", ComNames.BILL_STATUS_12);
    } else // 自动制证
    if ("4".equals(status.toString())) {
        param1.put("initBuy", 1);
        param1.put("businessType", 0);
        param1.put("mcstatus", mcstatus);
        param1.put("billStatus", ComNames.BILL_STATUS_5);
    } else // 待下载
    if ("5".equals(status.toString())) {
        // 订单状态是13的时候,表示是待下载的订单;
        param1.put("billStatus", ComNames.BILL_STATUS_13);
    }
    Integer count = sqlSession.selectOne("com.itrus.portal.db.BillMapper.selectCountByMakeCert", param1);
    if (page > 1 && size * (page - 1) >= count) {
        page = (count + size - 1) / size;
    }
    Integer offset = size * (page - 1);
    param1.put("offset", offset);
    param1.put("limit", size);
    List makecertexall = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectByAllMakeCert", param1);
    DigitalCertExample digitalcertex = new DigitalCertExample();
    Map<Long, DigitalCert> digitalcertmap = sqlSession.selectMap("com.itrus.portal.db.DigitalCertMapper.selectByExample", digitalcertex, "id");
    uiModel.addAttribute("makecerts", makecertexall);
    uiModel.addAttribute("digitalcertmap", digitalcertmap);
    uiModel.addAttribute("count", count);
    uiModel.addAttribute("pages", (count + size - 1) / size);
    uiModel.addAttribute("page", page);
    uiModel.addAttribute("size", size);
    uiModel.addAttribute("itemcount", makecertexall.size());
    uiModel.addAttribute("queryDate1", queryDate1);
    uiModel.addAttribute("queryDate2", queryDate2);
    uiModel.addAttribute("status", status);
    uiModel.addAttribute("billNo", billNo);
    uiModel.addAttribute("projectName", projectName);
    uiModel.addAttribute("enterpriseName", enterpriseName);
    uiModel.addAttribute("keySn", keySn);
    uiModel.addAttribute("businessType", businessType);
    uiModel.addAttribute("type", type);
    uiModel.addAttribute("mcstatus", mcstatus);
    return "makecert/list";
}
Also used : BigInteger(java.math.BigInteger) DigitalCert(com.itrus.portal.db.DigitalCert) HashMap(java.util.HashMap) Calendar(java.util.Calendar) JSONObject(com.alibaba.fastjson.JSONObject) List(java.util.List) ArrayList(java.util.ArrayList) DigitalCertExample(com.itrus.portal.db.DigitalCertExample) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with DigitalCertExample

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

the class DigitalCertServiceImpl method getDigitalCertByProductMap.

/**
 * 根据产品id的集合获取对应的数字证书的map
 *
 * @param productIds
 * @return
 */
public Map<Long, DigitalCert> getDigitalCertByProductMap(Set<Long> productIds) {
    Map<Long, DigitalCert> digitalCertMap = new HashMap<Long, DigitalCert>();
    if (null != productIds && productIds.size() > 0) {
        DigitalCertExample example = new DigitalCertExample();
        DigitalCertExample.Criteria criteria = example.or();
        criteria.andIdIn(new ArrayList<Long>(productIds));
        digitalCertMap = sqlSession.selectMap("com.itrus.portal.db.DigitalCertMapper.selectByExample", example, "id");
    }
    return digitalCertMap;
}
Also used : DigitalCert(com.itrus.portal.db.DigitalCert) HashMap(java.util.HashMap) DigitalCertExample(com.itrus.portal.db.DigitalCertExample)

Aggregations

DigitalCertExample (com.itrus.portal.db.DigitalCertExample)3 DigitalCert (com.itrus.portal.db.DigitalCert)2 HashMap (java.util.HashMap)2 List (java.util.List)2 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 JSONObject (com.alibaba.fastjson.JSONObject)1 BigInteger (java.math.BigInteger)1 ArrayList (java.util.ArrayList)1 Calendar (java.util.Calendar)1