现存量查询接口
This commit is contained in:
		
							parent
							
								
									cd2416ebb6
								
							
						
					
					
						commit
						220e5bf147
					
				|  | @ -14,6 +14,7 @@ import nccloud.openapi.scmpub.pub.TransferCodeToPKTool; | |||
| import nccloud.openapi.scmpub.pubitf.IJsonParamMapping; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
|  | @ -59,7 +60,7 @@ public class APIOnhandQueryIpml implements IAPIOnhandQuery { | |||
|     public OnhandVO[] queryOnhandVOByDimsNoTrans(List<Map<String, Object>> paramMapList) throws BusinessException { | ||||
| 
 | ||||
| 
 | ||||
|         //±<EFBFBD><EFBFBD>ה<EFBFBD>מ¼ל²י | ||||
|         // ±ØÊäÏî¼ì²é | ||||
|         try { | ||||
|             List<OnhandDimVO> onhandDimVOS = new ArrayList<>(); | ||||
|             for (Map<String, Object> paramMap : paramMapList) { | ||||
|  | @ -79,6 +80,7 @@ public class APIOnhandQueryIpml implements IAPIOnhandQuery { | |||
|             return null; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public OnhandVO[] queryOnhandVOByDims(List<Map<String, Object>> paramMapList) throws Exception { | ||||
|         // ±ØÊäÏî¼ì²é | ||||
|  | @ -120,6 +122,45 @@ public class APIOnhandQueryIpml implements IAPIOnhandQuery { | |||
|         return onhandVOs; | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|     public OnhandVO[] onhandQueryBatch(Map<String, Object> paramMap) throws Exception { | ||||
|         try { | ||||
|             List<OnhandDimVO> onhandDimVOS = new ArrayList<>(); | ||||
|             String pk_org = paramMap.get("pk_org").toString(); | ||||
|             if (paramMap.get("cmaterialoid") != null && paramMap.get("cmaterialoid") instanceof List) { | ||||
|                 List<String> cmaterialoids = (List<String>) paramMap.get("cmaterialoid"); | ||||
|                 for (String cmaterialoid : cmaterialoids) { | ||||
|                     Map<String, Object> selMap = new HashMap<>(); | ||||
|                     selMap.put("pk_org", pk_org); | ||||
|                     selMap.put("cmaterialoid", cmaterialoid); | ||||
|                     // ·Òë | ||||
|                     selMap = TransferCodeToPKTool.doTranslateFields(jsonParamMapping, selMap); | ||||
|                     OnhandDataSupplement dataSupplement = new OnhandDataSupplement(); | ||||
|                     OnhandDimVO onhandDimVO = new OnhandDimVO(); | ||||
|                     onhandDimVO = dataSupplement.process(selMap); | ||||
|                     onhandDimVOS.add(onhandDimVO); | ||||
|                 } | ||||
| 
 | ||||
|             } else { | ||||
|                 Map<String, Object> selMap = new HashMap<>(); | ||||
|                 selMap.put("pk_org", pk_org); | ||||
|                 // ·Òë | ||||
|                 selMap = TransferCodeToPKTool.doTranslateFields(jsonParamMapping, selMap); | ||||
|                 OnhandDataSupplement dataSupplement = new OnhandDataSupplement(); | ||||
|                 OnhandDimVO onhandDimVO = new OnhandDimVO(); | ||||
|                 onhandDimVO = dataSupplement.process(selMap); | ||||
|                 onhandDimVOS.add(onhandDimVO); | ||||
|             } | ||||
| 
 | ||||
|             OnhandVO[] onhandVOs = NCLocator.getInstance().lookup(OnhandResService.class) | ||||
|                     .queryOnhandVOByDims(onhandDimVOS.toArray(new OnhandDimVO[0])); | ||||
|             return onhandVOs; | ||||
|         } catch (Exception e) { | ||||
|             ExceptionUtils.marsh(e); | ||||
|             return null; | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| 
 | ||||
|     // ±ØÊäÏîУÑé | ||||
|     private void requiredFieldCheck(String[] requiredField, Map<String, Object> paramMap) { | ||||
|  |  | |||
|  | @ -46,4 +46,13 @@ public interface IAPIOnhandQuery { | |||
|      * @throws Exception 当查询操作失败时抛出的异常 | ||||
|      */ | ||||
|     OnhandVO[] queryOnhandVOByCondition(Map<String, Object> paramMap) throws Exception; | ||||
| 
 | ||||
|     /** | ||||
|      * 根据查询条件查询多个物料的现存量信息 | ||||
|      * | ||||
|      * @param paramMap 参数映射列表,每个映射包含一组查询条件 | ||||
|      * @return OnhandVO[] 查询到的现存量信息数组 | ||||
|      * @throws Exception 当查询操作失败时抛出的异常 | ||||
|      */ | ||||
|     OnhandVO[] onhandQueryBatch(Map<String, Object> paramMap) throws Exception; | ||||
| } | ||||
|  |  | |||
|  | @ -773,7 +773,7 @@ public class OnhandResource { | |||
|         } | ||||
|         try { | ||||
|             OnhandVO[] onhandVOs = NCLocator.getInstance().lookup(IAPIOnhandQuery.class) | ||||
|                     .queryOnhandVOByDims(paramMap); | ||||
|                     .onhandQueryBatch(paramMap); | ||||
|             // 对数据进行整合组装,返回物料+仓库+数量 | ||||
|             if (null != onhandVOs && onhandVOs.length > 0) { | ||||
|                 // 收集所有物料和仓库ID | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue