//可用料道信息 public static JArray getMechineLDList(string mechineID) { string mechineLDList = null; try { mechineLDList = RedisHelper.GetRedisModel <string>(mechineID + "_LDList"); } catch { } if (string.IsNullOrEmpty(mechineLDList)) { //string sql = @"SELECT distinct productID FROM asm_ldInfo WHERE mechineID =@mechineID AND zt != 1 AND productID != '' "; string sql = @"SELECT productID, sum(case when zt = 0 then 0 else ld_productNum end) errorld_productNum FROM asm_ldInfo WHERE mechineID = @mechineID AND productID != '' GROUP BY productID"; sql = sql.Replace("@mechineID", mechineID); DataTable dt = DbHelperSQL.Query(sql).Tables[0]; if (dt.Rows.Count > 0) { RedisHelper.SetRedisModel <string>(mechineID + "_LDList", OperUtil.DataTableToJsonWithJsonNet(dt)); mechineLDList = OperUtil.DataTableToJsonWithJsonNet(dt); } } return(mechineLDList == null ? new JArray() : (JArray)JsonConvert.DeserializeObject(mechineLDList)); }
//产品信息 public static JArray getSellOrderInfo(string mechineID) { string mechineSellOrderInfo = null; try { mechineSellOrderInfo = RedisHelper.GetRedisModel <string>(mechineID + "_SellOrderInfo"); } catch { } if (string.IsNullOrEmpty(mechineSellOrderInfo)) { string sql = "select * from asm_orderlistDetail where zt = 3 AND mechineID ='" + mechineID + "'"; DataTable dt = DbHelperSQL.Query(sql).Tables[0]; if (dt.Rows.Count > 0) { RedisHelper.SetRedisModel <string>(mechineID + "_SellOrderInfo", OperUtil.DataTableToJsonWithJsonNet(dt)); mechineSellOrderInfo = OperUtil.DataTableToJsonWithJsonNet(dt); } } return(mechineSellOrderInfo == null ? new JArray() : (JArray)JsonConvert.DeserializeObject(mechineSellOrderInfo)); }
//限时特价信息 public static JArray getXSTJList(string mechineID) { string mechineXSTJList = null; try { mechineXSTJList = RedisHelper.GetRedisModel <string>(mechineID + "_XSTJList"); } catch { } if (string.IsNullOrEmpty(mechineXSTJList)) { string sql = @"select * from asm_xstj where mechineID=@mechineID order by timeSpan desc"; sql = sql.Replace("@mechineID", mechineID); DataTable dt = DbHelperSQL.Query(sql).Tables[0]; if (dt.Rows.Count > 0) { RedisHelper.SetRedisModel <string>(mechineID + "_XSTJList", OperUtil.DataTableToJsonWithJsonNet(dt)); mechineXSTJList = OperUtil.DataTableToJsonWithJsonNet(dt); } } return(mechineXSTJList == null ? new JArray() : (JArray)JsonConvert.DeserializeObject(mechineXSTJList)); }
//产品信息 public static JArray getCompanyProductList(string companyID) { string companyProductList = null; try { companyProductList = RedisHelper.GetRedisModel <string>(companyID + "_ProductListSet"); } catch { } if (string.IsNullOrEmpty(companyProductList)) { string sql = @"select * from asm_product where is_del = 0 AND companyID = @companyID"; sql = sql.Replace("@companyID", companyID); DataTable dt = DbHelperSQL.Query(sql).Tables[0]; if (dt.Rows.Count > 0) { RedisHelper.SetRedisModel <string>(companyID + "_ProductListSet", OperUtil.DataTableToJsonWithJsonNet(dt)); companyProductList = OperUtil.DataTableToJsonWithJsonNet(dt); } } return(companyProductList == null ? new JArray() : (JArray)JsonConvert.DeserializeObject(companyProductList)); }
//产品信息 public static JArray getVideoInfoList() { string mechineVideoInfoList = null; try { mechineVideoInfoList = RedisHelper.GetRedisModel <string>("_VideoInfoList"); } catch { } if (string.IsNullOrEmpty(mechineVideoInfoList)) { string sql = "select * from asm_video where shType=1"; DataTable dt = DbHelperSQL.Query(sql).Tables[0]; if (dt.Rows.Count > 0) { RedisHelper.SetRedisModel <string>("_VideoInfoList", OperUtil.DataTableToJsonWithJsonNet(dt)); mechineVideoInfoList = OperUtil.DataTableToJsonWithJsonNet(dt); } } return(mechineVideoInfoList == null ? new JArray() : (JArray)JsonConvert.DeserializeObject(mechineVideoInfoList)); }
//产品信息 public static JArray getVideoAddMechine(string mechineID) { string mechineVideoAddMechine = null; try { mechineVideoAddMechine = RedisHelper.GetRedisModel <string>(mechineID + "_VideoAddMechine"); } catch { } if (string.IsNullOrEmpty(mechineVideoAddMechine)) { string sql = "select * from asm_videoAddMechine where mechineID='" + mechineID + "' and zt=0 and tfType!=0 and ((tfType=1 and times<tfcs) or (tfType=2 and GETDATE()<valiDate)) and is_open=0 and (GETDATE()>startTime or startTime is null)"; DataTable dt = DbHelperSQL.Query(sql).Tables[0]; if (dt.Rows.Count > 0) { RedisHelper.SetRedisModel <string>(mechineID + "_VideoAddMechine", OperUtil.DataTableToJsonWithJsonNet(dt)); mechineVideoAddMechine = OperUtil.DataTableToJsonWithJsonNet(dt); } } return(mechineVideoAddMechine == null ? new JArray() : (JArray)JsonConvert.DeserializeObject(mechineVideoAddMechine)); }
//安卓屏幕的产品类别 public static void getProductTypeInfo() { string sql = "select * from asm_protype"; DataTable dt = DbHelperSQL.Query(sql).Tables[0]; if (dt.Rows.Count > 0) { Util.log("dt=" + OperUtil.DataTableToJsonWithJsonNet(dt), "updateProductType.txt"); SetNewRedisInfo("_productTypeInfoSet", OperUtil.DataTableToJsonWithJsonNet(dt)); } }
public static string getMechine(string mechineID) { string mechineInfo = null; try { mechineInfo = RedisHelper.GetRedisModel <string>(mechineID + "_mechineInfoSet"); } catch { } if (string.IsNullOrEmpty(mechineInfo)) { string sql = "select am.*,ac.p1,ac.p2,ac.p3,ac.p4,ac.p5,ac.p6,ac.p7,ac.p8,ac.p9,ac.p10,am.setTem,'' videoListNo,'' productTypeNo,'' androidProductNo,'' priceSwitch from asm_mechine am left join asm_company ac on am.companyID=ac.id where am.id='" + mechineID + "'"; DataTable dt = DbHelperSQL.Query(sql).Tables[0]; if (dt.Rows.Count > 0) { RedisHelper.SetRedisModel <string>(mechineID + "_mechineInfoSet", OperUtil.DataTableToJsonWithJsonNet(dt)); mechineInfo = OperUtil.DataTableToJsonWithJsonNet(dt); } } return(mechineInfo); }
//机器库存中去重后的产品列表 public static JArray getMechineKcProduct(string mechineID) { string kcProduct = null; try { kcProduct = RedisHelper.GetRedisModel <string>(mechineID + "_KcProduct"); } catch { } if (string.IsNullOrEmpty(kcProduct)) { string sql = @"select t.* from (select asm_kcDetail.*, row_number() over(partition by productID order by id desc) rn from asm_kcDetail where mechineID =@mechineID) t where rn = 1"; sql = sql.Replace("@mechineID", mechineID); DataTable dt = DbHelperSQL.Query(sql).Tables[0]; if (dt.Rows.Count > 0) { RedisHelper.SetRedisModel <string>(mechineID + "_KcProduct", OperUtil.DataTableToJsonWithJsonNet(dt)); kcProduct = OperUtil.DataTableToJsonWithJsonNet(dt); } } return(kcProduct == null ? new JArray() : (JArray)JsonConvert.DeserializeObject(kcProduct)); }