private void doPrintSetting() { requestMeta.setFuncId(this.printSettingButton.getFuncId()); requestMeta.setPageType(this.getCompoId() + "_L"); new PrintSettingDialog(requestMeta); }
public ZcDingdian sendPayFN(ZcDingdian bill, RequestMeta requestMeta) throws Exception { bill = updateFN(bill, requestMeta); Map map = null; BudgetUtil bu = new BudgetUtil(); // 指标接口和支付接口分开,这样指标接口出错时则不掉用取消结冻指标操作 try { /* * 释放指标金额,本次支付金额10w,则应该修改采购计划金额=原采购计划金额-10w */ map = bu.getDingDianShiFangBudget(baseDao, true, bill); bu.callService(map, requestMeta.getSvNd()); Map rtn = new PayForZcUtil().PayByDingDian(bill, requestMeta); if (rtn == null) { // 目前没有处理,应该不会出现这种情况 // throw new RuntimeException(e1.getMessage()); } else { String rtnType = (String) rtn.get(PayForZcUtil.RTN_RESULT); String returnMsg = (String) rtn.get(PayForZcUtil.RTN_MESSAGE); if (rtnType.equalsIgnoreCase(PayForZcUtil.RTN_RESULT_FALSE)) { throw new RuntimeException("定点采购【" + bill.getDdCode() + "】生成支付出错:" + returnMsg); } else { // 保存支付凭证号与当前支付单的关联关系 String vouIds = (String) rtn.get(PayForZcUtil.RTN_DATA); _savePayVouId(vouIds, bill, requestMeta); } } } catch (ZcPayInterfaceException e) { try { bu.cancelCallService(map, requestMeta.getSvNd()); } catch (Exception e1) { String errorInfo = ""; errorInfo = "定点采购【" + bill.getDdCode() + "】生成支付出错时,取消结冻的指标出现异常\n"; List biLst = bill.getBiList(); for (int i = 0; i < biLst.size(); i++) { ZcDingdianBi bi = (ZcDingdianBi) biLst.get(i); errorInfo += "指标编号:" + bi.getZcBiNo() + " 金额:" + (bi.getZcBiJhuaSum() == null ? "" : bi.getZcBiJhuaSum().toString()) + "\n"; } System.err.println("异常信息如下:" + errorInfo); e1.printStackTrace(); throw new RuntimeException(e1.getMessage() + errorInfo); } e.printStackTrace(); throw new RuntimeException(e.getMessage()); } bill = auditFN(bill, requestMeta); // 支付指标 return bill; }
private void executeAudit(List beanList, int isGoonAudit, FuncButton button) { GkCommentDialog commentDialog = new GkCommentDialog( DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().getActiveWindow(), ModalityType.APPLICATION_MODAL); if (commentDialog.cancel) { return; } boolean success = true; String errorInfo = ""; try { String comment = commentDialog.getComment(); for (int i = 0; i < beanList.size(); i++) { ZcEbEvalReport report = (ZcEbEvalReport) beanList.get(i); report.setIsGoonAudit(isGoonAudit); report.setComment(comment); report.setAuditorId(WorkEnv.getInstance().getCurrUserId()); } requestMeta.setFuncId(button.getFuncId()); zcEbEvalServiceDelegate.updateZcEbEvalStatus(beanList, requestMeta); zcEbEvalServiceDelegate.auditFN(beanList, requestMeta); } catch (Exception e) { success = false; logger.error(e.getMessage(), e); errorInfo += e.getMessage(); } if (success) { refreshCurrentTabData(); JOptionPane.showMessageDialog(this, "审核成功!", "提示", JOptionPane.INFORMATION_MESSAGE); } else { JOptionPane.showMessageDialog(this, "审核失败 !" + errorInfo, "错误", JOptionPane.ERROR_MESSAGE); } }
private void doSuggestPass() { List ZcEbEvalReportList = getCheckedList(); if (ZcEbEvalReportList.size() == 0) { JOptionPane.showMessageDialog(this, "请选择需要送审的数据!", "提示", JOptionPane.INFORMATION_MESSAGE); return; } boolean success = true; try { GkCommentDialog commentDialog = new GkCommentDialog(this.getParentWindow(), ModalityType.APPLICATION_MODAL); if (commentDialog.cancel) { return; } String comment = commentDialog.getComment(); for (int i = 0; i < ZcEbEvalReportList.size(); i++) { ZcEbEvalReport zcEbEvalReport = (ZcEbEvalReport) ZcEbEvalReportList.get(i); zcEbEvalReport.setComment(comment); if (WorkEnv.getInstance().containRole(AsOptionMeta.getOptVal("OPT_ZC_CGZX_FZR_ROLE"))) { zcEbEvalReport.setIsGoonAudit(0); } } requestMeta.setFuncId(this.suggestPassButton.getFuncId()); zcEbEvalServiceDelegate.auditFN(ZcEbEvalReportList, requestMeta); } catch (BaseException ex) { success = false; UIUtilities.showStaickTraceDialog(ex, this, "错误", ex.getMessage()); } if (success) { JOptionPane.showMessageDialog(this, "处理成功!", "提示", JOptionPane.INFORMATION_MESSAGE); refreshCurrentTabData(); } }
@SuppressWarnings("unchecked") private void doPrint() { List printList = getCheckedList(); if (printList.size() == 0) { JOptionPane.showMessageDialog(this, "请选择需要打印的数据 !", "提示", JOptionPane.INFORMATION_MESSAGE); return; } requestMeta.setFuncId(this.printButton.getFuncId()); requestMeta.setPageType(getCompoId() + "_L"); boolean success = true; boolean printed = false; try { PrintObject printObject = this.baseDataServiceDelegate.genMainBillPrintObjectFN(printList, requestMeta); if (Printer.print(printObject)) { printed = true; } } catch (Exception e) { success = false; logger.error(e.getMessage(), e); JOptionPane.showMessageDialog( this, "打印出错!\n" + e.getMessage(), "错误", JOptionPane.ERROR_MESSAGE); } if (success && printed) {} }
@SuppressWarnings("unchecked") private void doPrintPreview() { final List printList = getCheckedList(); if (printList.size() == 0) { JOptionPane.showMessageDialog(this, "请选择需要打印预览的数据 !", "提示", JOptionPane.INFORMATION_MESSAGE); return; } requestMeta.setFuncId(this.printPreviewButton.getFuncId()); requestMeta.setPageType(getCompoId() + "_L"); try { PrintObject printObject = this.baseDataServiceDelegate.genMainBillPrintObjectFN(printList, requestMeta); PrintPreviewer previewer = new PrintPreviewer(printObject) { @Override protected void afterSuccessPrint() {} }; previewer.preview(); } catch (Exception e) { logger.error(e.getMessage(), e); JOptionPane.showMessageDialog( this, "打印预览出错!\n" + e.getMessage(), "错误", JOptionPane.ERROR_MESSAGE); } }
private void doCallBack() { String returnInfo = ""; boolean success = true; try { List beanList = getCheckedList(); if (beanList.size() == 0) { JOptionPane.showMessageDialog(this, "没有选择数据!", " 提示", JOptionPane.INFORMATION_MESSAGE); return; } requestMeta.setFuncId(callbackButton.getFuncId()); zcEbEvalServiceDelegate.callbackZcEbEvalReportFN(beanList, requestMeta); } catch (BusinessException be) { returnInfo = be.getMessage(); success = false; } catch (Exception ex) { returnInfo = ex.getMessage(); success = false; } if (success) { JOptionPane.showMessageDialog(this, "收回成功!", " 提示", JOptionPane.INFORMATION_MESSAGE); refreshCurrentTabData(); } else { JOptionPane.showMessageDialog(this, "收回失败 !\n" + returnInfo, "错误", JOptionPane.ERROR_MESSAGE); } }
private void _savePayVouId(String vouIds, ZcDingdian dd, RequestMeta requestMeta) { // TCJLODO Auto-generated method stub if (vouIds == null) return; baseDao.delete("ZC_PAY_GK_INFO.deleteByZcBillId", dd.getDdCode()); StringTokenizer st = new StringTokenizer(vouIds, PayForZcUtil.RTN_DATA_SPLIT); String interfaceType = AsOptionUtil.getInstance().getOptionVal(ZcPayGkInfo.GK_INTERFACE_TYPE); String vouType = interfaceType.equalsIgnoreCase("Y") ? ZcPayGkInfo.GK_VOU_TYPE_ZFPZ : ZcPayGkInfo.GK_VOU_TYPE_ZFSQ; while (st.hasMoreTokens()) { String vouId = st.nextToken(); ZcPayGkInfo info = new ZcPayGkInfo(); info.setZcBillType(ZcPayGkInfo.ZC_BILL_TYPE_DINGDIAN); info.setZcBillId(dd.getDdCode()); info.setGkVouId(vouId); info.setGkReturnFlag("N"); info.setSendGkDate(requestMeta.getSysDate()); info.setGkVouType(vouType); baseDao.insert("ZC_PAY_GK_INFO.insert", info); } }
public void doUnTread() { List ZcEbEvalReportList = getCheckedList(); if (ZcEbEvalReportList.size() == 0) { JOptionPane.showMessageDialog(this, "请选择需要退回的数据!", "提示", JOptionPane.INFORMATION_MESSAGE); return; } boolean success = true; try { requestMeta.setFuncId(unTreadButton.getFuncId()); GkCommentUntreadDialog commentDialog = new GkCommentUntreadDialog(this.getParentWindow(), ModalityType.APPLICATION_MODAL); if (commentDialog.cancel) { return; } String comment = commentDialog.getComment(); for (int i = 0; i < ZcEbEvalReportList.size(); i++) { ZcEbEvalReport zcEbEvalReport = (ZcEbEvalReport) ZcEbEvalReportList.get(i); zcEbEvalReport.setComment(comment); } zcEbEvalServiceDelegate.untreadFN(ZcEbEvalReportList, requestMeta); } catch (BaseException ex) { success = false; logger.error(ex.getStackTraceMessage(), ex); success = false; UIUtilities.showStaickTraceDialog(ex, this, "错误", ex.getMessage()); } catch (OtherException ex) { success = false; logger.error(ex.getStackTraceMessage(), ex); success = false; UIUtilities.showStaickTraceDialog(ex, this, "错误", ex.getMessage()); } catch (Exception ex) { success = false; logger.error(ex.getMessage(), ex); UIUtilities.showStaickTraceDialog(ex, this, "错误", ex.getMessage()); } if (success) { JOptionPane.showMessageDialog(this, "处理成功!", "提示", JOptionPane.INFORMATION_MESSAGE); refreshCurrentTabData(); } }
private void initWorkEnv(Object f, Method method) { try { if (oldTorken != null && oldTorken.equals(getValue(method, f, "token"))) { isReLoad = false; return; } // System.out.println("workEnv.initWorkEnv object f class name=" + // f.getClass().getName()); WorkEnv workEnv = WorkEnv.getInstance(); workEnv.setToken((String) getValue(method, f, "token")); oldTorken = workEnv.getToken(); workEnv.setClientIP((String) getValue(method, f, "clientIP")); workEnv.setTransDate((String) getValue(method, f, "transDate")); workEnv.setRoot((String) getValue(method, f, "root")); workEnv.setWebRoot((String) getValue(method, f, "webRoot")); workEnv.setOrgCode((String) getValue(method, f, "orgCode")); workEnv.setOrgName((String) getValue(method, f, "orgName")); workEnv.setRoleId((String) getValue(method, f, "roleId")); workEnv.setEmpCode((String) getValue(method, f, "empCode")); workEnv.setEmpName((String) getValue(method, f, "empName")); workEnv.setExpertCode((String) getValue(method, f, "empCode")); workEnv.setExpertName((String) getValue(method, f, "empName")); workEnv.setOrgCode((String) getValue(method, f, "orgCode")); workEnv.setOrgPoCode((String) getValue(method, f, "orgPoCode")); // System.out.println("workEnv.setOrgPoCode 1" + workEnv.getOrgPoCode()); workEnv.setPoCode((String) getValue(method, f, "poCode")); workEnv.setExpertCode((String) getValue(method, f, "expertCode")); workEnv.setExpertName((String) getValue(method, f, "expertName")); workEnv.setUrlMap(changeStrToMap((String) getValue(method, f, "urlArray"))); workEnv.setAccountId((String) getValue(method, f, "accountId")); // workEnv.setCompoId((String) getValue(method, f, "compoId")); workEnv.setApplet((Applet) f); // ClassLoader oldLoader = Thread.currentThread().getContextClassLoader(); // Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); /*IBaseDataServiceDelegate baseDataServiceDelegate = (IBaseDataServiceDelegate) ServiceFactory.create(IBaseDataServiceDelegate.class, "baseDataServiceDelegate"); RequestMeta meta = WorkEnv.getInstance().getRequestMeta(); meta.setSvUserID((String) getValue(method, f, "userId")); User user = baseDataServiceDelegate.getUserById((String) getValue(method, f, "userId"), meta); workEnv.setCurrUser(user); Company company = baseDataServiceDelegate.getCompanyByCoCode(workEnv.getTransNd(), (String) getValue(method, f, "coCode"), meta); workEnv.setCurrCompany(company); meta.setSvCoCode(workEnv.getCurrCoCode()); meta.setSvCoName(workEnv.getCurrCompany() == null ? null : workEnv.getCurrCompany().getName()); java.util.Date sysDate = baseDataServiceDelegate.getSysDate(meta); workEnv.setSysDate(sysDate); IConsoleServiceDelegate consoleServiceDelegate = (IConsoleServiceDelegate) ServiceFactory.create(IConsoleServiceDelegate.class, "consoleServiceDelegate"); List<AsRole> roles = consoleServiceDelegate.getAsRoleByPosi(workEnv.getPoCode(), meta); workEnv.setRoles(roles); // List empLst = zcbaseDataServiceDelegate.queryDataForList("AsEmp.getAsEmp", null, meta); // // EmpMeta.setEmpLst(empLst); if (workEnv.getOrgPoCode() == null || workEnv.getOrgPoCode().trim().equals("")) { workEnv.setOrgPoCode(getOrgPoCode(baseDataServiceDelegate, meta.getSvCoCode(), meta.getSvOrgCode(), meta.getSvPoCode(), workEnv.getTransNd(), meta)); }*/ IZcEbBaseServiceDelegate zcbaseDataServiceDelegate = (IZcEbBaseServiceDelegate) ServiceFactory.create(IZcEbBaseServiceDelegate.class, "zcEbBaseServiceDelegate"); RequestMeta meta = WorkEnv.getInstance().getRequestMeta(); meta.setSvUserID((String) getValue(method, f, "userId")); ElementConditionDto dto = new ElementConditionDto(); dto.setUserId((String) getValue(method, f, "userId")); dto.setCoCode((String) getValue(method, f, "coCode")); dto.setNd(workEnv.getTransNd()); dto.setPosiCode(workEnv.getPoCode()); dto.setOrgCode((String) getValue(method, f, "orgCode")); Map initMap = zcbaseDataServiceDelegate.initWorkEnv(dto, meta); User user = (User) initMap.get("user"); workEnv.setCurrUser(user); meta.setSvUserID(user.getUserId()); Company company = (Company) initMap.get("company"); workEnv.setCurrCompany(company); meta.setSvCoCode(workEnv.getCurrCoCode()); meta.setSvCoName( workEnv.getCurrCompany() == null ? null : workEnv.getCurrCompany().getName()); Date sysDate = (Date) initMap.get("sysDate"); workEnv.setSysDate(sysDate); List roles = (List) initMap.get("roles"); workEnv.setRoles(roles); String orgPoCode = (String) initMap.get("orgPoCode"); workEnv.setOrgPoCode(orgPoCode); } catch (Exception ex) { ex.printStackTrace(); } }
/** 构造函数 */ public ZcEbEvalReportOffLineListPanel() { init(); requestMeta.setCompoId(getCompoId()); }
package com.ufgov.zc.server.zc.service.impl;
private ZcDingdian _updateFN(ZcDingdian bill, RequestMeta requestMeta, boolean isImportData) throws Exception { // System.out.println("before service 2="+bill.getCoCode()+bill.getCoName()); String code = ""; String temp_code = ""; List biList = bill.getBiList(); String userId = requestMeta.getSvUserID(); String compoId = requestMeta.getCompoId(); boolean isDraft = false; if (bill.getProcessInstId() == null || bill.getProcessInstId().longValue() == -1) { Long draftid = workflowDao.createDraftId(); bill.setProcessInstId(draftid); isDraft = true; } Map map = null; if ("".equals(ZcSUtil.safeString(bill.getDdCode())) || bill.getDdCode().equals("自动编号")) { // 当新建项目的时候,项目编码不进行正式编码,首先创建一个临时编码,等提交送审之后,进行正式编码 temp_code = NumUtil.getInstance().getNo("ZC_DINGDIAN", "DD_CODE", bill); code = temp_code; bill.setDdCode(code); map = new BudgetUtil() .getSaveBudgetByZcDingDian(ddBiDao, baseDao, ZcSUtil.isUseBi(), bill, biList); // System.out.println("before service 3="+bill.getCoCode()+bill.getCoName()); BigDecimal biSum = new BigDecimal(0); for (int i = 0; i < biList.size(); i++) { ZcDingdianBi bi = (ZcDingdianBi) biList.get(i); bi.setDdCode(code); if (bi.getZcBiNo() != null && bi.getZcBiNo().trim().length() > 0) { biSum = biSum.add(bi.getZcBiJhuaSum()); } } bill.setBiSum(biSum); for (int i = 0; i < bill.getItemList().size(); i++) { ZcDingdianItem item = (ZcDingdianItem) bill.getItemList().get(i); item.setDdCode(code); } // System.out.println("before service 4="+bill.getCoCode()+bill.getCoName()); ddDao.insert(bill); // System.out.println("before service 5="+bill.getCoCode()+bill.getCoName()); ddBiDao.insertList(biList); ddItemDao.insertList(bill.getItemList()); // System.out.println("before service 6="+bill.getCoCode()+bill.getCoName()); } else { code = bill.getDdCode(); BigDecimal biSum = new BigDecimal(0); for (int i = 0; i < biList.size(); i++) { ZcDingdianBi bi = (ZcDingdianBi) biList.get(i); bi.setDdCode(code); if (bi.getZcBiNo() != null && bi.getZcBiNo().trim().length() > 0) { biSum = biSum.add(bi.getZcBiJhuaSum()); } } bill.setBiSum(biSum); // 使用删除、插入,是考虑导入数据时,code已经有了,直接update没有用,所以采用删、插的模式 ddDao.deleteByPrimaryKey(bill.getDdCode()); // System.out.println("update before="+bill.getCoCode()+bill.getCoName()); ddDao.insert(bill); // System.out.println("666="+bill.getCoCode()+bill.getCoName()); map = new BudgetUtil() .getSaveBudgetByZcDingDian(ddBiDao, baseDao, ZcSUtil.isUseBi(), bill, biList); ddBiDao.deleteBiByDdCode(bill.getDdCode()); ddItemDao.deleteItemByDdCode(bill.getDdCode()); for (int i = 0; i < biList.size(); i++) { ZcDingdianBi mbi = (ZcDingdianBi) biList.get(i); mbi.setDdCode(code); } ddBiDao.insertList(biList); for (int i = 0; i < bill.getItemList().size(); i++) { ZcDingdianItem item = (ZcDingdianItem) bill.getItemList().get(i); item.setDdCode(code); } ddItemDao.insertList(bill.getItemList()); } if (isDraft) { AsWfDraft asWfDraft = new AsWfDraft(); asWfDraft.setCompoId(compoId); asWfDraft.setWfDraftName(bill.getDdCode()); asWfDraft.setUserId(userId); asWfDraft.setMasterTabId(compoId); asWfDraft.setWfDraftId(BigDecimal.valueOf(bill.getProcessInstId().longValue())); workflowDao.insertAsWfdraft(asWfDraft); } // 不是导入的数据,且使用指标接口 if (!isImportData) { // new BudgetUtil().callService(map, requestMeta.getSvNd()); } // System.out.println("return before="+bill.getCoCode()+bill.getCoName()); return bill; }
package com.ufgov.zc.client.zc.zcebxy;
package com.ufgov.zc.server.system.util;
package com.ufgov.zc.client.zc.expertevaluate;
package com.ufgov.zc.client.zc.auditsheet;