|
@@ -95,8 +95,8 @@ public class OrderItems extends Controller {
|
|
|
if (sa_orderitemsid <= 0) {
|
|
|
//获取定制属性
|
|
|
customproperties = orderItemsHelper.getCustomProperties(itemRowsMap, item);
|
|
|
- if(itemRow.getString("iscustomsize").equals("1")&&customproperties.isEmpty()){
|
|
|
- return getErrReturnObject().setErrMsg(itemRow.getString("itemno")+"的定制信息为空,无法添加").toString();
|
|
|
+ if (itemRow.getString("iscustomsize").equals("1") && customproperties.isEmpty()) {
|
|
|
+ return getErrReturnObject().setErrMsg(itemRow.getString("itemno") + "的定制信息为空,无法添加").toString();
|
|
|
}
|
|
|
|
|
|
spec = orderItemsHelper.getCustomSpec(itemRowsMap, item);
|
|
@@ -546,7 +546,7 @@ public class OrderItems extends Controller {
|
|
|
if (orderRows.isNotEmpty()) {
|
|
|
sys_enterpriseid = orderRows.get(0).getLong("sys_enterpriseid");
|
|
|
}
|
|
|
- Long sa_promotionid=orderRows.get(0).getLong("sa_promotionid");
|
|
|
+ Long sa_promotionid = orderRows.get(0).getLong("sa_promotionid");
|
|
|
// boolean isExport = content.getBooleanValue("isExport");
|
|
|
// SQLFactory sqlFactory = new SQLFactory(this, "订单商品明细_列表", pageSize, pageNumber, pageSorting);
|
|
|
// if (isExport) {
|
|
@@ -560,11 +560,11 @@ public class OrderItems extends Controller {
|
|
|
QuerySQL querySQL = SQLFactory.createQuerySQL(this, "sa_orderitems");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "st_invbal_sale", "t2", "t2.siteid = t1.siteid AND t2.itemid = t1.itemid");
|
|
|
querySQL.addJoinTable(JOINTYPE.left, "plm_item", "t3", "t3.itemid = t1.itemid and t3.siteid = t1.siteid",
|
|
|
- "orderminqty_auxunit", "orderaddqty_auxunit", "spec", "iscustomsize", "widthschemeid", "lengthschemeid", "standards", "k3outcode");
|
|
|
+ "orderminqty_auxunit", "orderaddqty_auxunit", "spec", "iscustomsize", "widthschemeid", "lengthschemeid", "standards", "k3outcode");
|
|
|
// querySQL.addJoinTable(JOINTYPE.left, "plm_itemextend", "t4", "t4.itemid = t1.itemid and t4.siteid = t1.siteid",
|
|
|
// "erpitemno", "erpitemname", "material", "prodline", "device", "specalnote");
|
|
|
- querySQL.addJoinTable(JOINTYPE.left,"sa_promotion_items","t4",
|
|
|
- "t4.itemid = t1.itemid and t4.siteid = t1.siteid and t4.sa_promotionid="+sa_promotionid);
|
|
|
+ querySQL.addJoinTable(JOINTYPE.left, "sa_promotion_items", "t4",
|
|
|
+ "t4.itemid = t1.itemid and t4.siteid = t1.siteid and t4.sa_promotionid=" + sa_promotionid);
|
|
|
|
|
|
querySQL.addQueryFields("candispatchqty", "ifnull(t2.candispatchqty, 0)");
|
|
|
querySQL.addQueryFields("cansaleqty", "ifnull(t2.cansaleqty, 0)");
|
|
@@ -643,7 +643,7 @@ public class OrderItems extends Controller {
|
|
|
if (rowsMap.containsKey(jsonObject.getString("fitemno"))) {
|
|
|
if (rowsMap.get(jsonObject.getString("fitemno")).isNotEmpty()) {
|
|
|
for (Row row : rowsMap.get(jsonObject.getString("fitemno"))
|
|
|
- ) {
|
|
|
+ ) {
|
|
|
row.put("invbalqty", jsonObject.getBigDecimalValue("fqty"));
|
|
|
}
|
|
|
}
|
|
@@ -1062,13 +1062,24 @@ public class OrderItems extends Controller {
|
|
|
String type = "";
|
|
|
String typemx = "";
|
|
|
Long sys_enterpriseid = 0L;
|
|
|
+ JSONArray sa_accountclassinfos = new JSONArray();
|
|
|
if (orderRows.isNotEmpty()) {
|
|
|
sa_brandid = orderRows.get(0).getLong("sa_brandid");
|
|
|
tradefield = orderRows.get(0).getString("tradefield");
|
|
|
type = orderRows.get(0).getString("type");
|
|
|
typemx = orderRows.get(0).getString("typemx");
|
|
|
sys_enterpriseid = orderRows.get(0).getLong("sys_enterpriseid");
|
|
|
+ sa_accountclassinfos = orderRows.get(0).getJSONArray("sa_accountclassinfos");
|
|
|
+ }
|
|
|
+ boolean iswuliao = false;
|
|
|
+ for (Object sa_accountclassinfo : sa_accountclassinfos) {
|
|
|
+ JSONObject jsonObject = (JSONObject) sa_accountclassinfo;
|
|
|
+ if (jsonObject.getString("accountname").equals("物料账户")) {
|
|
|
+ iswuliao = true;
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
SQLFactory sqlFactory = new SQLFactory(this, "查询可添加商品列表", pageSize, pageNumber, pageSorting);
|
|
|
switch (type) {
|
|
|
// case "总部订单":
|
|
@@ -1098,6 +1109,9 @@ public class OrderItems extends Controller {
|
|
|
sqlFactory.addParameter_SQL("where2", where2);
|
|
|
break;
|
|
|
}
|
|
|
+ if(iswuliao){
|
|
|
+ where.append(" and t1.iswuliao ='1' ");
|
|
|
+ }
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter_SQL("where", where);
|
|
|
String sql = sqlFactory.getSQL(false);
|