Merge remote-tracking branch 'origin/master'

master
zhaoxiaolin 10 months ago
commit da4578bfb0

@ -113,4 +113,10 @@ public interface RemoteSapService {
@PostMapping("/sap/sapOrderReceipt")
public R sapOrderReceipt(@RequestBody(required = false) List<Map<String, Object>> mapList);
/**
*
*/
@PostMapping("/sap/FPinventory")
public R FPinventory(@RequestBody(required = false) List<Map<String, Object>> mapList);
}

@ -124,6 +124,11 @@ public class RemoteSapFallbackFactory implements FallbackFactory<RemoteSapServic
return R.fail("101类型订单收货过账失败" + throwable.getMessage());
}
@Override
public R FPinventory(List<Map<String, Object>> mapList) {
return R.fail("成品备货单获取失败" + throwable.getMessage());
}
};
}
}

@ -513,5 +513,13 @@ public class SapController extends BaseController {
return sapItemSyncService.FPinventory(mapList);
}
/**
* 105()
*/
@PostMapping("/incomingConversion")
@Log(title = "来料库存转换接口", businessType = BusinessType.SAP)
public R incomingConversion(@RequestBody(required = false) Map<String, Object> mapList) {
return sapItemSyncService.incomingConversion(mapList);
}
}

@ -34,4 +34,6 @@ public interface SapItemSyncService {
R inComingCheck(Map<String, Object> mapList);
R FPinventory(Map<String, Object> mapList);
R incomingConversion(Map<String, Object> mapList);
}

@ -459,10 +459,89 @@ public class SapItemSyncImpl implements SapItemSyncService {
log.info("成品备货单参数-------" + mapList.toString());
JCoTable S_TDDAT = func.getTableParameterList().getTable("S_TDDAT");
JCoTable S_MATNR = func.getTableParameterList().getTable("S_MATNR");
System.out.println(S_TDDAT);
System.out.println(S_MATNR);
if (mapList==null || mapList.size()==0)
{
return R.fail("参数不能为空");
}
if (StringUtils.isNotEmpty(mapList.get("S_MATNR").toString())){
S_TDDAT.appendRow();
S_TDDAT.setValue(Constants.SIGN, "I");
S_TDDAT.setValue(Constants.OPTION, "BT");
S_TDDAT.setValue(Constants.LOW, "20231201");
S_TDDAT.setValue(Constants.LOW, mapList.get("S_MATNR").toString());
}
if (StringUtils.isNotEmpty(mapList.get("S_TDDAT").toString())){
S_TDDAT.appendRow();
S_TDDAT.setValue(Constants.SIGN, "I");
S_TDDAT.setValue(Constants.OPTION, "BT");
S_TDDAT.setValue(Constants.LOW, mapList.get("S_TDDAT").toString());
S_TDDAT.setValue(Constants.HIGH, END_DATE);
}
func.execute(dest);//执行调用函数
String RETCODE=func.getExportParameterList().getString("RETCODE");
String MSG=func.getExportParameterList().getString("MSG");
JCoTable maraTable = func.getTableParameterList().getTable("LT_CP");
List<Map<String,String>> mapResult=new ArrayList<>();
for (int i = 0; i < maraTable.getNumRows(); i++) {
maraTable.setRow(i);
Map map=new HashMap();
String MATNR=maraTable.getString("MATNR");//物料号
String MAKTX=maraTable.getString("MAKTX");//物料描述
String VBELN=maraTable.getString("VBELN");//交货单
String VBELN_VA=maraTable.getString("VBELN_VA");//销售单
String MENGE=maraTable.getString("MENGE");//数量
String MEINS=maraTable.getString("MEINS");//单位
String TDDAT=maraTable.getString("TDDAT");//计划日期
String KUNNR=maraTable.getString("KUNNR");//送达方
String KUNNR_NM=maraTable.getString("KUNNR_NM");//送达方描述
String LIFNR=maraTable.getString("LIFNR");//货运代理
String LIFNR_NM=maraTable.getString("LIFNR_NM");//货运代理描述
String ZSAREA=maraTable.getString("ZSAREA");//销售大区
String BZTXT1=maraTable.getString("BZTXT1");//销售大区描述
log.info("物料号"+MATNR+"物料描述"+MAKTX+"交货单"+VBELN+"销售单"+VBELN_VA+
"数量"+MENGE+"单位"+MEINS+"计划日期"+TDDAT+"送达方"+KUNNR+"送达方描述"+KUNNR_NM+"货运代理"+LIFNR+
"货运代理描述"+LIFNR_NM+"销售大区"+ZSAREA+"销售大区描述"+BZTXT1);
map.put("MATNR",MATNR);
map.put("MAKTX",MAKTX);
map.put("VBELN",VBELN);
map.put("VBELN_VA",VBELN_VA);
map.put("MENGE",MENGE);
map.put("MEINS",MEINS);
map.put("TDDAT",TDDAT);
map.put("KUNNR",KUNNR);
map.put("KUNNR_NM",KUNNR_NM);
map.put("LIFNR",LIFNR);
map.put("LIFNR_NM",LIFNR_NM);
map.put("ZSAREA",ZSAREA);
map.put("BZTXT1",BZTXT1);
mapResult.add(map);
}
if ((Constants.FAIL).equals(Integer.parseInt(RETCODE))){
return R.fail(MSG);
}
return R.ok(mapResult,MSG);
} catch (Exception e) {
log.error(e.getMessage());
return R.fail(e.getMessage());
}
}
@Override
public R incomingConversion(Map<String, Object> mapList) {
try {
JCoRepository repository = dest.getRepository();
JCoFunction func = repository.getFunction("ZMES_ZSDR29");
if (func == null) {
throw new RuntimeException("Function does not exist in SAP");
}
log.info("成品备货单参数-------" + mapList.toString());
JCoTable S_TDDAT = func.getTableParameterList().getTable("S_TDDAT");
JCoTable S_MATNR = func.getTableParameterList().getTable("S_MATNR");
S_TDDAT.appendRow();
S_TDDAT.setValue(Constants.SIGN, "I");
S_TDDAT.setValue(Constants.OPTION, "BT");
S_TDDAT.setValue(Constants.LOW, "20240301");
S_TDDAT.setValue("HIGH", END_DATE);
System.out.println(S_TDDAT);
System.out.println(S_MATNR);
@ -485,4 +564,6 @@ public class SapItemSyncImpl implements SapItemSyncService {
return R.fail(e.getMessage());
}
}
}

@ -1011,7 +1011,7 @@ public class WmsProductPutServiceImpl implements IWmsProductPutService {
wmsFpStorageNews2.setAmount(amountAdd);
wmsFpStorageNewsMapper.updateWmsFpStorageNews(wmsFpStorageNews2);
} else {
wmsFpStorageNewsMapper.insertWmsFpStorageNews(wmsFpStorageNews);
wmsFpStorageNewsMapper.insertWmsFpStorageNews(wmsFpStorageNews1);
}
return result1;
}

@ -212,7 +212,7 @@
<!--查询总数-->
<select id="queryCount" parameterType="BaseArea" resultType="java.lang.Integer">
select count(*)
select count(1)
from base_area
where del_flag = '0'
</select>

@ -267,7 +267,7 @@
</select>
<select id="selectChildNodes" parameterType="com.op.wms.domain.BaseBom" resultType="Integer">
select count(*) as number
select count(1) as number
from base_bom_component
where cumc = #{component}
and bom_code = #{bomCode}

@ -152,7 +152,7 @@
</update>
<select id="queryCount" parameterType="BaseWarehouse" resultType="java.lang.Integer">
select count(*)
select count(1)
from base_warehouse
and del_flag = '0'
</select>

Loading…
Cancel
Save