Search in sources :

Example 1 with EvidenceSaveService

use of com.itrus.portal.db.EvidenceSaveService 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";
}
Also used : AppService(com.itrus.portal.db.AppService) EvidenceBasicInformation(com.itrus.portal.db.EvidenceBasicInformation) HashMap(java.util.HashMap) EvidenceSaveService(com.itrus.portal.db.EvidenceSaveService) EvidenceEnclosure(com.itrus.portal.db.EvidenceEnclosure) EvidenceEventContentExample(com.itrus.portal.db.EvidenceEventContentExample) Date(java.util.Date) EvidenceBasicInformationExample(com.itrus.portal.db.EvidenceBasicInformationExample) EvidenceSaveServiceExample(com.itrus.portal.db.EvidenceSaveServiceExample) Map(java.util.Map) HashMap(java.util.HashMap) EvidenceEventContent(com.itrus.portal.db.EvidenceEventContent) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with EvidenceSaveService

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

the class SaveServiceController method show.

// 显示详情
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) {
    EvidenceSaveService saveService = saveServiceImpl.selectServiceById(id);
    uiModel.addAttribute("saveService", saveService);
    AppService appService = appServiceImpl.selectById(saveService.getAppService());
    uiModel.addAttribute("appService", appService);
    AppServiceExample ase = new AppServiceExample();
    AppServiceExample.Criteria asec = ase.createCriteria();
    asec.andTypeEqualTo(3L);
    asec.andServiceConfigNameEqualTo("EvidenceOutServiceConfig");
    List<AppService> appServiceList = sqlSession.selectList("com.itrus.portal.db.AppServiceMapper.selectByExample", ase);
    uiModel.addAttribute("appServiceList", appServiceList);
    return "saveservice/show";
}
Also used : AppService(com.itrus.portal.db.AppService) EvidenceSaveService(com.itrus.portal.db.EvidenceSaveService) AppServiceExample(com.itrus.portal.db.AppServiceExample) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with EvidenceSaveService

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

the class SaveServiceController method updateForm.

// 返回修改页面
@RequestMapping(value = "/{id}", params = "form", produces = "text/html")
public String updateForm(@PathVariable("id") Long id, Model uiModel) {
    EvidenceSaveService saveService = saveServiceImpl.selectServiceById(id);
    uiModel.addAttribute("saveService", saveService);
    AppService appService = appServiceImpl.selectById(saveService.getAppService());
    uiModel.addAttribute("appService", appService);
    AppServiceExample ase = new AppServiceExample();
    AppServiceExample.Criteria asec = ase.createCriteria();
    asec.andTypeEqualTo(3L);
    asec.andServiceConfigNameEqualTo("EvidenceOutServiceConfig");
    List<AppService> appServiceList = sqlSession.selectList("com.itrus.portal.db.AppServiceMapper.selectByExample", ase);
    uiModel.addAttribute("appServiceList", appServiceList);
    return "saveservice/update";
}
Also used : AppService(com.itrus.portal.db.AppService) EvidenceSaveService(com.itrus.portal.db.EvidenceSaveService) AppServiceExample(com.itrus.portal.db.AppServiceExample) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 4 with EvidenceSaveService

use of com.itrus.portal.db.EvidenceSaveService 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";
}
Also used : AppService(com.itrus.portal.db.AppService) EvidenceBasicInformation(com.itrus.portal.db.EvidenceBasicInformation) HashMap(java.util.HashMap) EvidenceSaveService(com.itrus.portal.db.EvidenceSaveService) EvidenceEnclosure(com.itrus.portal.db.EvidenceEnclosure) EvidenceEventContentExample(com.itrus.portal.db.EvidenceEventContentExample) Date(java.util.Date) EvidenceBasicInformationExample(com.itrus.portal.db.EvidenceBasicInformationExample) EvidenceSaveServiceExample(com.itrus.portal.db.EvidenceSaveServiceExample) Map(java.util.Map) HashMap(java.util.HashMap) EvidenceEventContent(com.itrus.portal.db.EvidenceEventContent) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 5 with EvidenceSaveService

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

the class SaveServiceImpl method updateEvidenceSaveService.

/**
 * 修改存证服务
 * @param evidenceSaveService
 * @param appService
 * @param id
 */
public void updateEvidenceSaveService(EvidenceSaveService evidenceSaveService, AppService appService, Long id) {
    DefaultTransactionDefinition def = new DefaultTransactionDefinition();
    def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
    TransactionStatus status = transactionManager.getTransaction(def);
    try {
        // 修改存证服务配置表
        EvidenceSaveService evidenceSaveService0 = selectById(evidenceSaveService.getId());
        evidenceSaveService.setAppService(evidenceSaveService0.getAppService());
        sqlSession.update("com.itrus.portal.db.EvidenceSaveServiceMapper.updateByPrimaryKey", evidenceSaveService);
        // 根据服务id获取第二次存证服务
        EvidenceSaveServiceCopy evidenceSaveServiceCopy = selectByEvidenceSaveServiceCopy(appService.getId());
        evidenceSaveServiceCopy.setEncryptionWay(evidenceSaveService.getEncryptionWay());
        evidenceSaveServiceCopy.setFixationWay(evidenceSaveService.getFixationWay());
        evidenceSaveServiceCopy.setSaveTime(evidenceSaveService.getSaveTime());
        evidenceSaveServiceCopy.setBaseSpace(evidenceSaveService.getBaseSpace());
        evidenceSaveServiceCopy.setFactorBusinessInfo(evidenceSaveService.getFactorBusinessInfo());
        evidenceSaveServiceCopy.setFactorIdVerify(evidenceSaveService.getFactorIdVerify());
        evidenceSaveServiceCopy.setFactorEventVerify(evidenceSaveService.getFactorEventVerify());
        evidenceSaveServiceCopy.setFactorCertSave(evidenceSaveService.getFactorCertSave());
        evidenceSaveServiceCopy.setFactorContent(evidenceSaveService.getFactorContent());
        evidenceSaveServiceCopy.setAppService(evidenceSaveService.getAppService());
        sqlSession.update("com.itrus.portal.db.EvidenceSaveServiceCopyMapper.updateByPrimaryKey", evidenceSaveServiceCopy);
        // 修改应用服务表
        AppService appService0 = appServiceImpl.selectById(appService.getId());
        appService.setCreator(appService0.getCreator());
        appService.setCreateTime(appService0.getCreateTime());
        appService.setType(appService0.getType());
        appService.setServiceConfigName(appService0.getServiceConfigName());
        appService.setServiceConfigId(appService0.getServiceConfigId());
        appService.setModifyTime(new Date());
        appService.setModifier(id);
        appService.setIsDelete(appService0.getIsDelete());
        sqlSession.update("com.itrus.portal.db.AppServiceMapper.updateByPrimaryKey", appService);
        sqlSession.flushStatements();
        transactionManager.commit(status);
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        if (!status.isCompleted())
            transactionManager.rollback(status);
    }
}
Also used : AppService(com.itrus.portal.db.AppService) DefaultTransactionDefinition(org.springframework.transaction.support.DefaultTransactionDefinition) EvidenceSaveServiceCopy(com.itrus.portal.db.EvidenceSaveServiceCopy) TransactionStatus(org.springframework.transaction.TransactionStatus) EvidenceSaveService(com.itrus.portal.db.EvidenceSaveService) Date(java.util.Date)

Aggregations

EvidenceSaveService (com.itrus.portal.db.EvidenceSaveService)11 AppService (com.itrus.portal.db.AppService)9 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)8 HashMap (java.util.HashMap)6 EvidenceBasicInformation (com.itrus.portal.db.EvidenceBasicInformation)5 EvidenceSaveServiceExample (com.itrus.portal.db.EvidenceSaveServiceExample)4 Date (java.util.Date)4 JSONObject (com.alibaba.fastjson.JSONObject)3 EvidenceBasicInformationExample (com.itrus.portal.db.EvidenceBasicInformationExample)3 EvidenceEnclosure (com.itrus.portal.db.EvidenceEnclosure)3 EvidenceEventContent (com.itrus.portal.db.EvidenceEventContent)3 RealNameAuthentication (com.itrus.portal.db.RealNameAuthentication)3 IOException (java.io.IOException)3 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)3 AppServiceExample (com.itrus.portal.db.AppServiceExample)2 ApplicationInfo (com.itrus.portal.db.ApplicationInfo)2 EvidenceEventContentExample (com.itrus.portal.db.EvidenceEventContentExample)2 Map (java.util.Map)2 EvidenceCert (com.itrus.portal.db.EvidenceCert)1 EvidenceCheck (com.itrus.portal.db.EvidenceCheck)1