|
|
@@ -212,7 +212,7 @@ public class ItempriceadjustItemprice extends Controller {
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlList.add(sqlFactory.getSQL());
|
|
|
for (Object o : sa_itempriceadjust_itemsids) {
|
|
|
- String sql = "update sa_itempriceadjust_items set rowno=rowno-1 where siteid = '" + siteid + "' and sa_itempriceadjustid="+sa_itempriceadjustid+" and sa_itempriceadjust_itemsid > " + o;
|
|
|
+ String sql = "update sa_itempriceadjust_items set rowno=rowno-1 where siteid = '" + siteid + "' and sa_itempriceadjustid=" + sa_itempriceadjustid + " and sa_itempriceadjust_itemsid > " + o;
|
|
|
sqlList.add(sql);
|
|
|
sql = DataContrlLog.createLog(this, "sa_itempriceadjust_itemprice", Long.parseLong(o.toString()), "更新", "商品调价单商品删除:" + o).getSQL();
|
|
|
sqlList.add(sql);
|
|
|
@@ -280,7 +280,6 @@ public class ItempriceadjustItemprice extends Controller {
|
|
|
if (itemnoRowsMap.containsKey(itemno)) {
|
|
|
row.put("itemid", itemnoRowsMap.get(itemno).get(0).getLong("itemid"));
|
|
|
row.put("oldmarketprice", itemnoRowsMap.get(itemno).get(0).getBigDecimal("marketprice"));
|
|
|
- rowssuc.add(row);
|
|
|
} else {
|
|
|
iserr = true;
|
|
|
row.put("msg", "错误信息:不存在商品编号为" + itemno + "的商品");
|
|
|
@@ -297,50 +296,10 @@ public class ItempriceadjustItemprice extends Controller {
|
|
|
iserr = true;
|
|
|
row.put("msg", "错误信息:商品调整价不能为空");
|
|
|
rowserr.add(row);
|
|
|
+ continue;
|
|
|
}
|
|
|
+ rowssuc.add(row);
|
|
|
|
|
|
-
|
|
|
- }
|
|
|
- if (iserr) {
|
|
|
- ExcelFactory excelFactory = new ExcelFactory("调价单导入错误信息");
|
|
|
- HashMap<String, String> map = new HashMap<String, String>();
|
|
|
- map.put("itemno", "商品编号");
|
|
|
- map.put("remarks", "备注");
|
|
|
- map.put("price1", "调整价1");
|
|
|
- map.put("price2", "调整价2");
|
|
|
- map.put("price3", "调整价3");
|
|
|
- map.put("price4", "调整价4");
|
|
|
- map.put("price5", "调整价5");
|
|
|
- map.put("msg", "错误信息");
|
|
|
- ArrayList<String> colNameList = new ArrayList<String>();
|
|
|
- HashMap<String, Class> keytypemap = new HashMap<String, Class>();
|
|
|
- colNameList.add("itemno");
|
|
|
- colNameList.add("remarks");
|
|
|
- colNameList.add("price1");
|
|
|
- colNameList.add("price2");
|
|
|
- colNameList.add("price3");
|
|
|
- colNameList.add("price4");
|
|
|
- colNameList.add("price5");
|
|
|
- colNameList.add("msg");
|
|
|
- keytypemap.put("itemno", String.class);
|
|
|
- keytypemap.put("remarks", String.class);
|
|
|
- keytypemap.put("price1", BigDecimal.class);
|
|
|
- keytypemap.put("price2", BigDecimal.class);
|
|
|
- keytypemap.put("price3", BigDecimal.class);
|
|
|
- keytypemap.put("price4", BigDecimal.class);
|
|
|
- keytypemap.put("price5", BigDecimal.class);
|
|
|
- keytypemap.put("msg", String.class);
|
|
|
- rowserr.setFieldList(colNameList);
|
|
|
- rowserr.setFieldTypeMap(keytypemap);
|
|
|
- addSheet(excelFactory, "Sheet1", rowserr, map);
|
|
|
-
|
|
|
- Rows aa = uploadExcelToObs(excelFactory);
|
|
|
- String url = "";
|
|
|
- if (!aa.isEmpty()) {
|
|
|
- url = aa.get(0).getString("url");
|
|
|
- }
|
|
|
- dbConnect.runSqlUpdate("delete from sa_itempriceadjust where sa_itempriceadjustid=" + sa_itempriceadjustid);
|
|
|
- return getSucReturnObject().setData(url).toString();
|
|
|
}
|
|
|
|
|
|
if (!rowssuc.isEmpty()) {
|
|
|
@@ -405,6 +364,48 @@ public class ItempriceadjustItemprice extends Controller {
|
|
|
} else {
|
|
|
dbConnect.runSqlUpdate("delete from sa_itempriceadjust where sa_itempriceadjustid=" + sa_itempriceadjustid);
|
|
|
}
|
|
|
+
|
|
|
+ if (iserr) {
|
|
|
+ ExcelFactory excelFactory = new ExcelFactory("调价单导入错误信息");
|
|
|
+ HashMap<String, String> map = new HashMap<String, String>();
|
|
|
+ map.put("itemno", "商品编号");
|
|
|
+ map.put("remarks", "备注");
|
|
|
+ map.put("price1", "调整价1");
|
|
|
+ map.put("price2", "调整价2");
|
|
|
+ map.put("price3", "调整价3");
|
|
|
+ map.put("price4", "调整价4");
|
|
|
+ map.put("price5", "调整价5");
|
|
|
+ map.put("msg", "错误信息");
|
|
|
+ ArrayList<String> colNameList = new ArrayList<String>();
|
|
|
+ HashMap<String, Class> keytypemap = new HashMap<String, Class>();
|
|
|
+ colNameList.add("itemno");
|
|
|
+ colNameList.add("remarks");
|
|
|
+ colNameList.add("price1");
|
|
|
+ colNameList.add("price2");
|
|
|
+ colNameList.add("price3");
|
|
|
+ colNameList.add("price4");
|
|
|
+ colNameList.add("price5");
|
|
|
+ colNameList.add("msg");
|
|
|
+ keytypemap.put("itemno", String.class);
|
|
|
+ keytypemap.put("remarks", String.class);
|
|
|
+ keytypemap.put("price1", BigDecimal.class);
|
|
|
+ keytypemap.put("price2", BigDecimal.class);
|
|
|
+ keytypemap.put("price3", BigDecimal.class);
|
|
|
+ keytypemap.put("price4", BigDecimal.class);
|
|
|
+ keytypemap.put("price5", BigDecimal.class);
|
|
|
+ keytypemap.put("msg", String.class);
|
|
|
+ rowserr.setFieldList(colNameList);
|
|
|
+ rowserr.setFieldTypeMap(keytypemap);
|
|
|
+ addSheet(excelFactory, "Sheet1", rowserr, map);
|
|
|
+
|
|
|
+ Rows aa = uploadExcelToObs(excelFactory);
|
|
|
+ String url = "";
|
|
|
+ if (!aa.isEmpty()) {
|
|
|
+ url = aa.get(0).getString("url");
|
|
|
+ }
|
|
|
+ dbConnect.runSqlUpdate("delete from sa_itempriceadjust where sa_itempriceadjustid=" + sa_itempriceadjustid);
|
|
|
+ return getSucReturnObject().setData(url).toString();
|
|
|
+ }
|
|
|
} catch (Exception e1) {
|
|
|
dbConnect.runSqlUpdate("delete from sa_itempriceadjust where sa_itempriceadjustid=" + sa_itempriceadjustid);
|
|
|
e1.printStackTrace();
|