103接口收货

master
Yangwl 6 months ago
parent 3cdac663ca
commit b86164b76b

@ -100,14 +100,15 @@
<groupId>com.sap.conn</groupId> <groupId>com.sap.conn</groupId>
<artifactId>sapjco</artifactId> <artifactId>sapjco</artifactId>
<version>3.0.8</version> <version>3.0.8</version>
<!-- <scope>system</scope>--> <!-- <scope>system</scope>-->
<!-- <systemPath>${project.basedir}/src/main/lib/sapjco3.jar</systemPath>--> <!-- <systemPath>${project.basedir}/src/main/lib/sapjco3.jar</systemPath>-->
</dependency> </dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>

@ -495,6 +495,17 @@ public class SapController extends BaseController {
return sapItemSyncService.FPinventory(mapList); return sapItemSyncService.FPinventory(mapList);
} }
/**
*
* @param mapList
* @return
*/
@PostMapping("/temporarilyCollected")
@Log(title = "来料暂收接口", businessType = BusinessType.SAP)
public R temporarilyCollected(@RequestBody(required = false) List<Map> mapList) {
return sapItemSyncService.temporarilyCollected(mapList);
}
/** /**
* 105() * 105()
*/ */
@ -518,4 +529,6 @@ public class SapController extends BaseController {
dynamicRoutingDataSource.removeDataSource(dataSourceProperty.getPoolName()); dynamicRoutingDataSource.removeDataSource(dataSourceProperty.getPoolName());
return R.ok(); return R.ok();
} }
} }

@ -36,4 +36,6 @@ public interface SapItemSyncService {
R FPinventory(Map<String, Object> mapList); R FPinventory(Map<String, Object> mapList);
R incomingConversion(Map<String, Object> mapList); R incomingConversion(Map<String, Object> mapList);
R temporarilyCollected(List<Map> mapList);
} }

@ -594,5 +594,55 @@ public class SapItemSyncImpl implements SapItemSyncService {
} }
} }
/**
* ZMES_103_MIGOMIGO-103
*
* EBELN CHAR 10 0
* EBELP NUMC 5 0
* MATNR CHAR 18 0
* WERKS CHAR 4 0
* QUANTITY QUAN 13 3
* @param mapList
* @return
*/
@Override
public R temporarilyCollected(List<Map> mapList) {
try {
JCoRepository repository = dest.getRepository();
JCoFunction func = repository.getFunction("ZMES_103_MIGO");
if (func == null) {
throw new RuntimeException("Function does not exist in SAP");
}
log.info("来料暂收参数-------" + mapList.toString());
JCoTable L_ITEM = func.getTableParameterList().getTable("L_ITEM");
System.out.println(L_ITEM);
for (Map map : mapList) {
L_ITEM.appendRow();
L_ITEM.setValue("EBELN", map.get("EBELN"));
L_ITEM.setValue("EBELP", map.get("EBELP"));
L_ITEM.setValue("MATNR", map.get("MATNR"));
L_ITEM.setValue("WERKS", map.get("WERKS"));
L_ITEM.setValue("QUANTITY", map.get("QUANTITY"));
}
System.out.println(L_ITEM);
func.execute(dest);//执行调用函数
/**
* RETCODE CHAR3 200-500-
* L_MSG CHAR220
* MATERIALDOCUMENT CHAR10
* MATDOCUMENTYEAR NUMC4
*/
String RETCODE = func.getExportParameterList().getString("RETCODE");
String MESSAGE = func.getExportParameterList().getString("L_MSG");
String MATERIALDOCUMENT = func.getExportParameterList().getString("MATERIALDOCUMENT");
String MATDOCUMENTYEAR = func.getExportParameterList().getString("MATDOCUMENTYEAR");
System.out.println(RETCODE+"/" +MESSAGE+"/" +MATERIALDOCUMENT+"/" +MATDOCUMENTYEAR);
return R.ok();
} catch (Exception e) {
log.error(e.getMessage());
return R.fail(e.getMessage());
}
}
} }

Loading…
Cancel
Save