diff --git a/src/main/java/cn/palmte/work/controller/backend/ProcessController.java b/src/main/java/cn/palmte/work/controller/backend/ProcessController.java new file mode 100644 index 0000000..bac191e --- /dev/null +++ b/src/main/java/cn/palmte/work/controller/backend/ProcessController.java @@ -0,0 +1,76 @@ +package cn.palmte.work.controller.backend; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import cn.palmte.work.model.Project; +import cn.palmte.work.model.ProjectRepository; + +/** + * @author Harry Yang + * @since 1.0 2022/12/8 11:03 + */ +@Controller +@RequestMapping("/process") +public class ProcessController { + + private final ProjectRepository projectRepository; + + public ProcessController(ProjectRepository projectRepository) { + this.projectRepository = projectRepository; + } + + /** + * 新建流程 + */ + @GetMapping("/new") + public String newProcess() { + return "/admin/business/process-new"; + } + + /** + * 已办流程 + */ + @GetMapping("/completed") + public String completed() { + return "/admin/business/process-completed"; + } + + /** + * 待我审核 + */ + @GetMapping("/review") + public String review() { + return "/admin/business/process-review"; + } + + @ResponseBody + @GetMapping("/projects") + public List> query(@RequestParam String q) { + return projectRepository.findByProjectNoOrName(q) + .stream() + .map(project -> { + HashMap map = new HashMap<>(); + map.put("id", project.getId()); + map.put("name", project.getName()); + return map; + }) + .collect(Collectors.toList()); + } + + @ResponseBody + @GetMapping("/projects/{id}") + public Project query(@PathVariable int id) { + return projectRepository.findById(id); + } + +} diff --git a/src/main/java/cn/palmte/work/model/ProjectRepository.java b/src/main/java/cn/palmte/work/model/ProjectRepository.java index 7d359e2..76e21a4 100644 --- a/src/main/java/cn/palmte/work/model/ProjectRepository.java +++ b/src/main/java/cn/palmte/work/model/ProjectRepository.java @@ -3,6 +3,7 @@ package cn.palmte.work.model; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Modifying; import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; import javax.transaction.Transactional; import java.util.Date; @@ -38,4 +39,9 @@ public interface ProjectRepository extends JpaRepository { @Transactional(rollbackOn = Exception.class) @Query(value = "update project set approve_id=?, approve_name=? where approve_id = ?", nativeQuery = true) int batchUpdateApprove(int targetAdminId, String targetAdminName, int adminId); + + @Query(value = "select * from project where `project_no` like concat('%', :q, '%') or `name` like concat('%', :q, '%')", + nativeQuery = true) + List findByProjectNoOrName(@Param("q") String query); + } diff --git a/src/main/resources/static/assets/process/业务采购流程@2x.png b/src/main/resources/static/assets/process/业务采购流程@2x.png new file mode 100644 index 0000000..32ec71c Binary files /dev/null and b/src/main/resources/static/assets/process/业务采购流程@2x.png differ diff --git a/src/main/resources/static/assets/process/业务采购流程@3x.png b/src/main/resources/static/assets/process/业务采购流程@3x.png new file mode 100644 index 0000000..a17a35b Binary files /dev/null and b/src/main/resources/static/assets/process/业务采购流程@3x.png differ diff --git a/src/main/resources/static/assets/process/销售合同流程@2x.png b/src/main/resources/static/assets/process/销售合同流程@2x.png new file mode 100644 index 0000000..1899213 Binary files /dev/null and b/src/main/resources/static/assets/process/销售合同流程@2x.png differ diff --git a/src/main/resources/static/assets/process/销售合同流程@3x.png b/src/main/resources/static/assets/process/销售合同流程@3x.png new file mode 100644 index 0000000..2ab1d02 Binary files /dev/null and b/src/main/resources/static/assets/process/销售合同流程@3x.png differ diff --git a/src/main/resources/templates/admin/business/process-completed.ftl b/src/main/resources/templates/admin/business/process-completed.ftl new file mode 100644 index 0000000..f82c5c9 --- /dev/null +++ b/src/main/resources/templates/admin/business/process-completed.ftl @@ -0,0 +1,44 @@ +<#assign base=request.contextPath /> +<#import "../../common/defaultLayout.ftl" as defaultLayout> +<@defaultLayout.layout> + + +
{{ message }}
+ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/templates/admin/business/process-new.ftl b/src/main/resources/templates/admin/business/process-new.ftl new file mode 100644 index 0000000..fef3f9d --- /dev/null +++ b/src/main/resources/templates/admin/business/process-new.ftl @@ -0,0 +1,669 @@ +<#assign base=request.contextPath /> +<#import "../../common/defaultLayout.ftl" as defaultLayout> +<@defaultLayout.layout> +<#-- --> + + + +
+
+
+
业务应用 / + {{subTitle}}
+
+ +
+
+ + + +
+ + <#-- 业务采购流程 --> +
+
+
项目编号
+
+ +
+ +
+
+ + <#-- 选择 业务采购清单明细 --> + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + <#-- 新增销售合同流程 --> + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + +
+ +
+ + + + + + + +
+ +
+ + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + +
+ +
+ + + +
+ +
+ + + 点击上传 +
只能上传PDF、excel、word、图片、压缩包,且不超过50MB
+
+
+
+ +
+ + 详细清单 + +
+ +
+ +
+ + <#-- 新增业务采购合同流程 --> + +
+
+
+ +
+ + + + +
+ +
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ +
+ +
+ + + + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/resources/templates/admin/business/process-review.ftl b/src/main/resources/templates/admin/business/process-review.ftl new file mode 100644 index 0000000..f82c5c9 --- /dev/null +++ b/src/main/resources/templates/admin/business/process-review.ftl @@ -0,0 +1,44 @@ +<#assign base=request.contextPath /> +<#import "../../common/defaultLayout.ftl" as defaultLayout> +<@defaultLayout.layout> + + +
{{ message }}
+ + + + + + + + + + + + + + + + + + + + + +