Compare commits
No commits in common. "dcb7f32b6de2ffe62607f6e899895849fc2259c6" and "d9462239fd486e3d2b3dad2ca224281df8e0edae" have entirely different histories.
dcb7f32b6d
...
d9462239fd
|
|
@ -1,69 +0,0 @@
|
||||||
package com.njzscloud.supervisory.route.controller;
|
|
||||||
|
|
||||||
import com.njzscloud.common.core.utils.R;
|
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
|
||||||
import com.njzscloud.supervisory.route.pojo.RouteEntity;
|
|
||||||
import com.njzscloud.supervisory.route.service.RouteService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路线管理
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/route")
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class RouteController {
|
|
||||||
|
|
||||||
private final RouteService routeService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*/
|
|
||||||
@PostMapping("/add")
|
|
||||||
public R<?> add(@RequestBody RouteEntity routeEntity) {
|
|
||||||
routeService.add(routeEntity);
|
|
||||||
return R.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改
|
|
||||||
*/
|
|
||||||
@PostMapping("/modify")
|
|
||||||
public R<?> modify(@RequestBody RouteEntity routeEntity) {
|
|
||||||
routeService.modify(routeEntity);
|
|
||||||
return R.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
@PostMapping("/del")
|
|
||||||
public R<?> del(@RequestBody List<Long> ids) {
|
|
||||||
routeService.del(ids);
|
|
||||||
return R.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*/
|
|
||||||
@GetMapping("/detail")
|
|
||||||
public R<RouteEntity> detail(@RequestParam Long id) {
|
|
||||||
return R.success(routeService.detail(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*/
|
|
||||||
@GetMapping("/paging")
|
|
||||||
public R<PageResult<RouteEntity>> paging(PageParam pageParam, RouteEntity routeEntity) {
|
|
||||||
return R.success(routeService.paging(pageParam, routeEntity));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
package com.njzscloud.supervisory.route.controller;
|
|
||||||
|
|
||||||
import com.njzscloud.common.core.utils.R;
|
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
|
||||||
import com.njzscloud.supervisory.route.pojo.RouteDetailEntity;
|
|
||||||
import com.njzscloud.supervisory.route.service.RouteDetailService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路线详情管理
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/route_detail")
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class RouteDetailController {
|
|
||||||
|
|
||||||
private final RouteDetailService routeDetailService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*/
|
|
||||||
@PostMapping("/add")
|
|
||||||
public R<?> add(@RequestBody RouteDetailEntity detailEntity) {
|
|
||||||
routeDetailService.add(detailEntity);
|
|
||||||
return R.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改
|
|
||||||
*/
|
|
||||||
@PostMapping("/modify")
|
|
||||||
public R<?> modify(@RequestBody RouteDetailEntity detailEntity) {
|
|
||||||
routeDetailService.modify(detailEntity);
|
|
||||||
return R.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
@PostMapping("/del")
|
|
||||||
public R<?> del(@RequestBody List<Long> ids) {
|
|
||||||
routeDetailService.del(ids);
|
|
||||||
return R.success();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*/
|
|
||||||
@GetMapping("/detail")
|
|
||||||
public R<RouteDetailEntity> detail(@RequestParam Long id) {
|
|
||||||
return R.success(routeDetailService.detail(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*/
|
|
||||||
@GetMapping("/paging")
|
|
||||||
public R<PageResult<RouteDetailEntity>> paging(PageParam pageParam, RouteDetailEntity detailEntity) {
|
|
||||||
return R.success(routeDetailService.paging(pageParam, detailEntity));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
package com.njzscloud.supervisory.route.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.njzscloud.supervisory.route.pojo.RouteDetailEntity;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路线详情管理
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface RouteDetailMapper extends BaseMapper<RouteDetailEntity> {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
package com.njzscloud.supervisory.route.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.njzscloud.supervisory.route.pojo.RouteEntity;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路线管理
|
|
||||||
*/
|
|
||||||
@Mapper
|
|
||||||
public interface RouteMapper extends BaseMapper<RouteEntity> {
|
|
||||||
|
|
||||||
IPage<RouteEntity> paging(Page<Object> page, @Param("ew") QueryWrapper<RouteEntity> ew);
|
|
||||||
|
|
||||||
RouteEntity selectDetailById(@Param("id") Long id);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
package com.njzscloud.supervisory.route.pojo;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 优惠管理
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@TableName(value = "biz_route_detail", autoResultMap = true)
|
|
||||||
public class RouteDetailEntity {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Id
|
|
||||||
*/
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路线id
|
|
||||||
*/
|
|
||||||
private Long routeId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路线名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 排序
|
|
||||||
*/
|
|
||||||
private Integer sort;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建人 Id; sys_user.id
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private Long creatorId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改人 Id; sys_user.id
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private Long modifierId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private LocalDateTime modifyTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否删除; 0-->未删除、1-->已删除
|
|
||||||
*/
|
|
||||||
@TableLogic
|
|
||||||
private Boolean deleted;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,95 +0,0 @@
|
||||||
package com.njzscloud.supervisory.route.pojo;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.experimental.Accessors;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 优惠管理
|
|
||||||
*/
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@Accessors(chain = true)
|
|
||||||
@TableName(value = "biz_route", autoResultMap = true)
|
|
||||||
public class RouteEntity {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Id
|
|
||||||
*/
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 项目id
|
|
||||||
*/
|
|
||||||
private Long projectId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清运公司id
|
|
||||||
*/
|
|
||||||
private Long companyId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 站点id
|
|
||||||
*/
|
|
||||||
private Long stationId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路线名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 起始地
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String startAddress;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 终点地
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String endAddress;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路线详情
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private List<RouteDetailEntity> detailEntityList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建人 Id; sys_user.id
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private Long creatorId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改人 Id; sys_user.id
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private Long modifierId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT)
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改时间
|
|
||||||
*/
|
|
||||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
|
||||||
private LocalDateTime modifyTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 是否删除; 0-->未删除、1-->已删除
|
|
||||||
*/
|
|
||||||
@TableLogic
|
|
||||||
private Boolean deleted;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,42 +0,0 @@
|
||||||
package com.njzscloud.supervisory.route.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
|
||||||
import com.njzscloud.supervisory.route.pojo.RouteDetailEntity;
|
|
||||||
import com.njzscloud.supervisory.route.pojo.RouteEntity;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路线详情管理
|
|
||||||
*/
|
|
||||||
public interface RouteDetailService extends IService<RouteDetailEntity> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*/
|
|
||||||
void add(RouteDetailEntity detailEntity);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改
|
|
||||||
*/
|
|
||||||
void modify(RouteDetailEntity detailEntity);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
void del(List<Long> ids);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*/
|
|
||||||
RouteDetailEntity detail(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*/
|
|
||||||
PageResult<RouteDetailEntity> paging(PageParam pageParam, RouteDetailEntity detailEntity);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
package com.njzscloud.supervisory.route.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
|
||||||
import com.njzscloud.supervisory.route.pojo.RouteEntity;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路线管理
|
|
||||||
*/
|
|
||||||
public interface RouteService extends IService<RouteEntity> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*/
|
|
||||||
void add(RouteEntity routeEntity);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改
|
|
||||||
*/
|
|
||||||
void modify(RouteEntity routeEntity);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
void del(List<Long> ids);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*/
|
|
||||||
RouteEntity detail(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*/
|
|
||||||
PageResult<RouteEntity> paging(PageParam pageParam, RouteEntity routeEntity);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
||||||
package com.njzscloud.supervisory.route.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
|
||||||
import com.njzscloud.supervisory.route.mapper.RouteDetailMapper;
|
|
||||||
import com.njzscloud.supervisory.route.pojo.RouteDetailEntity;
|
|
||||||
import com.njzscloud.supervisory.route.service.RouteDetailService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路线详情管理
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class RouteDetailServiceImpl extends ServiceImpl<RouteDetailMapper, RouteDetailEntity> implements RouteDetailService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void add(RouteDetailEntity detailEntity) {
|
|
||||||
this.save(detailEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void modify(RouteDetailEntity detailEntity) {
|
|
||||||
this.updateById(detailEntity);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void del(List<Long> ids) {
|
|
||||||
this.removeBatchByIds(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public RouteDetailEntity detail(Long id) {
|
|
||||||
return this.getById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public PageResult<RouteDetailEntity> paging(PageParam pageParam, RouteDetailEntity detailEntity) {
|
|
||||||
Page<RouteDetailEntity> page = this.page(pageParam.toPage(), Wrappers.<RouteDetailEntity>lambdaQuery()
|
|
||||||
.eq(StrUtil.isNotBlank(detailEntity.getName()), RouteDetailEntity::getName, detailEntity.getName())
|
|
||||||
.eq(RouteDetailEntity::getDeleted, Boolean.FALSE)
|
|
||||||
.orderByDesc(RouteDetailEntity::getCreateTime));
|
|
||||||
return PageResult.of(page);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,122 +0,0 @@
|
||||||
package com.njzscloud.supervisory.route.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.njzscloud.common.mp.support.PageParam;
|
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
|
||||||
import com.njzscloud.supervisory.order.pojo.entity.OrderExpenseItemsEntity;
|
|
||||||
import com.njzscloud.supervisory.route.mapper.RouteMapper;
|
|
||||||
import com.njzscloud.supervisory.route.pojo.RouteDetailEntity;
|
|
||||||
import com.njzscloud.supervisory.route.pojo.RouteEntity;
|
|
||||||
import com.njzscloud.supervisory.route.service.RouteDetailService;
|
|
||||||
import com.njzscloud.supervisory.route.service.RouteService;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 路线管理
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class RouteServiceImpl extends ServiceImpl<RouteMapper, RouteEntity> implements RouteService {
|
|
||||||
|
|
||||||
private final RouteDetailService routeDetailService;
|
|
||||||
|
|
||||||
private final RouteMapper routeMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void add(RouteEntity routeEntity) {
|
|
||||||
this.save(routeEntity);
|
|
||||||
// 保存详情
|
|
||||||
List<RouteDetailEntity> detailEntityList = routeEntity.getDetailEntityList();
|
|
||||||
if (null != detailEntityList && detailEntityList.size() > 0) {
|
|
||||||
for (RouteDetailEntity detailEntity : detailEntityList) {
|
|
||||||
detailEntity.setRouteId(routeEntity.getId());
|
|
||||||
}
|
|
||||||
routeDetailService.saveBatch(detailEntityList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void modify(RouteEntity routeEntity) {
|
|
||||||
this.updateById(routeEntity);
|
|
||||||
// 删除原有数据,然后直接新增
|
|
||||||
routeDetailService.remove(Wrappers.<RouteDetailEntity>lambdaQuery()
|
|
||||||
.in(RouteDetailEntity::getRouteId, routeEntity.getId()));
|
|
||||||
List<RouteDetailEntity> detailEntityList = routeEntity.getDetailEntityList();
|
|
||||||
if (null != detailEntityList && detailEntityList.size() > 0) {
|
|
||||||
for (RouteDetailEntity detailEntity : detailEntityList) {
|
|
||||||
detailEntity.setRouteId(routeEntity.getId());
|
|
||||||
}
|
|
||||||
routeDetailService.saveBatch(detailEntityList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
|
||||||
public void del(List<Long> ids) {
|
|
||||||
this.removeBatchByIds(ids);
|
|
||||||
for (Long id : ids) {
|
|
||||||
// 删除详细路线
|
|
||||||
routeDetailService.remove(Wrappers.<RouteDetailEntity>lambdaQuery()
|
|
||||||
.in(RouteDetailEntity::getRouteId, id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 详情
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public RouteEntity detail(Long id) {
|
|
||||||
RouteEntity entity = routeMapper.selectDetailById(id);
|
|
||||||
List<RouteDetailEntity> detailEntityList = routeDetailService.list(Wrappers.lambdaQuery(RouteDetailEntity.class)
|
|
||||||
.eq(RouteDetailEntity::getRouteId, entity.getId())
|
|
||||||
.orderByAsc(RouteDetailEntity::getSort));
|
|
||||||
if (null != detailEntityList && detailEntityList.size() > 0) {
|
|
||||||
entity.setDetailEntityList(detailEntityList);
|
|
||||||
}
|
|
||||||
return entity;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public PageResult<RouteEntity> paging(PageParam pageParam, RouteEntity routeEntity) {
|
|
||||||
QueryWrapper<RouteEntity> ew = Wrappers.<RouteEntity>query()
|
|
||||||
.eq("a.deleted", 0)
|
|
||||||
.like(StrUtil.isNotBlank(routeEntity.getName()), "a.name", routeEntity.getName())
|
|
||||||
.eq(null != routeEntity.getCompanyId(), "a.company_id", routeEntity.getCompanyId())
|
|
||||||
.eq(null != routeEntity.getStationId(), "a.station_id", routeEntity.getStationId());
|
|
||||||
IPage<RouteEntity> page = routeMapper.paging(pageParam.toPage(), ew);
|
|
||||||
for (RouteEntity entity : page.getRecords()) {
|
|
||||||
List<RouteDetailEntity> detailEntityList = routeDetailService.list(Wrappers.lambdaQuery(RouteDetailEntity.class)
|
|
||||||
.eq(RouteDetailEntity::getRouteId, entity.getId()).orderByAsc(RouteDetailEntity::getSort));
|
|
||||||
if (null != detailEntityList && detailEntityList.size() > 0) {
|
|
||||||
entity.setDetailEntityList(detailEntityList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return PageResult.of(page);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
<?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.supervisory.route.mapper.RouteMapper">
|
|
||||||
<select id="paging" resultType="com.njzscloud.supervisory.route.pojo.RouteEntity">
|
|
||||||
SELECT
|
|
||||||
a.id,
|
|
||||||
a.project_id,
|
|
||||||
a.company_id,
|
|
||||||
a.station_id,
|
|
||||||
a.name,
|
|
||||||
a.creator_id,
|
|
||||||
a.modifier_id,
|
|
||||||
a.create_time,
|
|
||||||
a.modify_time,
|
|
||||||
a.deleted,
|
|
||||||
b.company_name start_address,
|
|
||||||
c.company_name end_address
|
|
||||||
FROM biz_route a
|
|
||||||
LEFT JOIN biz_company b ON b.id = a.company_id
|
|
||||||
LEFT JOIN biz_company c ON c.id = a.station_id
|
|
||||||
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
|
||||||
${ew.customSqlSegment}
|
|
||||||
</if>
|
|
||||||
ORDER BY a.modify_time DESC
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectDetailById" resultType="com.njzscloud.supervisory.route.pojo.RouteEntity">
|
|
||||||
SELECT a.id,
|
|
||||||
a.project_id,
|
|
||||||
a.company_id,
|
|
||||||
a.station_id,
|
|
||||||
a.name,
|
|
||||||
a.creator_id,
|
|
||||||
a.modifier_id,
|
|
||||||
a.create_time,
|
|
||||||
a.modify_time,
|
|
||||||
a.deleted,
|
|
||||||
b.company_name start_address,
|
|
||||||
c.company_name end_address
|
|
||||||
FROM biz_route a
|
|
||||||
LEFT JOIN biz_company b ON b.id = a.company_id
|
|
||||||
LEFT JOIN biz_company c ON c.id = a.station_id
|
|
||||||
WHERE a.id = #{id}
|
|
||||||
AND a.deleted = 0
|
|
||||||
</select>
|
|
||||||
</mapper>
|
|
||||||
Loading…
Reference in New Issue