Browse Source

材料出库MA型材优化

zthwr 10 months ago
parent
commit
11925f8dd3
1 changed files with 27 additions and 11 deletions
  1. 27 11
      mmpac/mmpac/src/client/u8c/ui/mmpac/action/ToMaterialOutDialog.java

+ 27 - 11
mmpac/mmpac/src/client/u8c/ui/mmpac/action/ToMaterialOutDialog.java

@@ -1045,17 +1045,33 @@ public class ToMaterialOutDialog extends UIDialog implements ActionListener,Bill
 	 */
    	public  Object  getHandNum(String pk_corp,String storcode,String cinvbasid,String vbatchcode, String color ,String sizing,String alloy,String standard)throws Exception {
    		StringBuffer sql = new StringBuffer();
-   		sql.append("SELECT ");
-   		sql.append(" nonhandnum/nonhandastnum as hsl");
-   		sql.append(" FROM");
-   		sql.append(" ic_onhandnum");
-   		sql.append(" WHERE");
-   		sql.append(" pk_corp = '"+pk_corp+"'");
-   		sql.append(" AND cwarehouseid = ( SELECT pk_stordoc FROM bd_stordoc WHERE storcode = '"+storcode+"' and sealflag = 'N' and dr = 0)");
-   		sql.append(" AND cinvbasid = '"+cinvbasid+"' AND vfree1='"+color+"' AND vfree2='"+alloy+"' AND vfree3='"+sizing+"' AND vfree4='"+standard+"' ");
-   		if(vbatchcode != null) {
-   			sql.append(" AND vlot = '"+vbatchcode+"'");
-   		}
+		sql.append("SELECT ");
+		sql.append(" nonhandnum/nonhandastnum as hsl");
+		sql.append(" FROM");
+		sql.append(" ic_onhandnum");
+		sql.append(" WHERE");
+		sql.append(" pk_corp = '"+pk_corp+"'");
+		sql.append(" AND cwarehouseid = ( SELECT pk_stordoc FROM bd_stordoc WHERE storcode = '"+storcode+"' and sealflag = 'N' and dr = 0)");
+		sql.append(" AND cinvbasid = '"+cinvbasid+"'  ");
+		if(vbatchcode != null && !"".equals(vbatchcode)) {
+			sql.append(" AND vlot = '"+vbatchcode+"' ");
+		}
+		
+		if(color != null && !"".equals(color)) {
+			sql.append(" AND vfree1='"+color+"' ");
+		}
+		
+		if(alloy != null && !"".equals(alloy)) {
+			sql.append(" AND vfree2='"+alloy+"' ");
+		}
+		
+		if(sizing != null && !"".equals(sizing)) {
+			sql.append(" AND vfree3='"+sizing+"' ");
+		}
+		
+		if(standard != null && !"".equals(standard)) {
+			sql.append("  AND vfree4='"+standard+"' ");
+		}
    		return  iuap.executeQuery(sql.toString(), new ColumnProcessor());
    	}