姜鹏 1 month ago
parent
commit
19a1e5920a
  1. 2
      ICSSoft.WMS.WebAPI/ICSSoft.Common/NewTransType.cs
  2. 4
      ICSSoft.WMS.WebAPI/ICSSoft.Common/TransTypeEnum.cs
  3. 77
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
  4. 47
      ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs

2
ICSSoft.WMS.WebAPI/ICSSoft.Common/NewTransType.cs

@ -31,7 +31,7 @@ namespace ICSSoft.Common
"生产发料-补料申请单","副产品入库-生产订单","条码打印","锐腾两步调入","锐腾委外发料-委外订单备料表",
"无源头调拨","副产品入库-无源头","副产品入库-委外订单","红字其他入库","采购入库-入库单","委外入库-入库单","销售发货-出库单",
"生产发料-生产订单备料表-自动出库","杂发-自动","产成品入库-产成品入库单-mes","销售发货-红字出库单","销售发货-红字出库单原条码","采购退货-采购订单","委外退货-委外采购订单",
"物料调拨-自动","销售发货单-快递单","成品预入库-DRCoffee","采购入库-采购订单-DRCoffee","条码拆分记录查询","条码查询-未入库","条码记录","赋码上架","生产交接","采购到货-开立到货单"
"物料调拨-自动","销售发货单-快递单","成品预入库-DRCoffee","采购入库-采购订单-DRCoffee","条码拆分记录查询","条码查询-未入库","条码记录","赋码上架","生产交接","采购到货-开立到货单","采购拒收-退回"
};

4
ICSSoft.WMS.WebAPI/ICSSoft.Common/TransTypeEnum.cs

@ -28,6 +28,10 @@ namespace ICSSoft.Common
[DBValue("42")]
PurchaseRejectDoc,
[Description("采购拒收-退回")]
[DBValue("42-1")]
PurchaseRejectReturnDoc,
[Description("采购退货-采购退货单")]
[DBValue("3")]
PurchaseReceiveDoctNegative,

77
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs

@ -1818,6 +1818,24 @@ a.ExtensionID
tableName = @"ICSDeliveryNotice a ";
where = @" a.DNCode='{0}' AND a.WorkPoint='{1}' AND a.DNType='3' AND a.Status='1' AND a.Quantity>ISNULL(a.RCVQuantity, 0)";
singleWhere = @" a.DNCode='{0}' AND a.WorkPoint='{1}' AND a.DNType='3'";
completeWhere = @" a.DNCode='{0}' AND a.WorkPoint='{1}' AND a.Quantity>ISNULL(a.RCVQuantity,0)";
}
#endregion
#region 采购拒收-退回
else if (TransType == TransTypeEnum.PurchaseRejectReturnDoc.GetDescription())
{
columns = @"a.DNCode AS TransCode,
a.DNDetailID AS DetailID,
a.Sequence AS TransSequence,
a.EATTRIBUTE1 AS Barcode,
ISNULL(a.RCVQuantity,0) AS IssueQuantity,";
tableName = @"ICSDeliveryNotice a ";
where = @" a.DNCode='{0}' AND a.WorkPoint='{1}' AND a.DNType='3' AND a.Status='2' AND a.Quantity>ISNULL(a.RCVQuantity, 0)";
singleWhere = @" a.DNCode='{0}' AND a.WorkPoint='{1}' AND a.DNType='3'";
@ -6117,6 +6135,30 @@ LEFT JOIN (SELECT SUM(Quantity) AS sumQty,SUM(InQuantity) AS sumIsQty,WorkPoint,
orderby = @" a.MTIME DESC";
}
#endregion
#region 采购拒收
else if (TransType == TransTypeEnum.PurchaseRejectDoc.GetDescription())
{
columns = @" DISTINCT a.DNCode AS TransCode,a.MTIME";
tableName = @"ICSDeliveryNotice a ";
where = @" a.Status='1' AND a.DNType='3' AND a.WorkPoint='{1}' and a.Quantity>ISNULL(a.RCVQuantity, 0)";
orderby = @" a.MTIME DESC";
}
#endregion
#region 采购拒收-退回
else if (TransType == TransTypeEnum.PurchaseRejectReturnDoc.GetDescription())
{
columns = @" DISTINCT a.DNCode AS TransCode,a.MTIME";
tableName = @"ICSDeliveryNotice a ";
where = @" a.Status='2' AND a.DNType='3' AND a.WorkPoint='{1}' and a.Quantity>ISNULL(a.RCVQuantity, 0)";
orderby = @" a.MTIME DESC";
}
#endregion
#endregion
else
@ -13507,7 +13549,7 @@ INNER JOIN ICSExtension extt ON ISNULL(ext.ProjectCode, '')+'~'+CASE WHEN (invBa
case when isnull(config.enable,0)=0 then '2' else '1' end,
e.F_Account, SYSDATETIME(),
a.DNID,a.DNDetailID, '0', '0', a.ExtensionID,
e.F_Account,e.F_RealName, SYSDATETIME(), a.WorkPoint, d.LOTNO,''
e.F_Account,e.F_RealName, '{12}', a.WorkPoint, d.LOTNO,''
FROM ICSDeliveryNotice a
INNER JOIN ICSExtension ext ON a.ExtensionID=ext.ID AND a.WorkPoint=ext.WorkPoint
INNER JOIN ICSASNDetail b ON a.ASNCode=b.ASNCode AND a.WorkPoint=b.WorkPoint
@ -13522,7 +13564,7 @@ INNER JOIN ICSExtension extd ON d.ExtensionID=extd.ID AND d.WorkPoint=extd.WorkP
INNER JOIN ICSPurchaseOrder n ON m.TransCode =n.POCode AND m.TransSequence=n.Sequence AND a.PODetailID=n.PODetailID AND m.WorkPoint=n.WorkPoint
INNER JOIN ICSInspection h ON h.LotNo=d.LotNo AND h.WorkPoint=a.WorkPoint and h.enable = 1
INNER JOIN Sys_SRM_User e ON e.F_Account='{3}' AND e.F_Location='{2}'
left join icsConfiguration config on 1=1 and config.Code ='SaveReview001'
left join icsConfiguration config on 1=1 and config.Code ='SaveReview001' AND config.WorkPoint=a.WorkPoint
WHERE a.DNCode='{0}' and d.LOTNO='{1}' AND a.WorkPoint='{2}'and
ISNULL(ext.ProjectCode, '')+'~'+CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(ext.BatchCode, '') ELSE '' END+'~'+ISNULL(ext.Version, '')+'~'+ISNULL(ext.Brand, '')+'~'+
ISNULL(ext.cFree1, '')+'~'+ISNULL(ext.cFree2, '')+'~'+ISNULL(ext.cFree3, '')+'~'+ISNULL(ext.cFree4, '')+'~'+ISNULL(ext.cFree5, '')+'~'+ISNULL(ext.cFree6, '')+'~'+ISNULL(ext.cFree7, '')+'~'+ISNULL(ext.cFree8, '')+'~'+ISNULL(ext.cFree9, '')+'~'+ISNULL(ext.cFree10, '') = ISNULL(extd.ProjectCode, '')+'~'+CASE WHEN (invBat.BatchEnable IS NULL AND ISNULL(inv.BatchEnable, '0')='1') OR ISNULL(invBat.BatchEnable, '0')='1' THEN ISNULL(extd.BatchCode, '') ELSE '' END+'~'+ISNULL(extd.Version, '')+'~'+ISNULL(extd.Brand, '')+'~'+
@ -13553,7 +13595,7 @@ INNER JOIN ICSExtension extd ON d.ExtensionID=extd.ID AND d.WorkPoint=extd.WorkP
case when isnull(config.enable,0)=0 then '2' else '1' end,
e.F_Account, SYSDATETIME(),
a.DNID,a.DNDetailID, '0', '0', a.ExtensionID,
e.F_Account,e.F_RealName, SYSDATETIME(), a.WorkPoint, d.LOTNO,''
e.F_Account,e.F_RealName, '{12}', a.WorkPoint, d.LOTNO,''
FROM ICSDeliveryNotice a
INNER JOIN ICSExtension ext ON a.ExtensionID=ext.ID AND a.WorkPoint=ext.WorkPoint
INNER JOIN ICSASNDetail b ON a.ASNCode=b.ASNCode AND a.WorkPoint=b.WorkPoint
@ -13567,11 +13609,11 @@ INNER JOIN ICSExtension ext ON a.ExtensionID=ext.ID AND a.WorkPoint=ext.WorkPoin
INNER JOIN ICSPurchaseOrder n ON m.TransCode =n.POCode AND m.TransSequence=n.Sequence AND a.PODetailID=n.PODetailID AND m.WorkPoint=n.WorkPoint
INNER JOIN ICSInspection h ON h.LotNo=d.LotNo AND h.WorkPoint=a.WorkPoint and h.enable = 1
INNER JOIN Sys_SRM_User e ON e.F_Account='{3}' AND e.F_Location='{2}'
left join icsConfiguration config on 1=1 and config.Code ='SaveReview001'
left join icsConfiguration config on 1=1 and config.Code ='SaveReview001' AND config.WorkPoint=a.WorkPoint
WHERE a.DNCode='{0}' and d.LOTNO='{1}' AND a.WorkPoint='{2}'";
}
sql = string.Format(sql, item.DNCode, itemInfo.LotNo, item.WorkPoint, item.User, Code, item.VenCode, item.DepCode, itemInfo.Quantity, itemInfo.Amount, itemInfo.UnitPrice, itemInfo.Currency, itemInfo.Sequence);
sql = string.Format(sql, item.DNCode, itemInfo.LotNo, item.WorkPoint, item.User, Code, item.VenCode, item.DepCode, itemInfo.Quantity, itemInfo.Amount, itemInfo.UnitPrice, itemInfo.Currency, itemInfo.Sequence, item.MTime);
if (!DBHelper.ExecuteNonQuery(sql, cmd))
{
@ -13580,13 +13622,13 @@ INNER JOIN ICSExtension ext ON a.ExtensionID=ext.ID AND a.WorkPoint=ext.WorkPoin
lots += "'" + itemInfo.LotNo + item.WorkPoint + "',";
}
//增加了webconfig 判断不是U9,调用U8接口
string sqlCheckSign = @"select * from ICSConfiguration where code = 'UploadERP003' and enable = '1'";
DataTable flag = DBHelper.SQlReturnData(sqlCheckSign, cmd);
if (flag != null && flag.Rows.Count > 0)
{
if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["UploadERP"]) && !DBHelper.IsU9())
ICSPurchaseService.PurchaseRejectDocInNewERP(item.DNCode, Code, item.WorkPoint, cmd, language);
}
//string sqlCheckSign = @"select * from ICSConfiguration where code = 'UploadERP003' and enable = '1'";
//DataTable flag = DBHelper.SQlReturnData(sqlCheckSign, cmd);
//if (flag != null && flag.Rows.Count > 0)
//{
// if (Convert.ToBoolean(System.Configuration.ConfigurationManager.AppSettings["UploadERP"]) && !DBHelper.IsU9())
// ICSPurchaseService.PurchaseRejectDocInNewERP(item.DNCode, Code, item.WorkPoint, cmd, language);
//}
@ -33406,9 +33448,9 @@ END as NEWLotNo
'','','','{8}' ,(select Top 1 f.F_RealName FROM ICSInventoryLot a INNER JOIN Sys_SRM_User f ON f.F_Account='{8}' AND a.WorkPoint=f.F_Location) ,
SYSDATETIME() ,'{3}' ,''
FROM ICSDeliveryNotice a
INNER JOIN ICSInventoryLotDetail b ON b.TransCode=a.DNCode AND b.TransSequnce=a.Sequence AND b.WorkPoint=a.WorkPoint
INNER JOIN ICSInventoryLot c WHERE c.LotNo=a.b.LotNo AND c.WorkPoint=b.WorkPoint
WHERE a.DNCode='{1}' AND a.Sequence='{2}' AND a.DNType='3' AND a.Status='2' AND a.WorkPoint='{3}'
INNER JOIN ICSInventoryLot c ON c.LotNo=a.EATTRIBUTE1 AND c.WorkPoint=a.WorkPoint
WHERE a.DNCode='{1}' AND a.Sequence='{2}' AND a.DNType='3' AND a.Status='1' AND a.WorkPoint='{3}'
UPDATE ICSDeliveryNotice SET Status='2' WHERE DNCode='{1}' AND Sequence='{2}' AND DNType='3' AND Status='1' AND WorkPoint='{3}'
";
detailSql = string.Format(detailSql, itemInfo.LotNo, item.TransCode, itemInfo.Sequence, item.WorkPoint, itemInfo.locationCode, item.Quantity, Identification, TransTypeEnum.PurchaseRejectDoc.GetDescription<DBValue>(), item.User);
sql += detailSql;
@ -33537,10 +33579,9 @@ END as NEWLotNo
'','','','{8}' ,(select Top 1 f.F_RealName FROM ICSInventoryLot a INNER JOIN Sys_SRM_User f ON f.F_Account='{8}' AND a.WorkPoint=f.F_Location) ,
SYSDATETIME() ,'{3}' ,''
FROM ICSDeliveryNotice a
INNER JOIN ICSInventoryLotDetail b ON b.TransCode=a.DNCode AND b.TransSequnce=a.Sequence AND b.WorkPoint=a.WorkPoint
INNER JOIN ICSInventoryLot c WHERE c.LotNo=a.b.LotNo AND c.WorkPoint=b.WorkPoint
INNER JOIN ICSInventoryLot c ON c.LotNo=a.EATTRIBUTE1 AND c.WorkPoint=a.WorkPoint
WHERE a.DNCode='{1}' AND a.Sequence='{2}' AND a.DNType='3' AND a.Status='2' AND a.WorkPoint='{3}'
UPDATE ICSDeliveryNotice SET RCVQuantity={5} WHERE DNCode='{1}' AND Sequence='{2}' AND DNType='3' AND Status='2' AND WorkPoint='{3}'
UPDATE ICSDeliveryNotice SET RCVQuantity={5},Status='3' WHERE DNCode='{1}' AND Sequence='{2}' AND DNType='3' AND Status='2' AND WorkPoint='{3}'
";
detailSql = string.Format(detailSql, itemInfo.LotNo, item.TransCode, itemInfo.Sequence, item.WorkPoint, "", item.Quantity, Identification, TransTypeEnum.PurchaseRejectDoc.GetDescription<DBValue>(), item.User);
sql += detailSql;

47
ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs

@ -2619,52 +2619,7 @@ namespace ICSSoft.WebAPI.Controllers
log.Debug("生产退料申请修改返回值:" + str);
return result;
}
///// <summary>
///// 生产退料删除
///// </summary>
///// <param name="JsonData"></param>
///// <returns></returns>
//[HttpPost]
//[Route("api/MOIssueDocNegativeApply/Delete")]
//public HttpResponseMessage MOIssueDocNegativeApplyDelete([FromBody] object JsonData)
//{
// log.Info("生产退料申请添加传入值" + JsonData);
// try
// {
// List<ICSMOApplyNeg> model = new List<ICSMOApplyNeg>();
// if (JsonData != null && !string.IsNullOrWhiteSpace(JsonData.ToString()) && JsonData.ToString() != "[]")
// {
// model = JsonConvert.DeserializeObject<List<ICSMOApplyNeg>>(JsonData.ToString());
// WMSBarCoreService action = new WMSBarCoreService();
// var resultStr = action.MOIssueDocNegativeApplyDelete(model);
// if (resultStr > 0)
// {
// res.Success = true;
// res.Message = LanguageHelper.GetNameSingle("WMSAPI001");// "接口调用成功!";
// res.Data = resultStr;
// }
// else
// {
// res.Success = false;
// res.Message = "退料单号没有数据!";
// }
// }
// }
// catch (Exception ex)
// {
// log.Error("转换失败:" + ex.ToString());
// res.Success = false;
// res.Message = ex.Message;
// }
// finally
// {
// str = JsonConvert.SerializeObject(res);
// result.Content = new StringContent(str, Encoding.GetEncoding("UTF-8"), "application/json");
// }
// log.Debug("生产退料申请添加返回值:" + str);
// return result;
//}
#region 到货单
///// <summary>

Loading…
Cancel
Save