From ef3ea72c22e5f007a3793aabb6847c37ed1c3e8a Mon Sep 17 00:00:00 2001
From: hhb <839062268@qq.com>
Date: Tue, 7 Nov 2023 00:50:51 +0800
Subject: [PATCH] =?UTF-8?q?=E7=A7=91=E7=A0=94=E9=A1=B9=E7=9B=AE=20?=
=?UTF-8?q?=E7=94=A8=E6=88=B7=E9=93=B6=E8=A1=8C=20=E5=8A=B3=E5=8A=A1?=
=?UTF-8?q?=E8=B4=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../main/resources/template/front/index.ftl | 6 +-
.../modules/system/domain/Project.java | 87 +++++++++++
.../modules/system/domain/ServiceFee.java | 101 +++++++++++++
.../zhengjie/modules/system/domain/User.java | 5 +
.../modules/system/domain/UserBank.java | 1 +
.../system/repository/ProjectRepository.java | 27 ++++
.../repository/ServiceFeeRepository.java | 27 ++++
.../system/repository/UserBankRepository.java | 3 +-
.../system/rest/ProjectController.java | 89 +++++++++++
.../system/rest/ServiceFeeController.java | 89 +++++++++++
.../modules/system/rest/UserController.java | 7 +
.../system/service/ProjectService.java | 82 ++++++++++
.../system/service/ServiceFeeService.java | 82 ++++++++++
.../system/service/dto/ProjectDto.java | 62 ++++++++
.../service/dto/ProjectQueryCriteria.java | 28 ++++
.../system/service/dto/ServiceFeeDto.java | 74 +++++++++
.../service/dto/ServiceFeeQueryCriteria.java | 28 ++++
.../system/service/dto/UserBankSmallDto.java | 58 ++++++++
.../modules/system/service/dto/UserDto.java | 2 +
.../service/impl/ProjectServiceImpl.java | 112 ++++++++++++++
.../service/impl/ServiceFeeServiceImpl.java | 116 +++++++++++++++
.../service/impl/UserBankServiceImpl.java | 10 +-
.../service/mapstruct/ProjectMapper.java | 31 ++++
.../service/mapstruct/ServiceFeeMapper.java | 31 ++++
.../mapstruct/UserBankSmallMapper.java | 33 +++++
eladmin-web/src/api/system/project.js | 27 ++++
eladmin-web/src/api/system/serviceFee.js | 27 ++++
eladmin-web/src/api/system/user.js | 8 +
.../src/views/system/project/index.vue | 132 +++++++++++++++++
.../src/views/system/reimburse/index.vue | 8 +-
.../src/views/system/service_fee/index.vue | 140 ++++++++++++++++++
.../src/views/system/user/user-select.vue | 54 +++++++
32 files changed, 1579 insertions(+), 8 deletions(-)
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Project.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/domain/ServiceFee.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/repository/ProjectRepository.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/repository/ServiceFeeRepository.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/rest/ProjectController.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/rest/ServiceFeeController.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/service/ProjectService.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/service/ServiceFeeService.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/ProjectDto.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/ProjectQueryCriteria.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/ServiceFeeDto.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/ServiceFeeQueryCriteria.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserBankSmallDto.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/ProjectServiceImpl.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/ServiceFeeServiceImpl.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/ProjectMapper.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/ServiceFeeMapper.java
create mode 100644 eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserBankSmallMapper.java
create mode 100644 eladmin-web/src/api/system/project.js
create mode 100644 eladmin-web/src/api/system/serviceFee.js
create mode 100644 eladmin-web/src/views/system/project/index.vue
create mode 100644 eladmin-web/src/views/system/service_fee/index.vue
create mode 100644 eladmin-web/src/views/system/user/user-select.vue
diff --git a/eladmin-generator/src/main/resources/template/front/index.ftl b/eladmin-generator/src/main/resources/template/front/index.ftl
index 9b7084c..2a7fd9a 100644
--- a/eladmin-generator/src/main/resources/template/front/index.ftl
+++ b/eladmin-generator/src/main/resources/template/front/index.ftl
@@ -39,9 +39,9 @@
<#if column.formShow>
prop="${column.changeColumnName}"#if>>
<#if column.formType = 'Input'>
-
+
<#elseif column.formType = 'Textarea'>
-
+
<#elseif column.formType = 'Radio'>
<#if (column.dictName)?? && (column.dictName)!="">
{{ item.label }}
@@ -61,7 +61,7 @@
未设置字典,请手动设置 Select
#if>
<#else>
-
+
#if>
#if>
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Project.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Project.java
new file mode 100644
index 0000000..a04ff96
--- /dev/null
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/Project.java
@@ -0,0 +1,87 @@
+/*
+* Copyright 2019-2020 Zheng Jie
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package me.zhengjie.modules.system.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import io.swagger.annotations.ApiModelProperty;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import javax.validation.constraints.*;
+import java.math.BigDecimal;
+import java.sql.Timestamp;
+import java.io.Serializable;
+
+/**
+* @website https://eladmin.vip
+* @description /
+* @author author
+**/
+@Entity
+@Data
+@Table(name="project")
+public class Project implements Serializable {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "`project_id`")
+ @ApiModelProperty(value = "ID")
+ private Long projectId;
+
+ @Column(name = "`project_no`",nullable = false)
+ @NotBlank
+ @ApiModelProperty(value = "科研项目编号")
+ private String projectNo;
+
+ @Column(name = "`project_name`",nullable = false)
+ @NotBlank
+ @ApiModelProperty(value = "科研项目名称")
+ private String projectName;
+
+ @Column(name = "`project_fee`",nullable = false)
+ @NotBlank
+ @ApiModelProperty(value = "项目预算")
+ private BigDecimal projectFee;
+
+ @ManyToOne
+ @JoinColumn(name = "project_user_id")
+ @ApiModelProperty(value = "项目负责人")
+ private User projectUser;
+
+ @Column(name = "`remark`")
+ @ApiModelProperty(value = "备注")
+ private String remark;
+
+ @Column(name = "`create_by`")
+ @ApiModelProperty(value = "创建者")
+ private String createBy;
+
+ @Column(name = "`update_by`")
+ @ApiModelProperty(value = "更新者")
+ private String updateBy;
+
+ @Column(name = "`create_time`")
+ @ApiModelProperty(value = "创建日期")
+ private Timestamp createTime;
+
+ @Column(name = "`update_time`")
+ @ApiModelProperty(value = "更新时间")
+ private Timestamp updateTime;
+
+ public void copy(Project source){
+ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+ }
+}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/ServiceFee.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/ServiceFee.java
new file mode 100644
index 0000000..5eac576
--- /dev/null
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/ServiceFee.java
@@ -0,0 +1,101 @@
+/*
+* Copyright 2019-2020 Zheng Jie
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package me.zhengjie.modules.system.domain;
+
+import lombok.Data;
+import cn.hutool.core.bean.BeanUtil;
+import io.swagger.annotations.ApiModelProperty;
+import cn.hutool.core.bean.copier.CopyOptions;
+import javax.persistence.*;
+import javax.validation.constraints.*;
+import java.sql.Timestamp;
+import java.math.BigDecimal;
+import java.io.Serializable;
+
+/**
+* @website https://eladmin.vip
+* @description /
+* @author author
+**/
+@Entity
+@Data
+@Table(name="service_fee")
+public class ServiceFee implements Serializable {
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "`service_fee_id`")
+ @ApiModelProperty(value = "ID")
+ private Long serviceFeeId;
+
+ @ManyToOne
+ @JoinColumn(name = "user_id")
+ @ApiModelProperty(value = "劳务人")
+ private User user;
+
+ @Column(name = "`payable_fee`")
+ @ApiModelProperty(value = "应发金额")
+ private BigDecimal payableFee;
+
+ @Column(name = "`tax`")
+ @ApiModelProperty(value = "个人所得税")
+ private BigDecimal tax;
+
+ @Column(name = "`paid_fee`")
+ @ApiModelProperty(value = "实发金额")
+ private BigDecimal paidFee;
+
+ @Column(name = "`fee_source`")
+ @ApiModelProperty(value = "资金来源")
+ private String feeSource;
+
+ @ManyToOne
+ @JoinColumn(name = "approve_user_id")
+ @ApiModelProperty(value = "审批人")
+ private User approveUser;
+
+ @Column(name = "`service_time`")
+ @ApiModelProperty(value = "劳务时间")
+ private Timestamp serviceTime;
+
+ @Column(name = "`apply_time`")
+ @ApiModelProperty(value = "申请时间")
+ private Timestamp applyTime;
+
+ @Column(name = "`remark`")
+ @ApiModelProperty(value = "备注")
+ private String remark;
+
+ @Column(name = "`create_by`")
+ @ApiModelProperty(value = "创建者")
+ private String createBy;
+
+ @Column(name = "`update_by`")
+ @ApiModelProperty(value = "更新者")
+ private String updateBy;
+
+ @Column(name = "`create_time`")
+ @ApiModelProperty(value = "创建日期")
+ private Timestamp createTime;
+
+ @Column(name = "`update_time`")
+ @ApiModelProperty(value = "更新时间")
+ private Timestamp updateTime;
+
+ public void copy(ServiceFee source){
+ BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
+ }
+}
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/User.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/User.java
index 357836a..11b64ba 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/User.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/User.java
@@ -59,6 +59,11 @@ public class User extends BaseEntity implements Serializable {
inverseJoinColumns = {@JoinColumn(name = "job_id",referencedColumnName = "job_id")})
private Set jobs;
+ @OrderBy("bankUse asc ")
+ @OneToMany(fetch = FetchType.EAGER,mappedBy = "user")
+ @ApiModelProperty(value = "用户银行卡")
+ private Set userBanks;
+
@OneToOne
@JoinColumn(name = "dept_id")
@ApiModelProperty(value = "用户部门")
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/UserBank.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/UserBank.java
index 06bf995..77500f7 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/UserBank.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/UserBank.java
@@ -20,6 +20,7 @@ import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import me.zhengjie.base.BaseEntity;
+import org.springframework.data.web.SortDefault;
import javax.persistence.*;
import javax.validation.constraints.*;
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/ProjectRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/ProjectRepository.java
new file mode 100644
index 0000000..c4efaa2
--- /dev/null
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/ProjectRepository.java
@@ -0,0 +1,27 @@
+/*
+* Copyright 2019-2020 Zheng Jie
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package me.zhengjie.modules.system.repository;
+
+import me.zhengjie.modules.system.domain.Project;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+/**
+* @website https://eladmin.vip
+* @author author
+**/
+public interface ProjectRepository extends JpaRepository, JpaSpecificationExecutor {
+}
\ No newline at end of file
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/ServiceFeeRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/ServiceFeeRepository.java
new file mode 100644
index 0000000..840c497
--- /dev/null
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/ServiceFeeRepository.java
@@ -0,0 +1,27 @@
+/*
+* Copyright 2019-2020 Zheng Jie
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package me.zhengjie.modules.system.repository;
+
+import me.zhengjie.modules.system.domain.ServiceFee;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
+
+/**
+* @website https://eladmin.vip
+* @author author
+**/
+public interface ServiceFeeRepository extends JpaRepository, JpaSpecificationExecutor {
+}
\ No newline at end of file
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserBankRepository.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserBankRepository.java
index 4eb7a17..7b02454 100644
--- a/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserBankRepository.java
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/UserBankRepository.java
@@ -21,6 +21,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import java.util.List;
+import java.util.Optional;
/**
* @website https://eladmin.vip
@@ -29,5 +30,5 @@ import java.util.List;
**/
public interface UserBankRepository extends JpaRepository, JpaSpecificationExecutor {
- UserBank findByBankUseAndUser(String bankUse, User user);
+ Optional findByBankUseAndUser(String bankUse, User user);
}
\ No newline at end of file
diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/ProjectController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/ProjectController.java
new file mode 100644
index 0000000..cde3c96
--- /dev/null
+++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/ProjectController.java
@@ -0,0 +1,89 @@
+/*
+* Copyright 2019-2020 Zheng Jie
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+package me.zhengjie.modules.system.rest;
+
+import me.zhengjie.annotation.Log;
+import me.zhengjie.modules.system.domain.Project;
+import me.zhengjie.modules.system.service.ProjectService;
+import me.zhengjie.modules.system.service.dto.ProjectQueryCriteria;
+import org.springframework.data.domain.Pageable;
+import lombok.RequiredArgsConstructor;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import io.swagger.annotations.*;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+import me.zhengjie.utils.PageResult;
+import me.zhengjie.modules.system.service.dto.ProjectDto;
+
+/**
+* @website https://eladmin.vip
+* @author author
+**/
+@RestController
+@RequiredArgsConstructor
+@Api(tags = "科研信息管理")
+@RequestMapping("/api/project")
+public class ProjectController {
+
+ private final ProjectService projectService;
+
+ @Log("导出数据")
+ @ApiOperation("导出数据")
+ @GetMapping(value = "/download")
+ @PreAuthorize("@el.check('project:list')")
+ public void exportProject(HttpServletResponse response, ProjectQueryCriteria criteria) throws IOException {
+ projectService.download(projectService.queryAll(criteria), response);
+ }
+
+ @GetMapping
+ @Log("查询科研信息")
+ @ApiOperation("查询科研信息")
+ @PreAuthorize("@el.check('project:list')")
+ public ResponseEntity> queryProject(ProjectQueryCriteria criteria, Pageable pageable){
+ return new ResponseEntity<>(projectService.queryAll(criteria,pageable),HttpStatus.OK);
+ }
+
+ @PostMapping
+ @Log("新增科研信息")
+ @ApiOperation("新增科研信息")
+ @PreAuthorize("@el.check('project:add')")
+ public ResponseEntity