|
|
@@ -12,7 +12,6 @@ import common.YosException;
|
|
|
import common.annotation.API;
|
|
|
import common.annotation.CACHEING;
|
|
|
import common.annotation.CACHEING_CLEAN;
|
|
|
-
|
|
|
import common.data.*;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
import org.apache.poi.ss.usermodel.CellStyle;
|
|
|
@@ -62,19 +61,19 @@ public class Item extends Controller {
|
|
|
}
|
|
|
Rows itemRows = dbConnect.runSqlQuery("SELECT t1.*,t2.material from plm_item t1 left join plm_itemextend t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid WHERE t1.itemid=" + itemid + " and t1.siteid ='" + siteid + "'");
|
|
|
|
|
|
- if(itemRows.get(0).getLong("wmsuploadflag")==2){
|
|
|
- if(!itemRows.get(0).getString("itemname").equals(content.getString("itemname")) ||
|
|
|
+ if (itemRows.get(0).getLong("wmsuploadflag") == 2) {
|
|
|
+ if (!itemRows.get(0).getString("itemname").equals(content.getString("itemname")) ||
|
|
|
!itemRows.get(0).getString("model").equals(content.getString("model")) ||
|
|
|
!itemRows.get(0).getString("shapsize").equals(content.getString("shapsize")) ||
|
|
|
!itemRows.get(0).getString("spec").equals(content.getString("spec")) ||
|
|
|
!itemRows.get(0).getString("unitid").equals(content.getString("unitid")) ||
|
|
|
!itemRows.get(0).getString("remarks").equals(content.getString("remarks")) ||
|
|
|
- !itemRows.get(0).getString("stockno").equals(content.getString("stockno"))){
|
|
|
- sqlList.add("update plm_item set wmsuploadflag=1 where itemid="+itemid+" and siteid='"+siteid+"'");
|
|
|
+ !itemRows.get(0).getString("stockno").equals(content.getString("stockno"))) {
|
|
|
+ sqlList.add("update plm_item set wmsuploadflag=1 where itemid=" + itemid + " and siteid='" + siteid + "'");
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if(content.getBooleanValue("ismodule")){
|
|
|
+
|
|
|
+ if (content.getBooleanValue("ismodule")) {
|
|
|
// Rows aftersalesitemnorows = dbConnect.runSqlQuery("select aftersalesitemno from plm_item where siteid='"+siteid+"' and aftersalesitemno='"+aftersalesitemno+"'");
|
|
|
// if(aftersalesitemnorows.isNotEmpty()){
|
|
|
// return getErrReturnObject().setErrMsg("该配件的售后品号" + aftersalesitemno + "已存在,请修改").toString();
|
|
|
@@ -224,7 +223,7 @@ public class Item extends Controller {
|
|
|
sqlFactory.addParameter("soldbase", content.getBigDecimal("soldbase"));
|
|
|
sqlFactory.addParameter("byname", content.getStringValue("byname"));
|
|
|
//rate,grade,custamount,safeqty,icaddqty,icminqty,iswriteoff,isnegative,ispartorderautocheck,islimitemparts,itemname_print,
|
|
|
- //applicablegassource,hygienelicensenum,departmentid,executionstandards,itemclsnum,outplace
|
|
|
+ //applicablegassource,hygienelicensenum,departmentid,executionstandards,itemclsnum,outplace
|
|
|
sqlFactory.addParameter("rate", content.getBigDecimal("rate"));
|
|
|
sqlFactory.addParameter("grade", content.getStringValue("grade"));
|
|
|
sqlFactory.addParameter("custamount", content.getBigDecimal("custamount"));
|
|
|
@@ -249,22 +248,22 @@ public class Item extends Controller {
|
|
|
sqlFactory.addParameter("poday", content.getIntValue("poday"));
|
|
|
sqlFactory.addParameter("sa_supplierid", content.getLongValue("sa_supplierid"));
|
|
|
|
|
|
- String topclassnum="";
|
|
|
+ String topclassnum = "";
|
|
|
if (content.containsKey("itemclassids")) {
|
|
|
JSONArray itemclassids = content.getJSONArray("itemclassids");
|
|
|
- for (Object obj : itemclassids) {
|
|
|
- JSONObject itemclass = (JSONObject) obj;
|
|
|
- if(itemclass.getStringValue("classtype").equals("存货")){
|
|
|
- SQLFactory sqlFactory1 = new SQLFactory(this, "获取最上级营销类别名称");
|
|
|
- sqlFactory1.addParameter_in("itemclassid", itemclass.getLongValue("itemclassid"));
|
|
|
- sqlFactory1.addParameter("siteid", siteid);
|
|
|
- Rows rows = dbConnect.runSqlQuery(sqlFactory1.getSQL());
|
|
|
- if (rows.isNotEmpty()) {
|
|
|
- topclassnum=rows.get(0).getString("itemclassname");
|
|
|
- }
|
|
|
+ for (Object obj : itemclassids) {
|
|
|
+ JSONObject itemclass = (JSONObject) obj;
|
|
|
+ if (itemclass.getStringValue("classtype").equals("存货")) {
|
|
|
+ SQLFactory sqlFactory1 = new SQLFactory(this, "获取最上级营销类别名称");
|
|
|
+ sqlFactory1.addParameter_in("itemclassid", itemclass.getLongValue("itemclassid"));
|
|
|
+ sqlFactory1.addParameter("siteid", siteid);
|
|
|
+ Rows rows = dbConnect.runSqlQuery(sqlFactory1.getSQL());
|
|
|
+ if (rows.isNotEmpty()) {
|
|
|
+ topclassnum = rows.get(0).getString("itemclassname");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
sqlFactory.addParameter("topclassnum", topclassnum);
|
|
|
|
|
|
sqlList.add(sqlFactory.getSQL());
|
|
|
@@ -357,10 +356,10 @@ public class Item extends Controller {
|
|
|
sqlFactory.addParameter("classtype", itemclass.getStringValue("classtype"));
|
|
|
sqlFactory.addParameter("itemclassid", itemclass.getLongValue("itemclassid"));
|
|
|
|
|
|
- if(itemclass.getStringValue("classtype").equals("存货")){
|
|
|
- Rows itemclsnumrows =dbConnect.runSqlQuery("select itemclassnum from plm_itemclass where classtype='存货' and itemclassid="+itemclass.getLongValue("itemclassid"));
|
|
|
- if(!itemclsnumrows.isEmpty()){
|
|
|
- sqlList.add("update plm_item set itemclsnum='"+itemclsnumrows.get(0).getString("itemclassnum")+"' where itemid="+itemid);
|
|
|
+ if (itemclass.getStringValue("classtype").equals("存货")) {
|
|
|
+ Rows itemclsnumrows = dbConnect.runSqlQuery("select itemclassnum from plm_itemclass where classtype='存货' and itemclassid=" + itemclass.getLongValue("itemclassid"));
|
|
|
+ if (!itemclsnumrows.isEmpty()) {
|
|
|
+ sqlList.add("update plm_item set itemclsnum='" + itemclsnumrows.get(0).getString("itemclassnum") + "' where itemid=" + itemid);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -380,7 +379,6 @@ public class Item extends Controller {
|
|
|
dbConnect.runSqlUpdate(sqlList);
|
|
|
|
|
|
|
|
|
-
|
|
|
content.put("itemid", itemid);
|
|
|
|
|
|
return queryDetail();
|
|
|
@@ -390,14 +388,14 @@ public class Item extends Controller {
|
|
|
public String copyItem() throws YosException {
|
|
|
long itemid = content.getLong("itemid");
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "货品档案新增");
|
|
|
- ArrayList<String> sqlList=new ArrayList<>();
|
|
|
- Rows itemRows = dbConnect.runSqlQuery("select *from plm_item where itemid="+itemid);
|
|
|
- Rows itemextendRows = dbConnect.runSqlQuery("select *from plm_itemextend where itemid="+itemid);
|
|
|
- Rows itemtradefieldRows = dbConnect.runSqlQuery("select *from plm_item_tradefield where itemid="+itemid);
|
|
|
- Rows itemsaleclassRows = dbConnect.runSqlQuery("select *from sa_itemsaleclass where itemid="+itemid);
|
|
|
- Rows attachmentLinksRows = dbConnect.runSqlQuery("select * from sys_attachment_links where ownertable='plm_item' and ownerid="+itemid);
|
|
|
-
|
|
|
- if(itemRows.isEmpty()){
|
|
|
+ ArrayList<String> sqlList = new ArrayList<>();
|
|
|
+ Rows itemRows = dbConnect.runSqlQuery("select *from plm_item where itemid=" + itemid);
|
|
|
+ Rows itemextendRows = dbConnect.runSqlQuery("select *from plm_itemextend where itemid=" + itemid);
|
|
|
+ Rows itemtradefieldRows = dbConnect.runSqlQuery("select *from plm_item_tradefield where itemid=" + itemid);
|
|
|
+ Rows itemsaleclassRows = dbConnect.runSqlQuery("select *from sa_itemsaleclass where itemid=" + itemid);
|
|
|
+ Rows attachmentLinksRows = dbConnect.runSqlQuery("select * from sys_attachment_links where ownertable='plm_item' and ownerid=" + itemid);
|
|
|
+
|
|
|
+ if (itemRows.isEmpty()) {
|
|
|
return getErrReturnObject().setErrMsg("原商品不存在,无法复制").toString();
|
|
|
}
|
|
|
Row item = itemRows.get(0);
|
|
|
@@ -408,8 +406,8 @@ public class Item extends Controller {
|
|
|
sqlFactory.addParameter("itemid", newitemid);
|
|
|
sqlFactory.addParameter("username", username);
|
|
|
sqlFactory.addParameter("userid", userid);
|
|
|
- sqlFactory.addParameter("itemno", "复制"+item.getString("itemno"));
|
|
|
- sqlFactory.addParameter("aftersalesitemno", "复制"+item.getString("aftersalesitemno"));
|
|
|
+ sqlFactory.addParameter("itemno", "复制" + item.getString("itemno"));
|
|
|
+ sqlFactory.addParameter("aftersalesitemno", "复制" + item.getString("aftersalesitemno"));
|
|
|
sqlFactory.addParameter("unitid", item.getLong("unitid"));
|
|
|
sqlFactory.addParameter("isauxunit", item.getString("isauxunit"));
|
|
|
sqlFactory.addParameter("unitgroupid", item.getString("unitgroupid"));
|
|
|
@@ -528,7 +526,7 @@ public class Item extends Controller {
|
|
|
// 货品档案扩展属性字段表
|
|
|
|
|
|
|
|
|
- if(!itemextendRows.isEmpty()){
|
|
|
+ if (!itemextendRows.isEmpty()) {
|
|
|
sqlFactory = new SQLFactory(this, "货品档案-扩展新增");
|
|
|
long plm_itemextendid = createTableID("plm_itemextend");
|
|
|
Row itemextendRow = itemextendRows.get(0);
|
|
|
@@ -558,7 +556,7 @@ public class Item extends Controller {
|
|
|
sqlList.add(sqlFactory.getSQL());
|
|
|
}
|
|
|
|
|
|
- if(!itemtradefieldRows.isEmpty()){
|
|
|
+ if (!itemtradefieldRows.isEmpty()) {
|
|
|
sqlFactory = new SQLFactory(this, "新增领域");
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("plm_item_tradefieldid", createTableID("plm_item_tradefield"));
|
|
|
@@ -568,21 +566,21 @@ public class Item extends Controller {
|
|
|
sqlList.add(sqlFactory.getSQL());
|
|
|
}
|
|
|
|
|
|
- if(!itemsaleclassRows.isEmpty()){
|
|
|
- for(Row row :itemsaleclassRows){
|
|
|
+ if (!itemsaleclassRows.isEmpty()) {
|
|
|
+ for (Row row : itemsaleclassRows) {
|
|
|
sqlFactory = new SQLFactory(this, "商品营销类别新增");
|
|
|
sqlFactory.addParameter("sa_itemsaleclassid", createTableID("sa_itemsaleclass"));
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("itemid", newitemid);
|
|
|
- sqlFactory.addParameter("itemno", "复制"+item.getString("itemno"));
|
|
|
+ sqlFactory.addParameter("itemno", "复制" + item.getString("itemno"));
|
|
|
sqlFactory.addParameter("classtype", row.getString("classtype"));
|
|
|
sqlFactory.addParameter("itemclassid", row.getLong("itemclassid"));
|
|
|
|
|
|
sqlList.add(sqlFactory.getSQL());
|
|
|
}
|
|
|
}
|
|
|
- if(!attachmentLinksRows.isEmpty()){
|
|
|
- for(Row row :attachmentLinksRows){
|
|
|
+ if (!attachmentLinksRows.isEmpty()) {
|
|
|
+ for (Row row : attachmentLinksRows) {
|
|
|
Long linksid = createTableID("sys_attachment_links");
|
|
|
InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sys_attachment_links");
|
|
|
insertSQL.setValue("linksid", linksid);
|
|
|
@@ -663,7 +661,7 @@ public class Item extends Controller {
|
|
|
String result = "";
|
|
|
// String result = request.doPost(object.toString(),
|
|
|
// "http://60.190.151.198:8089/BYESB/jaxrs/webclientrest");
|
|
|
- Rows siteParameterRows =dbConnect.runSqlQuery("select * from sys_site_parameter where siteid='" + siteid + "'");
|
|
|
+ Rows siteParameterRows = dbConnect.runSqlQuery("select * from sys_site_parameter where siteid='" + siteid + "'");
|
|
|
for (Row row : rows) {
|
|
|
JSONArray jsonArrayResult = new JSONArray();
|
|
|
if (isJSONArray(result)) {
|
|
|
@@ -684,9 +682,9 @@ public class Item extends Controller {
|
|
|
row.put("itemsaleclass", itemSaleClassRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
row.put("tradefield", tradefieldRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
if (siteParameterRows.isNotEmpty()) {
|
|
|
- row.put("defaultlevelprice",siteParameterRows.get(0).getString("defaultlevelprice"));
|
|
|
- }else{
|
|
|
- row.put("defaultlevelprice","");
|
|
|
+ row.put("defaultlevelprice", siteParameterRows.get(0).getString("defaultlevelprice"));
|
|
|
+ } else {
|
|
|
+ row.put("defaultlevelprice", "");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -834,7 +832,7 @@ public class Item extends Controller {
|
|
|
where.append(")");
|
|
|
}
|
|
|
if (content.containsKey("sys_enterpriseid")) {
|
|
|
- if(content.getLong("sys_enterpriseid")>0){
|
|
|
+ if (content.getLong("sys_enterpriseid") > 0) {
|
|
|
where.append(" and t1.itemid not in (SELECT ifnull(itemid,0) from sys_enterprise_saleclass WHERE sys_enterpriseid = " +
|
|
|
content.getLong("sys_enterpriseid") + " and siteid='" + siteid + "' )");
|
|
|
}
|
|
|
@@ -904,7 +902,7 @@ public class Item extends Controller {
|
|
|
}
|
|
|
|
|
|
public QuerySQL queryList(String where) throws YosException {
|
|
|
- QuerySQL querySQL = SQLFactory.createQuerySQL(this, "plm_item","*");
|
|
|
+ QuerySQL querySQL = SQLFactory.createQuerySQL(this, "plm_item", "*");
|
|
|
querySQL.setTableAlias("t1");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "plm_unit", "t2", "t2.unitid = t1.unitid AND t2.siteid = t1.siteid",
|
|
|
"unitname");
|
|
|
@@ -925,11 +923,11 @@ public class Item extends Controller {
|
|
|
// querySQL.addJoinTable(JOINTYPE.left, "plm_itemclass", "t14", "t14.itemclassid = t1.marketingcategory AND t14.siteid = t1.siteid",
|
|
|
// "itemclassname");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sys_department", "t16", "t16.departmentid = t1.departmentid AND t16.siteid = t1.siteid",
|
|
|
- "depno","depname");
|
|
|
+ "depno", "depname");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "st_stock", "t17", "t17.stockno = t1.stockno AND t17.siteid = t1.siteid",
|
|
|
"stockname");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "sa_supplier", "t18", "t18.sa_supplierid = t1.sa_supplierid AND t18.siteid = t1.siteid",
|
|
|
- "suppno","suppname","suppshortname");
|
|
|
+ "suppno", "suppname", "suppshortname");
|
|
|
|
|
|
|
|
|
querySQL.setWhere("t1.siteid", siteid);
|
|
|
@@ -954,25 +952,25 @@ public class Item extends Controller {
|
|
|
String sql1 = "select t2.groupnum from sa_itemgroupmx t1 inner join sa_itemgroup t2 on t1.sa_itemgroupid=t2.sa_itemgroupid and t1.siteid=t2.siteid where t1.itemid in " + jsonArray + " and t1.siteid ='"
|
|
|
+ siteid + "'";
|
|
|
sql1 = sql1.replace("[", "(").replace("]", ")");
|
|
|
- Rows rows =dbConnect.runSqlQuery(sql1);
|
|
|
+ Rows rows = dbConnect.runSqlQuery(sql1);
|
|
|
if (rows.isNotEmpty()) {
|
|
|
- return getErrReturnObject().setErrMsg("该商品已存在商品组,商品组编码:"+rows.get(0).getString("groupnum")+",请前往商品组删除该商品后重试!").toString();
|
|
|
+ return getErrReturnObject().setErrMsg("该商品已存在商品组,商品组编码:" + rows.get(0).getString("groupnum") + ",请前往商品组删除该商品后重试!").toString();
|
|
|
}
|
|
|
|
|
|
String sql2 = "select t2.sonum from sa_orderitems t1 inner join sa_order t2 on t1.sa_orderid=t2.sa_orderid and t1.siteid=t2.siteid where t1.itemid in " + jsonArray + " and t1.siteid ='"
|
|
|
+ siteid + "'";
|
|
|
sql2 = sql2.replace("[", "(").replace("]", ")");
|
|
|
- Rows rows2 =dbConnect.runSqlQuery(sql2);
|
|
|
+ Rows rows2 = dbConnect.runSqlQuery(sql2);
|
|
|
if (rows2.isNotEmpty()) {
|
|
|
- return getErrReturnObject().setErrMsg("该商品已存在于订单,单号:"+rows2.get(0).getString("sonum")+",无法删除!").toString();
|
|
|
+ return getErrReturnObject().setErrMsg("该商品已存在于订单,单号:" + rows2.get(0).getString("sonum") + ",无法删除!").toString();
|
|
|
}
|
|
|
|
|
|
String sql3 = "select t2.billno from sa_aftersalesmag_items t1 inner join sa_aftersalesmag t2 on t1.sa_aftersalesmagid=t2.sa_aftersalesmagid and t1.siteid=t2.siteid where t1.itemid in " + jsonArray + " and t1.siteid ='"
|
|
|
+ siteid + "'";
|
|
|
sql3 = sql3.replace("[", "(").replace("]", ")");
|
|
|
- Rows rows3 =dbConnect.runSqlQuery(sql3);
|
|
|
+ Rows rows3 = dbConnect.runSqlQuery(sql3);
|
|
|
if (rows3.isNotEmpty()) {
|
|
|
- return getErrReturnObject().setErrMsg("该商品已存在于退货单,单号:"+rows3.get(0).getString("billno")+",无法删除!").toString();
|
|
|
+ return getErrReturnObject().setErrMsg("该商品已存在于退货单,单号:" + rows3.get(0).getString("billno") + ",无法删除!").toString();
|
|
|
}
|
|
|
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "货品档案删除");
|
|
|
@@ -1126,7 +1124,7 @@ public class Item extends Controller {
|
|
|
if (status.equals("0")) {
|
|
|
if (itemRowsMap.containsKey(String.valueOf(id))) {
|
|
|
if (!itemRowsMap.get(String.valueOf(id)).isEmpty()) {
|
|
|
- if (itemRowsMap.get(String.valueOf(id)).get(0).getBoolean("isonsale") || itemRowsMap.get(String.valueOf(id)).get(0).getBoolean("isused") ) {
|
|
|
+ if (itemRowsMap.get(String.valueOf(id)).get(0).getBoolean("isonsale") || itemRowsMap.get(String.valueOf(id)).get(0).getBoolean("isused")) {
|
|
|
return getErrReturnObject().setErrMsg("上架或启用状态无法反审核").toString();
|
|
|
}
|
|
|
}
|
|
|
@@ -1147,7 +1145,7 @@ public class Item extends Controller {
|
|
|
}
|
|
|
|
|
|
@API(title = "货品档案启用", apiversion = R.ID2025070114584703.v1.class)
|
|
|
- @CACHEING_CLEAN(apiClass = {Item.class,itemgroup.class, restcontroller.sale.itemgroup.itemgroup.class})
|
|
|
+ @CACHEING_CLEAN(apiClass = {Item.class, itemgroup.class, restcontroller.sale.itemgroup.itemgroup.class})
|
|
|
public String used() throws YosException {
|
|
|
JSONArray jsonArray = content.getJSONArray("itemids");
|
|
|
String isused = content.getString("isused");
|
|
|
@@ -1203,14 +1201,14 @@ public class Item extends Controller {
|
|
|
} else {
|
|
|
sqlList.add(DataContrlLog.createLog(this, "plm_item", id, "停用", "停用成功").getSQL());
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
dbConnect.runSqlUpdate(sqlList);
|
|
|
return getSucReturnObject().toString();
|
|
|
}
|
|
|
|
|
|
|
|
|
@API(title = "货品档案上架", apiversion = R.ID20220923154802.v1.class)
|
|
|
- @CACHEING_CLEAN(apiClass = {Item.class,itemgroup.class, restcontroller.sale.itemgroup.itemgroup.class})
|
|
|
+ @CACHEING_CLEAN(apiClass = {Item.class, itemgroup.class, restcontroller.sale.itemgroup.itemgroup.class})
|
|
|
public String onsale() throws YosException {
|
|
|
|
|
|
JSONArray jsonArray = content.getJSONArray("itemids");
|
|
|
@@ -1267,11 +1265,8 @@ public class Item extends Controller {
|
|
|
if (!brandRows.isEmpty()) {
|
|
|
sa_brandid = brandRows.get(0).getLong("sa_brandid");
|
|
|
}
|
|
|
- Rows itemRows = dbConnect.runSqlQuery("select itemid,itemno,itemname,sa_customschemeid,isonsale from plm_item where siteid='" + siteid + "'");
|
|
|
- RowsMap itemRowsMap = itemRows.toRowsMap("itemid");
|
|
|
-
|
|
|
- Rows tradefieldRows = dbConnect.runSqlQuery("select itemid,tradefield from plm_item_tradefield where siteid='" + siteid + "'");
|
|
|
- RowsMap tradefieldRowsMap = tradefieldRows.toRowsMap("itemid");
|
|
|
+ RowsMap itemRowsMap = SQLFactory.createQuerySQL(this, "plm_item", "itemid", "itemno", "itemname").setWhere("itemid", jsonArray).query().toRowsMap("itemid");
|
|
|
+ RowsMap tradefieldRowsMap = SQLFactory.createQuerySQL(this, "plm_item_tradefield", "itemid", "tradefield").setWhere("itemid", jsonArray).query().toRowsMap("itemid");
|
|
|
|
|
|
ArrayList<String> sqlList = new ArrayList<>();
|
|
|
for (Object obj : jsonArray) {
|
|
|
@@ -1351,13 +1346,13 @@ public class Item extends Controller {
|
|
|
// sqlFactory.addParameter_SQL("where", where);
|
|
|
// Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_itemgroup", "sa_itemgroupid", "isonsale",
|
|
|
- "groupname","sa_brandid");
|
|
|
+ "groupname", "sa_brandid");
|
|
|
querySQL.setTableAlias("t1");
|
|
|
querySQL.addJoinTable(JOINTYPE.inner, "sa_itemgroupmx", "t2", "t1.sa_itemgroupid = t2.sa_itemgroupid and t1.siteid = t2.siteid");
|
|
|
- querySQL.addJoinTable(JOINTYPE.left, "sa_brand", "t3", "t3.sa_brandid = t1.sa_brandid and t3.siteid = t1.siteid","brandname");
|
|
|
+ querySQL.addJoinTable(JOINTYPE.left, "sa_brand", "t3", "t3.sa_brandid = t1.sa_brandid and t3.siteid = t1.siteid", "brandname");
|
|
|
querySQL.setDistinct(true);
|
|
|
querySQL.setSiteid(siteid);
|
|
|
- querySQL.setWhere("t1.itemid",itemid);
|
|
|
+ querySQL.setWhere("t1.itemid", itemid);
|
|
|
querySQL.setWhere(where.toString());
|
|
|
querySQL.setPage(pageSize, pageNumber);
|
|
|
Rows rows = querySQL.query();
|
|
|
@@ -1403,11 +1398,11 @@ public class Item extends Controller {
|
|
|
// Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "plm_technicalinfo", "plm_technicalinfoid", "billno",
|
|
|
- "type","remarks");
|
|
|
+ "type", "remarks");
|
|
|
querySQL.setTableAlias("t1");
|
|
|
querySQL.addJoinTable(JOINTYPE.inner, "plm_technicalinfo_item", "t2", "t1.plm_technicalinfoid = t2.plm_technicalinfoid and t1.siteid = t2.siteid");
|
|
|
querySQL.setSiteid(siteid);
|
|
|
- querySQL.setWhere("t2.itemid",itemid);
|
|
|
+ querySQL.setWhere("t2.itemid", itemid);
|
|
|
querySQL.setWhere(where.toString());
|
|
|
querySQL.setPage(pageSize, pageNumber);
|
|
|
Rows rows = querySQL.query();
|
|
|
@@ -1460,10 +1455,10 @@ public class Item extends Controller {
|
|
|
// sqlFactory.addParameter_SQL("where", where);
|
|
|
// Rows rows = dbConnect.runSqlQuery(sqlFactory.getSQL());
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_itemprice", "sa_itempriceid", "itemid",
|
|
|
- "itemno","pricegrade","price");
|
|
|
+ "itemno", "pricegrade", "price");
|
|
|
querySQL.setTableAlias("t1");
|
|
|
querySQL.setSiteid(siteid);
|
|
|
- querySQL.setWhere("t1.itemid",itemid);
|
|
|
+ querySQL.setWhere("t1.itemid", itemid);
|
|
|
querySQL.setWhere(where.toString());
|
|
|
querySQL.setPage(pageSize, pageNumber);
|
|
|
Rows rows = querySQL.query();
|
|
|
@@ -1745,7 +1740,7 @@ public class Item extends Controller {
|
|
|
sqlFactory.addParameter("username", username);
|
|
|
sqlFactory.addParameter("userid", userid);
|
|
|
sqlFactory.addParameter("itemno", row.getString("itemno"));
|
|
|
- sqlFactory.addParameter("aftersalesitemno","");
|
|
|
+ sqlFactory.addParameter("aftersalesitemno", "");
|
|
|
sqlFactory.addParameter("unitid", row.getLong("unitid"));
|
|
|
sqlFactory.addParameter("isauxunit", 0);
|
|
|
sqlFactory.addParameter("unitgroupid", "null");
|