public ResultJson ExpressInfo(ConsignmentRequest request) { if (ProductionFunc.Instance.Update(new DbOpertion.Models.Production { Id = request.Id, ExpressCompany = request.ExpressCompany, ExpressNo = request.ExpressNo, ExpressContext = request.ExpressContext, ExpressWeight = request.ExpressWeight, OrderStatus = "成品已发货" })) { var production = Production_Orderdetail_ViewFunc.Instance.SelectByModel(new DbOpertion.Models.Production_Orderdetail_View { Id = request.Id }).FirstOrDefault(); OrderFunc.Instance.SendThing(production.OrderId.Value); return(new ResultJson { HttpCode = 200, Message = "成功!" }); } else { return(new ResultJson { HttpCode = 300, Message = "操作失败!请重试!" }); } }
private async static Task<StandardResponse> GetResponse(ConsignmentRequest consignmentRequest) { await LongTaskSim.WaitFive(); var resp = new StandardResponse() { process_message = "Success" }; if (consignmentRequest.op_type == "create") { var random = new Random(1000); var num = random.Next(9000); resp.status = "inserted"; resp.reference = $"DEC00000000000{num}"; } else if (consignmentRequest.op_type == "update" || consignmentRequest.op_type == "cancel" || consignmentRequest.op_type == "submit") { resp.status = "updated"; resp.reference = consignmentRequest.consignment_number; } return resp; }
public async Task<IActionResult> ConsignmentDeclaration(ConsignmentRequest consignmentRequest) { if (consignmentRequest == null) return BadRequest(); return Ok(await GetResponse(consignmentRequest)); }