| | |
| | | using WIDESEA_SerialPortRepository; |
| | | using WIDESEAWCS_Core; |
| | | using WIDESEAWCS_Core.BaseServices; |
| | | using WIDESEAWCS_DTO.SerialPort; |
| | | using WIDESEAWCS_ITaskInfoService; |
| | | using WIDESEAWCS_Model.Models; |
| | | |
| | | |
| | | namespace WIDESEAWCS_TaskInfoService |
| | | { |
| | | public class TorqueOpServer : ServiceBase<Dt_TorqueOp, TorqueOpRepository>, ITorqueOpServer |
| | | public class TorqueOpServer : ServiceBase<Dt_TorqueOp, ITorqueOpRepository>,ITorqueOpServer |
| | | { |
| | | public TorqueOpServer(TorqueOpRepository BaseDal) : base(BaseDal) |
| | | private IProcessRepository _iprocessRepository; |
| | | public TorqueOpServer(ITorqueOpRepository BaseDal, IProcessRepository iprocessRepository) : base(BaseDal) |
| | | { |
| | | _iprocessRepository = iprocessRepository; |
| | | } |
| | | |
| | | public override PageGridData<Dt_TorqueOp> GetPageData(PageDataOptions options) |
| | | { |
| | | OrderByParameters = new Dictionary<string, SqlSugar.OrderByType> { |
| | | { |
| | | nameof(Dt_TorqueOp.ID),SqlSugar.OrderByType.Asc |
| | | } }; |
| | | return base.GetPageData(options); |
| | | } |
| | | |
| | | //public WebResponseContent Nexstep(string id, string guorp) |
| | | //{ |
| | | // if (true) |
| | | // { |
| | | |
| | | // } |
| | | //} |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ç±»ååå½åæ¥éª¤æ¥æ¾åºæåå¼ |
| | | /// </summary> |
| | | /// <param name="getTorDTO"></param> |
| | | /// <returns></returns> |
| | | public WebResponseContent Checkvalue(GetTorDTO getTorDTO) |
| | | { |
| | | try |
| | | { |
| | | var op = BaseDal.QueryData(x => x.GroupOp == getTorDTO.grop && x.ProcessSte == getTorDTO.setnum &&x.TakeId==getTorDTO.takeid); |
| | | if (op==null) |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "æ²¡ææ¾å°è¯¥ä»»å¡å·ï¼"}; |
| | | } |
| | | return new WebResponseContent { Status = true, Data = op }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | return new WebResponseContent { Status = false,Message="æ¥è¯¢å¤±è´¥ï¼"+ex.Message }; |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent AddTorqueOp(Dt_TorqueOp torqueOp) |
| | | { |
| | | try |
| | | { |
| | | var process = _iprocessRepository.QueryData(a => a.SetpNum == torqueOp.ProcessSte && a.CraftType == torqueOp.GroupOp).FirstOrDefault(); |
| | | if (process != null) |
| | | { |
| | | if (torqueOp.TorqueSize == process.TorqueOne || torqueOp.TorqueSize == process.TorqueTwo) |
| | | { |
| | | BaseDal.AddData(torqueOp); |
| | | return new WebResponseContent { Status = true, Message = "æ·»å æå" }; |
| | | } |
| | | else |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "æåå¼ä¸åæ ¼", Code = 400 }; |
| | | } |
| | | } |
| | | return new WebResponseContent { Status = false, Message = "æ°æ®æè¯¯", Code = 400 }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return new WebResponseContent { Status = false, Message = "æ·»å 失败ï¼" + ex.Message }; |
| | | } |
| | | } |
| | | |
| | | public WebResponseContent WhetherSaveValueData(string takeid, string group, int setpunm) |
| | | { |
| | | try |
| | | { |
| | | var tor = BaseDal.QueryData(x => x.TakeId == takeid && x.GroupOp == group && x.ProcessSte == setpunm); |
| | | return new WebResponseContent { Status = true,Data=tor }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | return new WebResponseContent { Status = false, Message = "é误" + ex.Message }; |
| | | } |
| | | } |
| | | } |
| | | } |