| | |
| | | //获取数据库原始数据 |
| | | StringBuilder sb = new StringBuilder(); |
| | | sb.append("WITH outbound AS(") |
| | | .append(" SELECT A.project_uuid,A.project_itemize,C.material_type,B.material_code,SUM(B.outbound_weight)outbound_weight ") |
| | | .append(" SELECT A.project_uuid,D.itemize project_itemize,C.material_type,B.material_code,SUM(B.outbound_weight)outbound_weight ") |
| | | .append(" FROM product_project_outbound A ") |
| | | .append(" LEFT JOIN product_project_outbound_sub B ON A.uuid=B.outbound_uuid ") |
| | | .append(" LEFT JOIN product_project_base_material C ON B.material_uuid = C.uuid ") |
| | | .append(" WHERE project_uuid = ? ") |
| | | .append(" GROUP BY A.project_uuid,A.project_itemize,C.material_type,B.material_code ") |
| | | .append(" LEFT JOIN product_project_item D ON A.project_itemize = D.uuid ") |
| | | .append(" WHERE A.flow_flag=2 AND A.project_uuid = ? ") |
| | | .append(" GROUP BY A.project_uuid,D.itemize,C.material_type,B.material_code ") |
| | | .append(" ) ") |
| | | .append(" SELECT A.project_uuid,A.project_itemize,A.total_outbound_weight,B.material_type,B.material_code,B.outbound_weight ") |
| | | .append(" FROM ( ") |
| | |
| | | .append(" FROM outbound ") |
| | | .append(" GROUP BY project_uuid,project_itemize ") |
| | | .append(" )A ") |
| | | .append(" RIGHT JOIN outbound B ON A.project_uuid=B.project_uuid AND A.project_itemize=B.project_itemize "); |
| | | .append(" RIGHT JOIN outbound B ON A.project_uuid=B.project_uuid AND A.project_itemize=B.project_itemize ") |
| | | .append(" ORDER BY project_itemize,material_code"); |
| | | DataTableEntity dtItemizeInfo = baseDao.listTable(sb.toString(), new Object[]{project_uuid}); |
| | | if (!BaseUtil.dataTableIsEmpty(dtItemizeInfo)) { |
| | | |
| | |
| | | if (BaseUtil.strIsNull(materialTypes[materialType])) { |
| | | materialTypes[materialType] = materialCode; |
| | | } else { |
| | | materialTypes[fseItemize.getInteger(Cmnconst.MATERIAL_TYPE)] += "," + materialCode; |
| | | if(materialTypes[fseItemize.getInteger(Cmnconst.MATERIAL_TYPE)].indexOf(materialCode)<0) { |
| | | materialTypes[fseItemize.getInteger(Cmnconst.MATERIAL_TYPE)] += "," + materialCode; |
| | | } |
| | | } |
| | | |
| | | //收集行转列数据 |