pda出入库
This commit is contained in:
commit
0b5a14316c
@ -48,7 +48,7 @@ public class QMSServiceImpl implements QMSService{
|
||||
" TO_CHAR(T.RECEIVETIME ,'YYYY-MM-DD' ) deliveryDate, \r\n" +
|
||||
" T.RECEIVEREQUESTNAME , \r\n" +
|
||||
" M3.MATERIALSPECNAME materialCode, \r\n" +
|
||||
" M3.DESC_CN materialName, \r\n" +
|
||||
" M3.DESCRIPTION materialName, \r\n" +
|
||||
" M3.MATERIALGROUP materialGroup, \r\n" +
|
||||
" COUNT(DISTINCT T.CHARGE ) batchQuantity, \r\n" +
|
||||
" T.UNIT quantityUnit, \r\n" +
|
||||
@ -81,7 +81,7 @@ public class QMSServiceImpl implements QMSService{
|
||||
" T.RECEIVEREQUESTNAME , \r\n" +
|
||||
" TO_CHAR(T.RECEIVETIME ,'YYYY-MM-DD' ) ,\r\n" +
|
||||
" M3.MATERIALSPECNAME , \r\n" +
|
||||
" M3.DESC_CN , \r\n" +
|
||||
" M3.DESCRIPTION , \r\n" +
|
||||
" M3.MATERIALGROUP , \r\n" +
|
||||
" T.UNIT , \r\n" +
|
||||
" S.SUPPLIERNO , \r\n" +
|
||||
@ -410,7 +410,7 @@ public class QMSServiceImpl implements QMSService{
|
||||
" T.LOCATIONNAME,\r\n" +
|
||||
" TO_CHAR(T.RECEIVETIME, 'YYYY-MM-DD') deliveryDate,\r\n" +
|
||||
" M3.MATERIALSPECNAME materialCode,\r\n" +
|
||||
" M3.DESC_CN materialName,\r\n" +
|
||||
" M3.DESCRIPTION materialName,\r\n" +
|
||||
" M3.MATERIALGROUP materialGroup,\r\n" +
|
||||
" COUNT(DISTINCT T.CHARGE) batchQuantity,\r\n" +
|
||||
" T.UNIT quantityUnit,\r\n" +
|
||||
@ -434,7 +434,7 @@ public class QMSServiceImpl implements QMSService{
|
||||
" BE.DESCRIPTION,\r\n" +
|
||||
" TO_CHAR(T.RECEIVETIME, 'YYYY-MM-DD'),\r\n" +
|
||||
" M3.MATERIALSPECNAME,\r\n" +
|
||||
" M3.DESC_CN,\r\n" +
|
||||
" M3.DESCRIPTION,\r\n" +
|
||||
" M3.MATERIALGROUP,\r\n" +
|
||||
" T.UNIT,\r\n" +
|
||||
" S.SUPPLIERNO,\r\n" +
|
||||
@ -479,41 +479,53 @@ public class QMSServiceImpl implements QMSService{
|
||||
|
||||
public String sendToIQCByDataList(String opCode, String siteName, String deliveryName) throws CustomException {
|
||||
String sql = " \n" +
|
||||
"SELECT \n" +
|
||||
"WITH AA AS (\n" +
|
||||
"\tSELECT\n" +
|
||||
"\t\tP.SITENAME,\n" +
|
||||
" \t\tEL.DESCRIPTION AS ERPLOCATIONDESC,\n" +
|
||||
"\t\tP.LOCATIONNAME,\t\n" +
|
||||
"\t\tTO_CHAR(P.RECEIVETIME ,'YYYY-MM-DD' ) deliveryDate,\n" +
|
||||
"\t\tDR.RECEIVEREQUESTNAME,\n" +
|
||||
"\t\tP.RECEIVEREQUESTNAME,\n" +
|
||||
"\t\tP.ERPFACTORY,\n" +
|
||||
"\t\tP.ERPLOCATION,\n" +
|
||||
"\t\tP.MATERIALSPECNAME AS materialCode,\n" +
|
||||
"\t\tMP.DESC_CN AS materialName,\n" +
|
||||
"\t\tMP.MATERIALGROUP AS materialGroup,\n" +
|
||||
"\t\tP.LOCATIONNAME,\t\n" +
|
||||
"\t\tP.UNIT AS quantityUnit,\n" +
|
||||
"\t\tLISTAGG(DISTINCT P.CHARGE , ';') WITHIN GROUP (ORDER BY P.CHARGE) AS LOTS,\n" +
|
||||
"\t\tCOUNT(DISTINCT P.CHARGE ) batchQuantity,\n" +
|
||||
" P.UNIT AS quantityUnit,\n" +
|
||||
"\t\tSP.SUPPLIERNO AS SUPPLIERCODE,\n" +
|
||||
"\t\tSP.SUPPLIERNAME,\n" +
|
||||
"\t\tLISTAGG(DISTINCT P.CHARGE , ';') WITHIN GROUP (ORDER BY P.CHARGE) AS LOTS\n" +
|
||||
"\t\t\tFROM\n" +
|
||||
" MATERIALPACKING P \n" +
|
||||
"LEFT JOIN SUPPLIER SP\tON SP.SUPPLIERNO = P.SUPPLIERNAME\n" +
|
||||
"LEFT JOIN BS_ERPLOCATION EL ON EL.ERPLOCATIONNAME = P.ERPLOCATION AND EL.SITENAME = P.SITENAME\n" +
|
||||
"LEFT JOIN MATERIALSPEC MP ON MP.MATERIALSPECNAME = P.MATERIALSPECNAME AND MP.SITENAME = P.SITENAME\n" +
|
||||
"LEFT JOIN BS_MATERIALFACTORY BF ON BF.MATERIALSPECNAME = P.MATERIALSPECNAME AND BF.ERPFACTORY = P.ERPFACTORY\n" +
|
||||
"LEFT JOIN MATERIALRECEIVEREQUESTDETAIL RD ON P.SITENAME = RD.SITENAME \n" +
|
||||
"LEFT JOIN MATERIALRECEIVEREQUEST R ON RD.RECEIVEREQUESTNAME = R.RECEIVEREQUESTNAME AND RD.SITENAME = R.SITENAME\n" +
|
||||
"LEFT JOIN MATERIALDELIVERYRECEIVE DR ON R.RECEIVEREQUESTNAME=DR.RECEIVEREQUESTNAME \n" +
|
||||
"LEFT JOIN MATERIALDELIVERY D ON DR.DELIVERYNAME = D.DELIVERYNAME WHERE\n" +
|
||||
" D.SITENAME =:SITENAME\n" +
|
||||
" AND D.DELIVERYNAME =:DELIVERYNAME\n" +
|
||||
" AND D.DELIVERYSTATE = '02'\n" +
|
||||
"\t\tAND DR.MATERIALSPECNAME=RD.MATERIALSPECNAME\n" +
|
||||
"\t\tAND RD.RECEIVEREQUESTDETAILNAME=DR.RECEIVEREQUESTDETAILNAME\n" +
|
||||
"\t\tAND P.RECEIVEREQUESTNAME = DR.DELIVERYNAME \n" +
|
||||
"\t\tAND P.MATERIALSPECNAME = DR.MATERIALSPECNAME AND P.STOCKSTATE = 'Created' \n" +
|
||||
"\t\tP.SUPPLIERNAME\n" +
|
||||
"\tFROM\n" +
|
||||
"\t\tMATERIALPACKING P \n" +
|
||||
"\tWHERE\n" +
|
||||
"\t\tP.RECEIVEREQUESTNAME =:DELIVERYNAME\n" +
|
||||
"\t\tGROUP BY \n" +
|
||||
"\t\tP.SITENAME,EL.DESCRIPTION,TO_CHAR(P.RECEIVETIME ,'YYYY-MM-DD' ),\n" +
|
||||
"\t\tP.MATERIALSPECNAME,MP.DESC_CN, MP.MATERIALGROUP,P.UNIT,SP.SUPPLIERNO, SP.SUPPLIERNAME,\n" +
|
||||
"\t\tSUBSTR(P.TRUEGG , 1, INSTR(P.TRUEGG , '*') - 1) ,P.LOCATIONNAME,DR.RECEIVEREQUESTNAME ";
|
||||
"\t\tP.SITENAME,\n" +
|
||||
"\t\tP.RECEIVEREQUESTNAME,\n" +
|
||||
"\t\tP.ERPFACTORY,\n" +
|
||||
"\t\tP.ERPLOCATION,\n" +
|
||||
"\t\tP.MATERIALSPECNAME,\n" +
|
||||
"\t\tP.LOCATIONNAME,\n" +
|
||||
"\t\tP.UNIT,\n" +
|
||||
"\t\tP.SUPPLIERNAME\n" +
|
||||
"\t\t)\n" +
|
||||
"\t\t\n" +
|
||||
"SELECT\n" +
|
||||
"\tAA.SITENAME,\n" +
|
||||
"AA.RECEIVEREQUESTNAME,\n" +
|
||||
"\t\tAA.ERPFACTORY,\n" +
|
||||
"\t\tAA.ERPLOCATION,\n" +
|
||||
"\t\tAA.materialCode,\n" +
|
||||
"\t\tAA.LOCATIONNAME,\t\n" +
|
||||
"\t\tAA.quantityUnit,\n" +
|
||||
"\t\tAA.LOTS,\n" +
|
||||
"\t\tAA.batchQuantity,\n" +
|
||||
"\t\tAA.SUPPLIERNAME,\n" +
|
||||
"\t\tEL.DESCRIPTION AS ERPLOCATIONDESC,\n" +
|
||||
"\t\tMP.MATERIALGROUP,\n" +
|
||||
"\t\tMP.DESCRIPTION\n" +
|
||||
"FROM\n" +
|
||||
"AA\n" +
|
||||
"LEFT JOIN BS_ERPLOCATION EL ON EL.ERPLOCATIONNAME = AA.ERPLOCATION\n" +
|
||||
"LEFT JOIN MATERIALSPEC MP ON MP.MATERIALSPECNAME = AA.materialCode\n" +
|
||||
"WHERE\n" +
|
||||
"\tAA.RECEIVEREQUESTNAME =:DELIVERYNAME ";
|
||||
Map<String, Object> hashMap = new HashMap<String,Object> ();
|
||||
hashMap.put("SITENAME", siteName);
|
||||
hashMap.put("DELIVERYNAME", deliveryName);
|
||||
|
@ -5746,7 +5746,7 @@ public class ToSAPServiceImpl {
|
||||
ErpMessageLog erplog = new ErpMessageLog();
|
||||
erplog.setEventUser("");
|
||||
erplog.setServerName("WmsToErp");
|
||||
erplog.setEventName("iqcResultFeekback");
|
||||
erplog.setEventName("pqcSyncdata2-QMS质检结果");
|
||||
erplog.setInterfaceTime(TimeStampUtil.getCurrentTime(TimeStampUtil.FORMAT_DEFAULT));
|
||||
erplog.setMessageId(UUID.randomUUID().toString());
|
||||
erplog.setSendMsg(sendData);
|
||||
@ -6714,53 +6714,43 @@ public class ToSAPServiceImpl {
|
||||
List<MaterialPackingKey> materialPackingKeyList = new ArrayList<>();
|
||||
List<Map<String, Object>> qmsDataList = new ArrayList<>();
|
||||
//依据采购订单,查询待入库的物料(MATERIALPACKING)
|
||||
String querySql = " SELECT " +
|
||||
" DR.DELIVERYNUM AS MATERIALQUANTITY,\n" +
|
||||
" DR.RECEIVEREQUESTNAME,\n" +
|
||||
" DR.RECEIVEREQUESTDETAILNAME,\n" +
|
||||
" P.ERPLOCATION,\n" +
|
||||
" P.ERPFACTORY,\n" +
|
||||
" P.UNIT,\n" +
|
||||
"\t\tSUM(P.FQTY) AS FQTY,\n" +
|
||||
" P.FUNIT,\n" +
|
||||
" P.REMARK,\n" +
|
||||
"\t\tP.OQARESULTSTATE,\n" +
|
||||
"\t\tBF.IQCFLAG,\n" +
|
||||
" P.OQARESULT,\n" +
|
||||
"\t\tR.RECEIVEREQUESTTYPE,\n" +
|
||||
"\t\tEL.DESCRIPTION AS ERPLOCATIONDESC,\n" +
|
||||
"\t\tSP.SUPPLIERNO AS SUPPLIERCODE,\n" +
|
||||
"\t\tSP.SUPPLIERNAME,\n" +
|
||||
"\t\tMP.MATERIALSPECNAME AS MATERIALSPECNAME,\n" +
|
||||
"\t\tMP.DESC_CN AS MATERIALNAME,\n" +
|
||||
"\t\tMP.MATERIALGROUP,\n" +
|
||||
"\t\tP.LOCATIONNAME,\t\t\n" +
|
||||
"\t\tP.RECEIVETIME,\n" +
|
||||
"\t\tP.TRUEGG " +
|
||||
" FROM\n" +
|
||||
" MATERIALPACKING P \n" +
|
||||
"LEFT JOIN SUPPLIER SP\tON SP.SITENAME = P.SUPPLIERNAME\n" +
|
||||
"LEFT JOIN BS_ERPLOCATION EL ON EL.ERPLOCATIONNAME = P.ERPLOCATION AND EL.SITENAME = P.SITENAME\n" +
|
||||
"LEFT JOIN MATERIALSPEC MP ON MP.MATERIALSPECNAME = P.MATERIALSPECNAME AND MP.SITENAME = P.SITENAME\n" +
|
||||
"LEFT JOIN BS_MATERIALFACTORY BF ON BF.MATERIALSPECNAME = P.MATERIALSPECNAME AND BF.ERPFACTORY = P.ERPFACTORY\n" +
|
||||
"LEFT JOIN MATERIALRECEIVEREQUESTDETAIL RD ON P.SITENAME = RD.SITENAME \n" +
|
||||
"LEFT JOIN MATERIALRECEIVEREQUEST R ON RD.RECEIVEREQUESTNAME = R.RECEIVEREQUESTNAME AND RD.SITENAME = R.SITENAME\n" +
|
||||
"LEFT JOIN MATERIALDELIVERYRECEIVE DR ON R.RECEIVEREQUESTNAME=DR.RECEIVEREQUESTNAME \n" +
|
||||
"LEFT JOIN MATERIALDELIVERY D ON DR.DELIVERYNAME = D.DELIVERYNAME " +
|
||||
String querySql = " \n" +
|
||||
"\t\t\n" +
|
||||
"\t\tWITH AA AS (\n" +
|
||||
"\tSELECT DISTINCT\n" +
|
||||
"\t\tP.RECEIVEREQUESTNAME,\n" +
|
||||
"\t\tP.ERPFACTORY,\n" +
|
||||
"\t\tP.ERPLOCATION,\n" +
|
||||
"\t\tP.MATERIALSPECNAME \n" +
|
||||
"\tFROM\n" +
|
||||
"\t\tMATERIALPACKING P \n" +
|
||||
"\tWHERE\n" +
|
||||
"\t\tP.RECEIVEREQUESTNAME =:DELIVERYNAME\n" +
|
||||
"\t\tAND P.STOCKSTATE = 'Created' \n" +
|
||||
"\t) \n" +
|
||||
"SELECT\n" +
|
||||
"\tDR.DELIVERYNAME,\n" +
|
||||
"\tDR.DELIVERYNUM AS MATERIALQUANTITY,\n" +
|
||||
"\tDR.RECEIVEREQUESTNAME,\n" +
|
||||
"\tDR.MATERIALSPECNAME,\n" +
|
||||
"\tDR.RECEIVEREQUESTDETAILNAME,\n" +
|
||||
"\tAA.ERPLOCATION,\n" +
|
||||
"\tAA.ERPFACTORY,\n" +
|
||||
"\tRQ.SUPPLIERNO AS SUPPLIERNAME,\n" +
|
||||
"\tRD.MATERIALUNIT AS UNIT,\n" +
|
||||
"\tMP.FUNIT,\n" +
|
||||
"\tBF.IQCFLAG\n" +
|
||||
"FROM\n" +
|
||||
"\tMATERIALDELIVERYRECEIVE DR\n" +
|
||||
"\tLEFT JOIN MATERIALRECEIVEREQUESTDETAIL RD ON DR.RECEIVEREQUESTNAME = RD.RECEIVEREQUESTNAME AND DR.RECEIVEREQUESTDETAILNAME = RD.RECEIVEREQUESTDETAILNAME\n" +
|
||||
"\tLEFT JOIN MATERIALRECEIVEREQUEST RQ ON RQ.RECEIVEREQUESTNAME = RD.RECEIVEREQUESTNAME\n" +
|
||||
"\tLEFT JOIN MATERIALSPEC MP ON MP.MATERIALSPECNAME = DR.MATERIALSPECNAME\n" +
|
||||
"\tLEFT JOIN BS_MATERIALFACTORY BF ON BF.MATERIALSPECNAME = RD.MATERIALSPECNAME \n" +
|
||||
"\tAND BF.ERPFACTORY = RD.ERPFACTORY\n" +
|
||||
"\tLEFT JOIN AA ON DR.MATERIALSPECNAME = AA.MATERIALSPECNAME \n" +
|
||||
"WHERE\n" +
|
||||
" D.SITENAME =:SITENAME\n" +
|
||||
" AND D.DELIVERYNAME =:DELIVERYNAME\n" +
|
||||
" AND D.DELIVERYSTATE = '02'\n" +
|
||||
"\t\tAND DR.MATERIALSPECNAME=RD.MATERIALSPECNAME\n" +
|
||||
"\t\tAND RD.RECEIVEREQUESTDETAILNAME=DR.RECEIVEREQUESTDETAILNAME\n" +
|
||||
"\t\tAND P.RECEIVEREQUESTNAME = DR.DELIVERYNAME \n" +
|
||||
"\t\tAND P.MATERIALSPECNAME = DR.MATERIALSPECNAME" +
|
||||
" AND P.STOCKSTATE = 'Created' " +
|
||||
" GROUP BY DR.RECEIVEREQUESTNAME, DR.RECEIVEREQUESTDETAILNAME\n" +
|
||||
"\t\t,P.OQARESULT, P.OQARESULTSTATE, P.UNIT, P.FUNIT, P.REMARK, P.SUPPLIERNAME\n" +
|
||||
"\t\t,P.ERPFACTORY, P.ERPLOCATION, BF.IQCFLAG, R.RECEIVEREQUESTTYPE\n" +
|
||||
"\t\t,EL.DESCRIPTION, SP.SUPPLIERNO,SP.SUPPLIERNAME,MP.MATERIALSPECNAME\n" +
|
||||
"\t\t,MP.DESC_CN, MP.MATERIALGROUP, P.LOCATIONNAME, P.RECEIVETIME,P.TRUEGG,DR.DELIVERYNUM ";
|
||||
"\tDELIVERYNAME =:DELIVERYNAME\n" +
|
||||
"\t " ;
|
||||
Map<String, Object> hashMap = new HashMap<String, Object>();
|
||||
hashMap.put("DELIVERYNAME", deliveryName);
|
||||
hashMap.put("SITENAME", siteName);
|
||||
@ -6786,7 +6776,7 @@ public class ToSAPServiceImpl {
|
||||
item.put("LIFNR", mm.get("SUPPLIERNAME"));
|
||||
item.put("MENGE", mm.get("MATERIALQUANTITY"));
|
||||
item.put("MEINS", mm.get("UNIT"));
|
||||
item.put("BPMNG", mm.get("FQTY"));//采购价格单位数量
|
||||
item.put("BPMNG", mm.get("FQTY") == null ? "0" : mm.get("FQTY"));//采购价格单位数量
|
||||
item.put("BPRME", mm.get("FUNIT"));//采购价格单位
|
||||
|
||||
item.put("EBELN", mm.get("RECEIVEREQUESTNAME"));
|
||||
@ -6802,9 +6792,9 @@ public class ToSAPServiceImpl {
|
||||
// String insmk = StringUtils.equals(mm.get("OQARESULTSTATE").toString(),"END")?"":"X";
|
||||
item.put("INSMK", insmk);
|
||||
itemData.add(item);
|
||||
if (!saleList.contains(mm.get("RECEIVEREQUESTTYPE").toString())){
|
||||
/*if (!saleList.contains(mm.get("RECEIVEREQUESTTYPE").toString())){
|
||||
qmsDataList.add(mm);
|
||||
}
|
||||
}*/
|
||||
/**
|
||||
//存储条码,更新UNDOID用
|
||||
MaterialPackingKey materialPackingKey = new MaterialPackingKey(siteName, mm.get("MATERIALPACKINGNAME").toString());
|
||||
@ -6838,21 +6828,7 @@ public class ToSAPServiceImpl {
|
||||
throw new RuntimeException("SAP返回" + rmsg);
|
||||
}
|
||||
|
||||
if("S".equals(rcode) && qmsDataList.size() > 0) {
|
||||
/**
|
||||
jsonObject.put("warehouse", list.get(i).get("ERPLOCATIONDESC"));
|
||||
jsonObject.put("supplierName", list.get(i).get("SUPPLIERNAME"));
|
||||
jsonObject.put("supplierCode", list.get(i).get("SUPPLIERCODE"));
|
||||
jsonObject.put("materialName", list.get(i).get("MATERIALNAME"));
|
||||
jsonObject.put("materialCode", list.get(i).get("MATERIALCODE"));
|
||||
jsonObject.put("materialGroup", list.get(i).get("MATERIALGROUP"));
|
||||
jsonObject.put("batchQuantity", list.get(i).get("BATCHQUANTITY"));
|
||||
jsonObject.put("quantityUnit", list.get(i).get("QUANTITYUNIT"));
|
||||
jsonObject.put("deliveryDate", list.get(i).get("DELIVERYDATE"));
|
||||
jsonObject.put("specifications", list.get(i).get("BATCHNUMBER"));
|
||||
jsonObject.put("LOCATIONNAME", list.get(i).get("LOCATIONNAME"));
|
||||
String receiveRequestName = list.get(i).get("RECEIVEREQUESTNAME") == null ? "" : list.get(i).get("RECEIVEREQUESTNAME").toString();
|
||||
*/
|
||||
if("S".equals(rcode)) {
|
||||
// 调用 QMS
|
||||
//qMSServiceImpl.PreIQCInfoSend(receiveRequestName, "SDK",opCode, erpFactory);
|
||||
exceptionMsg = "QMS返回";
|
||||
|
@ -29,6 +29,7 @@ import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
@ -634,6 +635,7 @@ public class MaterialReceiveActController {
|
||||
* @param in receiveRequestName到货单号
|
||||
* @return 返回信息
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@RequestMapping(value = "/commitDeliveryStockInToSAP", method = RequestMethod.POST)
|
||||
public AjaxResult CommitDeliveryStockInToSAP(@RequestBody JSONObject in ) throws Exception {
|
||||
try {
|
||||
|
@ -41,17 +41,22 @@ public class MaterialUndoController {
|
||||
String undoId = undoDto.getUndoId();
|
||||
String userId = undoDto.getUserId();
|
||||
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 commitDate = undoDto.getCommitDate();
|
||||
|
||||
String preErpLocation = undoDto.getPreErpLocation();
|
||||
String preLocationName = undoDto.getPreLocationName();
|
||||
String locationName = undoDto.getErpLocation();
|
||||
String erpLocation = undoDto.getLocationName();
|
||||
|
||||
//根据物料凭证校验物料状态是否一致
|
||||
try {
|
||||
Boolean checkUndoCondition = untils.CheckUndoCondition(undoId);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return AjaxResult.me().setSuccess(false).setMessage(e.toString());
|
||||
}
|
||||
// try {
|
||||
// Boolean checkUndoCondition = untils.CheckUndoCondition(undoId);
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// return AjaxResult.me().setSuccess(false).setMessage(e.toString());
|
||||
// }
|
||||
//校验单据类型,根据单据类型判断逻辑
|
||||
// switch (inv_TYPE) {
|
||||
// case "45":
|
||||
@ -71,20 +76,28 @@ public class MaterialUndoController {
|
||||
// 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.cgrkUndo(undoId, userId); // 采购入库
|
||||
} else if ("Z002".equals(inv_TYPE) || "Z003".equals(inv_TYPE) || "Z004".equals(inv_TYPE)) {
|
||||
materialUndoServiceImpl.cprkUndo(undoId, userId);// 成品入库
|
||||
} else if (inv_TYPE.contains("ZLF") || "Z008".equals(inv_TYPE)) { // 出库冲销
|
||||
}
|
||||
// else if ("Z002".equals(inv_TYPE) || "Z003".equals(inv_TYPE) || "Z004".equals(inv_TYPE)) {
|
||||
// materialUndoServiceImpl.cprkUndo(undoId, userId);// 成品入库
|
||||
// }
|
||||
else if ("Z008".equals(inv_TYPE)) { // 出库冲销
|
||||
materialUndoServiceImpl.ckUndo(undoId, userId);
|
||||
} else if (inv_TYPE.contains("ZLR")) {
|
||||
materialUndoServiceImpl.ckUndo(undoId, userId);
|
||||
}else if(inv_TYPE.contains("ZK")) { // 转库
|
||||
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("调拨出库")) { // 调拨出库
|
||||
materialUndoServiceImpl.orderUndo(undoId, userId,commitDate);
|
||||
}else {
|
||||
} else if (inv_TYPE.contains("ZLF")) { // 销售发货出库
|
||||
materialUndoServiceImpl.orderUndo(undoId, userId,commitDate);
|
||||
} else {
|
||||
return AjaxResult.me().setSuccess(false).setMessage("单据类型不支持冲销");
|
||||
}
|
||||
|
||||
|
@ -284,7 +284,7 @@ public class QMSController {
|
||||
|
||||
SetEventInfo setEventInfo = 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.setEventName("iqcSyncdata");
|
||||
eventInfo.setEventUser("pQC");
|
||||
@ -314,7 +314,7 @@ public class QMSController {
|
||||
String pqcResult = jb.get("judgementResult").toString();//检验结果
|
||||
String pqcResultDate = jb.get("resultTime").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 specialState = jb.get("specialState") == null ? "" : jb.get("specialState").toString();//特殊状态 (0特采、1紧急放行、2退供应商)
|
||||
String transferStatus = jb.get("transferStatus") == null ? "" : jb.get("transferStatus").toString();//异常处理
|
||||
@ -354,6 +354,7 @@ public class QMSController {
|
||||
//eventInfo.setEventTime(Timestamp.valueOf(pqcResultDate));
|
||||
eventInfo.setEventUser(user);
|
||||
List<String> sapBoxList = new ArrayList<> ();
|
||||
|
||||
if ("0".equals(tpType)) {//采购到货单, 领料退库,产成品入库
|
||||
|
||||
// 获取JSON数组
|
||||
@ -418,6 +419,10 @@ public class QMSController {
|
||||
if(sapBoxList.size() > 0) {
|
||||
String undoId = toSAPService.iqcResultFeekback(sapBoxList,siteName,commonNumber,materialCode,pqcResult,pqcResultDate,user,
|
||||
exceptionHandling,specialState);
|
||||
if (undoId == null || "".equals(undoId)) {
|
||||
throw new CustomException("SAP过账失败!");
|
||||
}
|
||||
untils.SaveUnDoInfo_ForSap(sapBoxList, undoId, makeEventInfo);
|
||||
}
|
||||
|
||||
if(mpList.size()>0)
|
||||
@ -517,6 +522,11 @@ public class QMSController {
|
||||
if(sapBoxList.size() > 0) {
|
||||
String undoId = toSAPService.iqcResultFeekback(sapBoxList,siteName,commonNumber,materialCode,pqcResult,pqcResultDate,user,
|
||||
exceptionHandling,specialState);
|
||||
|
||||
if (undoId == null || "".equals(undoId)) {
|
||||
throw new CustomException("SAP过账失败!");
|
||||
}
|
||||
untils.SaveUnDoInfo_ForSap(sapBoxList, undoId, makeEventInfo);
|
||||
}
|
||||
|
||||
if(mpList.size()>0)
|
||||
@ -992,7 +1002,7 @@ public class QMSController {
|
||||
// billCode = NCWServiceImpl.OQZkNoInvoice(LocationBoxList, sendUser);
|
||||
|
||||
if (billCode == null || "".equals(billCode)) {
|
||||
throw new CustomException("ERP过账失败!");
|
||||
throw new CustomException("SAP过账失败!");
|
||||
}
|
||||
|
||||
EventInfoUtil eventInfoUtil = new EventInfoUtil();
|
||||
|
@ -16,4 +16,12 @@ public class MaterialUndoDto {
|
||||
private String lastEventName;
|
||||
|
||||
private String commitDate;
|
||||
|
||||
private String preErpLocation;
|
||||
|
||||
private String preLocationName;
|
||||
|
||||
private String locationName;
|
||||
|
||||
private String erpLocation;
|
||||
}
|
||||
|
@ -68,5 +68,5 @@ public interface IMaterialShipService {
|
||||
* @param eventInfo 事件信息
|
||||
* @param materialDelivery 到货单信息
|
||||
*/
|
||||
void DeliveryStockInUpdateReceiveRequestQty(EventInfo eventInfo, MaterialDelivery materialDelivery);
|
||||
void DeliveryStockInUpdateReceiveRequestQty(EventInfo eventInfo, MaterialDelivery materialDelivery) throws Exception;
|
||||
}
|
||||
|
@ -2066,7 +2066,7 @@ public class MaterialShipServiceImpl implements IMaterialShipService {
|
||||
* @param eventInfo 事件信息
|
||||
* @param materialDelivery 到货单信息
|
||||
*/
|
||||
public void DeliveryStockInUpdateReceiveRequestQty(EventInfo eventInfo, MaterialDelivery materialDelivery){
|
||||
public void DeliveryStockInUpdateReceiveRequestQty(EventInfo eventInfo, MaterialDelivery materialDelivery) throws Exception{
|
||||
//获取到货单关联的所有入库单
|
||||
StoreDetailDto storeDetailDto = new StoreDetailDto();
|
||||
storeDetailDto.setDocumentName(materialDelivery.getDeliveryName());
|
||||
@ -2090,6 +2090,7 @@ public class MaterialShipServiceImpl implements IMaterialShipService {
|
||||
updateReceiveRequestQtyMap.put("SITENAME", materialDelivery.getSiteName());
|
||||
updateReceiveRequestQtyMap.put("MATERIALSPECNAME", materialDeliveryReceive.getMaterialSpecName());
|
||||
updateReceiveRequestQtyMap.put("RECEIVEREQUESTNAME", materialDeliveryReceive.getReceiveRequestName());
|
||||
updateReceiveRequestQtyMap.put("RECEIVEREQUESTDETAILNAME", materialDeliveryReceive.getReceiveRequestDetailName());
|
||||
updateReceiveRequestQtyMap.put("LASTEVENTNAME", eventInfo.getEventUser());
|
||||
updateReceiveRequestQtyMap.put("LASTEVENTTIMEKEY", eventInfo.getEventTimeKey());
|
||||
updateReceiveRequestQtyMap.put("LASTEVENTTIME", eventInfo.getEventTime());
|
||||
|
@ -74,29 +74,34 @@ public class MaterialUndoServiceImpl implements IMaterialUndoService {
|
||||
@Transactional
|
||||
public void cgrkUndo (String undoId, String user) throws Exception {
|
||||
|
||||
String billCode = toSAPService.cancelShipInter(undoId, user);
|
||||
if (billCode == null) {
|
||||
throw new GlobalException("报送ERP失败,请联系IT处理!");
|
||||
}
|
||||
// String billCode = toSAPService.cancelShipInter(undoId, user);
|
||||
// if (billCode == null) {
|
||||
// throw new GlobalException("报送ERP失败,请联系IT处理!");
|
||||
// }
|
||||
|
||||
EventInfo makeEventInfo = new EventInfoUtil().makeEventInfo("MakeUndo", user, "MakeUndo");
|
||||
EventInfo makeEventInfo = new EventInfoUtil().makeEventInfo("采购入库冲销", user, "采购入库冲销");
|
||||
String condition="WHERE UNDOID =? ";
|
||||
String[] bindSet={undoId};
|
||||
//根据物料凭证找到所有的待冲销数据,更新库存状态为创建
|
||||
|
||||
// 直接删除生成的标签
|
||||
List<MaterialPacking> list = MaterialPackingServiceProxy.getMaterialPackingService().select(condition, bindSet);
|
||||
Map<String, Object> hashMap = new HashMap<String, Object> ();
|
||||
hashMap.put("stockState", "Created");
|
||||
SetEventInfo setEventInfo = new SetEventInfo();
|
||||
setEventInfo.setUserColumns(hashMap);
|
||||
if(list.size() > 0) {
|
||||
for (MaterialPacking materialPacking : list) {
|
||||
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);
|
||||
}
|
||||
@ -298,6 +303,58 @@ public class MaterialUndoServiceImpl implements IMaterialUndoService {
|
||||
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
|
||||
public void orderUndo (String undoId, String user, String commitDate) throws Exception {
|
||||
|
||||
|
@ -82,7 +82,6 @@ public class NoInvoiceManagerServiceImpl {
|
||||
undoid = toSAPServiceImpl.qtcrNoInvoiceForCheckPlanApp(mapList, qtc, user,
|
||||
commitDate,opCode,costName,lifnr);
|
||||
SDKMaterialPackingServiceImpl.updateUndoIdInByList(list, undoid, makeEventInfo,opCode);
|
||||
|
||||
//更新库存状态
|
||||
commonUtils.SaveUnDoInfo_ForSap(strings,undoid,makeEventInfo);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user