设备修改,部分大屏数据返回
This commit is contained in:
@@ -29,7 +29,7 @@ public class LaboratoryBigScreenController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/statistics")
|
@PostMapping("/statistics")
|
||||||
@Operation(summary = "大屏统计信息——总数统计")
|
@Operation(summary = "大屏统计信息——试验室、设备等总数统计")
|
||||||
public ResponseResult getStatistics() {
|
public ResponseResult getStatistics() {
|
||||||
return bigScreenService.getPigStatistics();
|
return bigScreenService.getPigStatistics();
|
||||||
}
|
}
|
||||||
|
|||||||
22
src/main/java/com/dc/dc_project/mapper/PositionMapper.java
Normal file
22
src/main/java/com/dc/dc_project/mapper/PositionMapper.java
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
package com.dc.dc_project.mapper;
|
||||||
|
|
||||||
|
import com.dc.dc_project.model.pojo.Position;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.dc.dc_project.model.vo.PositionVo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ADMIN
|
||||||
|
* @description 针对表【sys_position(岗位信息表)】的数据库操作Mapper
|
||||||
|
* @createDate 2025-11-14 16:39:29
|
||||||
|
* @Entity com.dc.dc_project.model.pojo.Position
|
||||||
|
*/
|
||||||
|
public interface PositionMapper extends BaseMapper<Position> {
|
||||||
|
|
||||||
|
List<PositionVo> getPositionsByPId(Long id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
110
src/main/java/com/dc/dc_project/model/pojo/Position.java
Normal file
110
src/main/java/com/dc/dc_project/model/pojo/Position.java
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
package com.dc.dc_project.model.pojo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位信息表
|
||||||
|
* @TableName sys_position
|
||||||
|
*/
|
||||||
|
@TableName(value ="sys_position")
|
||||||
|
@Data
|
||||||
|
public class Position {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位名
|
||||||
|
*/
|
||||||
|
@TableField(value = "name")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位所属站点
|
||||||
|
*/
|
||||||
|
@TableField(value = "org_id")
|
||||||
|
private Long orgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@TableField(value = "remark")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "created_at")
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
@TableField(value = "updated_at")
|
||||||
|
private LocalDateTime updatedAt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑删除标志(0=正常,1=删除)
|
||||||
|
*/
|
||||||
|
@TableField(value = "is_deleted")
|
||||||
|
private Integer isDeleted;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean equals(Object that) {
|
||||||
|
if (this == that) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (that == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (getClass() != that.getClass()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Position other = (Position) that;
|
||||||
|
return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
|
||||||
|
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
|
||||||
|
&& (this.getOrgId() == null ? other.getOrgId() == null : this.getOrgId().equals(other.getOrgId()))
|
||||||
|
&& (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
|
||||||
|
&& (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
|
||||||
|
&& (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()))
|
||||||
|
&& (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int hashCode() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
|
||||||
|
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
|
||||||
|
result = prime * result + ((getOrgId() == null) ? 0 : getOrgId().hashCode());
|
||||||
|
result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
|
||||||
|
result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
|
||||||
|
result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
|
||||||
|
result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append(getClass().getSimpleName());
|
||||||
|
sb.append(" [");
|
||||||
|
sb.append("Hash = ").append(hashCode());
|
||||||
|
sb.append(", id=").append(id);
|
||||||
|
sb.append(", name=").append(name);
|
||||||
|
sb.append(", orgId=").append(orgId);
|
||||||
|
sb.append(", remark=").append(remark);
|
||||||
|
sb.append(", createdAt=").append(createdAt);
|
||||||
|
sb.append(", updatedAt=").append(updatedAt);
|
||||||
|
sb.append(", isDeleted=").append(isDeleted);
|
||||||
|
sb.append("]");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -39,6 +39,12 @@ public class RecordEntrust {
|
|||||||
@TableField(value = "client_name")
|
@TableField(value = "client_name")
|
||||||
private String clientName;
|
private String clientName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 委托类型(1=现场,2=室内)
|
||||||
|
*/
|
||||||
|
@TableField(value = "entrust_type")
|
||||||
|
private Integer entrustType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
|
|||||||
51
src/main/java/com/dc/dc_project/model/vo/PositionVo.java
Normal file
51
src/main/java/com/dc/dc_project/model/vo/PositionVo.java
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
package com.dc.dc_project.model.vo;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位信息表
|
||||||
|
* @TableName sys_position
|
||||||
|
*/
|
||||||
|
@TableName(value ="sys_position")
|
||||||
|
@Data
|
||||||
|
public class PositionVo {
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位名
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 岗位所属站点
|
||||||
|
*/
|
||||||
|
private Long orgId;
|
||||||
|
|
||||||
|
private String orgName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createdAt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime updatedAt;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 逻辑删除标志(0=正常,1=删除)
|
||||||
|
*/
|
||||||
|
private Integer isDeleted;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -30,5 +30,5 @@ public class UserInfoVo {
|
|||||||
|
|
||||||
private List<Role> roles;
|
private List<Role> roles;
|
||||||
|
|
||||||
private OrgVo orgVo;
|
private List<PositionVo> positionVos;
|
||||||
}
|
}
|
||||||
|
|||||||
13
src/main/java/com/dc/dc_project/service/PositionService.java
Normal file
13
src/main/java/com/dc/dc_project/service/PositionService.java
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
package com.dc.dc_project.service;
|
||||||
|
|
||||||
|
import com.dc.dc_project.model.pojo.Position;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ADMIN
|
||||||
|
* @description 针对表【sys_position(岗位信息表)】的数据库操作Service
|
||||||
|
* @createDate 2025-11-14 16:39:29
|
||||||
|
*/
|
||||||
|
public interface PositionService extends IService<Position> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.dc.dc_project.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.dc.dc_project.model.pojo.Position;
|
||||||
|
import com.dc.dc_project.mapper.PositionMapper;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ADMIN
|
||||||
|
* @description 针对表【sys_position(岗位信息表)】的数据库操作Service实现
|
||||||
|
* @createDate 2025-11-14 16:39:29
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position>
|
||||||
|
implements PositionService{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -40,8 +40,11 @@ public class BigScreenServiceImpl implements BigScreenService {
|
|||||||
BigScreenStatistics bigScreenStatistics = new BigScreenStatistics();
|
BigScreenStatistics bigScreenStatistics = new BigScreenStatistics();
|
||||||
//试验室
|
//试验室
|
||||||
bigScreenStatistics.setLaboratoryCount(laboratoryService.count());
|
bigScreenStatistics.setLaboratoryCount(laboratoryService.count());
|
||||||
|
//设备
|
||||||
bigScreenStatistics.setDeviceCount(equipmentService.count());
|
bigScreenStatistics.setDeviceCount(equipmentService.count());
|
||||||
|
//人员
|
||||||
bigScreenStatistics.setPersonCount(personnelService.count());
|
bigScreenStatistics.setPersonCount(personnelService.count());
|
||||||
|
//工程数
|
||||||
bigScreenStatistics.setProjectCount(standardService.count());
|
bigScreenStatistics.setProjectCount(standardService.count());
|
||||||
bigScreenStatistics.setProjectBuildingCount(standardService.count());
|
bigScreenStatistics.setProjectBuildingCount(standardService.count());
|
||||||
bigScreenStatistics.setProjectCompletedCount(standardService.count());
|
bigScreenStatistics.setProjectCompletedCount(standardService.count());
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.dc.dc_project.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.dc.dc_project.mapper.PersonnelOrgMapper;
|
||||||
|
import com.dc.dc_project.model.pojo.PersonnelOrg;
|
||||||
|
import com.dc.dc_project.service.PersonnelOrgService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ADMIN
|
||||||
|
* @description 针对表【sys_personnel_org(角色-组织关系表)】的数据库操作Service实现
|
||||||
|
* @createDate 2025-11-14 16:34:55
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class PersonnelOrgServiceImpl extends ServiceImpl<PersonnelOrgMapper, PersonnelOrg>
|
||||||
|
implements PersonnelOrgService {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -5,19 +5,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.dc.dc_project.common.ResponseResult;
|
import com.dc.dc_project.common.ResponseResult;
|
||||||
import com.dc.dc_project.common.ResultCode;
|
import com.dc.dc_project.common.ResultCode;
|
||||||
import com.dc.dc_project.mapper.OrgMapper;
|
import com.dc.dc_project.mapper.*;
|
||||||
import com.dc.dc_project.mapper.PersonnelMapper;
|
|
||||||
import com.dc.dc_project.mapper.RoleMapper;
|
|
||||||
import com.dc.dc_project.model.dto.user.LoginDto;
|
import com.dc.dc_project.model.dto.user.LoginDto;
|
||||||
import com.dc.dc_project.model.pojo.Personnel;
|
import com.dc.dc_project.model.pojo.*;
|
||||||
import com.dc.dc_project.model.pojo.RecordResult;
|
|
||||||
import com.dc.dc_project.model.pojo.Role;
|
|
||||||
import com.dc.dc_project.model.pojo.User;
|
|
||||||
import com.dc.dc_project.model.vo.PersonnelVo;
|
import com.dc.dc_project.model.vo.PersonnelVo;
|
||||||
|
import com.dc.dc_project.model.vo.PositionVo;
|
||||||
import com.dc.dc_project.model.vo.UserInfoVo;
|
import com.dc.dc_project.model.vo.UserInfoVo;
|
||||||
import com.dc.dc_project.service.PersonnelService;
|
import com.dc.dc_project.service.PersonnelService;
|
||||||
import com.dc.dc_project.service.UserService;
|
import com.dc.dc_project.service.UserService;
|
||||||
import com.dc.dc_project.mapper.UserMapper;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -42,6 +37,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User>
|
|||||||
private final PersonnelService personnelService;
|
private final PersonnelService personnelService;
|
||||||
private final OrgMapper orgMapper;
|
private final OrgMapper orgMapper;
|
||||||
private final RoleMapper roleMapper;
|
private final RoleMapper roleMapper;
|
||||||
|
private final PositionMapper positionMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResponseResult login(LoginDto loginDto) {
|
public ResponseResult login(LoginDto loginDto) {
|
||||||
@@ -86,6 +82,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User>
|
|||||||
User user = baseMapper.selectOne(queryWrapper);
|
User user = baseMapper.selectOne(queryWrapper);
|
||||||
Personnel personnel = personnelMapper.selectOne(new LambdaQueryWrapper<Personnel>().eq(Personnel::getUserId, user.getId()));
|
Personnel personnel = personnelMapper.selectOne(new LambdaQueryWrapper<Personnel>().eq(Personnel::getUserId, user.getId()));
|
||||||
List<Role> roles = roleMapper.getRolesByUserId(user.getId());
|
List<Role> roles = roleMapper.getRolesByUserId(user.getId());
|
||||||
|
List<PositionVo> positions = positionMapper.getPositionsByPId(personnel.getId());
|
||||||
|
|
||||||
UserInfoVo userInfoVo = new UserInfoVo();
|
UserInfoVo userInfoVo = new UserInfoVo();
|
||||||
|
|
||||||
|
|||||||
@@ -4,8 +4,7 @@
|
|||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.dc.dc_project.mapper.PersonnelOrgMapper">
|
<mapper namespace="com.dc.dc_project.mapper.PersonnelOrgMapper">
|
||||||
|
|
||||||
|
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id,role_id,org_id,created_at,created_by
|
id,personnel_id,org_id,created_at,created_by
|
||||||
</sql>
|
</sql>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|||||||
28
src/main/resources/mapper/PositionMapper.xml
Normal file
28
src/main/resources/mapper/PositionMapper.xml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?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.dc.dc_project.mapper.PositionMapper">
|
||||||
|
|
||||||
|
<resultMap id="BaseResultMap" type="com.dc.dc_project.model.pojo.Position">
|
||||||
|
<id property="id" column="id" />
|
||||||
|
<result property="name" column="name" />
|
||||||
|
<result property="orgId" column="org_id" />
|
||||||
|
<result property="remark" column="remark" />
|
||||||
|
<result property="createdAt" column="created_at" />
|
||||||
|
<result property="updatedAt" column="updated_at" />
|
||||||
|
<result property="isDeleted" column="is_deleted" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id,name,org_id,remark,created_at,updated_at,
|
||||||
|
is_deleted
|
||||||
|
</sql>
|
||||||
|
<select id="getPositionsByPId" resultType="com.dc.dc_project.model.vo.PositionVo">
|
||||||
|
select
|
||||||
|
id
|
||||||
|
from sys_position
|
||||||
|
left join sys_personnel_position spp on sys_position.id = spp.position_id
|
||||||
|
left join
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user