| | |
| | | public static final String PROJECTTYPE="projectType"; |
| | | public static final String PROJECT_UUID="project_uuid"; |
| | | public static final String ITEMIZE_UUID="itemize_uuid"; |
| | | public static final String UUID="uuid"; |
| | | |
| | | } |
| | |
| | | } |
| | | } |
| | | /** |
| | | * 获取项目分项材料 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/list-material-v/{version}", method = RequestMethod.POST) |
| | | @ApiVersion(1) |
| | | public String listMaterialV(HttpServletRequest request) { |
| | | try { |
| | | //获取参数 |
| | | FieldSetEntity fse = BaseUtil.getFieldSetEntity(request); |
| | | |
| | | //判断uuid是否为空 |
| | | if (BaseUtil.strIsNull(fse.getString(Cmnconst.UUID))) { |
| | | return this.error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText()); |
| | | } |
| | | |
| | | //判断分页参数是否为空 |
| | | if (BaseUtil.strIsNull(fse.getString(CoreConst.CPAGE)) || BaseUtil.strIsNull(fse.getString(CoreConst.PAGESIZE))) { |
| | | return this.error(SystemCode.SYSTEM_CPAGES_NOT_NULL.getValue(), SystemCode.SYSTEM_CPAGES_NOT_NULL.getText()); |
| | | } |
| | | return OK_List(projectInfoService.listMaterialV(fse.getString(Cmnconst.UUID), fse.getInteger(CoreConst.CPAGE), fse.getInteger(CoreConst.PAGESIZE))); |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return this.error(SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getValue(), |
| | | SystemCode.PROJECT_MAMAGERENT_ITEMIZE_GENERAL_ERROR.getText() + e.getMessage()); |
| | | } |
| | | } |
| | | /** |
| | | * 根据uuid获取项目分项树结构详情 |
| | | * @param request |
| | | * @return |
| | |
| | | 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; |
| | | |
| | |
| | | return dtItemizeBudget; |
| | | } |
| | | |
| | | /** |
| | | * 更具项目分项uuid获取项目分项下的材料 |
| | | * @param uuid |
| | | * @param capge |
| | | * @param pageSize |
| | | * @return |
| | | */ |
| | | 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); |
| | | } |
| | | |
| | | /** |
| | | * 根据项目uuid获取项目分项树结构 |
| | | * @param uuid |
| | | * @return |
| | | */ |
| | | |
| | | public JSONArray getTreeProjectItem(String uuid) { |
| | | FieldSetEntity fseProject = baseDao.getFieldSetEntity(Cmnconst.PRODUCT_PROJECT_QXLW, uuid, true); |
| | | DataTableEntity newDtProjectItem = BaseUtil.dataTableToTreeTable(fseProject.getSubDataTable(Cmnconst.PRODUCT_PROJECT_ITEM), Cmnconst.ITEMIZE_CODE, Cmnconst.ITEMIZE_PARENT_CODE, null); |
| | | DataTableEntity dtProjectItemize = baseDao.listTable(Cmnconst.PRODUCT_PROJECT_ITEM, "project_uuid=?", new Object[]{uuid}, new Object[]{CoreConst.UUID, Cmnconst.ITEMIZE, Cmnconst.ITEMIZE_CODE, Cmnconst.ITEMIZE_PARENT_CODE}); |
| | | DataTableEntity newDtProjectItem = BaseUtil.dataTableToTreeTable(dtProjectItemize, Cmnconst.ITEMIZE_CODE, Cmnconst.ITEMIZE_PARENT_CODE, null); |
| | | JSONArray objects = BaseUtil.dataTableEntityToJson(newDtProjectItem); |
| | | JSONObject json = new JSONObject(); |
| | | json.put("itemize", "项目分部分项"); |
| | | json.put("children", objects); |
| | | json.put("type", 1); |
| | | |
| | | json.set("itemize", "项目分部分项"); |
| | | json.set("children", objects); |
| | | json.set("type", 1); |
| | | JSONArray array = new JSONArray(); |
| | | array.add(json); |
| | | |
| | | return array; |
| | | } |
| | | } |