@Override public void updateTemplate(CpGzTemplateVO templateVo) throws TplBusinessException { BaseDAO dao = new BaseDAO(); try { dao.updateVO(templateVo); } catch (DAOException e) { LfwLogger.error(e); throw new TplBusinessException(e.getMessage(), e); } }
// ---------------------- public String sdbSyn() throws LfwBusinessException { WebContext ctx = getWebContext(); String pk_xy_step_pub = ctx.getParameter("pk_xy_step_pub"); String pk_xy_proj_main = ctx.getParameter("pk_xy_proj_main"); String success = "ok"; String operatorID = LfwRuntimeEnvironment.getUserVO().getPrimaryKey(); BaseDAO dao = new BaseDAO(); try { String sqlb = "select * from ebs_xy_projexec_personjzx where ( discard_status != '3' or discard_status is null ) and zdy3 ='" + pk_xy_step_pub + "' and pk_person in " + "(select pk_psndoc from bd_psndoc where pk_psnbasdoc in " + "(select pk_psndoc from sm_userandclerk where userid = '" + operatorID + "'))"; List<ProjGroupVO> listb = (List<ProjGroupVO>) dao.executeQuery(sqlb, new BeanListProcessor(ProjGroupVO.class)); if (listb != null && listb.size() > 0) { ProjGroupVO pcg = listb.get(0); String judgment = pcg.getZdy1(); if ("是".equals(judgment)) { success = "N"; } else { pcg.setZdy1("是"); dao.updateVO(pcg, new String[] {"zdy1"}); } } else { success = "你不属于采购小组人员或者采购小组人员变化了,请重新打开采购执行界面!"; } } catch (Exception e) { Logger.error("签到失败"); Logger.error(e.getMessage(), e); success = "签到失败"; } return success; }
@Override protected NCObject[] doBillLoad(IBusinessEntity entity) throws BusinessException { // 采购方案主键 // 这里需要从其他地方来获取现在使用默认值,当业务真正的串联时需要统一获取 String pk_proj_main = this.getWebContext().getParameter("projectPk"); // 采购方案模板环节执行主键ID String pk_xy_step_exec_state = this.getWebContext().getParameter("stepId"); // 点击开启来源 String open_source = this.getWebContext().getParameter("open_source"); // 发布环节PK String pubPk = this.getWebContext().getParameter("pubPk"); BaseDAO dao = new BaseDAO(); try { // 获取采购小组人员信息 String sql = "select * from ebs_xy_projexec_person where pk_xy_proj_main ='" + pk_proj_main + "' "; List<ProjPersonCGVO> ppj = (List<ProjPersonCGVO>) dao.executeQuery(sql, new BeanListProcessor(ProjPersonCGVO.class)); if (ppj != null || ppj.size() > 0) { for (ProjPersonCGVO cvo : ppj) { // 每轮的采购小组数据 zdy3是发布主键 zdy5是采购小组信息每条数据的主键 String sqljzx = "select * from ebs_xy_projexec_personjzx where zdy3 = '" + pubPk + "' and zdy5= '" + cvo.getPk_xy_proj_person() + "'"; List<ProjGroupVO> ppjjzx = (List<ProjGroupVO>) dao.executeQuery(sqljzx, new BeanListProcessor(ProjGroupVO.class)); if (ppjjzx != null && ppjjzx.size() > 0) { ProjGroupVO jzx = ppjjzx.get(0); jzx.setDiscard_status(cvo.getDiscard_status()); jzx.setTicketnum(cvo.getTicketnum()); jzx.setWeight(cvo.getWeight()); jzx.setPk_corp(cvo.getPk_corp()); jzx.setPk_dept(cvo.getPk_dept()); jzx.setPk_person(cvo.getPk_person()); dao.updateVO( jzx, new String[] { "discard_status", "ticketnum", "weight", "pk_corp", "pk_dept", "pk_person" }); } else { ProjGroupVO pg = new ProjGroupVO(); pg.setDiscard_status(cvo.getDiscard_status()); pg.setPk_xy_proj_main(pk_proj_main); // pg.setPk_xy_proj_person(cvo.getPk_xy_proj_person()); pg.setPk_corp(cvo.getPk_corp()); pg.setPk_dept(cvo.getPk_dept()); pg.setPk_person(cvo.getPk_person()); pg.setZdy3(pubPk); pg.setTicketnum(cvo.getTicketnum()); pg.setWeight(cvo.getWeight()); pg.setZdy5(cvo.getPk_xy_proj_person()); dao.insertVO(pg); } } } } catch (Exception e) { Logger.error(e.getMessage(), e); } NCObject ncObj = ((OpenDelegator) this.billHandler) .doQueryOpenVOSByPK(pk_proj_main, pk_xy_step_exec_state, open_source, pubPk); NCObject[] s = null; if (pk_proj_main != null && pk_proj_main.length() > 0) { s = new NCObject[1]; s[0] = ncObj; } else { s = super.doBillLoad(entity); } return s; }
// 季凌峰 2012/12/25 附件解密 public String loupadate( String opensource, String pk_xy_proj_main, String pk_xy_pub_step, String price_type) { String keyValue = null; // 附件解密方法 Properties props = new Properties(); // 文件存放的路径。评标会解密的附件压缩 String ebsfile = ""; BaseDAO dao = new BaseDAO(); InputStream is = null; try { // 读取应用下的配置文件 String path = RuntimeEnv.getInstance().getNCHome() + File.separatorChar + "hotwebs" + File.separatorChar + "ebscg" + File.separatorChar + "WEB-INF" + File.separatorChar + "conf" + File.separatorChar + "system.properties"; is = new FileInputStream(path); props.load(is); keyValue = props.getProperty(EbsOperaitonConst.CHECK_KEY); } catch (Exception e) { Logger.error("读取系统配置错误!", e); try { if (is != null) is.close(); } catch (Exception et) { Logger.error("读取系统配置错误!", et); } } finally { try { if (is != null) is.close(); } catch (IOException e) { Logger.error("读取系统配置错误!", e); } } // 如果为1的时候则对文件解密 if (keyValue != null) { // 因为没有从js获取,没有打开界面调用数据,所以参数需要自己定义和获取。 String openvalue = "2"; // 模块类型 model_type 7门户上传附件 String modelType = "7"; // 来源单据类型 bill_type //发标应答 E059 发布应答 E05A String billType = "E059"; // 发标应答 E059 if (opensource != null && opensource.equals("0")) { billType = "E05A"; // 发布应答 E05A } // 所属单据ID bill_id 采购方案主键 String billId = pk_xy_proj_main; // 所属单据明细ID itemid 供应商确定主键 try { String sql = "select * from ebs_xy_proj_item_sup_cfm where pk_xy_proj_main = '" + pk_xy_proj_main + "' and isnull(dr,0) = 0 "; List<ProjItemSupCfmVO> sp = (List<ProjItemSupCfmVO>) dao.executeQuery(sql, new BeanListProcessor(ProjItemSupCfmVO.class)); if (sp != null && sp.size() > 0) { for (ProjItemSupCfmVO sup : sp) { // 获取每次供应商的附件 // 修改下面的方法,主要是为了取得对应的附件类型。 String sqls = "select * from ebs_da_att where model_type='" + modelType + "' and bill_type= '" + billType + "' and bill_id='" + billId + "' and itemid='" + sup.getPk_xy_proj_item_sup_cfm() + "' and zdy3='" + pk_xy_pub_step + "' and price_type in (" + price_type + ") and ISNULL(dr,0) = 0 "; List<AttVO> list = (List<AttVO>) dao.executeQuery(sqls, new BeanListProcessor(AttVO.class)); // List<AttVO> list = getOpenQueryService().getCaFileByPara(modelType, billType, billId, // sup.getPk_xy_proj_item_sup_cfm()); EbscgFileUploadHandler fileHandler = (EbscgFileUploadHandler) LfwClassUtil.newInstance(EbscgFileUploadHandler.class.getName()); if (list != null && list.size() > 0) { SignVO signvo = null; byte[] baOutPlaintext = null; for (AttVO attvo : list) { if (attvo != null && attvo.getAfter_ca() != null && attvo.getAfter_ca() == 1) { continue; } try { // 采用数据库读取文件数据 DataFileFactory dff = DataFileFactory.getInstance(); IDataBaseFileOper ibfo = dff.getFileDealServer(); byte[] content = null; content = ibfo.obtainFileMess(attvo.getPk_da_att(), "ca_content"); EncrypteDecrypte3DES des = new EncrypteDecrypte3DES(); BASE64Decoder base64 = new BASE64Decoder(); des.setKey(base64.decodeBuffer(keyValue)); des.setIv(base64.decodeBuffer("zz7cZtYpVR4=")); baOutPlaintext = des.decrypt(base64.decodeBuffer(new String(content).trim())); ibfo.updateFileMess(attvo.getPk_da_att(), baOutPlaintext, "content"); attvo.setAfter_ca(1); // 设置文档解密状态 dao.updateVO(attvo, new String[] {"after_ca"}); } catch (Exception ex) { // TODO Auto-generated catch block logger.error(ex.getMessage(), ex); return "文件解密失败"; /*throw new LfwRuntimeException("文件解密失败");*/ } } } } } } catch (Exception e) { logger.error(e.getMessage(), e); return "文件解密失败"; /*throw new LfwRuntimeException("文件解密失败");*/ } } return "ok"; }