1
This commit is contained in:
parent
ffa2aa024e
commit
fcf9455064
@ -0,0 +1,65 @@
|
||||
package com.dianliang.module.custom.controller;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.dianliang.module.custom.vo.CompanyReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import com.dianliang.module.custom.entity.DlCompany;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.dianliang.module.custom.service.DlCompanyService;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 企业信息表(每个租户的下属企业信息);(dl_company)表控制层
|
||||
* @author : http://www.chiner.pro
|
||||
* @date : 2024-7-31
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/base/company")
|
||||
@Tag(name = "管理后台 - BASE 企业管理")
|
||||
@Validated
|
||||
public class DlCompanyController{
|
||||
@Autowired
|
||||
private DlCompanyService dlCompanyService;
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得企业信息表(每个租户的下属企业信息)分页")
|
||||
@PreAuthorize("@ss.hasPermission('base:company:query')")
|
||||
public CommonResult<IPage<?>> getCompanyPage(CompanyReqVO pageReqVO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize) {
|
||||
Page<DlCompany> page = new Page<>(pageNo, pageSize);
|
||||
return success(dlCompanyService.queryListPage(pageReqVO,page));
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
package com.dianliang.module.custom.controller;
|
||||
|
||||
public class TestController {
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
package com.dianliang.module.custom.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.dianliang.module.custom.entity.TestEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface TestMapper extends BaseMapper<TestEntity> {
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.dianliang.module.custom.entity;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 企业信息表(每个租户的下属企业信息);
|
||||
* @author : http://www.chiner.pro
|
||||
* @date : 2024-7-31
|
||||
*/
|
||||
@TableName("dl_company")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class DlCompany extends BaseDO {
|
||||
/** 主键标识 */
|
||||
@TableId
|
||||
private String id ;
|
||||
/** 企业名称 */
|
||||
private String corpName ;
|
||||
/** 统一社会信用代码 */
|
||||
private String orgCard ;
|
||||
/** 注册资本(单位:万元) */
|
||||
private Integer registFund ;
|
||||
/** 注册日期 */
|
||||
private Date registDate ;
|
||||
/** 详细地址 */
|
||||
private String address ;
|
||||
/** 法人姓名 */
|
||||
private String legalName ;
|
||||
/** 法人身份证号 */
|
||||
private String legalCard ;
|
||||
/** 联系人 */
|
||||
private String contactName ;
|
||||
/** 联系方式 */
|
||||
private String mobilePhone ;
|
||||
/** 企业简介 */
|
||||
private String corpContent ;
|
||||
/** 经营范围 */
|
||||
private String business ;
|
||||
/** 管理员登录账号 */
|
||||
private String loginAccount ;
|
||||
/** 关联的菜单编号(实际就是这个企业的用户登录后有哪些菜单权限) */
|
||||
private String menuIds ;
|
||||
/** 租户号 */
|
||||
private String tenantId ;
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
package com.dianliang.module.custom.entity;
|
||||
|
||||
public class TestEntity {
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.dianliang.module.custom.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.dianliang.module.custom.vo.CompanyReqVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.dianliang.module.custom.entity.DlCompany;
|
||||
|
||||
/**
|
||||
* 企业信息表(每个租户的下属企业信息);(dl_company)表数据库访问层
|
||||
* @author : http://www.chiner.pro
|
||||
* @date : 2024-7-31
|
||||
*/
|
||||
@Mapper
|
||||
public interface DlCompanyMapper extends BaseMapper<DlCompany>{
|
||||
IPage<DlCompany> selectListPage(@Param("map") CompanyReqVO companyReqVO, Page<DlCompany> page);
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.dianliang.module.custom.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dianliang.module.custom.entity.DlCompany;
|
||||
import java.util.*;
|
||||
import javax.validation.*;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import com.dianliang.module.custom.vo.CompanyReqVO;
|
||||
|
||||
/**
|
||||
* 企业信息表(每个租户的下属企业信息);(dl_company)表服务接口
|
||||
* @author : http://www.chiner.pro
|
||||
* @date : 2024-7-31
|
||||
*/
|
||||
public interface DlCompanyService extends IService<DlCompany> {
|
||||
/**
|
||||
* 获得企业信息表(每个租户的下属企业信息)分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 企业信息表(每个租户的下属企业信息)分页
|
||||
*/
|
||||
IPage<DlCompany> queryListPage(CompanyReqVO pageReqVO, Page<DlCompany> page);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
package com.dianliang.module.custom.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.dianliang.module.custom.entity.TestEntity;
|
||||
|
||||
public interface TestService extends IService<TestEntity> {
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
package com.dianliang.module.custom.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dianliang.module.custom.vo.CompanyReqVO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper;
|
||||
import com.dianliang.module.custom.entity.DlCompany;
|
||||
import com.dianliang.module.custom.mapper.DlCompanyMapper;
|
||||
import com.dianliang.module.custom.service.DlCompanyService;
|
||||
/**
|
||||
* 企业信息表(每个租户的下属企业信息);(dl_company)表服务实现类
|
||||
* @author : http://www.chiner.pro
|
||||
* @date : 2024-7-31
|
||||
*/
|
||||
@Service
|
||||
public class DlCompanyServiceImpl extends ServiceImpl<DlCompanyMapper, DlCompany> implements DlCompanyService{
|
||||
@Autowired
|
||||
private DlCompanyMapper dlCompanyMapper;
|
||||
|
||||
|
||||
/**
|
||||
* 获得企业信息表(每个租户的下属企业信息)分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @param page
|
||||
* @return 企业信息表(每个租户的下属企业信息)分页
|
||||
*/
|
||||
@Override
|
||||
public IPage<DlCompany> queryListPage(CompanyReqVO pageReqVO, Page<DlCompany> page) {
|
||||
IPage<DlCompany> pageList = dlCompanyMapper.selectListPage(pageReqVO,page);
|
||||
return pageList;
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
package com.dianliang.module.custom.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.dianliang.module.custom.dao.TestMapper;
|
||||
import com.dianliang.module.custom.entity.TestEntity;
|
||||
import com.dianliang.module.custom.service.TestService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class TestServiceImpl extends ServiceImpl<TestMapper, TestEntity> implements TestService {
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.dianliang.module.custom.vo;
|
||||
|
||||
import com.dianliang.module.custom.entity.DlCompany;
|
||||
import lombok.Data;
|
||||
/**
|
||||
* 企业查询vo
|
||||
* @author vinjor-M
|
||||
* @date 17:37 2024/7/31
|
||||
**/
|
||||
@Data
|
||||
public class CompanyReqVO extends DlCompany {
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.dianliang.module.custom.mapper.DlCompanyMapper">
|
||||
<select id="selectListPage" resultType="com.dianliang.module.custom.entity.DlCompany">
|
||||
select * from base_company
|
||||
</select>
|
||||
</mapper>
|
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.dianliang.module.custom.dao.TestMapper">
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user