| | |
| | | |
| | | /** |
| | | * 根据筛选条件 |
| | | * |
| | | * @param pageNum |
| | | * @param pageSize |
| | | * @param projectManage |
| | |
| | | public Response add(ProjectManage pm) { |
| | | Response response = new Response<>(); |
| | | pm.setProNameCode(new SimpleDateFormat("yyyyMMddHHmmss").format(new Date())); |
| | | pm.setProProgress(1);//立项 |
| | | pm.setProState(1);//项目状态 进行中 |
| | | pm.setProProgress(1);//项目进度 立项 |
| | | Integer num = projectManageMapper.checkUniqueId(pm); |
| | | if (num > 0) { |
| | | return response.setMsg(0, "添加失败,pro_name_code重复"); |
| | |
| | | if (bl) { |
| | | ArrayList<String> list = pm.getFileList(); |
| | | if (null != list) { |
| | | Date proUploadDate = new Date(); |
| | | for (int i = 0; i < list.size(); i++) { |
| | | ProjectArchiveManage pam = new ProjectArchiveManage(); |
| | | pam.setProNum(pm.getProNum()); |
| | |
| | | int rexIdex = split[1].lastIndexOf("."); |
| | | pam.setProDocumentName(split[1].substring(0, rexIdex)); |
| | | pam.setProDocumentFormat(split[1].substring(rexIdex + 1)); |
| | | pam.setProUploadDate(new Date()); |
| | | pam.setProUploadDate(proUploadDate); |
| | | projectArchiveManageMapper.insert(pam); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 项目过程管理/己确认、未确认阶段 |
| | | * |
| | | * @param projectManage |
| | | * @return |
| | | */ |
| | |
| | | for (int i = 0; i < pams.size(); i++) { |
| | | ProjectArchiveManage pam = pams.get(i); |
| | | HashMap<Object, Object> mapDoc = new HashMap<>(); |
| | | mapDoc.put("fileName", pam.getProDocumentName()); |
| | | mapDoc.put("name", pam.getProDocumentName()); |
| | | mapDoc.put("url", pam.getProFilePath()); |
| | | list.add(mapDoc); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 项目进度确认 |
| | | *未归档可以修改更新,归档后不能修改 |
| | | * 未归档可以修改更新,归档后不能修改 |
| | | * |
| | | * @param pm |
| | | * @return |
| | | */ |
| | |
| | | TransactionStatus transactionStatus = dataSourceTransactionManager.getTransaction(transactionDefinition); |
| | | try { |
| | | bl = projectManageMapper.updateManageState(pm) > 0; |
| | | String path = pm.getNote().trim(); |
| | | if (path.length() > 10) { |
| | | ProjectArchiveManage pam = new ProjectArchiveManage(); |
| | | pam.setProNum(pm.getProNum()); |
| | | pam.setProName(pm.getProName()); |
| | | pam.setProNameCode(pm.getProNameCode());//唯一 |
| | | pam.setProSort(pm.getProSort()); |
| | | pam.setProFilePath(path); |
| | | String[] split = path.split("-"); |
| | | int rexIdex = split[1].lastIndexOf("."); |
| | | pam.setProDocumentName(split[1].substring(0, rexIdex)); |
| | | pam.setProDocumentFormat(split[1].substring(rexIdex + 1)); |
| | | projectArchiveManageMapper.insert(pam); |
| | | ArrayList<String> fileList = pm.getFileList(); |
| | | if (bl && null != fileList) { |
| | | for (int i = 0; i < fileList.size(); i++) { |
| | | String filePath = fileList.get(i); |
| | | Boolean fileExist = projectArchiveManageMapper.checkFileExist(filePath) > 0; |
| | | if (!fileExist) { |
| | | ProjectArchiveManage pam = new ProjectArchiveManage(); |
| | | pam.setProNum(pm.getProNum()); |
| | | pam.setProName(pm.getProName()); |
| | | pam.setProNameCode(pm.getProNameCode());//唯一 |
| | | pam.setProSort(pm.getProSort()); |
| | | pam.setProFilePath(filePath); |
| | | pam.setProUploadDate(new Date()); |
| | | String[] split = filePath.split("_"); |
| | | int rexIdex = split[1].lastIndexOf("."); |
| | | pam.setProDocumentName(split[1].substring(0, rexIdex)); |
| | | pam.setProDocumentFormat(split[1].substring(rexIdex + 1)); |
| | | projectArchiveManageMapper.insert(pam); |
| | | } |
| | | } |
| | | } |
| | | response.setMsg(1, "更新成功"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | dataSourceTransactionManager.rollback(transactionStatus); |
| | | return response.setMsg(0, "更新失败"); |
| | | } |
| | | if (bl) { |
| | | response.setMsg(1, "更新成功"); |
| | | dataSourceTransactionManager.commit(transactionStatus); |
| | | } else { |
| | | |
| | | response.setMsg(0, "更新失败"); |
| | | dataSourceTransactionManager.rollback(transactionStatus); |
| | | } |
| | | return response; |
| | |
| | | /** |
| | | * 项目进度管理 |
| | | * 项目进度(1-6 立项、审批、研究、结题、验收、归档) |
| | | * |
| | | * @param progress |
| | | * @return |
| | | */ |
| | | public Response updateProjectProgress(ProjectManage progress) { |
| | | Response<Object> response = new Response<>(); |
| | | boolean b = projectManageMapper.updateProjectProgress(progress) > 0; |
| | | if (b) { |
| | | progress.setProArchiveDate(new Date()); |
| | | boolean bl = projectManageMapper.updateProjectProgress(progress) > 0; |
| | | if (bl) { |
| | | projectArchiveManageMapper.updateProjectProgress(progress);//有文档材料就增加归档时间 |
| | | response.setMsg(1, "更新成功"); |
| | | } else { |
| | | response.setMsg(0, "更新失败"); |