Merge remote-tracking branch 'origin/master'

master
zhaoxiaolin 6 months ago
commit dba2cab5ff

@ -13,15 +13,15 @@ spring:
cloud: cloud:
nacos: nacos:
discovery: discovery:
namespace: lanju-op namespace: lanju-op-test
group: zxl group: test
# 服务注册地址 # 服务注册地址
server-addr: 175.27.215.92:8848 server-addr: 192.168.202.20:8848
config: config:
namespace: lanju-op namespace: lanju-op-test
group: zxl group: test
# 服务注册地址 # 服务注册地址
server-addr: 175.27.215.92:8848 server-addr: 192.168.202.20:8848
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

@ -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,61 @@ 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");
log.info("暂收结果结果-----" + RETCODE+"/" +MESSAGE+"/" +MATERIALDOCUMENT+"/" +MATDOCUMENTYEAR);
if((Constants.FAIL).equals(Integer.parseInt(RETCODE))){
return R.fail(MESSAGE);
}
Map Resmap = new HashMap();
Resmap.put("MATERIALDOCUMENT", MATERIALDOCUMENT);
Resmap.put("MATDOCUMENTYEAR", MATDOCUMENTYEAR);
return R.ok(Resmap, MESSAGE);
} catch (Exception e) {
log.error(e.getMessage());
return R.fail(e.getMessage());
}
}
} }

Loading…
Cancel
Save