Juj 1 year ago
parent
commit
1dae7d7ff6
  1. 121
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs
  2. 2
      ICSSoft.WMS.WebAPI/ICSSoft.WMS.WebAPI/Controllers/WMSBarCoreController.cs
  3. 17
      WMS-BS/NFine.Application/OMAY/OMAYApsApp.cs
  4. 5
      WMS-BS/NFine.Web/Areas/OMAY/Controllers/ApsController.cs
  5. 2
      WMS-BS/NFine.Web/Areas/OMAY/Views/Aps/EditInstructionBill.cshtml
  6. 21
      WMS-BS/NFine.Web/Areas/OMAY/Views/Aps/MoProducePlan.cshtml

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

@ -1963,7 +1963,7 @@ a.ExtensionID
tableName = @"ICSCheck a ";
where = @" a.WorkPoint='{1}' ";
where = @" a.WorkPoint='{1}' and a.Status='1'";
}
#endregion
where = string.Format(where, JsonData.TransCode, JsonData.WorkPoint);
@ -10586,17 +10586,69 @@ END";
{
string lots = string.Empty;
string sql = string.Empty;
DataTable dtLotno = new DataTable();
int result = 0;
string Identification = Guid.NewGuid().ToString();
foreach (var item in JsonData)
{
sql = @"SELECT b.LotNo FROM ICSCheck a
INNER JOIN ICSWareHouseLotInfo b ON SUBSTRING(b.LocationCode,1,LEN(a.SelectLevel))=a.SelectLevel
INNER JOIN ICSWarehouse c on b.WarehouseCode=c.WarehouseCode and b.WorkPoint=c.WorkPoint
where a.CheckCode='{0}' and a.WorkPoint='{1}'";
sql = string.Format(sql, item.CheckCode, item.WorkPoint);
dtLotno = DBHelper.SQlReturnData(sql, cmd);
//创建盘点单
foreach (var itemInfo in item.detail)
{
for (int i = dtLotno.Rows.Count - 1; i >= 0; i--)
{
string lotNo = dtLotno.Rows[i]["LotNo"].ToString();
// 判断当前 itemInfo.LotNo 是否包含在 dtLotno 中
if (lotNo.Equals(itemInfo.LotNo))
{
// 移除该行记录
dtLotno.Rows.RemoveAt(i);
}
}
ICSWareHouseLotInfoService.WareHouseLotInfoUpdate(Identification, item.CheckCode, "", itemInfo.LotNo, itemInfo.ActualQuantity, item.User, item.WorkPoint, TransTypeEnum.Check.GetDescription<DBValue>(), item.CheckKind, cmd, language);
lots += "'" + itemInfo.LotNo + item.WorkPoint + "',";
}
for (int i = 0; i < dtLotno.Rows.Count; i++)
{
///更新库存
sql = @"UPDATE ICSWareHouseLotInfo SET Quantity=0 WHERE LotNo='{0}' AND WorkPoint='{1}'";
sql = string.Format(sql, dtLotno.Rows[i]["LotNo"].ToString(), item.WorkPoint);
if (!DBHelper.ExecuteNonQuery(sql, cmd))
{
throw new Exception(language.GetNameByCode("WMSAPIInfo168"));//"库存更新失败!");
}
///添加日志
sql = @"INSERT INTO ICSWareHouseLotInfoLog(ID,Identification,TransCode,TransSequence,LotNo,InvCode,
FromWarehouseCode,FromLocationCode,ToWarehouseCode,ToLocationCode,Quantity,
Memo,Lock,TransType,BusinessCode,ERPUpload,ERPID,
ERPDetailID,ERPCode,ERPSequence,MUSER,MUSERName,
MTIME,WorkPoint,EATTRIBUTE1)
SELECT NEWID(),'{3}','{4}','{5}',a.LotNo ,a.InvCode ,
a.WarehouseCode,a.LocationCode,'','',a.Quantity,
'{8}','0','{6}','{7}','0','',
'','','',f.F_Account ,f.F_RealName ,
SYSDATETIME() ,a.WorkPoint ,''
FROM ICSWareHouseLotInfo a
INNER JOIN Sys_SRM_User f ON f.F_Account='{2}' AND a.WorkPoint=f.F_Location
WHERE a.LotNo='{0}' AND a.WorkPoint='{1}'
";
sql = string.Format(sql, dtLotno.Rows[i]["LotNo"].ToString(), item.WorkPoint, item.User, Identification, item.CheckCode, "", 8, TransTypeEnum.LOTCheckAfter.GetDescription<DBValue>(), item.CheckKind);
if (!DBHelper.ExecuteNonQuery(sql, cmd))
{
throw new Exception(language.GetNameByCode("WMSAPIInfo166"));
}
}
if (string.IsNullOrWhiteSpace(lots))
{
throw new Exception(language.GetNameByCode("WMSAPIInfo005"));//"请传入条码信息!");
@ -17432,18 +17484,69 @@ a.ExtensionID
item.TransCode = trans[1];
}
#region 销售出库
else if (TransType == TransTypeEnum.SalesShipmentDoc.GetDescription()
|| TransType == TransTypeEnum.MOIssueDoc.GetDescription()
|| TransType == TransTypeEnum.OutsourcingIssueDoc.GetDescription())
else if (TransType == TransTypeEnum.SalesShipmentDoc.GetDescription())
{
BusinessCode = TransTypeEnum.SalesShipmentDoc.GetDescription<DBValue>();
//更新源头单据数量
pikTbLogsql += string.Format(@" update b set b.LockQuantity=convert(decimal(18,6),b.LockQuantity)-convert(decimal(18,6),c.Quantity )
from dbo.ICSWareHouseLotInfo b
inner join (select sum(Quantity) as Quantity, LotNo from ICSWareHouseLotInfolog where TransCode ='{0}' AND TransSequence='{1}' and TransType='15' and WorkPoint='{2}' group by LotNo) c
on c.LotNo =b.LotNo ", item.TransCode, item.TransSequence,item.WorkPoint);
pikTbLogsql += string.Format(@" IF EXISTS(SELECT * FROM ICSSDN b
where b.SDNCode = '{0}' AND b.workpoint='{1}' and b.SDNQuantity>0)
BEGIN
RAISERROR('{0}!',16,1);
RETURN
END
delete ICSMOPickMerge from ICSMOPickMerge a
LEFT JOIN ICSSDN b on a.SourceID=b.id and a.WorkPoint=b.WorkPoint
where b.SDNCode = '{0}' AND b.workpoint='{1}'", item.TransCode, item.WorkPoint);
if (!DBHelper.ExecuteNonQuery(pikTbLogsql, cmd))
{
throw new Exception("回撤拣料失败!");
}
}
#endregion
#region 生产发料
else if (TransType == TransTypeEnum.MOIssueDoc.GetDescription())
{
BusinessCode = TransTypeEnum.MOIssueDoc.GetDescription<DBValue>();
//更新源头单据数量
pikTbLogsql += string.Format(@"IF EXISTS(SELECT * FROM ICSMO b
INNER join ICSMOPick c on c.MODetailID=b.MODetailID and c.WorkPoint=b.WorkPoint
where b.MOCode = '{0}' AND b.workpoint='{1}' and c.IssueQuantity>0)
BEGIN
RAISERROR('{0}!',16,1);
RETURN
END
delete ICSMOPickMerge from ICSMOPickMerge a
INNER join ICSMOPick c on a.SourceID=c.id and a.WorkPoint=c.WorkPoint
LEFT JOIN ICSMO b on c.MODetailID=b.MODetailID and c.WorkPoint=b.WorkPoint and b.MOStatus<>'3'
where b.MOCode = '{0}' AND b.workpoint='{1}'", item.TransCode, item.WorkPoint);
if (!DBHelper.ExecuteNonQuery(pikTbLogsql, cmd))
{
throw new Exception("回撤拣料失败!");
}
}
#endregion
#region 委外发料
else if ( TransType == TransTypeEnum.OutsourcingIssueDoc.GetDescription())
{
BusinessCode = TransTypeEnum.OutsourcingIssueDoc.GetDescription<DBValue>();
//更新源头单据数量
pikTbLogsql += string.Format(@" IF EXISTS(SELECT * FROM ICSOutsourcingOrder b
INNER join ICSOOPick c on c.OODetailID=b.OODetailID and c.WorkPoint=b.WorkPoint
where b.OOCode = '{0}' AND b.workpoint='{1}' and c.IssueQuantity>0)
BEGIN
RAISERROR('{0}!',16,1);
RETURN
END
delete ICSMOPickMerge from ICSMOPickMerge a
INNER join ICSOOPick c on a.SourceID=c.id and a.WorkPoint=c.WorkPoint
LEFT JOIN ICSOutsourcingOrder b on c.OODetailID=b.OODetailID and c.WorkPoint=b.WorkPoint
where b.OOCode = '{0}' AND b.workpoint='{1}'", item.TransCode, item.WorkPoint);
pikTbLogsql += string.Format(@" delete dbo.ICSWareHouseLotInfoLog where TransCode ='{0}' AND TransSequence='{1}' and TransType='15' and WorkPoint='{2}'", item.TransCode, item.TransSequence, item.WorkPoint);
if (!DBHelper.ExecuteNonQuery(pikTbLogsql, cmd))
{
throw new Exception("回撤拣料失败!");

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

@ -69,7 +69,7 @@ namespace ICSSoft.WebAPI.Controllers
}
/// <summary>
/// 多语言
/// 盘点单审核
/// </summary>
/// <param name="JsonData"></param>
/// <returns></returns>

17
WMS-BS/NFine.Application/OMAY/OMAYApsApp.cs

@ -269,7 +269,24 @@ UPDATE dbo.ICSMO set DepCode=@DepCode, MTIME=GETDATE(),MUSER='{1}',WorkPoint='{2
var ids = queryParam["ids"].ToString().Split(',');
var sql4 = @"select count(1) Value
from ICSMOPick a
left join ICSMO b on a.MODetailID=b.MODetailID
left join ICSInventory c on a.InvCode =c.InvCode
where 1=1
and a.EATTRIBUTE1=0
and a.WorkPoint='"+ WorkPoint + "' and b.ID in ('"+string.Join("','", ids) +"')";
var isCanUpdateDepCode= Repository().FindDataSetBySql(sql4.ToString()).Tables[0];
if(isCanUpdateDepCode!=null&& isCanUpdateDepCode.Rows.Count > 0)
{
if (isCanUpdateDepCode.Rows[0]["Value"].ToInt() > 0)
{
sql = @"
--select @DepCode
UPDATE dbo.ICSMO set MTIME=GETDATE(),MUSER='{1}',WorkPoint='{2}',APSStatus='Y' <1> <2> <3> WHERE ID in ('{3}')";
}
}
string APIURL = ConfigurationManager.ConnectionStrings["ERPAPIURL"].ConnectionString + "MOHKWam/Update";
var planStartDate = queryParam["planStartDate"].ToStringExt();
var planEndDate = queryParam["planEndDate"].ToStringExt();

5
WMS-BS/NFine.Web/Areas/OMAY/Controllers/ApsController.cs

@ -20,9 +20,12 @@ namespace NFine.Web.Areas.OMAY.Controllers
return View();
}
public ActionResult EditInstructionBill(string ids)
public ActionResult EditInstructionBill(string ids,string line)
{
ViewData["ids"] = ids;
ViewData["line"] = line;
return View();
}

2
WMS-BS/NFine.Web/Areas/OMAY/Views/Aps/EditInstructionBill.cshtml

@ -26,7 +26,9 @@
$("#F_EnabledMark").bindSelect();
console.log('@ViewData["ids"]');
console.log('@ViewData["line"]');
$("#ids").val('@ViewData["ids"]' );
$("#F_SSCode").val('@ViewData["line"]' );
}
function submitForm() {
if (!$('#form1').formValid()) {

21
WMS-BS/NFine.Web/Areas/OMAY/Views/Aps/MoProducePlan.cshtml

@ -325,19 +325,34 @@
that.query();
});
$("#NF-InstructionBill").click(function () {
// console.log("编辑指令单");
var objList = $("#gridList").jqGrid('getGridParam', 'selarrrow');
// console.log(objList);
if (objList.length == 0) {
$.modalMsg("请选择一条数据", "warning");
return;
}
let lines = [];
for (var i = 0; i < objList.length; i++) {
let line = $("#gridList").jqGrid('getRowData', objList[i]).DepName;
lines.push(line);
}
if (lines.length==0) {
$.modalMsg("请选择一条数据", "warning");
return;
}
if (!lines.every(x => x == lines[0])) {
$.modalMsg("不同产线订单无法下发", "warning");
return;
}
var idstr = objList.join();
// return;
$.modalOpen({
id: "Form",
title: "指令单",
url: "/OMAY/Aps/EditInstructionBill?ids=" + idstr + "",
url: "/OMAY/Aps/EditInstructionBill?ids=" + idstr + "&line=" + lines[0],
width: "600px",
height: "400px",
callBack: function (iframeId) {

|||||||
100:0
Loading…
Cancel
Save