use of com.itrus.portal.db.MakeSealConfig in project portal by ixinportal.
the class MakeSealConfigController method show.
// 显示详情
@RequestMapping(value = "/{id}", produces = "text/html")
public String show(@PathVariable("id") Long id, Model uiModel) throws Exception {
MakeSealConfig makeSealConfig = sqlSession.selectOne("com.itrus.portal.db.MakeSealConfigMapper.selectByPrimaryKey", id);
uiModel.addAttribute("makesealconfig", makeSealConfig);
return "makesealconfig/show";
}
use of com.itrus.portal.db.MakeSealConfig in project portal by ixinportal.
the class BillWebController method reNewCertConfirm.
// 订单详情,待更新确认
@RequestMapping(value = "/reNewCertConfirm/{id}", produces = "text/html")
public String reNewCertConfirm(@PathVariable("id") Long id, HttpServletRequest request, Model uiModel) {
HttpSession session = request.getSession();
UserInfo userInfo = (UserInfo) session.getAttribute("webuserInfo");
Enterprise enterprise = (Enterprise) session.getAttribute("webenterprise");
if (null == userInfo || null == enterprise) {
return "redirect:/userInfoWeb/denglu.html";
}
// 审核记录
ReviewLog reviewLog = reviewLogService.getReviewLog(id);
if (reviewLog != null) {
uiModel.addAttribute("reviewLog", reviewLog);
}
Map param = new HashMap();
// 设置查询条件,选择属于当前用户,当前企业的订单
param.put("id", id);
// param.put("userinfoid", userInfo.getId());
// param.put("enterpriseid", enterprise.getId());
List<Map> billAll = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectProductBillCertById", param);
log.error("--------获取订单数量-------" + billAll.size() + "*****获取订单信息***" + billAll);
log.error("------获取订单id--------" + billAll.get(0).get("id"));
log.error("========获取订单编号=========" + billAll.get(0).get("bill_id"));
if (0 == billAll.size()) {
return "redirect:/userInfoWeb/denglu.html";
}
uiModel.addAttribute("bills", billAll.get(0));
// 获取数字证书
Product product = productService.getProduct((Long) billAll.get(0).get("product"));
log.error("****获取产品id*****" + product.getId());
DigitalCert digitalCert = digitalCertService.getDigitalCert(product.getCert());
// 获取订单在线支付方式
if (billAll.get(0).get("on_pay_info") != null) {
Map<Long, OnPayInfo> opiMap = sqlSession.selectMap("com.itrus.portal.db.OnPayInfoMapper.selectByExample", "id");
uiModel.addAttribute("opiMap", opiMap);
Map<Long, OnlinePay> opMap = sqlSession.selectMap("com.itrus.portal.db.OnlinePayMapper.selectByExample", "id");
uiModel.addAttribute("opMap", opMap);
}
PayInfoExample payInfoex = new PayInfoExample();
Map<Long, PayInfo> payinfoMap = sqlSession.selectMap("com.itrus.portal.db.PayInfoMapper.selectByExample", payInfoex, "id");
uiModel.addAttribute("payinfomap", payinfoMap);
// 获取产品规格
ProductSpec productSpec = null;
if (null != billAll.get(0).get("product_spec") && !"0".equals(billAll.get(0).get("product_spec"))) {
productSpec = productSpecService.getProductSpec((Long) billAll.get(0).get("product_spec"));
}
uiModel.addAttribute("productSpec", productSpec);
uiModel.addAttribute("digitalCert", digitalCert);
// 返回订单对应的老证书的base64
CertBuf certBuf = sqlSession.selectOne("com.itrus.portal.db.CertBufMapper.selectCertBufByBillId", id);
if (null != certBuf) {
uiModel.addAttribute("oldCertB64", certBuf.getCertBuf().replaceAll("\n", ""));
}
log.error("*********签章服务******" + product.getMakeSealServer());
// 判断是否有签章服务,有则显示授权
if (null != product.getMakeSealServer()) {
uiModel.addAttribute("makesealserver", product.getMakeSealServer());
uiModel.addAttribute("billId", billAll.get(0).get("id"));
// 签章服务配置
List<MakeSealConfig> makeSealConfigs = sqlSession.selectList("com.itrus.portal.db.MakeSealConfigMapper.selectByExample");
if (!makeSealConfigs.isEmpty()) {
MakeSealConfig makeSealConfig = makeSealConfigs.get(0);
try {
makeSealConfig.setAddressKey(AESencrp.decrypt(makeSealConfig.getAddressKey(), dbEncKey));
} catch (EncDecException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
uiModel.addAttribute("makeSealConfig", makeSealConfig);
}
}
return "ixinweb/dingdanxiangqing_gengxinqueren";
}
use of com.itrus.portal.db.MakeSealConfig in project portal by ixinportal.
the class MakeCertController method makeSeal.
/**
* 获取签章模版
*
* @param billId
* @return
* @throws Exception
* @throws EncDecException
*/
@RequestMapping(value = "/makeSeal", method = RequestMethod.POST)
@ResponseBody
public Map<String, Object> makeSeal(@RequestParam(value = "billId", required = true) Long billId, @RequestParam(value = "productId", required = false) Long productId, HttpServletRequest request, HttpServletResponse response) throws EncDecException, Exception {
Map<String, Object> map = new HashMap<String, Object>();
map.put("retCode", 0);
// 获取签章模版
Bill bill = sqlSession.selectOne("com.itrus.portal.db.BillMapper.selectByPrimaryKey", billId);
// 查询项目产品
Product product = null;
// 如为组合产品productId不为空
if (null == productId) {
product = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByPrimaryKey", bill.getProduct());
} else {
product = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByPrimaryKey", productId);
}
if (null == product.getMakeSealServer() || product.getMakeSealServer() <= 0) {
map.put("retMsg", "该产品未配置签章服务");
return map;
}
MakeSealServer makeSealServer = sqlSession.selectOne("com.itrus.portal.db.MakeSealServerMapper.selectByPrimaryKey", product.getMakeSealServer());
// 签章服务配置
List<MakeSealConfig> makeSealConfigs = sqlSession.selectList("com.itrus.portal.db.MakeSealConfigMapper.selectByExample");
if (makeSealConfigs.isEmpty()) {
map.put("retMsg", "没有找到签章服务配置");
return map;
}
/**
* 增加百润和以前的点聚
*/
if (makeSealServer.getFirm().contains("点聚")) {
// 新加if
if (makeSealConfigs.get(0).getName().equals(makeSealServer.getFirm())) {
MakeSealConfig makeSealConfig = makeSealConfigs.get(0);
makeSealConfig.setAddressKey(AESencrp.decrypt(makeSealConfig.getAddressKey(), dbEncKey));
map.put("retCode", 1);
map.put("makeSealConfig", makeSealConfig);
// 替换-印章名称
if (StringUtils.isNotBlank(makeSealServer.getSealName())) {
UIDInfoUtils uidutils = new UIDInfoUtils();
uidutils.initService(businessService, orgCodeService, taxCertService, identityCardService, userInfoService, enterpriseService);
makeSealServer.setSealName(uidutils.getUidInfo(billId, makeSealServer.getSealName()));
}
} else {
MakeSealConfig makeSealConfig = makeSealConfigs.get(1);
makeSealConfig.setAddressKey(AESencrp.decrypt(makeSealConfig.getAddressKey(), dbEncKey));
map.put("retCode", 1);
map.put("makeSealConfig", makeSealConfig);
// 替换-印章名称
if (StringUtils.isNotBlank(makeSealServer.getSealName())) {
UIDInfoUtils uidutils = new UIDInfoUtils();
uidutils.initService(businessService, orgCodeService, taxCertService, identityCardService, userInfoService, enterpriseService);
makeSealServer.setSealName(uidutils.getUidInfo(billId, makeSealServer.getSealName()));
}
}
}
// 新加百润
if (makeSealServer.getFirm().contains("百润")) {
// 第一条是点聚,第二条是百润
if (makeSealConfigs.get(0).getName().equals(makeSealServer.getFirm())) {
MakeSealConfig makeSealConfig = makeSealConfigs.get(0);
makeSealConfig.setAddressKey(AESencrp.decrypt(makeSealConfig.getAddressKey(), dbEncKey));
map.put("retCode", 1);
map.put("makeSealConfig", makeSealConfig);
// 替换-印章名称
if (StringUtils.isNotBlank(makeSealServer.getSealName())) {
UIDInfoUtils uidutils = new UIDInfoUtils();
uidutils.initService(businessService, orgCodeService, taxCertService, identityCardService, userInfoService, enterpriseService);
makeSealServer.setSealName(uidutils.getUidInfo(billId, makeSealServer.getSealName()));
}
} else {
MakeSealConfig makeSealConfig = makeSealConfigs.get(1);
makeSealConfig.setAddressKey(AESencrp.decrypt(makeSealConfig.getAddressKey(), dbEncKey));
map.put("retCode", 1);
map.put("makeSealConfig", makeSealConfig);
// 替换-印章名称
if (StringUtils.isNotBlank(makeSealServer.getSealName())) {
UIDInfoUtils uidutils = new UIDInfoUtils();
uidutils.initService(businessService, orgCodeService, taxCertService, identityCardService, userInfoService, enterpriseService);
makeSealServer.setSealName(uidutils.getUidInfo(billId, makeSealServer.getSealName()));
}
}
}
map.put("makeSealServer", makeSealServer);
return map;
}
use of com.itrus.portal.db.MakeSealConfig in project portal by ixinportal.
the class MakeSealConfigController method updateForm.
// 返回修改页面
@RequestMapping(value = "/{id}", params = "form", produces = "text/html")
public String updateForm(@PathVariable("id") Long id, Model uiModel) throws Exception {
MakeSealConfig makeSealConfig = sqlSession.selectOne("com.itrus.portal.db.MakeSealConfigMapper.selectByPrimaryKey", id);
uiModel.addAttribute("makesealconfig", makeSealConfig);
return "makesealconfig/update";
}
use of com.itrus.portal.db.MakeSealConfig in project portal by ixinportal.
the class MakeSealServerController method updateForm.
// 修改页面
@RequestMapping(value = "/{id}", params = "form", produces = "text/html")
public String updateForm(@PathVariable("id") Long id, Model uiModel) {
MakeSealServer makeSealServer = makeSealServerService.selectMakeSealServer(id);
uiModel.addAttribute("makeSealServer", makeSealServer);
List<MakeSealConfig> makeSealConfigs = new ArrayList<MakeSealConfig>();
makeSealConfigs = sqlSession.selectList("com.itrus.portal.db.MakeSealConfigMapper.selectByExample", null);
uiModel.addAttribute("makeSealConfigs", makeSealConfigs);
// if(makeSealServer.getFirm().contains("点聚")){
return "makesealserver/update";
/*}else{
return "makesealserver/update2";
}*/
}
Aggregations