|
|
@ -93,6 +93,9 @@ public class SapOrderServiceImpl implements SapOrderService {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func.execute(dest);//执行调用函数
|
|
|
|
func.execute(dest);//执行调用函数
|
|
|
|
// 获取 内表 - ZMES_PRO
|
|
|
|
// 获取 内表 - ZMES_PRO
|
|
|
|
JCoTable maraTable = func.getTableParameterList().getTable("ZMES_PRO");
|
|
|
|
JCoTable maraTable = func.getTableParameterList().getTable("ZMES_PRO");
|
|
|
@ -118,8 +121,7 @@ public class SapOrderServiceImpl implements SapOrderService {
|
|
|
|
String ERDAT = maraTable.getString("ERDAT");
|
|
|
|
String ERDAT = maraTable.getString("ERDAT");
|
|
|
|
String STTXT = maraTable.getString("STTXT");
|
|
|
|
String STTXT = maraTable.getString("STTXT");
|
|
|
|
String VERID = maraTable.getString("VERID");
|
|
|
|
String VERID = maraTable.getString("VERID");
|
|
|
|
|
|
|
|
log.info("订单输出------:"+"订单号:" + AUFNR + " - 订单类型:" + AUART + "-生产版本:"+ VERID +" -上级订单编号:" + MAUFNR + " - 物料号:" + PLNBEZ + " - 物料描述(短文本):" + MAKTX
|
|
|
|
log.info("订单输出------:" + "订单号:" + AUFNR + " - 订单类型:" + AUART + " - 生产版本:" + VERID + " - 上级订单编号:" + MAUFNR + " - 物料号:" + PLNBEZ + " - 物料描述(短文本):" + MAKTX
|
|
|
|
|
|
|
|
+ " - 订单的计划工厂:" + PWERK + " - 订单数量总计:" + GAMNG + " - 基本计量单位:" + GMEIN + " - 任务清单组码:" + PLNNR + " - 基本开始日期:" + GSTRP
|
|
|
|
+ " - 订单的计划工厂:" + PWERK + " - 订单数量总计:" + GAMNG + " - 基本计量单位:" + GMEIN + " - 任务清单组码:" + PLNNR + " - 基本开始日期:" + GSTRP
|
|
|
|
+ " - 基本完成日期:" + GLTRP + " - 输入者:" + ERNAM + " - 创建日期:" + ERDAT + " - 系统状态:" + STTXT);
|
|
|
|
+ " - 基本完成日期:" + GLTRP + " - 输入者:" + ERNAM + " - 创建日期:" + ERDAT + " - 系统状态:" + STTXT);
|
|
|
|
// System.out.println("订单号:" + AUFNR + " - 订单类型:" + AUART + " - 上级订单编号:" + MAUFNR + " - 物料号:" + PLNBEZ + " - 物料描述(短文本):" + MAKTX
|
|
|
|
// System.out.println("订单号:" + AUFNR + " - 订单类型:" + AUART + " - 上级订单编号:" + MAUFNR + " - 物料号:" + PLNBEZ + " - 物料描述(短文本):" + MAKTX
|
|
|
@ -183,7 +185,6 @@ public class SapOrderServiceImpl implements SapOrderService {
|
|
|
|
jCoParameterList.setValue("P_QUANTITY",sapCreateOrder.getQuantity());
|
|
|
|
jCoParameterList.setValue("P_QUANTITY",sapCreateOrder.getQuantity());
|
|
|
|
jCoParameterList.setValue("P_DATES",sapCreateOrder.getDates());
|
|
|
|
jCoParameterList.setValue("P_DATES",sapCreateOrder.getDates());
|
|
|
|
jCoParameterList.setValue("P_DATEE",sapCreateOrder.getDatee());
|
|
|
|
jCoParameterList.setValue("P_DATEE",sapCreateOrder.getDatee());
|
|
|
|
jCoParameterList.setValue("P_VERID", sapCreateOrder.getVerid());
|
|
|
|
|
|
|
|
func.execute(dest);//执行调用函数
|
|
|
|
func.execute(dest);//执行调用函数
|
|
|
|
JCoParameterList J= func.getExportParameterList();
|
|
|
|
JCoParameterList J= func.getExportParameterList();
|
|
|
|
System.out.println(func.getExportParameterList());
|
|
|
|
System.out.println(func.getExportParameterList());
|
|
|
@ -214,6 +215,7 @@ public class SapOrderServiceImpl implements SapOrderService {
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public R sapCloseOrder(SapCloseOrderQuery sapCloseOrderQuery) {
|
|
|
|
public R sapCloseOrder(SapCloseOrderQuery sapCloseOrderQuery) {
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder Msg = new StringBuilder();
|
|
|
|
StringBuilder Msg = new StringBuilder();
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
//获取连接
|
|
|
|
//获取连接
|
|
|
@ -240,6 +242,7 @@ public class SapOrderServiceImpl implements SapOrderService {
|
|
|
|
// System.out.println(J);
|
|
|
|
// System.out.println(J);
|
|
|
|
String L_MSG1= func.getExportParameterList().getString("L_MSG");
|
|
|
|
String L_MSG1= func.getExportParameterList().getString("L_MSG");
|
|
|
|
Msg.append(sapCloseOrderQuery.getLeadOrder()+L_MSG1+";");
|
|
|
|
Msg.append(sapCloseOrderQuery.getLeadOrder()+L_MSG1+";");
|
|
|
|
|
|
|
|
|
|
|
|
//关闭子订单
|
|
|
|
//关闭子订单
|
|
|
|
jCoParameterList.setValue("P_AUFNR",sapCloseOrderQuery.getOrder());
|
|
|
|
jCoParameterList.setValue("P_AUFNR",sapCloseOrderQuery.getOrder());
|
|
|
|
func.execute(dest);//执行调用函数
|
|
|
|
func.execute(dest);//执行调用函数
|
|
|
@ -289,6 +292,7 @@ public class SapOrderServiceImpl implements SapOrderService {
|
|
|
|
* 生产订单报工工时 LT_GS
|
|
|
|
* 生产订单报工工时 LT_GS
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
JCoTable LT_GS_jCoTable = func.getTableParameterList().getTable("LT_GS");
|
|
|
|
JCoTable LT_GS_jCoTable = func.getTableParameterList().getTable("LT_GS");
|
|
|
|
|
|
|
|
// System.out.println("LT_GS_jCoTable"+LT_GS_jCoTable);
|
|
|
|
LT_GS_jCoTable.appendRow();
|
|
|
|
LT_GS_jCoTable.appendRow();
|
|
|
|
LT_GS_jCoTable.setValue("CONF_ACTIVITY1", sapRFW.getLt_gs().getConf_activity1());
|
|
|
|
LT_GS_jCoTable.setValue("CONF_ACTIVITY1", sapRFW.getLt_gs().getConf_activity1());
|
|
|
|
LT_GS_jCoTable.setValue("CONF_ACTIVITY2", sapRFW.getLt_gs().getConf_activity2());
|
|
|
|
LT_GS_jCoTable.setValue("CONF_ACTIVITY2", sapRFW.getLt_gs().getConf_activity2());
|
|
|
@ -300,20 +304,24 @@ public class SapOrderServiceImpl implements SapOrderService {
|
|
|
|
* MES生产订单报工货物移动修改 LT_HW
|
|
|
|
* MES生产订单报工货物移动修改 LT_HW
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
JCoTable LT_HW_jCoTable = func.getTableParameterList().getTable("LT_HW");
|
|
|
|
JCoTable LT_HW_jCoTable = func.getTableParameterList().getTable("LT_HW");
|
|
|
|
|
|
|
|
//System.out.println("LT_HW_jCoTable"+LT_HW_jCoTable);
|
|
|
|
for (SapRFW.lt_hw lt_hw:sapRFW.getLt_hwList()){
|
|
|
|
for (SapRFW.lt_hw lt_hw:sapRFW.getLt_hwList()){
|
|
|
|
LT_HW_jCoTable.appendRow();
|
|
|
|
LT_HW_jCoTable.appendRow();
|
|
|
|
LT_HW_jCoTable.setValue("MATERIAL", lt_hw.getMaterial());
|
|
|
|
LT_HW_jCoTable.setValue("MATERIAL", lt_hw.getMaterial());
|
|
|
|
LT_HW_jCoTable.setValue("ENTRY_QNT", lt_hw.getEntry_qnt());
|
|
|
|
LT_HW_jCoTable.setValue("ENTRY_QNT", lt_hw.getEntry_qnt());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func.execute(dest);//执行调用函数
|
|
|
|
func.execute(dest);//执行调用函数
|
|
|
|
|
|
|
|
JCoParameterList J= func.getExportParameterList();
|
|
|
|
|
|
|
|
System.out.println(func.getExportParameterList());
|
|
|
|
String RETCODE= func.getExportParameterList().getString("RETCODE");
|
|
|
|
String RETCODE= func.getExportParameterList().getString("RETCODE");
|
|
|
|
MESSAGE= func.getExportParameterList().getString("MESSAGE");
|
|
|
|
MESSAGE= func.getExportParameterList().getString("MESSAGE");
|
|
|
|
if (Constants.RFW_FAIL.equals(RETCODE)) {
|
|
|
|
if (Constants.FAIL.equals(RETCODE)){
|
|
|
|
log.error("订单号:" + sapRFW.getAufnr() + "报工失败" + MESSAGE);
|
|
|
|
|
|
|
|
return R.fail("订单号:"+sapRFW.getAufnr()+"报工失败"+MESSAGE);
|
|
|
|
return R.fail("订单号:"+sapRFW.getAufnr()+"报工失败"+MESSAGE);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log.error("订单号:" + sapRFW.getAufnr() + "报工成功" + MESSAGE);
|
|
|
|
|
|
|
|
return R.ok("",MESSAGE);
|
|
|
|
return R.ok("",MESSAGE);
|
|
|
|
|
|
|
|
|
|
|
|
}catch (Exception e){
|
|
|
|
}catch (Exception e){
|
|
|
|
return R.fail(e.getMessage());
|
|
|
|
return R.fail(e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -425,6 +433,7 @@ public class SapOrderServiceImpl implements SapOrderService {
|
|
|
|
}catch (Exception e){
|
|
|
|
}catch (Exception e){
|
|
|
|
return R.fail(e.getMessage());
|
|
|
|
return R.fail(e.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
@ -439,10 +448,12 @@ public class SapOrderServiceImpl implements SapOrderService {
|
|
|
|
if (func == null) {
|
|
|
|
if (func == null) {
|
|
|
|
throw new RuntimeException("Function does not exist in SAP");
|
|
|
|
throw new RuntimeException("Function does not exist in SAP");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (StringUtils.isEmpty(sapProOrder.getAufnr())) {
|
|
|
|
if (StringUtils.isEmpty(sapProOrder.getAufnr()))
|
|
|
|
|
|
|
|
{
|
|
|
|
return R.fail("订单号为空!");
|
|
|
|
return R.fail("订单号为空!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (StringUtils.isEmpty(sapProOrder.getQuantity())) {
|
|
|
|
if (StringUtils.isEmpty(sapProOrder.getQuantity()))
|
|
|
|
|
|
|
|
{
|
|
|
|
return R.fail("数量为空!");
|
|
|
|
return R.fail("数量为空!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|