企业信息
parent
e0e0923397
commit
a0ed4ee252
|
@ -61,12 +61,6 @@
|
|||
<artifactId>cloud-common-datascope</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- MuYu Common Log -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>cloud-common-log</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 接口模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
package com.muyu.firmmanage;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.firmmanage
|
||||
* @Project:cloud-server-8
|
||||
* @name:FirmManageApplication
|
||||
* @Date:2024/9/27 21:19
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class FirmManageApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(FirmManageApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -1,5 +1,15 @@
|
|||
package com.muyu.firmmanage.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.firmmanage.domain.req.FirmListReq;
|
||||
import com.muyu.firmmanage.domain.resp.firmlist.FirmTotalListResp;
|
||||
import com.muyu.firmmanage.service.FirmManageService;
|
||||
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.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
@ -12,5 +22,25 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
*/
|
||||
@RestController
|
||||
@RequestMapping("/firmmanage")
|
||||
@Tag(name = "公司相关事务",description = "公司相关事务操作")
|
||||
public class FirmManageController {
|
||||
|
||||
@Autowired
|
||||
private FirmManageService firmManageService;
|
||||
|
||||
|
||||
/**
|
||||
* 公司列表信息展示
|
||||
* @param firmListReq
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/firmmessageList")
|
||||
@Operation(summary = "公司信息列表展示",description = "展示公司信息的列表")
|
||||
public Result firmmessageList(@Validated @RequestBody FirmListReq firmListReq){
|
||||
FirmTotalListResp firmTotalListResp = firmManageService.firmmessageList(firmListReq);
|
||||
return Result.success(firmTotalListResp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,17 @@
|
|||
package com.muyu.firmmanage.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.firmmanage.domain
|
||||
|
@ -12,9 +19,97 @@ import lombok.experimental.SuperBuilder;
|
|||
* @name:Firm
|
||||
* @Date:2024/9/27 12:29
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class Firm {
|
||||
public class Firm extends BaseEntity {
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 用户类型(00系统用户)
|
||||
*/
|
||||
private String userType;
|
||||
|
||||
/**
|
||||
* 用户邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
private String phonenumber;
|
||||
|
||||
/**
|
||||
* 用户性别(0男 1女 2未知)
|
||||
*/
|
||||
private Integer sex;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 帐号状态(0正常 1停用)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
private String loginIp;
|
||||
|
||||
/**
|
||||
* 最后登录时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date loginDate;
|
||||
|
||||
/**
|
||||
* 数据库名称
|
||||
*/
|
||||
private String databaseName;
|
||||
|
||||
/**
|
||||
* 企业ID
|
||||
*/
|
||||
private Long firmId;
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String firmName;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
package com.muyu.firmmanage.domain.req;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.firmmanage.domain.req
|
||||
* @Project:cloud-server-8
|
||||
* @name:FirmListReq
|
||||
* @Date:2024/9/27 19:19
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "公司信息响应对象",description = "公司信息响应对象")
|
||||
public class FirmListReq {
|
||||
|
||||
/**
|
||||
* 公司名称
|
||||
*/
|
||||
private String firmName;
|
||||
/**
|
||||
* 页码,从1开始
|
||||
*/
|
||||
private Integer pageNum=1;
|
||||
/**
|
||||
* 每页大小
|
||||
*/
|
||||
private Integer pageSize=10;
|
||||
|
||||
}
|
|
@ -0,0 +1,135 @@
|
|||
package com.muyu.firmmanage.domain.resp.firmlist;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.firmmanage.domain.Firm;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.firmmanage.domain.resp
|
||||
* @Project:cloud-server-8
|
||||
* @name:FirmListResp
|
||||
* @Date:2024/9/27 19:33
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class FirmListResp {
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 用户账号
|
||||
*/
|
||||
private String userName;
|
||||
|
||||
/**
|
||||
* 用户昵称
|
||||
*/
|
||||
private String nickName;
|
||||
|
||||
/**
|
||||
* 用户类型(00系统用户)
|
||||
*/
|
||||
private String userType;
|
||||
|
||||
/**
|
||||
* 用户邮箱
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
private String phonenumber;
|
||||
|
||||
/**
|
||||
* 用户性别(0男 1女 2未知)
|
||||
*/
|
||||
private Integer sex;
|
||||
|
||||
/**
|
||||
* 头像地址
|
||||
*/
|
||||
private String avatar;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 帐号状态(0正常 1停用)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 最后登录IP
|
||||
*/
|
||||
private String loginIp;
|
||||
|
||||
/**
|
||||
* 最后登录时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date loginDate;
|
||||
|
||||
/**
|
||||
* 数据库名称
|
||||
*/
|
||||
private String databaseName;
|
||||
|
||||
/**
|
||||
* 企业ID
|
||||
*/
|
||||
private Long firmId;
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String firmName;
|
||||
|
||||
/**
|
||||
* 数据库对象构建为返回结果对象
|
||||
*/
|
||||
public static FirmListResp firmListResp(Firm firm){
|
||||
return FirmListResp.builder()
|
||||
.userId(firm.getUserId())
|
||||
.deptId(firm.getDeptId())
|
||||
.userName(firm.getUserName())
|
||||
.nickName(firm.getNickName())
|
||||
.userType((firm.getUserType()))
|
||||
.email(firm.getEmail())
|
||||
.phonenumber(firm.getPhonenumber())
|
||||
.sex(firm.getSex())
|
||||
.avatar(firm.getAvatar())
|
||||
.password(firm.getPassword())
|
||||
.status(firm.getStatus())
|
||||
.delFlag(firm.getDelFlag())
|
||||
.loginDate(firm.getLoginDate())
|
||||
.databaseName(firm.getDatabaseName())
|
||||
.firmId(firm.getFirmId())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.muyu.firmmanage.domain.resp.firmlist;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.firmmanage.domain.resp.firmlist
|
||||
* @Project:cloud-server-8
|
||||
* @name:FirmTotalListResp
|
||||
* @Date:2024/9/27 19:42
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@Tag(name = "公司数据总数列表",description = "数据总数响应")
|
||||
public class FirmTotalListResp {
|
||||
|
||||
private List<FirmListResp> firmListRespList;
|
||||
|
||||
private long total;
|
||||
|
||||
public static FirmTotalListResp firmTotalListResp(List<FirmListResp> firmListRespList,long toal){
|
||||
FirmTotalListResp firmTotalListResp = new FirmTotalListResp();
|
||||
firmTotalListResp.setFirmListRespList(firmListRespList);
|
||||
firmTotalListResp.setTotal(toal);
|
||||
return firmTotalListResp;
|
||||
}
|
||||
}
|
|
@ -1,7 +1,12 @@
|
|||
package com.muyu.firmmanage.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.firmmanage.domain.Firm;
|
||||
import com.muyu.firmmanage.domain.req.FirmListReq;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.firmmanage.mapper
|
||||
|
@ -10,5 +15,7 @@ import org.apache.ibatis.annotations.Mapper;
|
|||
* @Date:2024/9/27 12:28
|
||||
*/
|
||||
@Mapper
|
||||
public interface FirmManageMapper {
|
||||
public interface FirmManageMapper extends BaseMapper<Firm> {
|
||||
|
||||
List<Firm> firmmessageList(FirmListReq firmListReq);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
package com.muyu.firmmanage.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.firmmanage.domain.Firm;
|
||||
import com.muyu.firmmanage.domain.req.FirmListReq;
|
||||
import com.muyu.firmmanage.domain.resp.firmlist.FirmTotalListResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.firmmanage.service
|
||||
|
@ -7,5 +14,12 @@ package com.muyu.firmmanage.service;
|
|||
* @name:FirmManageService
|
||||
* @Date:2024/9/27 12:28
|
||||
*/
|
||||
public interface FirmManageService {
|
||||
public interface FirmManageService extends IService<Firm> {
|
||||
|
||||
/**
|
||||
* 公司列表信息展示
|
||||
* @param firmListReq
|
||||
* @return
|
||||
*/
|
||||
FirmTotalListResp firmmessageList(FirmListReq firmListReq);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,19 @@
|
|||
package com.muyu.firmmanage.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.firmmanage.domain.Firm;
|
||||
import com.muyu.firmmanage.domain.req.FirmListReq;
|
||||
import com.muyu.firmmanage.domain.resp.firmlist.FirmListResp;
|
||||
import com.muyu.firmmanage.domain.resp.firmlist.FirmTotalListResp;
|
||||
import com.muyu.firmmanage.mapper.FirmManageMapper;
|
||||
import com.muyu.firmmanage.service.FirmManageService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.firmmanage.service.impl
|
||||
|
@ -11,5 +22,26 @@ import org.springframework.stereotype.Service;
|
|||
* @Date:2024/9/27 12:28
|
||||
*/
|
||||
@Service
|
||||
public class FirmManageServiceImpl implements FirmManageService {
|
||||
public class FirmManageServiceImpl extends ServiceImpl<FirmManageMapper,Firm> implements FirmManageService {
|
||||
@Autowired
|
||||
private FirmManageMapper firmManageMapper;
|
||||
|
||||
/**
|
||||
* 公司列表信息展示
|
||||
* @param firmListReq
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public FirmTotalListResp firmmessageList(FirmListReq firmListReq) {
|
||||
LambdaQueryWrapper<Firm> queryWrapper = new LambdaQueryWrapper<>();
|
||||
long count = this.count(queryWrapper);
|
||||
int offset=(firmListReq.getPageNum()-1)*firmListReq.getPageSize();
|
||||
firmListReq.setPageNum(offset);
|
||||
List<Firm> list = firmManageMapper.firmmessageList(firmListReq);
|
||||
List<FirmListResp> firmListRespList = list.stream()
|
||||
.map(FirmListResp::firmListResp)
|
||||
.toList();
|
||||
return FirmTotalListResp.firmTotalListResp(firmListRespList, count);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9701
|
||||
port: 9709
|
||||
|
||||
nacos:
|
||||
addr: 159.75.188.178:8848
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
<?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.firmmanage.mapper.FirmManageMapper">
|
||||
<resultMap id="FirmListResult" type="com.muyu.firmmanage.domain.Firm">
|
||||
<id property="userId" column="user_id"></id>
|
||||
<result property="deptId" column="dept_id"></result>
|
||||
<result property="userName" column="user_name"></result>
|
||||
<result property="nickName" column="nick_name"></result>
|
||||
<result property="userType" column="user_type"></result>
|
||||
<result property="email" column="email"></result>
|
||||
<result property="phonenumber" column="phonenumber"></result>
|
||||
<result property="sex" column="sex"></result>
|
||||
<result property="avatar" column="avatar"></result>
|
||||
<result property="password" column="password"></result>
|
||||
<result property="status" column="status"></result>
|
||||
<result property="delFlag" column="del_flag"></result>
|
||||
<result property="loginIp" column="login_ip"></result>
|
||||
<result property="loginDate" column="login_date"></result>
|
||||
<result property="databaseName" column="database_name"></result>
|
||||
<result property="firmId" column="firm_id"></result>
|
||||
<result property="firmName" column="firm_name"></result>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectFirmManage">
|
||||
SELECT
|
||||
sys_user.*,
|
||||
firm.*
|
||||
FROM
|
||||
sys_user
|
||||
LEFT JOIN firm ON sys_user.firm_id = firm.firm_id
|
||||
</sql>
|
||||
|
||||
|
||||
<select id="firmmessageList" resultType="com.muyu.firmmanage.domain.Firm">
|
||||
<include refid="selectFirmManage"></include>
|
||||
<where>
|
||||
<if test="firmName!=null and firmName!=''">
|
||||
and firm.firm_name=#{firmName}
|
||||
</if>
|
||||
</where>
|
||||
limit #{pageNum},#{pageSize}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue