9、NC自定义弹窗(参照,日期,文本。。。界面显示)

**

9、NC自定义弹窗(参照,日期,文本。。。界面显示)

**
package nc.ui.hfet.hfet_fininvoiceandorg.ace.action2;

import hf.nc.ws.pu.vo.selectvo;

import java.awt.Color;
import java.awt.Component;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Set;

import javax.swing.JSpinner;
import javax.swing.SpinnerDateModel;
import javax.swing.border.MatteBorder;

import nc.bs.framework.common.NCLocator;
import nc.itf.hfdm.IHfdm_dormdocMaintain;
import nc.itf.uap.IUAPQueryBS;
import nc.jdbc.framework.processor.BeanProcessor;
import nc.ui.pub.beans.UIDialog;
import nc.ui.pub.bill.BillListPanel;
import nc.vo.bd.defdoc.DefdocVO;
import nc.vo.hfet.hfet_declearinfomt.Hfet_declearzg_dt1;
import nc.vo.hfet.hfet_fininvoiceandorg.AggHfet_fininvoiceandorg;
import nc.vo.hfet.hfet_fininvoiceandorg.Hfet_fininvoiceandorg;
import nc.vo.hfet.hfet_xbkhdz.Hfet_xbkhdz;
import nc.vo.pub.lang.UFBoolean;
import nc.vo.pub.lang.UFDate;

public class bgSendDialog extends UIDialog implements ActionListener {
private nc.ui.pub.beans.UIButton UIButtonComm = null;// 按钮
private nc.ui.pub.beans.UIButton UIButtonCanel = null;
private javax.swing.JPanel mainPanel = null;// 主pane
private nc.ui.pub.beans.UILabel UILabel1 = null;// 标签
private nc.ui.pub.beans.UILabel UILabel2 = null;
private nc.ui.pub.beans.UILabel UILabel3 = null;
private nc.ui.pub.beans.UILabel UILabel4 = null;
private nc.ui.pub.beans.UILabel UILabel5 = null;
private nc.ui.pub.beans.UILabel UILabel6 = null;
private nc.ui.pub.beans.UILabel UILabel7 = null;
private nc.ui.pub.beans.UILabel UILabel8 = null;
private nc.ui.pub.beans.UILabel UILabel9 = null;
private nc.ui.pub.beans.UILabel UILabel10 = null;// 标签
private nc.ui.pub.beans.UIComboBox ComboBoxto1 = null;// 下拉
private nc.ui.pub.beans.UIComboBox ComboBoxto2 = null;// 下拉
private nc.ui.pub.beans.UITextField tField = null;//文本框
private nc.ui.pub.beans.UITextField tField1 = null;//文本框
private nc.ui.pub.beans.UIRadioButton UIRadioButton = null;
private nc.ui.pub.beans.UIRadioButton UIRadioButton1 = null;
private nc.ui.pub.beans.CalendarFormatter CalendarFormatter = null;
private String value = null;// 使用value变量来告诉外界是点击什么按钮
private nc.ui.pub.beans.UICheckBox UICheckBox=null;
private nc.ui.pub.beans.UICheckBox UICheckBox1=null;
private nc.ui.pub.beans.UICheckBox UICheckBox2=null;
private nc.ui.pub.beans.UICheckBox UICheckBox3=null;
private nc.ui.pub.beans.UICheckBox UICheckBox4=null;
private nc.ui.pub.beans.UIFileChooser UIFileChooser = null;
private nc.ui.pub.beans.UIRefPane UIRefPane;
private nc.ui.pub.beans.UIRefPane UIRefPane1;
private nc.ui.pub.beans.UIRefPane UIRefPane2;
private nc.ui.pub.beans.UIRefPane UIRefPane3;
private nc.ui.pub.beans.UIRefPane UIRefPane4;
private JSpinner year = null;
private JSpinner year2 = null;
private BillListPanel listPanel;
private Object[] aggvo = null;
private List data = null;
private static List<AggHfet_fininvoiceandorg> AggHfet_fininvoiceandorgs = new ArrayList<AggHfet_fininvoiceandorg>();
private static List<AggHfet_fininvoiceandorg> AggHfet_fininvoiceandorgs1 = new ArrayList<AggHfet_fininvoiceandorg>();
private static String returnValue = null;

// private nc.ui.pub.beans.UI TimeShortCutInputUtil = null;

@SuppressWarnings("deprecation")
public bgSendDialog(Object[] aggvo,List data) {
	
	super();
	initialize();
	this.aggvo = aggvo;
	this.data = data;
}

// 初始话
private void initialize() {
	setName("SendDialog");
	this.setTitle("信保融资处理信息修改");// 设置标题
	setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);// 关闭就退出
	setSize(310, 400);// 大小
	setContentPane(getUIDialogContentPane());// 主panne
	getUIButtonComm().addActionListener(this);// 两个按钮添加监听
	getUIButtonCanel().addActionListener(this);//
}
/**
 * 初始化数据面板
 * @return
 */
public BillListPanel getBillListPanel() {
	if (listPanel == null) {
		listPanel = new BillListPanel();
		listPanel.setName("BillListPanel_Center");
		//listPanel.loadTemplet("1001ZZ100000002KTKC1");// 正式  1001ZZ100000002KMNW5
		listPanel.setBounds(30, 150, 180,150);
		listPanel.getBodyTable().setSortEnabled(false);
		listPanel.setMultiSelect(false);
	    listPanel.setEnabled(true);
	    
	    listPanel.setBodyValueVO(new Hfet_declearzg_dt1[0]);
	    //listPanel.getParentListPanel().setTotalRowShow(true);
	  //  listPanel.getBodyScrollPane("fk_hdovertime").setTotalRowShow(true);
	}
	return listPanel;
}

// 按钮的初始
private nc.ui.pub.beans.UIButton getUIButtonComm() {
	if (UIButtonComm == null) {
		UIButtonComm = new nc.ui.pub.beans.UIButton();
		UIButtonComm.setName("UIButtonComm");
		UIButtonComm.setText("确定");
		UIButtonComm.setBounds(70, 350, 55, 22);
	}
	return UIButtonComm;
}

// 按钮初始
private nc.ui.pub.beans.UIButton getUIButtonCanel() {
	if (UIButtonCanel == null)
		UIButtonCanel = new nc.ui.pub.beans.UIButton();
	UIButtonCanel.setName("UIButtonCanel");
	UIButtonCanel.setText("取消");
	UIButtonCanel.setBackground(getBackground());
	UIButtonCanel.setBounds(210, 350, 55, 22);
	return UIButtonCanel;
}

// 增加按钮等工作,主panne的初始
private javax.swing.JPanel getUIDialogContentPane() {
	if (mainPanel == null) {
		mainPanel = new javax.swing.JPanel();
		mainPanel.setName("mainPane"); // 名称
		mainPanel.setLayout(null);// 布局
		getUIDialogContentPane()
		 		.add(getUILabel2(), getUILabel2().getName());
		/*getUIDialogContentPane()
		        .add(getUILabel3(), getUILabel3().getName());*/ //
		getUIDialogContentPane() 
        		.add(getUILabel4(), getUILabel4().getName());
		getUIDialogContentPane() 
		.add(getUILabel5(), getUILabel5().getName());
		getUIDialogContentPane() 
		.add(getUILabel6(), getUILabel6().getName());
		getUIDialogContentPane() 
		.add(getUILabel7(), getUILabel7().getName());
		getUIDialogContentPane() 
		.add(getUILabel8(), getUILabel8().getName());
		getUIDialogContentPane() 
		.add(getUILabel9(), getUILabel9().getName());
		getUIDialogContentPane() 
		.add(getUILabel10(), getUILabel10().getName());
		getUIDialogContentPane().add(getUIButtonComm(),
				getUIButtonComm().getName()); // 按钮
		getUIDialogContentPane().add(getUIButtonCanel(),
				getUIButtonCanel().getName()); // 按钮
		 /*getUIDialogContentPane().add(getUICheckBox(),
				 getUICheckBox().getName());*/
		/* getUIDialogContentPane().add(getUICheckBox1(),
				 getUICheckBox1().getName());*/
		 getUIDialogContentPane().add(getUICheckBox2(),
				 getUICheckBox2().getName());
		 getUIDialogContentPane().add(getUICheckBox3(),
				 getUICheckBox3().getName());
		  getUIDialogContentPane().add(getUICheckBox4(),
				 getUICheckBox4().getName());
		 getUIDialogContentPane().add(getUITextField(),
                getUITextField().getName()); //文本     
		 mainPanel.add(getUIRefPane());
		// mainPanel.add(getUIRefPane1());
		 mainPanel.add(getUIRefPane2());
		 mainPanel.add(getUIRefPane3());
		 mainPanel.add(getUIRefPane4());
	/*	 SpinnerDateModel model = new SpinnerDateModel();
           //获得JSPinner对象
  year = new JSpinner(model);
           //设置时间格式
           JSpinner.DateEditor editor = new JSpinner.DateEditor(year,
                   "yyyy-MM-dd");
           year.setEditor(editor);
          year.setBounds(120, 71, 130, 25);
          getUIDialogContentPane().add(year);
          
          SpinnerDateModel model1 = new SpinnerDateModel();
           //获得JSPinner对象
  year2 = new JSpinner(model1);
           //设置时间格式
           JSpinner.DateEditor editor1 = new JSpinner.DateEditor(year2,
                   "yyyy-MM-dd");
           year2.setEditor(editor1);
           year.setBounds(120, 71, 130, 25);
          year2.setBounds(120, 150, 130, 25);
          getUIDialogContentPane().add(year2);*/
		 
		          
	}
	return mainPanel;
}
private Component getUILabel2() {// 标签初始2
	if ( UILabel2== null) {
		UILabel2 = new nc.ui.pub.beans.UILabel();
		UILabel2.setName("Label2");
		UILabel2.setText("信保客户:");
		UILabel2.setBounds(50, 30,60, 20);
	}
	return UILabel2;
}
private Component getUILabel4() {// 标签初始2
	if ( UILabel4== null) {
		UILabel4 = new nc.ui.pub.beans.UILabel();
		UILabel4.setName("Label4");
		UILabel4.setText("是否信保:");
		UILabel4.setBounds(50, 70,60, 20);
	}
	return UILabel4;
}
private Component getUILabel5() {// 标签初始2
	if ( UILabel5== null) {
		UILabel5 = new nc.ui.pub.beans.UILabel();
		UILabel5.setName("UILabel5");
		UILabel5.setText("投保日期:");
		UILabel5.setBounds(50, 110,80, 20);
	}
	return UILabel5;
}
private Component getUILabel6() {// 标签初始2
	if ( UILabel6== null) {
		UILabel6 = new nc.ui.pub.beans.UILabel();
		UILabel6.setName("Label6");
		UILabel6.setText("是否打印单据:");
		UILabel6.setBounds(50, 150,80, 20);
	}
	return UILabel6;
}
private Component getUILabel7() {// 标签初始2
	if ( UILabel7== null) {
		UILabel7 = new nc.ui.pub.beans.UILabel();
		UILabel7.setName("UILabel7");
		UILabel7.setText("打印日期:");
		UILabel7.setBounds(50, 190,80, 20);
	}
	return UILabel7;
}
private Component getUILabel8() {// 标签初始2
	if ( UILabel8== null) {
		UILabel8 = new nc.ui.pub.beans.UILabel();
		UILabel8.setName("UILabel8");
		UILabel8.setText("承保书编号:");
		UILabel8.setBounds(50, 230,80, 20);
	}
	return UILabel8;
}
private Component getUILabel9() {// 标签初始2
	if ( UILabel9== null) {
		UILabel9= new nc.ui.pub.beans.UILabel();
		UILabel9.setName("UILabel9");
		UILabel9.setText("是否融资:");
		UILabel9.setBounds(50, 270,60, 20);
	}
	return UILabel9;
}
/*private Component getUILabel6() {// 标签初始2
	if ( UILabel6== null) {
		UILabel6 = new nc.ui.pub.beans.UILabel();
		UILabel6.setName("Label4");
		UILabel6.setText("是否放款:");
		UILabel6.setBounds(50, 190,60, 20);
	}
	return UILabel6;
}
private Component getUILabel7() {// 标签初始2
	if ( UILabel7== null) {
		UILabel7 = new nc.ui.pub.beans.UILabel();
		UILabel7.setName("Label4");
		UILabel7.setText("是否已信保融资:");
		UILabel7.setBounds(50, 230,90, 20);
	}
	return UILabel7;
}*/
private Component getUIRefPane() {// 标签初始2
	if ( UIRefPane== null) {
		UIRefPane = new nc.ui.pub.beans.UIRefPane("信保客户(自定义档案)");
		/*UIRefPane.setName("UIRefPane");
		UIRefPane.setText("是否已信保融资:");*/
		//UIRefPane.getRefModel().setWherePart(" islock='N' and istransaction = 'Y' ");
		UIRefPane.setBounds(new Rectangle(120, 31,130, 25));
	}
	return UIRefPane;
}
/*private Component getUIRefPane1() {// 标签初始2
	if ( UIRefPane1== null) {
		UIRefPane1 = new nc.ui.pub.beans.UIRefPane("日历");//UIRefPane1.setText(new UFDate().toString());
		
		UIRefPane.setName("UIRefPane");
		UIRefPane.setText("是否已信保融资:");
		//UIRefPane.getRefModel().setWherePart(" islock='N' and istransaction = 'Y' ");
		UIRefPane1.setBounds(new Rectangle(120, 71, 130, 25));
	}
	return UIRefPane1;
}*/
private Component getUIRefPane2() {// 标签初始2
	if ( UIRefPane2== null) {
		UIRefPane2 = new nc.ui.pub.beans.UIRefPane("日历");
		//UIRefPane2.setText(new UFDate().toString());
		/*UIRefPane.setName("UIRefPane");
		UIRefPane.setText("是否已信保融资:");*/
		//UIRefPane.getRefModel().setWherePart(" islock='N' and istransaction = 'Y' ");
		UIRefPane2.setBounds(new Rectangle(120, 110, 130, 25));
	}
	return UIRefPane2;
}
private Component getUIRefPane3() {// 标签初始2
	if ( UIRefPane3== null) {
		UIRefPane3 = new nc.ui.pub.beans.UIRefPane("日历");
		//UIRefPane2.setText(new UFDate().toString());
		/*UIRefPane.setName("UIRefPane");
		UIRefPane.setText("是否已信保融资:");*/
		//UIRefPane.getRefModel().setWherePart(" islock='N' and istransaction = 'Y' ");
		UIRefPane3.setBounds(new Rectangle(120, 190, 130, 25));
	}
	return UIRefPane3;
}
private Component getUICheckBox() {//选择按钮
	if (UICheckBox == null) {
		UICheckBox = new nc.ui.pub.beans.UICheckBox();
		UICheckBox.setName("UICheckBox");
		UICheckBox.setBounds(110, 31, 18, 18);
	}
	return UICheckBox;
}
private Component getUICheckBox1() {//选择按钮
	if (UICheckBox1 == null) {
		UICheckBox1 = new nc.ui.pub.beans.UICheckBox();
		UICheckBox1.setName("UICheckBox1");
		UICheckBox1.setBounds(110, 71, 18, 18);
	}
	return UICheckBox1;
}
private Component getUICheckBox2() {//选择按钮
	if (UICheckBox2 == null) {
		UICheckBox2 = new nc.ui.pub.beans.UICheckBox();
		UICheckBox2.setName("UICheckBox2");
		UICheckBox2.setBounds(120, 71, 18, 18);
	}
	return UICheckBox2;
}
private Component getUICheckBox3() {//选择按钮
	if (UICheckBox3 == null) {
		UICheckBox3 = new nc.ui.pub.beans.UICheckBox();
		UICheckBox3.setName("UICheckBox3");
		UICheckBox3.setBounds(140, 152, 18, 18);
	}
	return UICheckBox3;
}
private Component getUICheckBox4() {//选择按钮
	if (UICheckBox4 == null) {
		UICheckBox4 = new nc.ui.pub.beans.UICheckBox();
		UICheckBox4.setName("UICheckBox4");
		UICheckBox4.setBounds(120, 270, 18, 18);
	}
	return UICheckBox4;
}
 private Component getUITextField() {//文本初始
     if (tField == null) {
             tField = new nc.ui.pub.beans.UITextField();
             tField.setName("tField");
             MatteBorder border = new MatteBorder(1, 1, 1, 1, new Color(128, 128, 128));
             tField.setBorder(border);
             tField.setBounds(120, 230, 130, 25);
     }
     return tField;

}

	private Component getUILabel10() {// 标签初始2
		if ( UILabel10== null) {
			UILabel10= new nc.ui.pub.beans.UILabel();
			UILabel10.setName("UILabel10");
			UILabel10.setText("融资日期:");
			UILabel10.setBounds(50, 305,60, 20);
		}
		return UILabel10;
	}
	private Component getUIRefPane4() {// 标签初始2
		if ( UIRefPane4== null) {
			UIRefPane4 = new nc.ui.pub.beans.UIRefPane("日历");
			//UIRefPane2.setText(new UFDate().toString());
			/*UIRefPane.setName("UIRefPane");
			UIRefPane.setText("是否已信保融资:");*/
			//UIRefPane.getRefModel().setWherePart(" islock='N' and istransaction = 'Y' ");
			UIRefPane4.setBounds(new Rectangle(120, 305, 130, 25));
		}
		return UIRefPane4;
	}

 public String getOkCanel() {// 取消时调用
		return value;
	}
public void actionPerformed(ActionEvent e) {// 点击按钮时调用
	if (e.getSource() == getUIButtonComm()) {
		this.returnValue="ok";
		value = UIButtonComm.getText();
		try {
			getPriceVo(this.aggvo,this.data);
		} catch (Exception e1) {
			// TODO 自动生成的 catch 块
			e1.printStackTrace();
		}
		this.closeOK();
		
	}
	if (e.getSource() == getUIButtonCanel()) {
		this.returnValue="ok1";
		value = UIButtonCanel.getText();
		this.closeOK();
	}
}
public String  getSelectedlb(){
	selectvo select=  (selectvo) ComboBoxto1.getSelectedItem();
	String selectlb =  select.getPk_defdoc();
	return selectlb;
}
public String  getSelectedqy(){
	selectvo select=(selectvo) ComboBoxto2.getSelectedItem();
	String selectqy =  select.getPk_defdoc();
	return selectqy;
}
public String[] getPriceVo(Object[] aggvo2,List data) throws Exception {// 确认是调用
	IUAPQueryBS server = NCLocator.getInstance().lookup(IUAPQueryBS.class);
	AggHfet_fininvoiceandorgs = new ArrayList<AggHfet_fininvoiceandorg>();
	AggHfet_fininvoiceandorgs1 = new ArrayList<AggHfet_fininvoiceandorg>();
	IHfdm_dormdocMaintain isv=  NCLocator.getInstance().lookup(IHfdm_dormdocMaintain.class);
	/*String  tjyhbh = tField.getText();
	Boolean sftb = UICheckBox.isSelected();
	Boolean sfrz = UICheckBox1.isSelected();*/
	String  cbsbh = tField.getText();
	Boolean sftb = UICheckBox2.isSelected();
	Boolean sfdy = UICheckBox3.isSelected();
	Boolean sfrz = UICheckBox4.isSelected();
	/*Boolean sfxbrz = UICheckBox4.isSelected();*/
	String refcode = UIRefPane.getRefCode();
	String[] values = new String[2];
	String pk_hfet_declearinfomt = "";
	String sql = "select a.* from bd_defdoc a where  a.pk_defdoclist in (select pk_defdoclist from bd_defdoclist a where a.name like '%信保客户%') and  a.code='"+refcode+"' and a.dr=0";
	DefdocVO DefdocVO = (DefdocVO)server.executeQuery(sql, new BeanProcessor(DefdocVO.class));
	for(int i = 0 ; i < aggvo2.length ; i ++){
		AggHfet_fininvoiceandorg aggvo = (AggHfet_fininvoiceandorg)aggvo2[i];
		Hfet_fininvoiceandorg parentVO = aggvo.getParentVO();
		AggHfet_fininvoiceandorgs.add(aggvo);
		pk_hfet_declearinfomt+= ",'"+parentVO.getPk_hfet_declearinfomt()+"'";
	}
	Set<String> s = new HashSet<String>();
	if(AggHfet_fininvoiceandorgs.size()>0){
		for (AggHfet_fininvoiceandorg string : AggHfet_fininvoiceandorgs) {
			s.add(string.getParentVO().getPk_hfet_declearinfomt());
		}
	}
	Hfet_xbkhdz Hfet_xbkhdz = null;
	for(int j = 0 ; j < data.size() ; j++){
		AggHfet_fininvoiceandorg object = (AggHfet_fininvoiceandorg) data.get(j);
		for (int k = 0 ; k <AggHfet_fininvoiceandorgs.size() ; k ++) {
			if(object.getParentVO().getPk_hfet_declearinfomt().equals(AggHfet_fininvoiceandorgs.get(k).getParentVO().getPk_hfet_declearinfomt())){
				if(new UFBoolean(sftb).toString().equals("Y")){
					object.getParentVO().setSftb(new UFBoolean(sftb));
				}
				if(DefdocVO!=null){
					object.getParentVO().setXbkh(DefdocVO.getName());
					object.getParentVO().setXbdm(DefdocVO.getCode());
						String sql123 = "select * from hfet_xbkhdz where pk_org = '"+object.getParentVO().getPkckgs()+"' and  pk_xbkh='"+DefdocVO.getPk_defdoc()+"' and dr=0;";
						 Hfet_xbkhdz = (Hfet_xbkhdz)server.executeQuery(sql123, new BeanProcessor(Hfet_xbkhdz.class));
						if(Hfet_xbkhdz!=null){
							object.getParentVO().setDef2(String.valueOf(Hfet_xbkhdz.getXbqx()));
						}
				}
				if(UIRefPane2.getText()!=null&&!UIRefPane2.getText().equals("")){
					object.getParentVO().setTbrq(new UFDate(UIRefPane2.getText()));
				}
				if(UIRefPane3.getText()!=null&&!UIRefPane3.getText().equals("")){
					object.getParentVO().setDyrq(new UFDate(UIRefPane3.getText()));
				}
				if(UIRefPane4.getText()!=null&&!UIRefPane4.getText().equals("")){
					object.getParentVO().setRzrq(new UFDate(UIRefPane4.getText()));
				}
				if(new UFBoolean(sfdy).toString().equals("Y")){
					object.getParentVO().setSfydydj(new UFBoolean(sfdy));
				}
				if(new UFBoolean(sfrz).toString().equals("Y")){
					object.getParentVO().setSfrz(new UFBoolean(sfrz));
				}
				
				if(cbsbh!=null&&!cbsbh.equals("")){
					object.getParentVO().setCbsbh(cbsbh);
				}
				//object.getParentVO().setTdsfgy(new UFBoolean(tdsfgy));
				/*object.getParentVO().setTjyhbh(tjyhbh);*/
				
				AggHfet_fininvoiceandorgs1.add(object);
			}
		}
		if(s.contains(object.getParentVO().getPk_hfet_declearinfomt())){
			AggHfet_fininvoiceandorgs1.add(object);
		}
	}
	/*for(int i = data.size() - 1; i >= 0; i--){
		 AggHfet_fininvoiceandorg newaggvo = (AggHfet_fininvoiceandorg) data.get(i);
		 for(int j = 0; j < AggHfet_fininvoiceandorgs.size(); j++){
			 AggHfet_fininvoiceandorg delaggvo = AggHfet_fininvoiceandorgs.get(j);
			 if(newaggvo.getParentVO().getPk_hfet_declearinfomt().equals(delaggvo.getParentVO().getPk_hfet_declearinfomt()) ){
				 data.remove(i);
				 break;
			 }
		 }
		 
	 }*/
	if(!pk_hfet_declearinfomt.equals("")){
		pk_hfet_declearinfomt = pk_hfet_declearinfomt.substring(1);
		String sqlc="";
		if(refcode!=null){
			sqlc+= ",xbkhx='"+DefdocVO.getPk_defdoc()+"' ";
		}
		if(refcode!=null){
			/*String sql123 = "select * from hfet_xbkhdz where pk_org = '"+object.getParentVO().getPkckgs()+"' and pk_xbkh='"+DefdocVO.getPk_defdoc()+"' and dr=0;";
			Hfet_xbkhdz Hfet_xbkhdz = (Hfet_xbkhdz)server.executeQuery(sql123, new BeanProcessor(Hfet_xbkhdz.class));*/
			if(Hfet_xbkhdz!=null){
				sqlc+= ",name='"+String.valueOf(Hfet_xbkhdz.getXbqx())+"' ";
			}
		
		}
		/*if(UIRefPane1.getText()!=null&&!UIRefPane1.getText().equals("")){
			String s1 = UIRefPane1.getText()+" 00:00:00";
			sqlc+= ",xbrq = '"+s1+"' ";
		}*/
		if(UIRefPane2.getText()!=null&&!UIRefPane2.getText().equals("")){
			String s2 = UIRefPane2.getText()+" 00:00:00";
			sqlc+= ",tbrq = '"+s2+"' ";
		}
		if(UIRefPane3.getText()!=null&&!UIRefPane3.getText().equals("")){
			String s2 = UIRefPane3.getText()+" 00:00:00";
			sqlc+= ",dyrq = '"+s2+"' ";
		}
		if(UIRefPane4.getText()!=null&&!UIRefPane4.getText().equals("")){
			String s2 = UIRefPane4.getText()+" 00:00:00";
			sqlc+= ",rzrq = '"+s2+"' ";
		}
		/*sqlc+=",sftb = '"+new UFBoolean(sftb).toString()+"' ";
		sqlc+=",sfrz = '"+new UFBoolean(sfrz).toString()+"' ";*/
		if(new UFBoolean(sfdy).toString().equals("Y")){
			sqlc+=",sfydydj = '"+new UFBoolean(sfdy).toString()+"' ";
		}
		if(new UFBoolean(sftb).toString().equals("Y")){
			sqlc+=",sftb = '"+new UFBoolean(sftb).toString()+"' ";
		}
		if(new UFBoolean(sfrz).toString().equals("Y")){
			sqlc+=",sfrz = '"+new UFBoolean(sfrz).toString()+"' ";
		}
		if(cbsbh!=null&&!cbsbh.equals("")){
			sqlc+=",cbsbh = '"+cbsbh+"' ";
		}
		//if(refcode==null){
		if(!sqlc.equals("")){
			sqlc = sqlc.substring(1);
			isv.updateSql("update hfet_declearinfomt set "+sqlc+" where pk_hfet_declearinfomt in ("+pk_hfet_declearinfomt+")");
		
		}
			//isv.updateSql("update hfet_fininvoiceandorg set sffk = '"+new UFBoolean(sffk).toString()+"' ,tdsfgy = '"+new UFBoolean(tdsfgy).toString()+"' , sftb = '"+new UFBoolean(sftb).toString()+"',sfrz = '"+new UFBoolean(sfrz).toString()+"' where pk_hfet_declearinfomt in ("+pk_hfet_declearinfomt+")");
		/*}else{
			isv.updateSql("update hfet_declearinfomt set tbrq='"+new UFDate(format2)+"',sftb = '"+new UFBoolean(sftb).toString()+"',xbrq = '"+format+"',xbkhx='"+DefdocVO.getPk_defdoc()+"' where pk_hfet_declearinfomt in ("+pk_hfet_declearinfomt+")");
			//isv.updateSql("update hfet_fininvoiceandorg set tjyhbh='"+tjyhbh+"',sffk = '"+new UFBoolean(sffk).toString()+"' ,tdsfgy = '"+new UFBoolean(tdsfgy).toString()+"' , sftb = '"+new UFBoolean(sftb).toString()+"',sfrz = '"+new UFBoolean(sfrz).toString()+"' where pk_hfet_declearinfomt in ("+pk_hfet_declearinfomt+")");
		}*/
	}
	
	return values;
}

public static String returnvalue(){
	return returnValue;
	
}

public List getmeg(String pk_defdoclist) {
	Connection conn = null;// 创建一个数据库连接
	Statement sm = null;// 创建预编译语句对象,
	ResultSet rs = null;// 创建一个结果集对象
	List<selectvo> list = new ArrayList<selectvo>();

	try {
		Class.forName("oracle.jdbc.driver.OracleDriver"); // 加载数据库驱动
		System.out.println("数据库驱动加载成功!"); // 输出的信息
		String url = "jdbc:oracle:thin:@192.168.8.173:1521:orcl"; // 获取连接URL
		String user = "hfnc0914"; // 连接用户名
		String password = "hfnc0914"; // 连接密码
		conn = DriverManager.getConnection(url, user, password); // 获取数据库连接
		if (conn != null) {

			System.out.println("成功的与Oracle数据库建立连接!!");
			sm = conn.createStatement();
			String sql = "select code ,name,pk_defdoc from bd_defdoc where pk_defdoclist ='"
					+ pk_defdoclist + "'";
			rs = sm.executeQuery(sql);
			while (rs.next()) {
				selectvo vo = new selectvo();
				String code = rs.getString("code");
				String name = rs.getString("name");
				String pk_defdoc = rs.getString("pk_defdoc");
				vo.setCode(code);
				vo.setName(name);
				vo.setPk_defdoc(pk_defdoc);
				list.add(vo);
			}
		}
	} catch (Exception e) {
		System.out.println(e);
	} finally {
		try {
			// 逐一将上面的几个对象关闭,因为不关闭的话会影响性能、并且占用资源
			// 注意关闭的顺序,最后使用的最先关闭
			if (rs != null)
				rs.close();
			if (sm != null)
				sm.close();
			if (conn != null)
				conn.close();
			System.out.println("数据库连接已关闭!");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	return list;
}

public BillListPanel getListPanel() {
	return listPanel;
}

public void setListPanel(BillListPanel listPanel) {
	this.listPanel = listPanel;
}

}

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值