|
@@ -5,6 +5,7 @@ import java.util.List;
|
|
|
|
|
|
import nc.bs.framework.common.NCLocator;
|
|
|
import nc.itf.uap.IUAPQueryBS;
|
|
|
+import nc.jdbc.framework.processor.ColumnProcessor;
|
|
|
import nc.ui.hr.frame.FrameUI;
|
|
|
import nc.ui.hr.frame.action.AbstractAction;
|
|
|
import nc.ui.hr.frame.impl.MainBillMgrPanel;
|
|
@@ -31,7 +32,6 @@ public class DemandPurchaseRequisitionAction extends AbstractAction {
|
|
|
|
|
|
@Override
|
|
|
public void execute() throws Exception {
|
|
|
- // TODO Auto-generated method stub
|
|
|
// 获取材料请购单
|
|
|
MainBillMgrPanel mainMgrPanel = (MainBillMgrPanel) getMainPanel();
|
|
|
int selectedRow = ((DemandMainPanel) getMainPanel()).getSelectedRow();
|
|
@@ -40,10 +40,21 @@ public class DemandPurchaseRequisitionAction extends AbstractAction {
|
|
|
if (1!=demandVO.getBillstatus()) {
|
|
|
throw new ValidationException("单据需要先审批");// 新增请购单
|
|
|
}
|
|
|
+ //业务类型家装的允许生单,工装的不允许生单 vdef30
|
|
|
+ if ("工装".equals(demandVO.getVdef30())) {
|
|
|
+ throw new ValidationException("业务类型家装的允许生单,工装的不允许生单");
|
|
|
+ }
|
|
|
+
|
|
|
+ //校验不允许重复生成请购单
|
|
|
+ String sql="select cpraybill_bid from po_praybill_b where csourcebillid='"+demandVO.getPk_demand()+"' and dr=0; ";
|
|
|
+
|
|
|
+ Object pkbid=iuap.executeQuery(sql, new ColumnProcessor());
|
|
|
+
|
|
|
+ if(null!=pkbid && !"".equals(pkbid)) {
|
|
|
+ throw new ValidationException("已经生成请购单,不允许重复生单!");
|
|
|
+ }
|
|
|
+
|
|
|
if (null != s && s != null) {
|
|
|
-// getInstance(IDemandPurchaseRequisition.class).addPraybillVO(s);// 新增请购单
|
|
|
-
|
|
|
-// DemandVO demandVO = (DemandVO) s.getParentVO();//
|
|
|
CircularlyAccessibleValueObject[] demandBVOList = s.getAllChildrenVO();//
|
|
|
List<DemandBVO> demandBVOs = new ArrayList();
|
|
|
for(CircularlyAccessibleValueObject vo : demandBVOList) {
|
|
@@ -60,8 +71,4 @@ public class DemandPurchaseRequisitionAction extends AbstractAction {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// private IDemandPurchaseRequisition getInstance(Class<IDemandPurchaseRequisition> class1) {
|
|
|
-// return ServiceLocator.find(class1);
|
|
|
-// }
|
|
|
-
|
|
|
}
|