Compare commits

..

2 Commits

10 changed files with 124 additions and 46 deletions

View File

@ -21,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.core.type.TypeReference;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
@Slf4j @Slf4j
@Service @Service
@ -116,7 +117,8 @@ public class ToSAPServiceImpl {
itemData.add(item); itemData.add(item);
} }
String sendData = ToSAPMessageUtil.mm067(user, bodyData, itemData);
String sendData = ToSAPMessageUtil.mm067(user, bodyData, itemData, TimeStampUtil.getCurrentTime("yyyyMMdd"));
String sapreturn = toSAPMessageUtil.sendHttpPost(toSAPMessageUtil.materialChangeLocationUrl,"",sendData); String sapreturn = toSAPMessageUtil.sendHttpPost(toSAPMessageUtil.materialChangeLocationUrl,"",sendData);
org.json.JSONObject receiveJsonObject = new org.json.JSONObject(sapreturn); org.json.JSONObject receiveJsonObject = new org.json.JSONObject(sapreturn);
@ -236,7 +238,7 @@ public class ToSAPServiceImpl {
itemData.add(item); itemData.add(item);
} }
String sendData = ToSAPMessageUtil.mm067(user, bodyData, itemData); String sendData = ToSAPMessageUtil.mm067(user, bodyData, itemData,TimeStampUtil.getCurrentTime("yyyyMMdd"));
String sapreturn = toSAPMessageUtil.sendHttpPost(toSAPMessageUtil.materialChangeLocationUrl,"",sendData); String sapreturn = toSAPMessageUtil.sendHttpPost(toSAPMessageUtil.materialChangeLocationUrl,"",sendData);
org.json.JSONObject receiveJsonObject = new org.json.JSONObject(sapreturn); org.json.JSONObject receiveJsonObject = new org.json.JSONObject(sapreturn);
@ -522,7 +524,7 @@ public class ToSAPServiceImpl {
* @return 返回物料凭证相关的ID * @return 返回物料凭证相关的ID
* @throws Exception 如果与SAP系统的通信或其他错误发生时抛出异常 * @throws Exception 如果与SAP系统的通信或其他错误发生时抛出异常
*/ */
public String FGStockInByManulIn( String bodyJson, String user, String RECEIVEACTNO) throws Exception { public String FGStockInByManulIn( String bodyJson, String user, String RECEIVEACTNO, String commitDate) throws Exception {
// 初始化SAP返回信息结果代码消息文本和撤销ID // 初始化SAP返回信息结果代码消息文本和撤销ID
String sapreturn = ""; String sapreturn = "";
String rcode = ""; String rcode = "";
@ -535,7 +537,7 @@ public class ToSAPServiceImpl {
new TypeReference<List<Map<String, Object>>>() {} new TypeReference<List<Map<String, Object>>>() {}
); );
String makeFGStockIn = makeFGStockIn2(objList, user, RECEIVEACTNO); String makeFGStockIn = makeFGStockIn2(objList, user, RECEIVEACTNO,commitDate);
try { try {
// 发送物料信息到SAP系统 // 发送物料信息到SAP系统
@ -703,10 +705,10 @@ public class ToSAPServiceImpl {
itemsData.add(item); itemsData.add(item);
} }
String sendData = ToSAPMessageUtil.mm067(eventUser, bodyData, itemsData); String sendData = ToSAPMessageUtil.mm067(eventUser, bodyData, itemsData,TimeStampUtil.getCurrentTime("yyyyMMdd"));
return sendData; return sendData;
} }
public String makeFGStockIn2(List<Map<String, Object>> list, String eventUser, String receiveRequestName) throws JsonMappingException, JsonProcessingException { public String makeFGStockIn2(List<Map<String, Object>> list, String eventUser, String receiveRequestName,String commitDate) throws JsonMappingException, JsonProcessingException {
if (list == null || list.size() < 1) { if (list == null || list.size() < 1) {
return ""; return "";
@ -755,7 +757,7 @@ public class ToSAPServiceImpl {
itemsData.add(item); itemsData.add(item);
} }
String sendData = ToSAPMessageUtil.mm067(eventUser, bodyData, itemsData); String sendData = ToSAPMessageUtil.mm067(eventUser, bodyData, itemsData, commitDate);
return sendData; return sendData;
} }
//取消成品入库接口字段zd.2024.8.29 //取消成品入库接口字段zd.2024.8.29
@ -804,7 +806,7 @@ public class ToSAPServiceImpl {
itemsData.add(item); itemsData.add(item);
} }
String sendData = ToSAPMessageUtil.mm067(eventUser, bodyData, itemsData); String sendData = ToSAPMessageUtil.mm067(eventUser, bodyData, itemsData,TimeStampUtil.getCurrentTime("yyyyMMdd"));
return sendData; return sendData;
} }
@ -1176,7 +1178,7 @@ public class ToSAPServiceImpl {
item.put("UMMAT_KDPOS", mm.get("SENDSALESORDERDETAILNO")); item.put("UMMAT_KDPOS", mm.get("SENDSALESORDERDETAILNO"));
itemData.add(item); itemData.add(item);
} }
String sendData = ToSAPMessageUtil.mm067(user, bodyData, itemData); String sendData = ToSAPMessageUtil.mm067(user, bodyData, itemData,TimeStampUtil.getCurrentTime("yyyyMMdd"));
return sendData; return sendData;
} }
@ -1311,7 +1313,7 @@ public class ToSAPServiceImpl {
itemData.put("INSMK", ""); itemData.put("INSMK", "");
items.add(itemData); items.add(itemData);
} }
String sendData = ToSAPMessageUtil.mm067(user, bodyData, items); String sendData = ToSAPMessageUtil.mm067(user, bodyData, items,TimeStampUtil.getCurrentTime("yyyyMMdd"));
return sendData; return sendData;
} }
@ -3824,7 +3826,7 @@ public class ToSAPServiceImpl {
} }
//采购退货Z008 跨月新单据退货(Z001~Z007 原单据) //采购退货Z008 跨月新单据退货(Z001~Z007 原单据)
public String OrderStockBackOut(String shipRequestName, String siteName, String user) throws Exception { public String OrderStockBackOut(String shipRequestName, String siteName, String user, String commitDate) throws Exception {
String rcode; String rcode;
String undoId = ""; String undoId = "";
@ -3917,10 +3919,14 @@ public class ToSAPServiceImpl {
*/ */
body.put("ITEM", itemArray); body.put("ITEM", itemArray);
body.put("ITEMID", uniqueID); body.put("ITEMID", uniqueID);
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyyMMdd");
Date date = inputFormat.parse(commitDate);
String outputDate = outputFormat.format(date);
//过账日期 //过账日期
body.put("BUDAT", TimeStampUtil.getCurrentTime("yyyyMMdd")); body.put("BUDAT", outputDate);
//凭证日期 //凭证日期
body.put("BLDAT", TimeStampUtil.getCurrentTime("yyyyMMdd")); body.put("BLDAT", outputDate);
//凭证抬头文本 //凭证抬头文本
body.put("BKTXT", uniqueID); body.put("BKTXT", uniqueID);
//用户名 //用户名
@ -4766,7 +4772,7 @@ public class ToSAPServiceImpl {
String aimFactory, String aimFactory,
String aimERPlocation, String aimERPlocation,
String aimLocationName, String aimLocationName,
String user) throws Exception { String user, String commitDate) throws Exception {
String rcode; String rcode;
String undoId = ""; String undoId = "";
String rmsg = null; String rmsg = null;
@ -4780,6 +4786,7 @@ public class ToSAPServiceImpl {
.append(" :AIMERPLOCATION AS UMLGO_RECIEVEERPLOCATION, ").append(SystemPropHelper.CR) .append(" :AIMERPLOCATION AS UMLGO_RECIEVEERPLOCATION, ").append(SystemPropHelper.CR)
.append(" MP.MATERIALQUANTITY , ").append(SystemPropHelper.CR) .append(" MP.MATERIALQUANTITY , ").append(SystemPropHelper.CR)
.append(" MP.UNIT, ").append(SystemPropHelper.CR) .append(" MP.UNIT, ").append(SystemPropHelper.CR)
.append(" MP.PACKINGGRADE, ").append(SystemPropHelper.CR)
.append(" :AIMLOCATIONNAME AS NULL_RECIVELOCAITONNAME ").append(SystemPropHelper.CR) .append(" :AIMLOCATIONNAME AS NULL_RECIVELOCAITONNAME ").append(SystemPropHelper.CR)
.append(" FROM ").append(SystemPropHelper.CR) .append(" FROM ").append(SystemPropHelper.CR)
.append(" MATERIALPACKING MP ").append(SystemPropHelper.CR) .append(" MATERIALPACKING MP ").append(SystemPropHelper.CR)
@ -4824,10 +4831,21 @@ public class ToSAPServiceImpl {
*/ */
body.put("ITEM", itemArray); body.put("ITEM", itemArray);
body.put("ITEMID", uniqueID); body.put("ITEMID", uniqueID);
String outputDate = "";
if(commitDate.isEmpty()) {
outputDate = TimeStampUtil.getCurrentTime("yyyyMMdd");
}else {
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyyMMdd");
Date date = inputFormat.parse(commitDate);
outputDate = outputFormat.format(date);
}
//过账日期 //过账日期
body.put("BUDAT", TimeStampUtil.getCurrentTime("yyyyMMdd")); body.put("BUDAT", outputDate);
//凭证日期 //凭证日期
body.put("BLDAT", TimeStampUtil.getCurrentTime("yyyyMMdd")); body.put("BLDAT", outputDate);
//凭证抬头文本 //凭证抬头文本
body.put("BKTXT", uniqueID); body.put("BKTXT", uniqueID);
//用户名 //用户名
@ -4854,6 +4872,15 @@ public class ToSAPServiceImpl {
item.put("MEINS", mm.get("UNIT")); item.put("MEINS", mm.get("UNIT"));
//BWART 移动类型 //BWART 移动类型
item.put("BWART", "311"); item.put("BWART", "311");
String insmk = "";
if (StringUtils.isEmpty((String)mm.get("PACKINGGRADE"))) {
insmk = "2";
}
// String insmk = StringUtils.equals(mm.get("OQARESULTSTATE").toString(),"END")?"":"X";
item.put("INSMK", insmk);
item.put("BWART", "311");
// //ZLLORDER 自定义领料单号 // //ZLLORDER 自定义领料单号
// item.put("ZLLORDER", mm.get("SHIPREQUESTNAME")); // item.put("ZLLORDER", mm.get("SHIPREQUESTNAME"));
// //ZLLITEM 自定义领料单行号 // //ZLLITEM 自定义领料单行号
@ -5152,7 +5179,7 @@ public class ToSAPServiceImpl {
itemsData.add(item); itemsData.add(item);
} }
String sendData = ToSAPMessageUtil.mm067(eventUser, bodyData, itemsData); String sendData = ToSAPMessageUtil.mm067(eventUser, bodyData, itemsData,TimeStampUtil.getCurrentTime("yyyyMMdd"));
return sendData; return sendData;
} }
@ -5360,7 +5387,7 @@ public class ToSAPServiceImpl {
//质检批如何判定 如果是质检批 INSMK 值为2 //质检批如何判定 如果是质检批 INSMK 值为2
items.add(itemData); items.add(itemData);
} }
String sendData = ToSAPMessageUtil.mm067(user, bodyData, items); String sendData = ToSAPMessageUtil.mm067(user, bodyData, items,TimeStampUtil.getCurrentTime("yyyyMMdd"));
return sendData; return sendData;
} }
@ -5446,7 +5473,7 @@ public class ToSAPServiceImpl {
} }
String sendData = ToSAPMessageUtil.mm067(user, bodyData, itemData); String sendData = ToSAPMessageUtil.mm067(user, bodyData, itemData,TimeStampUtil.getCurrentTime("yyyyMMdd"));
String sapreturn = toSAPMessageUtil.sendHttpPost(toSAPMessageUtil.materialChangeLocationUrl,"",sendData); String sapreturn = toSAPMessageUtil.sendHttpPost(toSAPMessageUtil.materialChangeLocationUrl,"",sendData);
org.json.JSONObject receiveJsonObject = new org.json.JSONObject(sapreturn); org.json.JSONObject receiveJsonObject = new org.json.JSONObject(sapreturn);
@ -5545,7 +5572,7 @@ public class ToSAPServiceImpl {
} }
String sendData = ToSAPMessageUtil.mm067(user, bodyData, itemData); String sendData = ToSAPMessageUtil.mm067(user, bodyData, itemData,TimeStampUtil.getCurrentTime("yyyyMMdd"));
String sapreturn = toSAPMessageUtil.sendHttpPost(toSAPMessageUtil.materialChangeLocationUrl,"",sendData); String sapreturn = toSAPMessageUtil.sendHttpPost(toSAPMessageUtil.materialChangeLocationUrl,"",sendData);
org.json.JSONObject receiveJsonObject = new org.json.JSONObject(sapreturn); org.json.JSONObject receiveJsonObject = new org.json.JSONObject(sapreturn);
@ -5646,7 +5673,7 @@ public class ToSAPServiceImpl {
} }
String sendData = ToSAPMessageUtil.mm067(eventUser, bodyData, itemData); String sendData = ToSAPMessageUtil.mm067(eventUser, bodyData, itemData,TimeStampUtil.getCurrentTime("yyyyMMdd"));
String sapreturn = toSAPMessageUtil.sendHttpPost(toSAPMessageUtil.materialChangeLocationUrl,"",sendData); String sapreturn = toSAPMessageUtil.sendHttpPost(toSAPMessageUtil.materialChangeLocationUrl,"",sendData);
org.json.JSONObject receiveJsonObject = new org.json.JSONObject(sapreturn); org.json.JSONObject receiveJsonObject = new org.json.JSONObject(sapreturn);

View File

@ -21,10 +21,9 @@ import java.io.InputStreamReader;
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.util.Base64; import java.text.SimpleDateFormat;
import java.util.List; import java.util.*;
import java.util.Map;
import java.util.UUID;
@Slf4j @Slf4j
@Service(value = "ToSAPMessageUtil") @Service(value = "ToSAPMessageUtil")
public class ToSAPMessageUtil { public class ToSAPMessageUtil {
@ -169,7 +168,26 @@ public class ToSAPMessageUtil {
* @param itemsData * @param itemsData
* @return JSON消息字符串 * @return JSON消息字符串
*/ */
public static String mm067(String user, Map<String,?> bodyData, List<Map<String,Object>> itemsData){ public static String mm067(String user, Map<String,?> bodyData, List<Map<String,Object>> itemsData,String commitDate){
String outputDate = "";
try {
if(commitDate.contains("-")) {
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyyMMdd");
Date date = inputFormat.parse(commitDate);
outputDate = outputFormat.format(date);
}else {
outputDate = commitDate;
}
} catch (IllegalArgumentException e) {
log.error("commitDate 参数无效: " + e.getMessage(), e);
throw e;
} catch (Exception e) {
log.error("日期解析失败: " + e.getMessage(), e);
throw new RuntimeException("日期解析失败,请检查 commitDate 格式是否为 yyyy-MM-dd", e);
}
try { try {
JSONObject sendData = new JSONObject(true); JSONObject sendData = new JSONObject(true);
@ -224,10 +242,12 @@ public class ToSAPMessageUtil {
*/ */
body.put("ITEMID",uniqueID); body.put("ITEMID",uniqueID);
//过账日期 //过账日期
body.put("BUDAT",TimeStampUtil.getCurrentTime("yyyyMMdd")); body.put("BUDAT",outputDate);
//凭证日期 //凭证日期
body.put("BLDAT",TimeStampUtil.getCurrentTime("yyyyMMdd")); body.put("BLDAT",outputDate);
//凭证抬头文本 //凭证抬头文本
body.put("BKTXT",StringUtils.isEmpty((String)bodyData.get("BKTXT"))?uniqueID:bodyData.get("BKTXT")); body.put("BKTXT",StringUtils.isEmpty((String)bodyData.get("BKTXT"))?uniqueID:bodyData.get("BKTXT"));
//用户名 //用户名

View File

@ -376,10 +376,11 @@ public class PurchaseReturnController {
public AjaxResult completeShipRequest(@RequestBody JSONObject in ){ public AjaxResult completeShipRequest(@RequestBody JSONObject in ){
StockOutDto ms = JSON.toJavaObject(in, StockOutDto.class); StockOutDto ms = JSON.toJavaObject(in, StockOutDto.class);
String shipRequestName = ms.getShipRequestName(); String shipRequestName = ms.getShipRequestName();
String commitDate = ms.getCommitDate();
String siteName = "SDK"; String siteName = "SDK";
String user = ms.getUser(); String user = ms.getUser();
try { try {
purchaseReturnService.completeReceiveRequest(siteName, user, shipRequestName); purchaseReturnService.completeReceiveRequest(siteName, user, shipRequestName, commitDate);
} catch (Exception e) { } catch (Exception e) {
return AjaxResult.me().setErrorCode(500).setMessage(e.toString()); return AjaxResult.me().setErrorCode(500).setMessage(e.toString());
} }

View File

@ -679,6 +679,26 @@ public class SAPToWMSController {
String zzywy = MapUtils.getString(item, "ZZYWY"); // 业务员 String zzywy = MapUtils.getString(item, "ZZYWY"); // 业务员
String zzywzl = MapUtils.getString(item, "ZZYWZL"); // 业务助理 String zzywzl = MapUtils.getString(item, "ZZYWZL"); // 业务助理
String zzsyb = MapUtils.getString(item, "ZZSYB"); // 事业部 String zzsyb = MapUtils.getString(item, "ZZSYB"); // 事业部
// 如果是采购退货的单据把相关行项对应的批次记录到单独的ORDERCHARGE表
if("Z008".equals(receiveRequestType)) {
String rtOrdersql ="SELECT * FROM ORDERCHARGE WHERE RECEIVEREQUESTNAME =:receiverequestname";
Map<String, Object> selectRTMap= new HashMap<String, Object>();
selectRTMap.put("receiverequestname", receiveRequestName);
List<Map<String, Object>> rtResultList = IDMFrameServiceProxy.getSqlTemplate().queryForList(rtOrdersql, selectRTMap);
if(rtResultList.size() > 0) {
String sql="DELETE FROM ORDERCHARGE WHERE RECEIVEREQUESTNAME=?";
Object[] obj=new Object[] {receiveRequestName};
IDMFrameServiceProxy.getSqlTemplate().update(sql, obj);
}
// String[] chargeList = new String[]{};
// chargeList = zwmscharg.split(";");
String rtSql="INSERT INTO ORDERCHARGE(RECEIVEREQUESTNAME, RECEIVEREQUESTDETAILNAME, CHARGELIST) VALUES(?,?,?)";
Object[] obj=new Object[] {receiveRequestName, receiveRequestDetailName, zwmscharg};
IDMFrameServiceProxy.getSqlTemplate().update(rtSql, obj);
}
if("X".equals(loekz)) { if("X".equals(loekz)) {
String sql="DELETE FROM materialreceivedetail WHERE receiverequestname=? AND receiverequestdetailname=?"; String sql="DELETE FROM materialreceivedetail WHERE receiverequestname=? AND receiverequestdetailname=?";
Object[] obj=new Object[] {receiveRequestName, receiveRequestDetailName}; Object[] obj=new Object[] {receiveRequestName, receiveRequestDetailName};

View File

@ -72,7 +72,7 @@ public class ERPLocationMoveNoInvoiceServiceImpl implements ERPLocationMoveNoInv
arrayList.add(materialPackingKey); arrayList.add(materialPackingKey);
} }
String billCode = toSAPService.NoSourceChangeLocation(arrayList,aimErpFactory, aimErpLocation, aimLOcationName, user); String billCode = toSAPService.NoSourceChangeLocation(arrayList,aimErpFactory, aimErpLocation, aimLOcationName, user, "");
List<MaterialPackingKey> mpKeyList = new ArrayList<MaterialPackingKey> (); List<MaterialPackingKey> mpKeyList = new ArrayList<MaterialPackingKey> ();
SetEventInfo setEventInfo = new SetEventInfo(); SetEventInfo setEventInfo = new SetEventInfo();
for (MaterialPacking materialPacking : all) { for (MaterialPacking materialPacking : all) {
@ -169,7 +169,7 @@ public class ERPLocationMoveNoInvoiceServiceImpl implements ERPLocationMoveNoInv
} }
String billCode = toSAPService.NoSourceChangeLocation(arrayList,aimErpFactory, String billCode = toSAPService.NoSourceChangeLocation(arrayList,aimErpFactory,
aimErpLocation, aimLOcationName, user ); aimErpLocation, aimLOcationName, user,timesString );
List<MaterialPackingKey> mpKeyList = new ArrayList<MaterialPackingKey> (); List<MaterialPackingKey> mpKeyList = new ArrayList<MaterialPackingKey> ();
SetEventInfo setEventInfo = new SetEventInfo(); SetEventInfo setEventInfo = new SetEventInfo();
for (MaterialPacking materialPacking : all) { for (MaterialPacking materialPacking : all) {

View File

@ -555,7 +555,7 @@ public class InvoiceServiceImpl implements InvoiceService {
else else
{ {
billCode=ProductionStockOut_NEW(shipRequestName, "SDK", eventUser,materialPackingKeyList); billCode=ProductionStockOut_NEW(shipRequestName, "SDK", eventUser,materialPackingKeyList,commitDate);
if (billCode.isEmpty()) { if (billCode.isEmpty()) {
throw new CustomException("SAP过账异常"); throw new CustomException("SAP过账异常");
} }
@ -595,7 +595,7 @@ public class InvoiceServiceImpl implements InvoiceService {
case "ZLF7": case "ZLF7":
case "ZLF8": case "ZLF8":
// billCode=toSAPService.saleStockOut_NEW(shipRequestName, "SDK", eventUser,materialPackingKeyList); // billCode=toSAPService.saleStockOut_NEW(shipRequestName, "SDK", eventUser,materialPackingKeyList);
billCode=saleStockOut_NEW(shipRequestName, "SDK", eventUser,materialPackingKeyList); billCode=saleStockOut_NEW(shipRequestName, "SDK", eventUser,materialPackingKeyList,commitDate);
untils.SaveUnDoInfo_ForSap(materialPackingKeyList, billCode, makeEventInfo); untils.SaveUnDoInfo_ForSap(materialPackingKeyList, billCode, makeEventInfo);
break; break;
@ -2078,7 +2078,7 @@ public class InvoiceServiceImpl implements InvoiceService {
} }
} }
public String ProductionStockOut_NEW(String shipRequestName, String siteName, String user,List<String> boxList) throws Exception { public String ProductionStockOut_NEW(String shipRequestName, String siteName, String user,List<String> boxList,String commitDate) throws Exception {
String rcode; String rcode;
String undoId = ""; String undoId = "";
@ -2179,10 +2179,14 @@ public class InvoiceServiceImpl implements InvoiceService {
*/ */
body.put("ITEM", itemArray); body.put("ITEM", itemArray);
body.put("ITEMID", uniqueID); body.put("ITEMID", uniqueID);
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyyMMdd");
Date date = inputFormat.parse(commitDate);
String outputDate = outputFormat.format(date);
//过账日期 //过账日期
body.put("BUDAT", TimeStampUtil.getCurrentTime("yyyyMMdd")); body.put("BUDAT", outputDate);
//凭证日期 //凭证日期
body.put("BLDAT", TimeStampUtil.getCurrentTime("yyyyMMdd")); body.put("BLDAT", outputDate);
//凭证抬头文本 //凭证抬头文本
body.put("BKTXT", uniqueID); body.put("BKTXT", uniqueID);
//用户名 //用户名
@ -2419,7 +2423,7 @@ public class InvoiceServiceImpl implements InvoiceService {
} }
//重写销售交货单过账zd.2024.8.14 //重写销售交货单过账zd.2024.8.14
public String saleStockOut_NEW(String shipRequestName, String siteName, String user,List<String> boxList) throws Exception { public String saleStockOut_NEW(String shipRequestName, String siteName, String user,List<String> boxList,String commitDate) throws Exception {
String rcode; String rcode;
String undoId = ""; String undoId = "";
String rmsg = null; String rmsg = null;
@ -2477,10 +2481,15 @@ public class InvoiceServiceImpl implements InvoiceService {
*/ */
//交货单号 //交货单号
body.put("VBELN", shipRequestName); body.put("VBELN", shipRequestName);
SimpleDateFormat inputFormat = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyyMMdd");
Date date = inputFormat.parse(commitDate);
String outputDate = outputFormat.format(date);
//实际过账日期 //实际过账日期
body.put("WADAT_IST", TimeStampUtil.getCurrentTime("yyyyMMdd"));//yyyyMMddhhmmss body.put("WADAT_IST", outputDate);//yyyyMMddhhmmss
//发送日期 //发送日期
body.put("Z_SENDDATE", TimeStampUtil.getCurrentTime("yyyyMMdd")); body.put("Z_SENDDATE", outputDate);
//操作类型过账 //操作类型过账
body.put("Z_OPTION", "1"); body.put("Z_OPTION", "1");

View File

@ -274,7 +274,7 @@ public class ProductIntoServiceImpl implements FGStockInService {
String aimErpLocation = boxList.get(0).getErpLocation(); String aimErpLocation = boxList.get(0).getErpLocation();
String aimLOcationName = boxList.get(0).getLocationName(); String aimLOcationName = boxList.get(0).getLocationName();
String billCode = toSAPService.NoSourceChangeLocation(arrayList,aimErpFactory, String billCode = toSAPService.NoSourceChangeLocation(arrayList,aimErpFactory,
aimErpLocation, aimLOcationName, user ); aimErpLocation, aimLOcationName, user, "" );
} }
/** /**
@ -327,7 +327,7 @@ public class ProductIntoServiceImpl implements FGStockInService {
String aimErpLocation = boxList.get(0).getErpLocation(); String aimErpLocation = boxList.get(0).getErpLocation();
String aimLOcationName = boxList.get(0).getLocationName(); String aimLOcationName = boxList.get(0).getLocationName();
undoID = toSAPService.NoSourceChangeLocation(arrayList,aimErpFactory, undoID = toSAPService.NoSourceChangeLocation(arrayList,aimErpFactory,
aimErpLocation, aimLOcationName, user ); aimErpLocation, aimLOcationName, user, commitDate);
//更新物料凭证和库存状态 //更新物料凭证和库存状态
toSapDao.updateLocationStockState(boxList, "Stocked", undoID,aimErpFactory,aimErpLocation,aimLOcationName,user); toSapDao.updateLocationStockState(boxList, "Stocked", undoID,aimErpFactory,aimErpLocation,aimLOcationName,user);
}else { }else {
@ -336,7 +336,7 @@ public class ProductIntoServiceImpl implements FGStockInService {
// String json = JSON.toJSONString(fgStockInInfo); // String json = JSON.toJSONString(fgStockInInfo);
String json = JSON.toJSONString(fgStockInInfo); String json = JSON.toJSONString(fgStockInInfo);
undoID = toSAPService.FGStockInByManulIn(json, user,receiveRequestActNo); undoID = toSAPService.FGStockInByManulIn(json, user,receiveRequestActNo,commitDate);
// String pc = "("; // String pc = "(";
// for (MaterialPacking materialPacking : boxList) { // for (MaterialPacking materialPacking : boxList) {

View File

@ -19,6 +19,7 @@ public class PurchaseReturnServiceImpl implements PurchaseReturnService {
@Autowired @Autowired
private PurchaseReturnServiceDao purchaseReturnServiceDao; private PurchaseReturnServiceDao purchaseReturnServiceDao;
@Autowired
private ToSapDao toSapDao; private ToSapDao toSapDao;
@Autowired @Autowired
@ -87,7 +88,7 @@ public class PurchaseReturnServiceImpl implements PurchaseReturnService {
*/ */
@Override @Override
@Transactional @Transactional
public String completeReceiveRequest(String siteName, String user, String receiverequestname) throws Exception { public String completeReceiveRequest(String siteName, String user, String receiverequestname, String commitDate) throws Exception {
//查找需要过账的采购退库信息 //查找需要过账的采购退库信息
List<MaterialPacking> purchaseReturnBoxList = purchaseReturnServiceDao.getPurchaseReturnBoxList(siteName, receiverequestname); List<MaterialPacking> purchaseReturnBoxList = purchaseReturnServiceDao.getPurchaseReturnBoxList(siteName, receiverequestname);
// MaterialPacking的MaterialPackingName放入一个List<String> // MaterialPacking的MaterialPackingName放入一个List<String>
@ -97,7 +98,7 @@ public class PurchaseReturnServiceImpl implements PurchaseReturnService {
} }
//过账SAP //过账SAP
// String undoId = toSAPServiceImpl.orderStockOut(receiverequestname, siteName, user, purchaseReturnBoxListName); // String undoId = toSAPServiceImpl.orderStockOut(receiverequestname, siteName, user, purchaseReturnBoxListName);
String undoId = toSAPServiceImpl.OrderStockBackOut(receiverequestname, siteName, user); String undoId = toSAPServiceImpl.OrderStockBackOut(receiverequestname, siteName, user,commitDate);
// String undoId = "111"; // String undoId = "111";
//更新库存状态 //更新库存状态
toSapDao.updateStockState(purchaseReturnBoxList, "StockOut", undoId, user); toSapDao.updateStockState(purchaseReturnBoxList, "StockOut", undoId, user);

View File

@ -813,7 +813,7 @@ public class ReturnStockIntoServiceImpl implements ReturnStockInService {
aimErpLocation = boxList.get(0).getErpLocation(); aimErpLocation = boxList.get(0).getErpLocation();
aimLOcationName = boxList.get(0).getLocationName(); aimLOcationName = boxList.get(0).getLocationName();
billCode = ToSAPServiceImpl.NoSourceChangeLocation(arrayList,aimErpFactory, billCode = ToSAPServiceImpl.NoSourceChangeLocation(arrayList,aimErpFactory,
aimErpLocation, aimLOcationName, eventUser ); aimErpLocation, aimLOcationName, eventUser, "");
if (billCode.length() == 0) { if (billCode.length() == 0) {
throw new GlobalException("报送ERP失败,请联系IT处理"); throw new GlobalException("报送ERP失败,请联系IT处理");

View File

@ -15,5 +15,5 @@ public interface PurchaseReturnService {
public String getPurPackingInfo(String siteName, String user, String receiverequestname) throws Exception; public String getPurPackingInfo(String siteName, String user, String receiverequestname) throws Exception;
public String completeReceiveRequest(String siteName, String user, String receiverequestname) throws Exception; public String completeReceiveRequest(String siteName, String user, String receiverequestname, String commitDate) throws Exception;
} }