Преглед изворни кода

生产总订单有下游单据不允许取消审批

yaoyu пре 1 година
родитељ
комит
0116095d23

+ 2 - 0
mmpac/mmpac/src/client/u8c/ui/mmpac/action/OrderUnApproveAction.java

@@ -10,6 +10,7 @@ import nc.ui.hr.frame.impl.MainBillMgrPanel;
 import nc.vo.hr.tools.pub.HRAggVO;
 import nc.vo.pub.ValidationException;
 import nc.vo.trade.pub.IBillStatus;
+import u8c.bs.servlet.service.GetBaseDAOUtil;
 import u8c.ui.mmpac.datamodel.OrderDataModel;
 import u8c.ui.mmpac.panel.OrderMainPanel;
 import u8c.ui.mmpac.panel.OrderTestUI;
@@ -33,6 +34,7 @@ public class OrderUnApproveAction extends AbstractAction {
 		if (null != s && s != null){
 			//OrderMainVO headvo = (OrderMainVO) s[selectedRow].getParentVO();
 			OrderMainVO headvo = (OrderMainVO) s[0].getParentVO();
+			GetBaseDAOUtil.getGeneral(headvo.getPk_order());
 			if (headvo.getBillstatus() != IBillStatus.CHECKPASS){
 				throw new ValidationException("非审批态单据不允许取消审批");
 			}

+ 8 - 0
mmpac/mmpac/src/public/u8c/bs/servlet/service/GetBaseDAOUtil.java

@@ -391,6 +391,14 @@ public class GetBaseDAOUtil {
     	return pk_cubasdoc;
    	}
  
+   	//查询是否存在下游出入库单
+   	public static void getGeneral(String Cfirstbillhid)throws Exception {
+   		String sql = "select cgeneralbid from ic_general_b where Cfirstbillhid = '"+Cfirstbillhid+"' and dr = 0";
+   		String cgeneralbid  = (String) iuap.executeQuery(sql, new ColumnProcessor());
+   		if(cgeneralbid != null) {
+    		throw new Exception("存在下游单据不允许取消审批!");
+    	}
+   	}