| | |
| | | // itemIds is { Length: > 0 }, |
| | | // (a, b, c) => itemIds.Contains(a.ItemId)) |
| | | .WhereIF(id > 0, (a, b, d) => a.Id == id) |
| | | .WhereIF(true, (a, b, d, e, f, g) => (g.Fcode == queryObj.createUser || g.Fcode == null)) |
| | | .WhereIF(true, |
| | | (a, b, d, e, f, g) => |
| | | (g.Fcode == queryObj.createUser || g.Fcode == null)) |
| | | //å ç鿡件,æ ¹æ®ä¾åºåï¼ç©æç¼ç ï¼ç©æåç§°ï¼é¡¹ç®æç´¢ |
| | | //.WhereIF(queryObj.SearchValue != null && queryObj.SearchValue != "", |
| | | //(a, b, d) => (a.SuppName.ToLower().Contains(queryObj.SearchValue.ToLower()) |
| | |
| | | //)) |
| | | |
| | | //æ ¹æ®ä¸ææ¡æç´¢æ¡ä»¶çéï¼0项ç®, 1ç©æç¼å·, 2ç©æåç§°, 3ä¾åºå, 4éè´åï¼ |
| | | .WhereIF(queryObj.SelectedIndex == "0" && queryObj.SearchValue != null && queryObj.SearchValue != "", (a, b, d) => (d.ProjectCodes.ToLower().Contains(queryObj.SearchValue.ToLower()))) |
| | | .WhereIF(queryObj.SelectedIndex == "1" && queryObj.SearchValue != null && queryObj.SearchValue != "", (a, b, d) => (a.ItemNo.ToLower().Contains(queryObj.SearchValue.ToLower()))) |
| | | .WhereIF(queryObj.SelectedIndex == "2" && queryObj.SearchValue != null && queryObj.SearchValue != "", (a, b, d) => (a.ItemName.ToLower().Contains(queryObj.SearchValue.ToLower()))) |
| | | .WhereIF(queryObj.SelectedIndex == "3" && queryObj.SearchValue != null && queryObj.SearchValue != "", (a, b, d) => (a.SuppName.ToLower().Contains(queryObj.SearchValue.ToLower()))) |
| | | .WhereIF(queryObj.SelectedIndex == "4" && queryObj.SearchValue != null && queryObj.SearchValue != "", (a, b, d, e) => (e.Fname.ToLower().Contains(queryObj.SearchValue.ToLower()))) |
| | | .WhereIF( |
| | | queryObj.SelectedIndex == "0" && queryObj.SearchValue != null && |
| | | queryObj.SearchValue != "", |
| | | (a, b, d) => (d.ProjectCodes.ToLower() |
| | | .Contains(queryObj.SearchValue.ToLower()))) |
| | | .WhereIF( |
| | | queryObj.SelectedIndex == "1" && queryObj.SearchValue != null && |
| | | queryObj.SearchValue != "", |
| | | (a, b, d) => (a.ItemNo.ToLower() |
| | | .Contains(queryObj.SearchValue.ToLower()))) |
| | | .WhereIF( |
| | | queryObj.SelectedIndex == "2" && queryObj.SearchValue != null && |
| | | queryObj.SearchValue != "", |
| | | (a, b, d) => (a.ItemName.ToLower() |
| | | .Contains(queryObj.SearchValue.ToLower()))) |
| | | .WhereIF( |
| | | queryObj.SelectedIndex == "3" && queryObj.SearchValue != null && |
| | | queryObj.SearchValue != "", |
| | | (a, b, d) => (a.SuppName.ToLower() |
| | | .Contains(queryObj.SearchValue.ToLower()))) |
| | | .WhereIF( |
| | | queryObj.SelectedIndex == "4" && queryObj.SearchValue != null && |
| | | queryObj.SearchValue != "", |
| | | (a, b, d, e) => (e.Fname.ToLower() |
| | | .Contains(queryObj.SearchValue.ToLower()))) |
| | | .OrderByDescending((a, b, d) => a.Id) |
| | | .Select((a, b, d, e, f, g) => new LtsLlj |
| | | { |
| | |
| | | var parameters = new List<SugarParameter> |
| | | { |
| | | new("P_RELEASE_NO", releaseNo, |
| | | DbType.String, ParameterDirection.Input), |
| | | outputResult, |
| | | outputMessage |
| | | }; |
| | | DbType.String, ParameterDirection.Input), |
| | | outputResult, |
| | | outputMessage |
| | | }; |
| | | |
| | | var db = SqlSugarHelper.GetInstance(); |
| | | |
| | |
| | | msg[0] = resultValue; |
| | | msg[1] = messageValue; |
| | | return msg; |
| | | |
| | | } |
| | | |
| | | public string[] SaveSysSubmit(SysSubmit sysSubmit) |
| | | { |
| | | // å®ä¹è¾åºåæ° |
| | |
| | | var parameters = new List<SugarParameter> |
| | | { |
| | | new("PI_BILLNO", sysSubmit.PI_BILLNO, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_USER", sysSubmit.PI_USER, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_SAMPLE_STATUS", sysSubmit.PI_SAMPLE_STATUS, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_SAMPLE_TYPE", sysSubmit.PI_SAMPLE_TYPE, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_SAMPLE_REASON", sysSubmit.PI_SAMPLE_REASON, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_INSPECT_TYPE", sysSubmit.PI_INSPECT_TYPE, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_SAMPLE_PREPARATION", sysSubmit.PI_SAMPLE_PREPARATION, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_URGENCY", sysSubmit.PI_URGENCY, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_FIRMWAREVERSION", sysSubmit.PI_FIRMWAREVERSION, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_HARDWAREVERSION", sysSubmit.PI_HARDWAREVERSION, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_REMARK", sysSubmit.PI_REMARK, |
| | | DbType.String, ParameterDirection.Input), |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_USER", sysSubmit.PI_USER, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_SAMPLE_STATUS", sysSubmit.PI_SAMPLE_STATUS, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_SAMPLE_TYPE", sysSubmit.PI_SAMPLE_TYPE, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_SAMPLE_REASON", sysSubmit.PI_SAMPLE_REASON, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_INSPECT_TYPE", sysSubmit.PI_INSPECT_TYPE, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_SAMPLE_PREPARATION", sysSubmit.PI_SAMPLE_PREPARATION, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_URGENCY", sysSubmit.PI_URGENCY, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_FIRMWAREVERSION", sysSubmit.PI_FIRMWAREVERSION, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_HARDWAREVERSION", sysSubmit.PI_HARDWAREVERSION, |
| | | DbType.String, ParameterDirection.Input), |
| | | new("PI_REMARK", sysSubmit.PI_REMARK, |
| | | DbType.String, ParameterDirection.Input), |
| | | outputResult, |
| | | outputMessage |
| | | }; |
| | | }; |
| | | |
| | | var db = SqlSugarHelper.GetInstance(); |
| | | |
| | |
| | | msg[0] = resultValue; |
| | | msg[1] = messageValue; |
| | | return msg; |
| | | |
| | | } |
| | | |
| | | private string ExtractSubstring(string input, char startChar, char endChar) |
| | | { |
| | | var startIndex = input.IndexOf(startChar); |
| | |
| | | { |
| | | var entity = new Womcaa |
| | | { |
| | | Erpid = Convert.ToInt32(dto.Id), |
| | | Erpid = Convert.ToInt64(dto.Id), |
| | | Caa001 = dto.FBillNo, |
| | | Caa021 = dto.FWorkShopID, |
| | | RoutingId = dto.FRoutingId, |
| | |
| | | |
| | | CreateType = dto.FCreateType, |
| | | Caa018 = !string.IsNullOrEmpty(dto.PLAN_ID) |
| | | ? Convert.ToInt32(dto.PLAN_ID) |
| | | ? Convert.ToInt64(dto.PLAN_ID) |
| | | : null, |
| | | Caa019 = Convert.ToInt32(dto.PLAN_SEQ), |
| | | Caa019 = !string.IsNullOrEmpty(dto.PLAN_SEQ) |
| | | ? Convert.ToInt64(dto.PLAN_SEQ) |
| | | : null, |
| | | Caa020 = dto.PLAN_NUM, |
| | | SrcBillType = dto.FSrcBillType, |
| | | SrcBillNo = dto.FSrcBillNo, |
| | |
| | | { |
| | | var womcab = new Womcab |
| | | { |
| | | Erpid = Convert.ToDecimal(dto.ID), |
| | | Erpid = !string.IsNullOrEmpty(dto.ID) |
| | | ? Convert.ToDecimal(dto.ID) |
| | | : throw new Exception("å表idä¸å
许为空"), |
| | | Cab001 = dto.FBillNo, |
| | | Cab002 = dto.FSeq, |
| | | Cab003 = dto.FMaterialID, |
| | | Cab006 = Convert.ToDecimal(dto.FNeedQty), |
| | | MustQty = Convert.ToDecimal(dto.FMustQty), |
| | | Cab007 = Convert.ToDecimal(dto.FPickedQty), |
| | | Cab006 = !string.IsNullOrEmpty(dto.FNeedQty) |
| | | ? Convert.ToDecimal(dto.FNeedQty) |
| | | : null, |
| | | MustQty = !string.IsNullOrEmpty(dto.FMustQty) |
| | | ? Convert.ToDecimal(dto.FMustQty) |
| | | : null, |
| | | Cab007 = !string.IsNullOrEmpty(dto.FPickedQty) |
| | | ? Convert.ToDecimal(dto.FPickedQty) |
| | | : null, |
| | | PositionNo = dto.FPositionNO, |
| | | SupplyOrganization = dto.FChildSupplyOrgId, |
| | | IssuingOrganization = dto.FSupplyOrg, |
| | |
| | | IssueType = dto.FIssueType, |
| | | Cab009 = dto.FUnitID, |
| | | SupplyType = dto.FSupplyType, |
| | | Cab012 = Convert.ToDecimal(dto.FStdQty), |
| | | FreplaceGroup = Convert.ToInt32(dto.FReplaceGroup), |
| | | UseRate = Convert.ToDecimal(dto.FUseRate), |
| | | Cab012 = !string.IsNullOrEmpty(dto.FStdQty) |
| | | ? Convert.ToDecimal(dto.FStdQty) |
| | | : null, |
| | | FreplaceGroup = !string.IsNullOrEmpty(dto.FReplaceGroup) |
| | | ? Convert.ToInt64(dto.FReplaceGroup) |
| | | : null, |
| | | UseRate = !string.IsNullOrEmpty(dto.FUseRate) |
| | | ? Convert.ToDecimal(dto.FUseRate) |
| | | : null, |
| | | MaterialType = dto.FMaterialType, |
| | | Cab014 = Convert.ToInt32(dto.FIsKeyItem), |
| | | Numerator = Convert.ToDecimal(dto.FNumerator), |
| | | Denominator = Convert.ToDecimal(dto.FDenominator), |
| | | Pid = Convert.ToDecimal(dto.FID), |
| | | Eid = Convert.ToDecimal(dto.FID), |
| | | Scrapqty = Convert.ToDecimal(dto.FFixScrapQty), |
| | | Scraprate = Convert.ToDecimal(dto.FScrapRate), |
| | | Cab014 = !string.IsNullOrEmpty(dto.FIsKeyItem) |
| | | ? Convert.ToInt64(dto.FIsKeyItem) |
| | | : null, |
| | | Numerator = !string.IsNullOrEmpty(dto.FNumerator) |
| | | ? Convert.ToDecimal(dto.FNumerator) |
| | | : null, |
| | | Denominator = !string.IsNullOrEmpty(dto.FDenominator) |
| | | ? Convert.ToDecimal(dto.FDenominator) |
| | | : null, |
| | | Pid = !string.IsNullOrEmpty(dto.FID) |
| | | ? Convert.ToDecimal(dto.FID) |
| | | : throw new Exception("ç¶idä¸å
许为空"), |
| | | Eid = !string.IsNullOrEmpty(dto.FID) |
| | | ? Convert.ToDecimal(dto.FID) |
| | | : throw new Exception("ç¶idä¸å
许为空"), |
| | | Scrapqty = !string.IsNullOrEmpty(dto.FFixScrapQty) |
| | | ? Convert.ToDecimal(dto.FFixScrapQty) |
| | | : null, |
| | | Scraprate = !string.IsNullOrEmpty(dto.FScrapRate) |
| | | ? Convert.ToDecimal(dto.FScrapRate) |
| | | : null, |
| | | TypeB = dto.TypeB |
| | | // WR_F_XIFG_Base_qtr = dto.F_XIFG_Base_qtr, |
| | | // WR_F_XIFG_Base_83g = dto.F_XIFG_Base_83g |
¶Ô±ÈÐÂÎļþ |
| | |
| | | using System.Dynamic; |
| | | using MES.Service.Dto.webApi; |
| | | using MES.Service.Modes; |
| | | using MES.Service.service; |
| | | using MES.Service.util; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Newtonsoft.Json; |
| | | |
| | | namespace MESApplication.Controllers; |
| | | |
| | | [ApiController] |
| | | [Route("api/[controller]")] |
| | | public class WomcaaController : ControllerBase |
| | | { |
| | | private readonly MessageCenterManager _manager = new(); |
| | | private readonly WomcaaManager m = new(); |
| | | |
| | | private readonly string METHOD = "POST"; |
| | | |
| | | private readonly string TableName = "WOMCAA"; |
| | | |
| | | private readonly string URL = "http://localhost:10054/api/Womcaa/"; |
| | | |
| | | // |
| | | [HttpPost("Save")] |
| | | public ResponseResult Save(ErpWOM rohIn) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "Save"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(rohIn); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.Save(rohIn); |
| | | |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | |
| | | if (save) entity.Result = 1; |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | [HttpPost("SaveList")] |
| | | public ResponseResult SaveList(List<ErpWOM> units) |
| | | { |
| | | var entity = new MessageCenter(); |
| | | entity.TableName = TableName; |
| | | entity.Url = URL + "SaveList"; |
| | | entity.Method = METHOD; |
| | | entity.Data = JsonConvert.SerializeObject(units); |
| | | entity.Status = 1; |
| | | entity.CreateBy = "PL017"; |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | var save = m.SaveList(units); |
| | | resultInfos.tbBillList = save; |
| | | |
| | | entity.Result = 0; |
| | | if (save) entity.Result = 1; |
| | | |
| | | entity.DealWith = 1; |
| | | _manager.save(entity); |
| | | |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | entity.Result = 0; |
| | | |
| | | entity.DealWith = 0; |
| | | |
| | | entity.ResultData = ex.Message; |
| | | |
| | | _manager.save(entity); |
| | | |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// è·åææ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetList")] |
| | | public ResponseResult GetList() |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetList(); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®è·å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("GetById")] |
| | | public ResponseResult GetById(int id) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.GetById(id); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ ¹æ®ä¸»é®å é¤ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("DeleteByIds")] |
| | | public ResponseResult DeleteByIds([FromBody] object[] ids) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.DeleteByIds(ids); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Insert")] |
| | | public ResponseResult Add([FromBody] Womcaa data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Insert(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// æ·»å è¿åèªå¢ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("InsertReturnIdentity")] |
| | | public ResponseResult InsertReturnIdentity([FromBody] Womcaa data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.InsertReturnIdentity(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// ä¿®æ¹ |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost("Update")] |
| | | public ResponseResult Update([FromBody] Womcaa data) |
| | | { |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | resultInfos.tbBillList = m.Update(data); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | | message = "OK", |
| | | data = resultInfos |
| | | }; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | return ResponseResult.ResponseError(ex); |
| | | } |
| | | } |
| | | } |