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

生单其它出入库优化

zthwr пре 10 месеци
родитељ
комит
63fefd7dc3

+ 15 - 4
mmpac/mmpac/src/client/u8c/ui/mmpac/action/PushOtherInAction.java

@@ -117,9 +117,17 @@ public class PushOtherInAction extends AbstractAction{
 					OrderOtherinVO invo = invos[i];
 					//校验已执行数量等于主数量不让再执行生单操作
 					UFDouble exenumvo=invo.getExecnum()==null?UFDouble.ZERO_DBL: new UFDouble (invo.getExecnum());//已执行数量
-					if(new UFDouble (invo.getNum()).sub(exenumvo).compareTo(UFDouble.ZERO_DBL)<=0) {
-						MessageDialog.showErrorDlg(frameUI, "失败", "已经生成其他入库单,不允许重复生成!");
-						return;
+					if(!invo.getCmaterialcode().startsWith("MA")) {
+						if(new UFDouble (invo.getNum()).sub(exenumvo).compareTo(UFDouble.ZERO_DBL)<=0) {
+							MessageDialog.showErrorDlg(frameUI, "失败", "已经生成其他入库单,不允许重复生成!");
+							return;
+						}
+					}else {
+						UFDouble execnastnum=invo.getExecnastnum()==null?UFDouble.ZERO_DBL: new UFDouble (invo.getExecnastnum());//已执行辅数量
+						if(new UFDouble (invo.getNastnum()).sub(execnastnum).compareTo(UFDouble.ZERO_DBL)<=0) {
+							MessageDialog.showErrorDlg(frameUI, "失败", "已经生成其他入库单,不允许重复生成!");
+							return;
+						}
 					}
 					
 					GeneralBillItemVO itemvo = new GeneralBillItemVO();
@@ -158,10 +166,13 @@ public class PushOtherInAction extends AbstractAction{
 					itemvo.setCbodybilltypecode("4A");
 		//			itemvo.setCbodywarehouseid("1001V5100000000003A1");
 					//仓库ID
+					String storcode="";
 					if("工装".equals(billtype)) {
 						icheadvo.setCwarehouseid(GetBaseDAOUtil.getstordocpk("GZ001"));//仓库必填
+						storcode="GZ001";
 					}else if("家装".equals(billtype)) {
 						icheadvo.setCwarehouseid(GetBaseDAOUtil.getstordocpk("JZ002"));//仓库必填
+						storcode="JZ002";
 					}
 					itemvo.setCfirstbillhid(pk_order);
 					itemvo.setCfirstbillbid(invo.getPrimaryKey());
@@ -189,7 +200,7 @@ public class PushOtherInAction extends AbstractAction{
 					if(cmaterialcode.startsWith("MA")) {
 						InvbasdocVO  invbasvo = GetBaseDAOUtil.getInvVO(cmaterialcode);
 					    String pk_invbasdoc2 = invbasvo.getPrimaryKey();
-					    Object objbdef6 =getHandNum("1001", billtype, pk_invbasdoc2, vbatcode, 
+					    Object objbdef6 =getHandNum("1001", storcode, pk_invbasdoc2, vbatcode, 
 					    		invo.getColor(), invo.getSizing(), invo.getAlloy(), invo.getStandard());//现存量换算率
 					    if(null==objbdef6 || "".equals(objbdef6.toString())) {
 							MessageDialog.showErrorDlg(frameUI, "错误", "MA开头的现存量未查询到!无法计算换算率!");

+ 16 - 5
mmpac/mmpac/src/client/u8c/ui/mmpac/action/PushOtherOutAction.java

@@ -118,11 +118,19 @@ public class PushOtherOutAction extends AbstractAction{
 					OrderOtheroutVO outvo = outvos[i];
 					//校验已执行数量等于主数量不让再执行生单操作
 					UFDouble exenumvo=outvo.getExecnum()==null?UFDouble.ZERO_DBL: new UFDouble (outvo.getExecnum());//已执行数量
-					if(new UFDouble (outvo.getNum()).sub(exenumvo).compareTo(UFDouble.ZERO_DBL)<=0) {
-						MessageDialog.showErrorDlg(frameUI, "失败", "已经生成其他入库单,不允许重复生成!");
-						return;
+					if(!outvo.getCmaterialcode().startsWith("MA")) {
+						if(new UFDouble (outvo.getNum()).sub(exenumvo).compareTo(UFDouble.ZERO_DBL)<=0) {
+							MessageDialog.showErrorDlg(frameUI, "失败", "已经生成其他出库单,不允许重复生成!");
+							return;
+						}
+						
+					}else {
+						UFDouble execnastnum=outvo.getExecnastnum()==null?UFDouble.ZERO_DBL: new UFDouble (outvo.getExecnastnum());//已执行辅数量
+						if(new UFDouble (outvo.getNastnum()).sub(execnastnum).compareTo(UFDouble.ZERO_DBL)<=0) {
+							MessageDialog.showErrorDlg(frameUI, "失败", "已经生成其他出库单,不允许重复生成!");
+							return;
+						}
 					}
-					
 					GeneralBillItemVO itemvo = new GeneralBillItemVO();
 					String cmaterialcode = outvo.getCmaterialcode();
 					String pk_invbasdoc = "";//存货pk
@@ -158,11 +166,14 @@ public class PushOtherOutAction extends AbstractAction{
 					itemvo.setBzgflag(UFBoolean.FALSE);
 					itemvo.setCbodybilltypecode("4I");
 	//				itemvo.setCbodywarehouseid("1001V5100000000003A1");
+					String storcode="";
 					//仓库ID
 					if("工装".equals(billtype)) {
 						icheadvo.setCwarehouseid(GetBaseDAOUtil.getstordocpk("GZ001"));//仓库必填
+						storcode="GZ001";
 					}else if("家装".equals(billtype)) {
 						icheadvo.setCwarehouseid(GetBaseDAOUtil.getstordocpk("JZ002"));//仓库必填
+						storcode="JZ002";
 					}
 					itemvo.setCfirstbillhid(pk_order);
 					itemvo.setCfirstbillbid(outvo.getPrimaryKey());
@@ -194,7 +205,7 @@ public class PushOtherOutAction extends AbstractAction{
 					if(cmaterialcode.startsWith("MA")) {
 						InvbasdocVO  invbasvo = GetBaseDAOUtil.getInvVO(cmaterialcode);
 					    String pk_invbasdoc2 = invbasvo.getPrimaryKey();
-					    Object objbdef6 =getHandNum("1001", billtype, pk_invbasdoc2, vbatcode, 
+					    Object objbdef6 =getHandNum("1001", storcode, pk_invbasdoc2, vbatcode, 
 					    		outvo.getColor(), outvo.getSizing(), outvo.getAlloy(), outvo.getStandard());//现存量换算率
 					    if(null==objbdef6 || "".equals(objbdef6.toString())) {
 							MessageDialog.showErrorDlg(frameUI, "错误", "MA开头的现存量未查询到!无法计算换算率!");