|
|
@@ -306,17 +306,24 @@ public class workorder extends Controller {
|
|
|
RowsMap workorderteamRowsMap = workorderteamRows.toRowsMap("ownerid");
|
|
|
|
|
|
/** 工单节点物料查询 **/
|
|
|
- Rows oldworkorderitemRows = dbConnect.runSqlQuery(
|
|
|
- "select t1.*,t2.itemno,t2.model,t2.itemname,t2.spec,t3.sonum from sa_workorder_node_items t1 " +
|
|
|
- "left join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid " +
|
|
|
- "left join sa_order t3 on t1.sourceid=t3.sa_orderid and t1.siteid=t3.siteid and t1.sourcetable='sa_order' where t1.sa_workorderid=" + sa_workorderid + " and ifnull(t1.isnew,0)=0 and t1.siteid='"
|
|
|
+ Rows workorderitemRows = dbConnect.runSqlQuery(
|
|
|
+ "select t1.*,t2.itemno,t2.model,t2.itemname,t2.spec,t7.bomfullname,ifnull(t1.isnew,0) isnew from sa_workorder_node_items t1 left join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid" +
|
|
|
+ "LEFT JOIN sa_itemsalebom t6 on t1.itemid=t6.itemid and t6.siteid = t1.siteid " +
|
|
|
+ "LEFT JOIN plm_bom t7 on t7.plm_bomid=t6.plm_bomid and t6.siteid = t7.siteid where t1.sa_workorderid=" + sa_workorderid + " and t1.siteid='"
|
|
|
+ siteid + "'");
|
|
|
- RowsMap oldworkorderitemRowsMap = oldworkorderitemRows.toRowsMap("sa_workorder_nodeid");
|
|
|
-
|
|
|
- Rows newworkorderitemRows = dbConnect.runSqlQuery(
|
|
|
- "select t1.*,t2.itemno,t2.model,t2.itemname,t2.spec from sa_workorder_node_items t1 left join plm_item t2 on t1.itemid=t2.itemid and t1.siteid=t2.siteid where t1.sa_workorderid=" + sa_workorderid + " and ifnull(t1.isnew,0)=1 and t1.siteid='"
|
|
|
- + siteid + "'");
|
|
|
- RowsMap newworkorderitemRowsMap = newworkorderitemRows.toRowsMap("sa_workorder_nodeid");
|
|
|
+ // 默认商品图片
|
|
|
+ Rows defaultImageRows = beans.Item.Item.getItemdefaultImage(this);
|
|
|
+ // 附件
|
|
|
+ ArrayList<Long> itemids = workorderitemRows.toArrayList("itemid", new ArrayList<>());
|
|
|
+ RowsMap itemattRowsMap = getAttachmentUrl("plm_item", itemids);
|
|
|
+ for (Row itemRow : workorderitemRows) {
|
|
|
+ if (itemattRowsMap.getOrDefault(itemRow.getString("itemid"), new Rows()).isNotEmpty()) {
|
|
|
+ itemRow.put("attinfos", itemattRowsMap.getOrDefault(itemRow.getString("itemid"), new Rows()));
|
|
|
+ } else {
|
|
|
+ itemRow.put("attinfos", defaultImageRows);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ RowsMap workorderitemRowsMap = workorderitemRows.toRowsMap("sa_workorder_nodeid");
|
|
|
|
|
|
/** 节点关联培训人员查询 **/
|
|
|
Rows trainers = dbConnect.runSqlQuery(
|
|
|
@@ -347,10 +354,10 @@ public class workorder extends Controller {
|
|
|
row.put("team", workorderteamRowsMap.get(row.getString("sa_workorder_nodeid")));
|
|
|
|
|
|
/** 工单节点物料查询 **/
|
|
|
- row.put("oldtitems", oldworkorderitemRowsMap.get(row.getString("sa_workorder_nodeid")));
|
|
|
+ row.put("oldtitems", workorderitemRowsMap.get(row.getString("sa_workorder_nodeid")).toRowsMap("isnew").get("0"));
|
|
|
|
|
|
|
|
|
- row.put("newtitems", newworkorderitemRowsMap.get(row.getString("sa_workorder_nodeid")));
|
|
|
+ row.put("newtitems", workorderitemRowsMap.get(row.getString("sa_workorder_nodeid")).toRowsMap("isnew").get("1"));
|
|
|
|
|
|
// /** 节点关联培训物料查询 **/
|
|
|
// Rows traintitem = dbConnect.runSqlQuery("select * from sa_workorder_node_items where sa_workorder_nodeid="+sa_workorder_nodeid+" and sa_workorderid="
|
|
|
@@ -510,7 +517,7 @@ public class workorder extends Controller {
|
|
|
RowsMap itemattRowsMap = getAttachmentUrl("plm_item", itemids);
|
|
|
for (Row itemRow : workorderitemRows) {
|
|
|
if (itemattRowsMap.getOrDefault(itemRow.getString("itemid"), new Rows()).isNotEmpty()) {
|
|
|
- itemRow.put("attinfos", itemattRowsMap.getOrDefault(row.getString("itemid"), new Rows()));
|
|
|
+ itemRow.put("attinfos", itemattRowsMap.getOrDefault(itemRow.getString("itemid"), new Rows()));
|
|
|
} else {
|
|
|
itemRow.put("attinfos", defaultImageRows);
|
|
|
}
|