| | |
| | | |
| | | if (!string.IsNullOrEmpty(index)) |
| | | { |
| | | string str2 = $"delete from forlocal where id < ({index}-1000)"; |
| | | string str2 = $"delete from forlocal where id < ({index}-2000)"; |
| | | Operatoremysql(str2, connStrLocal); |
| | | } |
| | | |
| | |
| | | |
| | | if (!string.IsNullOrEmpty(index)) |
| | | { |
| | | string str2 = $"delete from forall where id < ({index}-1000)"; |
| | | string str2 = $"delete from forall where id < ({index}-2000)"; |
| | | Operatoremysql(str2, connStrAll); |
| | | } |
| | | |
| | |
| | | return "NoRead"; |
| | | } |
| | | |
| | | public List<ProductModel> SNGetProductList(string sn,string device) |
| | | { |
| | | try |
| | | { |
| | | string mysqlstr = $"select data from forall where sn='{sn}' and device='{device}'"; |
| | | var dt = selectdt(mysqlstr, connStrAll); |
| | | if (dt == null) |
| | | { |
| | | return null; |
| | | } |
| | | else |
| | | { |
| | | List<ProductModel> plist = new List<ProductModel>(); |
| | | for (int i = 0; i < dt.Rows.Count; i++) |
| | | { |
| | | string strjson = dt.Rows[i][0].ToString(); |
| | | strjson = strjson.Replace(@"\", @"\\"); |
| | | ProductModel p = JsonConvert.DeserializeObject<ProductModel>(strjson, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All }); |
| | | |
| | | //JsonConvert.DeserializeObject<IProcessConfig>(_configBackupStr, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All }); |
| | | plist.Add(p); |
| | | } |
| | | return plist; |
| | | } |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | CommonLogger.LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"数据库forall数据异常 {e.ToString()}"); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | public List<ProductModel> GetProductList(string plcnum) |
| | | { |
| | | try |