Explorar o código

MRP运算清单MA型材优化

zthwr hai 10 meses
pai
achega
5e24ca0722
Modificáronse 1 ficheiros con 28 adicións e 12 borrados
  1. 28 12
      mm/mm/src/client/u8c/ui/mm/action/YsAction.java

+ 28 - 12
mm/mm/src/client/u8c/ui/mm/action/YsAction.java

@@ -324,7 +324,7 @@ public class YsAction extends YsQuseryAction{
 								//只有辅数量
 								InvbasdocVO  invbasvo = GetBaseDAOUtil.getInvVO(vo.getCmaterialcode());
 							    String pk_invbasdoc = invbasvo.getPrimaryKey();
-								Object objbdef6 =getHandNum("1001", "工装", pk_invbasdoc, vo.getVbatchcode(), vo.getColor(), 
+								Object objbdef6 =getHandNum("1001", "GZ001", pk_invbasdoc, vo.getVbatchcode(), vo.getColor(), 
 							 			                vo.getSizing(), vo.getAlloy(), vo.getStandard());//现存量换算率  
 								
 							    if(null==objbdef6 || "".equals(objbdef6.toString())) {
@@ -1631,17 +1631,33 @@ public class YsAction extends YsQuseryAction{
 	 */
    	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());
    	}