qiuyao
2025-03-24 da3fd4520a4656ee7ae889595f5361562ef909e3
修改工艺表
已修改5个文件
91 ■■■■ 文件已修改
项目代码/WIDESEAWCS_Server 正式/ISerialPortService/IProcessServer.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEAWCS_Server 正式/SerialPortService/ProcessServer.cs 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEAWCS_Server 正式/WIDESEAWCS_DTO/SerialPort/SetpDTO.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEAWCS_Server 正式/WIDESEAWCS_Model/Models/SerialPort/Dt_Process.cs 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
项目代码/WIDESEAWCS_Server 正式/WIDESEAWCS_Server/Controllers/SerialPort/ProcessController.cs 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ÏîÄ¿´úÂë/WIDESEAWCS_Server Õýʽ/ISerialPortService/IProcessServer.cs
@@ -38,12 +38,11 @@
        WebResponseContent Getcircuit(string grops,string takeid);
        /// <summary>
        /// æ›´å…·å½“前任务,判断是否可以点击下一步
        /// å·¥è‰ºä¸‹ä¸€æ­¥è·³è½¬
        /// </summary>
        /// <param name="group"></param>
        /// <param name="takeid"></param>
        /// <param name="setnum"></param>
        /// <returns></returns>
        /// <param name="setpDTO">当前班组的任务当前步骤</param>
        /// <param name="flag">是否强制执行;是true,否false</param>
        /// <returns>返回1、当前步骤;2、最大步骤;3、已完成的工艺</returns>
        WebResponseContent Nextprocess(SetpDTO setpDTO, bool flag);
ÏîÄ¿´úÂë/WIDESEAWCS_Server Õýʽ/SerialPortService/ProcessServer.cs
@@ -7,6 +7,7 @@
using System.Threading.Tasks;
using AutoMapper;
using AutoMapper.Configuration.Conventions;
using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime;
using SqlSugar;
using WIDESEA_ISerialPortRepository;
using WIDESEA_SerialPortRepository;
@@ -324,12 +325,13 @@
        {
            try
            {
                //根据组和任务号获得top表全部数据
                Dt_Process proNow = new Dt_Process();
                //根据组和任务号获得torqueOp表全部数据
                var torp = _torqueOpRepository.QueryData(x => x.GroupOp == group && x.TakeId == takeid);
                //获取Modifier  ="true"  è¡¨ç¤ºæ˜¯å¼ºåˆ¶æ‰§è¡Œ
                var Mod = torp.Select(x => x.Modifier).FirstOrDefault();
                //var Mod = torp.Select(x => x.Modifier).FirstOrDefault();
                //查出工艺表
                var process = BaseDal.QueryData(x => x.CraftType == group);
@@ -339,28 +341,55 @@
                //拿到工艺表中步骤为1的
                var proNoe = process.Where(x => x.SetpNum == 1);//获得工艺表中的第一步
                //var proNoe = process.Where(x => x.SetpNum == 1);//获得工艺表中的第一步
                if (torp.Count == 0)
                {
                    return new WebResponseContent { Status = true, Message = "返回工艺表中的第一条", Data = new { proNoe, maxproce } };
                    proNow = process.Where(x => x.SetpNum == 1).First();
                    return new WebResponseContent { Status = true, Message = "返回工艺表中的第一条", Data = new { proNow, maxproce } };
                }
                var nowNum = torp.Max(x => x.ProcessSte);//获得当前最大步骤
                var flag = torp.Where(a => a.ProcessSte == nowNum && a.Modifier == "true").FirstOrDefault();
                //op.Modifier="true"  è¡¨ç¤ºæ˜¯å¼ºåˆ¶æ‰§è¡Œï¼Œå°±ä¸éœ€è¦åˆ¤æ–­åº”扭的次数,直接返回 op.ProcessSte+1
                if (Mod == "true")
                //if (Mod == "true")
                //{
                //    var now = maxproce + 1;
                //    return new WebResponseContent { Status = true, Data = new { proNoe, maxproce, now } };
                //}
                if (flag != null)
                {
                    var now = maxproce + 1;
                    return new WebResponseContent { Status = true, Data = new { proNoe, maxproce, now } };
                    proNow = process.Where(x => x.SetpNum == now).First();
                    var finish= process.Where(x => x.SetpNum > now);
                    return new WebResponseContent { Status = true, Data = new { proNow, maxproce, now, finish } };
                }
                //如果存值表中有数据就返回给他当前工艺步骤
                var maxpro = process.Where(x => x.SetpNum == nowNum);
                var maxpro = process.Where(x => x.SetpNum == nowNum).FirstOrDefault();
                if (maxpro != null)
                {
                    if (maxpro.TorqueOneQuantity + maxpro.TorqueTwoQuantity > torp.Where(a => a.ProcessSte == nowNum).Count())
                    {
                        proNow = maxpro;
                        var finish = process.Where(x => x.SetpNum < nowNum);
                        return new WebResponseContent { Status = true, Message = "返回当前任务做到的大步骤", Data = new { proNow, maxproce, finish } };
                    }
                    else
                    {
                        var now = nowNum + 1;
                        proNow = process.Where(x => x.SetpNum == now).First();
                        var finish = process.Where(x => x.SetpNum < now);
                        return new WebResponseContent { Status = true, Message = "返回当前任务做到的大步骤", Data = new { proNow, maxproce, finish } };
                    }
                }
                else
                {
                    return new WebResponseContent { Status = false, Message = "工艺数据有误"};
                }
                //判断当前步骤的扭力次数是否完成,没完成返回当前步骤,完成返回op.ProcessSte+1,状态值给false   
                return new WebResponseContent { Status = true, Message = "返回当前任务做到的大步骤", Data = new { maxpro, maxproce } };
                //return new WebResponseContent { Status = true, Message = "返回当前任务做到的大步骤", Data = new { maxpro, maxproce } };
            }
            catch (Exception ex)
@@ -369,6 +398,12 @@
            }
        }
        /// <summary>
        /// å·¥è‰ºä¸‹ä¸€æ­¥è·³è½¬
        /// </summary>
        /// <param name="setpDTO">当前班组的任务当前步骤</param>
        /// <param name="flag">是否强制执行;是true,否false</param>
        /// <returns>返回1、当前步骤;2、最大步骤;3、已完成的工艺</returns>
        public WebResponseContent Nextprocess(SetpDTO setpDTO, bool flag)//强制执行给我true
        {
            try
@@ -396,7 +431,7 @@
                {
                    return new WebResponseContent { Status = true, Message = "没有完成当前步骤", Data = new { nowdate, maxproce } };
                }
                else if (practiceCount == TargetCount || (practiceCount != TargetCount && flag))//强制执行 å‰ç«¯ç»™æˆ‘一个flag=ture时
                else if ((practiceCount == TargetCount && TargetCount == 0) || (practiceCount != TargetCount && flag))//强制执行 å‰ç«¯ç»™æˆ‘一个flag=ture时
                {
                    //强制跳转下一步,插入op表当前步骤
                    op.TakeId = setpDTO.takeid;
@@ -414,11 +449,11 @@
                int num = setpDTO.setnum + 1;
                //返回下一步步骤
                var nex = process.Where(x => x.CraftType == setpDTO.group && x.SetpNum == num).FirstOrDefault();
                var nex = process.Where(x => x.SetpNum == num).FirstOrDefault();
                var finish = process.Where(x => x.SetpNum < num).ToList();
                _torqueOpRepository.AddData(op);
                return new WebResponseContent { Status = true, Message = $"你已完成当前第{setpDTO.setnum},准备第{num}步任务", Data = new { nex, maxproce } };
                return new WebResponseContent { Status = true, Message = $"你已完成当前第{setpDTO.setnum},准备第{num}步任务", Data = new { nex, maxproce, finish } };
            }
            catch (Exception ex)
            {
@@ -426,6 +461,7 @@
            }
        }
        public WebResponseContent PreviousProcess(SetpDTO setpDTO)
        {
            try
ÏîÄ¿´úÂë/WIDESEAWCS_Server Õýʽ/WIDESEAWCS_DTO/SerialPort/SetpDTO.cs
@@ -6,6 +6,9 @@
namespace WIDESEAWCS_DTO.SerialPort
{
    /// <summary>
    /// å½“前班组的任务当前步骤
    /// </summary>
    public class SetpDTO
    {
        public string group { get; set; }
ÏîÄ¿´úÂë/WIDESEAWCS_Server Õýʽ/WIDESEAWCS_Model/Models/SerialPort/Dt_Process.cs
@@ -133,5 +133,11 @@
        [SugarColumn(IsNullable = true, Length = 50)]
        public string PointAxisHPB { get; set; }
        /// <summary>
        /// æ¨¡å—名称
        /// </summary>
        [SugarColumn(IsNullable = true, Length = 100)]
        public string ModuleName { get; set; }
    }
}
ÏîÄ¿´úÂë/WIDESEAWCS_Server Õýʽ/WIDESEAWCS_Server/Controllers/SerialPort/ProcessController.cs
@@ -54,13 +54,12 @@
        
        
        }
        /// <summary>
        /// ä¸‹ä¸€æ­¥
        /// å·¥è‰ºä¸‹ä¸€æ­¥è·³è½¬
        /// </summary>
        /// <param name="setpDTO"></param>
        /// <param name="flag"></param>
        /// <returns></returns>
        /// <param name="setpDTO">当前班组的任务当前步骤</param>
        /// <param name="flag">是否强制执行;是true,否false</param>
        /// <returns>返回1、当前步骤;2、最大步骤;3、已完成的工艺</returns>
        [HttpPost, Route("Nextprocess"), AllowAnonymous]
        public WebResponseContent Nextprocess([FromBody] SetpDTO setpDTO, bool flag)
        {