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