SAP模块增加时间参数

highway
Yangwl 1 year ago
parent 4e176bc6ab
commit d755acbb7f

@ -196,5 +196,6 @@
<orderEntry type="library" name="Maven: org.bouncycastle:bcpkix-jdk15on:1.69" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcprov-jdk15on:1.69" level="project" />
<orderEntry type="library" name="Maven: org.bouncycastle:bcutil-jdk15on:1.69" level="project" />
<orderEntry type="library" name="lib" level="project" />
</component>
</module>

@ -6,10 +6,7 @@ import com.op.common.log.enums.BusinessType;
import com.op.sap.service.SapService;
import com.op.system.api.model.SapProOrder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -25,8 +22,8 @@ public class SapController {
*/
@PostMapping("/shopOrderSync")
@Log(title = "同步SAP订单", businessType = BusinessType.SAP)
public List<SapProOrder> shopOrderSync(){
return sapService.shopOrderSync();
public List<SapProOrder> shopOrderSync(@RequestBody SapProOrder sapProOrder){
return sapService.shopOrderSync(sapProOrder);
}
/**

@ -15,5 +15,5 @@ public interface SapService {
List<SapProOrder> shopOrderSync();
List<SapProOrder> shopOrderSync(SapProOrder sapProOrder);
}

@ -52,7 +52,7 @@ public class SapServiceImpl implements SapService {
public String saprouter;
@Override
public List<SapProOrder> shopOrderSync() {
public List<SapProOrder> shopOrderSync(SapProOrder sapProOrder) {
// 连接
SapConn con = new SapConn(
ashost,
@ -232,53 +232,74 @@ public class SapServiceImpl implements SapService {
);
JCoDestination jCoDestination = SAPConnUtils.connect(con);
// 获取调用 RFC 函数对象
JCoFunction func = jCoDestination.getRepository().getFunction("ZMMR_MES_MAT_GET");
JCoFunction func = jCoDestination.getRepository().getFunction("ZPPR_MES_PRO_TO");
// 配置传入参数
JCoParameterList importParameterList = func.getImportParameterList();
System.out.println(importParameterList.getListMetaData());
// importParameterList.setValue("S_ERDAT","2019-11-07" );
// 调用并获取返回值
func.execute(jCoDestination);
// 获取 内表 - ZMES_PRO
JCoTable maraTable = func.getTableParameterList().getTable("LT_MARA");
JCoTable maraTable = func.getTableParameterList().getTable("ZMES_PRO");
JCoRecordMetaData metaData = maraTable.getRecordMetaData();
System.out.println("###" + metaData.toString());
SapProOrder proOrder = new SapProOrder();
List<SapProOrder> proOrderList = new ArrayList<>();
// 循环输出 Table 数据
for (int i = 0; i < maraTable.getNumRows(); i++) {
maraTable.setRow(i);
String MATNR = maraTable.getString("MATNR");
String AUFNR = maraTable.getString("AUFNR");
String AUART = maraTable.getString("AUART");
String MAUFNR = maraTable.getString("MAUFNR");
String PLNBEZ = maraTable.getString("PLNBEZ");
String MAKTX = maraTable.getString("MAKTX");
String EAN11 = maraTable.getString("EAN11");
String MTART = maraTable.getString("MTART");
String MTBEZ = maraTable.getString("MTBEZ");
String MATKL = maraTable.getString("MATKL");
String WGBEZ = maraTable.getString("WGBEZ");
String BRGEW = maraTable.getString("BRGEW");
String NTGEW = maraTable.getString("NTGEW");
String VOLUM = maraTable.getString("VOLUM");
String VOLEH = maraTable.getString("VOLEH");
String MEINS = maraTable.getString("MEINS");
String MEINH = maraTable.getString("MEINH");
String UMREZ = maraTable.getString("UMREZ");
String UMREN = maraTable.getString("UMREN");
String LVORM = maraTable.getString("LVORM");
String MENGE = maraTable.getString("MENGE");
String MHDHB = maraTable.getString("MHDHB");
String SPART = maraTable.getString("SPART");
String SPART_NM = maraTable.getString("SPART_NM");
String MVGR1 = maraTable.getString("MVGR1");
String MVGR1_NM = maraTable.getString("MVGR1_NM");
String MVGR2 = maraTable.getString("MVGR2");
String MVGR2_NM = maraTable.getString("MVGR2_NM");
String MVGR3 = maraTable.getString("MVGR3");
String MVGR3_NM = maraTable.getString("MVGR3_NM");
String MVGR4 = maraTable.getString("MVGR4");
String MVGR4_NM = maraTable.getString("MVGR4_NM");
String MVGR5 = maraTable.getString("MVGR5");
String MVGR5_NM = maraTable.getString("MVGR5_NM");
System.out.println("物料号:" + MATNR + " - 物料描述:" + MAKTX + " - 国际文件号(EAN/UPC)" + EAN11 + " - 物料类型:" + MTART );
String PWERK = maraTable.getString("PWERK");
String GAMNG = maraTable.getString("GAMNG");
String GMEIN = maraTable.getString("GMEIN");
String PLNNR = maraTable.getString("PLNNR");
String GSTRP = maraTable.getString("GSTRP");
String GLTRP = maraTable.getString("GLTRP");
String ERNAM = maraTable.getString("ERNAM");
String ERDAT = maraTable.getString("ERDAT");
String STTXT = maraTable.getString("STTXT");
System.out.println("订单号:" +AUFNR+" - 订单类型:" + AUART+ " - 上级订单编号:" + MAUFNR+ " - 物料号:" + PLNBEZ+ " - 物料描述(短文本):" + MAKTX
+ " - 订单的计划工厂:" + PWERK+ " - 订单数量总计:" + GAMNG+ " - 基本计量单位:" + GMEIN+ " - 任务清单组码:" + PLNNR+ " - 基本开始日期:" + GSTRP
+ " - 基本完成日期:" + GLTRP+ " - 输入者:" + ERNAM+ " - 创建日期:" + ERDAT+ " - 系统状态:" + STTXT);
}
// 循环输出 Table 数据
// for (int i = 0; i < maraTable.getNumRows(); i++) {
// maraTable.setRow(i);
// String MATNR = maraTable.getString("MATNR");
// String MAKTX = maraTable.getString("MAKTX");
// String EAN11 = maraTable.getString("EAN11");
// String MTART = maraTable.getString("MTART");
// String MTBEZ = maraTable.getString("MTBEZ");
// String MATKL = maraTable.getString("MATKL");
// String WGBEZ = maraTable.getString("WGBEZ");
// String BRGEW = maraTable.getString("BRGEW");
// String NTGEW = maraTable.getString("NTGEW");
// String VOLUM = maraTable.getString("VOLUM");
// String VOLEH = maraTable.getString("VOLEH");
// String MEINS = maraTable.getString("MEINS");
// String MEINH = maraTable.getString("MEINH");
// String UMREZ = maraTable.getString("UMREZ");
// String UMREN = maraTable.getString("UMREN");
// String LVORM = maraTable.getString("LVORM");
// String MENGE = maraTable.getString("MENGE");
// String MHDHB = maraTable.getString("MHDHB");
// String SPART = maraTable.getString("SPART");
// String SPART_NM = maraTable.getString("SPART_NM");
// String MVGR1 = maraTable.getString("MVGR1");
// String MVGR1_NM = maraTable.getString("MVGR1_NM");
// String MVGR2 = maraTable.getString("MVGR2");
// String MVGR2_NM = maraTable.getString("MVGR2_NM");
// String MVGR3 = maraTable.getString("MVGR3");
// String MVGR3_NM = maraTable.getString("MVGR3_NM");
// String MVGR4 = maraTable.getString("MVGR4");
// String MVGR4_NM = maraTable.getString("MVGR4_NM");
// String MVGR5 = maraTable.getString("MVGR5");
// String MVGR5_NM = maraTable.getString("MVGR5_NM");
// System.out.println("物料号:" + MATNR + " - 物料描述:" + MAKTX + " - 国际文件号(EAN/UPC)" + EAN11 + " - 物料类型:" + MTART );
// }
}
}

@ -14,12 +14,12 @@ spring:
nacos:
discovery:
namespace: lanju-op
group: zxl
group: ywl
# 服务注册地址
server-addr: 140.249.53.142:8848
config:
namespace: lanju-op
group: zxl
group: ywl
#命名空间
#group: local
# 配置中心地址

Loading…
Cancel
Save