20 files added
41 files modified
| | |
| | | |
| | | @ApiOperation("导出应用数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('app:list')") |
| | | @PreAuthorize("@el.check('app:download')") |
| | | public void exportApp(HttpServletResponse response, AppQueryCriteria criteria) throws IOException { |
| | | appService.download(appService.queryAll(criteria), response); |
| | | } |
| | |
| | | |
| | | @ApiOperation("导出数据库数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('database:list')") |
| | | @PreAuthorize("@el.check('database:download')") |
| | | public void exportDatabase(HttpServletResponse response, DatabaseQueryCriteria criteria) throws IOException { |
| | | databaseService.download(databaseService.queryAll(criteria), response); |
| | | } |
| | |
| | | |
| | | @ApiOperation("导出部署数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('database:list')") |
| | | @PreAuthorize("@el.check('database:download')") |
| | | public void exportDeployData(HttpServletResponse response, DeployQueryCriteria criteria) throws IOException { |
| | | deployService.download(deployService.queryAll(criteria), response); |
| | | } |
| | |
| | | |
| | | @ApiOperation("导出部署历史数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('deployHistory:list')") |
| | | @PreAuthorize("@el.check('deployHistory:download')") |
| | | public void exportDeployHistory(HttpServletResponse response, DeployHistoryQueryCriteria criteria) throws IOException { |
| | | deployhistoryService.download(deployhistoryService.queryAll(criteria), response); |
| | | } |
| | |
| | | |
| | | @ApiOperation("导出服务器数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('serverDeploy:list')") |
| | | @PreAuthorize("@el.check('serverDeploy:download')") |
| | | public void exportServerDeploy(HttpServletResponse response, ServerDeployQueryCriteria criteria) throws IOException { |
| | | serverDeployService.download(serverDeployService.queryAll(criteria), response); |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.project.domain; |
| | | |
| | | import lombok.Data; |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import cn.hutool.core.bean.copier.CopyOptions; |
| | | import me.zhengjie.base.BaseEntity; |
| | | |
| | | 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 HuaZhe |
| | | * @date 2022-12-14 |
| | | **/ |
| | | @Entity |
| | | @Data |
| | | @Table(name="project_type") |
| | | public class ProjectType extends BaseEntity implements Serializable { |
| | | |
| | | @Id |
| | | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| | | @Column(name = "`id`") |
| | | @ApiModelProperty(value = "ID") |
| | | private Long id; |
| | | |
| | | @Column(name = "`name`",nullable = false) |
| | | @NotBlank |
| | | @ApiModelProperty(value = "名称;例:国内二次开发,对日包人月,维保,评估报告,绩效评审") |
| | | private String name; |
| | | |
| | | @Column(name = "`standard_unit_currency`",nullable = false) |
| | | @NotBlank |
| | | @ApiModelProperty(value = "标准单价币种;字典:人民币、美元、日元") |
| | | private String standardUnitCurrency; |
| | | |
| | | @Column(name = "`standard_unit_price`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "标准单价金额") |
| | | private BigDecimal standardUnitPrice; |
| | | |
| | | @Column(name = "`standard_profit_price`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "标准利润金额") |
| | | private BigDecimal standardProfitPrice; |
| | | |
| | | @Column(name = "`standard_workload_unit`",nullable = false) |
| | | @NotBlank |
| | | @ApiModelProperty(value = "标准工作量单位;字典:个,本,行") |
| | | private String standardWorkloadUnit; |
| | | |
| | | @Column(name = "`remarks`") |
| | | @ApiModelProperty(value = "备注") |
| | | private String remarks; |
| | | |
| | | public void copy(ProjectType source){ |
| | | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.project.repository; |
| | | |
| | | import me.zhengjie.modules.project.domain.ProjectType; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @author HuaZhe |
| | | * @date 2022-12-14 |
| | | **/ |
| | | public interface ProjectTypeRepository extends JpaRepository<ProjectType, Long>, JpaSpecificationExecutor<ProjectType> { |
| | | |
| | | /** |
| | | * 根据名称查询数据 |
| | | * @return |
| | | * @author 华喆 |
| | | */ |
| | | List<ProjectType> findByName(String name); |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.project.rest; |
| | | |
| | | import me.zhengjie.annotation.Log; |
| | | import me.zhengjie.modules.project.domain.ProjectType; |
| | | import me.zhengjie.modules.project.service.ProjectTypeService; |
| | | import me.zhengjie.modules.project.service.dto.ProjectTypeQueryCriteria; |
| | | 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; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @author HuaZhe |
| | | * @date 2022-12-14 |
| | | **/ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "项目类型管理") |
| | | @RequestMapping("/api/projectType") |
| | | public class ProjectTypeController { |
| | | |
| | | private final ProjectTypeService projectTypeService; |
| | | |
| | | @Log("导出数据") |
| | | @ApiOperation("导出数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('projectType:download')") |
| | | public void exportProjectType(HttpServletResponse response, ProjectTypeQueryCriteria criteria) throws IOException { |
| | | projectTypeService.download(projectTypeService.queryAll(criteria), response); |
| | | } |
| | | |
| | | @GetMapping |
| | | @Log("查询项目类型") |
| | | @ApiOperation("查询项目类型") |
| | | @PreAuthorize("@el.check('projectType:list')") |
| | | public ResponseEntity<Object> queryProjectType(ProjectTypeQueryCriteria criteria, Pageable pageable){ |
| | | return new ResponseEntity<>(projectTypeService.queryAll(criteria,pageable),HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/all") |
| | | @Log("查询项目类型") |
| | | @ApiOperation("查询项目类型") |
| | | @PreAuthorize("@el.check('projectType:list')") |
| | | public ResponseEntity<Object> queryProjectTypeAll(ProjectTypeQueryCriteria criteria){ |
| | | return new ResponseEntity<>(projectTypeService.queryAll(criteria),HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping |
| | | @Log("新增项目类型") |
| | | @ApiOperation("新增项目类型") |
| | | @PreAuthorize("@el.check('projectType:add')") |
| | | public ResponseEntity<Object> createProjectType(@Validated @RequestBody ProjectType resources){ |
| | | return new ResponseEntity<>(projectTypeService.create(resources),HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PutMapping |
| | | @Log("修改项目类型") |
| | | @ApiOperation("修改项目类型") |
| | | @PreAuthorize("@el.check('projectType:edit')") |
| | | public ResponseEntity<Object> updateProjectType(@Validated @RequestBody ProjectType resources){ |
| | | projectTypeService.update(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @Log("删除项目类型") |
| | | @ApiOperation("删除项目类型") |
| | | @PreAuthorize("@el.check('projectType:del')") |
| | | public ResponseEntity<Object> deleteProjectType(@RequestBody Long[] ids) { |
| | | projectTypeService.deleteAll(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.project.service; |
| | | |
| | | import me.zhengjie.modules.project.domain.ProjectType; |
| | | import me.zhengjie.modules.project.service.dto.ProjectTypeDto; |
| | | import me.zhengjie.modules.project.service.dto.ProjectTypeQueryCriteria; |
| | | import org.springframework.data.domain.Pageable; |
| | | import java.util.Map; |
| | | import java.util.List; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @description 服务接口 |
| | | * @author HuaZhe |
| | | * @date 2022-12-14 |
| | | **/ |
| | | public interface ProjectTypeService { |
| | | |
| | | /** |
| | | * 查询数据分页 |
| | | * @param criteria 条件 |
| | | * @param pageable 分页参数 |
| | | * @return Map<String,Object> |
| | | */ |
| | | Map<String,Object> queryAll(ProjectTypeQueryCriteria criteria, Pageable pageable); |
| | | |
| | | /** |
| | | * 查询所有数据不分页 |
| | | * @param criteria 条件参数 |
| | | * @return List<ProjectTypeDto> |
| | | */ |
| | | List<ProjectTypeDto> queryAll(ProjectTypeQueryCriteria criteria); |
| | | |
| | | /** |
| | | * 根据ID查询 |
| | | * @param id ID |
| | | * @return ProjectTypeDto |
| | | */ |
| | | ProjectTypeDto findById(Long id); |
| | | |
| | | /** |
| | | * 创建 |
| | | * @param resources / |
| | | * @return ProjectTypeDto |
| | | */ |
| | | ProjectTypeDto create(ProjectType resources); |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param resources / |
| | | */ |
| | | void update(ProjectType resources); |
| | | |
| | | /** |
| | | * 多选删除 |
| | | * @param ids / |
| | | */ |
| | | void deleteAll(Long[] ids); |
| | | |
| | | /** |
| | | * 导出数据 |
| | | * @param all 待导出的数据 |
| | | * @param response / |
| | | * @throws IOException / |
| | | */ |
| | | void download(List<ProjectTypeDto> all, HttpServletResponse response) throws IOException; |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.project.service.dto; |
| | | |
| | | import lombok.Data; |
| | | import me.zhengjie.base.BaseDTO; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.math.BigDecimal; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @description / |
| | | * @author HuaZhe |
| | | * @date 2022-12-14 |
| | | **/ |
| | | @Data |
| | | public class ProjectTypeDto extends BaseDTO implements Serializable { |
| | | |
| | | /** ID */ |
| | | private Long id; |
| | | |
| | | /** 名称;例:国内二次开发,对日包人月,维保,评估报告,绩效评审 */ |
| | | private String name; |
| | | |
| | | /** 标准单价币种;字典:人民币、美元、日元 */ |
| | | private String standardUnitCurrency; |
| | | |
| | | /** 标准单价金额 */ |
| | | private BigDecimal standardUnitPrice; |
| | | |
| | | /** 标准利润金额 */ |
| | | private BigDecimal standardProfitPrice; |
| | | |
| | | /** 标准工作量单位;字典:个,本,行 */ |
| | | private String standardWorkloadUnit; |
| | | |
| | | /** 备注 */ |
| | | private String remarks; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.project.service.dto; |
| | | |
| | | import lombok.Data; |
| | | import java.util.List; |
| | | import me.zhengjie.annotation.Query; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @author HuaZhe |
| | | * @date 2022-12-14 |
| | | **/ |
| | | @Data |
| | | public class ProjectTypeQueryCriteria{ |
| | | |
| | | /** 模糊 */ |
| | | @Query(type = Query.Type.INNER_LIKE) |
| | | private String name; |
| | | |
| | | /** 精确 */ |
| | | @Query |
| | | private String standardUnitCurrency; |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.project.service.impl; |
| | | |
| | | import me.zhengjie.exception.BadRequestException; |
| | | import me.zhengjie.modules.project.domain.ProjectType; |
| | | import me.zhengjie.utils.ValidationUtil; |
| | | import me.zhengjie.utils.FileUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import me.zhengjie.modules.project.repository.ProjectTypeRepository; |
| | | import me.zhengjie.modules.project.service.ProjectTypeService; |
| | | import me.zhengjie.modules.project.service.dto.ProjectTypeDto; |
| | | import me.zhengjie.modules.project.service.dto.ProjectTypeQueryCriteria; |
| | | import me.zhengjie.modules.project.service.mapstruct.ProjectTypeMapper; |
| | | 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; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @description 服务实现 |
| | | * @author HuaZhe |
| | | * @date 2022-12-14 |
| | | **/ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class ProjectTypeServiceImpl implements ProjectTypeService { |
| | | |
| | | private final ProjectTypeRepository projectTypeRepository; |
| | | private final ProjectTypeMapper projectTypeMapper; |
| | | |
| | | @Override |
| | | public Map<String,Object> queryAll(ProjectTypeQueryCriteria criteria, Pageable pageable){ |
| | | Page<ProjectType> page = projectTypeRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); |
| | | return PageUtil.toPage(page.map(projectTypeMapper::toDto)); |
| | | } |
| | | |
| | | @Override |
| | | public List<ProjectTypeDto> queryAll(ProjectTypeQueryCriteria criteria){ |
| | | return projectTypeMapper.toDto(projectTypeRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public ProjectTypeDto findById(Long id) { |
| | | ProjectType projectType = projectTypeRepository.findById(id).orElseGet(ProjectType::new); |
| | | ValidationUtil.isNull(projectType.getId(),"ProjectType","id",id); |
| | | return projectTypeMapper.toDto(projectType); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ProjectTypeDto create(ProjectType resources) { |
| | | checkAddProject(resources); |
| | | return projectTypeMapper.toDto(projectTypeRepository.save(resources)); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void update(ProjectType resources) { |
| | | checkUpdateProject(resources); |
| | | ProjectType projectType = projectTypeRepository.findById(resources.getId()).orElseGet(ProjectType::new); |
| | | ValidationUtil.isNull( projectType.getId(),"ProjectType","id",resources.getId()); |
| | | projectType.copy(resources); |
| | | projectTypeRepository.save(projectType); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteAll(Long[] ids) { |
| | | for (Long id : ids) { |
| | | projectTypeRepository.deleteById(id); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void download(List<ProjectTypeDto> all, HttpServletResponse response) throws IOException { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (ProjectTypeDto projectType : all) { |
| | | Map<String,Object> map = new LinkedHashMap<>(); |
| | | map.put("名称;例:国内二次开发,对日包人月,维保,评估报告,绩效评审", projectType.getName()); |
| | | map.put("标准单价币种;字典:人民币、美元、日元", projectType.getStandardUnitCurrency()); |
| | | map.put("标准单价金额", projectType.getStandardUnitPrice()); |
| | | map.put("标准利润金额", projectType.getStandardProfitPrice()); |
| | | map.put("标准工作量单位;字典:个,本,行", projectType.getStandardWorkloadUnit()); |
| | | map.put("备注", projectType.getRemarks()); |
| | | map.put("创建者", projectType.getCreateBy()); |
| | | map.put("创建时间", projectType.getCreateTime()); |
| | | map.put("更新者", projectType.getUpdateBy()); |
| | | map.put("更新时间", projectType.getUpdateTime()); |
| | | list.add(map); |
| | | } |
| | | FileUtil.downloadExcel(list, response); |
| | | } |
| | | |
| | | // 判断是否拥有同名的项目名称 |
| | | public void checkAddProject(ProjectType resources){ |
| | | // 根据项目类型的名称查询项目类型 |
| | | List<ProjectType> opeDeliveryMethodList = projectTypeRepository.findByName(resources.getName()); |
| | | // 判断是否存在同名的项目类型 |
| | | if(opeDeliveryMethodList.size()>0){ |
| | | // 存在返回错误 |
| | | throw new BadRequestException("已存在此项目名称"); |
| | | } |
| | | } |
| | | |
| | | // 判断修改是否拥有同名的项目名称 |
| | | public void checkUpdateProject(ProjectType resources){ |
| | | // 根据项目类型的名称查询项目类型 |
| | | List<ProjectType> opeDeliveryMethodList = projectTypeRepository.findByName(resources.getName()); |
| | | // 判断是否存在同名的项目类型 |
| | | if(opeDeliveryMethodList.size() == 1){ |
| | | // 根据id判断是否是同一条 |
| | | if(opeDeliveryMethodList.get(0).getId() != resources.getId()){ |
| | | throw new BadRequestException("已存在此项目名称"); |
| | | } else { |
| | | |
| | | } |
| | | } else if(opeDeliveryMethodList.size()<1) { |
| | | |
| | | } else { |
| | | // 存在返回错误 |
| | | throw new BadRequestException("已存在此项目名称"); |
| | | } |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.project.service.mapstruct; |
| | | |
| | | import me.zhengjie.base.BaseMapper; |
| | | import me.zhengjie.modules.project.domain.ProjectType; |
| | | import me.zhengjie.modules.project.service.dto.ProjectTypeDto; |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.ReportingPolicy; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @author HuaZhe |
| | | * @date 2022-12-14 |
| | | **/ |
| | | @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) |
| | | public interface ProjectTypeMapper extends BaseMapper<ProjectTypeDto, ProjectType> { |
| | | |
| | | } |
| | |
| | | |
| | | @ApiOperation("导出任务数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('timing:list')") |
| | | @PreAuthorize("@el.check('timing:download')") |
| | | public void exportQuartzJob(HttpServletResponse response, JobQueryCriteria criteria) throws IOException { |
| | | quartzJobService.download(quartzJobService.queryAll(criteria), response); |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 me.zhengjie.base.BaseEntity; |
| | | |
| | | 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 赵士淞 |
| | | * @date 2022-12-14 |
| | | **/ |
| | | @Entity |
| | | @Data |
| | | @Table(name="sys_level") |
| | | public class SysLevel extends BaseEntity implements Serializable { |
| | | |
| | | @Id |
| | | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| | | @Column(name = "`id`") |
| | | @ApiModelProperty(value = "ID") |
| | | private Long id; |
| | | |
| | | @Column(name = "`job_id`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "岗位ID") |
| | | private Long jobId; |
| | | |
| | | @Column(name = "`name`",nullable = false) |
| | | @NotBlank |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | |
| | | @Column(name = "`description`") |
| | | @ApiModelProperty(value = "描述") |
| | | private String description; |
| | | |
| | | @Column(name = "`level_wage`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "级别工资") |
| | | private BigDecimal levelWage; |
| | | |
| | | @Column(name = "`basic_wage_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "基本工资比例") |
| | | private Double basicWageProportion; |
| | | |
| | | @Column(name = "`achievements_wage_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "绩效工资比例") |
| | | private Double achievementsWageProportion; |
| | | |
| | | @Column(name = "`performance_wage_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "业绩工资比例") |
| | | private Double performanceWageProportion; |
| | | |
| | | @Column(name = "`team_wage_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "团队工资比例") |
| | | private Double teamWageProportion; |
| | | |
| | | @Column(name = "`accumulation_radix`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "公积金基数") |
| | | private BigDecimal accumulationRadix; |
| | | |
| | | @Column(name = "`accumulation_personal_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "公积金个人缴纳比例") |
| | | private Double accumulationPersonalProportion; |
| | | |
| | | @Column(name = "`accumulation_company_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "公积金公司缴纳比例") |
| | | private Double accumulationCompanyProportion; |
| | | |
| | | @Column(name = "`pension_radix`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "养老险基数") |
| | | private BigDecimal pensionRadix; |
| | | |
| | | @Column(name = "`pension_personal_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "养老险个人缴纳比例") |
| | | private Double pensionPersonalProportion; |
| | | |
| | | @Column(name = "`pension_company_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "养老险公司缴纳比例") |
| | | private Double pensionCompanyProportion; |
| | | |
| | | @Column(name = "`medical_radix`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "医疗险基数") |
| | | private BigDecimal medicalRadix; |
| | | |
| | | @Column(name = "`medical_personal_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "医疗险个人缴纳比例") |
| | | private Double medicalPersonalProportion; |
| | | |
| | | @Column(name = "`medical_company_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "医疗险公司缴纳比例") |
| | | private Double medicalCompanyProportion; |
| | | |
| | | @Column(name = "`unemployment_radix`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "失业险基数") |
| | | private BigDecimal unemploymentRadix; |
| | | |
| | | @Column(name = "`unemployment_personal_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "失业险个人缴纳比例") |
| | | private Double unemploymentPersonalProportion; |
| | | |
| | | @Column(name = "`unemployment_company_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "失业险公司缴纳比例") |
| | | private Double unemploymentCompanyProportion; |
| | | |
| | | @Column(name = "`maternity_radix`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "生育险基数") |
| | | private BigDecimal maternityRadix; |
| | | |
| | | @Column(name = "`maternity_personal_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "生育险个人缴纳比例") |
| | | private Double maternityPersonalProportion; |
| | | |
| | | @Column(name = "`maternity_company_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "生育险公司缴纳比例") |
| | | private Double maternityCompanyProportion; |
| | | |
| | | @Column(name = "`industrial_injury_radix`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "工伤险基数") |
| | | private BigDecimal industrialInjuryRadix; |
| | | |
| | | @Column(name = "`industrial_injury_personal_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "工伤险个人缴纳比例") |
| | | private Double industrialInjuryPersonalProportion; |
| | | |
| | | @Column(name = "`industrial_injury_company_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "工伤险公司缴纳比例") |
| | | private Double industrialInjuryCompanyProportion; |
| | | |
| | | @Column(name = "`personal_performance_proportion`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "个人业绩比例") |
| | | private Double personalPerformanceProportion; |
| | | |
| | | @Column(name = "`annual_leave_days`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "年假天数") |
| | | private Integer annualLeaveDays; |
| | | |
| | | @Column(name = "`remarks`") |
| | | @ApiModelProperty(value = "备注") |
| | | private String remarks; |
| | | |
| | | public void copy(SysLevel source){ |
| | | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); |
| | | } |
| | | } |
| | |
| | | * @date 2022-12-13 |
| | | **/ |
| | | public interface SysConfigProportionRepository extends JpaRepository<SysConfigProportion, Long>, JpaSpecificationExecutor<SysConfigProportion> { |
| | | |
| | | //根据标题查询比例表 |
| | | @Query(value = "SELECT * from sys_config_proportion WHERE title = ?", nativeQuery = true) |
| | | SysConfigProportion findByTitle(String title); |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.SysLevel; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| | | import org.springframework.data.jpa.repository.Query; |
| | | |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @author 赵士淞 |
| | | * @date 2022-12-14 |
| | | **/ |
| | | public interface SysLevelRepository extends JpaRepository<SysLevel, Long>, JpaSpecificationExecutor<SysLevel> { |
| | | |
| | | /** |
| | | * 根据岗位查询 |
| | | * @param jobIds / |
| | | * @return / |
| | | */ |
| | | @Query(value = "SELECT count(1) FROM sys_level WHERE job_id IN ?1", nativeQuery = true) |
| | | int countByJobs(Set<Long> jobIds); |
| | | } |
| | |
| | | * @date 2022-12-13 |
| | | **/ |
| | | public interface SysRosteringRepository extends JpaRepository<SysRostering, Long>, JpaSpecificationExecutor<SysRostering> { |
| | | |
| | | @Query(value = "SELECT * FROM `sys_rostering` WHERE id = ?" , nativeQuery = true) |
| | | SysRostering findByRosId(Long Id); |
| | | } |
| | |
| | | |
| | | @ApiOperation("导出部门数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('dept:list')") |
| | | @PreAuthorize("@el.check('dept:download')") |
| | | public void exportDept(HttpServletResponse response, DeptQueryCriteria criteria) throws Exception { |
| | | deptService.download(deptService.queryAll(criteria, false), response); |
| | | } |
| | |
| | | |
| | | @ApiOperation("导出字典数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('dict:list')") |
| | | @PreAuthorize("@el.check('dict:download')") |
| | | public void exportDict(HttpServletResponse response, DictQueryCriteria criteria) throws IOException { |
| | | dictService.download(dictService.queryAll(criteria), response); |
| | | } |
| | |
| | | |
| | | @ApiOperation("导出岗位数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('job:list')") |
| | | @PreAuthorize("@el.check('job:download')") |
| | | public void exportJob(HttpServletResponse response, JobQueryCriteria criteria) throws IOException { |
| | | jobService.download(jobService.queryAll(criteria), response); |
| | | } |
| | |
| | | return new ResponseEntity<>(jobService.queryAll(criteria, pageable),HttpStatus.OK); |
| | | } |
| | | |
| | | @ApiOperation("查询岗位") |
| | | @GetMapping(value = "/all") |
| | | @PreAuthorize("@el.check('job:list','user:list')") |
| | | public ResponseEntity<Object> queryJob(JobQueryCriteria criteria){ |
| | | return new ResponseEntity<>(jobService.queryAll(criteria),HttpStatus.OK); |
| | | } |
| | | |
| | | @Log("新增岗位") |
| | | @ApiOperation("新增岗位") |
| | | @PostMapping |
| | |
| | | |
| | | @ApiOperation("导出菜单数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('menu:list')") |
| | | @PreAuthorize("@el.check('menu:download')") |
| | | public void exportMenu(HttpServletResponse response, MenuQueryCriteria criteria) throws Exception { |
| | | menuService.download(menuService.queryAll(criteria, false), response); |
| | | } |
| | |
| | | |
| | | @ApiOperation("导出角色数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('role:list')") |
| | | @PreAuthorize("@el.check('role:download')") |
| | | public void exportRole(HttpServletResponse response, RoleQueryCriteria criteria) throws IOException { |
| | | roleService.download(roleService.queryAll(criteria), response); |
| | | } |
| | |
| | | @Log("导出数据") |
| | | @ApiOperation("导出数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('sysConfigIndividualIncomeTax:list')") |
| | | @PreAuthorize("@el.check('sysConfigIndividualIncomeTax:download')") |
| | | public void exportSysConfigIndividualIncomeTax(HttpServletResponse response, SysConfigIndividualIncomeTaxQueryCriteria criteria) throws IOException { |
| | | sysConfigIndividualIncomeTaxService.download(sysConfigIndividualIncomeTaxService.queryAll(criteria), response); |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.SysLevel; |
| | | import me.zhengjie.modules.system.service.SysLevelService; |
| | | import me.zhengjie.modules.system.service.dto.SysLevelQueryCriteria; |
| | | 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; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @author 赵士淞 |
| | | * @date 2022-12-14 |
| | | **/ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "级别管理") |
| | | @RequestMapping("/api/sysLevel") |
| | | public class SysLevelController { |
| | | |
| | | private final SysLevelService sysLevelService; |
| | | |
| | | @Log("导出数据") |
| | | @ApiOperation("导出数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('sysLevel:download')") |
| | | public void exportSysLevel(HttpServletResponse response, SysLevelQueryCriteria criteria) throws IOException { |
| | | sysLevelService.download(sysLevelService.queryAll(criteria), response); |
| | | } |
| | | |
| | | @GetMapping |
| | | @Log("查询级别") |
| | | @ApiOperation("查询级别") |
| | | @PreAuthorize("@el.check('sysLevel:list')") |
| | | public ResponseEntity<Object> querySysLevel(SysLevelQueryCriteria criteria, Pageable pageable){ |
| | | return new ResponseEntity<>(sysLevelService.queryAll(criteria,pageable),HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/all") |
| | | @Log("查询级别") |
| | | @ApiOperation("查询级别") |
| | | @PreAuthorize("@el.check('sysLevel:list')") |
| | | public ResponseEntity<Object> querySysLevel(SysLevelQueryCriteria criteria){ |
| | | return new ResponseEntity<>(sysLevelService.queryAll(criteria),HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping |
| | | @Log("新增级别") |
| | | @ApiOperation("新增级别") |
| | | @PreAuthorize("@el.check('sysLevel:add')") |
| | | public ResponseEntity<Object> createSysLevel(@Validated @RequestBody SysLevel resources){ |
| | | return new ResponseEntity<>(sysLevelService.create(resources),HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PutMapping |
| | | @Log("修改级别") |
| | | @ApiOperation("修改级别") |
| | | @PreAuthorize("@el.check('sysLevel:edit')") |
| | | public ResponseEntity<Object> updateSysLevel(@Validated @RequestBody SysLevel resources){ |
| | | sysLevelService.update(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @Log("删除级别") |
| | | @ApiOperation("删除级别") |
| | | @PreAuthorize("@el.check('sysLevel:del')") |
| | | public ResponseEntity<Object> deleteSysLevel(@RequestBody Long[] ids) { |
| | | sysLevelService.deleteAll(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | } |
| | |
| | | |
| | | @ApiOperation("导出用户数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('user:list')") |
| | | @PreAuthorize("@el.check('user:download')") |
| | | public void exportUser(HttpServletResponse response, UserQueryCriteria criteria) throws IOException { |
| | | userService.download(userService.queryAll(criteria), response); |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.SysLevel; |
| | | import me.zhengjie.modules.system.service.dto.SysLevelDto; |
| | | import me.zhengjie.modules.system.service.dto.SysLevelQueryCriteria; |
| | | import org.springframework.data.domain.Pageable; |
| | | import java.util.Map; |
| | | import java.util.List; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @description 服务接口 |
| | | * @author 赵士淞 |
| | | * @date 2022-12-14 |
| | | **/ |
| | | public interface SysLevelService { |
| | | |
| | | /** |
| | | * 查询数据分页 |
| | | * @param criteria 条件 |
| | | * @param pageable 分页参数 |
| | | * @return Map<String,Object> |
| | | */ |
| | | Map<String,Object> queryAll(SysLevelQueryCriteria criteria, Pageable pageable); |
| | | |
| | | /** |
| | | * 查询所有数据不分页 |
| | | * @param criteria 条件参数 |
| | | * @return List<SysLevelDto> |
| | | */ |
| | | List<SysLevelDto> queryAll(SysLevelQueryCriteria criteria); |
| | | |
| | | /** |
| | | * 根据ID查询 |
| | | * @param id ID |
| | | * @return SysLevelDto |
| | | */ |
| | | SysLevelDto findById(Long id); |
| | | |
| | | /** |
| | | * 创建 |
| | | * @param resources / |
| | | * @return SysLevelDto |
| | | */ |
| | | SysLevelDto create(SysLevel resources); |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param resources / |
| | | */ |
| | | void update(SysLevel resources); |
| | | |
| | | /** |
| | | * 多选删除 |
| | | * @param ids / |
| | | */ |
| | | void deleteAll(Long[] ids); |
| | | |
| | | /** |
| | | * 导出数据 |
| | | * @param all 待导出的数据 |
| | | * @param response / |
| | | * @throws IOException / |
| | | */ |
| | | void download(List<SysLevelDto> all, HttpServletResponse response) throws IOException; |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.base.BaseDTO; |
| | | |
| | | import java.sql.Timestamp; |
| | | import java.math.BigDecimal; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @description / |
| | | * @author 赵士淞 |
| | | * @date 2022-12-14 |
| | | **/ |
| | | @Data |
| | | public class SysLevelDto extends BaseDTO implements Serializable { |
| | | |
| | | /** ID */ |
| | | private Long id; |
| | | |
| | | /** 岗位ID */ |
| | | private Long jobId; |
| | | |
| | | /** 名称 */ |
| | | private String name; |
| | | |
| | | /** 描述 */ |
| | | private String description; |
| | | |
| | | /** 级别工资 */ |
| | | private BigDecimal levelWage; |
| | | |
| | | /** 基本工资比例 */ |
| | | private Double basicWageProportion; |
| | | |
| | | /** 绩效工资比例 */ |
| | | private Double achievementsWageProportion; |
| | | |
| | | /** 业绩工资比例 */ |
| | | private Double performanceWageProportion; |
| | | |
| | | /** 团队工资比例 */ |
| | | private Double teamWageProportion; |
| | | |
| | | /** 公积金基数 */ |
| | | private BigDecimal accumulationRadix; |
| | | |
| | | /** 公积金个人缴纳比例 */ |
| | | private Double accumulationPersonalProportion; |
| | | |
| | | /** 公积金公司缴纳比例 */ |
| | | private Double accumulationCompanyProportion; |
| | | |
| | | /** 养老险基数 */ |
| | | private BigDecimal pensionRadix; |
| | | |
| | | /** 养老险个人缴纳比例 */ |
| | | private Double pensionPersonalProportion; |
| | | |
| | | /** 养老险公司缴纳比例 */ |
| | | private Double pensionCompanyProportion; |
| | | |
| | | /** 医疗险基数 */ |
| | | private BigDecimal medicalRadix; |
| | | |
| | | /** 医疗险个人缴纳比例 */ |
| | | private Double medicalPersonalProportion; |
| | | |
| | | /** 医疗险公司缴纳比例 */ |
| | | private Double medicalCompanyProportion; |
| | | |
| | | /** 失业险基数 */ |
| | | private BigDecimal unemploymentRadix; |
| | | |
| | | /** 失业险个人缴纳比例 */ |
| | | private Double unemploymentPersonalProportion; |
| | | |
| | | /** 失业险公司缴纳比例 */ |
| | | private Double unemploymentCompanyProportion; |
| | | |
| | | /** 生育险基数 */ |
| | | private BigDecimal maternityRadix; |
| | | |
| | | /** 生育险个人缴纳比例 */ |
| | | private Double maternityPersonalProportion; |
| | | |
| | | /** 生育险公司缴纳比例 */ |
| | | private Double maternityCompanyProportion; |
| | | |
| | | /** 工伤险基数 */ |
| | | private BigDecimal industrialInjuryRadix; |
| | | |
| | | /** 工伤险个人缴纳比例 */ |
| | | private Double industrialInjuryPersonalProportion; |
| | | |
| | | /** 工伤险公司缴纳比例 */ |
| | | private Double industrialInjuryCompanyProportion; |
| | | |
| | | /** 个人业绩比例 */ |
| | | private Double personalPerformanceProportion; |
| | | |
| | | /** 年假天数 */ |
| | | private Integer annualLeaveDays; |
| | | |
| | | /** 备注 */ |
| | | private String remarks; |
| | | |
| | | /** 岗位名称 */ |
| | | private String jobName; |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 赵士淞 |
| | | * @date 2022-12-14 |
| | | **/ |
| | | @Data |
| | | public class SysLevelQueryCriteria{ |
| | | |
| | | /** 精确 */ |
| | | @Query |
| | | private Long jobId; |
| | | |
| | | /** 模糊 */ |
| | | @Query(type = Query.Type.INNER_LIKE) |
| | | private String name; |
| | | } |
| | |
| | | import me.zhengjie.exception.BadRequestException; |
| | | import me.zhengjie.exception.EntityExistException; |
| | | import me.zhengjie.modules.system.domain.Job; |
| | | import me.zhengjie.modules.system.repository.SysLevelRepository; |
| | | import me.zhengjie.modules.system.repository.UserRepository; |
| | | import me.zhengjie.modules.system.service.dto.JobQueryCriteria; |
| | | import me.zhengjie.utils.*; |
| | |
| | | private final JobMapper jobMapper; |
| | | private final RedisUtils redisUtils; |
| | | private final UserRepository userRepository; |
| | | private final SysLevelRepository sysLevelRepository; |
| | | |
| | | @Override |
| | | public Map<String,Object> queryAll(JobQueryCriteria criteria, Pageable pageable) { |
| | |
| | | if(userRepository.countByJobs(ids) > 0){ |
| | | throw new BadRequestException("所选的岗位中存在用户关联,请解除关联再试!"); |
| | | } |
| | | if(sysLevelRepository.countByJobs(ids) > 0) { |
| | | throw new BadRequestException("所选的岗位中存在级别关联,请解除关联再试!"); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /** |
| | | * 判断金额是否存在 |
| | | * 重名验证 |
| | | */ |
| | | public void getInfo(SysConfigIndividualIncomeTax resources,SysConfigIndividualIncomeTax sysConfigIndividualIncomeTax){ |
| | | // 根据金额查询 |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public SysConfigProportionDto create(SysConfigProportion resources) { |
| | | //判断标题是否存在 |
| | | getInfo(resources,null); |
| | | return sysConfigProportionMapper.toDto(sysConfigProportionRepository.save(resources)); |
| | | } |
| | | |
| | |
| | | public void update(SysConfigProportion resources) { |
| | | SysConfigProportion sysConfigProportion = sysConfigProportionRepository.findById(resources.getId()).orElseGet(SysConfigProportion::new); |
| | | ValidationUtil.isNull( sysConfigProportion.getId(),"SysConfigProportion","id",resources.getId()); |
| | | getInfo(resources,sysConfigProportion); |
| | | sysConfigProportion.copy(resources); |
| | | sysConfigProportionRepository.save(sysConfigProportion); |
| | | } |
| | | |
| | | /** |
| | | * 重名验证 |
| | | * @param / |
| | | */ |
| | | public void getInfo(SysConfigProportion resources,SysConfigProportion sysConfigProportion){ |
| | | //根据标题查询比例表 |
| | | SysConfigProportion configProportion = sysConfigProportionRepository.findByTitle(resources.getTitle()); |
| | | if(ObjectUtils.isNotEmpty(resources.getId())){ |
| | | if(configProportion != null && configProportion.getId() != sysConfigProportion.getId()){ |
| | | throw new BadRequestException("标题已存在"); |
| | | } |
| | | }else{ |
| | | if(configProportion != null){ |
| | | throw new BadRequestException("标题已存在"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void deleteAll(Long[] ids) { |
| | | for (Long id : ids) { |
| New file |
| | |
| | | /* |
| | | * 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.Job; |
| | | import me.zhengjie.modules.system.domain.SysLevel; |
| | | import me.zhengjie.modules.system.repository.JobRepository; |
| | | import me.zhengjie.utils.ValidationUtil; |
| | | import me.zhengjie.utils.FileUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import me.zhengjie.modules.system.repository.SysLevelRepository; |
| | | import me.zhengjie.modules.system.service.SysLevelService; |
| | | import me.zhengjie.modules.system.service.dto.SysLevelDto; |
| | | import me.zhengjie.modules.system.service.dto.SysLevelQueryCriteria; |
| | | import me.zhengjie.modules.system.service.mapstruct.SysLevelMapper; |
| | | 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 java.util.function.Function; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @description 服务实现 |
| | | * @author 赵士淞 |
| | | * @date 2022-12-14 |
| | | **/ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class SysLevelServiceImpl implements SysLevelService { |
| | | |
| | | private final SysLevelRepository sysLevelRepository; |
| | | private final SysLevelMapper sysLevelMapper; |
| | | private final JobRepository jobRepository; |
| | | |
| | | @Override |
| | | public Map<String,Object> queryAll(SysLevelQueryCriteria criteria, Pageable pageable){ |
| | | Page<SysLevel> page = sysLevelRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); |
| | | // 将实体类转换为DTO(重写) |
| | | Function<SysLevel, SysLevelDto> func = new Function<SysLevel, SysLevelDto>(){ |
| | | @Override |
| | | public SysLevelDto apply(SysLevel t) { |
| | | // 将实体类转换成DTO |
| | | SysLevelDto sysLevelDto = sysLevelMapper.toDto(t); |
| | | // 根据岗位ID查询岗位信息 |
| | | Job job = jobRepository.findById(sysLevelDto.getJobId()).orElseGet(Job::new); |
| | | ValidationUtil.isNull(job.getId(),"Job","id",sysLevelDto.getJobId()); |
| | | // 岗位名称 |
| | | sysLevelDto.setJobName(job.getName()); |
| | | // 返回处理好的DTO |
| | | return sysLevelDto; |
| | | } |
| | | }; |
| | | return PageUtil.toPage(page.map(func)); |
| | | } |
| | | |
| | | @Override |
| | | public List<SysLevelDto> queryAll(SysLevelQueryCriteria criteria){ |
| | | return sysLevelMapper.toDto(sysLevelRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public SysLevelDto findById(Long id) { |
| | | SysLevel sysLevel = sysLevelRepository.findById(id).orElseGet(SysLevel::new); |
| | | ValidationUtil.isNull(sysLevel.getId(),"SysLevel","id",id); |
| | | return sysLevelMapper.toDto(sysLevel); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public SysLevelDto create(SysLevel resources) { |
| | | return sysLevelMapper.toDto(sysLevelRepository.save(resources)); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void update(SysLevel resources) { |
| | | SysLevel sysLevel = sysLevelRepository.findById(resources.getId()).orElseGet(SysLevel::new); |
| | | ValidationUtil.isNull( sysLevel.getId(),"SysLevel","id",resources.getId()); |
| | | sysLevel.copy(resources); |
| | | sysLevelRepository.save(sysLevel); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteAll(Long[] ids) { |
| | | for (Long id : ids) { |
| | | sysLevelRepository.deleteById(id); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void download(List<SysLevelDto> all, HttpServletResponse response) throws IOException { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (SysLevelDto sysLevel : all) { |
| | | Map<String,Object> map = new LinkedHashMap<>(); |
| | | map.put("岗位ID", sysLevel.getJobId()); |
| | | map.put("名称", sysLevel.getName()); |
| | | map.put("描述", sysLevel.getDescription()); |
| | | map.put("级别工资", sysLevel.getLevelWage()); |
| | | map.put("基本工资比例", sysLevel.getBasicWageProportion()); |
| | | map.put("绩效工资比例", sysLevel.getAchievementsWageProportion()); |
| | | map.put("业绩工资比例", sysLevel.getPerformanceWageProportion()); |
| | | map.put("团队工资比例", sysLevel.getTeamWageProportion()); |
| | | map.put("公积金基数", sysLevel.getAccumulationRadix()); |
| | | map.put("公积金个人缴纳比例", sysLevel.getAccumulationPersonalProportion()); |
| | | map.put("公积金公司缴纳比例", sysLevel.getAccumulationCompanyProportion()); |
| | | map.put("养老险基数", sysLevel.getPensionRadix()); |
| | | map.put("养老险个人缴纳比例", sysLevel.getPensionPersonalProportion()); |
| | | map.put("养老险公司缴纳比例", sysLevel.getPensionCompanyProportion()); |
| | | map.put("医疗险基数", sysLevel.getMedicalRadix()); |
| | | map.put("医疗险个人缴纳比例", sysLevel.getMedicalPersonalProportion()); |
| | | map.put("医疗险公司缴纳比例", sysLevel.getMedicalCompanyProportion()); |
| | | map.put("失业险基数", sysLevel.getUnemploymentRadix()); |
| | | map.put("失业险个人缴纳比例", sysLevel.getUnemploymentPersonalProportion()); |
| | | map.put("失业险公司缴纳比例", sysLevel.getUnemploymentCompanyProportion()); |
| | | map.put("生育险基数", sysLevel.getMaternityRadix()); |
| | | map.put("生育险个人缴纳比例", sysLevel.getMaternityPersonalProportion()); |
| | | map.put("生育险公司缴纳比例", sysLevel.getMaternityCompanyProportion()); |
| | | map.put("工伤险基数", sysLevel.getIndustrialInjuryRadix()); |
| | | map.put("工伤险个人缴纳比例", sysLevel.getIndustrialInjuryPersonalProportion()); |
| | | map.put("工伤险公司缴纳比例", sysLevel.getIndustrialInjuryCompanyProportion()); |
| | | map.put("个人业绩比例", sysLevel.getPersonalPerformanceProportion()); |
| | | map.put("年假天数", sysLevel.getAnnualLeaveDays()); |
| | | map.put("备注", sysLevel.getRemarks()); |
| | | map.put("创建者", sysLevel.getCreateBy()); |
| | | map.put("创建时间", sysLevel.getCreateTime()); |
| | | map.put("更新者", sysLevel.getUpdateBy()); |
| | | map.put("更新时间", sysLevel.getUpdateTime()); |
| | | list.add(map); |
| | | } |
| | | FileUtil.downloadExcel(list, response); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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.SysLevel; |
| | | import me.zhengjie.modules.system.service.dto.SysLevelDto; |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.ReportingPolicy; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @author 赵士淞 |
| | | * @date 2022-12-14 |
| | | **/ |
| | | @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) |
| | | public interface SysLevelMapper extends BaseMapper<SysLevelDto, SysLevel> { |
| | | |
| | | } |
| | |
| | | |
| | | @ApiOperation("导出数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('storage:list')") |
| | | @PreAuthorize("@el.check('storage:download')") |
| | | public void exportFile(HttpServletResponse response, LocalStorageQueryCriteria criteria) throws IOException { |
| | | localStorageService.download(localStorageService.queryAll(criteria), response); |
| | | } |
| New file |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | export function getAll(data) { |
| | | return request({ |
| | | url: 'api/projectType/all', |
| | | method: 'get', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export function add(data) { |
| | | return request({ |
| | | url: 'api/projectType', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export function del(ids) { |
| | | return request({ |
| | | url: 'api/projectType/', |
| | | method: 'delete', |
| | | data: ids |
| | | }) |
| | | } |
| | | |
| | | export function edit(data) { |
| | | return request({ |
| | | url: 'api/projectType', |
| | | method: 'put', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export default { getAll, add, edit, del } |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del } |
| | | export default { getAll, add, edit, del } |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | export function getAllJob() { |
| | | const params = { |
| | | page: 0, |
| | | size: 9999, |
| | | enabled: true |
| | | } |
| | | export function getAll(params) { |
| | | return request({ |
| | | url: 'api/job', |
| | | url: 'api/job/all', |
| | | method: 'get', |
| | | params |
| | | }) |
| | |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del } |
| | | export default { getAll, add, edit, del } |
| New file |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | export function getAll(params) { |
| | | return request({ |
| | | url: 'api/sysLevel/all', |
| | | method: 'get', |
| | | params |
| | | }) |
| | | } |
| | | |
| | | export function add(data) { |
| | | return request({ |
| | | url: 'api/sysLevel', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export function del(ids) { |
| | | return request({ |
| | | url: 'api/sysLevel/', |
| | | method: 'delete', |
| | | data: ids |
| | | }) |
| | | } |
| | | |
| | | export function edit(data) { |
| | | return request({ |
| | | url: 'api/sysLevel', |
| | | method: 'put', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export default { getAll, add, edit, del } |
| | |
| | | // 最大页数 |
| | | export const MAX_PAGE = 0 |
| | | // 最大条数 |
| | | export const MAX_SIZE = 99999 |
| | | // 比例配置:基本工资比例 |
| | | export const CONFIG_PROPORTION_BASIC_WAGE = '基本工资比例' |
| | | // 比例配置:绩效工资比例 |
| | | export const CONFIG_PROPORTION_MERIT_WAGE = '绩效工资比例' |
| | | // 比例配置:业绩工资比例 |
| | | export const CONFIG_PROPORTION_ACHIEVEMENT_WAGE = '业绩工资比例' |
| | | // 比例配置:团队工资比例 |
| | | export const CONFIG_PROPORTION_TEAM_WAGE = '团队工资比例' |
| | | // 比例配置:公积金个人缴纳比例 |
| | | export const CONFIG_PROPORTION_ACCUMULATION_FUND_PERSONAL = '公积金个人缴纳比例' |
| | | // 比例配置:公积金公司缴纳比例 |
| | | export const CONFIG_PROPORTION_ACCUMULATION_FUND_COMPANY = '公积金公司缴纳比例' |
| | | // 比例配置:养老险个人缴纳比例 |
| | | export const CONFIG_PROPORTION_PENSION_INSURANCE_PERSONAL = '养老险个人缴纳比例' |
| | | // 比例配置:养老险公司缴纳比例 |
| | | export const CONFIG_PROPORTION_PENSION_INSURANCE_COMPANY = '养老险公司缴纳比例' |
| | | // 比例配置:医疗险个人缴纳比例 |
| | | export const CONFIG_PROPORTION_MEDICAL_INSURANCE_PERSONAL = '医疗险个人缴纳比例' |
| | | // 比例配置:医疗险公司缴纳比例 |
| | | export const CONFIG_PROPORTION_MEDICAL_INSURANCE_COMPANY = '医疗险公司缴纳比例' |
| | | // 比例配置:失业险个人缴纳比例 |
| | | export const CONFIG_PROPORTION_UNEMPLOYMENT_INSURANCE_PERSONAL = '失业险个人缴纳比例' |
| | | // 比例配置:失业险公司缴纳比例 |
| | | export const CONFIG_PROPORTION_UNEMPLOYMENT_INSURANCE_COMPANY = '失业险公司缴纳比例' |
| | | // 比例配置:生育险个人缴纳比例 |
| | | export const CONFIG_PROPORTION_MATERNITY_INSURANCE_PERSONAL = '生育险个人缴纳比例' |
| | | // 比例配置:生育险公司缴纳比例 |
| | | export const CONFIG_PROPORTION_MATERNITY_INSURANCE_COMPANY = '生育险公司缴纳比例' |
| | | // 比例配置:工伤险个人缴纳比例 |
| | | export const CONFIG_PROPORTION_INDUSTRIAL_INJURY_INSURANCE_PERSONAL = '工伤险个人缴纳比例' |
| | | // 比例配置:工伤险公司缴纳比例 |
| | | export const CONFIG_PROPORTION_INDUSTRIAL_INJURY_INSURANCE_COMPANY = '工伤险公司缴纳比例' |
| | | // 比例配置:个人业绩比例 |
| | | export const CONFIG_PROPORTION_PERSONAL_PERFORMANCE = '个人业绩比例' |
| | | |
| | | // 真 |
| | | export const TRUE = true |
| | | // 假 |
| | | export const FALSE = false |
| | | |
| | | // 默认部门 |
| | | export const DEFAULT_DEPT = 1 |
| | | // 默认岗位 |
| | | export const DEFAULT_JOBS = 1 |
| | | |
| | | // 国家:中国 |
| | | export const COUNTRY_CHINA = '中国' |
| | | // 国家:日本 |
| | | export const COUNTRY_JAPAN = '日本' |
| | | |
| | | // 配置:寄件码打印标题 |
| | | export const CONFIG_PRINT_TITLE = '寄件码打印标题' |
| | | |
| | | // 使用情况 |
| | | export const USE_CASE = 'use_case' |
| | | |
| | | // 使用状态 |
| | | export const USAGE_STATUS = 'usage_status' |
| | | // 使用状态:使用中 |
| | | export const USAGE_STATUS_USED = 'usage_status_used' |
| | | // 使用状态:已停用 |
| | | export const USAGE_STATUS_DEACTIVATED = 'usage_status_deactivated' |
| | | |
| | | // 包裹状态 |
| | | export const PACKAGE_STATUS = 'package_status' |
| | | // 包裹状态:等待处理 |
| | | export const PACKAGE_STATUS_WAITING = 'package_status_waiting' |
| | | // 包裹状态:已取件 |
| | | export const PACKAGE_STATUS_PICKED = 'package_status_picked' |
| | | // 包裹状态:已入库 |
| | | export const PACKAGE_STATUS_WAREHOUSING = 'package_status_warehousing' |
| | | // 包裹状态:已发货 |
| | | export const PACKAGE_STATUS_SHIPPED = 'package_status_shipped' |
| | | |
| | | // 预约状态 |
| | | export const APPOINTMENT_STATUS = 'appointment_status' |
| | | // 预约状态:等待处理 |
| | | export const APPOINTMENT_STATUS_WAITING = 'appointment_status_waiting' |
| | | // 预约状态:已取消 |
| | | export const APPOINTMENT_STATUS_CANCELED = 'appointment_status_canceled' |
| | | // 预约状态:预约成功 |
| | | export const APPOINTMENT_STATUS_SUCCESS = 'appointment_status_success' |
| | | // 预约状态:已完成 |
| | | export const APPOINTMENT_STATUS_COMPLETED = 'appointment_status_completed' |
| | | |
| | | // 地址类型 |
| | | export const ADDRESS_TYPE = 'address_type' |
| | | // 地址类型:中国地址 |
| | | export const ADDRESS_TYPE_CHINA = 'address_type_china' |
| | | // 地址类型:日本地址 |
| | | export const ADDRESS_TYPE_JAPEN = 'address_type_japen' |
| | | // 地址类型:国际地址 |
| | | export const ADDRESS_TYPE_INTERNATIONAL = 'address_type_international' |
| | | |
| | | // 包裹分类:XX杂货(用于模糊查询判定是否为杂货) |
| | | export const PACKAGE_CLASSIFICATION_GROCERY = '杂货' |
| | | // 日期类型 |
| | | export const DATE_TYPE = 'date_type' |
| | | // 日期类型:工作日 |
| | | export const DATE_TYPE_WEEKDAY = 'date_type_weekday' |
| | | // 日期类型: 节假日(法定) |
| | | export const DATE_TYPE_LEGAL_HOLIDAYS = 'date_type_legal_holid' |
| | | // 日期类型: 节假日(串休) |
| | | export const DATE_TYPE_HOLIDAYS = 'date_type_holidays' |
| | | |
| | | export default { |
| | | MAX_PAGE, |
| | | MAX_SIZE, |
| | | TRUE, |
| | | FALSE, |
| | | DEFAULT_DEPT, |
| | | DEFAULT_JOBS, |
| | | COUNTRY_CHINA, |
| | | COUNTRY_JAPAN, |
| | | CONFIG_PRINT_TITLE, |
| | | USE_CASE, |
| | | USAGE_STATUS, |
| | | USAGE_STATUS_USED, |
| | | USAGE_STATUS_DEACTIVATED, |
| | | PACKAGE_STATUS, |
| | | PACKAGE_STATUS_WAITING, |
| | | PACKAGE_STATUS_PICKED, |
| | | PACKAGE_STATUS_WAREHOUSING, |
| | | PACKAGE_STATUS_SHIPPED, |
| | | APPOINTMENT_STATUS, |
| | | APPOINTMENT_STATUS_WAITING, |
| | | APPOINTMENT_STATUS_CANCELED, |
| | | APPOINTMENT_STATUS_SUCCESS, |
| | | APPOINTMENT_STATUS_COMPLETED, |
| | | ADDRESS_TYPE, |
| | | ADDRESS_TYPE_CHINA, |
| | | ADDRESS_TYPE_JAPEN, |
| | | ADDRESS_TYPE_INTERNATIONAL, |
| | | PACKAGE_CLASSIFICATION_GROCERY |
| | | CONFIG_PROPORTION_BASIC_WAGE, |
| | | CONFIG_PROPORTION_MERIT_WAGE, |
| | | CONFIG_PROPORTION_ACHIEVEMENT_WAGE, |
| | | CONFIG_PROPORTION_TEAM_WAGE, |
| | | CONFIG_PROPORTION_ACCUMULATION_FUND_PERSONAL, |
| | | CONFIG_PROPORTION_ACCUMULATION_FUND_COMPANY, |
| | | CONFIG_PROPORTION_PENSION_INSURANCE_PERSONAL, |
| | | CONFIG_PROPORTION_PENSION_INSURANCE_COMPANY, |
| | | CONFIG_PROPORTION_MEDICAL_INSURANCE_PERSONAL, |
| | | CONFIG_PROPORTION_MEDICAL_INSURANCE_COMPANY, |
| | | CONFIG_PROPORTION_UNEMPLOYMENT_INSURANCE_PERSONAL, |
| | | CONFIG_PROPORTION_UNEMPLOYMENT_INSURANCE_COMPANY, |
| | | CONFIG_PROPORTION_MATERNITY_INSURANCE_PERSONAL, |
| | | CONFIG_PROPORTION_MATERNITY_INSURANCE_COMPANY, |
| | | CONFIG_PROPORTION_INDUSTRIAL_INJURY_INSURANCE_PERSONAL, |
| | | CONFIG_PROPORTION_INDUSTRIAL_INJURY_INSURANCE_COMPANY, |
| | | CONFIG_PROPORTION_PERSONAL_PERFORMANCE, |
| | | DATE_TYPE, |
| | | DATE_TYPE_WEEKDAY, |
| | | DATE_TYPE_LEGAL_HOLIDAYS, |
| | | DATE_TYPE_HOLIDAYS |
| | | } |
| | |
| | | permission: { |
| | | add: ['admin', 'app:add'], |
| | | edit: ['admin', 'app:edit'], |
| | | del: ['admin', 'app:del'] |
| | | del: ['admin', 'app:del'], |
| | | download: ['admin', 'app:download'] |
| | | }, |
| | | rules: { |
| | | name: [ |
| | |
| | | permission: { |
| | | add: ['admin', 'database:add'], |
| | | edit: ['admin', 'database:edit'], |
| | | del: ['admin', 'database:del'] |
| | | del: ['admin', 'database:del'], |
| | | download: ['admin', 'database:download'] |
| | | }, |
| | | rules: { |
| | | name: [ |
| | |
| | | permission: { |
| | | add: ['admin', 'deploy:add'], |
| | | edit: ['admin', 'deploy:edit'], |
| | | del: ['admin', 'deploy:del'] |
| | | del: ['admin', 'deploy:del'], |
| | | download: ['admin', 'deploy:download'] |
| | | }, |
| | | rules: { |
| | | 'app.id': [ |
| | |
| | | return { |
| | | delLoading: false, |
| | | permission: { |
| | | del: ['admin', 'deployHistory:del'] |
| | | del: ['admin', 'deployHistory:del'], |
| | | download: ['admin', 'deployHistory:download'] |
| | | } |
| | | } |
| | | }, |
| | |
| | | permission: { |
| | | add: ['admin', 'serverDeploy:add'], |
| | | edit: ['admin', 'serverDeploy:edit'], |
| | | del: ['admin', 'serverDeploy:del'] |
| | | del: ['admin', 'serverDeploy:del'], |
| | | download: ['admin', 'serverDeploy:download'] |
| | | }, |
| | | rules: { |
| | | name: [ |
| | |
| | | add: false, |
| | | edit: false, |
| | | del: false, |
| | | download: true |
| | | download: false |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | add: false, |
| | | edit: false, |
| | | del: false, |
| | | download: true |
| | | download: false |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | add: false, |
| | | edit: false, |
| | | del: false, |
| | | download: true |
| | | download: false |
| | | } |
| | | }, |
| | | methods: { |
| New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <!--工具栏--> |
| | | <div class="head-container"> |
| | | <div v-if="crud.props.searchToggle"> |
| | | <!-- 搜索 --> |
| | | <el-input v-model="query.name" clearable placeholder="请输入名称" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" /> |
| | | <el-select v-model="query.standardUnitCurrency" filterable placeholder="请选择标准单价币种" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery"> |
| | | <el-option |
| | | v-for="item in dict[standardUnitCurrency]" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | <rrOperation /> |
| | | </div> |
| | | <!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
| | | <crudOperation :permission="permission" /> |
| | | <!--表单组件--> |
| | | <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> |
| | | <el-form ref="form" :model="form" :rules="rules" size="small" label-width="120px"> |
| | | <el-form-item label="名称" prop="name"> |
| | | <el-input v-model="form.name" maxlength="100" style="width: 330px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="标准单价币种" prop="standardUnitCurrency"> |
| | | <el-select v-model="form.standardUnitCurrency" filterable placeholder="请选择" style="width: 330px;"> |
| | | <el-option |
| | | v-for="item in dict[standardUnitCurrency]" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="标准单价金额" prop="standardUnitPrice"> |
| | | <money-input :key="random" v-model="form.standardUnitPrice" :width="330" /> |
| | | </el-form-item> |
| | | <el-form-item label="标准利润金额" prop="standardProfitPrice"> |
| | | <money-input :key="random" v-model="form.standardProfitPrice" :width="330" /> |
| | | </el-form-item> |
| | | <el-form-item label="标准工作量单位" prop="standardWorkloadUnit"> |
| | | <el-select v-model="form.standardWorkloadUnit" filterable placeholder="请选择" style="width: 330px;"> |
| | | <el-option |
| | | v-for="item in dict[standardWorkloadUnit]" |
| | | :key="item.id" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="form.remarks" :rows="3" type="textarea" maxlength="1000" style="width: 330px;" /> |
| | | </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="name" label="名称" show-overflow-tooltip /> |
| | | <el-table-column prop="standardUnitCurrency" label="标准单价币种"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ dict.label[standardUnitCurrency][scope.row.standardUnitCurrency] }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="standardUnitPrice" label="标准单价金额"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.standardUnitPrice) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="standardProfitPrice" label="标准利润金额"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.standardProfitPrice) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="standardWorkloadUnit" label="标准工作量单位"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ dict.label[standardWorkloadUnit][scope.row.standardWorkloadUnit] }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remarks" label="备注" show-overflow-tooltip /> |
| | | <el-table-column v-if="checkPer(['admin','projectType:edit','projectType: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 crudProjectType from '@/api/project/projectType' |
| | | 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 moneyInput from '../../assembly/moneyInput/index.vue' |
| | | import constant from '../../../utils/constant' |
| | | |
| | | const defaultForm = { id: null, name: null, standardUnitCurrency: null, standardUnitPrice: null, standardProfitPrice: null, standardWorkloadUnit: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | export default { |
| | | name: 'ProjectType', |
| | | components: { pagination, crudOperation, rrOperation, udOperation, moneyInput }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | dicts: ['standard_unit_currency', 'standard_workload_unit'], |
| | | cruds() { |
| | | return CRUD({ title: '项目类型', url: 'api/projectType', idField: 'id', sort: 'id,desc', crudMethod: { ...crudProjectType }}) |
| | | }, |
| | | data() { |
| | | var checkStandardUnitPricet = (rule, value, callback) => { |
| | | if (value !== null) { |
| | | if (isNaN(Number(value))) { |
| | | callback(new Error('标准单价金额必须是数字')) |
| | | } else { |
| | | if (value <= 0) { |
| | | callback(new Error('标准单价金额必须大于0')) |
| | | } else if (value >= 10000000000) { |
| | | callback(new Error('标准单价金额必须小于1百亿')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | } else { |
| | | callback(new Error('标准单价金额不能为空')) |
| | | } |
| | | } |
| | | var checkStandardProfitPrice = (rule, value, callback) => { |
| | | if (value !== null) { |
| | | if (isNaN(Number(value))) { |
| | | callback(new Error('标准利润金额必须是数字')) |
| | | } else { |
| | | if (value <= 0) { |
| | | callback(new Error('标准利润金额必须大于0')) |
| | | } else if (value >= 10000000000) { |
| | | callback(new Error('标准利润金额必须小于1百亿')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | } else { |
| | | callback(new Error('标准利润金额不能为空')) |
| | | } |
| | | } |
| | | return { |
| | | permission: { |
| | | add: ['admin', 'projectType:add'], |
| | | edit: ['admin', 'projectType:edit'], |
| | | del: ['admin', 'projectType:del'], |
| | | download: ['admin', 'projectType:download'] |
| | | }, |
| | | rules: { |
| | | name: [ |
| | | { required: true, message: '名称不能为空', trigger: 'blur' }, |
| | | { min: 1, max: 100, message: '长度不超过100个字符', trigger: 'blur' } |
| | | ], |
| | | standardUnitCurrency: [ |
| | | { required: true, message: '标准单价币种不能为空', trigger: 'blur' } |
| | | ], |
| | | standardUnitPrice: [ |
| | | { required: true, validator: checkStandardUnitPricet, trigger: 'blur' } |
| | | ], |
| | | standardProfitPrice: [ |
| | | { required: true, validator: checkStandardProfitPrice, trigger: 'blur' } |
| | | ], |
| | | standardWorkloadUnit: [ |
| | | { required: true, message: '标准工作量单位不能为空', trigger: 'blur' } |
| | | ], |
| | | remarks: [ |
| | | { min: 1, max: 1000, message: '长度不超过1000个字符', trigger: 'blur' } |
| | | ] |
| | | }, |
| | | queryTypeOptions: [ |
| | | { key: 'name', display_name: '名称' }, |
| | | { key: 'standardUnitCurrency', display_name: '标准单价币种' } |
| | | ], |
| | | // 标准单价币种 |
| | | standardUnitCurrency: constant.STANDARD_UNIT_CURRENCY, |
| | | // 标准工作量单位 |
| | | standardWorkloadUnit: constant.STANDARD_WORKLOAD_UNIT, |
| | | // 随机数 |
| | | random: 0 |
| | | } |
| | | }, |
| | | methods: { |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | | [CRUD.HOOK.beforeRefresh]() { |
| | | return true |
| | | }, |
| | | // 新增与编辑前做的操作 |
| | | [CRUD.HOOK.afterToCU](crud, form) { |
| | | // 随机数 |
| | | this.random = Math.random() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | /> |
| | | <el-select v-model="query.dateType" placeholder="请选择日期类型" class="filter-item" style="width: 200px;"> |
| | | <el-option |
| | | v-for="item in dict.date_type" |
| | | v-for="item in dict[dickDateType]" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | |
| | | <el-form-item label="日期类型" prop="dateType"> |
| | | <el-select v-model="form.dateType" style="width: 370px;"> |
| | | <el-option |
| | | v-for="item in dict.date_type" |
| | | v-for="item in dict[dickDateType]" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | |
| | | <el-table-column prop="name" label="名称" show-overflow-tooltip /> |
| | | <el-table-column prop="dateType" label="日期类型"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ dict.label.date_type[scope.row.dateType] }}</el-tag> |
| | | <el-tag>{{ dict.label[dickDateType][scope.row.dateType] }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="remarks" label="备注" show-overflow-tooltip /> |
| | |
| | | import crudOperation from '@crud/CRUD.operation' |
| | | import udOperation from '@crud/UD.operation' |
| | | import pagination from '@crud/Pagination' |
| | | import constant from '@/utils/constant' |
| | | |
| | | const defaultForm = { id: null, holidayDate: null, name: null, dateType: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | export default { |
| | |
| | | return CRUD({ title: '节日配置', url: 'api/sysConfigHoliday', idField: 'id', sort: 'id,desc', crudMethod: { ...crudConfigHoliday }}) |
| | | }, |
| | | // 数据字典 |
| | | dicts: ['date_type'], |
| | | dicts: [constant.DATE_TYPE], |
| | | data() { |
| | | return { |
| | | permission: { |
| | |
| | | ], |
| | | createTime: [ |
| | | { required: true, message: '创建时间不能为空', trigger: 'blur' } |
| | | ], |
| | | remarks: [ |
| | | { min: 1, max: 1000, message: '长度不超过1000个字符', trigger: 'blur' } |
| | | ] |
| | | }} |
| | | }, |
| | | dickDateType: constant.DATE_TYPE } |
| | | }, |
| | | methods: { |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | |
| | | ], |
| | | createTime: [ |
| | | { required: true, message: '创建时间不能为空', trigger: 'blur' } |
| | | ], |
| | | remarks: [ |
| | | { min: 1, max: 1000, message: '长度不超过1000个字符', trigger: 'blur' } |
| | | ] |
| | | }} |
| | | }, |
| | |
| | | permission: { |
| | | add: ['admin', 'dept:add'], |
| | | edit: ['admin', 'dept:edit'], |
| | | del: ['admin', 'dept:del'] |
| | | del: ['admin', 'dept:del'], |
| | | download: ['admin', 'dept:download'] |
| | | }, |
| | | enabledTypeOptions: [ |
| | | { key: 'true', display_name: '正常' }, |
| | |
| | | permission: { |
| | | add: ['admin', 'dict:add'], |
| | | edit: ['admin', 'dict:edit'], |
| | | del: ['admin', 'dict:del'] |
| | | del: ['admin', 'dict:del'], |
| | | download: ['admin', 'dict:download'] |
| | | } |
| | | } |
| | | }, |
| | |
| | | permission: { |
| | | add: ['admin', 'job:add'], |
| | | edit: ['admin', 'job:edit'], |
| | | del: ['admin', 'job:del'] |
| | | del: ['admin', 'job:del'], |
| | | download: ['admin', 'job:download'] |
| | | } |
| | | } |
| | | }, |
| New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <!--工具栏--> |
| | | <div class="head-container"> |
| | | <div v-if="crud.props.searchToggle"> |
| | | <!-- 搜索 --> |
| | | <el-select v-model="query.jobId" filterable clearable placeholder="所属岗位" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery"> |
| | | <el-option |
| | | v-for="item in jobs" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | /> |
| | | </el-select> |
| | | <el-input v-model="query.name" clearable placeholder="名称" style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery" /> |
| | | <rrOperation :crud="crud" /> |
| | | </div> |
| | | <!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'--> |
| | | <crudOperation :permission="permission" /> |
| | | <!--表单组件--> |
| | | <el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px"> |
| | | <el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px"> |
| | | <el-form-item label="所属岗位" prop="jobId"> |
| | | <el-select v-model="form.jobId" filterable clearable placeholder="所属岗位" style="width: 300px;"> |
| | | <el-option |
| | | v-for="item in jobs" |
| | | :key="item.id" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | :disabled="!item.enabled" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="名称" prop="name"> |
| | | <el-input v-model="form.name" style="width: 300px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="描述"> |
| | | <el-input v-model="form.description" :rows="3" type="textarea" style="width: 300px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="级别工资" prop="levelWage"> |
| | | <money-input :key="random" v-model="form.levelWage" :width="300" /> |
| | | </el-form-item> |
| | | <el-form-item label="基本工资比例" prop="basicWageProportion"> |
| | | <el-input v-model="form.basicWageProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="绩效工资比例" prop="achievementsWageProportion"> |
| | | <el-input v-model="form.achievementsWageProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="业绩工资比例" prop="performanceWageProportion"> |
| | | <el-input v-model="form.performanceWageProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="团队工资比例" prop="teamWageProportion"> |
| | | <el-input v-model="form.teamWageProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="公积金基数" prop="accumulationRadix"> |
| | | <money-input :key="random" v-model="form.accumulationRadix" :width="300" /> |
| | | </el-form-item> |
| | | <el-form-item label="公积金个人缴纳比例" prop="accumulationPersonalProportion"> |
| | | <el-input v-model="form.accumulationPersonalProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="公积金公司缴纳比例" prop="accumulationCompanyProportion"> |
| | | <el-input v-model="form.accumulationCompanyProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="养老险基数" prop="pensionRadix"> |
| | | <money-input :key="random" v-model="form.pensionRadix" :width="300" /> |
| | | </el-form-item> |
| | | <el-form-item label="养老险个人缴纳比例" prop="pensionPersonalProportion"> |
| | | <el-input v-model="form.pensionPersonalProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="养老险公司缴纳比例" prop="pensionCompanyProportion"> |
| | | <el-input v-model="form.pensionCompanyProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="医疗险基数" prop="medicalRadix"> |
| | | <money-input :key="random" v-model="form.medicalRadix" :width="300" /> |
| | | </el-form-item> |
| | | <el-form-item label="医疗险个人缴纳比例" prop="medicalPersonalProportion"> |
| | | <el-input v-model="form.medicalPersonalProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="医疗险公司缴纳比例" prop="medicalCompanyProportion"> |
| | | <el-input v-model="form.medicalCompanyProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="失业险基数" prop="unemploymentRadix"> |
| | | <money-input :key="random" v-model="form.unemploymentRadix" :width="300" /> |
| | | </el-form-item> |
| | | <el-form-item label="失业险个人缴纳比例" prop="unemploymentPersonalProportion"> |
| | | <el-input v-model="form.unemploymentPersonalProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="失业险公司缴纳比例" prop="unemploymentCompanyProportion"> |
| | | <el-input v-model="form.unemploymentCompanyProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="生育险基数" prop="maternityRadix"> |
| | | <money-input :key="random" v-model="form.maternityRadix" :width="300" /> |
| | | </el-form-item> |
| | | <el-form-item label="生育险个人缴纳比例" prop="maternityPersonalProportion"> |
| | | <el-input v-model="form.maternityPersonalProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="生育险公司缴纳比例" prop="maternityCompanyProportion"> |
| | | <el-input v-model="form.maternityCompanyProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="工伤险基数" prop="industrialInjuryRadix"> |
| | | <money-input :key="random" v-model="form.industrialInjuryRadix" :width="300" /> |
| | | </el-form-item> |
| | | <el-form-item label="工伤险个人缴纳比例" prop="industrialInjuryPersonalProportion"> |
| | | <el-input v-model="form.industrialInjuryPersonalProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="工伤险公司缴纳比例" prop="industrialInjuryCompanyProportion"> |
| | | <el-input v-model="form.industrialInjuryCompanyProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="个人业绩比例" prop="personalPerformanceProportion"> |
| | | <el-input v-model="form.personalPerformanceProportion" style="width: 300px;"> |
| | | <template slot="append">%</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="年假天数" prop="annualLeaveDays"> |
| | | <el-input v-model="form.annualLeaveDays" style="width: 300px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="form.remarks" :rows="3" type="textarea" style="width: 300px;" /> |
| | | </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 :show-overflow-tooltip="true" prop="jobName" label="岗位名称" width="100"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ scope.row.jobName }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="name" label="名称" width="100" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="description" label="描述" width="140" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="levelWage" label="级别工资" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.levelWage) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="basicWageProportion" label="基本工资比例" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.basicWageProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="achievementsWageProportion" label="绩效工资比例" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.achievementsWageProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="performanceWageProportion" label="业绩工资比例" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.performanceWageProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="teamWageProportion" label="团队工资比例" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.teamWageProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="accumulationRadix" label="公积金基数" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.accumulationRadix) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="accumulationPersonalProportion" label="公积金个人缴纳比例" width="130"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.accumulationPersonalProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="accumulationCompanyProportion" label="公积金公司缴纳比例" width="130"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.accumulationCompanyProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="pensionRadix" label="养老险基数" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.pensionRadix) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="pensionPersonalProportion" label="养老险个人缴纳比例" width="130"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.pensionPersonalProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="pensionCompanyProportion" label="养老险公司缴纳比例" width="130"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.pensionCompanyProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="medicalRadix" label="医疗险基数" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.medicalRadix) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="medicalPersonalProportion" label="医疗险个人缴纳比例" width="130"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.medicalPersonalProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="medicalCompanyProportion" label="医疗险公司缴纳比例" width="130"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.medicalCompanyProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="unemploymentRadix" label="失业险基数" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.unemploymentRadix) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="unemploymentPersonalProportion" label="失业险个人缴纳比例" width="130"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.unemploymentPersonalProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="unemploymentCompanyProportion" label="失业险公司缴纳比例" width="130"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.unemploymentCompanyProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="maternityRadix" label="生育险基数" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.maternityRadix) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="maternityPersonalProportion" label="生育险个人缴纳比例" width="130"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.maternityPersonalProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="maternityCompanyProportion" label="生育险公司缴纳比例" width="130"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.maternityCompanyProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="industrialInjuryRadix" label="工伤险基数" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ crud.toMoney(scope.row.industrialInjuryRadix) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="industrialInjuryPersonalProportion" label="工伤险个人缴纳比例" width="130"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.industrialInjuryPersonalProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="industrialInjuryCompanyProportion" label="工伤险公司缴纳比例" width="130"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.industrialInjuryCompanyProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="personalPerformanceProportion" label="个人业绩比例" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.personalPerformanceProportion }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="annualLeaveDays" label="年假天数" width="100"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.annualLeaveDays }}天 |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="remarks" label="备注" width="140" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="createTime" label="创建时间" width="140" /> |
| | | <el-table-column v-if="checkPer(['admin','sysLevel:edit','sysLevel:del'])" label="操作" width="150px" align="center" fixed="right"> |
| | | <template slot-scope="scope"> |
| | | <udOperation |
| | | :data="scope.row" |
| | | :permission="permission" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!--分页组件--> |
| | | <pagination /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import crudSysLevel from '@/api/system/level' |
| | | 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 moneyInput from '../../assembly/moneyInput/index.vue' |
| | | import constant from '../../../utils/constant.js' |
| | | import crudJob from '@/api/system/job' |
| | | import crudConfigProportion from '@/api/system/configProportion' |
| | | |
| | | const defaultForm = { id: null, jobId: null, name: null, description: null, levelWage: null, basicWageProportion: null, achievementsWageProportion: null, performanceWageProportion: null, teamWageProportion: null, accumulationRadix: null, accumulationPersonalProportion: null, accumulationCompanyProportion: null, pensionRadix: null, pensionPersonalProportion: null, pensionCompanyProportion: null, medicalRadix: null, medicalPersonalProportion: null, medicalCompanyProportion: null, unemploymentRadix: null, unemploymentPersonalProportion: null, unemploymentCompanyProportion: null, maternityRadix: null, maternityPersonalProportion: null, maternityCompanyProportion: null, industrialInjuryRadix: null, industrialInjuryPersonalProportion: null, industrialInjuryCompanyProportion: null, personalPerformanceProportion: null, annualLeaveDays: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | export default { |
| | | name: 'SysLevel', |
| | | components: { pagination, crudOperation, rrOperation, udOperation, moneyInput }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | cruds() { |
| | | return CRUD({ title: '级别', url: 'api/sysLevel', idField: 'id', sort: 'id,desc', crudMethod: { ...crudSysLevel }}) |
| | | }, |
| | | data() { |
| | | // 工资(千万内)验证 |
| | | var wageValidate = (rule, value, callback) => { |
| | | if (value != null && value !== '' && (isNaN(value) || Number(value) < 0 || Number(value) > 10000000)) { |
| | | callback(new Error('请输入 一千万 以内的正整数或两位小数')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | // 比例(百内)验证 |
| | | var proportionValidate = (rule, value, callback) => { |
| | | const reg = /^([0-9]|[1-9]\d)(\.\d{1,2})?$|100$/ |
| | | if (value != null && value !== '' && !reg.test(value)) { |
| | | callback(new Error('请输入 一百 以内的正整数或两位小数')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | // 天数(百内)验证 |
| | | var dayValidate = (rule, value, callback) => { |
| | | const reg = /^([0-9]|[1-9]\d)$|100$/ |
| | | if (value != null && value !== '' && !reg.test(value)) { |
| | | callback(new Error('请输入 一百 以内的正整数')) |
| | | } else { |
| | | callback() |
| | | } |
| | | } |
| | | return { |
| | | permission: { |
| | | add: ['admin', 'sysLevel:add'], |
| | | edit: ['admin', 'sysLevel:edit'], |
| | | del: ['admin', 'sysLevel:del'], |
| | | download: ['admin', 'sysLevel:download'] |
| | | }, |
| | | rules: { |
| | | jobId: [ |
| | | { required: true, message: '所属岗位不能为空', trigger: 'change' } |
| | | ], |
| | | name: [ |
| | | { required: true, message: '名称不能为空', trigger: 'blur' }, |
| | | { max: 100, message: '最大长度 100 个字符', trigger: 'blur' } |
| | | ], |
| | | levelWage: [ |
| | | { required: true, message: '级别工资不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | basicWageProportion: [ |
| | | { required: true, message: '基本工资比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | achievementsWageProportion: [ |
| | | { required: true, message: '绩效工资比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | performanceWageProportion: [ |
| | | { required: true, message: '业绩工资比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | teamWageProportion: [ |
| | | { required: true, message: '团队工资比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | accumulationRadix: [ |
| | | { required: true, message: '公积金基数不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | accumulationPersonalProportion: [ |
| | | { required: true, message: '公积金个人缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | accumulationCompanyProportion: [ |
| | | { required: true, message: '公积金公司缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | pensionRadix: [ |
| | | { required: true, message: '养老险基数不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | pensionPersonalProportion: [ |
| | | { required: true, message: '养老险个人缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | pensionCompanyProportion: [ |
| | | { required: true, message: '养老险公司缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | medicalRadix: [ |
| | | { required: true, message: '医疗险基数不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | medicalPersonalProportion: [ |
| | | { required: true, message: '医疗险个人缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | medicalCompanyProportion: [ |
| | | { required: true, message: '医疗险公司缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | unemploymentRadix: [ |
| | | { required: true, message: '失业险基数不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | unemploymentPersonalProportion: [ |
| | | { required: true, message: '失业险个人缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | unemploymentCompanyProportion: [ |
| | | { required: true, message: '失业险公司缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | maternityRadix: [ |
| | | { required: true, message: '生育险基数不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | maternityPersonalProportion: [ |
| | | { required: true, message: '生育险个人缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | maternityCompanyProportion: [ |
| | | { required: true, message: '生育险公司缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | industrialInjuryRadix: [ |
| | | { required: true, message: '工伤险基数不能为空', trigger: 'blur' }, |
| | | { validator: wageValidate, trigger: 'blur' } |
| | | ], |
| | | industrialInjuryPersonalProportion: [ |
| | | { required: true, message: '工伤险个人缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | industrialInjuryCompanyProportion: [ |
| | | { required: true, message: '工伤险公司缴纳比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | personalPerformanceProportion: [ |
| | | { required: true, message: '个人业绩比例不能为空', trigger: 'blur' }, |
| | | { validator: proportionValidate, trigger: 'blur' } |
| | | ], |
| | | annualLeaveDays: [ |
| | | { required: true, message: '年假天数不能为空', trigger: 'blur' }, |
| | | { validator: dayValidate, trigger: 'blur' } |
| | | ] |
| | | }, |
| | | queryTypeOptions: [ |
| | | { key: 'jobId', display_name: '岗位ID' }, |
| | | { key: 'name', display_name: '名称' } |
| | | ], |
| | | // 比例配置:基本工资比例 |
| | | configProportionBasicWage: constant.CONFIG_PROPORTION_BASIC_WAGE, |
| | | // 比例配置:绩效工资比例 |
| | | configProportionMeritWage: constant.CONFIG_PROPORTION_MERIT_WAGE, |
| | | // 比例配置:业绩工资比例 |
| | | configProportionAchievementWage: constant.CONFIG_PROPORTION_ACHIEVEMENT_WAGE, |
| | | // 比例配置:团队工资比例 |
| | | configProportionTeamWage: constant.CONFIG_PROPORTION_TEAM_WAGE, |
| | | // 比例配置:公积金个人缴纳比例 |
| | | configProportionAccumulationFundPersonal: constant.CONFIG_PROPORTION_ACCUMULATION_FUND_PERSONAL, |
| | | // 比例配置:公积金公司缴纳比例 |
| | | configProportionAccumulationFundCompany: constant.CONFIG_PROPORTION_ACCUMULATION_FUND_COMPANY, |
| | | // 比例配置:养老险个人缴纳比例 |
| | | configProportionPensionInsurancePersonal: constant.CONFIG_PROPORTION_PENSION_INSURANCE_PERSONAL, |
| | | // 比例配置:养老险公司缴纳比例 |
| | | configProportionPensionInsuranceCompany: constant.CONFIG_PROPORTION_PENSION_INSURANCE_COMPANY, |
| | | // 比例配置:医疗险个人缴纳比例 |
| | | configProportionMedicalInsurancePersonal: constant.CONFIG_PROPORTION_MEDICAL_INSURANCE_PERSONAL, |
| | | // 比例配置:医疗险公司缴纳比例 |
| | | configProportionMedicalInsuranceCompany: constant.CONFIG_PROPORTION_MEDICAL_INSURANCE_COMPANY, |
| | | // 比例配置:失业险个人缴纳比例 |
| | | configProportionUnemploymentInsurancePersonal: constant.CONFIG_PROPORTION_UNEMPLOYMENT_INSURANCE_PERSONAL, |
| | | // 比例配置:失业险公司缴纳比例 |
| | | configProportionUnemploymentInsuranceCompany: constant.CONFIG_PROPORTION_UNEMPLOYMENT_INSURANCE_COMPANY, |
| | | // 比例配置:生育险个人缴纳比例 |
| | | configProportionMaternityInsurancePersonal: constant.CONFIG_PROPORTION_MATERNITY_INSURANCE_PERSONAL, |
| | | // 比例配置:生育险公司缴纳比例 |
| | | configProportionMaternityInsuranceCompany: constant.CONFIG_PROPORTION_MATERNITY_INSURANCE_COMPANY, |
| | | // 比例配置:工伤险个人缴纳比例 |
| | | configProportionIndustrialInjuryInsurancePersonal: constant.CONFIG_PROPORTION_INDUSTRIAL_INJURY_INSURANCE_PERSONAL, |
| | | // 比例配置:工伤险公司缴纳比例 |
| | | configProportionIndustrialInjuryInsuranceCompany: constant.CONFIG_PROPORTION_INDUSTRIAL_INJURY_INSURANCE_COMPANY, |
| | | // 比例配置:个人业绩比例 |
| | | configProportionPersonalPerformance: constant.CONFIG_PROPORTION_PERSONAL_PERFORMANCE, |
| | | // 岗位列表 |
| | | jobs: [], |
| | | // 比例列表 |
| | | proportions: [], |
| | | // 随机数 |
| | | random: 0 |
| | | } |
| | | }, |
| | | methods: { |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | | [CRUD.HOOK.beforeRefresh]() { |
| | | // 获取所有岗位 |
| | | this.getAllJob() |
| | | // 获取比例配置 |
| | | this.getAllProportion() |
| | | return true |
| | | }, |
| | | // 获取所有岗位 |
| | | getAllJob() { |
| | | // 获取所有岗位 |
| | | crudJob.getAll().then(res => { |
| | | // 岗位列表 |
| | | this.jobs = res |
| | | }).catch(() => { |
| | | |
| | | }) |
| | | }, |
| | | // 获取比例配置 |
| | | getAllProportion() { |
| | | // 获取比例配置 |
| | | crudConfigProportion.getAll().then(res => { |
| | | // 比例列表 |
| | | this.proportions = res |
| | | }).catch(() => { |
| | | |
| | | }) |
| | | }, |
| | | // 钩子: 开始 "新建/编辑" - 之前 |
| | | [CRUD.HOOK.beforeToCU]() { |
| | | // 随机数 |
| | | this.random = Math.random() |
| | | }, |
| | | // 钩子:新建 - 之前 |
| | | [CRUD.HOOK.beforeToAdd]() { |
| | | // 循环比例列表 |
| | | for (const item of this.proportions) { |
| | | // 判断比例配置 |
| | | if (item.title === this.configProportionBasicWage) { |
| | | // 基本工资比例 |
| | | this.form.basicWageProportion = item.proportion |
| | | } else if (item.title === this.configProportionMeritWage) { |
| | | // 绩效工资比例 |
| | | this.form.achievementsWageProportion = item.proportion |
| | | } else if (item.title === this.configProportionAchievementWage) { |
| | | // 业绩工资比例 |
| | | this.form.performanceWageProportion = item.proportion |
| | | } else if (item.title === this.configProportionTeamWage) { |
| | | // 团队工资比例 |
| | | this.form.teamWageProportion = item.proportion |
| | | } else if (item.title === this.configProportionAccumulationFundPersonal) { |
| | | // 公积金个人缴纳比例 |
| | | this.form.accumulationPersonalProportion = item.proportion |
| | | } else if (item.title === this.configProportionAccumulationFundCompany) { |
| | | // 公积金公司缴纳比例 |
| | | this.form.accumulationCompanyProportion = item.proportion |
| | | } else if (item.title === this.configProportionPensionInsurancePersonal) { |
| | | // 养老险个人缴纳比例 |
| | | this.form.pensionPersonalProportion = item.proportion |
| | | } else if (item.title === this.configProportionPensionInsuranceCompany) { |
| | | // 养老险公司缴纳比例 |
| | | this.form.pensionCompanyProportion = item.proportion |
| | | } else if (item.title === this.configProportionMedicalInsurancePersonal) { |
| | | // 医疗险个人缴纳比例 |
| | | this.form.medicalPersonalProportion = item.proportion |
| | | } else if (item.title === this.configProportionMedicalInsuranceCompany) { |
| | | // 医疗险公司缴纳比例 |
| | | this.form.medicalCompanyProportion = item.proportion |
| | | } else if (item.title === this.configProportionUnemploymentInsurancePersonal) { |
| | | // 失业险个人缴纳比例 |
| | | this.form.unemploymentPersonalProportion = item.proportion |
| | | } else if (item.title === this.configProportionUnemploymentInsuranceCompany) { |
| | | // 失业险公司缴纳比例 |
| | | this.form.unemploymentCompanyProportion = item.proportion |
| | | } else if (item.title === this.configProportionMaternityInsurancePersonal) { |
| | | // 生育险个人缴纳比例 |
| | | this.form.maternityPersonalProportion = item.proportion |
| | | } else if (item.title === this.configProportionMaternityInsuranceCompany) { |
| | | // 生育险公司缴纳比例 |
| | | this.form.maternityCompanyProportion = item.proportion |
| | | } else if (item.title === this.configProportionIndustrialInjuryInsurancePersonal) { |
| | | // 工伤险个人缴纳比例 |
| | | this.form.industrialInjuryPersonalProportion = item.proportion |
| | | } else if (item.title === this.configProportionIndustrialInjuryInsuranceCompany) { |
| | | // 工伤险公司缴纳比例 |
| | | this.form.industrialInjuryCompanyProportion = item.proportion |
| | | } else if (item.title === this.configProportionPersonalPerformance) { |
| | | // 个人业绩比例 |
| | | this.form.personalPerformanceProportion = item.proportion |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | permission: { |
| | | add: ['admin', 'menu:add'], |
| | | edit: ['admin', 'menu:edit'], |
| | | del: ['admin', 'menu:del'] |
| | | del: ['admin', 'menu:del'], |
| | | download: ['admin', 'menu:download'] |
| | | }, |
| | | rules: { |
| | | title: [ |
| | |
| | | permission: { |
| | | add: ['admin', 'roles:add'], |
| | | edit: ['admin', 'roles:edit'], |
| | | del: ['admin', 'roles:del'] |
| | | del: ['admin', 'roles:del'], |
| | | download: ['admin', 'roles:download'] |
| | | }, |
| | | rules: { |
| | | name: [ |
| | |
| | | permission: { |
| | | add: ['admin', 'timing:add'], |
| | | edit: ['admin', 'timing:edit'], |
| | | del: ['admin', 'timing:del'] |
| | | del: ['admin', 'timing:del'], |
| | | download: ['admin', 'timing:download'] |
| | | }, |
| | | rules: { |
| | | jobName: [ |
| | |
| | | :key="item.name" |
| | | :label="item.name" |
| | | :value="item.id" |
| | | :disabled="!item.enabled" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | |
| | | import { isvalidPhone } from '@/utils/validate' |
| | | import { getDepts, getDeptSuperior } from '@/api/system/dept' |
| | | import { getAll, getLevel } from '@/api/system/role' |
| | | import { getAllJob } from '@/api/system/job' |
| | | import crudJob from '@/api/system/job' |
| | | import CRUD, { presenter, header, form, crud } from '@crud/crud' |
| | | import rrOperation from '@crud/RR.operation' |
| | | import crudOperation from '@crud/CRUD.operation' |
| | |
| | | permission: { |
| | | add: ['admin', 'user:add'], |
| | | edit: ['admin', 'user:edit'], |
| | | del: ['admin', 'user:del'] |
| | | del: ['admin', 'user:del'], |
| | | download: ['admin', 'user:download'] |
| | | }, |
| | | enabledTypeOptions: [ |
| | | { key: 'true', display_name: '激活' }, |
| | |
| | | }, |
| | | // 获取弹窗内岗位数据 |
| | | getJobs() { |
| | | getAllJob().then(res => { |
| | | this.jobs = res.content |
| | | crudJob.getAll().then(res => { |
| | | this.jobs = res |
| | | }).catch(() => { }) |
| | | }, |
| | | // 获取权限级别 |
| | |
| | | headers: { 'Authorization': getToken() }, |
| | | permission: { |
| | | edit: ['admin', 'storage:edit'], |
| | | del: ['admin', 'storage:del'] |
| | | del: ['admin', 'storage:del'], |
| | | download: ['admin', 'storage:download'] |
| | | } |
| | | } |
| | | }, |
| | |
| | | data() { |
| | | return { |
| | | permission: { |
| | | del: ['admin', 'storage:del'] |
| | | del: ['admin', 'storage:del'], |
| | | download: ['admin', 'storage:download'] |
| | | }, |
| | | title: '文件', dialog: false, |
| | | icon: 'el-icon-refresh', |