Compare commits
2 Commits
a81c9dcbea
...
8fc2cc900e
Author | SHA1 | Date | |
---|---|---|---|
8fc2cc900e | |||
23d125763d |
@ -5744,7 +5744,7 @@ public class ToSAPServiceImpl {
|
|||||||
ErpMessageLog erplog = new ErpMessageLog();
|
ErpMessageLog erplog = new ErpMessageLog();
|
||||||
erplog.setEventUser("");
|
erplog.setEventUser("");
|
||||||
erplog.setServerName("WmsToErp");
|
erplog.setServerName("WmsToErp");
|
||||||
erplog.setEventName("iqcResultFeekback");
|
erplog.setEventName("pqcSyncdata2-QMS质检结果");
|
||||||
erplog.setInterfaceTime(TimeStampUtil.getCurrentTime(TimeStampUtil.FORMAT_DEFAULT));
|
erplog.setInterfaceTime(TimeStampUtil.getCurrentTime(TimeStampUtil.FORMAT_DEFAULT));
|
||||||
erplog.setMessageId(UUID.randomUUID().toString());
|
erplog.setMessageId(UUID.randomUUID().toString());
|
||||||
erplog.setSendMsg(sendData);
|
erplog.setSendMsg(sendData);
|
||||||
|
@ -41,17 +41,22 @@ public class MaterialUndoController {
|
|||||||
String undoId = undoDto.getUndoId();
|
String undoId = undoDto.getUndoId();
|
||||||
String userId = undoDto.getUserId();
|
String userId = undoDto.getUserId();
|
||||||
String flag = undoDto.getFlag();
|
String flag = undoDto.getFlag();
|
||||||
String inv_TYPE = undoDto.getINV_TYPE();
|
String inv_TYPE = undoDto.getINV_TYPE() == null ? "" : undoDto.getINV_TYPE();
|
||||||
String lastEventName = undoDto.getLastEventName();
|
String lastEventName = undoDto.getLastEventName();
|
||||||
String commitDate = undoDto.getCommitDate();
|
String commitDate = undoDto.getCommitDate();
|
||||||
|
|
||||||
|
String preErpLocation = undoDto.getPreErpLocation();
|
||||||
|
String preLocationName = undoDto.getPreLocationName();
|
||||||
|
String locationName = undoDto.getErpLocation();
|
||||||
|
String erpLocation = undoDto.getLocationName();
|
||||||
|
|
||||||
//根据物料凭证校验物料状态是否一致
|
//根据物料凭证校验物料状态是否一致
|
||||||
try {
|
// try {
|
||||||
Boolean checkUndoCondition = untils.CheckUndoCondition(undoId);
|
// Boolean checkUndoCondition = untils.CheckUndoCondition(undoId);
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
e.printStackTrace();
|
// e.printStackTrace();
|
||||||
return AjaxResult.me().setSuccess(false).setMessage(e.toString());
|
// return AjaxResult.me().setSuccess(false).setMessage(e.toString());
|
||||||
}
|
// }
|
||||||
//校验单据类型,根据单据类型判断逻辑
|
//校验单据类型,根据单据类型判断逻辑
|
||||||
// switch (inv_TYPE) {
|
// switch (inv_TYPE) {
|
||||||
// case "45":
|
// case "45":
|
||||||
@ -71,20 +76,28 @@ public class MaterialUndoController {
|
|||||||
// return AjaxResult.me().setSuccess(false).setMessage("单据类型不支持冲销");
|
// return AjaxResult.me().setSuccess(false).setMessage("单据类型不支持冲销");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if ("Z001".equals(inv_TYPE) || "Z005".equals(inv_TYPE) || "Z006".equals(inv_TYPE) || "Z007".equals(inv_TYPE)) {
|
if ("Z002".equals(inv_TYPE) || "Z003".equals(inv_TYPE) || "Z004".equals(inv_TYPE) || "Z001".equals(inv_TYPE) || "Z005".equals(inv_TYPE) || "Z006".equals(inv_TYPE) || "Z007".equals(inv_TYPE)) {
|
||||||
// materialUndoServiceImpl.rkUndo(undoId, userId); // 入库
|
// materialUndoServiceImpl.rkUndo(undoId, userId); // 入库
|
||||||
materialUndoServiceImpl.cgrkUndo(undoId, userId); // 采购入库
|
materialUndoServiceImpl.cgrkUndo(undoId, userId); // 采购入库
|
||||||
} else if ("Z002".equals(inv_TYPE) || "Z003".equals(inv_TYPE) || "Z004".equals(inv_TYPE)) {
|
}
|
||||||
materialUndoServiceImpl.cprkUndo(undoId, userId);// 成品入库
|
// else if ("Z002".equals(inv_TYPE) || "Z003".equals(inv_TYPE) || "Z004".equals(inv_TYPE)) {
|
||||||
} else if (inv_TYPE.contains("ZLF") || "Z008".equals(inv_TYPE)) { // 出库冲销
|
// materialUndoServiceImpl.cprkUndo(undoId, userId);// 成品入库
|
||||||
|
// }
|
||||||
|
else if ("Z008".equals(inv_TYPE)) { // 出库冲销
|
||||||
materialUndoServiceImpl.ckUndo(undoId, userId);
|
materialUndoServiceImpl.ckUndo(undoId, userId);
|
||||||
} else if (inv_TYPE.contains("ZLR")) {
|
} else if (inv_TYPE.contains("ZLR")) {
|
||||||
materialUndoServiceImpl.ckUndo(undoId, userId);
|
materialUndoServiceImpl.ckUndo(undoId, userId);
|
||||||
}else if(inv_TYPE.contains("ZK")) { // 转库
|
}else if(inv_TYPE.contains("ZK")) { // 转库
|
||||||
materialUndoServiceImpl.zkUndo(undoId, userId);
|
materialUndoServiceImpl.zkUndo(undoId, userId);
|
||||||
|
}else if(lastEventName.contains("自动转库")) { // 自动转库
|
||||||
|
materialUndoServiceImpl.zdZkUndo(undoId, userId,preErpLocation,preLocationName);
|
||||||
|
}else if(lastEventName.contains("质检结果")) { // 质检结果
|
||||||
|
materialUndoServiceImpl.zjJgUndo(undoId, userId);
|
||||||
}else if(inv_TYPE.contains("NLCC") && lastEventName.contains("调拨出库")) { // 调拨出库
|
}else if(inv_TYPE.contains("NLCC") && lastEventName.contains("调拨出库")) { // 调拨出库
|
||||||
materialUndoServiceImpl.orderUndo(undoId, userId,commitDate);
|
materialUndoServiceImpl.orderUndo(undoId, userId,commitDate);
|
||||||
}else {
|
} else if (inv_TYPE.contains("ZLF")) { // 销售发货出库
|
||||||
|
materialUndoServiceImpl.orderUndo(undoId, userId,commitDate);
|
||||||
|
} else {
|
||||||
return AjaxResult.me().setSuccess(false).setMessage("单据类型不支持冲销");
|
return AjaxResult.me().setSuccess(false).setMessage("单据类型不支持冲销");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ public class QMSController {
|
|||||||
|
|
||||||
SetEventInfo setEventInfo = new SetEventInfo();
|
SetEventInfo setEventInfo = new SetEventInfo();
|
||||||
SetEventInfo setEventInfo2 = new SetEventInfo();
|
SetEventInfo setEventInfo2 = new SetEventInfo();
|
||||||
EventInfo makeEventInfo = new EventInfoUtil().makeEventInfo("iqcSyncdata", "", "iqcSyncdata");
|
EventInfo makeEventInfo = new EventInfoUtil().makeEventInfo("QMS质检结果", "QMS", "pqcSyncdata2-QMS质检结果");
|
||||||
EventInfo eventInfo = new EventInfo();
|
EventInfo eventInfo = new EventInfo();
|
||||||
eventInfo.setEventName("iqcSyncdata");
|
eventInfo.setEventName("iqcSyncdata");
|
||||||
eventInfo.setEventUser("pQC");
|
eventInfo.setEventUser("pQC");
|
||||||
@ -314,7 +314,7 @@ public class QMSController {
|
|||||||
String pqcResult = jb.get("judgementResult").toString();//检验结果
|
String pqcResult = jb.get("judgementResult").toString();//检验结果
|
||||||
String pqcResultDate = jb.get("resultTime").toString();//检验时间
|
String pqcResultDate = jb.get("resultTime").toString();//检验时间
|
||||||
String user = jb.get("inspector").toString();//检验员
|
String user = jb.get("inspector").toString();//检验员
|
||||||
makeEventInfo = new EventInfoUtil().makeEventInfo("iqcSyncdata", user, "iqcSyncdata");
|
// makeEventInfo = new EventInfoUtil().makeEventInfo("iqcSyncdata", user, "iqcSyncdata");
|
||||||
String exceptionHandling = jb.get("exceptionHandling") == null ? "" : jb.get("exceptionHandling").toString();//异常处理 (0复卷,1降级,2报废)
|
String exceptionHandling = jb.get("exceptionHandling") == null ? "" : jb.get("exceptionHandling").toString();//异常处理 (0复卷,1降级,2报废)
|
||||||
String specialState = jb.get("specialState") == null ? "" : jb.get("specialState").toString();//特殊状态 (0特采、1紧急放行、2退供应商)
|
String specialState = jb.get("specialState") == null ? "" : jb.get("specialState").toString();//特殊状态 (0特采、1紧急放行、2退供应商)
|
||||||
String transferStatus = jb.get("transferStatus") == null ? "" : jb.get("transferStatus").toString();//异常处理
|
String transferStatus = jb.get("transferStatus") == null ? "" : jb.get("transferStatus").toString();//异常处理
|
||||||
@ -354,6 +354,7 @@ public class QMSController {
|
|||||||
//eventInfo.setEventTime(Timestamp.valueOf(pqcResultDate));
|
//eventInfo.setEventTime(Timestamp.valueOf(pqcResultDate));
|
||||||
eventInfo.setEventUser(user);
|
eventInfo.setEventUser(user);
|
||||||
List<String> sapBoxList = new ArrayList<> ();
|
List<String> sapBoxList = new ArrayList<> ();
|
||||||
|
|
||||||
if ("0".equals(tpType)) {//采购到货单, 领料退库,产成品入库
|
if ("0".equals(tpType)) {//采购到货单, 领料退库,产成品入库
|
||||||
|
|
||||||
// 获取JSON数组
|
// 获取JSON数组
|
||||||
@ -418,6 +419,10 @@ public class QMSController {
|
|||||||
if(sapBoxList.size() > 0) {
|
if(sapBoxList.size() > 0) {
|
||||||
String undoId = toSAPService.iqcResultFeekback(sapBoxList,siteName,commonNumber,materialCode,pqcResult,pqcResultDate,user,
|
String undoId = toSAPService.iqcResultFeekback(sapBoxList,siteName,commonNumber,materialCode,pqcResult,pqcResultDate,user,
|
||||||
exceptionHandling,specialState);
|
exceptionHandling,specialState);
|
||||||
|
if (undoId == null || "".equals(undoId)) {
|
||||||
|
throw new CustomException("SAP过账失败!");
|
||||||
|
}
|
||||||
|
untils.SaveUnDoInfo_ForSap(sapBoxList, undoId, makeEventInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mpList.size()>0)
|
if(mpList.size()>0)
|
||||||
@ -517,6 +522,11 @@ public class QMSController {
|
|||||||
if(sapBoxList.size() > 0) {
|
if(sapBoxList.size() > 0) {
|
||||||
String undoId = toSAPService.iqcResultFeekback(sapBoxList,siteName,commonNumber,materialCode,pqcResult,pqcResultDate,user,
|
String undoId = toSAPService.iqcResultFeekback(sapBoxList,siteName,commonNumber,materialCode,pqcResult,pqcResultDate,user,
|
||||||
exceptionHandling,specialState);
|
exceptionHandling,specialState);
|
||||||
|
|
||||||
|
if (undoId == null || "".equals(undoId)) {
|
||||||
|
throw new CustomException("SAP过账失败!");
|
||||||
|
}
|
||||||
|
untils.SaveUnDoInfo_ForSap(sapBoxList, undoId, makeEventInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mpList.size()>0)
|
if(mpList.size()>0)
|
||||||
@ -992,7 +1002,7 @@ public class QMSController {
|
|||||||
// billCode = NCWServiceImpl.OQZkNoInvoice(LocationBoxList, sendUser);
|
// billCode = NCWServiceImpl.OQZkNoInvoice(LocationBoxList, sendUser);
|
||||||
|
|
||||||
if (billCode == null || "".equals(billCode)) {
|
if (billCode == null || "".equals(billCode)) {
|
||||||
throw new CustomException("ERP过账失败!");
|
throw new CustomException("SAP过账失败!");
|
||||||
}
|
}
|
||||||
|
|
||||||
EventInfoUtil eventInfoUtil = new EventInfoUtil();
|
EventInfoUtil eventInfoUtil = new EventInfoUtil();
|
||||||
|
@ -16,4 +16,12 @@ public class MaterialUndoDto {
|
|||||||
private String lastEventName;
|
private String lastEventName;
|
||||||
|
|
||||||
private String commitDate;
|
private String commitDate;
|
||||||
|
|
||||||
|
private String preErpLocation;
|
||||||
|
|
||||||
|
private String preLocationName;
|
||||||
|
|
||||||
|
private String locationName;
|
||||||
|
|
||||||
|
private String erpLocation;
|
||||||
}
|
}
|
||||||
|
@ -74,29 +74,34 @@ public class MaterialUndoServiceImpl implements IMaterialUndoService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
public void cgrkUndo (String undoId, String user) throws Exception {
|
public void cgrkUndo (String undoId, String user) throws Exception {
|
||||||
|
|
||||||
String billCode = toSAPService.cancelShipInter(undoId, user);
|
// String billCode = toSAPService.cancelShipInter(undoId, user);
|
||||||
if (billCode == null) {
|
// if (billCode == null) {
|
||||||
throw new GlobalException("报送ERP失败,请联系IT处理!");
|
// throw new GlobalException("报送ERP失败,请联系IT处理!");
|
||||||
}
|
// }
|
||||||
|
|
||||||
EventInfo makeEventInfo = new EventInfoUtil().makeEventInfo("MakeUndo", user, "MakeUndo");
|
EventInfo makeEventInfo = new EventInfoUtil().makeEventInfo("采购入库冲销", user, "采购入库冲销");
|
||||||
String condition="WHERE UNDOID =? ";
|
String condition="WHERE UNDOID =? ";
|
||||||
String[] bindSet={undoId};
|
String[] bindSet={undoId};
|
||||||
//根据物料凭证找到所有的待冲销数据,更新库存状态为创建
|
//根据物料凭证找到所有的待冲销数据,更新库存状态为创建
|
||||||
|
|
||||||
|
// 直接删除生成的标签
|
||||||
List<MaterialPacking> list = MaterialPackingServiceProxy.getMaterialPackingService().select(condition, bindSet);
|
List<MaterialPacking> list = MaterialPackingServiceProxy.getMaterialPackingService().select(condition, bindSet);
|
||||||
Map<String, Object> hashMap = new HashMap<String, Object> ();
|
if(list.size() > 0) {
|
||||||
hashMap.put("stockState", "Created");
|
for (MaterialPacking materialPacking : list) {
|
||||||
SetEventInfo setEventInfo = new SetEventInfo();
|
|
||||||
setEventInfo.setUserColumns(hashMap);
|
|
||||||
for (MaterialPacking materialPacking : list) {
|
|
||||||
MaterialPackingKey key = materialPacking.getKey();
|
MaterialPackingKey key = materialPacking.getKey();
|
||||||
MaterialPackingServiceProxy.getMaterialPackingService().setEvent(key, makeEventInfo, setEventInfo);
|
// MaterialPackingServiceProxy.getMaterialPackingService().setEvent(key, makeEventInfo, setEventInfo);
|
||||||
|
|
||||||
|
String delSql = "DELETE FROM MATERIALPACKING WHERE MATERIALPACKINGNAME = :MATERIALPACKINGNAME";
|
||||||
|
String MATERIALPACKINGNAME = materialPacking.getMaterialPackingName();
|
||||||
|
Map<String, Object> hashMap = new HashMap<String, Object> ();
|
||||||
|
hashMap.put("MATERIALPACKINGNAME", MATERIALPACKINGNAME);
|
||||||
|
// SetEventInfo setEventInfo = new SetEventInfo();
|
||||||
|
// setEventInfo.setUserColumns(hashMap);
|
||||||
|
IDMFrameServiceProxy.getSqlTemplate().update(delSql, hashMap);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// String sql = "UPDATE BS_MATERIALPACKINGUNDOINFO b SET b.FLAG = 'Y' WHERE b.UNDOID = :UNDOID";
|
|
||||||
// Map<String, Object> hashMap2 = new HashMap<String, Object> ();
|
|
||||||
// hashMap2.put("UNDOID", undoId);
|
|
||||||
// IDMFrameServiceProxy.getSqlTemplate().update(sql, hashMap2);
|
|
||||||
// 更新凭证冲销状态
|
// 更新凭证冲销状态
|
||||||
MaterialReversalDao.updateReversalUnDoId(undoId);
|
MaterialReversalDao.updateReversalUnDoId(undoId);
|
||||||
}
|
}
|
||||||
@ -298,6 +303,58 @@ public class MaterialUndoServiceImpl implements IMaterialUndoService {
|
|||||||
MaterialReversalDao.updateReversalUnDoId(undoId);
|
MaterialReversalDao.updateReversalUnDoId(undoId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自动转库
|
||||||
|
* @param undoId
|
||||||
|
* @param user
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
public void zdZkUndo (String undoId, String user,String preErpLocation,String preLocationName) throws Exception {
|
||||||
|
|
||||||
|
String billCode = toSAPService.cancelShipInter(undoId, user);
|
||||||
|
if (billCode == null) {
|
||||||
|
throw new GlobalException("报送ERP失败,请联系IT处理!");
|
||||||
|
}
|
||||||
|
|
||||||
|
EventInfo makeEventInfo = new EventInfoUtil().makeEventInfo("冲销自动转库", user, "冲销自动转库");
|
||||||
|
String condition="WHERE UNDOID =? ";
|
||||||
|
String[] bindSet={undoId};
|
||||||
|
//根据物料凭证找到所有的待冲销数据,更新库存状态为创建
|
||||||
|
List<MaterialPacking> list = MaterialPackingServiceProxy.getMaterialPackingService().select(condition, bindSet);
|
||||||
|
|
||||||
|
for (MaterialPacking materialPacking : list) {
|
||||||
|
Map<String, Object> hashMap = new HashMap<String, Object> ();
|
||||||
|
hashMap.put("erpLocation", preErpLocation);
|
||||||
|
hashMap.put("locationName", preLocationName);
|
||||||
|
// hashMap.put("preErpLocation", materialPacking.getErpLocation());
|
||||||
|
// hashMap.put("preLocationName", materialPacking.getLocationName());
|
||||||
|
SetEventInfo setEventInfo = new SetEventInfo();
|
||||||
|
setEventInfo.setUserColumns(hashMap);
|
||||||
|
MaterialPackingKey key = materialPacking.getKey();
|
||||||
|
MaterialPackingServiceProxy.getMaterialPackingService().setEvent(key, makeEventInfo, setEventInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新凭证冲销状态
|
||||||
|
MaterialReversalDao.updateReversalUnDoId(undoId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 质检结果
|
||||||
|
* @param undoId
|
||||||
|
* @param user
|
||||||
|
*/
|
||||||
|
@Transactional
|
||||||
|
public void zjJgUndo (String undoId, String user) throws Exception {
|
||||||
|
|
||||||
|
String billCode = toSAPService.cancelShipInter(undoId, user);
|
||||||
|
if (billCode == null) {
|
||||||
|
throw new GlobalException("SAP质检结果冲销失败!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新凭证冲销状态
|
||||||
|
MaterialReversalDao.updateReversalUnDoId(undoId);
|
||||||
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public void orderUndo (String undoId, String user, String commitDate) throws Exception {
|
public void orderUndo (String undoId, String user, String commitDate) throws Exception {
|
||||||
|
|
||||||
|
@ -54,6 +54,7 @@ public class NoInvoiceManagerServiceImpl {
|
|||||||
}
|
}
|
||||||
String undoid = "";
|
String undoid = "";
|
||||||
// undoid = NCWServiceImpl.qtrNoInvoice(list,user,commitDate,opCode);
|
// undoid = NCWServiceImpl.qtrNoInvoice(list,user,commitDate,opCode);
|
||||||
|
|
||||||
SDKMaterialPackingServiceImpl.updateUndoIdByList(list, undoid, makeEventInfo,opCode);
|
SDKMaterialPackingServiceImpl.updateUndoIdByList(list, undoid, makeEventInfo,opCode);
|
||||||
//更新库存状态
|
//更新库存状态
|
||||||
SDKMaterialPackingServiceImpl.SaveUnDoInfo( undoid,commitDate);
|
SDKMaterialPackingServiceImpl.SaveUnDoInfo( undoid,commitDate);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user