|
|
@@ -133,8 +133,8 @@ public class itemgroup extends Controller {
|
|
|
list.add(whereObject.getLong("itemclassid"));
|
|
|
ArrayList<Long> listNew = new ArrayList<>();
|
|
|
listNew.add((long) 0);
|
|
|
- for (long itemclassid:list) {
|
|
|
- if(itemclassList.contains(itemclassid)){
|
|
|
+ for (long itemclassid : list) {
|
|
|
+ if (itemclassList.contains(itemclassid)) {
|
|
|
listNew.add(itemclassid);
|
|
|
}
|
|
|
}
|
|
|
@@ -193,10 +193,10 @@ public class itemgroup extends Controller {
|
|
|
BigDecimal max = new BigDecimal(0);
|
|
|
BigDecimal min = ((ItemPrice) ItemPriceList.values().toArray()[0]).getPrice();
|
|
|
for (ItemPrice itemPrice : ItemPriceList.values()) {
|
|
|
- if (itemPrice.getPrice().compareTo(max) == 1) {
|
|
|
+ if (itemPrice.getPrice().compareTo(max) > 0) {
|
|
|
max = itemPrice.getPrice();
|
|
|
}
|
|
|
- if (itemPrice.getPrice().compareTo(min) == -1) {
|
|
|
+ if (itemPrice.getPrice().compareTo(min) < 0) {
|
|
|
min = itemPrice.getPrice();
|
|
|
}
|
|
|
}
|
|
|
@@ -298,18 +298,6 @@ public class itemgroup extends Controller {
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
Rows rows = dbConnect.runSqlQuery(sqlFactory);
|
|
|
|
|
|
- for (Row row : rows) {
|
|
|
- ItemPrice itemPrice = ItemPrice.getItemPrice(this, sys_enterpriseid, row.getLong("itemid"));
|
|
|
- row.put("oldprice", itemPrice.getMarketprice());
|
|
|
- if (sys_enterpriseid > 0 || (usertype == 21 || usertype == 22)) {
|
|
|
- row.put("gradeprice", itemPrice.getContractprice());
|
|
|
- } else {
|
|
|
- row.put("gradeprice", itemPrice.getMarketprice());
|
|
|
- }
|
|
|
-
|
|
|
-// row.put("pricegrade", itemPrice.getEnterpriseGrade().getPricegrade());
|
|
|
- }
|
|
|
-
|
|
|
ArrayList<Long> ids = rows.toArrayList("itemid", new ArrayList<>());
|
|
|
|
|
|
//默认商品图片
|
|
|
@@ -332,7 +320,18 @@ public class itemgroup extends Controller {
|
|
|
+ siteid + "'");
|
|
|
RowsMap itemclassRowsMap = rowsitemclass.toRowsMap("itemid");
|
|
|
|
|
|
+ HashMap<Long, ItemPrice> itemPriceHashMap = ItemPrice.getItemPrice(this, sys_enterpriseid, rows.toArrayList("itemid", new ArrayList<>()));
|
|
|
for (Row row : rows) {
|
|
|
+ long itemid = row.getLong("itemid");
|
|
|
+ ItemPrice itemPrice = itemPriceHashMap.get(itemid);
|
|
|
+
|
|
|
+ row.put("oldprice", itemPrice.getMarketprice());
|
|
|
+ if (sys_enterpriseid > 0 || (usertype == 21 || usertype == 22)) {
|
|
|
+ row.put("gradeprice", itemPrice.getContractprice());
|
|
|
+ } else {
|
|
|
+ row.put("gradeprice", itemPrice.getMarketprice());
|
|
|
+ }
|
|
|
+
|
|
|
Rows jsonArray = new Rows();
|
|
|
Rows coverRows = coverRowsMap.get(row.getString("itemid"));
|
|
|
if (coverRows.isEmpty()) {
|
|
|
@@ -393,12 +392,12 @@ public class itemgroup extends Controller {
|
|
|
SQLFactory factory = new SQLFactory(this, "商品组明细查询");
|
|
|
factory.addParameter("sa_itemgroupid", content.getString("sa_itemgroupid"));
|
|
|
factory.addParameter("siteid", siteid);
|
|
|
- String where1=" 1=1 ";
|
|
|
+ String where1 = " 1=1 ";
|
|
|
Rows tradefieldRows = dbConnect.runSqlQuery("SELECT DISTINCT t1.tradefield from sys_enterprise_tradefield t1 WHERE t1.sys_enterpriseid = " + sys_enterpriseid + " and t1.siteid='" + siteid + "'");
|
|
|
|
|
|
- if(!tradefieldRows.isEmpty()){
|
|
|
- for (Row row: tradefieldRows) {
|
|
|
- where1= where1 +" or t4.tradefield like '%"+row.getString("tradefield")+"%' ";
|
|
|
+ if (!tradefieldRows.isEmpty()) {
|
|
|
+ for (Row row : tradefieldRows) {
|
|
|
+ where1 = where1 + " or t4.tradefield like '%" + row.getString("tradefield") + "%' ";
|
|
|
}
|
|
|
}
|
|
|
factory.addParameter_SQL("where1", where1);
|
|
|
@@ -445,22 +444,22 @@ public class itemgroup extends Controller {
|
|
|
for (Row row : rows) {
|
|
|
for (String value : listParmBlank) {
|
|
|
if (value.equals("color")) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", row.getString("color"));
|
|
|
jsonObject.put("flag", true);
|
|
|
colormap.add(jsonObject);
|
|
|
} else if (value.equals("spec")) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", row.getString("spec"));
|
|
|
jsonObject.put("flag", true);
|
|
|
specmap.add(jsonObject);
|
|
|
} else if (value.equals("material")) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", row.getString("material"));
|
|
|
jsonObject.put("flag", true);
|
|
|
materialmap.add(jsonObject);
|
|
|
} else if (value.equals("cheek")) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", row.getString("cheek"));
|
|
|
jsonObject.put("flag", true);
|
|
|
cheekmap.add(jsonObject);
|
|
|
@@ -513,11 +512,11 @@ public class itemgroup extends Controller {
|
|
|
for (String value : listAll) {
|
|
|
if (value.equals("color")) {
|
|
|
factory.addParameter_SQL("where", " 1=1 " + specwhere + materialwhere + cheekwhere);
|
|
|
- System.out.println(" 1=1 " + specwhere + materialwhere + cheekwhere);
|
|
|
+ System.out.println(" 1=1 " + specwhere + materialwhere + cheekwhere);
|
|
|
rows = dbConnect.runSqlQuery(factory.getSQL());
|
|
|
if (!rows.isEmpty()) {
|
|
|
for (Row row : rows) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", row.getString("color"));
|
|
|
jsonObject.put("flag", true);
|
|
|
colormap.add(jsonObject);
|
|
|
@@ -528,7 +527,7 @@ public class itemgroup extends Controller {
|
|
|
rows = dbConnect.runSqlQuery(factory.getSQL());
|
|
|
if (!rows.isEmpty()) {
|
|
|
for (Row row : rows) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", row.getString("spec"));
|
|
|
jsonObject.put("flag", true);
|
|
|
specmap.add(jsonObject);
|
|
|
@@ -539,7 +538,7 @@ public class itemgroup extends Controller {
|
|
|
rows = dbConnect.runSqlQuery(factory.getSQL());
|
|
|
if (!rows.isEmpty()) {
|
|
|
for (Row row : rows) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", row.getString("material"));
|
|
|
jsonObject.put("flag", true);
|
|
|
materialmap.add(jsonObject);
|
|
|
@@ -550,7 +549,7 @@ public class itemgroup extends Controller {
|
|
|
rows = dbConnect.runSqlQuery(factory.getSQL());
|
|
|
if (!rows.isEmpty()) {
|
|
|
for (Row row : rows) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", row.getString("cheek"));
|
|
|
jsonObject.put("flag", true);
|
|
|
cheekmap.add(jsonObject);
|
|
|
@@ -560,76 +559,76 @@ public class itemgroup extends Controller {
|
|
|
}
|
|
|
|
|
|
for (String firstcolor : firstcolorList) {
|
|
|
- boolean isexistParm=false;
|
|
|
- for (Object object:colormap) {
|
|
|
+ boolean isexistParm = false;
|
|
|
+ for (Object object : colormap) {
|
|
|
JSONObject jsonObject = (JSONObject) object;
|
|
|
- if(jsonObject.getString("parm").equals(firstcolor)){
|
|
|
- isexistParm=true;
|
|
|
+ if (jsonObject.getString("parm").equals(firstcolor)) {
|
|
|
+ isexistParm = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if (!isexistParm) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", firstcolor);
|
|
|
jsonObject.put("flag", false);
|
|
|
colormap.add(jsonObject);
|
|
|
}
|
|
|
}
|
|
|
for (String firstspec : firstspecList) {
|
|
|
- boolean isexistParm=false;
|
|
|
- for (Object object:specmap) {
|
|
|
+ boolean isexistParm = false;
|
|
|
+ for (Object object : specmap) {
|
|
|
JSONObject jsonObject = (JSONObject) object;
|
|
|
- if(jsonObject.getString("parm").equals(firstspec)){
|
|
|
- isexistParm=true;
|
|
|
+ if (jsonObject.getString("parm").equals(firstspec)) {
|
|
|
+ isexistParm = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if (!isexistParm) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", firstspec);
|
|
|
jsonObject.put("flag", false);
|
|
|
specmap.add(jsonObject);
|
|
|
}
|
|
|
}
|
|
|
for (String firstmaterial : firstmaterialList) {
|
|
|
- boolean isexistParm=false;
|
|
|
- for (Object object:materialmap) {
|
|
|
+ boolean isexistParm = false;
|
|
|
+ for (Object object : materialmap) {
|
|
|
JSONObject jsonObject = (JSONObject) object;
|
|
|
- if(jsonObject.getString("parm").equals(firstmaterial)){
|
|
|
- isexistParm=true;
|
|
|
+ if (jsonObject.getString("parm").equals(firstmaterial)) {
|
|
|
+ isexistParm = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if (!isexistParm) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", firstmaterial);
|
|
|
jsonObject.put("flag", false);
|
|
|
materialmap.add(jsonObject);
|
|
|
}
|
|
|
}
|
|
|
for (String firstcheek : firstcheekList) {
|
|
|
- boolean isexistParm=false;
|
|
|
- for (Object object:cheekmap) {
|
|
|
+ boolean isexistParm = false;
|
|
|
+ for (Object object : cheekmap) {
|
|
|
JSONObject jsonObject = (JSONObject) object;
|
|
|
- if(jsonObject.getString("parm").equals(firstcheek)){
|
|
|
- isexistParm=true;
|
|
|
+ if (jsonObject.getString("parm").equals(firstcheek)) {
|
|
|
+ isexistParm = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if (!isexistParm) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", firstcheek);
|
|
|
jsonObject.put("flag", false);
|
|
|
cheekmap.add(jsonObject);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- factory.addParameter_SQL("where", " 1=1 " + colorwhere + specwhere + materialwhere+cheekwhere);
|
|
|
+ factory.addParameter_SQL("where", " 1=1 " + colorwhere + specwhere + materialwhere + cheekwhere);
|
|
|
} else {
|
|
|
String where = " 1=1 ";
|
|
|
for (String value : listParmNotBlank) {
|
|
|
if (value.equals("color")) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", content.getString("color"));
|
|
|
jsonObject.put("flag", true);
|
|
|
colormap.add(jsonObject);
|
|
|
@@ -642,7 +641,7 @@ public class itemgroup extends Controller {
|
|
|
// }
|
|
|
// }
|
|
|
} else if (value.equals("spec")) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", content.getString("spec"));
|
|
|
jsonObject.put("flag", true);
|
|
|
specmap.add(jsonObject);
|
|
|
@@ -655,7 +654,7 @@ public class itemgroup extends Controller {
|
|
|
// }
|
|
|
// }
|
|
|
} else if (value.equals("material")) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", content.getString("material"));
|
|
|
jsonObject.put("flag", true);
|
|
|
materialmap.add(jsonObject);
|
|
|
@@ -668,7 +667,7 @@ public class itemgroup extends Controller {
|
|
|
// }
|
|
|
// }
|
|
|
} else if (value.equals("cheek")) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", content.getString("cheek"));
|
|
|
jsonObject.put("flag", true);
|
|
|
cheekmap.add(jsonObject);
|
|
|
@@ -689,7 +688,7 @@ public class itemgroup extends Controller {
|
|
|
rows = dbConnect.runSqlQuery(factory.getSQL());
|
|
|
if (!rows.isEmpty()) {
|
|
|
for (Row row : rows) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", row.getString("color"));
|
|
|
jsonObject.put("flag", true);
|
|
|
colormap.add(jsonObject);
|
|
|
@@ -700,7 +699,7 @@ public class itemgroup extends Controller {
|
|
|
rows = dbConnect.runSqlQuery(factory.getSQL());
|
|
|
if (!rows.isEmpty()) {
|
|
|
for (Row row : rows) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", row.getString("spec"));
|
|
|
jsonObject.put("flag", true);
|
|
|
specmap.add(jsonObject);
|
|
|
@@ -710,7 +709,7 @@ public class itemgroup extends Controller {
|
|
|
rows = dbConnect.runSqlQuery(factory.getSQL());
|
|
|
if (!rows.isEmpty()) {
|
|
|
for (Row row : rows) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", row.getString("material"));
|
|
|
jsonObject.put("flag", true);
|
|
|
materialmap.add(jsonObject);
|
|
|
@@ -720,7 +719,7 @@ public class itemgroup extends Controller {
|
|
|
rows = dbConnect.runSqlQuery(factory.getSQL());
|
|
|
if (!rows.isEmpty()) {
|
|
|
for (Row row : rows) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", row.getString("cheek"));
|
|
|
jsonObject.put("flag", true);
|
|
|
cheekmap.add(jsonObject);
|
|
|
@@ -731,66 +730,65 @@ public class itemgroup extends Controller {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
for (String firstcolor : firstcolorList) {
|
|
|
- boolean isexistParm=false;
|
|
|
- for (Object object:colormap) {
|
|
|
+ boolean isexistParm = false;
|
|
|
+ for (Object object : colormap) {
|
|
|
JSONObject jsonObject = (JSONObject) object;
|
|
|
- if(jsonObject.getString("parm").equals(firstcolor)){
|
|
|
- isexistParm=true;
|
|
|
+ if (jsonObject.getString("parm").equals(firstcolor)) {
|
|
|
+ isexistParm = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if (!isexistParm) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", firstcolor);
|
|
|
jsonObject.put("flag", false);
|
|
|
colormap.add(jsonObject);
|
|
|
}
|
|
|
}
|
|
|
for (String firstspec : firstspecList) {
|
|
|
- boolean isexistParm=false;
|
|
|
- for (Object object:specmap) {
|
|
|
+ boolean isexistParm = false;
|
|
|
+ for (Object object : specmap) {
|
|
|
JSONObject jsonObject = (JSONObject) object;
|
|
|
- if(jsonObject.getString("parm").equals(firstspec)){
|
|
|
- isexistParm=true;
|
|
|
+ if (jsonObject.getString("parm").equals(firstspec)) {
|
|
|
+ isexistParm = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if (!isexistParm) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", firstspec);
|
|
|
jsonObject.put("flag", false);
|
|
|
specmap.add(jsonObject);
|
|
|
}
|
|
|
}
|
|
|
for (String firstmaterial : firstmaterialList) {
|
|
|
- boolean isexistParm=false;
|
|
|
- for (Object object:materialmap) {
|
|
|
+ boolean isexistParm = false;
|
|
|
+ for (Object object : materialmap) {
|
|
|
JSONObject jsonObject = (JSONObject) object;
|
|
|
- if(jsonObject.getString("parm").equals(firstmaterial)){
|
|
|
- isexistParm=true;
|
|
|
+ if (jsonObject.getString("parm").equals(firstmaterial)) {
|
|
|
+ isexistParm = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if (!isexistParm) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", firstmaterial);
|
|
|
jsonObject.put("flag", false);
|
|
|
materialmap.add(jsonObject);
|
|
|
}
|
|
|
}
|
|
|
for (String firstcheek : firstcheekList) {
|
|
|
- boolean isexistParm=false;
|
|
|
- for (Object object:cheekmap) {
|
|
|
+ boolean isexistParm = false;
|
|
|
+ for (Object object : cheekmap) {
|
|
|
JSONObject jsonObject = (JSONObject) object;
|
|
|
- if(jsonObject.getString("parm").equals(firstcheek)){
|
|
|
- isexistParm=true;
|
|
|
+ if (jsonObject.getString("parm").equals(firstcheek)) {
|
|
|
+ isexistParm = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
if (!isexistParm) {
|
|
|
- JSONObject jsonObject =new JSONObject();
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
jsonObject.put("parm", firstcheek);
|
|
|
jsonObject.put("flag", false);
|
|
|
cheekmap.add(jsonObject);
|
|
|
@@ -799,62 +797,61 @@ public class itemgroup extends Controller {
|
|
|
}
|
|
|
|
|
|
|
|
|
- colormap=jsonArraySortByField(colormap.toJSONString(),"parm","0");
|
|
|
- specmap=jsonArraySortByField(specmap.toJSONString(),"parm","0");
|
|
|
- materialmap=jsonArraySortByField(materialmap.toJSONString(),"parm","0");
|
|
|
- cheekmap=jsonArraySortByField(cheekmap.toJSONString(),"parm","0");
|
|
|
-
|
|
|
+ colormap = jsonArraySortByField(colormap.toJSONString(), "parm", "0");
|
|
|
+ specmap = jsonArraySortByField(specmap.toJSONString(), "parm", "0");
|
|
|
+ materialmap = jsonArraySortByField(materialmap.toJSONString(), "parm", "0");
|
|
|
+ cheekmap = jsonArraySortByField(cheekmap.toJSONString(), "parm", "0");
|
|
|
|
|
|
|
|
|
- for (Object object:colormap) {
|
|
|
- boolean flag=false;
|
|
|
- parm parm =JSON.parseObject(((JSONObject)object).toJSONString(),parm.class);
|
|
|
- for (parm parm1:colorList) {
|
|
|
- if(parm1.getParm().equals(parm.getParm())){
|
|
|
- flag=true;
|
|
|
+ for (Object object : colormap) {
|
|
|
+ boolean flag = false;
|
|
|
+ parm parm = JSON.parseObject(((JSONObject) object).toJSONString(), parm.class);
|
|
|
+ for (parm parm1 : colorList) {
|
|
|
+ if (parm1.getParm().equals(parm.getParm())) {
|
|
|
+ flag = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(!flag){
|
|
|
+ if (!flag) {
|
|
|
colorList.add(parm);
|
|
|
}
|
|
|
}
|
|
|
- for (Object object:specmap) {
|
|
|
- boolean flag=false;
|
|
|
- parm parm =JSON.parseObject(((JSONObject)object).toJSONString(),parm.class);
|
|
|
- for (parm parm1:specList) {
|
|
|
- if(parm1.getParm().equals(parm.getParm())){
|
|
|
- flag=true;
|
|
|
+ for (Object object : specmap) {
|
|
|
+ boolean flag = false;
|
|
|
+ parm parm = JSON.parseObject(((JSONObject) object).toJSONString(), parm.class);
|
|
|
+ for (parm parm1 : specList) {
|
|
|
+ if (parm1.getParm().equals(parm.getParm())) {
|
|
|
+ flag = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(!flag){
|
|
|
+ if (!flag) {
|
|
|
specList.add(parm);
|
|
|
}
|
|
|
}
|
|
|
- for (Object object:materialmap) {
|
|
|
- boolean flag=false;
|
|
|
- parm parm =JSON.parseObject(((JSONObject)object).toJSONString(),parm.class);
|
|
|
- for (parm parm1:materialList) {
|
|
|
- if(parm1.getParm().equals(parm.getParm())){
|
|
|
- flag=true;
|
|
|
+ for (Object object : materialmap) {
|
|
|
+ boolean flag = false;
|
|
|
+ parm parm = JSON.parseObject(((JSONObject) object).toJSONString(), parm.class);
|
|
|
+ for (parm parm1 : materialList) {
|
|
|
+ if (parm1.getParm().equals(parm.getParm())) {
|
|
|
+ flag = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(!flag){
|
|
|
+ if (!flag) {
|
|
|
materialList.add(parm);
|
|
|
}
|
|
|
}
|
|
|
- for (Object object:cheekmap) {
|
|
|
- boolean flag=false;
|
|
|
- parm parm =JSON.parseObject(((JSONObject)object).toJSONString(),parm.class);
|
|
|
- for (parm parm1:cheekList) {
|
|
|
- if(parm1.getParm().equals(parm.getParm())){
|
|
|
- flag=true;
|
|
|
+ for (Object object : cheekmap) {
|
|
|
+ boolean flag = false;
|
|
|
+ parm parm = JSON.parseObject(((JSONObject) object).toJSONString(), parm.class);
|
|
|
+ for (parm parm1 : cheekList) {
|
|
|
+ if (parm1.getParm().equals(parm.getParm())) {
|
|
|
+ flag = true;
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- if(!flag){
|
|
|
+ if (!flag) {
|
|
|
cheekList.add(parm);
|
|
|
}
|
|
|
}
|
|
|
@@ -865,8 +862,8 @@ public class itemgroup extends Controller {
|
|
|
rows = dbConnect.runSqlQuery(factory.getSQL());
|
|
|
|
|
|
String itemno = "";
|
|
|
- if(!rows.isEmpty()){
|
|
|
- itemno=rows.get(0).getString("itemno");
|
|
|
+ if (!rows.isEmpty()) {
|
|
|
+ itemno = rows.get(0).getString("itemno");
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -938,16 +935,15 @@ public class itemgroup extends Controller {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
- * 按照JSONArray中的对象的某个字段进行排序(采用fastJson)
|
|
|
+ * 按照JSONArray中的对象的某个字段进行排序(采用fastJson)
|
|
|
*
|
|
|
* @param jsonArrayStr json数组字符串
|
|
|
- * @param sortkeyname 根据哪个字段进行排序
|
|
|
- * @param order 倒序:0;非0顺序
|
|
|
+ * @param sortkeyname 根据哪个字段进行排序
|
|
|
+ * @param order 倒序:0;非0顺序
|
|
|
* @return 排序后的jsonarray
|
|
|
*/
|
|
|
- public JSONArray jsonArraySortByField(String jsonArrayStr,String sortkeyname, String order) throws YosException {
|
|
|
+ public JSONArray jsonArraySortByField(String jsonArrayStr, String sortkeyname, String order) throws YosException {
|
|
|
|
|
|
JSONArray sortedJsonArray = new JSONArray();
|
|
|
|
|
|
@@ -969,7 +965,7 @@ public class itemgroup extends Controller {
|
|
|
String strA = new String();
|
|
|
String strB = new String();
|
|
|
|
|
|
- String regEx="[\n`~!@#$%^&*()+=|{}':;',\\-_\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。, 、?]";
|
|
|
+ String regEx = "[\n`~!@#$%^&*()+=|{}':;',\\-_\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。, 、?]";
|
|
|
|
|
|
String aStr = a.getStringValue(sortkeyname);
|
|
|
strA = aStr.replaceAll(regEx, "");
|
|
|
@@ -978,7 +974,7 @@ public class itemgroup extends Controller {
|
|
|
|
|
|
if ("0".equals(order)) {
|
|
|
return -strA.compareTo(strB);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
return strA.compareTo(strB);
|
|
|
}
|
|
|
|