|
|
@@ -513,10 +513,10 @@ namespace Business.ResourceExamineManagement
|
|
|
/// 资源检查 -- TODO:根据客户的不同标准交货期(假如客户设定10天),如果检查交期小于标准交货期(10天),则默认把建议交期调整为10天。
|
|
|
/// </summary>
|
|
|
/// <param name="input"></param>
|
|
|
- /// <param name="type">类型(0,销售订单 1,销售订单行)</param>
|
|
|
+ /// <param name="type">类型(0,销售订单 1,全域订单)</param>
|
|
|
/// <returns></returns>
|
|
|
/// <exception cref="NotImplementedException"></exception>
|
|
|
- public async Task<string> ReceiveResult(string ids,int type)
|
|
|
+ public async Task<string> ReceiveResult(string ids,int type, string companyid)
|
|
|
{
|
|
|
if (string.IsNullOrEmpty(ids))
|
|
|
{
|
|
|
@@ -552,19 +552,19 @@ namespace Business.ResourceExamineManagement
|
|
|
}
|
|
|
else {
|
|
|
//获取订单行数据
|
|
|
- sentrys = await _mysql_crm_seorderentry.GetListAsync(p => input.sorderId.Contains(p.Id) && (p.progress == "1" || p.progress == "2") && !p.IsDeleted);
|
|
|
+ sentrys = await _mysql_crm_seorderentry.GetListAsync(p => (p.progress == "1" || p.progress == "2") && p.company_id.ToString() == companyid && !p.IsDeleted);
|
|
|
if (!sentrys.Any())
|
|
|
{
|
|
|
new NLogHelper("ResourceExamineAppService").WriteLog("ReceiveResult", "订单行数据不存在", _currentTenant.Id.ToString());
|
|
|
//throw new NotImplementedException("订单行数据不存在!");
|
|
|
- return "订单行数据不存在";
|
|
|
+ return "没有需要检查的订单行。";
|
|
|
}
|
|
|
sorders = _mysql_crm_seorder.GetListAsync(p => sentrys.Select(s => s.seorder_id).Contains(p.Id) && !p.IsDeleted).Result;
|
|
|
if (!sorders.Any())
|
|
|
{
|
|
|
new NLogHelper("ResourceExamineAppService").WriteLog("ReceiveResult", "订单数据不存在", _currentTenant.Id.ToString());
|
|
|
//throw new NotImplementedException("订单数据不存在!");
|
|
|
- return "订单数据不存在";
|
|
|
+ return "没有需要检查的订单。";
|
|
|
}
|
|
|
}
|
|
|
input.company_id = sorders[0].company_id;
|
|
|
@@ -2336,22 +2336,12 @@ namespace Business.ResourceExamineManagement
|
|
|
/// </summary>
|
|
|
/// <param name="input"></param>
|
|
|
/// <returns></returns>
|
|
|
- public async Task<string> OrderResourceCheck(int day, string workOrd, string companyid)
|
|
|
+ public async Task<string> OrderResourceCheck(int day, string companyid)
|
|
|
{
|
|
|
List<mes_morder> mo_Mes_Morders = new List<mes_morder>();
|
|
|
- if (day == 0)
|
|
|
+ if (day <= 0)
|
|
|
{
|
|
|
- List<string> workOrds = workOrd.Split(",").ToList();
|
|
|
- if (workOrds.Count == 0)
|
|
|
- {
|
|
|
- return "未传入工单号,请选择。";
|
|
|
- }
|
|
|
- mo_Mes_Morders = _mysql_mes_morder.GetListAsync(x => companyid == x.company_id.ToString() && workOrds.Contains(x.morder_no)).Result;
|
|
|
- //如果工单有今天和之前的,则提示不处理
|
|
|
- if (mo_Mes_Morders.Where(s => s.moentry_sys_stime <= DateTime.Now.Date).Count() > 0)
|
|
|
- {
|
|
|
- return "请选择开工时间在今天之后的工单。";
|
|
|
- }
|
|
|
+ return "请选择开工时间在今天之后的工单。";
|
|
|
}
|
|
|
else
|
|
|
{
|