企业名称

This commit is contained in:
zhuyy 2023-02-01 11:48:30 +08:00
parent 792eb5f84a
commit 52c04e2208
6 changed files with 134 additions and 1 deletions

View File

@ -14,12 +14,14 @@ public interface UrlConstant {
String DEPT = API + "/dept"; String DEPT = API + "/dept";
String ROLE = API + "/role"; String ROLE = API + "/role";
String PERSON = API + "/person"; String PERSON = API + "/person";
String COMPANY = API + "/company";
/** /**
* 重要说明该值为项目生成后的缺省密钥 * 重要说明该值为项目生成后的缺省密钥
* 在实际的应用中一定要为不同的项目或服务自行生成公钥和私钥并将 PRIVATE_KEY 的引用改为服务的配置项 * 在实际的应用中一定要为不同的项目或服务自行生成公钥和私钥并将 PRIVATE_KEY 的引用改为服务的配置项

View File

@ -0,0 +1,28 @@
package com.ydool.staff.controller;
import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.ydool.common.base.BaseController;
import com.ydool.common.constant.UrlConstant;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.staff.service.impl.CompanyNameServiceImpl;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(UrlConstant.COMPANY)
@Api(tags = "企业", value = "企业")
@ApiSupport(order = 1)
public class CompanyNameController extends BaseController {
@Autowired
CompanyNameServiceImpl companyNameService;
@GetMapping("/tree")
public AjaxResult tree(){
return companyNameService.companyNameTree();
}
}

View File

@ -0,0 +1,35 @@
package com.ydool.staff.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ydool.common.base.BaseEntity;
import com.ydool.common.base.TreeEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author msf
* @since 2023-02-01
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("t_lc_company_name")
@ApiModel(value="CompanyName对象", description="")
public class CompanyName extends TreeEntity {
private static final long serialVersionUID = 1L;
private String name;
private String remarks;
@Override
public String getNamed() {
return this.name;
}
}

View File

@ -0,0 +1,18 @@
package com.ydool.staff.mapper;
import com.ydool.staff.entity.CompanyName;
import com.github.yulichang.base.MPJBaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author msf
* @since 2023-02-01
*/
@Mapper
public interface CompanyNameMapper extends MPJBaseMapper<CompanyName> {
}

View File

@ -0,0 +1,17 @@
package com.ydool.staff.service;
import com.ydool.common.data.dto.AjaxResult;
/**
* <p>
* 服务类
* </p>
*
* @author msf
* @since 2023-02-01
*/
public interface ICompanyNameService {
AjaxResult companyNameTree();
}

View File

@ -0,0 +1,33 @@
package com.ydool.staff.service.impl;
import com.ydool.common.base.BaseTreeService;
import com.ydool.common.data.dto.AjaxResult;
import com.ydool.common.data.dto.OptionResult;
import com.ydool.common.utils.TreeSorterUtil;
import com.ydool.staff.entity.CompanyName;
import com.ydool.staff.mapper.CompanyNameMapper;
import com.ydool.staff.service.ICompanyNameService;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* <p>
* 服务类
* </p>
*
* @author msf
* @since 2023-02-01
*/
@Service
public class CompanyNameServiceImpl extends BaseTreeService<CompanyNameMapper, CompanyName> implements ICompanyNameService {
@Override
public AjaxResult companyNameTree() {
List<CompanyName> deptList = treeList();
List<OptionResult> optionResultList = TreeSorterUtil.optionTree(deptList);
return AjaxResult.ok().data(optionResultList);
}
}