SAP接口ZIM_001_QUERY调整为ZWM3A05,ZIM_001调整为ZWM3A06
This commit is contained in:
parent
2e172a4451
commit
e918caa8b8
|
|
@ -60,7 +60,7 @@ public class OutPurchaseController extends BaseController {
|
|||
*/
|
||||
@GetMapping("getForOut")
|
||||
public ApiResult<Zim001QueryResultDTO> getForOut(String orderNo){
|
||||
Zim001QueryResultDTO result = sapService.zim001query(orderNo);
|
||||
Zim001QueryResultDTO result = sapService.zwm3A05(orderNo, null, null);
|
||||
result.getItem1().parallelStream().forEach(it->{
|
||||
it.setBinNos(binService.getBinNos(it.getMATNR(),it.getWERKS(),it.getLGORT()));
|
||||
});
|
||||
|
|
@ -119,7 +119,7 @@ public class OutPurchaseController extends BaseController {
|
|||
VUtil.trueThrowBusinessError(CollectionUtil.isNotEmpty(errors)).throwMessage("以下物料的批次号不符合要求:"+StrUtil.join(",",errors));
|
||||
//扣减库存
|
||||
inventoryService.out(inventories);
|
||||
sapService.zim001(request);
|
||||
sapService.zwm3A06(request);
|
||||
return ApiResult.success();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -111,15 +111,19 @@ public class SapService {
|
|||
/**
|
||||
* 查询采购单退库信息
|
||||
* @param orderNo 采购单号
|
||||
* @param supplierNo 供应商编号
|
||||
* @param materialNo 物料编号
|
||||
*/
|
||||
public Zim001QueryResultDTO zim001query(String orderNo) {
|
||||
public Zim001QueryResultDTO zwm3A05(String orderNo, String supplierNo, String materialNo) {
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
parameters.put("EBELN", orderNo);
|
||||
parameters.put("I_EBELN", orderNo);
|
||||
parameters.put("I_LIFNR", supplierNo);
|
||||
parameters.put("I_MATNR", materialNo);
|
||||
|
||||
Zim001QueryResultDTO result=new Zim001QueryResultDTO();
|
||||
JCoFunction function = exec("ZIM_001_QUERY", parameters, null);
|
||||
JCoFunction function = exec("ZWM3A05", parameters, null);
|
||||
|
||||
JCoStructure structure = function.getExportParameterList().getStructure("OUTPUT");
|
||||
JCoStructure structure = function.getExportParameterList().getStructure("E_RETURN");
|
||||
VUtil.trueThrowBusinessError(!StrUtil.equals(structure.getString("TYPE"), "S"))
|
||||
.throwMessage("SAP错误:" + structure.getString("MSG"));
|
||||
|
||||
|
|
@ -162,7 +166,10 @@ public class SapService {
|
|||
return result;
|
||||
}
|
||||
|
||||
public void zim001(Zim001QueryResultDTO dto){
|
||||
public void zwm3A06(Zim001QueryResultDTO dto) {
|
||||
Map<String, Object> parameters = new HashMap<>();
|
||||
parameters.put("I_EBELN", dto.getItem1().get(0).getEBELN());
|
||||
|
||||
Map<String, List<Map<String, Object>>> tables = new HashMap<>();
|
||||
List<Map<String, Object>> list1 = new ArrayList<>();
|
||||
dto.getItem1().forEach(item -> {
|
||||
|
|
@ -194,7 +201,7 @@ public class SapService {
|
|||
});
|
||||
tables.put("INPUT2", list2);
|
||||
|
||||
JCoParameterList jparameters = execReturnParameter("ZIM_001", null, tables);
|
||||
JCoParameterList jparameters = execReturnParameter("ZWM3A06", parameters, tables);
|
||||
JCoStructure structure=jparameters.getStructure("OUTPUT");
|
||||
VUtil.trueThrowBusinessError(!StrUtil.equals(structure.getString("TYPE"), "S"))
|
||||
.throwMessage("SAP错误:" + structure.getString("MSG"));
|
||||
|
|
|
|||
Loading…
Reference in New Issue