wms过账修改

master
mengjiao 7 months ago
parent f791cc3439
commit 45bc283865

@ -130,4 +130,11 @@ public interface RemoteSapService {
*/
@PostMapping("/sap/temporarilyCollected")
public R temporarilyCollected(@RequestBody(required = false) List<Map> mapList) ;
/**
*sap105
*/
@PostMapping("/sap/sap105temporarilyCollected")
public R sap105temporarilyCollected(@RequestBody(required = false) List<Map> mapList) ;
}

@ -143,6 +143,11 @@ public class RemoteSapFallbackFactory implements FallbackFactory<RemoteSapServic
return R.fail("来料暂收过账失败" + throwable.getMessage());
}
@Override
public R sap105temporarilyCollected(List<Map> mapList) {
return R.fail("105过账失败" + throwable.getMessage());
}
};
}
}

@ -653,42 +653,140 @@ public class SapItemSyncImpl implements SapItemSyncService {
@Override
public R sap105temporarilyCollected(List<Map> mapList) {
try {
Map map= mapList.get(0);
JCoRepository repository = dest.getRepository();
JCoFunction func = repository.getFunction("ZMES_103_MIGO");
JCoFunction func = repository.getFunction("ZMES_GET_MSEG");
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);
log.info("取物料凭证数据接口的参数-------" + mapList.toString());
JCoTable S_MBLNR = func.getTableParameterList().getTable("S_MBLNR");
//交货单号
JCoTable S_MJAHR = func.getTableParameterList().getTable("S_MJAHR");
//销售凭证类型
JCoTable S_MATNR = func.getTableParameterList().getTable("S_MATNR");
// S_MBLNR.setValue("S_MBLNR", S_MBLNR);
S_MBLNR.appendRow();
S_MBLNR.setValue(Constants.SIGN, "I");
S_MBLNR.setValue(Constants.OPTION, "BT");
S_MBLNR.setValue(Constants.LOW,map.get("S_MBLNR"));
S_MBLNR.setValue(Constants.HIGH,map.get("S_MBLNR"));
S_MJAHR.appendRow();
S_MJAHR.setValue(Constants.SIGN, "I");
S_MJAHR.setValue(Constants.OPTION, "BT");
S_MJAHR.setValue(Constants.LOW,map.get("S_MJAHR"));
S_MJAHR.setValue(Constants.HIGH,map.get("S_MJAHR"));
S_MATNR.appendRow();
S_MATNR.setValue(Constants.SIGN, "I");
S_MATNR.setValue(Constants.OPTION, "BT");
S_MATNR.setValue(Constants.LOW,map.get("S_MATNR"));
S_MATNR.setValue(Constants.HIGH,map.get("S_MATNR"));
func.execute(dest);//执行调用函数
/**
* RETCODE CHAR3 200-500-
* L_MSG CHAR220
* MATERIALDOCUMENT CHAR10
* MATDOCUMENTYEAR NUMC4
* MBLNR
* MJAHR
* ZEILE
* EBELN
* EBELP
* MATNR
* WERKS
* LGORT
* MENGE
* MEINS
* ERFMG
* ERFME
* BPMNG
* BPRME
*/
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);
JCoTable maraTable = func.getTableParameterList().getTable("LT_MSEG");
// 首先检查表中是否有行
if (maraTable.getNumRows() > 0) {
// 遍历每一行
String mblnr = new String(); // 物料凭证编号
String mjahr = new String(); // 物料凭证年度
String zeile = new String(); // 物料凭证中的项目
String ebeln = new String(); // 采购订单编号
String ebelp = new String(); // 采购凭证的项目编号
String matnr = new String(); // 物料号
String werks = new String(); // 工厂
String lgort = new String(); // 库存地点
String menge = new String(); // 数量
String meins = new String(); // 基本计量单位
String erfmg = new String(); // 以输入单位计的数量
String erfme = new String(); // 条目单位
String bpmng = new String(); // 采购订单价格单位的数量
String bprme = new String(); // 订单价格单位(采购)
String RETCODE= new String();
String MESSAGE= new String();
String MATERIALDOCUMENT = new String();
String MATDOCUMENTYEAR= new String();
for (int i = 0; i < maraTable.getNumRows(); i++) {
mblnr = maraTable.getString("MBLNR"); // 物料凭证编号
mjahr = maraTable.getString("MJAHR"); // 物料凭证年度
zeile = maraTable.getString("ZEILE"); // 物料凭证中的项目
ebeln = maraTable.getString("EBELN"); // 采购订单编号
matnr = maraTable.getString("MATNR"); // 物料号
werks = maraTable.getString("WERKS"); // 工厂
lgort = maraTable.getString("LGORT"); // 库存地点
menge = maraTable.getString("MENGE"); // 数量
meins = maraTable.getString("MEINS"); // 基本计量单位
erfmg = maraTable.getString("ERFMG"); // 以输入单位计的数量
erfme = maraTable.getString("ERFME"); // 条目单位
bpmng = maraTable.getString("BPMNG"); // 采购订单价格单位的数量
bprme = maraTable.getString("BPRME"); // 订单价格单位(采购)
// 处理获取到的字段值
System.out.println("物料凭证编号: " + mblnr);
System.out.println("物料凭证年度: " + mjahr);
System.out.println("物料凭证中的项目: " + zeile);
System.out.println("采购订单编号: " + ebeln);
System.out.println("采购凭证的项目编号: " + ebelp);
System.out.println("物料号: " + matnr);
System.out.println("工厂: " + werks);
System.out.println("库存地点: " + lgort);
System.out.println("数量: " + menge);
System.out.println("基本计量单位: " + meins);
System.out.println("以输入单位计的数量: " + erfmg);
System.out.println("条目单位: " + erfme);
System.out.println("采购订单价格单位的数量: " + bpmng);
System.out.println("订单价格单位(采购): " + bprme);
JCoFunction func2 = repository.getFunction("ZMES_105_MIGO");
if (func2 == null) {
throw new RuntimeException("Function does not exist in SAP");
}
log.info("105参数-------" + mapList.toString());
JCoTable L_ITEM = func2.getTableParameterList().getTable("L_ITEM");
L_ITEM.appendRow();
L_ITEM.setValue("LFBNR",mblnr);//参考凭证的凭证号
L_ITEM.setValue("LFPOS",zeile);//参考凭证项目
L_ITEM.setValue("BSTNR", ebeln);//采购订单编号
L_ITEM.setValue("EBELP", ebelp);//采购凭证的项目编号
L_ITEM.setValue("WERKS", werks);//工厂
L_ITEM.setValue("LGORT", lgort);//库存地点
L_ITEM.setValue("QUANTITY",menge);//数量
L_ITEM.setValue("BATCH", map.get("incomeBatchNo"));//批号
L_ITEM.setValue("HSDAT","");//生产日期
System.out.println(L_ITEM);
func2.execute(dest);//执行调用函数
RETCODE = func2.getExportParameterList().getString("RETCODE");
MESSAGE = func2.getExportParameterList().getString("L_MSG");
MATERIALDOCUMENT = func2.getExportParameterList().getString("MATERIALDOCUMENT");
MATDOCUMENTYEAR = func2.getExportParameterList().getString("MATDOCUMENTYEAR");
log.info("105结果结果-----" + 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);
} else {
// 表为空的处理
System.out.println("表中没有数据。");
return R.fail("没有暂收数据");
}
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());

@ -3,6 +3,8 @@ package com.op.wms.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.wms.domain.OdsProcureOrder;
import com.op.wms.service.IOdsProcureOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -22,6 +24,8 @@ import com.op.common.core.web.domain.AjaxResult;
import com.op.common.core.utils.poi.ExcelUtil;
import com.op.common.core.web.page.TableDataInfo;
import static com.op.common.core.web.domain.AjaxResult.success;
/**
* Controller
*
@ -34,6 +38,8 @@ public class WmsRawOrderInController extends BaseController {
@Autowired
private IWmsRawOrderInService wmsRawOrderInService;
@Autowired
private IOdsProcureOrderService odsProcureOrderService;
/**
*
*/
@ -95,4 +101,9 @@ public class WmsRawOrderInController extends BaseController {
public AjaxResult remove(@PathVariable String[] rawOrderInIds) {
return toAjax(wmsRawOrderInService.deleteWmsRawOrderInByRawOrderInIds(rawOrderInIds));
}
// @PostMapping("/sap105temporarilyCollected")
// public AjaxResult sap105temporarilyCollected(@RequestBody List<OdsProcureOrder> odsProcureOrder) {
// String result = odsProcureOrderService.sap105temporarilyCollected(odsProcureOrder);
// return success(result);
// }
}

@ -794,4 +794,5 @@ public class WmsToWCSmissionController {
return success(result);
}
}

@ -339,6 +339,7 @@ public class WmsRawOrderIn extends BaseEntity {
*/
@Excel(name = "有效标记")
private String activeFlag;
private String incomeBatchNo;
public void setRawOrderInId(String rawOrderInId) {
this.rawOrderInId = rawOrderInId;

@ -62,8 +62,10 @@ public interface WmsOdsMateStorageNewsMapper {
*/
public int deleteWmsOdsMateStorageNewsByStorageIds(String[] storageIds);
WmsOdsMateStorageNews selectByWhCodeAndMate(WmsOdsEmStorageNews wmsOdsEmStorageNews);
public WmsOdsMateStorageNews selectByWhCodeAndMate(WmsOdsEmStorageNews wmsOdsEmStorageNews);
WmsOdsMateStorageNews selectBaseProductByCode(WCSInventoryPlan wcsInventoryPlan);
public WmsOdsMateStorageNews selectBaseProductByCode(WCSInventoryPlan wcsInventoryPlan);
public void updateWmsOdsMateStorageNewsUpdateStorageAmount(WmsOdsMateStorageNews wmsOdsMateStorageNews);
}

@ -65,4 +65,6 @@ public interface WmsRawOrderInMapper {
WmsToWCSDTO finishedProductRequestInbound(WmsToWCSDTO wcsdto);
List<String> finishedProductRequestInboundsn(WmsToWCSDTO wcsdto);
WmsRawOrderIn selectWmsRawOrderInByRawOrderInIdTWO(String rawOrderInId);
}

@ -220,4 +220,10 @@
select DISTINCT material_desc,user_defined1
from wms_ods_mate_storage_news where material_code=#{sku}
</select>
<update id="updateWmsOdsMateStorageNewsUpdateStorageAmount" >
update wms_ods_mate_storage_news
set storage_amount = ISNULL(storage_amount, 0) - #{storageAmount},
gmt_modified=GETDATE()
where wh_code=#{whCode} and wl_code=#{wlCode} and wa_code=#{waCode} and material_code=#{materialCode}
</update>
</mapper>

@ -57,6 +57,7 @@
<result property="lastModifiedBy" column="last_modified_by"/>
<result property="gmtModified" column="gmt_modified"/>
<result property="activeFlag" column="active_flag"/>
<result property="incomeBatchNo" column="incomeBatchNo"/>
</resultMap>
<sql id="selectWmsRawOrderInVo">
@ -128,7 +129,68 @@
<include refid="selectWmsRawOrderInVo"/>
where raw_order_in_id = #{rawOrderInId}
</select>
<select id="selectWmsRawOrderInByRawOrderInIdTWO" parameterType="String" resultMap="WmsRawOrderInResult">
SELECT DISTINCT
wms_raw_order_in.raw_order_in_id,
wms_raw_order_in.factory_code,
wms_raw_order_in.wh_code,
wms_raw_order_in.wa_code,
wms_raw_order_in.wl_code,
wms_raw_order_in.order_in_type,
wms_raw_order_in.order_no,
wms_raw_order_in.dn_no,
wms_raw_order_in.po_no,
wms_raw_order_in.po_line,
wms_raw_order_in.po_type,
wms_raw_order_in.material_code,
wms_raw_order_in.material_desc,
wms_raw_order_in.unit,
wms_raw_order_in.buyer_group,
wms_raw_order_in.supply_code,
wms_raw_order_in.sap_factory_code,
wms_raw_order_in.send_spot,
wms_raw_order_in.request_amount,
wms_raw_order_in.receipt_amount,
wms_raw_order_in.shelves_amount,
wms_raw_order_in.location,
wms_raw_order_in.request_time,
wms_raw_order_in.quality_status,
wms_raw_order_in.order_status,
wms_raw_order_in.receipt_operator,
wms_raw_order_in.receipt_time,
wms_raw_order_in.shelves_operator,
wms_raw_order_in.return_amount,
wms_raw_order_in.return_name,
wms_raw_order_in.return_time,
wms_raw_order_in.return_status,
wms_raw_order_in.shelves_time,
wms_raw_order_in.return_message,
wms_raw_order_in.accounting_status,
wms_raw_order_in.accounting_time,
wms_raw_order_in.accounting_message,
wms_raw_order_in.user_defined1,
wms_raw_order_in.user_defined2,
wms_raw_order_in.user_defined3,
wms_raw_order_in.user_defined4,
wms_raw_order_in.user_defined5,
wms_raw_order_in.user_defined6,
wms_raw_order_in.user_defined7,
wms_raw_order_in.user_defined8,
wms_raw_order_in.user_defined9,
wms_raw_order_in.user_defined10,
wms_raw_order_in.create_by,
wms_raw_order_in.gmt_create,
wms_raw_order_in.last_modified_by,
wms_raw_order_in.gmt_modified,
wms_raw_order_in_sn.user_defined2 incomeBatchNo ,
wms_raw_order_in.active_flag
FROM
wms_raw_order_in
LEFT JOIN wms_raw_order_in_sn ON wms_raw_order_in.dn_no=wms_raw_order_in_sn.user_defined5
where wms_raw_order_in.raw_order_in_id = #{rawOrderInId}
and wms_raw_order_in.order_status='0'
</select>
<insert id="insertWmsRawOrderIn" parameterType="WmsRawOrderIn">
insert into wms_raw_order_in
<trim prefix="(" suffix=")" suffixOverrides=",">

Loading…
Cancel
Save