Pārlūkot izejas kodu

生产总订单20240123

zthwr 9 mēneši atpakaļ
vecāks
revīzija
0712428300

+ 39 - 0
mmpac/mmpac/src/client/u8c/ui/mmpac/action/CardRefreshAction.java

@@ -0,0 +1,39 @@
+package u8c.ui.mmpac.action;
+
+import nc.ui.hr.frame.FrameUI;
+import nc.ui.hr.frame.action.AbstractAction;
+import nc.ui.hr.frame.button.AbstractBtnReg;
+import nc.ui.hr.frame.impl.MainBillMgrPanel;
+import nc.ui.hr.frame.state.StateRegister;
+import nc.vo.hr.tools.pub.HRAggVO;
+import u8c.ui.mmpac.panel.OrderMainPanel;
+import u8c.ui.mmpac.panel.OrderTestUI;
+
+public class CardRefreshAction  extends AbstractAction{
+	OrderTestUI frameUI = null;
+	public CardRefreshAction(FrameUI frameUI1) {
+		super(frameUI1);
+		this.frameUI = (OrderTestUI) frameUI1;
+	}
+
+	@Override
+	public void execute() throws Exception {
+		OrderTestUI ui = (OrderTestUI)this.getFrameUI();
+		MainBillMgrPanel mainMgrPanel = (MainBillMgrPanel) getMainPanel();
+//		int selectedRow = ((OrderMainPanel) getMainPanel()).getSelectedRow();
+		HRAggVO s = (HRAggVO) mainMgrPanel.getMainBillCardPanel().getData();
+		
+		boolean boo = mainMgrPanel.getBillCardPanel().isShowing();
+		if(boo) {
+			mainMgrPanel.getBillCardPanel().setBillValueVO(s);
+			ui.getBillCardPanel().getBodyTabbedPane().setSelectedIndex(3);//默认显示哪个页签
+		}else {
+			getFrameUI().getBtnManager().getCmdByID(AbstractBtnReg.SYSBTN_REFRESH).execute();
+		}
+		
+		
+		getDataModel().setCurrentState(StateRegister.STATE_NOTEDIT); 
+		
+	}
+
+}

+ 306 - 0
mmpac/mmpac/src/client/u8c/ui/mmpac/action/MmpacQueryAction.java

@@ -0,0 +1,306 @@
+package u8c.ui.mmpac.action;
+
+import nc.ui.hr.frame.action.AbstractAction;
+import java.awt.Component;
+import nc.ui.hr.frame.FrameUI;
+import nc.ui.hr.frame.HrQueryDialog;
+import nc.ui.hr.frame.LeftPanel;
+import nc.ui.hr.frame.MainPanel;
+import nc.ui.hr.frame.impl.MainBillCardPanel;
+import nc.ui.hr.frame.impl.MainBillListPanel;
+import nc.ui.hr.frame.impl.MainBillMgrPanel;
+import nc.ui.hr.frame.impl.MainSwitchPanel;
+import nc.ui.hr.frame.model.BillDataModel;
+import nc.ui.hr.frame.model.DataModel;
+import nc.ui.hr.frame.util.BillBufferUtils;
+import nc.ui.pub.beans.constenum.DefaultConstEnum;
+import nc.ui.pub.beans.constenum.IConstEnum;
+import nc.vo.hr.tools.pub.HRAggVO;
+import nc.vo.pub.BusinessException;
+import nc.vo.pub.SuperVO;
+import org.apache.commons.lang.StringUtils;
+
+public class MmpacQueryAction extends AbstractAction
+{
+  private boolean blIsRefresh = false;
+
+  private int iAfterQryState = 0;
+
+  private SuperVO[] queryResultVOs = null;
+
+  public MmpacQueryAction(FrameUI frameUI)
+  {
+    super(frameUI);
+  }
+
+  public MmpacQueryAction(FrameUI frameUI, boolean blIsRefresh2)
+  {
+    super(frameUI);
+
+    this.blIsRefresh = blIsRefresh2;
+  }
+
+  protected void bufferData()
+  {
+    if ((this.queryResultVOs == null) || (this.queryResultVOs.length == 0))
+    {
+      return;
+    }
+
+    HRAggVO[] hrAggVOs = HRAggVO.createHRAggVOs(this.queryResultVOs);
+
+    getDataModel().getBillBufferUtils().setBufferData(hrAggVOs, true);
+  }
+
+  protected void displayData(SuperVO[] resultVOs)
+  {
+    if (getFrameUI().needLeftPanel())
+    {
+      getLeftPanel().removeAllItems();
+
+      if ((resultVOs == null) || (resultVOs.length == 0))
+      {
+        getMainPanel().clearView();
+        getMainPanel().setMainPanelEnabled(false);
+      }
+      else
+      {
+        getLeftPanel().addItem(resultVOs);
+      }
+
+      getBillDataModel().setCurrentState(5);
+
+      return;
+    }
+
+    HRAggVO hrAggVO = null;
+    MainBillListPanel mainBillListPanel = null;
+    MainBillCardPanel  mainBillCardPanel=null;
+
+    if ((getMainPanel() instanceof MainSwitchPanel))
+    {
+      if ((getMainPanel() instanceof MainBillMgrPanel))
+      {
+        ((MainBillMgrPanel)getMainPanel()).show("LIST_PANEL");
+      }
+
+      Component com = ((MainSwitchPanel)getMainPanel()).getCurrentShowComp();
+      if ((com instanceof MainBillCardPanel))
+      {
+        hrAggVO = getBillDataModel().queryDataByHeadVO(resultVOs[0], null);
+        ((MainBillCardPanel)com).setData(hrAggVO);
+      }
+      else if ((com instanceof MainBillListPanel))
+      {
+        HRAggVO[] aggVOs = HRAggVO.createHRAggVOs(resultVOs);
+
+        mainBillListPanel = (MainBillListPanel)com;
+        mainBillListPanel.setData(aggVOs);
+      }
+    }
+
+    if ((getMainPanel() instanceof MainBillCardPanel))
+    {
+      hrAggVO = getBillDataModel().queryDataByHeadVO(resultVOs[0], null);
+      ((MainBillCardPanel)getMainPanel()).setData(hrAggVO);
+    }
+    else if ((getMainPanel() instanceof MainBillListPanel))
+    {
+      HRAggVO[] aggVOs = HRAggVO.createHRAggVOs(resultVOs);
+
+      mainBillListPanel = (MainBillListPanel)getMainPanel();
+      mainBillListPanel.setData(aggVOs);
+    }
+
+    if (mainBillListPanel != null)
+    {
+      if ((resultVOs != null) && (resultVOs.length > 0))
+      {
+        if (mainBillListPanel.getHeadSelectedRow() == -1)
+        {
+          mainBillListPanel.setHeadSelectedRow(0, 0);
+          mainBillListPanel.loadBodyData();
+
+          getDataModel().setCurrentSelectIndex(0);
+        }
+
+        getDataModel().setCurrentState(8);
+      }
+      else
+      {
+        getDataModel().setCurrentState(this.iAfterQryState, true);
+      }
+    }
+    else
+    {
+      getDataModel().setCurrentState(this.iAfterQryState, true);
+    }
+
+    getMainPanel().afterSetData();
+
+    getMainPanel().setMainPanelEditable(false);
+  }
+
+  public void execute()
+    throws Exception
+  {
+    queryData();
+
+    if ((!isRefresh()) && (1 != getQueryDialog().getResult()))
+    {
+      return;
+    }
+
+    displayData(this.queryResultVOs);
+
+    showResultHintMessage();
+  }
+
+  public int getAfterQryState()
+  {
+    return this.iAfterQryState;
+  }
+
+  protected BillDataModel getBillDataModel()
+  {
+    return (BillDataModel)getDataModel();
+  }
+
+  protected String getCondition()
+  {
+    return getQueryDialog().getWhereSQL();
+  }
+
+  public String getOrderSQL()
+  {
+    String strOrderSQL = "";
+
+    if (StringUtils.isNotBlank(getQueryDialog().getOrderSQL()))
+    {
+      strOrderSQL = getQueryDialog().getOrderSQL();
+    }
+
+    if (StringUtils.isNotBlank(getDataModel().getSQLOrderBy()))
+    {
+      if (StringUtils.isNotBlank(strOrderSQL))
+      {
+        strOrderSQL = strOrderSQL + "," + getDataModel().getSQLOrderBy();
+      }
+      else
+      {
+        strOrderSQL = strOrderSQL + " order by " + getDataModel().getSQLOrderBy();
+      }
+    }
+
+    return strOrderSQL;
+  }
+
+  public HrQueryDialog getQueryDialog()
+  {
+    return getFrameUI().getQueryDialog();
+  }
+
+  public SuperVO[] getQueryResultVOs()
+  {
+    return this.queryResultVOs;
+  }
+
+  public boolean isRefresh()
+  {
+    return this.blIsRefresh;
+  }
+
+  protected void queryData()
+    throws BusinessException
+  {
+    String strQueryCondition = null;
+
+    if (isRefresh())
+    {
+      strQueryCondition = getDataModel().getCondition();
+
+      if ((strQueryCondition == null) || (strQueryCondition.length() == 0))
+      {
+        strQueryCondition = "1<>1";
+      }
+    }
+    else
+    {
+      if (getQueryDialog().showModal() != 1)
+      {
+        return;
+      }
+
+      strQueryCondition = getCondition();
+
+      if (strQueryCondition == null)
+      {
+        strQueryCondition = " 1=1 ";
+      }
+
+      strQueryCondition = strQueryCondition + getDataModel().getExtraCondition();
+
+      strQueryCondition = strQueryCondition + getOrderSQL();
+      
+     if(strQueryCondition.contains("billstatus")) {
+    	  strQueryCondition= strQueryCondition.replaceAll("编写中", "8");
+    	  strQueryCondition= strQueryCondition.replaceAll("已批准", "1");
+      }
+      
+
+      getDataModel().setCondition(strQueryCondition);
+    }
+
+    queryData2(strQueryCondition);
+
+    bufferData();
+  }
+
+  protected void queryData2(String strQueryCondition)
+    throws BusinessException
+  {
+    Class clazz = getFrameUI().needLeftPanel() ? getBillDataModel().getLeftVOClass() : getBillDataModel().getHeadVOClass();
+
+    setQueryResultVOs(getBillDataModel().onQuery(clazz, strQueryCondition));
+  }
+
+  public void setAfterQryState(int afterQryState1)
+  {
+    this.iAfterQryState = afterQryState1;
+  }
+
+  public void setFieldDefaultValue(String strFieldCode, String strDefaultValue)
+  {
+    getQueryDialog().setFieldDefaultValue(strFieldCode, strDefaultValue);
+  }
+
+  public void setFieldValueElementEnum(String strFieldCode, IConstEnum[] items)
+  {
+    getQueryDialog().setFieldValueElementEnum(strFieldCode, items);
+  }
+
+  public void setQueryResultVOs(SuperVO[] queryResultVO2s)
+  {
+    this.queryResultVOs = queryResultVO2s;
+  }
+
+  protected void showResultHintMessage()
+  {
+    String strMsg = "";
+
+    if (this.blIsRefresh)
+    {
+      strMsg = getResource("nc_hr_ui_frame", "UPPnc_hr_ui_frame-000123");
+    }
+    else if ((this.queryResultVOs == null) || (this.queryResultVOs.length == 0))
+    {
+      strMsg = getResource("nc_hr_ui_frame", "UPPnc_hr_ui_frame-000124");
+    }
+    else
+    {
+      strMsg = getResource("nc_hr_ui_frame", "UPPnc_hr_ui_frame-000206", new String[] { String.valueOf(this.queryResultVOs.length) });
+    }
+
+    getFrameUI().showHintMessage(strMsg);
+  }
+}

+ 120 - 0
mmpac/mmpac/src/client/u8c/ui/mmpac/action/OutSourcingAction.java

@@ -0,0 +1,120 @@
+package u8c.ui.mmpac.action;
+
+import nc.hr.utils.PubEnv;
+import nc.ui.fts.pub.BillCardPanelUtil;
+import nc.ui.hr.frame.FrameUI;
+import nc.ui.hr.frame.action.AbstractAction;
+import nc.ui.hr.frame.action.BrowseFromListToCardAction;
+import nc.ui.hr.frame.action.SaveAction;
+import nc.ui.hr.frame.impl.MainBillMgrPanel;
+import nc.ui.hr.frame.state.StateRegister;
+import nc.vo.hr.tools.pub.HRAggVO;
+import nc.vo.pub.CircularlyAccessibleValueObject;
+import nc.vo.pub.ValidationException;
+import nc.vo.trade.pub.IBillStatus;
+import u8c.ui.mmpac.panel.OrderTestUI;
+import u8c.vo.OrderIssueVO;
+import u8c.vo.OrderMainVO;
+import u8c.vo.OrderOtherinVO;
+import u8c.vo.OrderOtheroutVO;
+
+public class OutSourcingAction    extends AbstractAction{
+	OrderTestUI frameUI = null;
+	public OutSourcingAction(FrameUI frameUI1) {
+		super(frameUI1);
+		this.frameUI = (OrderTestUI) frameUI1;
+	}
+
+	@Override
+	public void execute() throws Exception {
+       
+	
+		OrderTestUI ui = (OrderTestUI)this.getFrameUI();
+		
+        MainBillMgrPanel mainMgrPanel = (MainBillMgrPanel) getMainPanel();
+        
+        HRAggVO s = (HRAggVO) mainMgrPanel.getMainBillCardPanel().getData();
+        
+        OrderMainVO headvo = (OrderMainVO) this.getSelection(mainMgrPanel).getParentVO();
+        
+  		if (headvo.getBillstatus() != IBillStatus.CHECKPASS){
+  			throw new ValidationException("用于审批后操作,本单据不符合要求!请正常修改生成即可!");
+  		}
+              
+		
+ //     getDataModel().setCurrentState(StateRegister.STATE_EDIT);
+//        
+        getMainPanel().setMainPanelEnabled(true);
+        
+//      ui.getBillCardPanel().setEnabled(false);//设置面板可编辑性
+      
+        // 设置字段不可见
+	//	BillCardPanelUtil.setBodyColsVisible(ui.getBillCardPanel(),new String[] {"bdef5"}, false, "mmpac_order_issue");
+        
+        
+		
+        for(int i=0; i<ui.getBillCardPanel().getHeadItems().length;i++) {
+            //表头不可编辑
+        	ui.getBillCardPanel().getHeadItems()[i].setEdit(false);
+        	
+        }
+        
+        
+        //不可以编辑页签 0 表头  1 表体
+  //      ui.getBillCardPanel().setTabEnabled(1, "mmpac_order_in", false);//不可以点页签
+        
+        
+        ui.getBillCardPanel().getBodyTabbedPane().setSelectedIndex(1);//默认显示哪个页签
+        
+        ui.getBillCardPanel().getBillModel("mmpac_order_in").setEnabledAllItems(false); //都不可编辑
+        
+        ui.getBillCardPanel().getBillModel("mmpac_order_issue").setEnabledAllItems(false); //都不可编辑
+        
+        ui.getBillCardPanel().getBillModel("mmpac_order_otherin").setEnabledAllItems(false); //都不可编辑
+        
+        ui.getBillCardPanel().getBillModel("mmpac_order_otherout").setEnabledAllItems(false); //都不可编辑
+        
+ 
+        
+        
+        OrderIssueVO[] issuevos= (OrderIssueVO[]) s.getTableVO("mmpac_order_issue");
+        
+        for(int row=0;row<issuevos.length;row++) {
+           ui.getBillCardPanel().getBillModel("mmpac_order_issue").setCellEditable(row,"bdef5", true);//可编辑
+        }
+        
+        
+//        CircularlyAccessibleValueObject[] criavoubhects= s.getTableVO("mmpac_order_otherout");
+//        
+//        if(null!=criavoubhects && criavoubhects.length>0) {
+//        	  OrderOtheroutVO[] outvos= (OrderOtheroutVO[]) s.getTableVO("mmpac_order_otherout");
+//              for(int row=0;row<outvos.length;row++) {
+//                  ui.getBillCardPanel().getBillModel("mmpac_order_otherout").setCellEditable(row,"color", true);//可编辑
+//               }
+//                
+//        }
+        
+        
+//        CircularlyAccessibleValueObject[] criavoubhects= s.getTableVO("mmpac_order_otherin");
+//        
+//        if(null!=criavoubhects && criavoubhects.length>0) {
+//        	OrderOtherinVO[] invos= (OrderOtherinVO[]) s.getTableVO("mmpac_order_otherin");
+//              for(int row=0;row<invos.length;row++) {
+//                  ui.getBillCardPanel().getBillModel("mmpac_order_otherin").setCellEditable(row,"color", true);//可编辑
+//               }
+//                
+//        }
+        
+        
+	}
+
+}
+
+
+
+
+
+
+
+
+

+ 108 - 0
mmpac/mmpac/src/client/u8c/ui/mmpac/action/UpdateColorAction.java

@@ -0,0 +1,108 @@
+package u8c.ui.mmpac.action;
+
+import nc.ui.hr.frame.FrameUI;
+import nc.ui.hr.frame.action.AbstractAction;
+import nc.ui.hr.frame.button.AbstractBtnReg;
+import nc.ui.hr.frame.impl.MainBillMgrPanel;
+import nc.ui.hr.frame.state.StateRegister;
+import nc.vo.hr.tools.pub.HRAggVO;
+import nc.vo.pub.CircularlyAccessibleValueObject;
+import nc.vo.pub.ValidationException;
+import nc.vo.trade.pub.IBillStatus;
+import u8c.ui.mmpac.panel.OrderTestUI;
+import u8c.vo.OrderIssueVO;
+import u8c.vo.OrderMainVO;
+import u8c.vo.OrderOtherinVO;
+
+public class UpdateColorAction extends AbstractAction{
+	OrderTestUI frameUI = null;
+	public UpdateColorAction(FrameUI frameUI1) {
+		super(frameUI1);
+		this.frameUI = (OrderTestUI) frameUI1;
+	}
+
+	@Override
+	public void execute() throws Exception {
+	
+		OrderTestUI ui = (OrderTestUI)this.getFrameUI();
+		
+	    MainBillMgrPanel mainMgrPanel = (MainBillMgrPanel) getMainPanel();
+	    
+        HRAggVO s = (HRAggVO) mainMgrPanel.getMainBillCardPanel().getData();
+        
+        OrderMainVO headvo = (OrderMainVO) this.getSelection(mainMgrPanel).getParentVO();
+		if (headvo.getBillstatus() != IBillStatus.CHECKPASS){
+			throw new ValidationException("用于审批后操作,本单据不符合要求!请正常修改生成即可!");
+		}
+	
+  //      getDataModel().setCurrentState(StateRegister.STATE_EDIT);
+        
+        getMainPanel().setMainPanelEnabled(true);
+        
+       
+        
+        
+//      ui.getBillCardPanel().setEnabled(false);//设置面板可编辑性
+      
+        // 设置字段不可见
+	//	BillCardPanelUtil.setBodyColsVisible(ui.getBillCardPanel(),new String[] {"bdef5"}, false, "mmpac_order_issue");
+        
+        for(int i=0; i<ui.getBillCardPanel().getHeadItems().length;i++) {
+            //表头不可编辑
+        	ui.getBillCardPanel().getHeadItems()[i].setEdit(false);
+        	
+        }
+        
+        
+        //不可以编辑页签 0 表头  1 表体
+  //      ui.getBillCardPanel().setTabEnabled(1, "mmpac_order_in", false);//不可以点页签
+        
+        
+        ui.getBillCardPanel().getBodyTabbedPane().setSelectedIndex(3);//默认显示哪个页签
+        
+        ui.getBillCardPanel().getBillModel("mmpac_order_in").setEnabledAllItems(false); //都不可编辑
+        
+        ui.getBillCardPanel().getBillModel("mmpac_order_issue").setEnabledAllItems(false); //都不可编辑
+        
+        ui.getBillCardPanel().getBillModel("mmpac_order_otherin").setEnabledAllItems(false); //都不可编辑
+        
+        ui.getBillCardPanel().getBillModel("mmpac_order_otherout").setEnabledAllItems(false); //都不可编辑
+        
+      
+        
+        
+//        CircularlyAccessibleValueObject[] criavoubhects= s.getTableVO("mmpac_order_otherout");
+//        
+//        if(null!=criavoubhects && criavoubhects.length>0) {
+//        	  OrderOtheroutVO[] outvos= (OrderOtheroutVO[]) s.getTableVO("mmpac_order_otherout");
+//              for(int row=0;row<outvos.length;row++) {
+//                  ui.getBillCardPanel().getBillModel("mmpac_order_otherout").setCellEditable(row,"color", true);//可编辑
+//               }
+//                
+//        }
+        
+        
+        CircularlyAccessibleValueObject[] criavoubhects= s.getTableVO("mmpac_order_otherin");
+        
+        if(null!=criavoubhects && criavoubhects.length>0) {
+        	OrderOtherinVO[] invos= (OrderOtherinVO[]) s.getTableVO("mmpac_order_otherin");
+              for(int row=0;row<invos.length;row++) {
+                  ui.getBillCardPanel().getBillModel("mmpac_order_otherin").setCellEditable(row,"color", true);//可编辑
+               }
+                
+        }
+        
+      
+        
+	}
+
+}
+
+
+
+
+
+
+
+
+