科研项目 用户银行 劳务费
parent
b9d6a4a65f
commit
ef3ea72c22
|
@ -39,9 +39,9 @@
|
||||||
<#if column.formShow>
|
<#if column.formShow>
|
||||||
<el-form-item label="<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>"<#if column.istNotNull> prop="${column.changeColumnName}"</#if>>
|
<el-form-item label="<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>"<#if column.istNotNull> prop="${column.changeColumnName}"</#if>>
|
||||||
<#if column.formType = 'Input'>
|
<#if column.formType = 'Input'>
|
||||||
<el-input v-model="form.${column.changeColumnName}" style="width: 370px;" />
|
<el-input v-model="form.${column.changeColumnName}" />
|
||||||
<#elseif column.formType = 'Textarea'>
|
<#elseif column.formType = 'Textarea'>
|
||||||
<el-input v-model="form.${column.changeColumnName}" :rows="3" type="textarea" style="width: 370px;" />
|
<el-input v-model="form.${column.changeColumnName}" :rows="3" type="textarea" />
|
||||||
<#elseif column.formType = 'Radio'>
|
<#elseif column.formType = 'Radio'>
|
||||||
<#if (column.dictName)?? && (column.dictName)!="">
|
<#if (column.dictName)?? && (column.dictName)!="">
|
||||||
<el-radio v-model="form.${column.changeColumnName}" v-for="item in dict.${column.dictName}" :key="item.id" :label="item.value">{{ item.label }}</el-radio>
|
<el-radio v-model="form.${column.changeColumnName}" v-for="item in dict.${column.dictName}" :key="item.id" :label="item.value">{{ item.label }}</el-radio>
|
||||||
|
@ -61,7 +61,7 @@
|
||||||
未设置字典,请手动设置 Select
|
未设置字典,请手动设置 Select
|
||||||
</#if>
|
</#if>
|
||||||
<#else>
|
<#else>
|
||||||
<el-date-picker v-model="form.${column.changeColumnName}" type="datetime" style="width: 370px;" />
|
<el-date-picker v-model="form.${column.changeColumnName}" type="datetime" />
|
||||||
</#if>
|
</#if>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</#if>
|
</#if>
|
||||||
|
|
|
@ -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));
|
||||||
|
}
|
||||||
|
}
|
|
@ -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));
|
||||||
|
}
|
||||||
|
}
|
|
@ -59,6 +59,11 @@ public class User extends BaseEntity implements Serializable {
|
||||||
inverseJoinColumns = {@JoinColumn(name = "job_id",referencedColumnName = "job_id")})
|
inverseJoinColumns = {@JoinColumn(name = "job_id",referencedColumnName = "job_id")})
|
||||||
private Set<Job> jobs;
|
private Set<Job> jobs;
|
||||||
|
|
||||||
|
@OrderBy("bankUse asc ")
|
||||||
|
@OneToMany(fetch = FetchType.EAGER,mappedBy = "user")
|
||||||
|
@ApiModelProperty(value = "用户银行卡")
|
||||||
|
private Set<UserBank> userBanks;
|
||||||
|
|
||||||
@OneToOne
|
@OneToOne
|
||||||
@JoinColumn(name = "dept_id")
|
@JoinColumn(name = "dept_id")
|
||||||
@ApiModelProperty(value = "用户部门")
|
@ApiModelProperty(value = "用户部门")
|
||||||
|
|
|
@ -20,6 +20,7 @@ import cn.hutool.core.bean.BeanUtil;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import cn.hutool.core.bean.copier.CopyOptions;
|
import cn.hutool.core.bean.copier.CopyOptions;
|
||||||
import me.zhengjie.base.BaseEntity;
|
import me.zhengjie.base.BaseEntity;
|
||||||
|
import org.springframework.data.web.SortDefault;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import javax.persistence.*;
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
|
|
|
@ -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<Project, Long>, JpaSpecificationExecutor<Project> {
|
||||||
|
}
|
|
@ -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<ServiceFee, Long>, JpaSpecificationExecutor<ServiceFee> {
|
||||||
|
}
|
|
@ -21,6 +21,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @website https://eladmin.vip
|
* @website https://eladmin.vip
|
||||||
|
@ -29,5 +30,5 @@ import java.util.List;
|
||||||
**/
|
**/
|
||||||
public interface UserBankRepository extends JpaRepository<UserBank, Long>, JpaSpecificationExecutor<UserBank> {
|
public interface UserBankRepository extends JpaRepository<UserBank, Long>, JpaSpecificationExecutor<UserBank> {
|
||||||
|
|
||||||
UserBank findByBankUseAndUser(String bankUse, User user);
|
Optional<UserBank> findByBankUseAndUser(String bankUse, User user);
|
||||||
}
|
}
|
|
@ -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<PageResult<ProjectDto>> queryProject(ProjectQueryCriteria criteria, Pageable pageable){
|
||||||
|
return new ResponseEntity<>(projectService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("新增科研信息")
|
||||||
|
@ApiOperation("新增科研信息")
|
||||||
|
@PreAuthorize("@el.check('project:add')")
|
||||||
|
public ResponseEntity<Object> createProject(@Validated @RequestBody Project resources){
|
||||||
|
projectService.create(resources);
|
||||||
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Log("修改科研信息")
|
||||||
|
@ApiOperation("修改科研信息")
|
||||||
|
@PreAuthorize("@el.check('project:edit')")
|
||||||
|
public ResponseEntity<Object> updateProject(@Validated @RequestBody Project resources){
|
||||||
|
projectService.update(resources);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping
|
||||||
|
@Log("删除科研信息")
|
||||||
|
@ApiOperation("删除科研信息")
|
||||||
|
@PreAuthorize("@el.check('project:del')")
|
||||||
|
public ResponseEntity<Object> deleteProject(@RequestBody Long[] ids) {
|
||||||
|
projectService.deleteAll(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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<PageResult<ServiceFeeDto>> queryServiceFee(ServiceFeeQueryCriteria criteria, Pageable pageable){
|
||||||
|
return new ResponseEntity<>(serviceFeeService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("新增劳务费")
|
||||||
|
@ApiOperation("新增劳务费")
|
||||||
|
@PreAuthorize("@el.check('serviceFee:add')")
|
||||||
|
public ResponseEntity<Object> createServiceFee(@Validated @RequestBody ServiceFee resources){
|
||||||
|
serviceFeeService.create(resources);
|
||||||
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Log("修改劳务费")
|
||||||
|
@ApiOperation("修改劳务费")
|
||||||
|
@PreAuthorize("@el.check('serviceFee:edit')")
|
||||||
|
public ResponseEntity<Object> updateServiceFee(@Validated @RequestBody ServiceFee resources){
|
||||||
|
serviceFeeService.update(resources);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping
|
||||||
|
@Log("删除劳务费")
|
||||||
|
@ApiOperation("删除劳务费")
|
||||||
|
@PreAuthorize("@el.check('serviceFee:del')")
|
||||||
|
public ResponseEntity<Object> deleteServiceFee(@RequestBody Long[] ids) {
|
||||||
|
serviceFeeService.deleteAll(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
|
@ -75,6 +75,13 @@ public class UserController {
|
||||||
userService.download(userService.queryAll(criteria), response);
|
userService.download(userService.queryAll(criteria), response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("导出用户数据")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
@PreAuthorize("@el.check('user:list')")
|
||||||
|
public ResponseEntity<List<UserDto>> getUserList(UserQueryCriteria criteria) throws IOException {
|
||||||
|
return ResponseEntity.ok(userService.queryAll(criteria));
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("查询用户")
|
@ApiOperation("查询用户")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@PreAuthorize("@el.check('user:list')")
|
@PreAuthorize("@el.check('user:list')")
|
||||||
|
|
|
@ -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<String,Object>
|
||||||
|
*/
|
||||||
|
PageResult<ProjectDto> queryAll(ProjectQueryCriteria criteria, Pageable pageable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有数据不分页
|
||||||
|
* @param criteria 条件参数
|
||||||
|
* @return List<ProjectDto>
|
||||||
|
*/
|
||||||
|
List<ProjectDto> 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<ProjectDto> all, HttpServletResponse response) throws IOException;
|
||||||
|
}
|
|
@ -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<String,Object>
|
||||||
|
*/
|
||||||
|
PageResult<ServiceFeeDto> queryAll(ServiceFeeQueryCriteria criteria, Pageable pageable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询所有数据不分页
|
||||||
|
* @param criteria 条件参数
|
||||||
|
* @return List<ServiceFeeDto>
|
||||||
|
*/
|
||||||
|
List<ServiceFeeDto> 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<ServiceFeeDto> all, HttpServletResponse response) throws IOException;
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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{
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -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{
|
||||||
|
}
|
|
@ -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;
|
||||||
|
}
|
|
@ -37,6 +37,8 @@ public class UserDto extends BaseDTO implements Serializable {
|
||||||
|
|
||||||
private Set<JobSmallDto> jobs;
|
private Set<JobSmallDto> jobs;
|
||||||
|
|
||||||
|
private Set<UserBankSmallDto> userBanks;
|
||||||
|
|
||||||
private DeptSmallDto dept;
|
private DeptSmallDto dept;
|
||||||
|
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
|
@ -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<ProjectDto> queryAll(ProjectQueryCriteria criteria, Pageable pageable){
|
||||||
|
Page<Project> page = projectRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||||
|
return PageUtil.toPage(page.map(projectMapper::toDto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProjectDto> 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<ProjectDto> all, HttpServletResponse response) throws IOException {
|
||||||
|
List<Map<String, Object>> list = new ArrayList<>();
|
||||||
|
for (ProjectDto project : all) {
|
||||||
|
Map<String,Object> 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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -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<ServiceFeeDto> queryAll(ServiceFeeQueryCriteria criteria, Pageable pageable){
|
||||||
|
Page<ServiceFee> page = serviceFeeRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||||
|
return PageUtil.toPage(page.map(serviceFeeMapper::toDto));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ServiceFeeDto> 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<ServiceFeeDto> all, HttpServletResponse response) throws IOException {
|
||||||
|
List<Map<String, Object>> list = new ArrayList<>();
|
||||||
|
for (ServiceFeeDto serviceFee : all) {
|
||||||
|
Map<String,Object> 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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -73,6 +73,9 @@ public class UserBankServiceImpl implements UserBankService {
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void create(UserBank resources) {
|
public void create(UserBank resources) {
|
||||||
|
if (resources.getBankUse() == null){
|
||||||
|
resources.setBankUse("否");
|
||||||
|
}
|
||||||
handleBankUse(resources);
|
handleBankUse(resources);
|
||||||
userBankRepository.save(resources);
|
userBankRepository.save(resources);
|
||||||
}
|
}
|
||||||
|
@ -93,9 +96,10 @@ public class UserBankServiceImpl implements UserBankService {
|
||||||
* */
|
* */
|
||||||
private void handleBankUse(UserBank resources) {
|
private void handleBankUse(UserBank resources) {
|
||||||
if (Objects.equals("是", resources.getBankUse())) {
|
if (Objects.equals("是", resources.getBankUse())) {
|
||||||
UserBank useUserBank = userBankRepository.findByBankUseAndUser("是",resources.getUser());
|
userBankRepository.findByBankUseAndUser("是", resources.getUser()).ifPresent(userBank ->{
|
||||||
useUserBank.setBankUse("否");
|
userBank.setBankUse("否");
|
||||||
userBankRepository.save(useUserBank);
|
userBankRepository.save(userBank);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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<ProjectDto, Project> {
|
||||||
|
|
||||||
|
}
|
|
@ -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<ServiceFeeDto, ServiceFee> {
|
||||||
|
|
||||||
|
}
|
|
@ -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<UserBankSmallDto, UserBank> {
|
||||||
|
|
||||||
|
}
|
|
@ -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 }
|
|
@ -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 }
|
|
@ -1,5 +1,13 @@
|
||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
import { encrypt } from '@/utils/rsaEncrypt'
|
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) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
@ -0,0 +1,132 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission" />
|
||||||
|
<!--表单组件-->
|
||||||
|
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="800px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px">
|
||||||
|
<el-form-item label="科研项目编号" prop="projectNo">
|
||||||
|
<el-input v-model="form.projectNo" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="科研项目名称" prop="projectName">
|
||||||
|
<el-input v-model="form.projectName" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="项目预算" prop="projectFee">
|
||||||
|
<el-input v-model="form.projectFee" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="项目负责人" prop="projectUserId">
|
||||||
|
<!-- <el-input v-model="form.projectUserId" />-->
|
||||||
|
<user-select v-model="form.projectUser.id" ></user-select>
|
||||||
|
<!-- <el-select-->
|
||||||
|
<!-- v-model="form.projectUser.id"-->
|
||||||
|
<!-- filterable-->
|
||||||
|
<!-- remote-->
|
||||||
|
<!-- placeholder="请输入项目负责人名字"-->
|
||||||
|
<!-- >-->
|
||||||
|
<!-- <el-option-->
|
||||||
|
<!-- v-for="item in options"-->
|
||||||
|
<!-- :key="item.value"-->
|
||||||
|
<!-- :label="item.label"-->
|
||||||
|
<!-- :value="item.value">-->
|
||||||
|
<!-- </el-option>-->
|
||||||
|
|
||||||
|
<!-- </el-select>-->
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="form.remark" />
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="创建者">
|
||||||
|
<el-input v-model="form.createBy" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="更新者">
|
||||||
|
<el-input v-model="form.updateBy" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="创建日期">
|
||||||
|
<el-input v-model="form.createTime" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="更新时间">
|
||||||
|
<el-input v-model="form.updateTime" />
|
||||||
|
</el-form-item>-->
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||||
|
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column prop="projectNo" label="科研项目编号" />
|
||||||
|
<el-table-column prop="projectName" label="科研项目名称" />
|
||||||
|
<el-table-column prop="projectFee" label="项目预算" />
|
||||||
|
<el-table-column prop="projectUser.nickName" label="项目负责人" />
|
||||||
|
<el-table-column prop="remark" label="备注" />
|
||||||
|
<!-- <el-table-column prop="createBy" label="创建者" />-->
|
||||||
|
<!-- <el-table-column prop="updateBy" label="更新者" />-->
|
||||||
|
<!-- <el-table-column prop="createTime" label="创建日期" />-->
|
||||||
|
<!-- <el-table-column prop="updateTime" label="更新时间" />-->
|
||||||
|
<el-table-column v-if="checkPer(['admin','project:edit','project:del'])" label="操作" width="150px" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<udOperation
|
||||||
|
:data="scope.row"
|
||||||
|
:permission="permission"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudProject from '@/api/system/project'
|
||||||
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import udOperation from '@crud/UD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
import UserSelect from "@/views/system/user/user-select.vue";
|
||||||
|
|
||||||
|
const defaultForm = { projectUser:{},projectId: null, projectNo: null, projectName: null, projectFee: null, projectUserId: null, remark: null, createBy: null, updateBy: null, createTime: null, updateTime: null }
|
||||||
|
export default {
|
||||||
|
name: 'Project',
|
||||||
|
components: {UserSelect, pagination, crudOperation, rrOperation, udOperation },
|
||||||
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({ title: '科研信息', url: 'api/project', idField: 'projectId', sort: 'projectId,desc', crudMethod: { ...crudProject }})
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
permission: {
|
||||||
|
add: ['admin', 'project:add'],
|
||||||
|
edit: ['admin', 'project:edit'],
|
||||||
|
del: ['admin', 'project:del']
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
projectNo: [
|
||||||
|
{ required: true, message: '科研项目编号不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
projectName: [
|
||||||
|
{ required: true, message: '科研项目名称不能为空', trigger: 'blur' }
|
||||||
|
],
|
||||||
|
projectFee: [
|
||||||
|
{ required: true, message: '项目预算不能为空', trigger: 'blur' }
|
||||||
|
]
|
||||||
|
} }
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -25,6 +25,12 @@
|
||||||
<el-form-item label="部门" prop="user.dept.name">
|
<el-form-item label="部门" prop="user.dept.name">
|
||||||
<el-input v-model="form.user.dept.name" disabled />
|
<el-input v-model="form.user.dept.name" disabled />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="开户行" prop="user.dept.name">
|
||||||
|
<el-input v-model="form.user.userBanks[0].bankName" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="银行卡号" prop="user.dept.name">
|
||||||
|
<el-input v-model="form.user.userBanks[0].bankNo" disabled />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="申请事由" prop="reason">
|
<el-form-item label="申请事由" prop="reason">
|
||||||
<el-input v-model="form.reason" style="" />
|
<el-input v-model="form.reason" style="" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -125,7 +131,7 @@ import udOperation from '@crud/UD.operation'
|
||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination'
|
||||||
import {mapGetters} from "vuex";
|
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 {
|
export default {
|
||||||
name: 'Reimburse',
|
name: 'Reimburse',
|
||||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
|
|
|
@ -0,0 +1,140 @@
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission" />
|
||||||
|
<!--表单组件-->
|
||||||
|
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="800px">
|
||||||
|
<el-form ref="form" inline :model="form" :rules="rules" size="small" label-width="150px">
|
||||||
|
<!-- <el-form-item label="劳务人" v-show="false">-->
|
||||||
|
<!-- <el-input v-model="form.user.id" />-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- <el-form-item label="劳务人">-->
|
||||||
|
<!-- <el-input v-model="form.user.id" />-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<el-form-item label="劳务人">
|
||||||
|
<user-select v-model="form.user.id" @userInfo="fillUser" ></user-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="性别">
|
||||||
|
<el-input v-model="form.user.gender" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="手机" >
|
||||||
|
<el-input v-model="form.user.phone" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="开户行" >
|
||||||
|
<el-input v-model="form.user.userBanks[0].bankName" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="银行卡号" >
|
||||||
|
<el-input v-model="form.user.userBanks[0].bankNo" disabled />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="应发金额">
|
||||||
|
<el-input v-model="form.payableFee" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="个人所得税">
|
||||||
|
<el-input v-model="form.tax" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="实发金额">
|
||||||
|
<el-input v-model="form.paidFee" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="资金来源">
|
||||||
|
<el-select v-model="form.feeSource" filterable placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in dict.fee_source"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="审批人">-->
|
||||||
|
<!-- <el-input v-model="form.approveUserId" />-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<el-form-item label="劳务时间">
|
||||||
|
<el-date-picker v-model="form.serviceTime" type="datetime" style="" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="备注">
|
||||||
|
<el-input v-model="form.remark" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||||
|
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column prop="userId" label="劳务人" />
|
||||||
|
<el-table-column prop="payableFee" label="应发金额" />
|
||||||
|
<el-table-column prop="tax" label="个人所得税" />
|
||||||
|
<el-table-column prop="paidFee" label="实发金额" />
|
||||||
|
<el-table-column prop="feeSource" label="资金来源">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ dict.label.fee_source[scope.row.feeSource] }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="approveUserId" label="审批人" />
|
||||||
|
<el-table-column prop="serviceTime" label="劳务时间" />
|
||||||
|
<el-table-column prop="applyTime" label="申请时间" />
|
||||||
|
<el-table-column prop="remark" label="备注" />
|
||||||
|
<el-table-column v-if="checkPer(['admin','serviceFee:edit','serviceFee:del'])" label="操作" width="150px" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<udOperation
|
||||||
|
:data="scope.row"
|
||||||
|
:permission="permission"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudServiceFee from '@/api/system/serviceFee'
|
||||||
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation.vue'
|
||||||
|
import crudOperation from '@crud/CRUD.operation.vue'
|
||||||
|
import udOperation from '@crud/UD.operation.vue'
|
||||||
|
import pagination from '@crud/Pagination.vue'
|
||||||
|
import UserSelect from "@/views/system/user/user-select.vue";
|
||||||
|
|
||||||
|
const defaultForm = { user:{userBanks:[{}]},approveUser:{}, serviceFeeId: null, userId: null, payableFee: null, tax: null, paidFee: null, feeSource: null, approveUserId: null, serviceTime: null, applyTime: null, remark: null, createBy: null, updateBy: null, createTime: null, updateTime: null }
|
||||||
|
export default {
|
||||||
|
name: 'ServiceFee',
|
||||||
|
components: {UserSelect, pagination, crudOperation, rrOperation, udOperation },
|
||||||
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
|
dicts: ['fee_source'],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({ title: '劳务费', url: 'api/serviceFee', idField: 'serviceFeeId', sort: 'serviceFeeId,desc', crudMethod: { ...crudServiceFee }})
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
permission: {
|
||||||
|
add: ['admin', 'serviceFee:add'],
|
||||||
|
edit: ['admin', 'serviceFee:edit'],
|
||||||
|
del: ['admin', 'serviceFee:del']
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
} }
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
fillUser(user){
|
||||||
|
this.form.user = {userBanks:[{}]}
|
||||||
|
console.log(user)
|
||||||
|
this.form.user = Object.assign({}, this.form.user, user)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -0,0 +1,54 @@
|
||||||
|
<template>
|
||||||
|
<el-select
|
||||||
|
ref="userSelect"
|
||||||
|
v-model="value"
|
||||||
|
:remote-method="querySearch"
|
||||||
|
filterable
|
||||||
|
default-first-option
|
||||||
|
remote
|
||||||
|
placeholder="请输入用户信息搜索"
|
||||||
|
@change="change"
|
||||||
|
>
|
||||||
|
<el-option v-for="item in options" :key="item.id" :value="item" :label="item.nickName" />
|
||||||
|
</el-select>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
import {getUserList} from "@/api/system/user";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'UserSelect',
|
||||||
|
props:{
|
||||||
|
search:{}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
value: this.search,
|
||||||
|
options: [],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
querySearch(query) {
|
||||||
|
if (query !== '') {
|
||||||
|
const params = {
|
||||||
|
blurry : query
|
||||||
|
}
|
||||||
|
getUserList(params).then(res =>{
|
||||||
|
this.options = res;
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.options = []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
change(val){
|
||||||
|
this.$emit('input',val.id)
|
||||||
|
this.$emit('userInfo',val)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
</style>
|
Loading…
Reference in New Issue