企业demo

This commit is contained in:
Vinjor 2024-07-31 21:53:13 +08:00
parent 3826756a86
commit 9f707c10b8
16 changed files with 69 additions and 105 deletions
dl-module-base
pom.xml
src/main
java
resources/mapper/custom
pom.xml
yudao-server/src/main

View File

@ -3,21 +3,18 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <parent>
<artifactId>yudao</artifactId>
<groupId>cn.iocoder.boot</groupId> <groupId>cn.iocoder.boot</groupId>
<artifactId>yudao</artifactId>
<version>${revision}</version> <version>${revision}</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>dl-module-base</artifactId> <artifactId>dl-module-base</artifactId>
<packaging>pom</packaging> <packaging>jar</packaging>
<name>${project.artifactId}</name> <name>${project.artifactId}</name>
<description> <description>
点亮业务基础包,存放用户基础库、客户基础库、企业基础库、车辆基础库等 crm 包下客户关系管理Customer Relationship Management
例如说:客户、联系人、商机、合同、回款等等
</description> </description>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>cn.iocoder.boot</groupId> <groupId>cn.iocoder.boot</groupId>

View File

@ -1,4 +1,4 @@
package com.dianliang.common; package cn.iocoder.yudao.common;
public interface TestCommon { public interface TestCommon {
} }

View File

@ -0,0 +1,4 @@
package cn.iocoder.yudao.job;
public class TestJob {
}

View File

@ -1,44 +1,20 @@
package com.dianliang.module.custom.controller.admin; package cn.iocoder.yudao.module.custom.controller.admin;
import cn.iocoder.yudao.module.custom.entity.DlCompany;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dianliang.module.custom.vo.CompanyReqVO; import cn.iocoder.yudao.module.custom.vo.CompanyReqVO;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation; 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.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; 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.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import cn.iocoder.yudao.module.custom.service.DlCompanyService;
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)表控制层 * 企业信息表每个租户的下属企业信息;(dl_company)表控制层

View File

@ -1,4 +1,4 @@
package com.dianliang.module.custom.entity; package cn.iocoder.yudao.module.custom.entity;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;

View File

@ -1,16 +1,14 @@
package com.dianliang.module.custom.mapper; package cn.iocoder.yudao.module.custom.mapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import cn.iocoder.yudao.module.custom.entity.DlCompany;
import cn.iocoder.yudao.module.custom.vo.CompanyReqVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 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.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.dianliang.module.custom.entity.DlCompany;
/** /**
* 企业信息表每个租户的下属企业信息;(dl_company)表数据库访问层 * 企业信息表每个租户的下属企业信息;(dl_company)表数据库访问层
* @author : http://www.chiner.pro * @author : http://www.chiner.pro
* @date : 2024-7-31 * @date : 2024-7-31

View File

@ -1,14 +1,10 @@
package com.dianliang.module.custom.service; package cn.iocoder.yudao.module.custom.service;
import cn.iocoder.yudao.module.custom.entity.DlCompany;
import cn.iocoder.yudao.module.custom.vo.CompanyReqVO;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; 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)表服务接口 * 企业信息表每个租户的下属企业信息;(dl_company)表服务接口

View File

@ -1,18 +1,14 @@
package com.dianliang.module.custom.service.impl; package cn.iocoder.yudao.module.custom.service.impl;
import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.module.custom.entity.DlCompany;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dianliang.module.custom.vo.CompanyReqVO; import cn.iocoder.yudao.module.custom.vo.CompanyReqVO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import cn.iocoder.yudao.module.custom.mapper.DlCompanyMapper;
import com.baomidou.mybatisplus.extension.conditions.update.LambdaUpdateChainWrapper; import cn.iocoder.yudao.module.custom.service.DlCompanyService;
import com.dianliang.module.custom.entity.DlCompany;
import com.dianliang.module.custom.mapper.DlCompanyMapper;
import com.dianliang.module.custom.service.DlCompanyService;
/** /**
* 企业信息表每个租户的下属企业信息;(dl_company)表服务实现类 * 企业信息表每个租户的下属企业信息;(dl_company)表服务实现类
* @author : http://www.chiner.pro * @author : http://www.chiner.pro

View File

@ -1,6 +1,6 @@
package com.dianliang.module.custom.vo; package cn.iocoder.yudao.module.custom.vo;
import com.dianliang.module.custom.entity.DlCompany; import cn.iocoder.yudao.module.custom.entity.DlCompany;
import lombok.Data; import lombok.Data;
/** /**
* 企业查询vo * 企业查询vo

View File

@ -1,4 +0,0 @@
package com.dianliang.job;
public class TestJob {
}

View File

@ -1,4 +0,0 @@
package com.dianliang.module.custom.vo;
public class TestVO {
}

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-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"> <!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"> <mapper namespace="cn.iocoder.yudao.module.custom.mapper.DlCompanyMapper">
<select id="selectListPage" resultType="com.dianliang.module.custom.entity.DlCompany"> <select id="selectListPage" resultType="cn.iocoder.yudao.module.custom.entity.DlCompany">
select * from base_company select * from base_company
</select> </select>
</mapper> </mapper>

63
pom.xml
View File

@ -10,8 +10,6 @@
<modules> <modules>
<module>yudao-dependencies</module> <module>yudao-dependencies</module>
<module>yudao-framework</module> <module>yudao-framework</module>
<!-- Server 主项目 -->
<module>yudao-server</module>
<!-- 各种 module 拓展 --> <!-- 各种 module 拓展 -->
<module>yudao-module-system</module> <module>yudao-module-system</module>
<module>yudao-module-infra</module> <module>yudao-module-infra</module>
@ -24,6 +22,8 @@
<module>yudao-module-crm</module> <module>yudao-module-crm</module>
<module>yudao-module-erp</module> <module>yudao-module-erp</module>
<module>dl-module-base</module> <module>dl-module-base</module>
<!-- Server 主项目 -->
<module>yudao-server</module>
<!-- <module>yudao-module-ai</module>--> <!-- <module>yudao-module-ai</module>-->
</modules> </modules>
@ -68,6 +68,9 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version> <version>${maven-surefire-plugin.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin> </plugin>
<!-- maven-compiler-plugin 插件,解决 spring-boot-configuration-processor + Lombok + MapStruct 组合 --> <!-- maven-compiler-plugin 插件,解决 spring-boot-configuration-processor + Lombok + MapStruct 组合 -->
<!-- https://stackoverflow.com/questions/33483697/re-run-spring-boot-configuration-annotation-processor-to-update-generated-metada --> <!-- https://stackoverflow.com/questions/33483697/re-run-spring-boot-configuration-annotation-processor-to-update-generated-metada -->
@ -133,34 +136,34 @@
</build> </build>
<!-- 使用 huawei / aliyun 的 Maven 源,提升下载速度 --> <!-- 使用 huawei / aliyun 的 Maven 源,提升下载速度 -->
<repositories> <!-- <repositories>-->
<repository> <!-- <repository>-->
<id>huaweicloud</id> <!-- <id>huaweicloud</id>-->
<name>huawei</name> <!-- <name>huawei</name>-->
<url>https://mirrors.huaweicloud.com/repository/maven/</url> <!-- <url>https://mirrors.huaweicloud.com/repository/maven/</url>-->
</repository> <!-- </repository>-->
<repository> <!-- <repository>-->
<id>aliyunmaven</id> <!-- <id>aliyunmaven</id>-->
<name>aliyun</name> <!-- <name>aliyun</name>-->
<url>https://maven.aliyun.com/repository/public</url> <!-- <url>https://maven.aliyun.com/repository/public</url>-->
</repository> <!-- </repository>-->
<repository> <!-- <repository>-->
<id>spring-milestones</id> <!-- <id>spring-milestones</id>-->
<name>Spring Milestones</name> <!-- <name>Spring Milestones</name>-->
<url>https://repo.spring.io/milestone</url> <!-- <url>https://repo.spring.io/milestone</url>-->
<snapshots> <!-- <snapshots>-->
<enabled>false</enabled> <!-- <enabled>false</enabled>-->
</snapshots> <!-- </snapshots>-->
</repository> <!-- </repository>-->
<repository> <!-- <repository>-->
<id>spring-snapshots</id> <!-- <id>spring-snapshots</id>-->
<name>Spring Snapshots</name> <!-- <name>Spring Snapshots</name>-->
<url>https://repo.spring.io/snapshot</url> <!-- <url>https://repo.spring.io/snapshot</url>-->
<releases> <!-- <releases>-->
<enabled>false</enabled> <!-- <enabled>false</enabled>-->
</releases> <!-- </releases>-->
</repository> <!-- </repository>-->
</repositories> <!-- </repositories>-->
</project> </project>

View File

@ -13,7 +13,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @author 芋道源码 * @author 芋道源码
*/ */
@SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package} @SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package}
@SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}.server", "${yudao.info.base-package}.module","com.dianliang.module"}) @SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}.server", "${yudao.info.base-package}.module"})
public class YudaoServerApplication { public class YudaoServerApplication {
public static void main(String[] args) { public static void main(String[] args) {

View File

@ -175,6 +175,7 @@ logging:
cn.iocoder.yudao.module.crm.dal.mysql: debug cn.iocoder.yudao.module.crm.dal.mysql: debug
cn.iocoder.yudao.module.erp.dal.mysql: debug cn.iocoder.yudao.module.erp.dal.mysql: debug
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿先禁用Spring Boot 3.X 存在部分错误的 WARN 提示 org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿先禁用Spring Boot 3.X 存在部分错误的 WARN 提示
cn.iocoder.yudao.module.custom.mapper.DlCompanyMapper: debug #
debug: false debug: false

View File

@ -67,6 +67,7 @@ flowable:
mybatis-plus: mybatis-plus:
configuration: configuration:
map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。 map-underscore-to-camel-case: true # 虽然默认为 true ,但是还是显示去指定下。
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config: global-config:
db-config: db-config:
id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。 id-type: NONE # “智能”模式,基于 IdTypeEnvironmentPostProcessor + 数据源的类型,自动适配成 AUTO、INPUT 模式。
@ -78,8 +79,8 @@ mybatis-plus:
banner: false # 关闭控制台的 Banner 打印 banner: false # 关闭控制台的 Banner 打印
type-aliases-package: type-aliases-package:
- ${yudao.info.base-package}.module.*.dal.dataobject - ${yudao.info.base-package}.module.*.dal.dataobject
- com.dianliang.module.*.entity - ${yudao.info.base-package}.module.*.entity
mapper-locations: classpath:/mapper/*.xml mapper-locations: classpath:/mapper/*/*.xml
encryptor: encryptor:
password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成 password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成