|
@@ -16,6 +16,7 @@ import common.data.SQLFactory;
|
|
|
import restcontroller.R;
|
|
|
import restcontroller.webmanage.sale.itemgroup.itemgroup;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
public class favorites extends Controller {
|
|
@@ -38,6 +39,9 @@ public class favorites extends Controller {
|
|
|
public String insertormodify_item() throws YosException {
|
|
|
long itemid = content.getLongValue("itemid");
|
|
|
boolean iscollection=content.getBooleanValue("iscollection");
|
|
|
+ BigDecimal qty =content.getBigDecimalValue("qty");
|
|
|
+ BigDecimal width =content.getBigDecimalValue("width");
|
|
|
+ BigDecimal length =content.getBigDecimalValue("length");
|
|
|
Rows favoritesRows = dbConnect.runSqlQuery("select * from sa_favorites where sys_enterpriseid=" + sys_enterpriseid + " and siteid='" + siteid + "' and itemid='"+itemid+"'");
|
|
|
ArrayList<String> sqllist = new ArrayList<>();
|
|
|
SQLFactory sqlAddFactory = new SQLFactory(this, "商品收藏记录新增");
|
|
@@ -52,6 +56,9 @@ public class favorites extends Controller {
|
|
|
sqlAddFactory.addParameter("sa_favoritesid", favoritesRows.get(0).getLong("sa_favoritesid"));
|
|
|
sqlAddFactory.addParameter("iscollection", iscollection);
|
|
|
sqlAddFactory.addParameter("siteid", siteid);
|
|
|
+ sqlAddFactory.addParameter("qty", qty);
|
|
|
+ sqlAddFactory.addParameter("width", width);
|
|
|
+ sqlAddFactory.addParameter("length", length);
|
|
|
}
|
|
|
sqllist.add(sqlAddFactory.getSQL());
|
|
|
dbConnect.runSqlUpdate(sqllist);
|
|
@@ -113,6 +120,12 @@ public class favorites extends Controller {
|
|
|
sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
Rows itemrows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
+
|
|
|
+ Rows sizecustomizedschemes=dbConnect.runSqlQuery("select * from sa_sizecustomizedscheme where siteid='"+siteid+"' ");
|
|
|
+ RowsMap sizecustomizedschemesRowsMap=sizecustomizedschemes.toRowsMap("sa_sizecustomizedschemeid");
|
|
|
+ Rows sizeschemedetails=dbConnect.runSqlQuery("select * from sa_sizeschemedetail where siteid='"+siteid+"' ");
|
|
|
+ RowsMap sizeschemedetailsRowsMap=sizeschemedetails.toRowsMap("sa_sizecustomizedschemeid");
|
|
|
+
|
|
|
for (Row row : itemrows) {
|
|
|
ItemPrice itemPrice = ItemPrice.getItemPrice(this, sys_enterpriseid, row.getLong("itemid"));
|
|
|
row.put("oldprice", itemPrice.getPrice());
|
|
@@ -129,6 +142,40 @@ public class favorites extends Controller {
|
|
|
row.put("gradeprice", 0);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ if(row.getLong("widthschemeid")!=0){
|
|
|
+ if(sizecustomizedschemesRowsMap.containsKey(row.getString("widthschemeid"))){
|
|
|
+ if(sizecustomizedschemesRowsMap.get(row.getString("widthschemeid")).isNotEmpty()){
|
|
|
+ row.put("widthtype",sizecustomizedschemesRowsMap.get(row.getString("widthschemeid")).get(0).getString("type"));
|
|
|
+ row.put("widthmin",sizecustomizedschemesRowsMap.get(row.getString("widthschemeid")).get(0).getBigDecimal("min"));
|
|
|
+ row.put("widthmax",sizecustomizedschemesRowsMap.get(row.getString("widthschemeid")).get(0).getBigDecimal("max"));
|
|
|
+ row.put("widthdecimalplaces",sizecustomizedschemesRowsMap.get(row.getString("widthschemeid")).get(0).getBigDecimal("decimalplaces"));
|
|
|
+ if(sizeschemedetailsRowsMap.containsKey(row.getString("widthschemeid"))){
|
|
|
+ row.put("widthschemedetails",sizeschemedetailsRowsMap.get(row.getString("widthschemeid")));
|
|
|
+ }else{
|
|
|
+ row.put("widthschemedetails",new JSONArray());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(row.getLong("lengthschemeid")!=0){
|
|
|
+ if(sizecustomizedschemesRowsMap.containsKey(row.getString("lengthschemeid"))){
|
|
|
+ if(sizecustomizedschemesRowsMap.get(row.getString("lengthschemeid")).isNotEmpty()){
|
|
|
+ row.put("lengthtype",sizecustomizedschemesRowsMap.get(row.getString("lengthschemeid")).get(0).getString("type"));
|
|
|
+ row.put("lengthmin",sizecustomizedschemesRowsMap.get(row.getString("lengthschemeid")).get(0).getBigDecimal("min"));
|
|
|
+ row.put("lengthmax",sizecustomizedschemesRowsMap.get(row.getString("lengthschemeid")).get(0).getBigDecimal("max"));
|
|
|
+ row.put("lengthdecimalplaces",sizecustomizedschemesRowsMap.get(row.getString("lengthschemeid")).get(0).getBigDecimal("decimalplaces"));
|
|
|
+ if(sizeschemedetailsRowsMap.containsKey(row.getString("lengthschemeid"))){
|
|
|
+ row.put("lengthschemedetails",sizeschemedetailsRowsMap.get(row.getString("lengthschemeid")));
|
|
|
+ }else{
|
|
|
+ row.put("lengthschemedetails",new JSONArray());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
ArrayList<Long> ids = itemrows.toArrayList("itemid", new ArrayList<>());
|