SAP报工相关

highway
Yangwl 1 year ago
parent fc43732c0c
commit e230ba1bd3

@ -44,7 +44,7 @@ public class SapRFW {
} }
public class lt_gs public static class lt_gs
{ {
String conf_activity1; String conf_activity1;
String conf_activity2; String conf_activity2;
@ -114,7 +114,7 @@ public class SapRFW {
} }
} }
public class lt_hw{ public static class lt_hw{
String material; String material;
String entry_qnt; String entry_qnt;

@ -137,4 +137,14 @@ public class Constants {
public static final String LOW="LOW"; public static final String LOW="LOW";
public static final String HIGH="HIGH"; public static final String HIGH="HIGH";
/**
* SAP
*/
//退料
public static final Integer TL=262;
//领料
public static final Integer LL=261;
} }

@ -52,27 +52,8 @@ public class SapController extends BaseController {
@Autowired @Autowired
private SapBomMapper sapBomMapper; private SapBomMapper sapBomMapper;
/**
*
* @return
*/
@PostMapping("/shopOrderSync")
@Log(title = "同步SAP订单", businessType = BusinessType.SAP)
public R<List<SapProOrder>> shopOrderSync(@RequestBody SapShopOrderQuery sapProOrder){
return sapOrderService.shopOrderSync(sapProOrder);
}
/**
* SAP
*
*/
@PostMapping("/shopUpdateSync")
@Log(title = "修改SAP订单", businessType = BusinessType.SAP)
public R shopUpdateSync(@RequestBody SapShopOrderQuery sapProOrder){
return sapOrderService.shopUpdateSync(sapProOrder);
}
/**====================主数据相关===================================================================================*/
/** /**
* *
* @param * @param
@ -113,7 +94,7 @@ public class SapController extends BaseController {
} }
/** /**
* * BOM
* @return * @return
*/ */
@PostMapping("/bomSync") @PostMapping("/bomSync")
@ -151,7 +132,6 @@ public class SapController extends BaseController {
} }
/** /**
* 线 * 线
* @return * @return
@ -176,7 +156,7 @@ public class SapController extends BaseController {
calendar.setTime(maxTime0); calendar.setTime(maxTime0);
calendar.add(Calendar.DAY_OF_YEAR, 1); calendar.add(Calendar.DAY_OF_YEAR, 1);
Date maxTime = calendar.getTime(); Date maxTime = calendar.getTime();
// qo.setAedat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923 // qo.setAedat(DateFormatUtils.format(maxTime, "yyyyMMdd"));//修改日期20230923
} }
qo.setWerks(dateSource.get("poolName").replace("ds_", ""));//工厂 qo.setWerks(dateSource.get("poolName").replace("ds_", ""));//工厂
@ -190,74 +170,6 @@ public class SapController extends BaseController {
return R.ok(); return R.ok();
} }
/**
*
* @param shopOrder
* @return
*/
@PostMapping("/materialPreparation")
@Log(title = "生产订单备料单接口", businessType = BusinessType.SAP)
public R<List<SapMaterialPreparation>> materialPreparation(@RequestParam("shopOrder") String shopOrder){
return sapMaterialPreparationService.MaterialPreparation(shopOrder);
}
/**
*
* ***
* @param sapBackflushMPQueryList
* @return
*/
@PostMapping("/sapBackflushMP")
@Log(title = "", businessType = BusinessType.SAP)
public R sapBackflushMP(@RequestBody List<SapBackflushMPQuery> sapBackflushMPQueryList){
return sapItemSyncService.sapBackflushMP(sapBackflushMPQueryList);
}
@PostMapping("/sapMaterialPosting")
@Log(title = "订单物料领料过账、原材料补料、订单物料退料过账接口MB1A", businessType = BusinessType.SAP)
public R sapMaterialPosting(@RequestBody SapMaterialPosting sapMaterialPosting){
return sapItemSyncService.sapMaterialPosting(sapMaterialPosting);
}
/**
*
* @param sapCreateOrderList
* @return
*/
@PostMapping("/sapCreateOrder")
@Log(title = "生产订单创建接口", businessType = BusinessType.SAP)
public R<List<Map<String, String>>> SapCreateOrder(@RequestBody List<SapCreateOrder> sapCreateOrderList){
return sapOrderService.SapCreateOrder(sapCreateOrderList);
}
/**
*
*
* @param sapCloseOrderQuery
* @return
*/
@PostMapping("/sapCloseOrder")
@Log(title = "生产订单关闭接口", businessType = BusinessType.SAP)
public R sapCloseOrder(@RequestBody SapCloseOrderQuery sapCloseOrderQuery){
return sapOrderService.sapCloseOrder(sapCloseOrderQuery);
}
/**
*
* @param sapRFW
* @return
*/
@PostMapping("/sapRFWOrder")
@Log(title = "生产订单报工接口", businessType = BusinessType.SAP)
public R sapRFWOrder(@RequestBody SapRFW sapRFW){
return sapOrderService.sapRFWOrder(sapRFW);
}
/** /**
* *
* @return * @return
@ -382,6 +294,96 @@ public class SapController extends BaseController {
} }
/**==================================生产订单相关============================================================================*/
/**
*
* @return
*/
@PostMapping("/shopOrderSync")
@Log(title = "同步SAP订单", businessType = BusinessType.SAP)
public R<List<SapProOrder>> shopOrderSync(@RequestBody SapShopOrderQuery sapProOrder){
return sapOrderService.shopOrderSync(sapProOrder);
}
/**
*
* @param sapCreateOrderList
* @return
*/
@PostMapping("/sapCreateOrder")
@Log(title = "生产订单创建接口", businessType = BusinessType.SAP)
public R<List<Map<String, String>>> SapCreateOrder(@RequestBody List<SapCreateOrder> sapCreateOrderList){
return sapOrderService.SapCreateOrder(sapCreateOrderList);
}
/**
* SAP
*
*/
@PostMapping("/shopUpdateSync")
@Log(title = "修改SAP订单", businessType = BusinessType.SAP)
public R shopUpdateSync(@RequestBody SapShopOrderQuery sapProOrder){
return sapOrderService.shopUpdateSync(sapProOrder);
}
/**
*
* @param sapRFW
* @return
*/
@PostMapping("/sapRFWOrder")
@Log(title = "生产订单报工接口", businessType = BusinessType.SAP)
public R sapRFWOrder(@RequestBody SapRFW sapRFW){
return sapOrderService.sapRFWOrder(sapRFW);
}
/**
*
*
* @param sapCloseOrderQuery
* @return
*/
@PostMapping("/sapCloseOrder")
@Log(title = "生产订单关闭接口", businessType = BusinessType.SAP)
public R sapCloseOrder(@RequestBody SapCloseOrderQuery sapCloseOrderQuery){
return sapOrderService.sapCloseOrder(sapCloseOrderQuery);
}
/**
*
* @param shopOrder
* @return
*/
@PostMapping("/materialPreparation")
@Log(title = "生产订单备料单接口", businessType = BusinessType.SAP)
public R<List<SapMaterialPreparation>> materialPreparation(@RequestParam("shopOrder") String shopOrder){
return sapMaterialPreparationService.MaterialPreparation(shopOrder);
}
/**
*
* ***
* @param sapBackflushMPQueryList
* @return
*/
@PostMapping("/sapBackflushMP")
@Log(title = "", businessType = BusinessType.SAP)
public R sapBackflushMP(@RequestBody List<SapBackflushMPQuery> sapBackflushMPQueryList){
return sapItemSyncService.sapBackflushMP(sapBackflushMPQueryList);
}
@PostMapping("/sapMaterialPosting")
@Log(title = "订单物料领料过账、原材料补料、订单物料退料过账接口MB1A", businessType = BusinessType.SAP)
public R sapMaterialPosting(@RequestBody SapMaterialPosting sapMaterialPosting){
return sapItemSyncService.sapMaterialPosting(sapMaterialPosting);
}
/** /**
* *
*/ */

@ -1,5 +1,6 @@
package com.op.sap.service.impl; package com.op.sap.service.impl;
import com.alibaba.fastjson2.JSONObject;
import com.op.common.core.constant.Constants; import com.op.common.core.constant.Constants;
import com.op.common.core.domain.R; import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.DateUtils;
@ -244,6 +245,8 @@ public class SapOrderServiceImpl implements SapOrderService {
@Override @Override
public R sapRFWOrder(SapRFW sapRFW) { public R sapRFWOrder(SapRFW sapRFW) {
String json= JSONObject.toJSONString(sapRFW);
System.out.println(json);
String MESSAGE=null; String MESSAGE=null;
try { try {
//获取连接 //获取连接
@ -300,10 +303,10 @@ public class SapOrderServiceImpl implements SapOrderService {
JCoParameterList J= func.getExportParameterList(); JCoParameterList J= func.getExportParameterList();
System.out.println(J); System.out.println(J);
MESSAGE= func.getExportParameterList().getString("MESSAGE"); MESSAGE= func.getExportParameterList().getString("MESSAGE");
if (StringUtils.isEmpty(MESSAGE)){ if (StringUtils.contains(MESSAGE,"错误")){
return R.fail("订单号:"+sapRFW.getAufnr()+"报工失败"); return R.fail("订单号:"+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());
@ -404,6 +407,8 @@ public class SapOrderServiceImpl implements SapOrderService {
return R.fail(e.getMessage()); return R.fail(e.getMessage());
} }
} }
} }

Loading…
Cancel
Save