卢江海、出货改动
This commit is contained in:
parent
7d23adb53b
commit
ab8c1dbb9b
@ -122,8 +122,29 @@ public class ReportFlowController : BaseController
|
||||
{
|
||||
throw new CustomException("workorder or process is null");
|
||||
}
|
||||
int ret = _reportFlowService.ShipmentProcessReportwork(workorder, processId, finish_num, bad_num, customer_order, process_operator);
|
||||
string data = "";
|
||||
if (ret == 0)
|
||||
{
|
||||
data = "失败";
|
||||
|
||||
return SUCCESS(_reportFlowService.ShipmentProcessReportwork(workorder, processId, finish_num, bad_num, customer_order, process_operator));
|
||||
}
|
||||
if (ret==1)
|
||||
{
|
||||
data = "成功";
|
||||
|
||||
}
|
||||
if (ret == 2)
|
||||
{
|
||||
data = "采购订单号和工单号不匹配";
|
||||
|
||||
}
|
||||
if (ret == 3)
|
||||
{
|
||||
data = "出货数量超额";
|
||||
|
||||
}
|
||||
return SUCCESS(data);
|
||||
}
|
||||
|
||||
//TODO 获取工单下的报工列表
|
||||
|
||||
@ -18,7 +18,7 @@ public interface IReportFlowService: IBaseService<ProReportwork01>
|
||||
|
||||
bool ProcessReportWork(string workorder, int process, int finish_num,int bad_num,string Worker);
|
||||
|
||||
bool ShipmentProcessReportwork(string workorder, int processId, int finish_num, int bad_num, string customer_order, string Worker);
|
||||
int ShipmentProcessReportwork(string workorder, int processId, int finish_num, int bad_num, string customer_order, string Worker);
|
||||
List<ProReportWorkDetialDto> GetWorkOrderReportWorkList(string workorder);
|
||||
|
||||
PagedInfo<ProReportWorkDetialDto> GetReportInfoByName(ProReportWorkDto2 query);
|
||||
|
||||
@ -12,6 +12,7 @@ using DOAN.Service.Public.IPublicService;
|
||||
using Infrastructure.Attribute;
|
||||
using Mapster;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using SqlSugar.DistributedSystem.Snowflake;
|
||||
using System.Diagnostics;
|
||||
|
||||
@ -140,9 +141,25 @@ public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowServic
|
||||
/// <param name="feed_order"></param>
|
||||
/// <param name="Worker"></param>
|
||||
/// <returns></returns>
|
||||
public bool ShipmentProcessReportwork(string workorder, int processId, int finish_num, int bad_num, string customer_order, string Worker)
|
||||
public int ShipmentProcessReportwork(string workorder, int processId, int finish_num, int bad_num, string customer_order, string Worker)
|
||||
{
|
||||
int result = 0;
|
||||
//采购订单号和工单号是否匹配
|
||||
bool isexistfree_order = Context.Queryable<ProWorkorder>().Where(o=>o.FeedOrder==customer_order).Any();
|
||||
if (isexistfree_order)
|
||||
{
|
||||
OrderPurchase orderPurchase= Context.Queryable<OrderPurchase>().Where(o => o.OrderNoMes == customer_order).First();
|
||||
if (orderPurchase.DeliveryQuantity + finish_num> orderPurchase.DemandQuantity)
|
||||
{
|
||||
return 3;//超额
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
return 2;//采购订单号和工单号不匹配
|
||||
}
|
||||
|
||||
int result = 0;
|
||||
bool Exist = Context.Queryable<ProReportwork01>().Where(it => it.Workorder == workorder && it.ProcessId == processId).Any();
|
||||
string NickName = Context.Queryable<SysUser>().Where(it => it.UserName == Worker).Select(it => it.NickName).First();
|
||||
Worker = string.IsNullOrEmpty(NickName) ? Worker + "|异常人员|" : NickName;
|
||||
@ -216,7 +233,7 @@ public class ReportFlowService : BaseService<ProReportwork01>, IReportFlowServic
|
||||
|
||||
|
||||
}
|
||||
return result > 0;
|
||||
return result > 0?1:0;
|
||||
}
|
||||
|
||||
public List<ProReportWorkDetialDto> GetWorkOrderReportWorkList(string workorder)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user