| | |
| | | try |
| | | { |
| | | dynamic resultInfos = new ExpandoObject(); |
| | | //resultInfos.tbBillList = m.CPRK(unity); |
| | | resultInfos.tbBillList = m.CPRK(unity); |
| | | return new ResponseResult |
| | | { |
| | | status = 0, |
| | |
| | | using (var conn = new SqlConnection(DbHelperSQL.strConn)) |
| | | { |
| | | if (unity.userName.IsNullOrEmpty()) throw new Exception("用户名不允许为空"); |
| | | if (unity.CfNum <= 0) throw new Exception("拆分数量需大于等于0"); |
| | | if (unity.sectionCode.IsNullOrEmpty()) throw new Exception("库位编号不允许为空"); |
| | | if (unity.barcode.IsNullOrEmpty()) throw new Exception("条码不允许为空"); |
| | | |
| | | using (var cmd = new SqlCommand("[prc_pda_bar_cf]", conn)) |
| | | using (var cmd = new SqlCommand("[prc_pda_inv_cprk]", conn)) |
| | | { |
| | | try |
| | | { |
| | |
| | | cmd.CommandType = CommandType.StoredProcedure; |
| | | SqlParameter[] parameters = |
| | | { |
| | | new("@outMsg", SqlDbType.NVarChar, 300), |
| | | new("@outSum", SqlDbType.NVarChar, 300), |
| | | new("@barcode_new", SqlDbType.NVarChar, 300), |
| | | new("@c_user", unity.userName), |
| | | new("@p_old_barcode", unity.barcode), |
| | | new("@p_qty", unity.CfNum), |
| | | new("@po_outMsg", SqlDbType.NVarChar, 300), |
| | | new("@po_outSum", SqlDbType.NVarChar, 300), |
| | | new("@po_womInBarSum", SqlDbType.NVarChar, 300), |
| | | new("@pi_user", unity.userName), |
| | | new("@pi_barcode", unity.barcode), |
| | | new("@pi_sectionCode", unity.sectionCode), |
| | | |
| | | }; |
| | | parameters[0].Direction = ParameterDirection.Output; |
| | |
| | | Quantity = reportQty |
| | | }) |
| | | .Where(x => x.Guid == barcode.Guid) |
| | | .ExecuteCommandAsync(); |
| | | .ExecuteCommand(); |
| | | |
| | | // 11. 获取或创建报工单 |
| | | var workProd = db.Queryable<MesWorkProd>() |
| | |
| | | |
| | | // 13. 更新工单已报工数量 |
| | | db.Updateable<Womdaa>() |
| | | .SetColumns(x => |
| | | x.Daa011 == (x.Daa011 ?? 0) + (int)barcode.Quantity |
| | | ) |
| | | .Where(x => x.Daa001 == barcode.BillNo) |
| | | .ExecuteCommandAsync(); |
| | | .SetColumns(x => new Womdaa |
| | | { |
| | | Daa011 = (x.Daa011 ?? 0) + (int)barcode.Quantity |
| | | }) |
| | | .Where(x => x.Daa001 == barcode.BillNo) |
| | | .ExecuteCommand(); |
| | | |
| | | // 14. 重新获取最新已报工数量 |
| | | reportedQty = db.Queryable<MesWorkProd, MesWorkProdCDetails>( |
| | |
| | | // 15. 返回处理结果 |
| | | return new ScanWorkResult |
| | | { |
| | | TaskNo = barcode.TaskNo, |
| | | TaskNo = barcode.BillNo, |
| | | ItemNo = item.ItemNo, |
| | | PlanQty = planQty ?? 0, |
| | | ReportedQty = reportedQty ?? 0, |