| | |
| | | import java.util.Map; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.product.core.websocket.config.CmnConst; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | //获取数据库原始数据 |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | //收集行转列数据 |
| | |
| | | public DataTableEntity listMaterialV(String uuid, Integer capge, Integer pageSize) { |
| | | return baseDao.listTable("product_project_base_material_v","project_itemize_uuid=?",new String[]{uuid},null,null,pageSize, capge); |
| | | } |
| | | |
| | | /** |
| | | * 更具仓库和材料获取库存 |
| | | * @return |
| | | */ |
| | | public FieldSetEntity findInventoryV(String warehouse_uuid, String material_uuid) { |
| | | return baseDao.getFieldSetByFilter("product_project_inventory_v","warehouse_uuid=? and uuid=?",new String[]{warehouse_uuid,material_uuid},false); |
| | | } |
| | | /** |
| | | * 根据项目uuid获取项目分项树结构 |
| | | * @param uuid |