Search in sources :

Example 1 with TrustedPersonalInformation

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

the class TrustedPersonalInformationController method loadImg.

/**
 * 得到图片
 *
 * @param id
 * @param response
 * @return
 */
@RequestMapping(value = "/img/{type1}/{id}")
public String loadImg(@PathVariable("type1") String type1, @PathVariable("id") Long id, HttpServletResponse response) {
    String img = null;
    String serviceId = null;
    OutputStream os = null;
    FileInputStream fis = null;
    TrustedPersonalInformation trusted = null;
    Corporateinformation corporatein = new Corporateinformation();
    Trustedenterprise trus = null;
    File file = null;
    try {
        response.setHeader("Pragma", "no-cache");
        response.setHeader("Cache-Control", "no-cache");
        response.setDateHeader("Expires", 0);
        if ("1".equals(type1)) {
            trus = trustedenterpriseService.selectById(id);
            corporatein = sqlSession.selectOne("com.itrus.portal.db.CorporateinformationMapper.selectByPrimaryKey", trus.getCorporateinformation());
            img = corporatein.getPhotoCodeImg();
            file = filePathUtils.getBillFile(trus.getSerialnumber());
        }
        if ("2".equals(type1)) {
            trusted = sqlSession.selectOne("com.itrus.portal.db.TrustedPersonalInformationMapper.selectByPrimaryKey", id);
            img = trusted.getPhotoCodeImg();
            file = filePathUtils.getBillFile(trusted.getSerialnumber());
        }
        if (trusted == null && corporatein == null) {
            return "status403";
        }
        if (img == null) {
            return "status403";
        }
        if (!file.exists()) {
            file.mkdir();
        }
        File imgFile = new File(file, img);
        fis = new FileInputStream(imgFile);
        byte[] bb = IOUtils.toByteArray(fis);
        os = response.getOutputStream();
        os.write(bb);
        os.flush();
    } catch (IOException e) {
        // 未找到
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        // 关闭流!
        try {
            if (null != fis) {
                fis.close();
            }
            if (null != os) {
                os.close();
            }
        } catch (IOException e) {
        }
    }
    return null;
}
Also used : Trustedenterprise(com.itrus.portal.db.Trustedenterprise) OutputStream(java.io.OutputStream) Corporateinformation(com.itrus.portal.db.Corporateinformation) IOException(java.io.IOException) TrustedPersonalInformation(com.itrus.portal.db.TrustedPersonalInformation) File(java.io.File) FileInputStream(java.io.FileInputStream) IOException(java.io.IOException) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with TrustedPersonalInformation

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

the class TrustedPersonalInformationController method show.

// 显示详情
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) {
    TrustedPersonalInformation trustedpersonalinformation = trustedPersonalInformationService.selectById(id);
    uiModel.addAttribute("trustedpersonalinformation", trustedpersonalinformation);
    Bankcardelements bankcardelememts = sqlSession.selectOne("com.itrus.portal.db.BankcardelementsMapper.selectByPrimaryKey", trustedpersonalinformation.getBankcardelements());
    String au = trustedpersonalinformation.getAuthenticationItem();
    System.out.println(au);
    if (au != null && au != "") {
        // 银行卡3,4要素
        if (au.indexOf("4") != -1) {
            uiModel.addAttribute("bankcardelememts", bankcardelememts);
        } else if (au.indexOf("5") != -1) {
            uiModel.addAttribute("bankcardelememts", bankcardelememts);
        } else {
            uiModel.addAttribute("bankcardelememts", 1);
        }
        // 个人人像核验
        if (au.indexOf("1") != -1 || au.indexOf("2") != -1) {
            uiModel.addAttribute("personal", 1);
        }
    }
    return "trustedpersonalinformation/show";
}
Also used : Bankcardelements(com.itrus.portal.db.Bankcardelements) TrustedPersonalInformation(com.itrus.portal.db.TrustedPersonalInformation) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with TrustedPersonalInformation

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

the class TrustedPersonalInformationService method selectListTrustedPersonalInformation.

/**
 * 得到个人的所有数据
 *
 * @return
 */
public Map selectListTrustedPersonalInformation() {
    // 声明一个map
    Map<String, TrustedPersonalInformation> map = new HashMap<String, TrustedPersonalInformation>();
    // 查询可信企业信息
    List<TrustedPersonalInformation> list = sqlSession.selectList("com.itrus.portal.db.TrustedPersonalInformationMapper.selectByExample", null);
    for (TrustedPersonalInformation trustedPersonalInformation : list) {
        // 将查询出来的数据循环放入map中
        map.put(trustedPersonalInformation.getFullName(), trustedPersonalInformation);
    }
    return map;
}
Also used : HashMap(java.util.HashMap) TrustedPersonalInformation(com.itrus.portal.db.TrustedPersonalInformation)

Aggregations

TrustedPersonalInformation (com.itrus.portal.db.TrustedPersonalInformation)3 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)2 Bankcardelements (com.itrus.portal.db.Bankcardelements)1 Corporateinformation (com.itrus.portal.db.Corporateinformation)1 Trustedenterprise (com.itrus.portal.db.Trustedenterprise)1 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 OutputStream (java.io.OutputStream)1 HashMap (java.util.HashMap)1