1 files added
7 files modified
9 files renamed
1 files deleted
| | |
| | | import me.zhengjie.modules.assetManagement.domain.AssetManagement; |
| | | import me.zhengjie.modules.assetManagement.domain.AssetUseManagement; |
| | | import me.zhengjie.modules.assetManagement.repository.AssetUseManagementRepository; |
| | | import me.zhengjie.modules.constant.Constant; |
| | | import me.zhengjie.modules.system.domain.SysUserCompany; |
| | | import me.zhengjie.modules.system.domain.SysCompany; |
| | | import me.zhengjie.modules.system.repository.DictDetailRepository; |
| | | import me.zhengjie.modules.system.repository.SysUserCompanyRepository; |
| | | import me.zhengjie.modules.system.repository.SysCompanyRepository; |
| | | import me.zhengjie.utils.ValidationUtil; |
| | | import me.zhengjie.utils.FileUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | |
| | | private final AssetManagementRepository assetManagementRepository; |
| | | private final AssetManagementMapper assetManagementMapper; |
| | | private final SysUserCompanyRepository sysUserCompanyRepository; |
| | | private final SysCompanyRepository sysCompanyRepository; |
| | | private final DictDetailRepository dictDetailRepository; |
| | | private final AssetUseManagementRepository assetUseManagementRepository; |
| | | |
| | |
| | | map.put("资产类型", assetManagement.getAssetsType()); |
| | | map.put("购买日期", assetManagement.getBuyDate()); |
| | | map.put("购买金额", assetManagement.getBuyMoney()); |
| | | map.put("所属公司", sysUserCompanyRepository.findById(assetManagement.getAffiliatedCompanyId()).orElseGet(SysUserCompany::new).getLabel()); |
| | | map.put("所属公司", sysCompanyRepository.findById(assetManagement.getAffiliatedCompanyId()).orElseGet(SysCompany::new).getLabel()); |
| | | map.put("使用状态", results); |
| | | map.put("备注", assetManagement.getRemarks()); |
| | | map.put("创建者", assetManagement.getCreateBy()); |
| | |
| | | import me.zhengjie.modules.assetManagement.repository.AssetManagementRepository; |
| | | import me.zhengjie.modules.conferenceRoom.domain.MeetingRoom; |
| | | import me.zhengjie.modules.conferenceRoom.repository.MeetingRoomRepository; |
| | | import me.zhengjie.modules.system.domain.SysUserCompany; |
| | | import me.zhengjie.modules.system.domain.SysUserContract; |
| | | import me.zhengjie.modules.system.domain.User; |
| | | import me.zhengjie.modules.system.repository.UserRepository; |
| | | import me.zhengjie.modules.system.service.dto.SysUserContractDto; |
| | | import me.zhengjie.utils.ValidationUtil; |
| | | import me.zhengjie.utils.FileUtil; |
| | | import lombok.RequiredArgsConstructor; |
| File was renamed from eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/domain/SysUserCompany.java |
| | |
| | | **/ |
| | | @Entity |
| | | @Data |
| | | @Table(name="sys_user_company") |
| | | public class SysUserCompany extends BaseEntity implements Serializable { |
| | | @Table(name="sys_company") |
| | | public class SysCompany extends BaseEntity implements Serializable { |
| | | |
| | | @Id |
| | | @GeneratedValue(strategy = GenerationType.IDENTITY) |
| | |
| | | @ApiModelProperty(value = "标签") |
| | | private String label; |
| | | |
| | | public void copy(SysUserCompany source){ |
| | | public void copy(SysCompany source){ |
| | | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); |
| | | } |
| | | } |
| File was renamed from eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/repository/SysUserCompanyRepository.java |
| | |
| | | */ |
| | | package me.zhengjie.modules.system.repository; |
| | | |
| | | import me.zhengjie.modules.system.domain.SysUserCompany; |
| | | import me.zhengjie.modules.system.domain.SysCompany; |
| | | import org.springframework.data.jpa.repository.JpaRepository; |
| | | import org.springframework.data.jpa.repository.JpaSpecificationExecutor; |
| | | import org.springframework.data.jpa.repository.Query; |
| | | |
| | | /** |
| | | * @website https://eladmin.vip |
| | | * @author wcd |
| | | * @date 2023-01-30 |
| | | **/ |
| | | public interface SysUserCompanyRepository extends JpaRepository<SysUserCompany, Long>, JpaSpecificationExecutor<SysUserCompany> { |
| | | public interface SysCompanyRepository extends JpaRepository<SysCompany, Long>, JpaSpecificationExecutor<SysCompany> { |
| | | |
| | | /** |
| | | * 根据value查询公司(导出用) |
| | | * @return |
| | | */ |
| | | // @Query |
| | | // SysUserCompany findByValue(String value); |
| | | } |
| File was renamed from eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/rest/SysUserCompanyController.java |
| | |
| | | package me.zhengjie.modules.system.rest; |
| | | |
| | | import me.zhengjie.annotation.Log; |
| | | import me.zhengjie.modules.system.domain.SysUserCompany; |
| | | import me.zhengjie.modules.system.service.SysUserCompanyService; |
| | | import me.zhengjie.modules.system.service.dto.SysUserCompanyDto; |
| | | import me.zhengjie.modules.system.service.dto.SysUserCompanyQueryCriteria; |
| | | import me.zhengjie.modules.system.domain.SysCompany; |
| | | import me.zhengjie.modules.system.service.SysCompanyService; |
| | | import me.zhengjie.modules.system.service.dto.SysCompanyDto; |
| | | import me.zhengjie.modules.system.service.dto.SysCompanyQueryCriteria; |
| | | import org.springframework.data.domain.Pageable; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.http.HttpStatus; |
| | |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "公司管理管理") |
| | | @RequestMapping("/api/sysUserCompany") |
| | | public class SysUserCompanyController { |
| | | @RequestMapping("/api/sysCompany") |
| | | public class SysCompanyController { |
| | | |
| | | private final SysUserCompanyService sysUserCompanyService; |
| | | private final SysCompanyService sysCompanyService; |
| | | |
| | | @Log("导出数据") |
| | | @ApiOperation("导出数据") |
| | | @GetMapping(value = "/download") |
| | | @PreAuthorize("@el.check('sysUserCompany:download')") |
| | | public void exportSystemSetting(HttpServletResponse response, SysUserCompanyQueryCriteria criteria) throws IOException { |
| | | sysUserCompanyService.download(sysUserCompanyService.queryAll(criteria), response); |
| | | @PreAuthorize("@el.check('sysCompany:download')") |
| | | public void exportSystemSetting(HttpServletResponse response, SysCompanyQueryCriteria criteria) throws IOException { |
| | | sysCompanyService.download(sysCompanyService.queryAll(criteria), response); |
| | | } |
| | | |
| | | @GetMapping |
| | | @Log("查询公司管理") |
| | | @ApiOperation("查询公司管理") |
| | | @PreAuthorize("@el.check('sysUserCompany:list')") |
| | | public ResponseEntity<Object> querySystemSetting(SysUserCompanyQueryCriteria criteria, Pageable pageable){ |
| | | return new ResponseEntity<>(sysUserCompanyService.queryAll(criteria,pageable),HttpStatus.OK); |
| | | @PreAuthorize("@el.check('sysCompany:list')") |
| | | public ResponseEntity<Object> querySystemSetting(SysCompanyQueryCriteria criteria, Pageable pageable){ |
| | | return new ResponseEntity<>(sysCompanyService.queryAll(criteria,pageable),HttpStatus.OK); |
| | | } |
| | | |
| | | @GetMapping(value = "/all") |
| | | @Log("查询公司管理") |
| | | @ApiOperation("查询公司管理") |
| | | @PreAuthorize("@el.check('sysUserCompany:list')") |
| | | public ResponseEntity<Object> querySystemSetting(SysUserCompanyQueryCriteria criteria){ |
| | | return new ResponseEntity<>(sysUserCompanyService.queryAll(criteria),HttpStatus.OK); |
| | | @PreAuthorize("@el.check('sysCompany:list')") |
| | | public ResponseEntity<Object> querySystemSetting(SysCompanyQueryCriteria criteria){ |
| | | return new ResponseEntity<>(sysCompanyService.queryAll(criteria),HttpStatus.OK); |
| | | } |
| | | |
| | | @PostMapping |
| | | @Log("新增公司管理") |
| | | @ApiOperation("新增公司管理") |
| | | @PreAuthorize("@el.check('sysUserCompany:add')") |
| | | public ResponseEntity<Object> createSystemSetting(@Validated @RequestBody SysUserCompany resources){ |
| | | return new ResponseEntity<>(sysUserCompanyService.create(resources),HttpStatus.CREATED); |
| | | @PreAuthorize("@el.check('sysCompany:add')") |
| | | public ResponseEntity<Object> createSystemSetting(@Validated @RequestBody SysCompany resources){ |
| | | return new ResponseEntity<>(sysCompanyService.create(resources),HttpStatus.CREATED); |
| | | } |
| | | |
| | | @PutMapping |
| | | @Log("修改公司管理") |
| | | @ApiOperation("修改公司管理") |
| | | @PreAuthorize("@el.check('sysUserCompany:edit')") |
| | | public ResponseEntity<Object> updateSystemSetting(@Validated @RequestBody SysUserCompany resources){ |
| | | sysUserCompanyService.update(resources); |
| | | @PreAuthorize("@el.check('sysCompany:edit')") |
| | | public ResponseEntity<Object> updateSystemSetting(@Validated @RequestBody SysCompany resources){ |
| | | sysCompanyService.update(resources); |
| | | return new ResponseEntity<>(HttpStatus.NO_CONTENT); |
| | | } |
| | | |
| | | @DeleteMapping |
| | | @Log("删除公司管理") |
| | | @ApiOperation("删除公司管理") |
| | | @PreAuthorize("@el.check('sysUserCompany:del')") |
| | | @PreAuthorize("@el.check('sysCompany:del')") |
| | | public ResponseEntity<Object> deleteSystemSetting(@RequestBody Long[] ids) { |
| | | sysUserCompanyService.deleteAll(ids); |
| | | sysCompanyService.deleteAll(ids); |
| | | return new ResponseEntity<>(HttpStatus.OK); |
| | | } |
| | | |
| | |
| | | @PostMapping(value = "/getCompName") |
| | | @Log("选择用户改变公司") |
| | | @ApiOperation("选择用户改变公司") |
| | | public ResponseEntity<Object> getCompName(@Validated @RequestBody SysUserCompanyDto resources){ |
| | | return new ResponseEntity<>(sysUserCompanyService.getCompName(resources), HttpStatus.OK); |
| | | public ResponseEntity<Object> getCompName(@Validated @RequestBody SysCompanyDto resources){ |
| | | return new ResponseEntity<>(sysCompanyService.getCompName(resources), HttpStatus.OK); |
| | | } |
| | | } |
| File was renamed from eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/SysUserCompanyService.java |
| | |
| | | */ |
| | | package me.zhengjie.modules.system.service; |
| | | |
| | | import me.zhengjie.modules.system.domain.SysUserCompany; |
| | | import me.zhengjie.modules.system.service.dto.SysUserCompanyDto; |
| | | import me.zhengjie.modules.system.service.dto.SysUserCompanyQueryCriteria; |
| | | import me.zhengjie.modules.system.domain.SysCompany; |
| | | import me.zhengjie.modules.system.service.dto.SysCompanyDto; |
| | | import me.zhengjie.modules.system.service.dto.SysCompanyQueryCriteria; |
| | | import org.springframework.data.domain.Pageable; |
| | | import java.util.Map; |
| | | import java.util.List; |
| | |
| | | * @author wcd |
| | | * @date 2023-01-30 |
| | | **/ |
| | | public interface SysUserCompanyService { |
| | | public interface SysCompanyService { |
| | | |
| | | /** |
| | | * 查询数据分页 |
| | |
| | | * @param pageable 分页参数 |
| | | * @return Map<String,Object> |
| | | */ |
| | | Map<String,Object> queryAll(SysUserCompanyQueryCriteria criteria, Pageable pageable); |
| | | Map<String,Object> queryAll(SysCompanyQueryCriteria criteria, Pageable pageable); |
| | | |
| | | /** |
| | | * 查询所有数据不分页 |
| | | * @param criteria 条件参数 |
| | | * @return List<SystemSettingDto> |
| | | */ |
| | | List<SysUserCompanyDto> queryAll(SysUserCompanyQueryCriteria criteria); |
| | | List<SysCompanyDto> queryAll(SysCompanyQueryCriteria criteria); |
| | | |
| | | /** |
| | | * 根据ID查询 |
| | | * @param id ID |
| | | * @return SystemSettingDto |
| | | */ |
| | | SysUserCompanyDto findById(Long id); |
| | | SysCompanyDto findById(Long id); |
| | | |
| | | /** |
| | | * 创建 |
| | | * @param resources / |
| | | * @return SystemSettingDto |
| | | */ |
| | | SysUserCompanyDto create(SysUserCompany resources); |
| | | SysCompanyDto create(SysCompany resources); |
| | | |
| | | /** |
| | | * 编辑 |
| | | * @param resources / |
| | | */ |
| | | void update(SysUserCompany resources); |
| | | void update(SysCompany resources); |
| | | |
| | | /** |
| | | * 多选删除 |
| | |
| | | * @param response / |
| | | * @throws IOException / |
| | | */ |
| | | void download(List<SysUserCompanyDto> all, HttpServletResponse response) throws IOException; |
| | | void download(List<SysCompanyDto> all, HttpServletResponse response) throws IOException; |
| | | |
| | | /** |
| | | * 选择用户改变公司 |
| | | * @param resources |
| | | * @return |
| | | */ |
| | | SysUserCompany getCompName(SysUserCompanyDto resources); |
| | | SysCompany getCompName(SysCompanyDto resources); |
| | | } |
| File was renamed from eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/SysUserCompanyDto.java |
| | |
| | | * @date 2023-01-30 |
| | | **/ |
| | | @Data |
| | | public class SysUserCompanyDto extends BaseDTO implements Serializable { |
| | | public class SysCompanyDto extends BaseDTO implements Serializable { |
| | | |
| | | private Long id; |
| | | |
| File was renamed from eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/SysUserCompanyQueryCriteria.java |
| | |
| | | * @date 2023-01-30 |
| | | **/ |
| | | @Data |
| | | public class SysUserCompanyQueryCriteria { |
| | | public class SysCompanyQueryCriteria { |
| | | |
| | | @Query(type = Query.Type.INNER_LIKE) |
| | | private String label; |
| 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.SysCompany; |
| | | import me.zhengjie.modules.system.domain.User; |
| | | import me.zhengjie.modules.system.repository.UserRepository; |
| | | import me.zhengjie.modules.system.service.dto.SysCompanyDto; |
| | | import me.zhengjie.modules.system.service.mapstruct.SysCompanyMapper; |
| | | import me.zhengjie.utils.ValidationUtil; |
| | | import me.zhengjie.utils.FileUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import me.zhengjie.modules.system.repository.SysCompanyRepository; |
| | | import me.zhengjie.modules.system.service.SysCompanyService; |
| | | import me.zhengjie.modules.system.service.dto.SysCompanyQueryCriteria; |
| | | 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 wcd |
| | | * @date 2023-01-30 |
| | | **/ |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class SysCompanyServiceImpl implements SysCompanyService { |
| | | |
| | | private final SysCompanyRepository sysCompanyRepository; |
| | | private final SysCompanyMapper sysCompanyMapper; |
| | | private final UserRepository userRepository; |
| | | |
| | | @Override |
| | | public Map<String,Object> queryAll(SysCompanyQueryCriteria criteria, Pageable pageable){ |
| | | Page<SysCompany> page = sysCompanyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); |
| | | return PageUtil.toPage(page.map(sysCompanyMapper::toDto)); |
| | | } |
| | | |
| | | @Override |
| | | public List<SysCompanyDto> queryAll(SysCompanyQueryCriteria criteria){ |
| | | return sysCompanyMapper.toDto(sysCompanyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public SysCompanyDto findById(Long id) { |
| | | SysCompany sysCompany = sysCompanyRepository.findById(id).orElseGet(SysCompany::new); |
| | | ValidationUtil.isNull(sysCompany.getId(),"SystemSetting","id",id); |
| | | return sysCompanyMapper.toDto(sysCompany); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public SysCompanyDto create(SysCompany resources) { |
| | | return sysCompanyMapper.toDto(sysCompanyRepository.save(resources)); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void update(SysCompany resources) { |
| | | SysCompany sysCompany = sysCompanyRepository.findById(resources.getId()).orElseGet(SysCompany::new); |
| | | ValidationUtil.isNull( sysCompany.getId(),"SystemSetting","id",resources.getId()); |
| | | sysCompany.copy(resources); |
| | | sysCompanyRepository.save(sysCompany); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteAll(Long[] ids) { |
| | | for (Long id : ids) { |
| | | sysCompanyRepository.deleteById(id); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void download(List<SysCompanyDto> all, HttpServletResponse response) throws IOException { |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | for (SysCompanyDto systemSetting : all) { |
| | | Map<String,Object> map = new LinkedHashMap<>(); |
| | | map.put("标签", systemSetting.getLabel()); |
| | | map.put("描述", systemSetting.getDescription()); |
| | | list.add(map); |
| | | } |
| | | FileUtil.downloadExcel(list, response); |
| | | } |
| | | |
| | | /** |
| | | * 选择用户改变公司 |
| | | * @param resources |
| | | * @return |
| | | */ |
| | | @Override |
| | | public SysCompany getCompName(SysCompanyDto resources) { |
| | | // 查询用户表 |
| | | User user = userRepository.findById(Long.valueOf(resources.getUserId())).orElseGet(User::new); |
| | | // 查询公司表 |
| | | SysCompany sysCompany = sysCompanyRepository.findById(user.getId()).orElseGet(SysCompany::new); |
| | | return sysCompany; |
| | | } |
| | | } |
| | |
| | | */ |
| | | package me.zhengjie.modules.system.service.impl; |
| | | |
| | | import me.zhengjie.modules.system.domain.SysUserCompany; |
| | | import me.zhengjie.modules.system.domain.SysCompany; |
| | | import me.zhengjie.modules.system.domain.SysUserContract; |
| | | import me.zhengjie.modules.system.domain.User; |
| | | import me.zhengjie.modules.system.repository.SysUserCompanyRepository; |
| | | import me.zhengjie.modules.system.repository.SysCompanyRepository; |
| | | import me.zhengjie.modules.system.repository.UserRepository; |
| | | import me.zhengjie.modules.system.service.dto.SysUserContractDto; |
| | | import me.zhengjie.modules.system.service.mapstruct.SysUserContractMapper; |
| | |
| | | private final SysUserContractRepository sysUserContractRepository; |
| | | private final SysUserContractMapper sysUserContractMapper; |
| | | private final UserRepository userRepository; |
| | | private final SysUserCompanyRepository sysUserCompanyRepository; |
| | | private final SysCompanyRepository sysCompanyRepository; |
| | | |
| | | @Override |
| | | public Map<String,Object> queryAll(SysUserContractQueryCriteria criteria, Pageable pageable){ |
| | |
| | | User user = userRepository.findById(sysUserContractDto.getUserId()).orElseGet(User::new); |
| | | sysUserContractDto.setUserName(user.getNickName()); |
| | | //查询公司信息 |
| | | SysUserCompany sysUserCompany = sysUserCompanyRepository.findById(sysUserContractDto.getCompanyId()).orElseGet(SysUserCompany::new); |
| | | sysUserContractDto.setCompName(sysUserCompany.getLabel()); |
| | | SysCompany sysCompany = sysCompanyRepository.findById(sysUserContractDto.getCompanyId()).orElseGet(SysCompany::new); |
| | | sysUserContractDto.setCompName(sysCompany.getLabel()); |
| | | return sysUserContractDto; |
| | | } |
| | | }; |
| | |
| | | for (SysUserContractDto sysContract : all) { |
| | | Map<String,Object> map = new LinkedHashMap<>(); |
| | | User user = userRepository.findById(sysContract.getUserId()).orElseGet(User::new); |
| | | SysUserCompany sysUserCompany = sysUserCompanyRepository.findById(sysContract.getCompanyId()).orElseGet(SysUserCompany::new); |
| | | SysCompany sysCompany = sysCompanyRepository.findById(sysContract.getCompanyId()).orElseGet(SysCompany::new); |
| | | map.put("所属员工", user.getNickName()); |
| | | map.put("合同名称", sysContract.getContractName()); |
| | | map.put("合同开始时间", sysContract.getContractStartTime()); |
| | | map.put("合同结束时间", sysContract.getContractEndTime()); |
| | | map.put("公司", sysUserCompany.getLabel()); |
| | | map.put("所属公司", sysCompany.getLabel()); |
| | | map.put("创建者", sysContract.getCreateBy()); |
| | | map.put("创建时间", sysContract.getCreateTime()); |
| | | map.put("更新者", sysContract.getUpdateBy()); |
| | |
| | | private final SysConfigHolidayRepository sysConfigHolidayRepository; |
| | | private final AttendanceGoOutRepository attendanceGoOutRepository; |
| | | private final AttendanceBusinessTravelRepository attendanceBusinessTravelRepository; |
| | | private final SysUserCompanyRepository sysUserCompanyRepository; |
| | | private final SysCompanyRepository sysCompanyRepository; |
| | | |
| | | @Override |
| | | public Object queryAll(UserQueryCriteria criteria, Pageable pageable) { |
| | |
| | | for (UserDto userDTO : queryAll) { |
| | | List<String> roles = userDTO.getRoles().stream().map(RoleSmallDto::getName).collect(Collectors.toList()); |
| | | String levelName = userDTO.getLevelId() != null ? sysLevelRepository.findById(userDTO.getLevelId()).orElseGet(SysLevel::new).getName() : ""; |
| | | SysUserCompany sysUserCompany = sysUserCompanyRepository.findById(userDTO.getCompanyId()).orElseGet(SysUserCompany::new); |
| | | SysCompany sysCompany = sysCompanyRepository.findById(userDTO.getCompanyId()).orElseGet(SysCompany::new); |
| | | Map<String, Object> map = new LinkedHashMap<>(); |
| | | map.put("用户名", userDTO.getUsername()); |
| | | map.put("角色", roles); |
| | |
| | | map.put("钉钉号", userDTO.getDingding()); |
| | | map.put("排班", userDTO.getSysRostering().getName()); |
| | | map.put("级别", levelName); |
| | | map.put("所属公司", sysUserCompany == null ? "" : sysUserCompany.getLabel()); |
| | | map.put("所属公司", sysCompany == null ? "" : sysCompany.getLabel()); |
| | | map.put("状态", userDTO.getEnabled() ? "启用" : "禁用"); |
| | | map.put("手机号码", userDTO.getPhone()); |
| | | map.put("修改密码的时间", userDTO.getPwdResetTime()); |
| File was renamed from eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapstruct/SysUserCompanyMapper.java |
| | |
| | | package me.zhengjie.modules.system.service.mapstruct; |
| | | |
| | | import me.zhengjie.base.BaseMapper; |
| | | import me.zhengjie.modules.system.domain.SysUserCompany; |
| | | import me.zhengjie.modules.system.service.dto.SysUserCompanyDto; |
| | | import me.zhengjie.modules.system.domain.SysCompany; |
| | | import me.zhengjie.modules.system.service.dto.SysCompanyDto; |
| | | import org.mapstruct.Mapper; |
| | | import org.mapstruct.ReportingPolicy; |
| | | |
| | |
| | | * @date 2023-01-30 |
| | | **/ |
| | | @Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) |
| | | public interface SysUserCompanyMapper extends BaseMapper<SysUserCompanyDto, SysUserCompany> { |
| | | public interface SysCompanyMapper extends BaseMapper<SysCompanyDto, SysCompany> { |
| | | |
| | | } |
| File was renamed from eladmin-web-master/src/api/system/sysUserCompany.js |
| | |
| | | |
| | | export function getAll(params) { |
| | | return request({ |
| | | url: 'api/sysUserCompany/all', |
| | | url: 'api/sysCompany/all', |
| | | method: 'get', |
| | | params |
| | | }) |
| | |
| | | |
| | | export function add(data) { |
| | | return request({ |
| | | url: 'api/sysUserCompany', |
| | | url: 'api/sysCompany', |
| | | method: 'post', |
| | | data |
| | | }) |
| | |
| | | |
| | | export function del(ids) { |
| | | return request({ |
| | | url: 'api/sysUserCompany/', |
| | | url: 'api/sysCompany/', |
| | | method: 'delete', |
| | | data: ids |
| | | }) |
| | |
| | | |
| | | export function edit(data) { |
| | | return request({ |
| | | url: 'api/sysUserCompany', |
| | | url: 'api/sysCompany', |
| | | method: 'put', |
| | | data |
| | | }) |
| | |
| | | |
| | | export function getCompName(data) { |
| | | return request({ |
| | | url: 'api/sysUserCompany/getCompName', |
| | | url: 'api/sysCompany/getCompName', |
| | | method: 'post', |
| | | data |
| | | }) |
| | |
| | | <el-table-column prop="affiliatedCompanyId" label="所属公司" show-overflow-tooltip> |
| | | <template slot-scope="scope"> |
| | | <template v-for="item in companyList"> |
| | | <span v-if="scope.row.affiliatedCompanyId == item.id" :key="item.id">{{ item.label }}</span> |
| | | <el-tag v-if="scope.row.affiliatedCompanyId == item.id" :key="item.id">{{ item.label }}</el-tag> |
| | | </template> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | |
| | | <script> |
| | | import crudAssetManagement from '@/api/assetManagement/assetManagement' |
| | | import crudSysUserCompany from '@/api/system/sysUserCompany' |
| | | import crudSysCompany from '@/api/system/sysCompany' |
| | | import crudUser from '@/api/system/user' |
| | | import crudMeetingRoom from '@/api/conferenceRoom/meetingRoom' |
| | | import CRUD, { presenter, header, form, crud } from '@crud/crud' |
| | |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | | [CRUD.HOOK.beforeRefresh]() { |
| | | // 查询配置参数 |
| | | crudSysUserCompany.getAll().then(res => { |
| | | crudSysCompany.getAll().then(res => { |
| | | // 公司列表 |
| | | this.companyList = res |
| | | }) |
| File was renamed from eladmin-web-master/src/views/system/userCompany/index.vue |
| | |
| | | <!--表单组件--> |
| | | <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="label"> |
| | | <el-form-item label="名称" prop="label"> |
| | | <el-input v-model="form.label" style="width: 370px;" /> |
| | | </el-form-item> |
| | | <el-form-item label="描述"> |
| | | <el-input v-model="form.description" style="width: 370px;" /> |
| | | <el-input v-model="form.description" type="textarea" rows="3" style="width: 370px;" /> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | |
| | | <!--表格渲染--> |
| | | <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="label" label="标签"> |
| | | <el-table-column prop="label" label="名称"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.label }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="description" label="描述" /> |
| | | <el-table-column prop="createTime" label="创建日期" /> |
| | | <el-table-column v-if="checkPer(['admin','sysUserCompany:edit','sysUserCompany:del'])" label="操作" width="150px" align="center"> |
| | | <el-table-column v-if="checkPer(['admin','sysCompany:edit','sysCompany:del'])" label="操作" width="150px" align="center"> |
| | | <template slot-scope="scope"> |
| | | <udOperation |
| | | :data="scope.row" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import crudSysUserCompany from '@/api/system/sysUserCompany' |
| | | import crudSysCompany from '@/api/system/sysCompany' |
| | | import CRUD, { presenter, header, form, crud } from '@crud/crud' |
| | | import rrOperation from '@crud/RR.operation' |
| | | import crudOperation from '@crud/CRUD.operation' |
| | |
| | | components: { pagination, crudOperation, rrOperation, udOperation }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | cruds() { |
| | | return CRUD({ title: '公司管理', url: 'api/sysUserCompany', idField: 'id', sort: 'id,desc', crudMethod: { ...crudSysUserCompany }}) |
| | | return CRUD({ title: '公司管理', url: 'api/sysCompany', idField: 'id', sort: 'id,desc', crudMethod: { ...crudSysCompany }}) |
| | | }, |
| | | data() { |
| | | return { |
| | | permission: { |
| | | add: ['admin', 'sysUserCompany:add'], |
| | | edit: ['admin', 'sysUserCompany:edit'], |
| | | del: ['admin', 'sysUserCompany:del'], |
| | | download: ['admin', 'sysUserCompany:download'] |
| | | add: ['admin', 'sysCompany:add'], |
| | | edit: ['admin', 'sysCompany:edit'], |
| | | del: ['admin', 'sysCompany:del'], |
| | | download: ['admin', 'sysCompany:download'] |
| | | }, |
| | | rules: { |
| | | label: [ |
| | | { required: true, message: '标签不能为空', trigger: 'blur' } |
| | | { required: true, message: '名称不能为空', trigger: 'blur' } |
| | | ] |
| | | }} |
| | | }, |
| | |
| | | import { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect' |
| | | import crudRostering from '@/api/system/rostering' |
| | | import crudLevel from '@/api/system/level' |
| | | import crudSysUserCompany from '@/api/system/sysUserCompany' |
| | | import crudSysCompany from '@/api/system/sysCompany' |
| | | let userRoles = [] |
| | | let userJobs = [] |
| | | const defaultForm = { id: null, username: null, nickName: null, gender: '男', email: null, enabled: 'false', roles: [], jobs: [], dept: { id: null }, phone: null, birthday: null, address: null, dingding: null, sysRostering: { id: null }, levelId: null } |
| | |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | | [CRUD.HOOK.beforeRefresh]() { |
| | | // 查询配置参数 |
| | | crudSysUserCompany.getAll().then(res => { |
| | | crudSysCompany.getAll().then(res => { |
| | | // 公司列表 |
| | | this.companyList = res |
| | | }) |
| | |
| | | import crudOperation from '@crud/CRUD.operation' |
| | | import udOperation from '@crud/UD.operation' |
| | | import pagination from '@crud/Pagination' |
| | | import crudSysUserCompany from '@/api/system/sysUserCompany' |
| | | import crudSysCompany from '@/api/system/sysCompany' |
| | | import crudUser from '@/api/system/user' |
| | | import fileUpload from '../../assembly/fileUpload/index.vue' |
| | | |
| | |
| | | [CRUD.HOOK.beforeRefresh]() { |
| | | this.getUsers() |
| | | // 查询配置参数 |
| | | crudSysUserCompany.getAll().then(res => { |
| | | crudSysCompany.getAll().then(res => { |
| | | // 公司列表 |
| | | this.companyList = res |
| | | }) |
| | |
| | | var form = JSON.stringify({ |
| | | 'userId': data |
| | | }) |
| | | crudSysUserCompany.getCompName(form).then(res => { |
| | | crudSysCompany.getCompName(form).then(res => { |
| | | this.form.companyId = res.label |
| | | }) |
| | | } else { |