Jelajahi Sumber

发货计划生成销售出库单逻辑优化

hu 1 bulan lalu
induk
melakukan
6fa7979bbf

+ 2 - 2
src/custom/restcontroller/webmanage/sale/sendplan/sendplandetail.java

@@ -312,8 +312,8 @@ public class sendplandetail extends Controller {
             String key = "";
             String sys_enterpriseid = jsonObject.getString("sys_enterpriseid");
             sys_enterpriseidList.add(sys_enterpriseid);
-            String topclassnum = jsonObject.getString("topclassnum");
-            key = topclassnum;
+            String outplace = jsonObject.getString("outplace");
+            key = outplace;
             HashMap<String, List<JSONObject>> agent = null;
             List<JSONObject> paolist = null;
             if (agentmap.containsKey(sys_enterpriseid)) {

+ 13 - 0
src/custom/restcontroller/webmanage/sale/serviceorder/serviceorder.java

@@ -245,6 +245,19 @@ public class serviceorder extends Controller {
         querySQL.setWhere(where.toString());
         querySQL.setPage(pageSize, pageNumber);
         Rows rows = querySQL.query();
+        // 默认商品图片
+        Rows defaultImageRows = beans.Item.Item.getItemdefaultImage(this);
+        // 附件
+        ArrayList<Long> ids = rows.toArrayList("itemid", new ArrayList<>());
+        RowsMap attRowsMap = getAttachmentUrl("plm_item", ids);
+
+        for(Row row : rows){
+            if (attRowsMap.getOrDefault(row.getString("itemid"), new Rows()).isNotEmpty()) {
+                row.put("attinfos", attRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
+            } else {
+                row.put("attinfos", defaultImageRows);
+            }
+        }
 
         return getSucReturnObject().setData(rows).toString();
     }