站点修改
parent
0af33c15ac
commit
e72876114a
|
|
@ -5,7 +5,7 @@ import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity;
|
import com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity;
|
||||||
import com.njzscloud.dispose.cst.driver.pojo.param.DriverQueryParam;
|
import com.njzscloud.dispose.cst.driver.pojo.param.DriverQueryParam;
|
||||||
import com.njzscloud.dispose.cst.driver.pojo.result.DriverDetailResult;
|
import com.njzscloud.dispose.cst.driver.pojo.result.DriverResult;
|
||||||
import com.njzscloud.dispose.cst.driver.service.DriverService;
|
import com.njzscloud.dispose.cst.driver.service.DriverService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -56,7 +56,7 @@ public class DriverController {
|
||||||
* 详情
|
* 详情
|
||||||
*/
|
*/
|
||||||
@GetMapping("/detail")
|
@GetMapping("/detail")
|
||||||
public R<DriverDetailResult> detail(@RequestParam("id") Long id) {
|
public R<DriverResult> detail(@RequestParam("id") Long id) {
|
||||||
return R.success(driverService.detail(id));
|
return R.success(driverService.detail(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -64,7 +64,7 @@ public class DriverController {
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
@GetMapping("/paging")
|
@GetMapping("/paging")
|
||||||
public R<PageResult<DriverDetailResult>> paging(PageParam pageParam, DriverQueryParam queryParam) {
|
public R<PageResult<DriverResult>> paging(PageParam pageParam, DriverQueryParam queryParam) {
|
||||||
return R.success(driverService.paging(pageParam, queryParam));
|
return R.success(driverService.paging(pageParam, queryParam));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity;
|
import com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity;
|
||||||
import com.njzscloud.dispose.cst.driver.pojo.result.DriverDetailResult;
|
import com.njzscloud.dispose.cst.driver.pojo.result.DriverResult;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
@ -16,8 +16,8 @@ import org.apache.ibatis.annotations.Param;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface DriverMapper extends BaseMapper<DriverEntity> {
|
public interface DriverMapper extends BaseMapper<DriverEntity> {
|
||||||
|
|
||||||
Page<DriverDetailResult> paging(Page<DriverEntity> page, @Param("ew") QueryWrapper<DriverEntity> ew);
|
Page<DriverResult> paging(Page<DriverEntity> page, @Param("ew") QueryWrapper<DriverEntity> ew);
|
||||||
|
|
||||||
DriverDetailResult getById(Long id);
|
DriverResult getById(Long id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import java.time.LocalDateTime;
|
||||||
@Setter
|
@Setter
|
||||||
@ToString
|
@ToString
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class DriverDetailResult {
|
public class DriverResult {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
||||||
|
|
@ -5,7 +5,7 @@ import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity;
|
import com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity;
|
||||||
import com.njzscloud.dispose.cst.driver.pojo.param.DriverQueryParam;
|
import com.njzscloud.dispose.cst.driver.pojo.param.DriverQueryParam;
|
||||||
import com.njzscloud.dispose.cst.driver.pojo.result.DriverDetailResult;
|
import com.njzscloud.dispose.cst.driver.pojo.result.DriverResult;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -21,9 +21,9 @@ public interface DriverService extends IService<DriverEntity> {
|
||||||
|
|
||||||
void del(List<Long> ids);
|
void del(List<Long> ids);
|
||||||
|
|
||||||
DriverDetailResult detail(Long id);
|
DriverResult detail(Long id);
|
||||||
|
|
||||||
PageResult<DriverDetailResult> paging(PageParam pageParam, DriverQueryParam queryParam);
|
PageResult<DriverResult> paging(PageParam pageParam, DriverQueryParam queryParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.cst.driver.mapper.DriverMapper;
|
import com.njzscloud.dispose.cst.driver.mapper.DriverMapper;
|
||||||
import com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity;
|
import com.njzscloud.dispose.cst.driver.pojo.entity.DriverEntity;
|
||||||
import com.njzscloud.dispose.cst.driver.pojo.param.DriverQueryParam;
|
import com.njzscloud.dispose.cst.driver.pojo.param.DriverQueryParam;
|
||||||
import com.njzscloud.dispose.cst.driver.pojo.result.DriverDetailResult;
|
import com.njzscloud.dispose.cst.driver.pojo.result.DriverResult;
|
||||||
import com.njzscloud.dispose.cst.driver.service.DriverService;
|
import com.njzscloud.dispose.cst.driver.service.DriverService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -45,12 +45,12 @@ public class DriverServiceImpl extends ServiceImpl<DriverMapper, DriverEntity> i
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DriverDetailResult detail(Long id) {
|
public DriverResult detail(Long id) {
|
||||||
return baseMapper.getById(id);
|
return baseMapper.getById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<DriverDetailResult> paging(PageParam pageParam, DriverQueryParam queryParam) {
|
public PageResult<DriverResult> paging(PageParam pageParam, DriverQueryParam queryParam) {
|
||||||
if (queryParam == null) {
|
if (queryParam == null) {
|
||||||
queryParam = new DriverQueryParam();
|
queryParam = new DriverQueryParam();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.cst.project.pojo.entity.ProjectEntity;
|
import com.njzscloud.dispose.cst.project.pojo.entity.ProjectEntity;
|
||||||
import com.njzscloud.dispose.cst.project.pojo.param.ProjectQueryParam;
|
import com.njzscloud.dispose.cst.project.pojo.param.ProjectQueryParam;
|
||||||
import com.njzscloud.dispose.cst.project.pojo.result.ProjectDetailResult;
|
import com.njzscloud.dispose.cst.project.pojo.result.ProjectResult;
|
||||||
import com.njzscloud.dispose.cst.project.service.ProjectService;
|
import com.njzscloud.dispose.cst.project.service.ProjectService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -57,7 +57,7 @@ public class ProjectController {
|
||||||
* 详情
|
* 详情
|
||||||
*/
|
*/
|
||||||
@GetMapping("/detail")
|
@GetMapping("/detail")
|
||||||
public R<ProjectDetailResult> detail(@RequestParam("id") Long id) {
|
public R<ProjectResult> detail(@RequestParam("id") Long id) {
|
||||||
return R.success(projectService.detail(id));
|
return R.success(projectService.detail(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -65,7 +65,7 @@ public class ProjectController {
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
@GetMapping("/paging")
|
@GetMapping("/paging")
|
||||||
public R<PageResult<ProjectDetailResult>> paging(PageParam pageParam, ProjectQueryParam queryParam) {
|
public R<PageResult<ProjectResult>> paging(PageParam pageParam, ProjectQueryParam queryParam) {
|
||||||
return R.success(projectService.paging(pageParam, queryParam));
|
return R.success(projectService.paging(pageParam, queryParam));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njzscloud.dispose.cst.project.pojo.entity.ProjectEntity;
|
import com.njzscloud.dispose.cst.project.pojo.entity.ProjectEntity;
|
||||||
import com.njzscloud.dispose.cst.project.pojo.result.ProjectDetailResult;
|
import com.njzscloud.dispose.cst.project.pojo.result.ProjectResult;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
@ -16,7 +16,7 @@ import org.apache.ibatis.annotations.Param;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface ProjectMapper extends BaseMapper<ProjectEntity> {
|
public interface ProjectMapper extends BaseMapper<ProjectEntity> {
|
||||||
|
|
||||||
Page<ProjectDetailResult> paging(Page<ProjectEntity> page, @Param("ew") QueryWrapper<ProjectEntity> ew);
|
Page<ProjectResult> paging(Page<ProjectEntity> page, @Param("ew") QueryWrapper<ProjectEntity> ew);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import java.time.LocalDateTime;
|
||||||
@Setter
|
@Setter
|
||||||
@ToString
|
@ToString
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class ProjectDetailResult {
|
public class ProjectResult {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
||||||
|
|
@ -5,7 +5,7 @@ import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.cst.project.pojo.entity.ProjectEntity;
|
import com.njzscloud.dispose.cst.project.pojo.entity.ProjectEntity;
|
||||||
import com.njzscloud.dispose.cst.project.pojo.param.ProjectQueryParam;
|
import com.njzscloud.dispose.cst.project.pojo.param.ProjectQueryParam;
|
||||||
import com.njzscloud.dispose.cst.project.pojo.result.ProjectDetailResult;
|
import com.njzscloud.dispose.cst.project.pojo.result.ProjectResult;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -21,9 +21,9 @@ public interface ProjectService extends IService<ProjectEntity> {
|
||||||
|
|
||||||
void del(List<Long> ids);
|
void del(List<Long> ids);
|
||||||
|
|
||||||
ProjectDetailResult detail(Long id);
|
ProjectResult detail(Long id);
|
||||||
|
|
||||||
PageResult<ProjectDetailResult> paging(PageParam pageParam, ProjectQueryParam queryParam);
|
PageResult<ProjectResult> paging(PageParam pageParam, ProjectQueryParam queryParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import com.njzscloud.dispose.cst.org.service.OrgService;
|
||||||
import com.njzscloud.dispose.cst.project.mapper.ProjectMapper;
|
import com.njzscloud.dispose.cst.project.mapper.ProjectMapper;
|
||||||
import com.njzscloud.dispose.cst.project.pojo.entity.ProjectEntity;
|
import com.njzscloud.dispose.cst.project.pojo.entity.ProjectEntity;
|
||||||
import com.njzscloud.dispose.cst.project.pojo.param.ProjectQueryParam;
|
import com.njzscloud.dispose.cst.project.pojo.param.ProjectQueryParam;
|
||||||
import com.njzscloud.dispose.cst.project.pojo.result.ProjectDetailResult;
|
import com.njzscloud.dispose.cst.project.pojo.result.ProjectResult;
|
||||||
import com.njzscloud.dispose.cst.project.service.ProjectService;
|
import com.njzscloud.dispose.cst.project.service.ProjectService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -57,19 +57,19 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ProjectDetailResult detail(Long id) {
|
public ProjectResult detail(Long id) {
|
||||||
ProjectEntity detail = this.getById(id);
|
ProjectEntity detail = this.getById(id);
|
||||||
if (detail == null) {
|
if (detail == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
ProjectDetailResult result = BeanUtil.copyProperties(detail, ProjectDetailResult.class);
|
ProjectResult result = BeanUtil.copyProperties(detail, ProjectResult.class);
|
||||||
fillCustomerAndOrgInfo(Collections.singletonList(result));
|
fillCustomerAndOrgInfo(Collections.singletonList(result));
|
||||||
// 使用 BeanUtil 直接复制属性
|
// 使用 BeanUtil 直接复制属性
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<ProjectDetailResult> paging(PageParam pageParam, ProjectQueryParam queryParam) {
|
public PageResult<ProjectResult> paging(PageParam pageParam, ProjectQueryParam queryParam) {
|
||||||
if (queryParam == null) {
|
if (queryParam == null) {
|
||||||
queryParam = new ProjectQueryParam();
|
queryParam = new ProjectQueryParam();
|
||||||
}
|
}
|
||||||
|
|
@ -82,7 +82,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity
|
||||||
// 直接调用自定义分页 SQL
|
// 直接调用自定义分页 SQL
|
||||||
Page<ProjectEntity> page = pageParam.toPage();
|
Page<ProjectEntity> page = pageParam.toPage();
|
||||||
page.addOrder(OrderItem.desc("p.create_time"));
|
page.addOrder(OrderItem.desc("p.create_time"));
|
||||||
Page<ProjectDetailResult> paging = baseMapper.paging(page, ew);
|
Page<ProjectResult> paging = baseMapper.paging(page, ew);
|
||||||
|
|
||||||
if (CollUtil.isNotEmpty(paging.getRecords())) {
|
if (CollUtil.isNotEmpty(paging.getRecords())) {
|
||||||
fillCustomerAndOrgInfo(paging.getRecords());
|
fillCustomerAndOrgInfo(paging.getRecords());
|
||||||
|
|
@ -94,12 +94,12 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity
|
||||||
/**
|
/**
|
||||||
* 批量填充运输方 / 产废方(购买方)的客户与组织信息
|
* 批量填充运输方 / 产废方(购买方)的客户与组织信息
|
||||||
*/
|
*/
|
||||||
private void fillCustomerAndOrgInfo(List<ProjectDetailResult> records) {
|
private void fillCustomerAndOrgInfo(List<ProjectResult> records) {
|
||||||
// 收集所有需要的 ID
|
// 收集所有需要的 ID
|
||||||
Set<Long> transCustomerIds = records.stream().map(ProjectDetailResult::getTransCustomerId).filter(Objects::nonNull).collect(Collectors.toSet());
|
Set<Long> transCustomerIds = records.stream().map(ProjectResult::getTransCustomerId).filter(Objects::nonNull).collect(Collectors.toSet());
|
||||||
Set<Long> fringeCustomerIds = records.stream().map(ProjectDetailResult::getFringeCustomerId).filter(Objects::nonNull).collect(Collectors.toSet());
|
Set<Long> fringeCustomerIds = records.stream().map(ProjectResult::getFringeCustomerId).filter(Objects::nonNull).collect(Collectors.toSet());
|
||||||
Set<Long> transOrgIds = records.stream().map(ProjectDetailResult::getTransOrgId).filter(Objects::nonNull).collect(Collectors.toSet());
|
Set<Long> transOrgIds = records.stream().map(ProjectResult::getTransOrgId).filter(Objects::nonNull).collect(Collectors.toSet());
|
||||||
Set<Long> fringeOrgIds = records.stream().map(ProjectDetailResult::getFringeOrgId).filter(Objects::nonNull).collect(Collectors.toSet());
|
Set<Long> fringeOrgIds = records.stream().map(ProjectResult::getFringeOrgId).filter(Objects::nonNull).collect(Collectors.toSet());
|
||||||
|
|
||||||
Set<Long> allCustomerIds = new HashSet<>(transCustomerIds);
|
Set<Long> allCustomerIds = new HashSet<>(transCustomerIds);
|
||||||
allCustomerIds.addAll(fringeCustomerIds);
|
allCustomerIds.addAll(fringeCustomerIds);
|
||||||
|
|
@ -116,7 +116,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, ProjectEntity
|
||||||
orgMap = orgService.listByIds(allOrgIds).stream().collect(Collectors.toMap(OrgEntity::getId, it -> it));
|
orgMap = orgService.listByIds(allOrgIds).stream().collect(Collectors.toMap(OrgEntity::getId, it -> it));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (ProjectDetailResult item : records) {
|
for (ProjectResult item : records) {
|
||||||
if (item.getTransCustomerId() != null) {
|
if (item.getTransCustomerId() != null) {
|
||||||
item.setTransCustomerInfo(customerMap.get(item.getTransCustomerId()));
|
item.setTransCustomerInfo(customerMap.get(item.getTransCustomerId()));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import com.njzscloud.common.core.utils.R;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.cst.station.pojo.entity.StationEntity;
|
import com.njzscloud.dispose.cst.station.pojo.entity.StationEntity;
|
||||||
|
import com.njzscloud.dispose.cst.station.pojo.param.StationQueryParam;
|
||||||
|
import com.njzscloud.dispose.cst.station.pojo.result.StationResult;
|
||||||
import com.njzscloud.dispose.cst.station.service.StationService;
|
import com.njzscloud.dispose.cst.station.service.StationService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -54,7 +56,7 @@ public class StationController {
|
||||||
* 详情
|
* 详情
|
||||||
*/
|
*/
|
||||||
@GetMapping("/detail")
|
@GetMapping("/detail")
|
||||||
public R<StationEntity> detail(@RequestParam("id") Long id) {
|
public R<StationResult> detail(@RequestParam("id") Long id) {
|
||||||
return R.success(stationService.detail(id));
|
return R.success(stationService.detail(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,8 +64,8 @@ public class StationController {
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
@GetMapping("/paging")
|
@GetMapping("/paging")
|
||||||
public R<PageResult<StationEntity>> paging(PageParam pageParam, StationEntity stationEntity) {
|
public R<PageResult<StationResult>> paging(PageParam pageParam, StationQueryParam queryParam) {
|
||||||
return R.success(stationService.paging(pageParam, stationEntity));
|
return R.success(stationService.paging(pageParam, queryParam));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,12 @@
|
||||||
package com.njzscloud.dispose.cst.station.mapper;
|
package com.njzscloud.dispose.cst.station.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njzscloud.dispose.cst.station.pojo.entity.StationEntity;
|
import com.njzscloud.dispose.cst.station.pojo.entity.StationEntity;
|
||||||
|
import com.njzscloud.dispose.cst.station.pojo.result.StationResult;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点信息
|
* 站点信息
|
||||||
|
|
@ -10,6 +14,9 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
*/
|
*/
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface StationMapper extends BaseMapper<StationEntity> {
|
public interface StationMapper extends BaseMapper<StationEntity> {
|
||||||
|
|
||||||
|
Page<StationResult> paging(Page<StationResult> page, @Param("ew") QueryWrapper<StationResult> ew);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.njzscloud.dispose.cst.station.pojo.entity;
|
package com.njzscloud.dispose.cst.station.pojo.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.njzscloud.dispose.common.pojo.entity.BaseEntity;
|
import com.njzscloud.dispose.common.pojo.entity.BaseEntity;
|
||||||
import com.njzscloud.dispose.cst.org.pojo.entity.OrgEntity;
|
import com.njzscloud.dispose.cst.org.pojo.entity.OrgEntity;
|
||||||
|
|
@ -10,7 +9,7 @@ import lombok.ToString;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 站点信息
|
* 站点信息实体(仅包含表字段)
|
||||||
* @author ljw
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
|
|
@ -85,10 +84,5 @@ public class StationEntity extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private Double lat;
|
private Double lat;
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联组织信息(返回用)
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private OrgEntity org;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.njzscloud.dispose.cst.station.pojo.param;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点分页查询入参
|
||||||
|
*
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class StationQueryParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除; 0-->未删除、1-->已删除
|
||||||
|
* 作为查询条件时,默认按未删除(0)处理
|
||||||
|
*/
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点名称(模糊查询)
|
||||||
|
*/
|
||||||
|
private String stationName;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,123 @@
|
||||||
|
package com.njzscloud.dispose.cst.station.pojo.result;
|
||||||
|
|
||||||
|
import com.njzscloud.dispose.cst.org.pojo.entity.OrgEntity;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点详情 / 列表返回结果
|
||||||
|
*
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class StationResult {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 组织信息 Id
|
||||||
|
*/
|
||||||
|
private Long orgId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 站点名称
|
||||||
|
*/
|
||||||
|
private String stationName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省;代码
|
||||||
|
*/
|
||||||
|
private String province;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市;代码
|
||||||
|
*/
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区县;代码
|
||||||
|
*/
|
||||||
|
private String area;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 乡镇街道;代码
|
||||||
|
*/
|
||||||
|
private String town;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 省;名称
|
||||||
|
*/
|
||||||
|
private String provinceName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市;名称
|
||||||
|
*/
|
||||||
|
private String cityName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区县;名称
|
||||||
|
*/
|
||||||
|
private String areaName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 乡镇街道;名称
|
||||||
|
*/
|
||||||
|
private String townName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详细地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 经度
|
||||||
|
*/
|
||||||
|
private Double lng;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 纬度
|
||||||
|
*/
|
||||||
|
private Double lat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人 Id;sys_user.id
|
||||||
|
*/
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人 Id; sys_user.id
|
||||||
|
*/
|
||||||
|
private Long modifierId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime modifyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除; 0-->未删除、1-->已删除
|
||||||
|
*/
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联组织信息(返回用)
|
||||||
|
*/
|
||||||
|
private OrgEntity org;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.dispose.cst.station.pojo.entity.StationEntity;
|
import com.njzscloud.dispose.cst.station.pojo.entity.StationEntity;
|
||||||
|
import com.njzscloud.dispose.cst.station.pojo.param.StationQueryParam;
|
||||||
|
import com.njzscloud.dispose.cst.station.pojo.result.StationResult;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -19,9 +21,9 @@ public interface StationService extends IService<StationEntity> {
|
||||||
|
|
||||||
void del(List<Long> ids);
|
void del(List<Long> ids);
|
||||||
|
|
||||||
StationEntity detail(Long id);
|
StationResult detail(Long id);
|
||||||
|
|
||||||
PageResult<StationEntity> paging(PageParam pageParam, StationEntity stationEntity);
|
PageResult<StationResult> paging(PageParam pageParam, StationQueryParam queryParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.njzscloud.dispose.cst.station.service.impl;
|
package com.njzscloud.dispose.cst.station.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||||
|
|
@ -11,6 +12,8 @@ import com.njzscloud.dispose.cst.org.pojo.entity.OrgEntity;
|
||||||
import com.njzscloud.dispose.cst.org.service.OrgService;
|
import com.njzscloud.dispose.cst.org.service.OrgService;
|
||||||
import com.njzscloud.dispose.cst.station.mapper.StationMapper;
|
import com.njzscloud.dispose.cst.station.mapper.StationMapper;
|
||||||
import com.njzscloud.dispose.cst.station.pojo.entity.StationEntity;
|
import com.njzscloud.dispose.cst.station.pojo.entity.StationEntity;
|
||||||
|
import com.njzscloud.dispose.cst.station.pojo.param.StationQueryParam;
|
||||||
|
import com.njzscloud.dispose.cst.station.pojo.result.StationResult;
|
||||||
import com.njzscloud.dispose.cst.station.service.StationService;
|
import com.njzscloud.dispose.cst.station.service.StationService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -37,16 +40,12 @@ public class StationServiceImpl extends ServiceImpl<StationMapper, StationEntity
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void add(StationEntity stationEntity) {
|
public void add(StationEntity stationEntity) {
|
||||||
OrgEntity org = stationEntity.getOrg();
|
|
||||||
orgService.save(org);
|
|
||||||
stationEntity.setOrgId(org.getId());
|
|
||||||
this.save(stationEntity);
|
this.save(stationEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void modify(StationEntity stationEntity) {
|
public void modify(StationEntity stationEntity) {
|
||||||
orgService.updateById(stationEntity.getOrg());
|
|
||||||
this.updateById(stationEntity);
|
this.updateById(stationEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -64,30 +63,36 @@ public class StationServiceImpl extends ServiceImpl<StationMapper, StationEntity
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StationEntity detail(Long id) {
|
public StationResult detail(Long id) {
|
||||||
StationEntity station = this.getById(id);
|
StationEntity station = this.getById(id);
|
||||||
if (station != null && station.getOrgId() != null) {
|
if (station == null) {
|
||||||
station.setOrg(orgService.getById(station.getOrgId()));
|
return null;
|
||||||
}
|
}
|
||||||
return station;
|
StationResult result = BeanUtil.copyProperties(station, StationResult.class);
|
||||||
|
if (station.getOrgId() != null) {
|
||||||
|
result.setOrg(orgService.getById(station.getOrgId()));
|
||||||
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<StationEntity> paging(PageParam pageParam, StationEntity stationEntity) {
|
public PageResult<StationResult> paging(PageParam pageParam, StationQueryParam queryParam) {
|
||||||
QueryWrapper<StationEntity> ew = Wrappers.<StationEntity>query().eq("deleted", 0);
|
if (queryParam == null) {
|
||||||
if (stationEntity != null) {
|
queryParam = new StationQueryParam();
|
||||||
String stationName = stationEntity.getStationName();
|
|
||||||
// 添加站点名称的模糊查询,并判空
|
|
||||||
ew.like(StrUtil.isNotBlank(stationName), "station_name", stationName);
|
|
||||||
}
|
}
|
||||||
|
String stationName = queryParam.getStationName();
|
||||||
|
|
||||||
|
QueryWrapper<StationResult> ew = Wrappers.<StationResult>query().eq("deleted", Boolean.FALSE);
|
||||||
|
// 添加站点名称的模糊查询,并判空
|
||||||
|
ew.like(StrUtil.isNotBlank(stationName), "station_name", stationName);
|
||||||
pageParam.toPage().addOrder(OrderItem.desc("create_time"));
|
pageParam.toPage().addOrder(OrderItem.desc("create_time"));
|
||||||
PageResult<StationEntity> page = PageResult.of(this.page(pageParam.toPage(), ew));
|
PageResult<StationResult> page = PageResult.of(baseMapper.paging(pageParam.toPage(), ew));
|
||||||
List<StationEntity> records = page.getRecords();
|
List<StationResult> records = page.getRecords();
|
||||||
if (records.isEmpty()) {
|
if (records.isEmpty()) {
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
List<Long> orgIds = records.stream()
|
List<Long> orgIds = records.stream()
|
||||||
.map(StationEntity::getOrgId)
|
.map(StationResult::getOrgId)
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.toList();
|
.toList();
|
||||||
if (!orgIds.isEmpty()) {
|
if (!orgIds.isEmpty()) {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<!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.njzscloud.dispose.cst.driver.mapper.DriverMapper">
|
<mapper namespace="com.njzscloud.dispose.cst.driver.mapper.DriverMapper">
|
||||||
|
|
||||||
<resultMap id="DriverResultMap" type="com.njzscloud.dispose.cst.driver.pojo.result.DriverDetailResult">
|
<resultMap id="DriverResultMap" type="com.njzscloud.dispose.cst.driver.pojo.result.DriverResult">
|
||||||
<id column="id" property="id"/>
|
<id column="id" property="id"/>
|
||||||
<result column="user_id" property="userId"/>
|
<result column="user_id" property="userId"/>
|
||||||
<result column="customer_id" property="customerId"/>
|
<result column="customer_id" property="customerId"/>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<!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.njzscloud.dispose.cst.project.mapper.ProjectMapper">
|
<mapper namespace="com.njzscloud.dispose.cst.project.mapper.ProjectMapper">
|
||||||
|
|
||||||
<resultMap id="ProjectResultMap" type="com.njzscloud.dispose.cst.project.pojo.result.ProjectDetailResult">
|
<resultMap id="ProjectResultMap" type="com.njzscloud.dispose.cst.project.pojo.result.ProjectResult">
|
||||||
<id column="id" property="id"/>
|
<id column="id" property="id"/>
|
||||||
<result column="project_name" property="projectName"/>
|
<result column="project_name" property="projectName"/>
|
||||||
<result column="contract_picture" property="contractPicture"/>
|
<result column="contract_picture" property="contractPicture"/>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,41 @@
|
||||||
|
<?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.njzscloud.dispose.cst.station.mapper.StationMapper">
|
||||||
|
<resultMap id="StationResultMap" type="com.njzscloud.dispose.cst.station.pojo.result.StationResult">
|
||||||
|
<id column="id" property="id"/>
|
||||||
|
<result column="org_id" property="orgId"/>
|
||||||
|
<result column="station_name" property="stationName"/>
|
||||||
|
<result column="province" property="province"/>
|
||||||
|
<result column="city" property="city"/>
|
||||||
|
<result column="area" property="area"/>
|
||||||
|
<result column="town" property="town"/>
|
||||||
|
<result column="province_name" property="provinceName"/>
|
||||||
|
<result column="city_name" property="cityName"/>
|
||||||
|
<result column="area_name" property="areaName"/>
|
||||||
|
<result column="town_name" property="townName"/>
|
||||||
|
<result column="address" property="address"/>
|
||||||
|
<result column="lng" property="lng"/>
|
||||||
|
<result column="lat" property="lat"/>
|
||||||
|
<result column="creator_id" property="creatorId"/>
|
||||||
|
<result column="modifier_id" property="modifierId"/>
|
||||||
|
<result column="create_time" property="createTime"/>
|
||||||
|
<result column="modify_time" property="modifyTime"/>
|
||||||
|
<result column="deleted" property="deleted"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id
|
||||||
|
, org_id, station_name, province, city, area, town,
|
||||||
|
province_name, city_name, area_name, town_name, address, lng, lat,
|
||||||
|
creator_id, modifier_id, create_time, modify_time, deleted
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="paging" resultMap="StationResultMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="Base_Column_List"/>
|
||||||
|
FROM cst_station
|
||||||
|
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||||
|
${ew.customSqlSegment}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
Loading…
Reference in New Issue