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;
}
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";
}
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;
}
Aggregations