11 files added
1 files modified
| 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.treatment.domain; |
| | | |
| | | import lombok.Data; |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import cn.hutool.core.bean.copier.CopyOptions; |
| | | import javax.persistence.*; |
| | | import javax.validation.constraints.*; |
| | | import java.math.BigDecimal; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @description / |
| | | * @author 初瑞峰 |
| | | * @date 2023-09-07 |
| | | **/ |
| | | @Entity |
| | | @Data |
| | | @Table(name="merit_wage") |
| | | public class MeritWage implements Serializable { |
| | | |
| | | @Id |
| | | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| | | @Column(name = "`id`") |
| | | @ApiModelProperty(value = "业绩工资ID") |
| | | private Long id; |
| | | |
| | | @Column(name = "`job_id`") |
| | | @ApiModelProperty(value = "岗位ID") |
| | | private Long jobId; |
| | | |
| | | @Column(name = "`name`",nullable = false) |
| | | @NotBlank |
| | | @ApiModelProperty(value = "名称") |
| | | private String name; |
| | | |
| | | @Column(name = "`level_one`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "一级标准") |
| | | private BigDecimal levelOne; |
| | | |
| | | @Column(name = "`level_one_wage`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "一级业绩") |
| | | private Integer levelOneWage; |
| | | |
| | | @Column(name = "`level_two`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "二级标准") |
| | | private BigDecimal levelTwo; |
| | | |
| | | @Column(name = "`level_two_wage`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "二级业绩") |
| | | private Integer levelTwoWage; |
| | | |
| | | @Column(name = "`level_three`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "三级标准") |
| | | private BigDecimal levelThree; |
| | | |
| | | @Column(name = "`level_three_wage`",nullable = false) |
| | | @NotNull |
| | | @ApiModelProperty(value = "三级业绩") |
| | | private Integer levelThreeWage; |
| | | |
| | | @Column(name = "`remarks`") |
| | | @ApiModelProperty(value = "备注") |
| | | private String remarks; |
| | | |
| | | @Column(name = "`level_id`") |
| | | @ApiModelProperty(value = "等级ID") |
| | | private Long levelId; |
| | | |
| | | public void copy(MeritWage 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.treatment.repository; |
| | | |
| | | import me.zhengjie.modules.treatment.domain.MeritWage; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @author 初瑞峰 |
| | | * @date 2023-09-07 |
| | | **/ |
| | | public interface MeritWageRepository extends JpaRepository<MeritWage, Long>, JpaSpecificationExecutor<MeritWage> { |
| | | MeritWage findByLevelId(Long LevelId); |
| | | } |
| 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.treatment.rest; |
| | | |
| | | import me.zhengjie.annotation.Log; |
| | | import me.zhengjie.modules.treatment.domain.MeritWage; |
| | | import me.zhengjie.modules.treatment.service.MeritWageService; |
| | | import me.zhengjie.modules.treatment.service.dto.MeritWageQueryCriteria; |
| | | 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 2023-09-07 |
| | | **/ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "业绩管理管理") |
| | | @RequestMapping("/api/meritWage") |
| | | public class MeritWageController { |
| | | |
| | | private final MeritWageService meritWageService; |
| | | |
| | | @Log("导出数据") |
| | | @ApiOperation("导出数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('meritWage:list')") |
| | | public void exportMeritWage(HttpServletResponse response, MeritWageQueryCriteria criteria) throws IOException { |
| | | meritWageService.download(meritWageService.queryAll(criteria), response); |
| | | } |
| | | |
| | | @GetMapping |
| | | @Log("查询业绩管理") |
| | | @ApiOperation("查询业绩管理") |
| | | @PreAuthorize("@el.check('meritWage:list')") |
| | | public ResponseEntity<Object> queryMeritWage(MeritWageQueryCriteria criteria, Pageable pageable){ |
| | | return new ResponseEntity<>(meritWageService.queryAll(criteria,pageable),HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping |
| | | @Log("新增业绩管理") |
| | | @ApiOperation("新增业绩管理") |
| | | @PreAuthorize("@el.check('meritWage:add')") |
| | | public ResponseEntity<Object> createMeritWage(@Validated @RequestBody MeritWage resources){ |
| | | return new ResponseEntity<>(meritWageService.create(resources),HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PutMapping |
| | | @Log("修改业绩管理") |
| | | @ApiOperation("修改业绩管理") |
| | | @PreAuthorize("@el.check('meritWage:edit')") |
| | | public ResponseEntity<Object> updateMeritWage(@Validated @RequestBody MeritWage resources){ |
| | | meritWageService.update(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @Log("删除业绩管理") |
| | | @ApiOperation("删除业绩管理") |
| | | @PreAuthorize("@el.check('meritWage:del')") |
| | | public ResponseEntity<Object> deleteMeritWage(@RequestBody Long[] ids) { |
| | | meritWageService.deleteAll(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping("/getAllDate") |
| | | @ApiOperation("获取所有的数据") |
| | | public ResponseEntity<Object> getAllDate() { |
| | | return new ResponseEntity<>(meritWageService.getAllDate(),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.treatment.service; |
| | | |
| | | import me.zhengjie.modules.treatment.domain.MeritWage; |
| | | import me.zhengjie.modules.treatment.service.dto.MeritWageDto; |
| | | import me.zhengjie.modules.treatment.service.dto.MeritWageQueryCriteria; |
| | | 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 2023-09-07 |
| | | **/ |
| | | public interface MeritWageService { |
| | | |
| | | /** |
| | | * 查询数据分页 |
| | | * @param criteria 条件 |
| | | * @param pageable 分页参数 |
| | | * @return Map<String,Object> |
| | | */ |
| | | Map<String,Object> queryAll(MeritWageQueryCriteria criteria, Pageable pageable); |
| | | |
| | | /** |
| | | * 查询所有数据不分页 |
| | | * @param criteria 条件参数 |
| | | * @return List<MeritWageDto> |
| | | */ |
| | | List<MeritWageDto> queryAll(MeritWageQueryCriteria criteria); |
| | | |
| | | /** |
| | | * 根据ID查询 |
| | | * @param id ID |
| | | * @return MeritWageDto |
| | | */ |
| | | MeritWageDto findById(Long id); |
| | | |
| | | /** |
| | | * 创建 |
| | | * @param resources / |
| | | * @return MeritWageDto |
| | | */ |
| | | MeritWageDto create(MeritWage resources); |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param resources / |
| | | */ |
| | | void update(MeritWage resources); |
| | | |
| | | /** |
| | | * 多选删除 |
| | | * @param ids / |
| | | */ |
| | | void deleteAll(Long[] ids); |
| | | |
| | | /** |
| | | * 导出数据 |
| | | * @param all 待导出的数据 |
| | | * @param response / |
| | | * @throws IOException / |
| | | */ |
| | | void download(List<MeritWageDto> all, HttpServletResponse response) throws IOException; |
| | | |
| | | List<Map<String,Object>> getAllDate(); |
| | | } |
| 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.treatment.service.dto; |
| | | |
| | | import lombok.Data; |
| | | import java.math.BigDecimal; |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @description / |
| | | * @author 初瑞峰 |
| | | * @date 2023-09-07 |
| | | **/ |
| | | @Data |
| | | public class MeritWageDto implements Serializable { |
| | | |
| | | /** 业绩工资ID */ |
| | | private Long id; |
| | | |
| | | /** 岗位ID */ |
| | | private Long jobId; |
| | | |
| | | /** 名称 */ |
| | | private String name; |
| | | |
| | | /** 一级标准 */ |
| | | private BigDecimal levelOne; |
| | | |
| | | /** 一级业绩 */ |
| | | private Integer levelOneWage; |
| | | |
| | | /** 二级标准 */ |
| | | private BigDecimal levelTwo; |
| | | |
| | | /** 二级业绩 */ |
| | | private Integer levelTwoWage; |
| | | |
| | | /** 三级标准 */ |
| | | private BigDecimal levelThree; |
| | | |
| | | /** 三级业绩 */ |
| | | private Integer levelThreeWage; |
| | | |
| | | /** 备注 */ |
| | | private String remarks; |
| | | |
| | | /** 等级ID */ |
| | | private Long levelId; |
| | | } |
| 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.treatment.service.dto; |
| | | |
| | | import lombok.Data; |
| | | import java.util.List; |
| | | import me.zhengjie.annotation.Query; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @author 初瑞峰 |
| | | * @date 2023-09-07 |
| | | **/ |
| | | @Data |
| | | public class MeritWageQueryCriteria{ |
| | | |
| | | /** 模糊 */ |
| | | @Query(type = Query.Type.INNER_LIKE) |
| | | private 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.treatment.service.impl; |
| | | |
| | | import me.zhengjie.exception.BadRequestException; |
| | | import me.zhengjie.modules.treatment.domain.CmnLevel; |
| | | import me.zhengjie.modules.treatment.domain.MeritWage; |
| | | import me.zhengjie.modules.treatment.repository.CmnLevelRepository; |
| | | import me.zhengjie.utils.ValidationUtil; |
| | | import me.zhengjie.utils.FileUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import me.zhengjie.modules.treatment.repository.MeritWageRepository; |
| | | import me.zhengjie.modules.treatment.service.MeritWageService; |
| | | import me.zhengjie.modules.treatment.service.dto.MeritWageDto; |
| | | import me.zhengjie.modules.treatment.service.dto.MeritWageQueryCriteria; |
| | | import me.zhengjie.modules.treatment.service.mapstruct.MeritWageMapper; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | 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.*; |
| | | import java.io.IOException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @description 服务实现 |
| | | * @author 初瑞峰 |
| | | * @date 2023-09-07 |
| | | **/ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class MeritWageServiceImpl implements MeritWageService { |
| | | |
| | | private final MeritWageRepository meritWageRepository; |
| | | private final MeritWageMapper meritWageMapper; |
| | | private final CmnLevelRepository cmnLevelRepository; |
| | | |
| | | @Override |
| | | public Map<String,Object> queryAll(MeritWageQueryCriteria criteria, Pageable pageable){ |
| | | Page<MeritWage> page = meritWageRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); |
| | | return PageUtil.toPage(page.map(meritWageMapper::toDto)); |
| | | } |
| | | |
| | | @Override |
| | | public List<MeritWageDto> queryAll(MeritWageQueryCriteria criteria){ |
| | | return meritWageMapper.toDto(meritWageRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public MeritWageDto findById(Long id) { |
| | | MeritWage meritWage = meritWageRepository.findById(id).orElseGet(MeritWage::new); |
| | | ValidationUtil.isNull(meritWage.getId(),"MeritWage","id",id); |
| | | return meritWageMapper.toDto(meritWage); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public MeritWageDto create(MeritWage resources) { |
| | | MeritWage id = meritWageRepository.findByLevelId(resources.getLevelId()); |
| | | if (id != null) { |
| | | throw new BadRequestException("当前级别已存在信息"); |
| | | } |
| | | return meritWageMapper.toDto(meritWageRepository.save(resources)); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void update(MeritWage resources) { |
| | | MeritWage meritWage = meritWageRepository.findById(resources.getId()).orElseGet(MeritWage::new); |
| | | ValidationUtil.isNull( meritWage.getId(),"MeritWage","id",resources.getId()); |
| | | meritWage.copy(resources); |
| | | meritWage.setName(cmnLevelRepository.findById(resources.getLevelId()).get().getName()); |
| | | meritWageRepository.save(meritWage); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteAll(Long[] ids) { |
| | | for (Long id : ids) { |
| | | meritWageRepository.deleteById(id); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void download(List<MeritWageDto> all, HttpServletResponse response) throws IOException { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (MeritWageDto meritWage : all) { |
| | | Map<String,Object> map = new LinkedHashMap<>(); |
| | | map.put("岗位ID", meritWage.getJobId()); |
| | | map.put("名称", meritWage.getName()); |
| | | map.put("一级标准", meritWage.getLevelOne()); |
| | | map.put("一级业绩", meritWage.getLevelOneWage()); |
| | | map.put("二级标准", meritWage.getLevelTwo()); |
| | | map.put("二级业绩", meritWage.getLevelTwoWage()); |
| | | map.put("三级标准", meritWage.getLevelThree()); |
| | | map.put("三级业绩", meritWage.getLevelThreeWage()); |
| | | map.put("备注", meritWage.getRemarks()); |
| | | map.put("等级ID", meritWage.getLevelId()); |
| | | list.add(map); |
| | | } |
| | | FileUtil.downloadExcel(list, response); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getAllDate() { |
| | | List<CmnLevel> all = cmnLevelRepository.findAll(); |
| | | List<Map<String, Object>> mapList = new ArrayList<>(); |
| | | for (CmnLevel cmnLevel : all) { |
| | | if (cmnLevel.getId().equals(21L) || cmnLevel.getId().equals(23L)) { |
| | | continue; |
| | | } |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("level_id",cmnLevel.getId()); |
| | | map.put("job_id",cmnLevel.getJob().getId()); |
| | | map.put("name",cmnLevel.getName()); |
| | | mapList.add(map); |
| | | } |
| | | return mapList; |
| | | } |
| | | } |
| 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.treatment.service.mapstruct; |
| | | |
| | | import me.zhengjie.base.BaseMapper; |
| | | import me.zhengjie.modules.treatment.domain.MeritWage; |
| | | import me.zhengjie.modules.treatment.service.dto.MeritWageDto; |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.ReportingPolicy; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @author 初瑞峰 |
| | | * @date 2023-09-07 |
| | | **/ |
| | | @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) |
| | | public interface MeritWageMapper extends BaseMapper<MeritWageDto, MeritWage> { |
| | | |
| | | } |
| New file |
| | |
| | | package me.zhengjie; |
| | | |
| | | import me.zhengjie.modules.system.repository.UserRepository; |
| | | import me.zhengjie.modules.system.service.impl.UserServiceImpl; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | |
| | | @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) |
| | | public class UserTest { |
| | | |
| | | @Autowired |
| | | UserRepository userRepository; |
| | | |
| | | @Autowired |
| | | UserServiceImpl userService; |
| | | |
| | | @Test |
| | | public void test() { |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | import request from '@/utils/request' |
| | | |
| | | export function add(data) { |
| | | return request({ |
| | | url: 'api/meritWage', |
| | | method: 'post', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export function del(ids) { |
| | | return request({ |
| | | url: 'api/meritWage/', |
| | | method: 'delete', |
| | | data: ids |
| | | }) |
| | | } |
| | | |
| | | export function edit(data) { |
| | | return request({ |
| | | url: 'api/meritWage', |
| | | method: 'put', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | export function getAllDate() { |
| | | return request({ |
| | | url: 'api/meritWage/getAllDate', |
| | | method: 'get' |
| | | }) |
| | | } |
| | | |
| | | export default { add, edit, del, getAllDate } |
| | |
| | | <money-input :key="actualAchievementsWageRandom" v-model="form.actualAchievementsWage" :width="523" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | </el-form-item> |
| | | <el-divider>业绩工资</el-divider> |
| | | <el-form-item label="应完成工时" prop="needCompletedPerformanceHours"> |
| | | <el-input v-model="form.needCompletedPerformanceHours" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="performanceParameterBlur"> |
| | | <template slot="append">小时</template> |
| | | </el-input> |
| | | <el-form-item label="业绩完成比" prop="CompletedAchievementsHoursRate"> |
| | | <el-input v-model="form.CompletedAchievementsHoursRate" style="width: 200px;" :disabled="true" @blur="achievementsParameterBlur" /> |
| | | </el-form-item> |
| | | <el-form-item label="已完成工时" prop="alreadyCompletedPerformanceHours"> |
| | | <el-input v-model="form.alreadyCompletedPerformanceHours" style="width: 200px;" :disabled="disabledFlagByApprove" @blur="performanceParameterBlur"> |
| | | <template slot="append">小时</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="预计工资" prop="performanceWage"> |
| | | <money-input :key="performanceWageRandom" v-model="form.performanceWage" :width="523" :disabled="disabledFlagByApprove" @blur="performanceWageBlur" /> |
| | | </el-form-item> |
| | | <el-form-item label="实际工资" prop="actualPerformanceWage"> |
| | | <money-input :key="actualPerformanceWageRandom" v-model="form.actualPerformanceWage" :width="523" :disabled="disabledFlagByApprove" @blur="statisticalAmount" /> |
| | | <el-form-item label="预计工资" prop="achievementsWage"> |
| | | <money-input :key="achievementsWageRandom" v-model="form.achievementsWage" :width="523" :disabled="true" @blur="achievementsWageBlur" /> |
| | | </el-form-item> |
| | | <el-divider>团队工资</el-divider> |
| | | <el-form-item label="实达标工时" prop="actualComplianceTeamHours"> |
| | |
| | | import crudProjectPerformanceDetail from '@/api/project/projectPerformanceDetail' |
| | | import crudSysConfigIndividualIncomeTax from '@/api/system/configIndividualIncomeTax' |
| | | |
| | | const defaultForm = { id: null, userId: null, salaryYearMonth: null, basicWage: null, fullDays: null, absenceDays: null, actualBasicWage: null, achievementsWage: null, needCompletedAchievementsHours: null, alreadyCompletedAchievementsHours: null, actualAchievementsWage: null, performanceWage: null, personalPerformanceProportion: null, needCompletedPerformanceHours: null, alreadyCompletedPerformanceHours: null, actualPerformanceWage: null, teamWage: null, actualComplianceTeamHours: null, alreadyCompletedTeamHours: null, actualTeamWage: null, pieceRate: 0, travelAllowance: 0, accumulationFund: null, accumulationFundPersonal: null, accumulationFundPersonalAmount: null, accumulationFundCompany: null, accumulationFundCompanyAmount: null, retirementInsurance: null, retirementInsurancePersonal: null, retirementInsurancePersonalAmount: null, retirementInsuranceCompany: null, retirementInsuranceCompanyAmount: null, medicalInsurance: null, medicalInsurancePersonal: null, medicalInsurancePersonalAmount: null, medicalInsuranceCompany: null, medicalInsuranceCompanyAmount: null, unemploymentInsurance: null, unemploymentInsurancePersonal: null, unemploymentInsurancePersonalAmount: null, unemploymentInsuranceCompany: null, unemploymentInsuranceCompanyAmount: null, birthInsurance: null, birthInsurancePersonal: null, birthInsurancePersonalAmount: null, birthInsuranceCompany: null, birthInsuranceCompanyAmount: null, employmentInsurance: null, employmentInsurancePersonal: null, employmentInsurancePersonalAmount: null, employmentInsuranceCompany: null, employmentInsuranceCompanyAmount: null, preTaxAmount: null, individualIncomeTax: null, afterTaxAmount: null, remarks: null, publicityStatus: constant.PUBLICITY_STATUS_NOT, approveStatus: constant.APPROVE_STATUS_UNRECOGNIZED, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | const defaultForm = { id: null, userId: null, salaryYearMonth: null, basicWage: null, fullDays: null, absenceDays: null, actualBasicWage: null, achievementsWage: null, needCompletedAchievementsHours: null, alreadyCompletedAchievementsHours: null, CompletedAchievementsHoursRate: null, actualAchievementsWage: null, performanceWage: null, personalPerformanceProportion: null, needCompletedPerformanceHours: null, alreadyCompletedPerformanceHours: null, actualPerformanceWage: null, teamWage: null, actualComplianceTeamHours: null, alreadyCompletedTeamHours: null, actualTeamWage: null, pieceRate: 0, travelAllowance: 0, accumulationFund: null, accumulationFundPersonal: null, accumulationFundPersonalAmount: null, accumulationFundCompany: null, accumulationFundCompanyAmount: null, retirementInsurance: null, retirementInsurancePersonal: null, retirementInsurancePersonalAmount: null, retirementInsuranceCompany: null, retirementInsuranceCompanyAmount: null, medicalInsurance: null, medicalInsurancePersonal: null, medicalInsurancePersonalAmount: null, medicalInsuranceCompany: null, medicalInsuranceCompanyAmount: null, unemploymentInsurance: null, unemploymentInsurancePersonal: null, unemploymentInsurancePersonalAmount: null, unemploymentInsuranceCompany: null, unemploymentInsuranceCompanyAmount: null, birthInsurance: null, birthInsurancePersonal: null, birthInsurancePersonalAmount: null, birthInsuranceCompany: null, birthInsuranceCompanyAmount: null, employmentInsurance: null, employmentInsurancePersonal: null, employmentInsurancePersonalAmount: null, employmentInsuranceCompany: null, employmentInsuranceCompanyAmount: null, preTaxAmount: null, individualIncomeTax: null, afterTaxAmount: null, remarks: null, publicityStatus: constant.PUBLICITY_STATUS_NOT, approveStatus: constant.APPROVE_STATUS_UNRECOGNIZED, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | export default { |
| | | name: 'NewSalary', |
| | | components: { pagination, crudOperation, rrOperation, udOperation, moneyInput }, |
| | |
| | | this.form.fullDays = Number((res * 8).toFixed(2)) |
| | | // 应完成绩效工时 |
| | | this.form.needCompletedAchievementsHours = Number((res * 8).toFixed(2)) |
| | | this.form.CompletedAchievementsHoursRate = Number(this.form.alreadyCompletedAchievementsHours / this.form.needCompletedAchievementsHours * 100).toFixed(2) |
| | | console.log(this.form) |
| | | // 发请求获取当前这个用户当前的基本的当前的业绩完成比可以得到多少钱 |
| | | // 定时器 |
| | | const interval = setInterval(() => { |
| | | // 判断个人业绩比例是否为空 |
| New file |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <!--工具栏--> |
| | | <div class="head-container"> |
| | | <div v-if="crud.props.searchToggle"> |
| | | <!-- 搜索 --> |
| | | <label class="el-form-item-label">名称</label> |
| | | <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="80px"> |
| | | <el-form-item label="名称" prop="levelId"> |
| | | <el-select v-model="form.levelId" placeholder="请选择" :disabled="crud.status.edit === 1"> |
| | | <el-option |
| | | v-for="item in LevelList" |
| | | :key="item.level_id" |
| | | :label="item.name" |
| | | :value="item.level_id" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="一级标准" prop="levelOne"> |
| | | <el-input v-model="form.levelOne" style="width: 370px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="一级业绩" prop="levelOneWage"> |
| | | <el-input v-model="form.levelOneWage" style="width: 370px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="二级标准" prop="levelTwo"> |
| | | <el-input v-model="form.levelTwo" style="width: 370px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="二级业绩" prop="levelTwoWage"> |
| | | <el-input v-model="form.levelTwoWage" style="width: 370px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="三级标准" prop="levelThree"> |
| | | <el-input v-model="form.levelThree" style="width: 370px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="三级业绩" prop="levelThreeWage"> |
| | | <el-input v-model="form.levelThreeWage" style="width: 370px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="备注"> |
| | | <el-input v-model="form.remarks" :rows="3" type="textarea" style="width: 370px;" /> |
| | | </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="name" label="名称"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ scope.row.name }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column :show-overflow-tooltip="true" prop="levelOne" label="一级标准" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="levelOneWage" label="一级业绩" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="levelTwo" label="二级标准" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="levelTwoWage" label="二级业绩" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="levelThree" label="三级标准" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="levelThreeWage" label="三级业绩" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="remarks" label="备注" /> |
| | | <el-table-column v-if="checkPer(['admin','meritWage:edit','meritWage: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 crudMeritWage from '@/api/treatment/meritWage' |
| | | 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' |
| | | |
| | | const defaultForm = { id: null, jobId: null, name: null, levelOne: null, levelOneWage: null, levelTwo: null, levelTwoWage: null, levelThree: null, levelThreeWage: null, remarks: null, levelId: null } |
| | | export default { |
| | | name: 'MeritWage', |
| | | components: { pagination, crudOperation, rrOperation, udOperation }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | cruds() { |
| | | return CRUD({ title: '业绩管理', url: 'api/meritWage', idField: 'id', sort: 'id,asc', crudMethod: { ...crudMeritWage }}) |
| | | }, |
| | | data() { |
| | | return { |
| | | permission: { |
| | | add: ['admin', 'meritWage:add'], |
| | | edit: ['admin', 'meritWage:edit'], |
| | | del: ['admin', 'meritWage:del'] |
| | | }, |
| | | rules: { |
| | | name: [ |
| | | { required: true, message: '名称不能为空', trigger: 'blur' } |
| | | ], |
| | | levelOne: [ |
| | | { required: true, message: '一级标准不能为空', trigger: 'blur' } |
| | | ], |
| | | levelOneWage: [ |
| | | { required: true, message: '一级业绩不能为空', trigger: 'blur' } |
| | | ], |
| | | levelTwo: [ |
| | | { required: true, message: '二级标准不能为空', trigger: 'blur' } |
| | | ], |
| | | levelTwoWage: [ |
| | | { required: true, message: '二级业绩不能为空', trigger: 'blur' } |
| | | ], |
| | | levelThree: [ |
| | | { required: true, message: '三级标准不能为空', trigger: 'blur' } |
| | | ], |
| | | levelThreeWage: [ |
| | | { required: true, message: '三级业绩不能为空', trigger: 'blur' } |
| | | ] |
| | | }, |
| | | queryTypeOptions: [ |
| | | { key: 'name', display_name: '名称' } |
| | | ], |
| | | LevelList: [] |
| | | } |
| | | }, |
| | | mounted() { |
| | | crudMeritWage.getAllDate().then(res => { |
| | | this.LevelList = res |
| | | }) |
| | | }, |
| | | methods: { |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | | [CRUD.HOOK.beforeRefresh]() { |
| | | return true |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |