feat(新增运营平台和业务平台登录,新增对应企业展示)
parent
1612ffd84b
commit
0a698e18a4
|
@ -6,7 +6,7 @@ server:
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: muyu-auth
|
name: ruoyi-auth
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.34.243.166:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.34.243.166:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -9,15 +9,15 @@ public class ServiceNameConstants {
|
||||||
/**
|
/**
|
||||||
* 认证服务的serviceid
|
* 认证服务的serviceid
|
||||||
*/
|
*/
|
||||||
public static final String AUTH_SERVICE = "muyu-auth";
|
public static final String AUTH_SERVICE = "ruoyi-auth";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统模块的serviceid
|
* 系统模块的serviceid
|
||||||
*/
|
*/
|
||||||
public static final String SYSTEM_SERVICE = "muyu-system";
|
public static final String SYSTEM_SERVICE = "ruoyi-system";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件服务的serviceid
|
* 文件服务的serviceid
|
||||||
*/
|
*/
|
||||||
public static final String FILE_SERVICE = "muyu-file";
|
public static final String FILE_SERVICE = "ruoyi-file";
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ server:
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: muyu-gateway
|
name: ruoyi-gateway
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.34.243.166:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.34.243.166:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
@ -33,7 +33,7 @@ spring:
|
||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.34.243.166:8848
|
||||||
dataId: sentinel-muyu-gateway
|
dataId: sentinel-muyu-gateway
|
||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
data-type: json
|
data-type: json
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
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">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-company</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>muyu-company-common</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<!-- 系统公共核心包 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,97 @@
|
||||||
|
package com.muyu.company.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.company.domain.vo.CompanyVo;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* company对象 company
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-05-26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class Company extends BaseEntity
|
||||||
|
{
|
||||||
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 企业名称 */
|
||||||
|
@Excel(name = "企业名称")
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
/** 法定代表人 */
|
||||||
|
@Excel(name = "法定代表人")
|
||||||
|
private String legalRepresentative;
|
||||||
|
|
||||||
|
/** 企业成立时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "企业成立时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date companyTime;
|
||||||
|
|
||||||
|
/** 业务范围 */
|
||||||
|
@Excel(name = "业务范围")
|
||||||
|
private String sphereOfBusiness;
|
||||||
|
|
||||||
|
/** 注册地址 */
|
||||||
|
@Excel(name = "注册地址")
|
||||||
|
private String registeredAddress;
|
||||||
|
|
||||||
|
/** 企业联系电话 */
|
||||||
|
@Excel(name = "企业联系电话")
|
||||||
|
private String companyPhone;
|
||||||
|
|
||||||
|
/** 公司邮箱 */
|
||||||
|
@Excel(name = "公司邮箱")
|
||||||
|
private String companyMailbox;
|
||||||
|
|
||||||
|
/** 公司营业执照 */
|
||||||
|
@Excel(name = "公司营业执照")
|
||||||
|
private String businessLicense;
|
||||||
|
|
||||||
|
/** 税务登记证 */
|
||||||
|
@Excel(name = "税务登记证")
|
||||||
|
private String taxRegistrationCertificate;
|
||||||
|
|
||||||
|
/** 企业状态 */
|
||||||
|
@Excel(name = "企业状态")
|
||||||
|
private String companyStatus;
|
||||||
|
|
||||||
|
/** 企业入驻时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "企业入驻时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date enterTime;
|
||||||
|
|
||||||
|
/** 是否认证 */
|
||||||
|
@Excel(name = "是否认证")
|
||||||
|
private String isAuthentication;
|
||||||
|
|
||||||
|
/** 认证时间 */
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||||
|
@Excel(name = "认证时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||||
|
private Date authenticationTime;
|
||||||
|
|
||||||
|
/** 服务等级 */
|
||||||
|
@Excel(name = "服务等级")
|
||||||
|
private Long serviceLevel;
|
||||||
|
}
|
|
@ -0,0 +1,30 @@
|
||||||
|
package com.muyu.company.domain.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* company对象 company
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-05-26
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class CompanyVo
|
||||||
|
{
|
||||||
|
private String deptName;
|
||||||
|
private String roleKey;
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
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">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-company</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>muyu-company-remove</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,97 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
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">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-company</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>muyu-company-server</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Nacos Config -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Sentinel -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringBoot Actuator -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Swagger UI -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
|
<version>${swagger.fox.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Mysql Connector -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataSource -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-datasource</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataScope -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-datascope</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Log -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-log</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Swagger -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-swagger</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>druid</artifactId>
|
||||||
|
<version>1.2.20</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-company-common</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.muyu.company;
|
||||||
|
|
||||||
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
|
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业模块
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
*/
|
||||||
|
@EnableCustomConfig
|
||||||
|
@EnableMyFeignClients
|
||||||
|
@SpringBootApplication
|
||||||
|
public class MuYuCompanyApplication {
|
||||||
|
public static void main (String[] args) {
|
||||||
|
SpringApplication.run(MuYuCompanyApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,86 @@
|
||||||
|
package com.muyu.company.controller;
|
||||||
|
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
import com.muyu.common.log.annotation.Log;
|
||||||
|
import com.muyu.common.log.enums.BusinessType;
|
||||||
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.muyu.company.domain.Company;
|
||||||
|
import com.muyu.company.domain.vo.CompanyVo;
|
||||||
|
import com.muyu.company.service.ICompanyService;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* companyController
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-05-26
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/company")
|
||||||
|
public class CompanyController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private ICompanyService companyService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询company列表
|
||||||
|
*/
|
||||||
|
@ApiOperation("获取企业列表")
|
||||||
|
@RequiresPermissions("company:company:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public Result<TableDataInfo<Company>> list(CompanyVo company){
|
||||||
|
startPage();
|
||||||
|
System.out.println(company);
|
||||||
|
List<Company> list = companyService.selectCompanyList(company);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取company详细信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("company:company:query")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public Result getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(companyService.selectCompanyById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增company
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("company:company:add")
|
||||||
|
@Log(title = "company", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public Result add(@RequestBody Company company)
|
||||||
|
{
|
||||||
|
return toAjax(companyService.insertCompany(company));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改company
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("company:company:edit")
|
||||||
|
@Log(title = "company", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public Result edit(@RequestBody Company company)
|
||||||
|
{
|
||||||
|
return toAjax(companyService.updateCompany(company));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除company
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("company:company:remove")
|
||||||
|
@Log(title = "company", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public Result remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(companyService.deleteCompanyByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.muyu.company.mapper;
|
||||||
|
|
||||||
|
import com.muyu.company.domain.Company;
|
||||||
|
import com.muyu.company.domain.vo.CompanyVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* companyMapper接口
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-05-26
|
||||||
|
*/
|
||||||
|
public interface CompanyMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询company
|
||||||
|
*
|
||||||
|
* @param id company主键
|
||||||
|
* @return company
|
||||||
|
*/
|
||||||
|
public Company selectCompanyById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询company列表
|
||||||
|
*
|
||||||
|
* @param company company
|
||||||
|
* @return company集合
|
||||||
|
*/
|
||||||
|
public List<Company> selectCompanyList(CompanyVo company);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增company
|
||||||
|
*
|
||||||
|
* @param company company
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertCompany(Company company);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改company
|
||||||
|
*
|
||||||
|
* @param company company
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateCompany(Company company);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除company
|
||||||
|
*
|
||||||
|
* @param id company主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteCompanyById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除company
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteCompanyByIds(Long[] ids);
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
package com.muyu.company.service;
|
||||||
|
|
||||||
|
import com.muyu.company.domain.Company;
|
||||||
|
import com.muyu.company.domain.vo.CompanyVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* companyService接口
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-05-26
|
||||||
|
*/
|
||||||
|
public interface ICompanyService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询company
|
||||||
|
*
|
||||||
|
* @param id company主键
|
||||||
|
* @return company
|
||||||
|
*/
|
||||||
|
public Company selectCompanyById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询company列表
|
||||||
|
*
|
||||||
|
* @param company company
|
||||||
|
* @return company集合
|
||||||
|
*/
|
||||||
|
public List<Company> selectCompanyList(CompanyVo company);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增company
|
||||||
|
*
|
||||||
|
* @param company company
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertCompany(Company company);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改company
|
||||||
|
*
|
||||||
|
* @param company company
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateCompany(Company company);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除company
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的company主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteCompanyByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除company信息
|
||||||
|
*
|
||||||
|
* @param id company主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteCompanyById(Long id);
|
||||||
|
}
|
|
@ -0,0 +1,98 @@
|
||||||
|
package com.muyu.company.service.impl;
|
||||||
|
|
||||||
|
import com.muyu.common.core.utils.DateUtils;
|
||||||
|
import com.muyu.company.domain.Company;
|
||||||
|
import com.muyu.company.domain.vo.CompanyVo;
|
||||||
|
import com.muyu.company.mapper.CompanyMapper;
|
||||||
|
import com.muyu.company.service.ICompanyService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* companyService业务层处理
|
||||||
|
*
|
||||||
|
* @author wan
|
||||||
|
* @date 2024-05-26
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class CompanyServiceImpl implements ICompanyService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private CompanyMapper companyMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询company
|
||||||
|
*
|
||||||
|
* @param id company主键
|
||||||
|
* @return company
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Company selectCompanyById(Long id)
|
||||||
|
{
|
||||||
|
return companyMapper.selectCompanyById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询company列表
|
||||||
|
*
|
||||||
|
* @param company company
|
||||||
|
* @return company
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<Company> selectCompanyList(CompanyVo company)
|
||||||
|
{
|
||||||
|
return companyMapper.selectCompanyList(company);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增company
|
||||||
|
*
|
||||||
|
* @param company company
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertCompany(Company company)
|
||||||
|
{
|
||||||
|
return companyMapper.insertCompany(company);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改company
|
||||||
|
*
|
||||||
|
* @param company company
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateCompany(Company company)
|
||||||
|
{
|
||||||
|
company.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return companyMapper.updateCompany(company);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除company
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的company主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteCompanyByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return companyMapper.deleteCompanyByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除company信息
|
||||||
|
*
|
||||||
|
* @param id company主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteCompanyById(Long id)
|
||||||
|
{
|
||||||
|
return companyMapper.deleteCompanyById(id);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
{ "properties": [ ] }
|
|
@ -0,0 +1,2 @@
|
||||||
|
Spring Boot Version: ${spring-boot.version}
|
||||||
|
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,25 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 9400
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: ruoyi-company
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: dev
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 101.34.243.166:8848
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 101.34.243.166:8848
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
|
@ -0,0 +1,74 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="logs/muyu-company-server"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统日志输出 -->
|
||||||
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/info.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.muyu" level="info"/>
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn"/>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info"/>
|
||||||
|
<appender-ref ref="file_error"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
|
@ -0,0 +1,115 @@
|
||||||
|
<?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.muyu.company.mapper.CompanyMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.muyu.company.domain.Company" id="CompanyResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="companyName" column="company_name" />
|
||||||
|
<result property="legalRepresentative" column="legal_representative" />
|
||||||
|
<result property="companyTime" column="company_time" />
|
||||||
|
<result property="sphereOfBusiness" column="sphere_of_business" />
|
||||||
|
<result property="registeredAddress" column="registered_address" />
|
||||||
|
<result property="companyPhone" column="company_phone" />
|
||||||
|
<result property="companyMailbox" column="company_mailbox" />
|
||||||
|
<result property="businessLicense" column="business_license" />
|
||||||
|
<result property="taxRegistrationCertificate" column="tax_registration_certificate" />
|
||||||
|
<result property="companyStatus" column="company_status" />
|
||||||
|
<result property="enterTime" column="enter_time" />
|
||||||
|
<result property="isAuthentication" column="is_authentication" />
|
||||||
|
<result property="authenticationTime" column="authentication_time" />
|
||||||
|
<result property="serviceLevel" column="service_level" />
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectCompanyVo">
|
||||||
|
select id, company_name, legal_representative, company_time, sphere_of_business, registered_address, company_phone, company_mailbox, business_license, tax_registration_certificate, company_status, enter_time, is_authentication, authentication_time, service_level, remark, create_by, create_time, update_by, update_time from company
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectCompanyList" parameterType="com.muyu.company.domain.Company" resultMap="CompanyResult">
|
||||||
|
<include refid="selectCompanyVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="roleKey != null and roleKey != '' and roleKey == 'common' || roleKey == 'employee'">
|
||||||
|
and company_name = #{deptName}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectCompanyById" parameterType="Long" resultMap="CompanyResult">
|
||||||
|
<include refid="selectCompanyVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertCompany" parameterType="com.muyu.company.domain.Company" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into company
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="companyName != null">company_name,</if>
|
||||||
|
<if test="legalRepresentative != null">legal_representative,</if>
|
||||||
|
<if test="companyTime != null">company_time,</if>
|
||||||
|
<if test="sphereOfBusiness != null">sphere_of_business,</if>
|
||||||
|
<if test="registeredAddress != null">registered_address,</if>
|
||||||
|
<if test="companyPhone != null">company_phone,</if>
|
||||||
|
<if test="companyMailbox != null">company_mailbox,</if>
|
||||||
|
<if test="businessLicense != null">business_license,</if>
|
||||||
|
<if test="taxRegistrationCertificate != null">tax_registration_certificate,</if>
|
||||||
|
<if test="companyStatus != null">company_status,</if>
|
||||||
|
<if test="enterTime != null">enter_time,</if>
|
||||||
|
<if test="isAuthentication != null">is_authentication,</if>
|
||||||
|
<if test="authenticationTime != null">authentication_time,</if>
|
||||||
|
<if test="serviceLevel != null">service_level,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="companyName != null">#{companyName},</if>
|
||||||
|
<if test="legalRepresentative != null">#{legalRepresentative},</if>
|
||||||
|
<if test="companyTime != null">#{companyTime},</if>
|
||||||
|
<if test="sphereOfBusiness != null">#{sphereOfBusiness},</if>
|
||||||
|
<if test="registeredAddress != null">#{registeredAddress},</if>
|
||||||
|
<if test="companyPhone != null">#{companyPhone},</if>
|
||||||
|
<if test="companyMailbox != null">#{companyMailbox},</if>
|
||||||
|
<if test="businessLicense != null">#{businessLicense},</if>
|
||||||
|
<if test="taxRegistrationCertificate != null">#{taxRegistrationCertificate},</if>
|
||||||
|
<if test="companyStatus != null">#{companyStatus},</if>
|
||||||
|
<if test="enterTime != null">#{enterTime},</if>
|
||||||
|
<if test="isAuthentication != null">#{isAuthentication},</if>
|
||||||
|
<if test="authenticationTime != null">#{authenticationTime},</if>
|
||||||
|
<if test="serviceLevel != null">#{serviceLevel},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateCompany" parameterType="com.muyu.company.domain.Company">
|
||||||
|
update company
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="companyName != null">company_name = #{companyName},</if>
|
||||||
|
<if test="legalRepresentative != null">legal_representative = #{legalRepresentative},</if>
|
||||||
|
<if test="companyTime != null">company_time = #{companyTime},</if>
|
||||||
|
<if test="sphereOfBusiness != null">sphere_of_business = #{sphereOfBusiness},</if>
|
||||||
|
<if test="registeredAddress != null">registered_address = #{registeredAddress},</if>
|
||||||
|
<if test="companyPhone != null">company_phone = #{companyPhone},</if>
|
||||||
|
<if test="companyMailbox != null">company_mailbox = #{companyMailbox},</if>
|
||||||
|
<if test="businessLicense != null">business_license = #{businessLicense},</if>
|
||||||
|
<if test="taxRegistrationCertificate != null">tax_registration_certificate = #{taxRegistrationCertificate},</if>
|
||||||
|
<if test="companyStatus != null">company_status = #{companyStatus},</if>
|
||||||
|
<if test="enterTime != null">enter_time = #{enterTime},</if>
|
||||||
|
<if test="isAuthentication != null">is_authentication = #{isAuthentication},</if>
|
||||||
|
<if test="authenticationTime != null">authentication_time = #{authenticationTime},</if>
|
||||||
|
<if test="serviceLevel != null">service_level = #{serviceLevel},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteCompanyById" parameterType="Long">
|
||||||
|
delete from company where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteCompanyByIds" parameterType="String">
|
||||||
|
delete from company where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
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">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-modules</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>muyu-company</artifactId>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>muyu-company-common</module>
|
||||||
|
<module>muyu-company-remove</module>
|
||||||
|
<module>muyu-company-server</module>
|
||||||
|
</modules>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
<maven.compiler.target>17</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
</project>
|
|
@ -6,7 +6,7 @@ server:
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: muyu-file
|
name: ruoyi-file
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.34.243.166:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.34.243.166:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -6,7 +6,7 @@ server:
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: muyu-gen
|
name: ruoyi-gen
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.34.243.166:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.34.243.166:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -6,7 +6,7 @@ server:
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: muyu-job
|
name: ruoyi-job
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.34.243.166:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.34.243.166:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -81,14 +81,25 @@ public class SysDeptController extends BaseController {
|
||||||
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
@Log(title = "部门管理", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public Result edit (@Validated @RequestBody SysDept dept) {
|
public Result edit (@Validated @RequestBody SysDept dept) {
|
||||||
Long deptId = dept.getDeptId();
|
|
||||||
deptService.checkDeptDataScope(deptId);
|
if (dept.getParentId()==null) {
|
||||||
if (!deptService.checkDeptNameUnique(dept)) {
|
Long deptId = dept.getDeptId();
|
||||||
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
deptService.checkDeptDataScope(deptId);
|
||||||
} else if (dept.getParentId().equals(deptId)) {
|
if (!deptService.checkDeptNameUnique(dept)) {
|
||||||
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
} else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) {
|
}else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) {
|
||||||
return error("该部门包含未停用的子部门!");
|
return error("该部门包含未停用的子部门!");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
Long deptId = dept.getDeptId();
|
||||||
|
deptService.checkDeptDataScope(deptId);
|
||||||
|
if (!deptService.checkDeptNameUnique(dept)) {
|
||||||
|
return error("修改部门'" + dept.getDeptName() + "'失败,部门名称已存在");
|
||||||
|
} else if (dept.getParentId().equals(deptId)) {
|
||||||
|
return error("修改部门'" + dept.getDeptName() + "'失败,上级部门不能是自己");
|
||||||
|
} else if (StringUtils.equals(UserConstants.DEPT_DISABLE, dept.getStatus()) && deptService.selectNormalChildrenDeptById(deptId) > 0) {
|
||||||
|
return error("该部门包含未停用的子部门!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
dept.setUpdateBy(SecurityUtils.getUsername());
|
dept.setUpdateBy(SecurityUtils.getUsername());
|
||||||
return toAjax(deptService.updateDept(dept));
|
return toAjax(deptService.updateDept(dept));
|
||||||
|
|
|
@ -205,13 +205,35 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertDept (SysDept dept) {
|
public int insertDept (SysDept dept) {
|
||||||
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
Long id = null;
|
||||||
// 如果父节点不为正常状态,则不允许新增子节点
|
if (dept.getParentId()==null) {
|
||||||
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) {
|
id =0L;
|
||||||
throw new ServiceException("部门停用,不允许新增");
|
|
||||||
|
return deptMapper.insertDept(
|
||||||
|
SysDept.builder()
|
||||||
|
.deptId(null)
|
||||||
|
.parentId(id)
|
||||||
|
.ancestors(String.valueOf(id))
|
||||||
|
.deptName(dept.getDeptName())
|
||||||
|
.orderNum(dept.getOrderNum())
|
||||||
|
.leader(dept.getLeader())
|
||||||
|
.phone(dept.getPhone())
|
||||||
|
.email(dept.getEmail())
|
||||||
|
.status(dept.getStatus())
|
||||||
|
.delFlag(dept.getDelFlag())
|
||||||
|
.parentName(dept.getParentName())
|
||||||
|
.createBy(dept.getCreateBy())
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
}else {
|
||||||
|
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
||||||
|
// 如果父节点不为正常状态,则不允许新增子节点
|
||||||
|
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus())) {
|
||||||
|
throw new ServiceException("部门停用,不允许新增");
|
||||||
|
}
|
||||||
|
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
||||||
|
return deptMapper.insertDept(dept);
|
||||||
}
|
}
|
||||||
dept.setAncestors(info.getAncestors() + "," + dept.getParentId());
|
|
||||||
return deptMapper.insertDept(dept);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -223,21 +245,45 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int updateDept (SysDept dept) {
|
public int updateDept (SysDept dept) {
|
||||||
SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId());
|
Long id = null;
|
||||||
SysDept oldDept = deptMapper.selectDeptById(dept.getDeptId());
|
if (dept.getParentId() == null) {
|
||||||
if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) {
|
id =0L;
|
||||||
String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId();
|
dept.setUpdateBy(SecurityUtils.getUsername());
|
||||||
String oldAncestors = oldDept.getAncestors();
|
|
||||||
dept.setAncestors(newAncestors);
|
int result = deptMapper.updateDept(
|
||||||
updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors);
|
SysDept.builder()
|
||||||
|
.deptId(dept.getDeptId())
|
||||||
|
.parentId(id)
|
||||||
|
.ancestors(String.valueOf(id))
|
||||||
|
.deptName(dept.getDeptName())
|
||||||
|
.orderNum(dept.getOrderNum())
|
||||||
|
.leader(dept.getLeader())
|
||||||
|
.phone(dept.getPhone())
|
||||||
|
.email(dept.getEmail())
|
||||||
|
.status(dept.getStatus())
|
||||||
|
.delFlag(dept.getDelFlag())
|
||||||
|
.parentName(dept.getParentName())
|
||||||
|
.updateBy(dept.getUpdateBy())
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
return result;
|
||||||
|
}else {
|
||||||
|
SysDept newParentDept = deptMapper.selectDeptById(dept.getParentId());
|
||||||
|
SysDept oldDept = deptMapper.selectDeptById(dept.getDeptId());
|
||||||
|
if (StringUtils.isNotNull(newParentDept) && StringUtils.isNotNull(oldDept)) {
|
||||||
|
String newAncestors = newParentDept.getAncestors() + "," + newParentDept.getDeptId();
|
||||||
|
String oldAncestors = oldDept.getAncestors();
|
||||||
|
dept.setAncestors(newAncestors);
|
||||||
|
updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors);
|
||||||
|
}
|
||||||
|
int result = deptMapper.updateDept(dept);
|
||||||
|
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors())
|
||||||
|
&& !StringUtils.equals("0", dept.getAncestors())) {
|
||||||
|
// 如果该部门是启用状态,则启用该部门的所有上级部门
|
||||||
|
updateParentDeptStatusNormal(dept);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
int result = deptMapper.updateDept(dept);
|
|
||||||
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors())
|
|
||||||
&& !StringUtils.equals("0", dept.getAncestors())) {
|
|
||||||
// 如果该部门是启用状态,则启用该部门的所有上级部门
|
|
||||||
updateParentDeptStatusNormal(dept);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -6,7 +6,7 @@ server:
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: muyu-system
|
name: ruoyi-system
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.34.243.166:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.34.243.166:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -112,7 +112,7 @@
|
||||||
<insert id="insertDept" parameterType="com.muyu.common.system.domain.SysDept">
|
<insert id="insertDept" parameterType="com.muyu.common.system.domain.SysDept">
|
||||||
insert into sys_dept(
|
insert into sys_dept(
|
||||||
<if test="deptId != null and deptId != 0">dept_id,</if>
|
<if test="deptId != null and deptId != 0">dept_id,</if>
|
||||||
<if test="parentId != null and parentId != 0">parent_id,</if>
|
<if test="parentId != null">parent_id,</if>
|
||||||
<if test="deptName != null and deptName != ''">dept_name,</if>
|
<if test="deptName != null and deptName != ''">dept_name,</if>
|
||||||
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
<if test="ancestors != null and ancestors != ''">ancestors,</if>
|
||||||
<if test="orderNum != null">order_num,</if>
|
<if test="orderNum != null">order_num,</if>
|
||||||
|
@ -124,7 +124,7 @@
|
||||||
create_time
|
create_time
|
||||||
)values(
|
)values(
|
||||||
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
<if test="deptId != null and deptId != 0">#{deptId},</if>
|
||||||
<if test="parentId != null and parentId != 0">#{parentId},</if>
|
<if test="parentId != null">#{parentId},</if>
|
||||||
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
<if test="deptName != null and deptName != ''">#{deptName},</if>
|
||||||
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
|
||||||
<if test="orderNum != null">#{orderNum},</if>
|
<if test="orderNum != null">#{orderNum},</if>
|
||||||
|
@ -140,7 +140,7 @@
|
||||||
<update id="updateDept" parameterType="com.muyu.common.system.domain.SysDept">
|
<update id="updateDept" parameterType="com.muyu.common.system.domain.SysDept">
|
||||||
update sys_dept
|
update sys_dept
|
||||||
<set>
|
<set>
|
||||||
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||||
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
|
||||||
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
|
||||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
<module>muyu-gen</module>
|
<module>muyu-gen</module>
|
||||||
<module>muyu-job</module>
|
<module>muyu-job</module>
|
||||||
<module>muyu-file</module>
|
<module>muyu-file</module>
|
||||||
|
<module>muyu-company</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<artifactId>muyu-modules</artifactId>
|
<artifactId>muyu-modules</artifactId>
|
||||||
|
|
|
@ -6,7 +6,7 @@ server:
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: muyu-monitor
|
name: ruoyi-monitor
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.34.243.166:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 101.34.243.166:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -0,0 +1,128 @@
|
||||||
|
<?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.muyu.company.mapper.CompanyMapper">
|
||||||
|
|
||||||
|
<resultMap type="Company" id="CompanyResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="companyName" column="company_name" />
|
||||||
|
<result property="legalRepresentative" column="legal_representative" />
|
||||||
|
<result property="companyTime" column="company_time" />
|
||||||
|
<result property="sphereOfBusiness" column="sphere_of_business" />
|
||||||
|
<result property="registeredAddress" column="registered_address" />
|
||||||
|
<result property="companyPhone" column="company_phone" />
|
||||||
|
<result property="companyMailbox" column="company_mailbox" />
|
||||||
|
<result property="businessLicense" column="business_license" />
|
||||||
|
<result property="taxRegistrationCertificate" column="tax_registration_certificate" />
|
||||||
|
<result property="companyStatus" column="company_status" />
|
||||||
|
<result property="enterTime" column="enter_time" />
|
||||||
|
<result property="isAuthentication" column="is_authentication" />
|
||||||
|
<result property="authenticationTime" column="authentication_time" />
|
||||||
|
<result property="serviceLevel" column="service_level" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="foundName" column="found_name" />
|
||||||
|
<result property="foundTime" column="found_time" />
|
||||||
|
<result property="updateName" column="update_name" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectCompanyVo">
|
||||||
|
select id, company_name, legal_representative, company_time, sphere_of_business, registered_address, company_phone, company_mailbox, business_license, tax_registration_certificate, company_status, enter_time, is_authentication, authentication_time, service_level, remark, found_name, found_time, update_name, update_time from company
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectCompanyList" parameterType="Company" resultMap="CompanyResult">
|
||||||
|
<include refid="selectCompanyVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="companyName != null and companyName != ''"> and company_name like concat('%', #{companyName}, '%')</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectCompanyById" parameterType="Long" resultMap="CompanyResult">
|
||||||
|
<include refid="selectCompanyVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertCompany" parameterType="Company" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into company
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="companyName != null">company_name,</if>
|
||||||
|
<if test="legalRepresentative != null">legal_representative,</if>
|
||||||
|
<if test="companyTime != null">company_time,</if>
|
||||||
|
<if test="sphereOfBusiness != null">sphere_of_business,</if>
|
||||||
|
<if test="registeredAddress != null">registered_address,</if>
|
||||||
|
<if test="companyPhone != null">company_phone,</if>
|
||||||
|
<if test="companyMailbox != null">company_mailbox,</if>
|
||||||
|
<if test="businessLicense != null">business_license,</if>
|
||||||
|
<if test="taxRegistrationCertificate != null">tax_registration_certificate,</if>
|
||||||
|
<if test="companyStatus != null">company_status,</if>
|
||||||
|
<if test="enterTime != null">enter_time,</if>
|
||||||
|
<if test="isAuthentication != null">is_authentication,</if>
|
||||||
|
<if test="authenticationTime != null">authentication_time,</if>
|
||||||
|
<if test="serviceLevel != null">service_level,</if>
|
||||||
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="foundName != null">found_name,</if>
|
||||||
|
<if test="foundTime != null">found_time,</if>
|
||||||
|
<if test="updateName != null">update_name,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="companyName != null">#{companyName},</if>
|
||||||
|
<if test="legalRepresentative != null">#{legalRepresentative},</if>
|
||||||
|
<if test="companyTime != null">#{companyTime},</if>
|
||||||
|
<if test="sphereOfBusiness != null">#{sphereOfBusiness},</if>
|
||||||
|
<if test="registeredAddress != null">#{registeredAddress},</if>
|
||||||
|
<if test="companyPhone != null">#{companyPhone},</if>
|
||||||
|
<if test="companyMailbox != null">#{companyMailbox},</if>
|
||||||
|
<if test="businessLicense != null">#{businessLicense},</if>
|
||||||
|
<if test="taxRegistrationCertificate != null">#{taxRegistrationCertificate},</if>
|
||||||
|
<if test="companyStatus != null">#{companyStatus},</if>
|
||||||
|
<if test="enterTime != null">#{enterTime},</if>
|
||||||
|
<if test="isAuthentication != null">#{isAuthentication},</if>
|
||||||
|
<if test="authenticationTime != null">#{authenticationTime},</if>
|
||||||
|
<if test="serviceLevel != null">#{serviceLevel},</if>
|
||||||
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="foundName != null">#{foundName},</if>
|
||||||
|
<if test="foundTime != null">#{foundTime},</if>
|
||||||
|
<if test="updateName != null">#{updateName},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateCompany" parameterType="Company">
|
||||||
|
update company
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="companyName != null">company_name = #{companyName},</if>
|
||||||
|
<if test="legalRepresentative != null">legal_representative = #{legalRepresentative},</if>
|
||||||
|
<if test="companyTime != null">company_time = #{companyTime},</if>
|
||||||
|
<if test="sphereOfBusiness != null">sphere_of_business = #{sphereOfBusiness},</if>
|
||||||
|
<if test="registeredAddress != null">registered_address = #{registeredAddress},</if>
|
||||||
|
<if test="companyPhone != null">company_phone = #{companyPhone},</if>
|
||||||
|
<if test="companyMailbox != null">company_mailbox = #{companyMailbox},</if>
|
||||||
|
<if test="businessLicense != null">business_license = #{businessLicense},</if>
|
||||||
|
<if test="taxRegistrationCertificate != null">tax_registration_certificate = #{taxRegistrationCertificate},</if>
|
||||||
|
<if test="companyStatus != null">company_status = #{companyStatus},</if>
|
||||||
|
<if test="enterTime != null">enter_time = #{enterTime},</if>
|
||||||
|
<if test="isAuthentication != null">is_authentication = #{isAuthentication},</if>
|
||||||
|
<if test="authenticationTime != null">authentication_time = #{authenticationTime},</if>
|
||||||
|
<if test="serviceLevel != null">service_level = #{serviceLevel},</if>
|
||||||
|
<if test="remark != null">remark = #{remark},</if>
|
||||||
|
<if test="foundName != null">found_name = #{foundName},</if>
|
||||||
|
<if test="foundTime != null">found_time = #{foundTime},</if>
|
||||||
|
<if test="updateName != null">update_name = #{updateName},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteCompanyById" parameterType="Long">
|
||||||
|
delete from company where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteCompanyByIds" parameterType="String">
|
||||||
|
delete from company where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
3
pom.xml
3
pom.xml
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
<name>muyu</name>
|
<name>muyu</name>
|
||||||
|
|
||||||
<description>若依微服务系统</description>
|
<description>微服务系统</description>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<muyu.version>3.6.3</muyu.version>
|
<muyu.version>3.6.3</muyu.version>
|
||||||
|
@ -205,7 +205,6 @@
|
||||||
<artifactId>muyu-common-system</artifactId>
|
<artifactId>muyu-common-system</artifactId>
|
||||||
<version>${muyu.version}</version>
|
<version>${muyu.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue