}
}
stringBuffer.append("'");
SqlCommand sqlCommand=new SqlCommand(Context.getDbConnection());
List<Map<String, Object>> productMapList= sqlCommand.queryForList(stringBuffer.toString());
List<String> quehuoproductlist = new ArrayList<String>();
//查看库存是否足够
for(Map<String, Object> detailmap : detailMapList) {
for (Map<String, Object> productmap : productMapList) {
String detailid = detailmap.get("PRODUCT_ID").toString();
String proid = productmap.get("PRODUCT_ID").toString();
int shuliang = Integer.parseInt(detailmap.get("AMOUNT").toString());
int kucun = Integer.parseInt(productmap.get("AMOUNT").toString());
if(detailid.equals(proid) && kucun<shuliang) {
enough = false;
quehuoproductlist.add(proid);
}
}
}
if(type.equals("zizeng") && enough==false) {
StringBuffer stringBuffer1 = new StringBuffer();
stringBuffer1.append("update product_info set amount = amount + 10 where product_id = '");
for(int i=0; i<quehuoproductlist.size(); i++)
{
if(i==0) {
stringBuffer1.append(quehuoproductlist.get(i));
}else {
stringBuffer1.append("' or product_id = '"+quehuoproductlist.get(i));
}
}
stringBuffer1.append("'");
SqlCommand sqlCommand1=new SqlCommand(Context.getDbConnection());
sqlCommand1.execute(stringBuffer1.toString());
}
if(je < Float.parseFloat(customedu) && detailzq >= Integer.parseInt(zhangqi) && enough == false) {
flag1 = true;
}