|
@@ -41,7 +41,8 @@ public class promotion extends Controller {
|
|
|
String promname = content.getStringValue("promname");
|
|
String promname = content.getStringValue("promname");
|
|
|
String remarks = content.getStringValue("remarks");
|
|
String remarks = content.getStringValue("remarks");
|
|
|
String type = content.getStringValue("type");
|
|
String type = content.getStringValue("type");
|
|
|
- String tradefield = content.getStringValue("tradefield");
|
|
|
|
|
|
|
+ //String tradefield = content.getStringValue("tradefield");
|
|
|
|
|
+ JSONArray tradefield =content.getJSONArray("tradefield");
|
|
|
BigDecimal orderminqty = content.getBigDecimal("orderminqty");
|
|
BigDecimal orderminqty = content.getBigDecimal("orderminqty");
|
|
|
BigDecimal orderaddqty = content.getBigDecimal("orderaddqty");
|
|
BigDecimal orderaddqty = content.getBigDecimal("orderaddqty");
|
|
|
BigDecimal orderminamount = content.getBigDecimal("orderminamount");
|
|
BigDecimal orderminamount = content.getBigDecimal("orderminamount");
|
|
@@ -81,7 +82,7 @@ public class promotion extends Controller {
|
|
|
sqlFactory.addParameter("sa_accountclassid", sa_accountclassid);
|
|
sqlFactory.addParameter("sa_accountclassid", sa_accountclassid);
|
|
|
sqlFactory.addParameter("sa_brandid", sa_brandid);
|
|
sqlFactory.addParameter("sa_brandid", sa_brandid);
|
|
|
sqlFactory.addParameter("type", type);
|
|
sqlFactory.addParameter("type", type);
|
|
|
- sqlFactory.addParameter("tradefield", tradefield);
|
|
|
|
|
|
|
+ sqlFactory.addParameter("tradefield", tradefield.toJSONString());
|
|
|
sqlFactory.addParameter("orderminqty", orderminqty);
|
|
sqlFactory.addParameter("orderminqty", orderminqty);
|
|
|
sqlFactory.addParameter("orderaddqty", orderaddqty);
|
|
sqlFactory.addParameter("orderaddqty", orderaddqty);
|
|
|
sqlFactory.addParameter("orderminamount", orderminamount);
|
|
sqlFactory.addParameter("orderminamount", orderminamount);
|
|
@@ -113,7 +114,11 @@ public class promotion extends Controller {
|
|
|
ArrayList<Long> ids = rows.toArrayList("sa_promotionid", new ArrayList<>());
|
|
ArrayList<Long> ids = rows.toArrayList("sa_promotionid", new ArrayList<>());
|
|
|
RowsMap attRowsMap = getAttachmentUrl("sa_promotion", ids);
|
|
RowsMap attRowsMap = getAttachmentUrl("sa_promotion", ids);
|
|
|
row.put("attinfos", attRowsMap.getOrDefault(row.getString("sa_promotionid"), new Rows()));
|
|
row.put("attinfos", attRowsMap.getOrDefault(row.getString("sa_promotionid"), new Rows()));
|
|
|
-
|
|
|
|
|
|
|
+ if (!StringUtils.isBlank(row.getString("tradefield"))) {
|
|
|
|
|
+ row.put("tradefield", JSONArray.parseArray(row.getString("tradefield")));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ row.put("tradefield", new JSONArray());
|
|
|
|
|
+ }
|
|
|
return getSucReturnObject().setData(row).toString();
|
|
return getSucReturnObject().setData(row).toString();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -142,6 +147,11 @@ public class promotion extends Controller {
|
|
|
ArrayList<Long> ids = rows.toArrayList("sa_promotionid", new ArrayList<>());
|
|
ArrayList<Long> ids = rows.toArrayList("sa_promotionid", new ArrayList<>());
|
|
|
RowsMap attRowsMap = getAttachmentUrl("sa_promotion", ids);
|
|
RowsMap attRowsMap = getAttachmentUrl("sa_promotion", ids);
|
|
|
for (Row row : rows) {
|
|
for (Row row : rows) {
|
|
|
|
|
+ if (!StringUtils.isBlank(row.getString("tradefield"))) {
|
|
|
|
|
+ row.put("tradefield", JSONArray.parseArray(row.getString("tradefield")));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ row.put("tradefield", new JSONArray());
|
|
|
|
|
+ }
|
|
|
row.put("attinfos", attRowsMap.getOrDefault(row.getString("sa_promotionid"), new Rows()));
|
|
row.put("attinfos", attRowsMap.getOrDefault(row.getString("sa_promotionid"), new Rows()));
|
|
|
}
|
|
}
|
|
|
|
|
|