use of com.itrus.portal.db.MakeSealServer in project portal by ixinportal.
the class MakeSealServerServiceImpl method delete.
/**
* 删除签章服务
*
* @param id
* @param needAdminLog
* 是否添加管理员日志
* @throws java.lang.Exception
*/
public void delete(Long id, boolean needAdminLog) throws Exception {
// 判断是否有和产品关联
MakeSealServer makeSealServer = selectMakeSealServer(id);
if (null == makeSealServer) {
throw new Exception("该签章服务不存在");
}
if (null != getProduct(id) && !getProduct(id).isEmpty()) {
throw new Exception("删除的签章服务存在关联,无法删除");
}
// 删除
sqlSession.delete("com.itrus.portal.db.MakeSealServerMapper.deleteByPrimaryKey", id);
if (needAdminLog) {
String oper = "删除签章服务";
String info = "签章服务名称: " + makeSealServer.getName();
LogUtil.adminlog(sqlSession, oper, info);
}
}
use of com.itrus.portal.db.MakeSealServer 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.MakeSealServer 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