use of com.itrus.portal.db.EvidenceCertificate in project portal by ixinportal.
the class OutServiceConfigController method update.
// 修改处理
@RequestMapping(method = RequestMethod.PUT, produces = "text/html")
public String update(@ModelAttribute("evidenceOutServiceConfig") EvidenceOutServiceConfig evidenceOutServiceConfig, @ModelAttribute("appService") AppService appService, @RequestParam(required = false, value = "id1") Long id1, @RequestParam(required = false, value = "type1") Integer type1, @RequestParam(required = false, value = "keyword1") String keyword1, @RequestParam(required = false, value = "page1") String page1, @RequestParam(required = false, value = "distanceToLeft1") String distanceToLeft1, @RequestParam(required = false, value = "distanceToDown1") String distanceToDown1, @RequestParam(required = false, value = "heightOfImage1") String heightOfImage1, @RequestParam(required = false, value = "widthOfImage1") String widthOfImage1, @RequestParam(required = false, value = "id2") Long id2, @RequestParam(required = false, value = "type2") Integer type2, @RequestParam(required = false, value = "keyword2") String keyword2, @RequestParam(required = false, value = "page2") String page2, @RequestParam(required = false, value = "distanceToLeft2") String distanceToLeft2, @RequestParam(required = false, value = "distanceToDown2") String distanceToDown2, @RequestParam(required = false, value = "heightOfImage2") String heightOfImage2, @RequestParam(required = false, value = "widthOfImage2") String widthOfImage2, @RequestParam(required = false, value = "id3") Long id3, @RequestParam(required = false, value = "type3") Integer type3, @RequestParam(required = false, value = "keyword3") String keyword3, @RequestParam(required = false, value = "page3") String page3, @RequestParam(required = false, value = "distanceToLeft3") String distanceToLeft3, @RequestParam(required = false, value = "distanceToDown3") String distanceToDown3, @RequestParam(required = false, value = "heightOfImage3") String heightOfImage3, @RequestParam(required = false, value = "widthOfImage3") String widthOfImage3, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) {
if (bindingResult.hasErrors()) {
Map<String, Object> param = new HashMap<String, Object>();
param.put("id", evidenceOutServiceConfig.getId());
List<Map<String, Object>> outServiceConfig = outServiceConfigService.selectOutServiceConfigByList(param);
uiModel.addAttribute("outServiceConfig", outServiceConfig.get(0));
// 得到对应的签章位置配置信息
List<EvidenceSignetPlaceConfig> signetPlaceConfigList = signetPlaceConfigService.selectSignetPlaceConfigByList(evidenceOutServiceConfig.getId());
for (int i = 0; i < signetPlaceConfigList.size(); i++) {
uiModel.addAttribute("signetPlaceConfig_" + (i + 1), signetPlaceConfigList.get(i));
}
List<EvidenceOutTemplate> outTemplateList = outServiceConfigService.selectOutTemplateByList();
uiModel.addAttribute("outTemplateList", outTemplateList);
List<EvidenceCertificate> certificateList = certificateService.getSignatureList();
uiModel.addAttribute("certificateList", certificateList);
return "outserviceconfig/update";
}
if (evidenceOutServiceConfig.getOutWay() == 0) {
evidenceOutServiceConfig.setOutWay(null);
}
if (evidenceOutServiceConfig.getOutReportTemplate() == 0) {
evidenceOutServiceConfig.setOutReportTemplate(null);
}
if (evidenceOutServiceConfig.getSaveRetTemplate() == 0) {
evidenceOutServiceConfig.setSaveRetTemplate(null);
}
if (evidenceOutServiceConfig.getEvidenceCertificate() == 0) {
evidenceOutServiceConfig.setEvidenceCertificate(null);
}
EvidenceSignetPlaceConfig signetPlaceConfigOne = null;
EvidenceSignetPlaceConfig signetPlaceConfigTwo = null;
EvidenceSignetPlaceConfig signetPlaceConfigThree = null;
if (type1 != null && type1 != 0) {
if (id1 != null) {
signetPlaceConfigOne = signetPlaceConfigService.selectById(id1);
} else {
signetPlaceConfigOne = new EvidenceSignetPlaceConfig();
}
signetPlaceConfigOne.setType(type1);
signetPlaceConfigOne.setKeyword(keyword1);
signetPlaceConfigOne.setPage(page1);
signetPlaceConfigOne.setDistanceToLeft(distanceToLeft1);
signetPlaceConfigOne.setDistanceToDown(distanceToDown1);
signetPlaceConfigOne.setHeightOfImage(heightOfImage1);
signetPlaceConfigOne.setWidthOfImage(widthOfImage1);
} else {
if (id1 != null) {
sqlSession.delete("com.itrus.portal.db.EvidenceSignetPlaceConfigMapper.deleteByPrimaryKey", id1);
}
}
if (type2 != null && type2 != 0) {
if (id2 != null) {
signetPlaceConfigTwo = signetPlaceConfigService.selectById(id2);
} else {
signetPlaceConfigTwo = new EvidenceSignetPlaceConfig();
}
signetPlaceConfigTwo.setType(type2);
signetPlaceConfigTwo.setKeyword(keyword2);
signetPlaceConfigTwo.setPage(page2);
signetPlaceConfigTwo.setDistanceToLeft(distanceToLeft2);
signetPlaceConfigTwo.setDistanceToDown(distanceToDown2);
signetPlaceConfigTwo.setHeightOfImage(heightOfImage2);
signetPlaceConfigTwo.setWidthOfImage(widthOfImage2);
} else {
if (id2 != null) {
sqlSession.delete("com.itrus.portal.db.EvidenceSignetPlaceConfigMapper.deleteByPrimaryKey", id2);
}
}
if (type3 != null && type3 != 0) {
if (id3 != null) {
signetPlaceConfigThree = signetPlaceConfigService.selectById(id3);
} else {
signetPlaceConfigThree = new EvidenceSignetPlaceConfig();
}
signetPlaceConfigThree.setType(type3);
signetPlaceConfigThree.setKeyword(keyword3);
signetPlaceConfigThree.setPage(page3);
signetPlaceConfigThree.setDistanceToLeft(distanceToLeft3);
signetPlaceConfigThree.setDistanceToDown(distanceToDown3);
signetPlaceConfigThree.setHeightOfImage(heightOfImage3);
signetPlaceConfigThree.setWidthOfImage(widthOfImage3);
} else {
if (id3 != null) {
sqlSession.delete("com.itrus.portal.db.EvidenceSignetPlaceConfigMapper.deleteByPrimaryKey", id3);
}
}
outServiceConfigService.updateOutServiceConfigeService(evidenceOutServiceConfig, appService, signetPlaceConfigOne, signetPlaceConfigTwo, signetPlaceConfigThree, getAdmin().getId());
String oper = "修改出证服务";
String info = "出证服务名称: " + appService.getAppServiceName();
LogUtil.evidencelog(sqlSession, null, oper, info);
return "redirect:outserviceconfig/" + evidenceOutServiceConfig.getId();
}
use of com.itrus.portal.db.EvidenceCertificate in project portal by ixinportal.
the class ServiceConfigurationController method create.
// 返回新建页面
@RequestMapping(params = "form", produces = "text/html")
public String create(@RequestParam(value = "id", required = false) Long id, Model uiModel) {
if (id == null) {
List<EvidenceCertificate> configuration = sqlSession.selectList("com.itrus.portal.db.EvidenceCertificateMapper.selectByExample");
// System.out.println(configuration.size());
uiModel.addAttribute("configuration", configuration);
return "serviceconfiguration/create";
}
try {
List<EvidenceCertificate> configuration = sqlSession.selectList("com.itrus.portal.db.EvidenceCertificateMapper.selectByExample");
uiModel.addAttribute("configuration", configuration);
EvidenceServiceConfiguration serviceconfig = sqlSession.selectOne("com.itrus.portal.db.EvidenceServiceConfigurationMapper.selectByPrimaryKey", id);
uiModel.addAttribute("serviceconfig", serviceconfig);
} catch (Exception e) {
e.printStackTrace();
}
// 通知其他机器,加载缓存
EvidenceCertificationChargingHandler cch = new EvidenceCertificationChargingHandler();
cch.setType(1);
QueueThread.buildCertificationTask(cch);
cacheCustomer.initEvidence(1);
return "serviceconfiguration/create";
}
use of com.itrus.portal.db.EvidenceCertificate in project portal by ixinportal.
the class CertificateServiceImpl method evidenceCertificateMapById.
public Map<Long, EvidenceCertificate> evidenceCertificateMapById() {
Map<Long, EvidenceCertificate> map = new HashMap<Long, EvidenceCertificate>();
List<EvidenceCertificate> evidenceCertificates = sqlSession.selectList("com.itrus.portal.db.EvidenceCertificateMapper.selectByExample", new EvidenceCertificateExample());
for (EvidenceCertificate certificate : evidenceCertificates) {
map.put(certificate.getId(), certificate);
}
return map;
}
Aggregations