环调用进度条
super.handler.post(this);
//Toast.makeText(this,
//"正在更新菜单。。。" + "当前最新版本:" + jsonObj.getString("rtmsg"),
//Toast.LENGTH_LONG).show();
database.execSQL("Delete from caidan");
database.execSQL("Delete from liangcai");
database.execSQL("Delete from recai");
database.execSQL("Delete from zhushi");
//database.execSQL("delete * from jiulei");
database.execSQL("Delete from tanglei");
database.execSQL("Delete from yinliao");
database.execSQL("Delete from wankuai");
database.execSQL("insert into [caidan] values(1,401,'二锅头',13.0,'酒类','','','二锅头,酒类,口感好,不上头',"
+ R.drawable.erguotou + ",0);");
System.out.println(jsonObj.getString("rtmsg"));
database.execSQL("update banbenhao set banben="+jsonObj.getString("rtmsg")+" where _id=1");
int j = 1;
int recaiid = 1;int liangcaiid = 1;int zhushiid = 1;
int yinliaoid = 1;int tangid = 1;int wankuaiid = 1;
int sui;
menulist = jsonObj.getJSONArray("list");
for (int k = 0; k <= jsonObj.getJSONArray("list").length(); k++) {
temp = menulist.getString(k);
temp = temp.replace(",", "\n");
temp = temp.replace("\"", "");
temp = temp.replace("[", "");
temp = temp.replace("]", "");
StringBuffer tempb = new StringBuffer(temp);
int i = 0;
tempId = tempb.substring(0, tempb.indexOf("\n"));
tempb = tempb.delete(0, tempb.indexOf("\n") + 1);
temptype = tempb.substring(0, tempb.indexOf("\n"));
tempb = tempb.delete(0, tempb.indexOf("\n") + 1);
tempName = tempb.substring(0, tempb.indexOf("\n"));
tempb = tempb.delete(0, tempb.indexOf("\n") + 1);
tempPic = tempb.substring(0, tempb.indexOf("\n"));
tempPic=tempPic.replace("\\","");
System.out.println(tempPic);
tempb = tempb.delete(0, tempb.indexOf("\n") + 1);
tempPrice = tempb.substring(0, tempb.indexOf("\n"));
tempb = tempb.delete(0, tempb.indexOf("\n") + 1);
tempJieShao = tempb.substring(0, tempb.indexOf("\n"));
tempb = tempb.delete(0, tempb.indexOf("\n") + 1);
tempDanWei = tempb.toString();
temptype=temptype.replace("\"", "");
temptype=temptype.replace("\'", "");
switch (Integer.parseInt(temptype)) {
case 1201:
tempNum = 200 + recaiid+"";
Random ran=new Random();
sui=ran.nextInt(2);
String sql="insert into [recai] values("
+ recaiid + ",'" + tempNum + "','"
+ tempName + "','" + tempPrice + "','"
+ temptype + "','" + tempDanWei + "',' ','"
+ tempJieShao + "','"+tempPic+"',1)";
sql="insert into [recai] values("
+ recaiid + ",'" + tempNum + "','"
+ tempName + "','" + tempPrice + "','"
+ temptype + "','" + tempDanWei + "',' ','"
+ tempJieShao + "','"+tempPic+"',0)";
database.execSQL(sql);
database.execSQL("insert into [caidan] values(" + j
+ ",'" + tempNum + "','" + tempName + "','"
+ tempPrice + "','" + temptype + "','"
+ tempDanWei + "',' ','" + tempJieShao
+ "','"+tempPic+"',0)");
j++;
recaiid++;
break;
case 1202:
tempNum = 100 + liangcaiid+"";
Random ran1=new Random();
sui=ran1.nextInt(2);
database.execSQL("insert into [liangcai] values("
+ liangcaiid + ",'" + tempNum + "','"
+ tempName + "','" + tempPrice + "','"
+ temptype + "','" + tempDanWei + "',' ','"
+ tempJieShao + "','"+tempPic+"',1)");
database.execSQL("insert into [liangcai] values("
+ liangcaiid + ",'" + tempNum + "','"
+ tempName + "','" + tempPrice + "','"
+ temptype + "','" + tempDanWei + "',' ','"
+ tempJieShao + "','"+tempPic+"',0)");
database.execSQL("insert into [caidan] values(" + j
+ ",'" + tempNum + "','" + tempName + "','"
+ tempPrice + "','" + temptype + "','"
+ tempDanWei + "',' ','" + tempJieShao
+ "','"+tempPic+"',0)");
j++;
liangcaiid++;
break;
case 1203:
tempNum = 500 + tangid+"";
Random ran2=new Random();
sui=ran2.nextInt(2);
database.execSQL("insert into [tanglei] values("
+ liangcaiid + ",'" + tempNum + "','"
+ tempName + "','" + tempPrice + "','"
+ temptype + "','" + tempDanWei + "',' ','"
+ tempJieShao + "','"+tempPic+"',1)");
database.execSQL("insert into [tanglei] values("
+ tangid + ",'" + tempNum + "','"
+ tempName + "','" + tempPrice + "','"
+ temptype + "','" + tempDanWei + "',' ','"
+ tempJieShao + "','"+tempPic+"',0)");
database.execSQL("insert into [caidan] values(" + j
+ ",'" + tempNum + "','" + tempName + "','"
+ tempPrice + "','" + temptype + "','"
+ tempDanWei + "',' ','" + tempJieShao
+ "','"+tempPic+"',0)");
j++;
tangid++;
break;
case 1204:
tempNum = 600 + yinliaoid+"";
Random ran3=new Random();
sui=ran3.nextInt(2);
database.execSQL("insert into [yinliao] values("
+ liangcaiid + ",'" + tempNum + "','"
+ tempName + "','" + tempPrice + "','"
+ temptype + "','" + tempDanWei + "',' ','"
+ tempJieShao + "','"+tempPic+"',1)");
database.execSQL("insert into [yinliao] values("
+ yinliaoid + ",'" + tempNum + "','"
+ tempName + "','" + tempPrice + "','"
+ temptype + "','" + tempDanWei + "',' ','"
+ tempJieShao + "','"+tempPic+"',0)");
database.execSQL("insert into [caidan] values(" + j
+ ",'" + tempNum + "','" + tempName + "','"
+ tempPrice + "','" + temptype + "','"
+ tempDanWei + "',' ','" + tempJieShao
+ "','"+tempPic+"',0)");
j++;
yinliaoid++;
break;
case 1205:
tempNum = 300 + zhushiid+"";
Random ran4=new Random();
sui=ran4.nextInt(2);
database.execSQL("insert into [zhushi] values("
+ liangcaiid + ",'" + tempNum + "','"
+ tempName + "','" + tempPrice + "','"
+ temptype + "','" + tempDanWei + "',' ','"
+ tempJieShao + "','"+tempPic+"',1)");
database.execSQL("insert into [zhushi] values("
+ zhushiid + ",'" + tempNum + "','"
+ tempName + "','" + tempPrice + "','"
+ temptype + "','" + tempDanWei + "',' ','"
+ tempJieShao + "','"+tempPic+"',0)");
上一篇:
基于JAVA的局域网监控系统
下一篇:
高陈基于Java超市账单管理系统