yl
2023-03-22 e235d94e5987d43117439837e3a0ee2e316e91d2
VueWebApi/DLL/DAL/AppPurchManagementDAL.cs
@@ -143,10 +143,10 @@
                    mes.data = null;
                    return mes;
                }
                //Lambda表达式过滤获取预计到货日期、部门、供应商
                string hacceptdate = json.Select(p => p.hacceptdate).ToList().Distinct().ToString(); //预计到货日期
                string dpartment = json.Select(p => p.hdepartmentcode).ToList().Distinct().ToString(); //部门
                string customercode = json.Select(p => p.hcustomercode).ToList().Distinct().ToString(); //供应商
                //Lambda表达式过滤获取预计到货日期、部门、供应商取第一个
                string hacceptdate = json.Select(p => p.hacceptdate).Distinct().ToList().First().ToString(); //预计到货日期
                string dpartment = json.Select(p => p.hdepartmentcode).Distinct().ToList().First().ToString(); //部门
                string customercode = json.Select(p => p.hcustomercode).Distinct().ToList().First().ToString(); //供应商
                //写入采购到货单主表
                sql = @"insert into T_PurchaseArrivalOrder(hbillno,hdate,hacceptdate,hbillstaus,hdepartmentcode,hcustomercode,hsourcebillno,lm_user,lm_date) 
                        values(@hbillno,@hdate,@hacceptdate,@hbillstaus,@hdepartmentcode,@hcustomercode,@hsourcebillno,@lm_user,@lm_date)";
@@ -157,7 +157,7 @@
                    {
                        hbillno = djwo,
                        hdate = DateTime.Now.ToString(),
                        hacceptdate = Convert.ToDateTime(hacceptdate),
                        hacceptdate =hacceptdate==""?null:hacceptdate,
                        hbillstaus = orderstaus,
                        hdepartmentcode = dpartment,
                        hcustomercode = customercode,
@@ -182,7 +182,7 @@
                            hpartcode = json[i].hpartcode,
                            hplanqty = decimal.Parse(json[i].hplanqty),
                            hqty = decimal.Parse(json[i].hqty),
                            hacceptdate = Convert.ToDateTime(hacceptdate),
                            hacceptdate = hacceptdate == "" ? null : hacceptdate,
                            hischeck = json[i].hischeck,
                            hbatchno = json[i].hbatchno
                        }