Browse Source

MRP运算清单MA型材优化

zthwr 10 months ago
parent
commit
5e24ca0722
1 changed files with 28 additions and 12 deletions
  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());
 								InvbasdocVO  invbasvo = GetBaseDAOUtil.getInvVO(vo.getCmaterialcode());
 							    String pk_invbasdoc = invbasvo.getPrimaryKey();
 							    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());//现存量换算率  
 							 			                vo.getSizing(), vo.getAlloy(), vo.getStandard());//现存量换算率  
 								
 								
 							    if(null==objbdef6 || "".equals(objbdef6.toString())) {
 							    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 {
    	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();
    		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());
    		return  iuap.executeQuery(sql.toString(), new ColumnProcessor());
    	}
    	}