use of com.itrus.portal.db.EvidenceEventContent in project portal by ixinportal.
the class ReceiptContoller method logImg.
/**
* 得到合同图片
*
* @param id
* @param response
* @return
*/
@RequestMapping(value = "/img/{id}/{count}")
public String logImg(@PathVariable("id") Long id, @PathVariable("count") int count, HttpServletResponse response) {
String img = null;
OutputStream os = null;
FileInputStream fis = null;
File file = null;
// 得到证据内容信息
EvidenceEventContent mevencontent = sqlSession.selectOne("com.itrus.portal.db.EvidenceEventContentMapper.selectByPrimaryKey", id);
EvidenceBasicInformation basic = sqlSession.selectOne("com.itrus.portal.db.EvidenceBasicInformationMapper.selectByPrimaryKey", mevencontent.getBasicInformation());
EvidenceEnclosureExample envlosureE = new EvidenceEnclosureExample();
EvidenceEnclosureExample.Criteria envlosureEx = envlosureE.createCriteria();
envlosureEx.andEvidenceSnEqualTo(basic.getEvidenceSn());
envlosureEx.andPdfTypeEqualTo("2");
EvidenceEnclosure enclosure = sqlSession.selectOne("com.itrus.portal.db.EvidenceEnclosureMapper.selectByExample", envlosureE);
try {
// 生成图片
if (enclosure != null) {
if ("2".equals(enclosure.getPdfType())) {
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
int size = count - 1;
img = enclosure.getObjectName() + ".1.0." + size + ".png";
log.equals("123img321" + img);
log.equals("456getBucketName654" + enclosure.getBucketName());
file = filePathUtils.getBillFile(enclosure.getBucketName() + File.separator + enclosure.getEvidenceSn());
}
}
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 (Exception e) {
// TODO Auto-generated catch block
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.EvidenceEventContent in project portal by ixinportal.
the class ReceiptContoller method outhis.
/**
* 预览出证信息
*
* @param serialnumber
* @param type
* @param uiModel
* @return
*/
@RequestMapping(value = "/outhis/{serialnumber}", produces = "text/html")
public String outhis(@PathVariable("serialnumber") String serialnumber, Model uiModel) {
// 得到证据基本信息表
List<EvidenceBasicInformation> blist = new ArrayList<EvidenceBasicInformation>();
// 得到企业平台信息
Map<Long, EvidenceCompaniesSubmit> companiesSubmit = new HashMap<Long, EvidenceCompaniesSubmit>();
// 得到天威企业信息
Map<Long, List<RealNameRecord>> realnameRecor = new HashMap<Long, List<RealNameRecord>>();
// 得到天威个人信息
Map<Long, PersonalName> personalName = new HashMap<Long, PersonalName>();
// 得到个人平台信息
Map<Long, EvidenceIndividual> denceid = new HashMap<Long, EvidenceIndividual>();
// 得到得到身份意愿信息
Map<Long, EvidenceDesireIdentify> mdesire = new HashMap<Long, EvidenceDesireIdentify>();
// 得到事件内容信息
Map<Long, EvidenceEventContent> eventcontent = new HashMap<Long, EvidenceEventContent>();
// 得到时间对象
Map<Long, List<EvidenceTrustedIdentity>> trusid = new HashMap<Long, List<EvidenceTrustedIdentity>>();
// 得到身份标识信息
Map<Long, List<EvidenceTrustedIdentity>> trusted = new HashMap<Long, List<EvidenceTrustedIdentity>>();
// 得到事件时间信息
Map<Long, List<EvidenceEventTime>> enenttime = new HashMap<Long, List<EvidenceEventTime>>();
// 得到事件行为认证信息
Map<Long, List<EvidenceEventBehavior>> enenbehavior = new HashMap<Long, List<EvidenceEventBehavior>>();
// 得到事件意愿认证信息
Map<Long, List<EvidenceEventDesire>> evendesire = new HashMap<Long, List<EvidenceEventDesire>>();
// 得到平台提交信息代表人
Map<Long, EvidenceRepresentative> erepresetative = new HashMap<Long, EvidenceRepresentative>();
// 得到平台提交信息代理人
Map<Long, EvidenceTheAgent> etheagent = new HashMap<Long, EvidenceTheAgent>();
// 得到营业执照
Map<Long, Licenseinformation> licensein = new HashMap<Long, Licenseinformation>();
// 得到企业银行信息
Map<Long, Enterprisebank> enterpris = new HashMap<Long, Enterprisebank>();
// 得到组织机构代码
Map<Long, Organization> organiza = new HashMap<Long, Organization>();
// 得到法定代表人信息
Map<Long, Corporateinformation> corporat = new HashMap<Long, Corporateinformation>();
// 得到代理人信息
Map<Long, Agentinformation> agemtom = new HashMap<Long, Agentinformation>();
// 得到银行三四要素信息
Map<Long, Bankcardelements> bankcardele = new HashMap<Long, Bankcardelements>();
// 证据基本信息,放入多个基本信息
List<EvidenceBasicInformation> basicinfos = new ArrayList<EvidenceBasicInformation>();
// 得到出证信息
EvidenceHisCertificateExample hiscer = new EvidenceHisCertificateExample();
EvidenceHisCertificateExample.Criteria tificate = hiscer.createCriteria();
tificate.andSerialnumberEqualTo(serialnumber);
EvidenceHisCertificate hisCertificate = sqlSession.selectOne("com.itrus.portal.db.EvidenceHisCertificateMapper.selectByExample", hiscer);
// 得到出证存证中间表
EvidenceHisRelationshipExample hisrelation = new EvidenceHisRelationshipExample();
EvidenceHisRelationshipExample.Criteria shipEx = hisrelation.createCriteria();
shipEx.andHisCertificateEqualTo(hisCertificate.getId());
List<EvidenceHisRelationship> hisrelationship = sqlSession.selectList("com.itrus.portal.db.EvidenceHisRelationshipMapper.selectByExample", hisrelation);
for (EvidenceHisRelationship h : hisrelationship) {
// 得到基本信息表
EvidenceBasicInformation basic = sqlSession.selectOne("com.itrus.portal.db.EvidenceBasicInformationMapper.selectByPrimaryKey", h.getBasicInformation());
basicinfos.add(basic);
// 得到身份意愿信息
EvidenceDesireIdentifyExample desireIdentify = new EvidenceDesireIdentifyExample();
EvidenceDesireIdentifyExample.Criteria desireExample = desireIdentify.createCriteria();
desireExample.andEvidenceSnEqualTo(basic.getEvidenceSn());
EvidenceDesireIdentify desire = sqlSession.selectOne("com.itrus.portal.db.EvidenceDesireIdentifyMapper.selectByExample", desireIdentify);
mdesire.put(basic.getId(), desire);
EvidenceRealNameExample realnameE = new EvidenceRealNameExample();
EvidenceRealNameExample.Criteria realnameEx = realnameE.createCriteria();
realnameEx.andBasicInformationEqualTo(basic.getId());
EvidenceRealName erealname = sqlSession.selectOne("com.itrus.portal.db.EvidenceRealNameMapper.selectByExample", realnameE);
if (erealname != null) {
if (!"1".equals(erealname.getEventVerifierType())) {
if ("1".equals(erealname.getType())) {
EvidenceCompaniesSubmit companiesSubmit1 = sqlSession.selectOne("com.itrus.portal.db.EvidenceCompaniesSubmitMapper.selectByPrimaryKey", erealname.getCompaniesSubmit());
companiesSubmit.put(basic.getId(), companiesSubmit1);
// 得到法定代表人
EvidenceRepresentative representative = sqlSession.selectOne("com.itrus.portal.db.EvidenceRepresentativeMapper.selectByPrimaryKey", companiesSubmit1.getRepresentative());
erepresetative.put(basic.getId(), representative);
// 得到代理人
EvidenceTheAgent theAgen = sqlSession.selectOne("com.itrus.portal.db.EvidenceTheAgentMapper.selectByPrimaryKey", companiesSubmit1.getTheAgent());
etheagent.put(basic.getId(), theAgen);
uiModel.addAttribute("companiesSubmit", companiesSubmit);
uiModel.addAttribute("realname", companiesSubmit);
} else {
EvidenceIndividual dic = sqlSession.selectOne("com.itrus.portal.db.EvidenceIndividualMapper.selectByPrimaryKey", erealname.getIndividual());
denceid.put(basic.getId(), dic);
uiModel.addAttribute("denceid", denceid);
uiModel.addAttribute("realname", denceid);
}
} else {
if ("1".equals(erealname.getType())) {
String serialnamber = erealname.getSerialnumber();
String[] namber = serialnamber.split(",");
// List<RealNameRecord> listReal = new ArrayList<RealNameRecord>();
List<String> listString = new ArrayList<String>();
for (int i = 0; i < namber.length; i++) {
listString.add(namber[i]);
}
RealNameRecordExample realname = new RealNameRecordExample();
RealNameRecordExample.Criteria recor = realname.createCriteria();
// recor.andSerialnumberEqualTo(erealname.getSerialnumber());
recor.andSerialnumberIn(listString);
List<RealNameRecord> realnameRecor1 = sqlSession.selectList("com.itrus.portal.db.RealNameRecordMapper.selectByExample", realname);
realnameRecor.put(basic.getId(), realnameRecor1);
for (RealNameRecord real : realnameRecor1) {
// 得到营业执照
if (real.getLicenseinformation() != null) {
Licenseinformation information = sqlSession.selectOne("com.itrus.portal.db.LicenseinformationMapper.selectByPrimaryKey", real.getLicenseinformation());
licensein.put(basic.getId(), information);
}
// 得到企业银行信息
if (real.getEnterprisebank() != null) {
Enterprisebank enterprise = sqlSession.selectOne("com.itrus.portal.db.EnterprisebankMapper.selectByPrimaryKey", real.getEnterprisebank());
enterpris.put(basic.getId(), enterprise);
}
// 得到组织机构代码信息
if (real.getOrganization() != null) {
Organization organization = sqlSession.selectOne("com.itrus.portal.db.OrganizationMapper.selectByPrimaryKey", real.getOrganization());
organiza.put(basic.getId(), organization);
}
// 得到法定代表人信息
if (real.getCorporateinformation() != null) {
Corporateinformation enterprise = sqlSession.selectOne("com.itrus.portal.db.CorporateinformationMapper.selectByPrimaryKey", real.getCorporateinformation());
corporat.put(basic.getId(), enterprise);
}
// 得到代理人信息
if (real.getAgentinformation() != null) {
Agentinformation enterprise = sqlSession.selectOne("com.itrus.portal.db.AgentinformationMapper.selectByPrimaryKey", real.getAgentinformation());
agemtom.put(basic.getId(), enterprise);
}
}
uiModel.addAttribute("realname", realnameRecor);
} else {
PersonalNameExample personal = new PersonalNameExample();
PersonalNameExample.Criteria personalname = personal.createCriteria();
personalname.andSerialnumberEqualTo(erealname.getSerialnumber());
PersonalName personalName1 = sqlSession.selectOne("com.itrus.portal.db.PersonalNameMapper.selectByExample", personal);
personalName.put(basic.getId(), personalName1);
// 得到银行三四要素信息
Bankcardelements bank = sqlSession.selectOne("com.itrus.portal.db.BankcardelementsMapper.selectByPrimaryKey", personalName1.getBankcardelements());
bankcardele.put(basic.getId(), bank);
uiModel.addAttribute("personalName", personalName);
uiModel.addAttribute("realname", personalName);
}
}
}
// 事件内容
EvidenceEventContentExample evencontent = new EvidenceEventContentExample();
EvidenceEventContentExample.Criteria countent = evencontent.createCriteria();
// countent.andBasicInformationEqualTo(basic.getId());
countent.andEvidenceSnEqualTo(basic.getEvidenceSn());
List<EvidenceEventContent> mevencontent = sqlSession.selectList("com.itrus.portal.db.EvidenceEventContentMapper.selectByExample", evencontent);
eventcontent.put(basic.getId(), mevencontent.get(0));
// 得到身份可信标识
EvidenceTrustedIdentityExample trusten = new EvidenceTrustedIdentityExample();
EvidenceTrustedIdentityExample.Criteria identityex = trusten.createCriteria();
identityex.andBasicInformationEqualTo(basic.getEvidenceSn());
identityex.andEventContentIsNull();
List<EvidenceTrustedIdentity> trustedidentity = sqlSession.selectList("com.itrus.portal.db.EvidenceTrustedIdentityMapper.selectByExample", trusten);
trusted.put(basic.getId(), trustedidentity);
// 事件对象认证
EvidenceTrustedIdentityExample trustenid = new EvidenceTrustedIdentityExample();
EvidenceTrustedIdentityExample.Criteria identitye = trustenid.createCriteria();
identitye.andEventContentEqualTo(mevencontent.get(0).getIdCode());
List<EvidenceTrustedIdentity> trustedidentit = sqlSession.selectList("com.itrus.portal.db.EvidenceTrustedIdentityMapper.selectByExample", trustenid);
trusid.put(basic.getId(), trustedidentit);
// 事件时间认证
EvidenceEventTimeExample eventime = new EvidenceEventTimeExample();
EvidenceEventTimeExample.Criteria eventimeEx = eventime.createCriteria();
eventimeEx.andEventContentEqualTo(mevencontent.get(0).getIdCode());
List<EvidenceEventTime> meventime = sqlSession.selectList("com.itrus.portal.db.EvidenceEventTimeMapper.selectByExample", eventime);
enenttime.put(basic.getId(), meventime);
// 事件行为认证
EvidenceEventBehaviorExample eventbehaciorEx = new EvidenceEventBehaviorExample();
EvidenceEventBehaviorExample.Criteria eventbe = eventbehaciorEx.createCriteria();
eventbe.andEventContentEqualTo(mevencontent.get(0).getIdCode());
List<EvidenceEventBehavior> eventbehacior = sqlSession.selectList("com.itrus.portal.db.EvidenceEventBehaviorMapper.selectByExample", eventbehaciorEx);
enenbehavior.put(basic.getId(), eventbehacior);
// 事件意愿认证
EvidenceEventDesireExample desireEx = new EvidenceEventDesireExample();
EvidenceEventDesireExample.Criteria eventdesire = desireEx.createCriteria();
// eventdesire.andMainInformationEqualTo(basic.getId());
eventdesire.andEventContenteEqualTo(mevencontent.get(0).getIdCode());
List<EvidenceEventDesire> meventdesire = sqlSession.selectList("com.itrus.portal.db.EvidenceEventDesireMapper.selectByExample", desireEx);
evendesire.put(basic.getId(), meventdesire);
blist.add(basic);
// 判断图片是否存在
if (mevencontent.get(0).getIsimg() == null) {
// EvidenceBasicInformation basic = sqlSession.selectOne("com.itrus.portal.db.EvidenceBasicInformationMapper.selectByPrimaryKey", mevencontent.getBasicInformation());
// 得到证据附件表,用于获取信息
EvidenceEnclosureExample envlosureE = new EvidenceEnclosureExample();
EvidenceEnclosureExample.Criteria envlosureEx = envlosureE.createCriteria();
envlosureEx.andEvidenceSnEqualTo(basic.getEvidenceSn());
envlosureEx.andPdfTypeEqualTo("2");
EvidenceEnclosure envlosure = sqlSession.selectOne("com.itrus.portal.db.EvidenceEnclosureMapper.selectByExample", envlosureE);
// 判断是否为用户上传pdf
if (envlosure != null) {
String urlFile = systemConfigService.getpdfurl() + File.separator + envlosure.getBucketName() + File.separator + envlosure.getEvidenceSn();
File filePathStr = new File(urlFile, envlosure.getObjectName());
int pdfToPng = 0;
if (filePathStr != null && filePathStr.getPath() != null) {
try {
pdfToPng = Pdf.pdf2png(filePathStr.getPath());
} catch (Exception e) {
e.printStackTrace();
}
}
// 判断生成图片是否成功
if (pdfToPng > 0) {
// 修改内容表信息,表示生成图片
mevencontent.get(0).setIsimg(1);
mevencontent.get(0).setImgCount(pdfToPng);
sqlSession.update("com.itrus.portal.db.EvidenceEventContentMapper.updateByPrimaryKey", mevencontent);
String oper = "原文图片生成成功";
String info = "图片地址:" + urlFile;
LogUtil.evidencelog(sqlSession, null, oper, info);
} else {
String oper = "原文图片生成失败";
String info = "失败原因:" + systemConfigService.getpdfurl() + File.separator + envlosure.getBucketName();
LogUtil.evidencelog(sqlSession, null, oper, info);
}
}
}
}
uiModel.addAttribute("basicinfos", basicinfos);
// 平台代表人
uiModel.addAttribute("erepresetative", erepresetative);
// 平台代理人
uiModel.addAttribute("etheagent", etheagent);
// 营业执照信息
uiModel.addAttribute("licensein", licensein);
// 企业银行信息
uiModel.addAttribute("enterpris", enterpris);
// 住址机构代码
uiModel.addAttribute("organiza", organiza);
// 法定代表人
uiModel.addAttribute("corporat", corporat);
// 法定代理人
uiModel.addAttribute("agemtom", agemtom);
// 银行卡三四要素
uiModel.addAttribute("bankcardele", bankcardele);
// 得到得到身份意愿信息
uiModel.addAttribute("mdesire", mdesire);
// 得到事件时间信息
uiModel.addAttribute("enenttime", enenttime);
// 得到事件行为认证信息
uiModel.addAttribute("enenbehavior", enenbehavior);
// 得到时间对象
uiModel.addAttribute("trusid", trusid);
// 得到身份标识信息
uiModel.addAttribute("trusted", trusted);
// 得到证据基本信息表
uiModel.addAttribute("blist", blist);
// 得到事件内容信息
uiModel.addAttribute("eventcontent", eventcontent);
// 得到出证信息
uiModel.addAttribute("hisCertificate", hisCertificate);
// 出证时间
uiModel.addAttribute("datetime", new Date());
return "reporttemplate/certificationReport1";
}
use of com.itrus.portal.db.EvidenceEventContent in project portal by ixinportal.
the class ReceiptContoller method preview.
/**
* 预览证书
*
* @param evidenceSn
* @param uiModel
* @return
*/
@RequestMapping(value = "/preview/{evidenceSn}", produces = "text/html")
public String preview(@PathVariable("evidenceSn") String evidenceSn, Model uiModel) {
// 得到证书基本信息
EvidenceBasicInformationExample basicEx = new EvidenceBasicInformationExample();
EvidenceBasicInformationExample.Criteria information = basicEx.createCriteria();
information.andEvidenceSnEqualTo(evidenceSn);
EvidenceBasicInformation basic = sqlSession.selectOne("com.itrus.portal.db.EvidenceBasicInformationMapper.selectByExample", basicEx);
// 得到时间内容信息
EvidenceEventContentExample evencontent = new EvidenceEventContentExample();
EvidenceEventContentExample.Criteria countent = evencontent.createCriteria();
// countent.andBasicInformationEqualTo(basic.getId());
countent.andEvidenceSnEqualTo(basic.getEvidenceSn());
List<EvidenceEventContent> mevencontent = sqlSession.selectList("com.itrus.portal.db.EvidenceEventContentMapper.selectByExample", evencontent);
/*
* EvidenceEnclosureExample closure = new EvidenceEnclosureExample();
* EvidenceEnclosureExample.Criteria enclsureEx =
* closure.createCriteria();
* enclsureEx.andEvidenceSnEqualTo(evidenceSn);
*/
Map param = new HashMap();
param.put("evidenceSn", evidenceSn);
int sun = basicInformationimpl.selectsize(param);
// int sun = basic.getEvidenceSize();
// 得到证书附件信息
List<EvidenceEnclosure> enclosure = sqlSession.selectList("com.itrus.portal.db.EvidenceEnclosureMapper.selectEvidenceEnclosureList", param);
// int count = 0;
// for (int i = 0; i < enclosure.size(); i++) {
// count++;
// }
// 得到服务表信息
/*AppService appservice = appService.selectById(basic.getOutAppService());
if (null != appservice) {
// 得到出证服务配置
EvidenceOutServiceConfigExample saveService = new EvidenceOutServiceConfigExample();
EvidenceOutServiceConfigExample.Criteria saveServiceEx = saveService.createCriteria();
saveServiceEx.andAppServiceEqualTo(appservice.getId());
EvidenceOutServiceConfig outService = sqlSession
.selectOne("com.itrus.portal.db.EvidenceOutServiceConfigMapper.selectByExample", saveService);
// 得到回执名称
if (outService != null) {
// 得到证书信息
EvidenceCertificate certificate = sqlSession.selectOne(
"com.itrus.portal.db.EvidenceCertificateMapper.selectByPrimaryKey",
outService.getEvidenceCertificate());
uiModel.addAttribute("certificate", certificate);
}*/
// 得到服务表信息
// 得到服务编码
Map<Long, AppService> mAppService = CacheCustomer.APP_SERVICE_MAP_BY_ID();
AppService appservices = null;
if (mAppService != null && mAppService.get(basic.getAppService()) != null) {
appservices = mAppService.get(basic.getAppService());
}
if (null == appservices) {
appservices = appService.selectById(basic.getAppService());
}
// AppService appservices = appService.selectById(basic.getAppService());
Map<Long, EvidenceSaveService> evidenceSaveService = CacheCustomer.getappSAVE_SERVICE_MAP();
EvidenceSaveService evidenceSave = null;
if (evidenceSaveService != null && evidenceSaveService.get(appservices.getId()) != null) {
evidenceSave = evidenceSaveService.get(appservices.getId());
} else {
EvidenceSaveServiceExample save = new EvidenceSaveServiceExample();
EvidenceSaveServiceExample.Criteria saveEx = save.createCriteria();
saveEx.andAppServiceEqualTo(appservices.getId());
evidenceSave = sqlSession.selectOne("com.itrus.portal.db.EvidenceSaveServiceMapper.selectByExample", save);
}
uiModel.addAttribute("evidenceSave", evidenceSave);
// }
uiModel.addAttribute("datetime", new Date());
uiModel.addAttribute("sun", sun);
uiModel.addAttribute("enclosure", enclosure);
if (enclosure.size() != 0) {
// uiModel.addAttribute("fixationTime", enclosure.get(0).getFixationTime());// 最新一次更新时间
// 第一次更新时间
uiModel.addAttribute("dataTime", enclosure.get(enclosure.size() - 1).getFixationTime());
}
uiModel.addAttribute("mevencontent", mevencontent.get(0));
uiModel.addAttribute("basic", basic);
// }
return "reporttemplate/receiptTemplate1";
}
use of com.itrus.portal.db.EvidenceEventContent in project portal by ixinportal.
the class BasicInformationController method show2.
/**
* 查看详情
*
* @param id
* @param uiModel
* @return
*/
@RequestMapping(value = "show/{identification}", produces = "text/html")
public String show2(@PathVariable("identification") String id, Model uiModel) {
List<EvidenceMainInformation> mlist = new ArrayList<EvidenceMainInformation>();
List<EvidenceMainInformation> milist = new ArrayList<EvidenceMainInformation>();
Map<Long, EvidenceCompaniesSubmit> companiesSubmit = new HashMap<Long, EvidenceCompaniesSubmit>();
Map<Long, List<RealNameRecord>> realnameRecor = new HashMap<Long, List<RealNameRecord>>();
Map<Long, List<PersonalName>> personalName = new HashMap<Long, List<PersonalName>>();
Map<Long, EvidenceIndividual> denceid = new HashMap<Long, EvidenceIndividual>();
// 事件对象认证
Map<Long, EvidenceTrustedIdentity> trustedidentit = new HashMap<Long, EvidenceTrustedIdentity>();
// 事件时间认证
Map<Long, EvidenceEventTime> meventime = new HashMap<Long, EvidenceEventTime>();
// 事件行为认证
Map<Long, EvidenceEventBehavior> eventbehacior = new HashMap<Long, EvidenceEventBehavior>();
// 事件意愿认证
Map<Long, EvidenceEventDesire> meventdesire = new HashMap<Long, EvidenceEventDesire>();
// 事件网络地址
Map<Long, EvidenceEventNetworkAddress> networkaddress = new HashMap<Long, EvidenceEventNetworkAddress>();
// 身份意愿信息
Map<Long, EvidenceDesireIdentify> desire = new HashMap<Long, EvidenceDesireIdentify>();
// 得到基本信息
EvidenceBasicInformation basicinfor = sqlSession.selectOne("com.itrus.portal.db.EvidenceBasicInformationMapper.selectByPrimaryKey", basid);
// 得到主体身份信息
EvidenceMainInformationExample mainExample = new EvidenceMainInformationExample();
EvidenceMainInformationExample.Criteria info = mainExample.createCriteria();
info.andIdentificationEqualTo(id);
// 得到主体信息
List<EvidenceMainInformation> mainInfor = sqlSession.selectList("com.itrus.portal.db.EvidenceMainInformationMapper.selectByExample", mainExample);
EvidenceMainInformation mainInfo = new EvidenceMainInformation();
if (mainInfor.size() != 0) {
mlist.add(mainInfor.get(0));
mainInfo = mainInfor.get(0);
}
EvidenceSubjectIdentityExample subjectExample = new EvidenceSubjectIdentityExample();
EvidenceSubjectIdentityExample.Criteria identity = subjectExample.createCriteria();
identity.andBasicInformationEqualTo(basicinfor.getEvidenceSn());
List<EvidenceSubjectIdentity> subjectIdentity = sqlSession.selectList("com.itrus.portal.db.EvidenceSubjectIdentityMapper.selectByExample", subjectExample);
for (int i = 0; i < subjectIdentity.size(); i++) {
// 得到主体信息
EvidenceMainInformationExample infomationE = new EvidenceMainInformationExample();
EvidenceMainInformationExample.Criteria tionE = infomationE.createCriteria();
tionE.andIdentificationEqualTo(subjectIdentity.get(i).getMainInformation());
if (subjectIdentity.get(i).getMainName() != null) {
tionE.andSubjectNameEqualTo(subjectIdentity.get(i).getMainName());
}
List<EvidenceMainInformation> ainInfo = sqlSession.selectList("com.itrus.portal.db.EvidenceMainInformationMapper.selectByExample", infomationE);
if (ainInfo.size() != 0) {
milist.add(ainInfo.get(0));
}
/*EvidenceMainInformation ainInfo = sqlSession.selectOne(
"com.itrus.portal.db.EvidenceMainInformationMapper.selectByPrimaryKey",
subjectIdentity.get(i).getMainInformation());
milist.add(ainInfo);*/
}
// 身份信息证据的map
Map<Long, EvidenceBasicInformation> basi = new HashMap<Long, EvidenceBasicInformation>();
// 得到身份可信标识
EvidenceTrustedIdentityExample trusten = new EvidenceTrustedIdentityExample();
EvidenceTrustedIdentityExample.Criteria identityex = trusten.createCriteria();
// identityex.andMainInformationEqualTo(mainInfo.getId());
identityex.andBasicInformationEqualTo(basicinfor.getEvidenceSn());
identityex.andEventContentIsNull();
Map<Long, EvidenceTrustedIdentity> trustedidentity = sqlSession.selectMap("com.itrus.portal.db.EvidenceTrustedIdentityMapper.selectByExample", trusten, "mainInformation");
// String evidenceSn = null;
if (trustedidentity != null && trustedidentity.get(mainInfo.getId()) != null) {
if (trustedidentity.get(mainInfo.getId()).getEvidenceSn() != null) {
String evidenceSn = trustedidentity.get(mainInfo.getId()).getEvidenceSn().toString();
// 得到可信身份标识关联的证据身份信息
EvidenceBasicInformationExample basicinforE = new EvidenceBasicInformationExample();
EvidenceBasicInformationExample.Criteria critbasic = basicinforE.createCriteria();
critbasic.andEvidenceSnEqualTo(evidenceSn);
EvidenceBasicInformation basicinfor1 = sqlSession.selectOne("com.itrus.portal.db.EvidenceBasicInformationMapper.selectByExample", basicinforE);
basi.put(mainInfo.getId(), basicinfor1);
// 得到身份意愿信息
EvidenceDesireIdentifyExample desireIdentify = new EvidenceDesireIdentifyExample();
EvidenceDesireIdentifyExample.Criteria desireExample = desireIdentify.createCriteria();
desireExample.andMainInformationEqualTo(mainInfo.getIdentification());
desire = sqlSession.selectMap("com.itrus.portal.db.EvidenceDesireIdentifyMapper.selectByExample", desireIdentify, "mainInformation");
// 得到实名认证信息
EvidenceRealNameExample realnameE = new EvidenceRealNameExample();
EvidenceRealNameExample.Criteria realnameEx = realnameE.createCriteria();
realnameEx.andMainInformationEqualTo(mainInfo.getSubjectName() + ";" + mainInfo.getIdentification());
// realnameEx.andBasicInformationEqualTo(basicinfor1.getId());
realnameEx.andEvidenceSnEqualTo(basicinfor.getEvidenceSn());
EvidenceRealName erealname = sqlSession.selectOne("com.itrus.portal.db.EvidenceRealNameMapper.selectByExample", realnameE);
if (erealname != null) {
if ("2".equals(erealname.getEventVerifierType()) || "3".equals(erealname.getEventVerifierType())) {
// 判断企业还是个人
if ("1".equals(erealname.getType())) {
EvidenceCompaniesSubmitExample evidenceCompanies = new EvidenceCompaniesSubmitExample();
EvidenceCompaniesSubmitExample.Criteria submitEx = evidenceCompanies.createCriteria();
submitEx.andIdCodeEqualTo(erealname.getCompaniesSubmit());
EvidenceCompaniesSubmit companiesSubmit1 = sqlSession.selectOne("com.itrus.portal.db.EvidenceCompaniesSubmitMapper.selectByExample", evidenceCompanies);
companiesSubmit.put(mainInfo.getId(), companiesSubmit1);
} else {
EvidenceIndividualExample evidenceIndiv = new EvidenceIndividualExample();
EvidenceIndividualExample.Criteria idualEx = evidenceIndiv.createCriteria();
idualEx.andIdCodeEqualTo(erealname.getIndividual());
EvidenceIndividual dic = sqlSession.selectOne("com.itrus.portal.db.EvidenceIndividualMapper.selectByPrimaryKey", evidenceIndiv);
denceid.put(mainInfo.getId(), dic);
}
} else if ("1".equals(erealname.getEventVerifierType())) {
if ("1".equals(erealname.getType())) {
String serialnamber = erealname.getSerialnumber();
String[] namber = serialnamber.split(",");
List<String> listString = new ArrayList<String>();
for (int i = 0; i < namber.length; i++) {
listString.add(namber[i]);
}
RealNameRecordExample realname = new RealNameRecordExample();
RealNameRecordExample.Criteria recor = realname.createCriteria();
// recor.andSerialnumberEqualTo(a[i]);
recor.andSerialnumberIn(listString);
realname.setOrderByClause("returntime");
listReal = sqlSession.selectList("com.itrus.portal.db.RealNameRecordMapper.selectByExample", realname);
realnameRecor.put(mainInfo.getId(), listReal);
} else {
String serialnamber = erealname.getSerialnumber();
String[] namber = serialnamber.split(",");
List<String> listString = new ArrayList<String>();
for (int i = 0; i < namber.length; i++) {
listString.add(namber[i]);
}
PersonalNameExample personal = new PersonalNameExample();
PersonalNameExample.Criteria personalname = personal.createCriteria();
personalname.andSerialnumberIn(listString);
personal.setOrderByClause("returntime");
listPersonal = sqlSession.selectList("com.itrus.portal.db.PersonalNameMapper.selectByExample", personal);
personalName.put(mainInfo.getId(), listPersonal);
}
}
}
uiModel.addAttribute("erealname", erealname);
}
}
// 事件内容
EvidenceEventContentExample evencontent = new EvidenceEventContentExample();
EvidenceEventContentExample.Criteria countent = evencontent.createCriteria();
// countent.andBasicInformationEqualTo(basicinfor.getId());
countent.andEvidenceSnEqualTo(basicinfor.getEvidenceSn());
EvidenceEventContent mevencontent = sqlSession.selectOne("com.itrus.portal.db.EvidenceEventContentMapper.selectByExample", evencontent);
if (mevencontent != null && mevencontent.getIdCode() != null) {
// 事件对象认证
EvidenceTrustedIdentityExample trustenid = new EvidenceTrustedIdentityExample();
EvidenceTrustedIdentityExample.Criteria identitye = trustenid.createCriteria();
identitye.andEventContentEqualTo(mevencontent.getIdCode());
trustedidentit = sqlSession.selectMap("com.itrus.portal.db.EvidenceTrustedIdentityMapper.selectByExample", trustenid, "mainInformation");
// 事件时间认证
EvidenceEventTimeExample eventime = new EvidenceEventTimeExample();
EvidenceEventTimeExample.Criteria eventimeEx = eventime.createCriteria();
eventimeEx.andEventContentEqualTo(mevencontent.getIdCode());
meventime = sqlSession.selectMap("com.itrus.portal.db.EvidenceEventTimeMapper.selectByExample", eventime, "mainInformation");
// 事件行为认证
EvidenceEventBehaviorExample eventbehaciorEx = new EvidenceEventBehaviorExample();
EvidenceEventBehaviorExample.Criteria eventbe = eventbehaciorEx.createCriteria();
eventbe.andEventContentEqualTo(mevencontent.getIdCode());
eventbehacior = sqlSession.selectMap("com.itrus.portal.db.EvidenceEventBehaviorMapper.selectByExample", eventbehaciorEx, "mainInformation");
// 事件意愿认证
EvidenceEventDesireExample desireEx = new EvidenceEventDesireExample();
EvidenceEventDesireExample.Criteria eventdesire = desireEx.createCriteria();
eventdesire.andEventContenteEqualTo(mevencontent.getIdCode());
meventdesire = sqlSession.selectMap("com.itrus.portal.db.EvidenceEventDesireMapper.selectByExample", desireEx, "mainInformation");
// 事件网络地址
EvidenceEventNetworkAddressExample network = new EvidenceEventNetworkAddressExample();
EvidenceEventNetworkAddressExample.Criteria address = network.createCriteria();
address.andEventContentEqualTo(mevencontent.getIdCode());
networkaddress = sqlSession.selectMap("com.itrus.portal.db.EvidenceEventNetworkAddressMapper.selectByExample", network, "mainInformation");
// 得到证据附件表,用于获取信息
EvidenceEnclosure envlosure = sqlSession.selectOne("com.itrus.portal.db.EvidenceEnclosureMapper.selectByPrimaryKey", mevencontent.getEvidenceEnclosure());
uiModel.addAttribute("enclosure", envlosure);
}
// 得到证据附件信息
EvidenceEnclosureExample enclou = new EvidenceEnclosureExample();
EvidenceEnclosureExample.Criteria sure = enclou.createCriteria();
sure.andEvidenceSnEqualTo(basicinfor.getEvidenceSn());
;
sure.andPdfTypeEqualTo("1");
List<EvidenceEnclosure> enclosure = sqlSession.selectList("com.itrus.portal.db.EvidenceEnclosureMapper.selectByExample", enclou);
EvidenceEnclosureExample enclouE = new EvidenceEnclosureExample();
EvidenceEnclosureExample.Criteria sureEX = enclouE.createCriteria();
sureEX.andEvidenceSnEqualTo(basicinfor.getEvidenceSn());
sureEX.andPdfTypeEqualTo("3");
EvidenceEnclosure enclosurepdf = sqlSession.selectOne("com.itrus.portal.db.EvidenceEnclosureMapper.selectByExample", enclouE);
uiModel.addAttribute("enclosurepdf", enclosurepdf);
// 服务委托人签名信息
Map<Long, EvidenceClientSignature> cilentsignat = new HashMap<Long, EvidenceClientSignature>();
// 天威签名信息
Map<Long, EvidenceClientSignature> cilentsignature = new HashMap<Long, EvidenceClientSignature>();
// 服务委托人时间戳信息
Map<Long, EvidenceClientTimeStamp> clientTimestamp = new HashMap<Long, EvidenceClientTimeStamp>();
// 天威时间戳信息
Map<Long, EvidenceClientTimeStamp> tclientTimestamp = new HashMap<Long, EvidenceClientTimeStamp>();
// 服务委托人证书信息
Map<Long, List<EvidenceCert>> listcert = new HashMap<Long, List<EvidenceCert>>();
// 服务委托人核验信息
Map<Long, EvidenceCheck> check = new HashMap<Long, EvidenceCheck>();
int ensize = 0;
for (EvidenceEnclosure en : enclosure) {
// 服务委托人签名信息
EvidenceClientSignatureExample cilent = new EvidenceClientSignatureExample();
EvidenceClientSignatureExample.Criteria signat = cilent.createCriteria();
signat.andEvidenceSnEqualTo(en.getEvidenceSn());
signat.andNameEqualTo("0");
EvidenceClientSignature listclient = sqlSession.selectOne("com.itrus.portal.db.EvidenceClientSignatureMapper.selectByExample", cilent);
if (listclient != null) {
cilentsignat.put(en.getId(), listclient);
ensize++;
// 服务委托人证书信息
/* EvidenceCertExample certEx = new EvidenceCertExample();
EvidenceCertExample.Criteria evidenceCert = certEx.createCriteria();
evidenceCert.andClientSignatureEqualTo(listclient.getId());
List<EvidenceCert> listCert = sqlSession
.selectList("com.itrus.portal.db.EvidenceCertMapper.selectByExample", certEx);*/
List<EvidenceCert> listCert = sqlSession.selectList("com.itrus.portal.db.EvidenceCertMapper.selectByPrimaryKey", listclient.getCertId());
listcert.put(en.getId(), listCert);
// 服务委托人核验信息
EvidenceCheckExample checkEx = new EvidenceCheckExample();
EvidenceCheckExample.Criteria evidenceCheck = checkEx.createCriteria();
evidenceCheck.andClientSignatureEqualTo(listclient.getId());
EvidenceCheck listCheck = sqlSession.selectOne("com.itrus.portal.db.EvidenceCheckMapper.selectByExample", checkEx);
check.put(en.getId(), listCheck);
}
// 天威签名信息
EvidenceClientSignatureExample cilentsign = new EvidenceClientSignatureExample();
EvidenceClientSignatureExample.Criteria signature = cilentsign.createCriteria();
signature.andEvidenceSnEqualTo(en.getEvidenceSn());
signature.andNameEqualTo("1");
EvidenceClientSignature clientlist = sqlSession.selectOne("com.itrus.portal.db.EvidenceClientSignatureMapper.selectByExample", cilentsign);
if (clientlist != null) {
cilentsignature.put(en.getId(), clientlist);
ensize++;
}
// 服务委托人时间戳信息
EvidenceClientTimeStampExample clientTime = new EvidenceClientTimeStampExample();
EvidenceClientTimeStampExample.Criteria stamp = clientTime.createCriteria();
stamp.andEvidenceSnEqualTo(en.getEvidenceSn());
stamp.andNameEqualTo("0");
EvidenceClientTimeStamp listtime = sqlSession.selectOne("com.itrus.portal.db.EvidenceClientTimeStampMapper.selectByExample", clientTime);
if (listtime != null) {
clientTimestamp.put(en.getId(), listtime);
ensize++;
}
// 天威时间戳信息
EvidenceClientTimeStampExample tclientTime = new EvidenceClientTimeStampExample();
EvidenceClientTimeStampExample.Criteria tstamp = tclientTime.createCriteria();
tstamp.andEvidenceSnEqualTo(en.getEvidenceSn());
tstamp.andNameEqualTo("1");
EvidenceClientTimeStamp timelist = sqlSession.selectOne("com.itrus.portal.db.EvidenceClientTimeStampMapper.selectByExample", tclientTime);
if (timelist != null) {
tclientTimestamp.put(en.getId(), timelist);
ensize++;
}
}
uiModel.addAttribute("basi", basi);
uiModel.addAttribute("ensize", ensize);
uiModel.addAttribute("check", check);
uiModel.addAttribute("listcert", listcert);
uiModel.addAttribute("envlosure", enclosure);
// uiModel.addAttribute("erealname", erealname);
uiModel.addAttribute("milist", milist);
uiModel.addAttribute("basicinfor", basicinfor);
uiModel.addAttribute("tclientTimestamp", tclientTimestamp);
uiModel.addAttribute("clientTimestamp", clientTimestamp);
uiModel.addAttribute("cilentsignature", cilentsignature);
uiModel.addAttribute("cilentsignat", cilentsignat);
uiModel.addAttribute("networkaddress", networkaddress);
uiModel.addAttribute("meventdesire", meventdesire);
uiModel.addAttribute("eventbehacior", eventbehacior);
uiModel.addAttribute("meventime", meventime);
uiModel.addAttribute("trustedidentit", trustedidentit);
uiModel.addAttribute("mevencontent", mevencontent);
uiModel.addAttribute("trustedidentity", trustedidentity);
uiModel.addAttribute("companiesSubmit", companiesSubmit);
uiModel.addAttribute("realnameRecor", realnameRecor);
uiModel.addAttribute("denceid", denceid);
uiModel.addAttribute("personalName", personalName);
uiModel.addAttribute("mainInfo", mlist);
uiModel.addAttribute("desire", desire);
int coutn = 0;
int size = 0;
Map<Long, Integer> msize = new HashMap<Long, Integer>();
// 得到认证数量
for (EvidenceMainInformation m : mlist) {
int showsize = 0;
// 身份认证
if (companiesSubmit.get(m.getId()) != null) {
coutn++;
}
if (realnameRecor.get(m.getId()) != null) {
coutn++;
}
if (personalName.get(m.getId()) != null) {
coutn++;
}
if (desire.get(m.getId()) != null) {
coutn++;
}
if (trustedidentity.get(m.getSubjectName() + ";" + m.getIdentification()) != null) {
coutn++;
}
if (denceid.get(m.getId()) != null) {
coutn++;
}
// 事件认证
if (trustedidentit.get(m.getSubjectName() + ";" + m.getIdentification()) != null) {
size++;
showsize++;
}
if (meventime.get(m.getSubjectName() + ";" + m.getIdentification()) != null) {
size++;
showsize++;
}
if (eventbehacior.get(m.getSubjectName() + ";" + m.getIdentification()) != null) {
size++;
showsize++;
}
if (meventdesire.get(m.getSubjectName() + ";" + m.getIdentification()) != null) {
size++;
showsize++;
}
if (networkaddress.get(m.getSubjectName() + ";" + m.getIdentification()) != null) {
size++;
showsize++;
}
msize.put(m.getId(), showsize);
}
uiModel.addAttribute("showsize", msize);
uiModel.addAttribute("rowsize", size + 1);
uiModel.addAttribute("rowcoutn", coutn);
return "basicinformation/show";
}
use of com.itrus.portal.db.EvidenceEventContent in project portal by ixinportal.
the class BasicInformationController method preview.
/**
* 预览证书
*
* @param evidenceSn
* @param uiModel
* @return
*/
@RequestMapping(value = "/preview/{evidenceSn}", produces = "text/html")
public String preview(@PathVariable("evidenceSn") String evidenceSn, Model uiModel) {
// 得到证书基本信息
EvidenceBasicInformationExample basicEx = new EvidenceBasicInformationExample();
EvidenceBasicInformationExample.Criteria information = basicEx.createCriteria();
information.andEvidenceSnEqualTo(evidenceSn);
EvidenceBasicInformation basic = sqlSession.selectOne("com.itrus.portal.db.EvidenceBasicInformationMapper.selectByExample", basicEx);
// 得到时间内容信息
EvidenceEventContentExample evencontent = new EvidenceEventContentExample();
EvidenceEventContentExample.Criteria countent = evencontent.createCriteria();
// countent.andBasicInformationEqualTo(basic.getId());
countent.andEvidenceSnEqualTo(basic.getEvidenceSn());
EvidenceEventContent mevencontent = sqlSession.selectOne("com.itrus.portal.db.EvidenceEventContentMapper.selectByExample", evencontent);
Map param = new HashMap();
param.put("evidenceSn", evidenceSn);
int sun = basicInformationimpl.selectsize(param);
// log.error("********************sun****************="+sun);
// 得到证书附件信息
List<EvidenceEnclosure> enclosure = sqlSession.selectList("com.itrus.portal.db.EvidenceEnclosureMapper.selectEvidenceEnclosureList", param);
/*int count = 0;
for (int i = 0; i < enclosure.size(); i++) {
count++;
}*/
// 得到服务表信息
// AppService appservice = appService.selectById(basic.getOutAppService());
// if (null != appservice) {
// // 得到出证服务配置
// EvidenceOutServiceConfigExample saveService = new EvidenceOutServiceConfigExample();
// EvidenceOutServiceConfigExample.Criteria saveServiceEx = saveService.createCriteria();
// saveServiceEx.andAppServiceEqualTo(appservice.getId());
// EvidenceOutServiceConfig outService = sqlSession
// .selectOne("com.itrus.portal.db.EvidenceOutServiceConfigMapper.selectByExample", saveService);
//
// // 得到回执名称
// if (outService != null) {
// // 得到证书信息
// EvidenceCertificate certificate = sqlSession.selectOne(
// "com.itrus.portal.db.EvidenceCertificateMapper.selectByPrimaryKey",
// outService.getEvidenceCertificate());
//
// uiModel.addAttribute("certificate", certificate);
// }
// 得到服务表信息
AppService appservices = appService.selectById(basic.getAppService());
EvidenceSaveServiceExample save = new EvidenceSaveServiceExample();
EvidenceSaveServiceExample.Criteria saveEx = save.createCriteria();
saveEx.andAppServiceEqualTo(appservices.getId());
EvidenceSaveService evidenceSave = sqlSession.selectOne("com.itrus.portal.db.EvidenceSaveServiceMapper.selectByExample", save);
uiModel.addAttribute("evidenceSave", evidenceSave);
// }
uiModel.addAttribute("datetime", new Date());
uiModel.addAttribute("sun", sun);
uiModel.addAttribute("enclosure", enclosure);
if (enclosure.size() != 0) {
// 最新一次更新时间
uiModel.addAttribute("fixationTime", enclosure.get(0).getFixationTime());
// 第一次更新时间
uiModel.addAttribute("dataTime", enclosure.get(enclosure.size() - 1).getFixationTime());
}
uiModel.addAttribute("mevencontent", mevencontent);
uiModel.addAttribute("basic", basic);
return "reporttemplate/receiptTemplate";
}
Aggregations