项目查看审核页面实现
parent
0aeb024e40
commit
13e47b6317
|
@ -1,9 +1,6 @@
|
||||||
package cn.palmte.work.controller.backend;
|
package cn.palmte.work.controller.backend;
|
||||||
|
|
||||||
import cn.palmte.work.bean.ApproveStatusEnum;
|
import cn.palmte.work.bean.*;
|
||||||
import cn.palmte.work.bean.BudgetBean;
|
|
||||||
import cn.palmte.work.bean.EstimateBean;
|
|
||||||
import cn.palmte.work.bean.ResponseMsg;
|
|
||||||
import cn.palmte.work.model.*;
|
import cn.palmte.work.model.*;
|
||||||
import cn.palmte.work.service.ProjectBudgetService;
|
import cn.palmte.work.service.ProjectBudgetService;
|
||||||
import cn.palmte.work.service.ProjectEstimateService;
|
import cn.palmte.work.service.ProjectEstimateService;
|
||||||
|
@ -35,11 +32,12 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 项目管理功能
|
* 项目管理功能
|
||||||
|
*
|
||||||
* @author xiongshiyan at 2021/10/29 , contact me with email yanshixiong@126.com or phone 15208384257
|
* @author xiongshiyan at 2021/10/29 , contact me with email yanshixiong@126.com or phone 15208384257
|
||||||
*/
|
*/
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/project")
|
@RequestMapping("/project")
|
||||||
public class ProjectController extends BaseController{
|
public class ProjectController extends BaseController {
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ProjectController.class);
|
private static final Logger logger = LoggerFactory.getLogger(ProjectController.class);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
@ -55,15 +53,15 @@ public class ProjectController extends BaseController{
|
||||||
* 项目列表
|
* 项目列表
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/list")
|
@RequestMapping("/list")
|
||||||
public String list(@RequestParam(value = "keywords",required = false) String keywords,
|
public String list(@RequestParam(value = "keywords", required = false) String keywords,
|
||||||
@RequestParam(value = PAGE_NUMBER, defaultValue = DEFAULT_PAGE_NUMBER) int pageNumber,
|
@RequestParam(value = PAGE_NUMBER, defaultValue = DEFAULT_PAGE_NUMBER) int pageNumber,
|
||||||
@RequestParam(value = PAGE_SIZE, defaultValue = DEFAULT_PAGE_SIZE) int pageSize,
|
@RequestParam(value = PAGE_SIZE, defaultValue = DEFAULT_PAGE_SIZE) int pageSize,
|
||||||
Map<String, Object> model) {
|
Map<String, Object> model) {
|
||||||
//当前登录人的角色类型
|
//当前登录人的角色类型
|
||||||
model.put("keywords",keywords);
|
model.put("keywords", keywords);
|
||||||
model.put("deptList", deptRepository.findAll());
|
model.put("deptList", deptRepository.findAll());
|
||||||
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords,model);
|
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords, model);
|
||||||
model.put("pager",projectService.list(searchInfo,pageNumber,pageSize));
|
model.put("pager", projectService.list(searchInfo, pageNumber, pageSize));
|
||||||
/*Page<Project> myApproveProjects = projectService.findMyApproveProjects(searchInfo, InterfaceUtil.getAdminId(), 1, Integer.MAX_VALUE);
|
/*Page<Project> myApproveProjects = projectService.findMyApproveProjects(searchInfo, InterfaceUtil.getAdminId(), 1, Integer.MAX_VALUE);
|
||||||
model.put("hasApproveProjects", CollectionUtil.isNotEmpty(myApproveProjects.getList()) ? "1" : "0");*/
|
model.put("hasApproveProjects", CollectionUtil.isNotEmpty(myApproveProjects.getList()) ? "1" : "0");*/
|
||||||
return "admin/project_list";
|
return "admin/project_list";
|
||||||
|
@ -73,11 +71,11 @@ public class ProjectController extends BaseController{
|
||||||
* 项目导出
|
* 项目导出
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/export")
|
@RequestMapping("/export")
|
||||||
public void export(@RequestParam(value = "keywords",required = false) String keywords, HttpServletResponse httpServletResponse) throws IOException {
|
public void export(@RequestParam(value = "keywords", required = false) String keywords, HttpServletResponse httpServletResponse) throws IOException {
|
||||||
Map<String, String> searchInfo = getSearchInfo(keywords);
|
Map<String, String> searchInfo = getSearchInfo(keywords);
|
||||||
downloadHeader(httpServletResponse , Utils.generateExcelName("项目报表"), "application/octet-stream");
|
downloadHeader(httpServletResponse, Utils.generateExcelName("项目报表"), "application/octet-stream");
|
||||||
String[] headers = {"项目名称","项目类型","项目状态","审核状态","当前审核人","项目创建者","部门名称","项目开始时间","项目结束时间","最后更新时间"};
|
String[] headers = {"项目名称", "项目类型", "项目状态", "审核状态", "当前审核人", "项目创建者", "部门名称", "项目开始时间", "项目结束时间", "最后更新时间"};
|
||||||
String[] exportColumns = {"name","typeDesc","statusDesc","approveStatusDesc","approveName","creatorName","deptName","startDate","endDate","lastUpdateTime"};
|
String[] exportColumns = {"name", "typeDesc", "statusDesc", "approveStatusDesc", "approveName", "creatorName", "deptName", "startDate", "endDate", "lastUpdateTime"};
|
||||||
ExportUtils.exportToExcel(headers, exportColumns, 1, 10000,
|
ExportUtils.exportToExcel(headers, exportColumns, 1, 10000,
|
||||||
httpServletResponse.getOutputStream(), (pN, pS) -> projectService.list(searchInfo, pN, pS).getList());
|
httpServletResponse.getOutputStream(), (pN, pS) -> projectService.list(searchInfo, pN, pS).getList());
|
||||||
}
|
}
|
||||||
|
@ -91,7 +89,7 @@ public class ProjectController extends BaseController{
|
||||||
|
|
||||||
//TODO 根据登录人的部门
|
//TODO 根据登录人的部门
|
||||||
Dept one = deptRepository.findOne(1);
|
Dept one = deptRepository.findOne(1);
|
||||||
model.put("dept",one);
|
model.put("dept", one);
|
||||||
|
|
||||||
return "admin/project_estimate_add";
|
return "admin/project_estimate_add";
|
||||||
}
|
}
|
||||||
|
@ -116,7 +114,7 @@ public class ProjectController extends BaseController{
|
||||||
|
|
||||||
|
|
||||||
@RequestMapping("/edit")
|
@RequestMapping("/edit")
|
||||||
public String edit(@RequestParam("id") int id,Map<String, Object> model) {
|
public String edit(@RequestParam("id") int id, Map<String, Object> model) {
|
||||||
Project project = projectService.getProject(id);
|
Project project = projectService.getProject(id);
|
||||||
model.put("project", project);
|
model.put("project", project);
|
||||||
EstimateBean estimateBean = projectEstimateService.getEstimate(project);
|
EstimateBean estimateBean = projectEstimateService.getEstimate(project);
|
||||||
|
@ -125,6 +123,7 @@ public class ProjectController extends BaseController{
|
||||||
model.put("Utils", FreeMarkerUtil.fromStaticPackage("cn.palmte.work.utils.Utils"));
|
model.put("Utils", FreeMarkerUtil.fromStaticPackage("cn.palmte.work.utils.Utils"));
|
||||||
return "admin/project_estimate_edit";
|
return "admin/project_estimate_edit";
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/estimateEditSave")
|
@RequestMapping("/estimateEditSave")
|
||||||
public String estimateEditSave(Project project, EstimateBean estimateBean, Map<String, Object> model) {
|
public String estimateEditSave(Project project, EstimateBean estimateBean, Map<String, Object> model) {
|
||||||
projectService.estimateEditSave(project, estimateBean, InterfaceUtil.getAdmin(), ApproveStatusEnum.APPROVAL_UNCOMMIT);
|
projectService.estimateEditSave(project, estimateBean, InterfaceUtil.getAdmin(), ApproveStatusEnum.APPROVAL_UNCOMMIT);
|
||||||
|
@ -141,7 +140,7 @@ public class ProjectController extends BaseController{
|
||||||
* 进项目预算页面
|
* 进项目预算页面
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/budgetEdit")
|
@RequestMapping("/budgetEdit")
|
||||||
public String budget(@RequestParam("id") int id,Map<String, Object> model) {
|
public String budget(@RequestParam("id") int id, Map<String, Object> model) {
|
||||||
Project project = projectService.getProject(id);
|
Project project = projectService.getProject(id);
|
||||||
model.put("project", project);
|
model.put("project", project);
|
||||||
BudgetBean budgetBean = projectBudgetService.getBudget(project);
|
BudgetBean budgetBean = projectBudgetService.getBudget(project);
|
||||||
|
@ -175,6 +174,7 @@ public class ProjectController extends BaseController{
|
||||||
projectService.budgetEditSave(project, budgetBean, InterfaceUtil.getAdmin(), ApproveStatusEnum.APPROVAL_UNCOMMIT);
|
projectService.budgetEditSave(project, budgetBean, InterfaceUtil.getAdmin(), ApproveStatusEnum.APPROVAL_UNCOMMIT);
|
||||||
return "redirect:/project/list";
|
return "redirect:/project/list";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 进行项目预算保存并提交审核
|
* 进行项目预算保存并提交审核
|
||||||
*/
|
*/
|
||||||
|
@ -204,6 +204,7 @@ public class ProjectController extends BaseController{
|
||||||
|
|
||||||
return ResponseMsg.buildSuccessMsg("成功");
|
return ResponseMsg.buildSuccessMsg("成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存成本明细
|
* 保存成本明细
|
||||||
*/
|
*/
|
||||||
|
@ -224,6 +225,7 @@ public class ProjectController extends BaseController{
|
||||||
|
|
||||||
return ResponseMsg.buildSuccessMsg("成功");
|
return ResponseMsg.buildSuccessMsg("成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存项目管理成本明细
|
* 保存项目管理成本明细
|
||||||
*/
|
*/
|
||||||
|
@ -244,6 +246,7 @@ public class ProjectController extends BaseController{
|
||||||
|
|
||||||
return ResponseMsg.buildSuccessMsg("成功");
|
return ResponseMsg.buildSuccessMsg("成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存项资金计划明细
|
* 保存项资金计划明细
|
||||||
*/
|
*/
|
||||||
|
@ -266,21 +269,19 @@ public class ProjectController extends BaseController{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 待我审核项目列表
|
* 待我审核项目列表
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/listApprove")
|
@RequestMapping("/listApprove")
|
||||||
public String listApprove(@RequestParam(value = "keywords",required = false) String keywords,
|
public String listApprove(@RequestParam(value = "keywords", required = false) String keywords,
|
||||||
@RequestParam(value = PAGE_NUMBER, defaultValue = DEFAULT_PAGE_NUMBER) int pageNumber,
|
@RequestParam(value = PAGE_NUMBER, defaultValue = DEFAULT_PAGE_NUMBER) int pageNumber,
|
||||||
@RequestParam(value = PAGE_SIZE, defaultValue = DEFAULT_PAGE_SIZE) int pageSize,
|
@RequestParam(value = PAGE_SIZE, defaultValue = DEFAULT_PAGE_SIZE) int pageSize,
|
||||||
Map<String, Object> model) {
|
Map<String, Object> model) {
|
||||||
//当前登录人的角色类型
|
//当前登录人的角色类型
|
||||||
model.put("keywords",keywords);
|
model.put("keywords", keywords);
|
||||||
model.put("deptList", deptRepository.findAll());
|
model.put("deptList", deptRepository.findAll());
|
||||||
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords,model);
|
ConcurrentHashMap<String, String> searchInfo = getSearchInfo(keywords, model);
|
||||||
model.put("pager",projectService.findMyApproveProjects(searchInfo,InterfaceUtil.getAdminId(),pageNumber,pageSize));
|
model.put("pager", projectService.findMyApproveProjects(searchInfo, InterfaceUtil.getAdminId(), pageNumber, pageSize));
|
||||||
return "admin/project_list_approve";
|
return "admin/project_list_approve";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,28 +289,92 @@ public class ProjectController extends BaseController{
|
||||||
* 待我审核项目导出
|
* 待我审核项目导出
|
||||||
*/
|
*/
|
||||||
@RequestMapping("/exportApprove")
|
@RequestMapping("/exportApprove")
|
||||||
public void exportApprove(@RequestParam(value = "keywords",required = false) String keywords, HttpServletResponse httpServletResponse) throws IOException {
|
public void exportApprove(@RequestParam(value = "keywords", required = false) String keywords, HttpServletResponse httpServletResponse) throws IOException {
|
||||||
Map<String, String> searchInfo = getSearchInfo(keywords);
|
Map<String, String> searchInfo = getSearchInfo(keywords);
|
||||||
downloadHeader(httpServletResponse , Utils.generateExcelName("待我审核项目报表"), "application/octet-stream");
|
downloadHeader(httpServletResponse, Utils.generateExcelName("待我审核项目报表"), "application/octet-stream");
|
||||||
String[] headers = {"项目名称","项目类型","项目状态","审核状态","当前审核人","项目创建者","部门名称","项目开始时间","项目结束时间","最后更新时间"};
|
String[] headers = {"项目名称", "项目类型", "项目状态", "审核状态", "当前审核人", "项目创建者", "部门名称", "项目开始时间", "项目结束时间", "最后更新时间"};
|
||||||
String[] exportColumns = {"name","typeDesc","statusDesc","approveStatusDesc","approveName","creatorName","deptName","startDate","endDate","lastUpdateTime"};
|
String[] exportColumns = {"name", "typeDesc", "statusDesc", "approveStatusDesc", "approveName", "creatorName", "deptName", "startDate", "endDate", "lastUpdateTime"};
|
||||||
ExportUtils.exportToExcel(headers, exportColumns, 1, 10000,
|
ExportUtils.exportToExcel(headers, exportColumns, 1, 10000,
|
||||||
httpServletResponse.getOutputStream(), (pN, pS) -> projectService.findMyApproveProjects(searchInfo, InterfaceUtil.getAdminId(), pN, pS).getList());
|
httpServletResponse.getOutputStream(), (pN, pS) -> projectService.findMyApproveProjects(searchInfo, InterfaceUtil.getAdminId(), pN, pS).getList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目查看页面
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @param model
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/detail")
|
||||||
|
public String detail(@RequestParam("id") int id, Map<String, Object> model) {
|
||||||
|
Project project = projectService.getProject(id);
|
||||||
|
EstimateBean estimateBean = projectEstimateService.getEstimate(project);
|
||||||
|
model.put("estimateBean", estimateBean);
|
||||||
|
model.put("project", project);
|
||||||
|
BudgetBean budgetBean = projectBudgetService.getBudget(project);
|
||||||
|
//预算主页面数据
|
||||||
|
model.put("budgetBean", budgetBean);
|
||||||
|
//收入明细
|
||||||
|
model.put("incomeDetails", projectBudgetService.getBudgetIncomeDetail(project));
|
||||||
|
//成本明细
|
||||||
|
model.put("costDetails", projectBudgetService.getBudgetCostDetail(project));
|
||||||
|
//项目管理成本明细
|
||||||
|
model.put("costProjectManageDetails", projectBudgetService.getBudgetCostProjectManageDetail(project));
|
||||||
|
List<ProjectBudgetPlanDetail> projectBudgetPlanDetails = projectBudgetService.getProjectBudgetPlanDetails(project);
|
||||||
|
//资金计划明细
|
||||||
|
model.put("projectBudgetPlanDetails", projectBudgetPlanDetails);
|
||||||
|
//资金计划总【上面汇总表】
|
||||||
|
model.put("projectBudgetPlanDetailTotal", projectBudgetService.getProjectBudgetPlanDetailTotal(project, projectBudgetPlanDetails));
|
||||||
|
//资金计划表中的统计信息【下面资金小表】
|
||||||
|
model.put("underwrittenPlanStatistic", projectBudgetService.getProjectUnderwrittenPlanStatisticBean(projectBudgetPlanDetails));
|
||||||
|
//现金表
|
||||||
|
model.put("cashFlowBean", projectBudgetService.getCashFlowBean(project, projectBudgetPlanDetails));
|
||||||
|
model.put("finalBean", new FinalBean());
|
||||||
|
//freemarker可以利用的静态方法
|
||||||
|
model.put("Utils", FreeMarkerUtil.fromStaticPackage("cn.palmte.work.utils.Utils"));
|
||||||
|
return "admin/project_detail";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 审核页面
|
||||||
|
* @param id
|
||||||
|
* @param model
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping("/approve")
|
||||||
|
public String approve(@RequestParam("id") int id, Map<String, Object> model) {
|
||||||
|
Project project = projectService.getProject(id);
|
||||||
|
EstimateBean estimateBean = projectEstimateService.getEstimate(project);
|
||||||
|
model.put("estimateBean", estimateBean);
|
||||||
|
model.put("project", project);
|
||||||
|
BudgetBean budgetBean = projectBudgetService.getBudget(project);
|
||||||
|
//预算主页面数据
|
||||||
|
model.put("budgetBean", budgetBean);
|
||||||
|
//收入明细
|
||||||
|
model.put("incomeDetails", projectBudgetService.getBudgetIncomeDetail(project));
|
||||||
|
//成本明细
|
||||||
|
model.put("costDetails", projectBudgetService.getBudgetCostDetail(project));
|
||||||
|
//项目管理成本明细
|
||||||
|
model.put("costProjectManageDetails", projectBudgetService.getBudgetCostProjectManageDetail(project));
|
||||||
|
List<ProjectBudgetPlanDetail> projectBudgetPlanDetails = projectBudgetService.getProjectBudgetPlanDetails(project);
|
||||||
|
//资金计划明细
|
||||||
|
model.put("projectBudgetPlanDetails", projectBudgetPlanDetails);
|
||||||
|
//资金计划总【上面汇总表】
|
||||||
|
model.put("projectBudgetPlanDetailTotal", projectBudgetService.getProjectBudgetPlanDetailTotal(project, projectBudgetPlanDetails));
|
||||||
|
//资金计划表中的统计信息【下面资金小表】
|
||||||
|
model.put("underwrittenPlanStatistic", projectBudgetService.getProjectUnderwrittenPlanStatisticBean(projectBudgetPlanDetails));
|
||||||
|
//现金表
|
||||||
|
model.put("cashFlowBean", projectBudgetService.getCashFlowBean(project, projectBudgetPlanDetails));
|
||||||
|
model.put("finalBean", new FinalBean());
|
||||||
|
//freemarker可以利用的静态方法
|
||||||
|
model.put("Utils", FreeMarkerUtil.fromStaticPackage("cn.palmte.work.utils.Utils"));
|
||||||
|
return "admin/project_approve";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@InitBinder
|
@InitBinder
|
||||||
public void initBinder(WebDataBinder webDataBinder){
|
public void initBinder(WebDataBinder webDataBinder) {
|
||||||
webDataBinder.addCustomFormatter(new DateFormatter("yyyy-MM-dd"));
|
webDataBinder.addCustomFormatter(new DateFormatter("yyyy-MM-dd"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -219,6 +219,16 @@
|
||||||
onclick="location.href='${base}/project/final/edit?id=${list.id}'"><span
|
onclick="location.href='${base}/project/final/edit?id=${list.id}'"><span
|
||||||
class="am-icon-pencil-square-o"></span>发起决算
|
class="am-icon-pencil-square-o"></span>发起决算
|
||||||
</button>
|
</button>
|
||||||
|
<button type="button"
|
||||||
|
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
||||||
|
onclick="location.href='${base}/project/detail?id=${list.id}'"><span
|
||||||
|
class="am-icon-pencil-square-o"></span>查看
|
||||||
|
</button>
|
||||||
|
<button type="button"
|
||||||
|
class="am-btn am-btn-default am-btn-xs am-text-secondary"
|
||||||
|
onclick="location.href='${base}/project/approve?id=${list.id}'"><span
|
||||||
|
class="am-icon-pencil-square-o"></span>审核
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
Loading…
Reference in New Issue