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 column.formType = 'Input'> - + <#elseif column.formType = 'Textarea'> - + <#elseif column.formType = 'Radio'> <#if (column.dictName)?? && (column.dictName)!=""> {{ item.label }} @@ -61,7 +61,7 @@ 未设置字典,请手动设置 Select <#else> - + 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 createProject(@Validated @RequestBody Project resources){ + projectService.create(resources); + return new ResponseEntity<>(HttpStatus.CREATED); + } + + @PutMapping + @Log("修改科研信息") + @ApiOperation("修改科研信息") + @PreAuthorize("@el.check('project:edit')") + public ResponseEntity updateProject(@Validated @RequestBody Project resources){ + projectService.update(resources); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @DeleteMapping + @Log("删除科研信息") + @ApiOperation("删除科研信息") + @PreAuthorize("@el.check('project:del')") + public ResponseEntity deleteProject(@RequestBody Long[] ids) { + projectService.deleteAll(ids); + return new ResponseEntity<>(HttpStatus.OK); + } +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/ServiceFeeController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/ServiceFeeController.java new file mode 100644 index 0000000..b13ed82 --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/ServiceFeeController.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.ServiceFee; +import me.zhengjie.modules.system.service.ServiceFeeService; +import me.zhengjie.modules.system.service.dto.ServiceFeeQueryCriteria; +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.ServiceFeeDto; + +/** +* @website https://eladmin.vip +* @author author +**/ +@RestController +@RequiredArgsConstructor +@Api(tags = "劳务费管理") +@RequestMapping("/api/serviceFee") +public class ServiceFeeController { + + private final ServiceFeeService serviceFeeService; + + @Log("导出数据") + @ApiOperation("导出数据") + @GetMapping(value = "/download") + @PreAuthorize("@el.check('serviceFee:list')") + public void exportServiceFee(HttpServletResponse response, ServiceFeeQueryCriteria criteria) throws IOException { + serviceFeeService.download(serviceFeeService.queryAll(criteria), response); + } + + @GetMapping + @Log("查询劳务费") + @ApiOperation("查询劳务费") + @PreAuthorize("@el.check('serviceFee:list')") + public ResponseEntity> queryServiceFee(ServiceFeeQueryCriteria criteria, Pageable pageable){ + return new ResponseEntity<>(serviceFeeService.queryAll(criteria,pageable),HttpStatus.OK); + } + + @PostMapping + @Log("新增劳务费") + @ApiOperation("新增劳务费") + @PreAuthorize("@el.check('serviceFee:add')") + public ResponseEntity createServiceFee(@Validated @RequestBody ServiceFee resources){ + serviceFeeService.create(resources); + return new ResponseEntity<>(HttpStatus.CREATED); + } + + @PutMapping + @Log("修改劳务费") + @ApiOperation("修改劳务费") + @PreAuthorize("@el.check('serviceFee:edit')") + public ResponseEntity updateServiceFee(@Validated @RequestBody ServiceFee resources){ + serviceFeeService.update(resources); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @DeleteMapping + @Log("删除劳务费") + @ApiOperation("删除劳务费") + @PreAuthorize("@el.check('serviceFee:del')") + public ResponseEntity deleteServiceFee(@RequestBody Long[] ids) { + serviceFeeService.deleteAll(ids); + return new ResponseEntity<>(HttpStatus.OK); + } +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java index f75b8bb..04e39bc 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java @@ -75,6 +75,13 @@ public class UserController { userService.download(userService.queryAll(criteria), response); } + @ApiOperation("导出用户数据") + @GetMapping(value = "/list") + @PreAuthorize("@el.check('user:list')") + public ResponseEntity> getUserList(UserQueryCriteria criteria) throws IOException { + return ResponseEntity.ok(userService.queryAll(criteria)); + } + @ApiOperation("查询用户") @GetMapping @PreAuthorize("@el.check('user:list')") diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/ProjectService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/ProjectService.java new file mode 100644 index 0000000..21678dd --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/ProjectService.java @@ -0,0 +1,82 @@ +/* +* 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.service; + +import me.zhengjie.modules.system.domain.Project; +import me.zhengjie.modules.system.service.dto.ProjectDto; +import me.zhengjie.modules.system.service.dto.ProjectQueryCriteria; +import org.springframework.data.domain.Pageable; +import java.util.Map; +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import me.zhengjie.utils.PageResult; + +/** +* @website https://eladmin.vip +* @description 服务接口 +* @author author +**/ +public interface ProjectService { + + /** + * 查询数据分页 + * @param criteria 条件 + * @param pageable 分页参数 + * @return Map + */ + PageResult queryAll(ProjectQueryCriteria criteria, Pageable pageable); + + /** + * 查询所有数据不分页 + * @param criteria 条件参数 + * @return List + */ + List queryAll(ProjectQueryCriteria criteria); + + /** + * 根据ID查询 + * @param projectId ID + * @return ProjectDto + */ + ProjectDto findById(Long projectId); + + /** + * 创建 + * @param resources / + */ + void create(Project resources); + + /** + * 编辑 + * @param resources / + */ + void update(Project resources); + + /** + * 多选删除 + * @param ids / + */ + void deleteAll(Long[] ids); + + /** + * 导出数据 + * @param all 待导出的数据 + * @param response / + * @throws IOException / + */ + void download(List all, HttpServletResponse response) throws IOException; +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/ServiceFeeService.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/ServiceFeeService.java new file mode 100644 index 0000000..7cc2f6b --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/ServiceFeeService.java @@ -0,0 +1,82 @@ +/* +* 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.service; + +import me.zhengjie.modules.system.domain.ServiceFee; +import me.zhengjie.modules.system.service.dto.ServiceFeeDto; +import me.zhengjie.modules.system.service.dto.ServiceFeeQueryCriteria; +import org.springframework.data.domain.Pageable; +import java.util.Map; +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import me.zhengjie.utils.PageResult; + +/** +* @website https://eladmin.vip +* @description 服务接口 +* @author author +**/ +public interface ServiceFeeService { + + /** + * 查询数据分页 + * @param criteria 条件 + * @param pageable 分页参数 + * @return Map + */ + PageResult queryAll(ServiceFeeQueryCriteria criteria, Pageable pageable); + + /** + * 查询所有数据不分页 + * @param criteria 条件参数 + * @return List + */ + List queryAll(ServiceFeeQueryCriteria criteria); + + /** + * 根据ID查询 + * @param serviceFeeId ID + * @return ServiceFeeDto + */ + ServiceFeeDto findById(Long serviceFeeId); + + /** + * 创建 + * @param resources / + */ + void create(ServiceFee resources); + + /** + * 编辑 + * @param resources / + */ + void update(ServiceFee resources); + + /** + * 多选删除 + * @param ids / + */ + void deleteAll(Long[] ids); + + /** + * 导出数据 + * @param all 待导出的数据 + * @param response / + * @throws IOException / + */ + void download(List all, HttpServletResponse response) throws IOException; +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/ProjectDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/ProjectDto.java new file mode 100644 index 0000000..102681e --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/ProjectDto.java @@ -0,0 +1,62 @@ +/* +* 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.service.dto; + +import lombok.Data; + +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.io.Serializable; + +/** +* @website https://eladmin.vip +* @description / +* @author author +**/ +@Data +public class ProjectDto implements Serializable { + + /** ID */ + private Long projectId; + + /** 科研项目编号 */ + private String projectNo; + + /** 科研项目名称 */ + private String projectName; + + /** 项目预算 */ + private BigDecimal projectFee; + + /** 项目负责人 */ +// private Long projectUserId; + private UserDto projectUser; + + /** 备注 */ + private String remark; + + /** 创建者 */ + private String createBy; + + /** 更新者 */ + private String updateBy; + + /** 创建日期 */ + private Timestamp createTime; + + /** 更新时间 */ + private Timestamp updateTime; +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/ProjectQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/ProjectQueryCriteria.java new file mode 100644 index 0000000..668927b --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/ProjectQueryCriteria.java @@ -0,0 +1,28 @@ +/* +* 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.service.dto; + +import lombok.Data; +import java.util.List; +import me.zhengjie.annotation.Query; + +/** +* @website https://eladmin.vip +* @author author +**/ +@Data +public class ProjectQueryCriteria{ +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/ServiceFeeDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/ServiceFeeDto.java new file mode 100644 index 0000000..a16a38a --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/ServiceFeeDto.java @@ -0,0 +1,74 @@ +/* +* 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.service.dto; + +import lombok.Data; +import me.zhengjie.modules.system.domain.User; + +import java.sql.Timestamp; +import java.math.BigDecimal; +import java.io.Serializable; + +/** +* @website https://eladmin.vip +* @description / +* @author author +**/ +@Data +public class ServiceFeeDto implements Serializable { + + /** ID */ + private Long serviceFeeId; + + /** 劳务人 */ + private User user; + + /** 应发金额 */ + private BigDecimal payableFee; + + /** 个人所得税 */ + private BigDecimal tax; + + /** 实发金额 */ + private BigDecimal paidFee; + + /** 资金来源 */ + private String feeSource; + + /** 审批人 */ + private User approveUser; + + /** 劳务时间 */ + private Timestamp serviceTime; + + /** 申请时间 */ + private Timestamp applyTime; + + /** 备注 */ + private String remark; + + /** 创建者 */ + private String createBy; + + /** 更新者 */ + private String updateBy; + + /** 创建日期 */ + private Timestamp createTime; + + /** 更新时间 */ + private Timestamp updateTime; +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/ServiceFeeQueryCriteria.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/ServiceFeeQueryCriteria.java new file mode 100644 index 0000000..273133d --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/ServiceFeeQueryCriteria.java @@ -0,0 +1,28 @@ +/* +* 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.service.dto; + +import lombok.Data; +import java.util.List; +import me.zhengjie.annotation.Query; + +/** +* @website https://eladmin.vip +* @author author +**/ +@Data +public class ServiceFeeQueryCriteria{ +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserBankSmallDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserBankSmallDto.java new file mode 100644 index 0000000..5a5821b --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserBankSmallDto.java @@ -0,0 +1,58 @@ +/* +* 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.service.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.sql.Timestamp; + +/** +* @website https://eladmin.vip +* @description / +* @author author +* @date 2023-10-31 +**/ +@Data +public class UserBankSmallDto implements Serializable { + + /** ID */ + private Long bankId; + + /** 银行卡号 */ + private String bankNo; + + /** 银行卡所属支行 */ + private String bankName; + + /** 是否常用账号 */ + private String bankUse; + + /** 备注 */ + private String remark; + + /** 创建者 */ + private String createBy; + + /** 更新者 */ + private String updateBy; + + /** 创建日期 */ + private Timestamp createTime; + + /** 更新时间 */ + private Timestamp updateTime; +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java index d8a0173..8073831 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserDto.java @@ -37,6 +37,8 @@ public class UserDto extends BaseDTO implements Serializable { private Set jobs; + private Set userBanks; + private DeptSmallDto dept; private Long deptId; diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/ProjectServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/ProjectServiceImpl.java new file mode 100644 index 0000000..12162b3 --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/ProjectServiceImpl.java @@ -0,0 +1,112 @@ +/* +* 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.service.impl; + +import me.zhengjie.modules.system.domain.Project; +import me.zhengjie.utils.ValidationUtil; +import me.zhengjie.utils.FileUtil; +import lombok.RequiredArgsConstructor; +import me.zhengjie.modules.system.repository.ProjectRepository; +import me.zhengjie.modules.system.service.ProjectService; +import me.zhengjie.modules.system.service.dto.ProjectDto; +import me.zhengjie.modules.system.service.dto.ProjectQueryCriteria; +import me.zhengjie.modules.system.service.mapstruct.ProjectMapper; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import me.zhengjie.utils.PageUtil; +import me.zhengjie.utils.QueryHelp; +import java.util.List; +import java.util.Map; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import me.zhengjie.utils.PageResult; + +/** +* @website https://eladmin.vip +* @description 服务实现 +* @author author +**/ +@Service +@RequiredArgsConstructor +public class ProjectServiceImpl implements ProjectService { + + private final ProjectRepository projectRepository; + private final ProjectMapper projectMapper; + + @Override + public PageResult queryAll(ProjectQueryCriteria criteria, Pageable pageable){ + Page page = projectRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(projectMapper::toDto)); + } + + @Override + public List queryAll(ProjectQueryCriteria criteria){ + return projectMapper.toDto(projectRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + @Transactional + public ProjectDto findById(Long projectId) { + Project project = projectRepository.findById(projectId).orElseGet(Project::new); + ValidationUtil.isNull(project.getProjectId(),"Project","projectId",projectId); + return projectMapper.toDto(project); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void create(Project resources) { + projectRepository.save(resources); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(Project resources) { + Project project = projectRepository.findById(resources.getProjectId()).orElseGet(Project::new); + ValidationUtil.isNull( project.getProjectId(),"Project","id",resources.getProjectId()); + project.copy(resources); + projectRepository.save(project); + } + + @Override + public void deleteAll(Long[] ids) { + for (Long projectId : ids) { + projectRepository.deleteById(projectId); + } + } + + @Override + public void download(List all, HttpServletResponse response) throws IOException { + List> list = new ArrayList<>(); + for (ProjectDto project : all) { + Map map = new LinkedHashMap<>(); + map.put("科研项目编号", project.getProjectNo()); + map.put("科研项目名称", project.getProjectName()); + map.put("项目预算", project.getProjectFee()); + map.put("项目负责人", project.getProjectUser().getNickName()); + map.put("备注", project.getRemark()); + map.put("创建者", project.getCreateBy()); + map.put("更新者", project.getUpdateBy()); + map.put("创建日期", project.getCreateTime()); + map.put("更新时间", project.getUpdateTime()); + list.add(map); + } + FileUtil.downloadExcel(list, response); + } +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/ServiceFeeServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/ServiceFeeServiceImpl.java new file mode 100644 index 0000000..bcfb788 --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/ServiceFeeServiceImpl.java @@ -0,0 +1,116 @@ +/* +* 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.service.impl; + +import me.zhengjie.modules.system.domain.ServiceFee; +import me.zhengjie.utils.ValidationUtil; +import me.zhengjie.utils.FileUtil; +import lombok.RequiredArgsConstructor; +import me.zhengjie.modules.system.repository.ServiceFeeRepository; +import me.zhengjie.modules.system.service.ServiceFeeService; +import me.zhengjie.modules.system.service.dto.ServiceFeeDto; +import me.zhengjie.modules.system.service.dto.ServiceFeeQueryCriteria; +import me.zhengjie.modules.system.service.mapstruct.ServiceFeeMapper; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import me.zhengjie.utils.PageUtil; +import me.zhengjie.utils.QueryHelp; +import java.util.List; +import java.util.Map; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import me.zhengjie.utils.PageResult; + +/** +* @website https://eladmin.vip +* @description 服务实现 +* @author author +**/ +@Service +@RequiredArgsConstructor +public class ServiceFeeServiceImpl implements ServiceFeeService { + + private final ServiceFeeRepository serviceFeeRepository; + private final ServiceFeeMapper serviceFeeMapper; + + @Override + public PageResult queryAll(ServiceFeeQueryCriteria criteria, Pageable pageable){ + Page page = serviceFeeRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + return PageUtil.toPage(page.map(serviceFeeMapper::toDto)); + } + + @Override + public List queryAll(ServiceFeeQueryCriteria criteria){ + return serviceFeeMapper.toDto(serviceFeeRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + } + + @Override + @Transactional + public ServiceFeeDto findById(Long serviceFeeId) { + ServiceFee serviceFee = serviceFeeRepository.findById(serviceFeeId).orElseGet(ServiceFee::new); + ValidationUtil.isNull(serviceFee.getServiceFeeId(),"ServiceFee","serviceFeeId",serviceFeeId); + return serviceFeeMapper.toDto(serviceFee); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void create(ServiceFee resources) { + serviceFeeRepository.save(resources); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ServiceFee resources) { + ServiceFee serviceFee = serviceFeeRepository.findById(resources.getServiceFeeId()).orElseGet(ServiceFee::new); + ValidationUtil.isNull( serviceFee.getServiceFeeId(),"ServiceFee","id",resources.getServiceFeeId()); + serviceFee.copy(resources); + serviceFeeRepository.save(serviceFee); + } + + @Override + public void deleteAll(Long[] ids) { + for (Long serviceFeeId : ids) { + serviceFeeRepository.deleteById(serviceFeeId); + } + } + + @Override + public void download(List all, HttpServletResponse response) throws IOException { + List> list = new ArrayList<>(); + for (ServiceFeeDto serviceFee : all) { + Map map = new LinkedHashMap<>(); +// map.put("劳务人", serviceFee.getUserId()); + map.put("应发金额", serviceFee.getPayableFee()); + map.put("个人所得税", serviceFee.getTax()); + map.put("实发金额", serviceFee.getPaidFee()); + map.put("资金来源", serviceFee.getFeeSource()); +// map.put("审批人", serviceFee.getApproveUserId()); + map.put("劳务时间", serviceFee.getServiceTime()); + map.put("申请时间", serviceFee.getApplyTime()); + map.put("备注", serviceFee.getRemark()); + map.put("创建者", serviceFee.getCreateBy()); + map.put("更新者", serviceFee.getUpdateBy()); + map.put("创建日期", serviceFee.getCreateTime()); + map.put("更新时间", serviceFee.getUpdateTime()); + list.add(map); + } + FileUtil.downloadExcel(list, response); + } +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserBankServiceImpl.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserBankServiceImpl.java index d20e271..d84b852 100644 --- a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserBankServiceImpl.java +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/impl/UserBankServiceImpl.java @@ -73,6 +73,9 @@ public class UserBankServiceImpl implements UserBankService { @Override @Transactional(rollbackFor = Exception.class) public void create(UserBank resources) { + if (resources.getBankUse() == null){ + resources.setBankUse("否"); + } handleBankUse(resources); userBankRepository.save(resources); } @@ -93,9 +96,10 @@ public class UserBankServiceImpl implements UserBankService { * */ private void handleBankUse(UserBank resources) { if (Objects.equals("是", resources.getBankUse())) { - UserBank useUserBank = userBankRepository.findByBankUseAndUser("是",resources.getUser()); - useUserBank.setBankUse("否"); - userBankRepository.save(useUserBank); + userBankRepository.findByBankUseAndUser("是", resources.getUser()).ifPresent(userBank ->{ + userBank.setBankUse("否"); + userBankRepository.save(userBank); + }); } } diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/ProjectMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/ProjectMapper.java new file mode 100644 index 0000000..a647d7d --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/ProjectMapper.java @@ -0,0 +1,31 @@ +/* +* 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.service.mapstruct; + +import me.zhengjie.base.BaseMapper; +import me.zhengjie.modules.system.domain.Project; +import me.zhengjie.modules.system.service.dto.ProjectDto; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @website https://eladmin.vip +* @author author +**/ +@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface ProjectMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/ServiceFeeMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/ServiceFeeMapper.java new file mode 100644 index 0000000..646ec45 --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/ServiceFeeMapper.java @@ -0,0 +1,31 @@ +/* +* 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.service.mapstruct; + +import me.zhengjie.base.BaseMapper; +import me.zhengjie.modules.system.domain.ServiceFee; +import me.zhengjie.modules.system.service.dto.ServiceFeeDto; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @website https://eladmin.vip +* @author author +**/ +@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface ServiceFeeMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserBankSmallMapper.java b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserBankSmallMapper.java new file mode 100644 index 0000000..7a6c105 --- /dev/null +++ b/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/UserBankSmallMapper.java @@ -0,0 +1,33 @@ +/* +* 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.service.mapstruct; + +import me.zhengjie.base.BaseMapper; +import me.zhengjie.modules.system.domain.UserBank; +import me.zhengjie.modules.system.service.dto.UserBankDto; +import me.zhengjie.modules.system.service.dto.UserBankSmallDto; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @website https://eladmin.vip +* @author author +* @date 2023-10-31 +**/ +@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface UserBankSmallMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/eladmin-web/src/api/system/project.js b/eladmin-web/src/api/system/project.js new file mode 100644 index 0000000..b263b85 --- /dev/null +++ b/eladmin-web/src/api/system/project.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/project', + method: 'post', + data + }) +} + +export function del(ids) { + return request({ + url: 'api/project/', + method: 'delete', + data: ids + }) +} + +export function edit(data) { + return request({ + url: 'api/project', + method: 'put', + data + }) +} + +export default { add, edit, del } diff --git a/eladmin-web/src/api/system/serviceFee.js b/eladmin-web/src/api/system/serviceFee.js new file mode 100644 index 0000000..c911b8a --- /dev/null +++ b/eladmin-web/src/api/system/serviceFee.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/serviceFee', + method: 'post', + data + }) +} + +export function del(ids) { + return request({ + url: 'api/serviceFee/', + method: 'delete', + data: ids + }) +} + +export function edit(data) { + return request({ + url: 'api/serviceFee', + method: 'put', + data + }) +} + +export default { add, edit, del } diff --git a/eladmin-web/src/api/system/user.js b/eladmin-web/src/api/system/user.js index c14df11..b86aaaa 100644 --- a/eladmin-web/src/api/system/user.js +++ b/eladmin-web/src/api/system/user.js @@ -1,5 +1,13 @@ import request from '@/utils/request' import { encrypt } from '@/utils/rsaEncrypt' +import qs from "qs"; + +export function getUserList(params) { + return request({ + url: 'api/users/list' + '?' + qs.stringify(params, { indices: false }), + method: 'get' + }) +} export function add(data) { return request({ diff --git a/eladmin-web/src/views/system/project/index.vue b/eladmin-web/src/views/system/project/index.vue new file mode 100644 index 0000000..a76ae56 --- /dev/null +++ b/eladmin-web/src/views/system/project/index.vue @@ -0,0 +1,132 @@ + + + + + diff --git a/eladmin-web/src/views/system/reimburse/index.vue b/eladmin-web/src/views/system/reimburse/index.vue index 7a3d5bd..5ae1ed8 100644 --- a/eladmin-web/src/views/system/reimburse/index.vue +++ b/eladmin-web/src/views/system/reimburse/index.vue @@ -25,6 +25,12 @@ + + + + + + @@ -125,7 +131,7 @@ import udOperation from '@crud/UD.operation' import pagination from '@crud/Pagination' import {mapGetters} from "vuex"; -const defaultForm = { user:{dept:{}},userId: null, reason: null, fee: null, reimburseType: null, feeSource: null, projectName: null, projectNo: null, projectFee: null, reimburseTime: null, remark: null, createBy: null, updateBy: null, createTime: null, updateTime: null, reimburseId: null } +const defaultForm = { user:{dept:{},userBanks:[{}]},userId: null, reason: null, fee: null, reimburseType: null, feeSource: null, projectName: null, projectNo: null, projectFee: null, reimburseTime: null, remark: null, createBy: null, updateBy: null, createTime: null, updateTime: null, reimburseId: null } export default { name: 'Reimburse', components: { pagination, crudOperation, rrOperation, udOperation }, diff --git a/eladmin-web/src/views/system/service_fee/index.vue b/eladmin-web/src/views/system/service_fee/index.vue new file mode 100644 index 0000000..b204070 --- /dev/null +++ b/eladmin-web/src/views/system/service_fee/index.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/eladmin-web/src/views/system/user/user-select.vue b/eladmin-web/src/views/system/user/user-select.vue new file mode 100644 index 0000000..094ff01 --- /dev/null +++ b/eladmin-web/src/views/system/user/user-select.vue @@ -0,0 +1,54 @@ + + + + +