创建车辆时同步创建一张该车俩的实时定位表以及订单、客户、路线、仓库、门店的增删改查
parent
507c6ca6bf
commit
d622237213
|
|
@ -2,16 +2,12 @@ package com.cpxt.web.controller.biz;
|
|||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cpxt.common.constant.HttpStatus;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.cpxt.common.annotation.Log;
|
||||
import com.cpxt.common.core.controller.BaseController;
|
||||
import com.cpxt.common.core.domain.AjaxResult;
|
||||
|
|
@ -35,15 +31,31 @@ public class BizCustomerShopController extends BaseController
|
|||
private IBizCustomerShopService bizCustomerShopService;
|
||||
|
||||
/**
|
||||
* 查询门店列表
|
||||
* 查询门店列表(分页)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:shop:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BizCustomerShop bizCustomerShop)
|
||||
public TableDataInfo list(BizCustomerShop bizCustomerShop,
|
||||
@RequestParam(defaultValue = "1") int pageNum,
|
||||
@RequestParam(defaultValue = "10") int pageSize)
|
||||
{
|
||||
startPage();
|
||||
List<BizCustomerShop> list = bizCustomerShopService.selectBizCustomerShopList(bizCustomerShop);
|
||||
return getDataTable(list);
|
||||
Page<BizCustomerShop> recordPage = bizCustomerShopService.selectBizCustomerShopPage(bizCustomerShop,pageNum,pageSize);
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(recordPage.getRecords());
|
||||
rspData.setTotal(recordPage.getTotal());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询门店列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:shop:list')")
|
||||
@GetMapping("/list2")
|
||||
public AjaxResult list(BizCustomerShop bizCustomerShop)
|
||||
{
|
||||
return AjaxResult.success(bizCustomerShopService.selectBizCustomerShopList(bizCustomerShop));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,16 +2,12 @@ package com.cpxt.web.controller.biz;
|
|||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cpxt.common.constant.HttpStatus;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.cpxt.common.annotation.Log;
|
||||
import com.cpxt.common.core.controller.BaseController;
|
||||
import com.cpxt.common.core.domain.AjaxResult;
|
||||
|
|
@ -35,15 +31,31 @@ public class BizCustomerWarehouseController extends BaseController
|
|||
private IBizCustomerWarehouseService bizCustomerWarehouseService;
|
||||
|
||||
/**
|
||||
* 查询仓库列表
|
||||
* 查询仓库列表(分页)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:warehouse:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BizCustomerWarehouse bizCustomerWarehouse)
|
||||
public TableDataInfo list(BizCustomerWarehouse bizCustomerWarehouse,
|
||||
@RequestParam(defaultValue = "1") int pageNum,
|
||||
@RequestParam(defaultValue = "10") int pageSize)
|
||||
{
|
||||
startPage();
|
||||
List<BizCustomerWarehouse> list = bizCustomerWarehouseService.selectBizCustomerWarehouseList(bizCustomerWarehouse);
|
||||
return getDataTable(list);
|
||||
Page<BizCustomerWarehouse> recordPage = bizCustomerWarehouseService.selectBizCustomerWarehousePage(bizCustomerWarehouse,pageNum,pageSize);
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(recordPage.getRecords());
|
||||
rspData.setTotal(recordPage.getTotal());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:warehouse:list')")
|
||||
@GetMapping("/list2")
|
||||
public AjaxResult list(BizCustomerWarehouse bizCustomerWarehouse)
|
||||
{
|
||||
return AjaxResult.success(bizCustomerWarehouseService.selectBizCustomerWarehouseList(bizCustomerWarehouse));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,16 +2,12 @@ package com.cpxt.web.controller.biz;
|
|||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cpxt.common.constant.HttpStatus;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import com.cpxt.common.annotation.Log;
|
||||
import com.cpxt.common.core.controller.BaseController;
|
||||
import com.cpxt.common.core.domain.AjaxResult;
|
||||
|
|
@ -35,15 +31,31 @@ public class BizOrderController extends BaseController
|
|||
private IBizOrderService bizOrderService;
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
* 查询订单列表(分页)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:order:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BizOrder bizOrder)
|
||||
public TableDataInfo list(BizOrder bizOrder,
|
||||
@RequestParam(defaultValue = "1") int pageNum,
|
||||
@RequestParam(defaultValue = "10") int pageSize)
|
||||
{
|
||||
startPage();
|
||||
List<BizOrder> list = bizOrderService.selectBizOrderList(bizOrder);
|
||||
return getDataTable(list);
|
||||
Page<BizOrder> recordPage = bizOrderService.selectBizOrderPage(bizOrder,pageNum,pageSize);
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setRows(recordPage.getRecords());
|
||||
rspData.setTotal(recordPage.getTotal());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('biz:order:list')")
|
||||
@GetMapping("/list2")
|
||||
public AjaxResult list(BizOrder bizOrder)
|
||||
{
|
||||
return AjaxResult.success(bizOrderService.selectBizOrderList(bizOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ public class Constants
|
|||
/**
|
||||
* 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
|
||||
*/
|
||||
public static final String[] JOB_WHITELIST_STR = { "com.cpxt.quartz.task" };
|
||||
public static final String[] JOB_WHITELIST_STR = { "com.cpxt.quartz.task", "com.cpxt.web.task" };
|
||||
|
||||
/**
|
||||
* 定时任务违规的字符
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.cpxt.biz.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.cpxt.common.annotation.Excel;
|
||||
|
|
@ -14,6 +15,7 @@ import java.util.Date;
|
|||
* @author YIN
|
||||
* @date 2024-12-16
|
||||
*/
|
||||
@Data
|
||||
public class BizCustomerRoute
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,13 @@ public interface BizCarMapper extends BaseMapper<BizCar>
|
|||
@Update("create table ${tableName} as select * from track_temp")
|
||||
void createTable(String tableName);
|
||||
|
||||
@Update("ALTER TABLE ${tableName} MODIFY COLUMN id INT NOT NULL AUTO_INCREMENT")
|
||||
void setAutoIncrement(String tableName);
|
||||
|
||||
@Update("ALTER TABLE ${tableName} ADD PRIMARY KEY (id)")
|
||||
void addPrimaryKey(String tableName);
|
||||
|
||||
@Select("select * from biz_car where car_no = #{carNo}")
|
||||
BizCar selectByCarNo(String carNo);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.cpxt.biz.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cpxt.biz.domain.BizCustomerShop;
|
||||
|
||||
/**
|
||||
|
|
@ -58,4 +60,6 @@ public interface IBizCustomerShopService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteBizCustomerShopById(Long id);
|
||||
|
||||
Page<BizCustomerShop> selectBizCustomerShopPage(BizCustomerShop bizCustomerShop, int pageNum, int pageSize);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.cpxt.biz.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cpxt.biz.domain.BizCustomerWarehouse;
|
||||
|
||||
/**
|
||||
|
|
@ -58,4 +60,6 @@ public interface IBizCustomerWarehouseService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteBizCustomerWarehouseById(Long id);
|
||||
|
||||
Page<BizCustomerWarehouse> selectBizCustomerWarehousePage(BizCustomerWarehouse bizCustomerWarehouse, int pageNum, int pageSize);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.cpxt.biz.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cpxt.biz.domain.BizOrder;
|
||||
|
||||
/**
|
||||
|
|
@ -58,4 +60,6 @@ public interface IBizOrderService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteBizOrderById(Long id);
|
||||
|
||||
Page<BizOrder> selectBizOrderPage(BizOrder bizOrder, int pageNum, int pageSize);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,7 +98,9 @@ public class BizCarServiceImpl implements IBizCarService
|
|||
if (i > 0){
|
||||
Long id = bizCar.getId();
|
||||
String tableName = "track_" + id;
|
||||
bizCarMapper.createTable(tableName);
|
||||
bizCarMapper.createTable(tableName); // 创建该车辆的行驶轨迹表
|
||||
bizCarMapper.addPrimaryKey(tableName); // 添加主键
|
||||
bizCarMapper.setAutoIncrement(tableName); // 设置自增
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.cpxt.biz.service.impl;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
|
@ -47,11 +48,26 @@ public class BizCustomerServiceImpl implements IBizCustomerService
|
|||
*/
|
||||
@Override
|
||||
public Page<BizCustomer> selectBizCustomerPage(BizCustomer bizCustomer, int pageNum, int pageSize) {
|
||||
LambdaQueryWrapper<BizCustomer> queryWrapper= new LambdaQueryWrapper<>();
|
||||
|
||||
LambdaQueryWrapper<BizCustomer> queryWrapper = buildQueryWrapper(bizCustomer);
|
||||
return bizCustomerMapper.selectPage(new Page<>(pageNum,pageSize),queryWrapper);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BizCustomer> buildQueryWrapper(BizCustomer bizCustomer) {
|
||||
LambdaQueryWrapper<BizCustomer> queryWrapper= new LambdaQueryWrapper<>();
|
||||
if (ObjectUtil.isNotEmpty(bizCustomer.getName())){
|
||||
queryWrapper.like(BizCustomer::getName, bizCustomer.getName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizCustomer.getLinkman())){
|
||||
queryWrapper.like(BizCustomer::getLinkman, bizCustomer.getLinkman());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizCustomer.getLinkphone())){
|
||||
queryWrapper.like(BizCustomer::getLinkphone, bizCustomer.getLinkphone());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizCustomer.getLevel())){
|
||||
queryWrapper.eq(BizCustomer::getLevel, bizCustomer.getLevel());
|
||||
}
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询客户列表
|
||||
|
|
@ -62,8 +78,7 @@ public class BizCustomerServiceImpl implements IBizCustomerService
|
|||
@Override
|
||||
public List<BizCustomer> selectBizCustomerList(BizCustomer bizCustomer)
|
||||
{
|
||||
LambdaQueryWrapper<BizCustomer> queryWrapper= new LambdaQueryWrapper<>();
|
||||
|
||||
LambdaQueryWrapper<BizCustomer> queryWrapper = buildQueryWrapper(bizCustomer);
|
||||
return bizCustomerMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@ package com.cpxt.biz.service.impl;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cpxt.biz.domain.BizCustomerRoute;
|
||||
import com.cpxt.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -37,6 +39,18 @@ public class BizCustomerShopServiceImpl implements IBizCustomerShopService
|
|||
return bizCustomerShopMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询门店列表(分页)
|
||||
*
|
||||
* @param bizCustomerShop 门店
|
||||
* @return 门店
|
||||
*/
|
||||
@Override
|
||||
public Page<BizCustomerShop> selectBizCustomerShopPage(BizCustomerShop bizCustomerShop, int pageNum, int pageSize) {
|
||||
LambdaQueryWrapper<BizCustomerShop> queryWrapper = buildQueryWrapper(bizCustomerShop);
|
||||
return bizCustomerShopMapper.selectPage(new Page<>(pageNum,pageSize),queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询门店列表
|
||||
*
|
||||
|
|
@ -46,10 +60,27 @@ public class BizCustomerShopServiceImpl implements IBizCustomerShopService
|
|||
@Override
|
||||
public List<BizCustomerShop> selectBizCustomerShopList(BizCustomerShop bizCustomerShop)
|
||||
{
|
||||
LambdaQueryWrapper<BizCustomerShop> queryWrapper = new LambdaQueryWrapper<>();
|
||||
LambdaQueryWrapper<BizCustomerShop> queryWrapper = buildQueryWrapper(bizCustomerShop);
|
||||
return bizCustomerShopMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BizCustomerShop> buildQueryWrapper(BizCustomerShop bizCustomerShop) {
|
||||
LambdaQueryWrapper<BizCustomerShop> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (ObjectUtil.isNotEmpty(bizCustomerShop.getCustomerName())){
|
||||
queryWrapper.like(BizCustomerShop::getCustomerName, bizCustomerShop.getCustomerName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizCustomerShop.getName())){
|
||||
queryWrapper.like(BizCustomerShop::getName, bizCustomerShop.getName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizCustomerShop.getAddress())){
|
||||
queryWrapper.like(BizCustomerShop::getAddress, bizCustomerShop.getAddress());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizCustomerShop.getLinkphone())){
|
||||
queryWrapper.like(BizCustomerShop::getLinkphone, bizCustomerShop.getLinkphone());
|
||||
}
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增门店
|
||||
*
|
||||
|
|
@ -103,4 +134,6 @@ public class BizCustomerShopServiceImpl implements IBizCustomerShopService
|
|||
updateWrapper.set("status","2"); //状态改为删除
|
||||
return bizCustomerShopMapper.update(null,updateWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,8 +3,10 @@ package com.cpxt.biz.service.impl;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cpxt.biz.domain.BizCustomerUser;
|
||||
import com.cpxt.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -37,6 +39,18 @@ public class BizCustomerWarehouseServiceImpl implements IBizCustomerWarehouseSer
|
|||
return bizCustomerWarehouseMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库列表(分页)
|
||||
*
|
||||
* @param bizCustomerWarehouse 仓库
|
||||
* @return 仓库
|
||||
*/
|
||||
@Override
|
||||
public Page<BizCustomerWarehouse> selectBizCustomerWarehousePage(BizCustomerWarehouse bizCustomerWarehouse, int pageNum, int pageSize) {
|
||||
LambdaQueryWrapper<BizCustomerWarehouse> queryWrapper = buildQueryWrapper(bizCustomerWarehouse);
|
||||
return bizCustomerWarehouseMapper.selectPage(new Page<>(pageNum,pageSize),queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询仓库列表
|
||||
*
|
||||
|
|
@ -46,11 +60,30 @@ public class BizCustomerWarehouseServiceImpl implements IBizCustomerWarehouseSer
|
|||
@Override
|
||||
public List<BizCustomerWarehouse> selectBizCustomerWarehouseList(BizCustomerWarehouse bizCustomerWarehouse)
|
||||
{
|
||||
LambdaQueryWrapper<BizCustomerWarehouse> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
LambdaQueryWrapper<BizCustomerWarehouse> queryWrapper = buildQueryWrapper(bizCustomerWarehouse);
|
||||
return bizCustomerWarehouseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BizCustomerWarehouse> buildQueryWrapper(BizCustomerWarehouse bizCustomerWarehouse) {
|
||||
LambdaQueryWrapper<BizCustomerWarehouse> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (ObjectUtil.isNotEmpty(bizCustomerWarehouse.getCustomerName())){
|
||||
queryWrapper.like(BizCustomerWarehouse::getCustomerName, bizCustomerWarehouse.getCustomerName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizCustomerWarehouse.getName())){
|
||||
queryWrapper.like(BizCustomerWarehouse::getName, bizCustomerWarehouse.getName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizCustomerWarehouse.getLinkman())){
|
||||
queryWrapper.like(BizCustomerWarehouse::getLinkman, bizCustomerWarehouse.getLinkman());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizCustomerWarehouse.getLinkphone())){
|
||||
queryWrapper.like(BizCustomerWarehouse::getLinkphone, bizCustomerWarehouse.getLinkphone());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizCustomerWarehouse.getAddress())){
|
||||
queryWrapper.like(BizCustomerWarehouse::getAddress, bizCustomerWarehouse.getAddress());
|
||||
}
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增仓库
|
||||
*
|
||||
|
|
@ -104,4 +137,6 @@ public class BizCustomerWarehouseServiceImpl implements IBizCustomerWarehouseSer
|
|||
updateWrapper.set("status","2"); //状态改为删除
|
||||
return bizCustomerWarehouseMapper.update(null,updateWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,13 +3,14 @@ package com.cpxt.biz.service.impl;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.cpxt.biz.domain.BizDriver;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cpxt.biz.domain.*;
|
||||
import com.cpxt.biz.mapper.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.cpxt.biz.mapper.BizOrderMapper;
|
||||
import com.cpxt.biz.domain.BizOrder;
|
||||
import com.cpxt.biz.service.IBizOrderService;
|
||||
|
||||
/**
|
||||
|
|
@ -24,6 +25,24 @@ public class BizOrderServiceImpl implements IBizOrderService
|
|||
@Autowired
|
||||
private BizOrderMapper bizOrderMapper;
|
||||
|
||||
@Autowired
|
||||
private BizCustomerMapper bizCustomerMapper;
|
||||
|
||||
@Autowired
|
||||
private BizCustomerRouteMapper bizCustomerRouteMapper;
|
||||
|
||||
@Autowired
|
||||
private BizCustomerWarehouseMapper bizCustomerWarehouseMapper;
|
||||
|
||||
@Autowired
|
||||
private BizCustomerShopMapper bizCustomerShopMapper;
|
||||
|
||||
@Autowired
|
||||
private BizCarMapper bizCarMapper;
|
||||
|
||||
@Autowired
|
||||
private BizDriverMapper bizDriverMapper;
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
|
|
@ -36,6 +55,18 @@ public class BizOrderServiceImpl implements IBizOrderService
|
|||
return bizOrderMapper.selectById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表(分页)
|
||||
*
|
||||
* @param bizOrder 订单
|
||||
* @return 订单
|
||||
*/
|
||||
@Override
|
||||
public Page<BizOrder> selectBizOrderPage(BizOrder bizOrder, int pageNum, int pageSize) {
|
||||
LambdaQueryWrapper<BizOrder> queryWrapper = buildQueryWrapper(bizOrder);
|
||||
return bizOrderMapper.selectPage(new Page<>(pageNum,pageSize),queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*
|
||||
|
|
@ -45,11 +76,186 @@ public class BizOrderServiceImpl implements IBizOrderService
|
|||
@Override
|
||||
public List<BizOrder> selectBizOrderList(BizOrder bizOrder)
|
||||
{
|
||||
LambdaQueryWrapper<BizOrder> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
LambdaQueryWrapper<BizOrder> queryWrapper = buildQueryWrapper(bizOrder);
|
||||
return bizOrderMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<BizOrder> buildQueryWrapper(BizOrder bizOrder) {
|
||||
LambdaQueryWrapper<BizOrder> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getOrderSn())){
|
||||
queryWrapper.like(BizOrder::getOrderSn, bizOrder.getOrderSn());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getOrderStatus())){
|
||||
queryWrapper.eq(BizOrder::getOrderStatus, bizOrder.getOrderStatus());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getOrderType())){
|
||||
queryWrapper.eq(BizOrder::getOrderType, bizOrder.getOrderType());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getCustomerId())){
|
||||
queryWrapper.eq(BizOrder::getCustomerId, bizOrder.getCustomerId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getCustomerName())){
|
||||
queryWrapper.like(BizOrder::getCustomerName, bizOrder.getCustomerName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getRouteId())){
|
||||
queryWrapper.eq(BizOrder::getRouteId, bizOrder.getRouteId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getRouteName())){
|
||||
queryWrapper.like(BizOrder::getRouteName, bizOrder.getRouteName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getWarehouseId())){
|
||||
queryWrapper.eq(BizOrder::getWarehouseId, bizOrder.getWarehouseId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getWarehouseName())){
|
||||
queryWrapper.like(BizOrder::getWarehouseName, bizOrder.getWarehouseName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getShopId())){
|
||||
queryWrapper.eq(BizOrder::getShopId, bizOrder.getShopId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getShopName())){
|
||||
queryWrapper.like(BizOrder::getShopName, bizOrder.getShopName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getCarId())){
|
||||
queryWrapper.eq(BizOrder::getCarId, bizOrder.getCarId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getCarNo())){
|
||||
queryWrapper.like(BizOrder::getCarNo, bizOrder.getCarNo());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getDriverId())){
|
||||
queryWrapper.eq(BizOrder::getDriverId, bizOrder.getDriverId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getDriverName())){
|
||||
queryWrapper.like(BizOrder::getDriverName, bizOrder.getDriverName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getCopilotId())){
|
||||
queryWrapper.eq(BizOrder::getCopilotId, bizOrder.getCopilotId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getCopilotName())){
|
||||
queryWrapper.like(BizOrder::getCopilotName, bizOrder.getCopilotName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getSenderName())){
|
||||
queryWrapper.like(BizOrder::getSenderName, bizOrder.getSenderName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getSenderLinkman())){
|
||||
queryWrapper.like(BizOrder::getSenderLinkman, bizOrder.getSenderLinkman());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getSenderPhone())){
|
||||
queryWrapper.like(BizOrder::getSenderPhone, bizOrder.getSenderPhone());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getSenderAddress())){
|
||||
queryWrapper.like(BizOrder::getSenderAddress, bizOrder.getSenderAddress());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getSenderLng())){
|
||||
queryWrapper.eq(BizOrder::getSenderLng, bizOrder.getSenderLng());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getSenderLat())){
|
||||
queryWrapper.eq(BizOrder::getSenderLat, bizOrder.getSenderLat());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getSenderCompany())){
|
||||
queryWrapper.like(BizOrder::getSenderCompany, bizOrder.getSenderCompany());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getReceiverName())){
|
||||
queryWrapper.like(BizOrder::getReceiverName, bizOrder.getReceiverName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getReceiverLinkman())){
|
||||
queryWrapper.like(BizOrder::getReceiverLinkman, bizOrder.getReceiverLinkman());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getReceiverPhone())){
|
||||
queryWrapper.like(BizOrder::getReceiverPhone, bizOrder.getReceiverPhone());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getReceiverAddress())){
|
||||
queryWrapper.like(BizOrder::getReceiverAddress, bizOrder.getReceiverAddress());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getReceiverLng())){
|
||||
queryWrapper.eq(BizOrder::getReceiverLng, bizOrder.getReceiverLng());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getReceiverLat())){
|
||||
queryWrapper.eq(BizOrder::getReceiverLat, bizOrder.getReceiverLat());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getReceiverCompany())){
|
||||
queryWrapper.like(BizOrder::getReceiverCompany, bizOrder.getReceiverCompany());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getGoodsType())){
|
||||
queryWrapper.eq(BizOrder::getGoodsType, bizOrder.getGoodsType());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getGoodsName())){
|
||||
queryWrapper.like(BizOrder::getGoodsName, bizOrder.getGoodsName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getWeight())){
|
||||
queryWrapper.eq(BizOrder::getWeight, bizOrder.getWeight());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getVolume())){
|
||||
queryWrapper.eq(BizOrder::getVolume, bizOrder.getVolume());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getLength())){
|
||||
queryWrapper.eq(BizOrder::getLength, bizOrder.getLength());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getWidth())){
|
||||
queryWrapper.eq(BizOrder::getWidth, bizOrder.getWidth());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getHeight())){
|
||||
queryWrapper.eq(BizOrder::getHeight, bizOrder.getHeight());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getTotalQuantity())){
|
||||
queryWrapper.eq(BizOrder::getTotalQuantity, bizOrder.getTotalQuantity());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getInsured())){
|
||||
queryWrapper.eq(BizOrder::getInsured, bizOrder.getInsured());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getInsuredMoney())){
|
||||
queryWrapper.eq(BizOrder::getInsuredMoney, bizOrder.getInsuredMoney());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getInsuredFee())){
|
||||
queryWrapper.eq(BizOrder::getInsuredFee, bizOrder.getInsuredFee());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getOrderFee())){
|
||||
queryWrapper.eq(BizOrder::getOrderFee, bizOrder.getOrderFee());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getIsCancel())){
|
||||
queryWrapper.eq(BizOrder::getIsCancel, bizOrder.getIsCancel());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getCancelReason())){
|
||||
queryWrapper.like(BizOrder::getCancelReason, bizOrder.getCancelReason());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getCancelTime())){
|
||||
queryWrapper.like(BizOrder::getCancelTime, bizOrder.getCancelTime());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getPayType())){
|
||||
queryWrapper.eq(BizOrder::getPayType, bizOrder.getPayType());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getPayMode())){
|
||||
queryWrapper.eq(BizOrder::getPayMode, bizOrder.getPayMode());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getPayId())){
|
||||
queryWrapper.eq(BizOrder::getPayId, bizOrder.getPayId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getPayStatus())){
|
||||
queryWrapper.eq(BizOrder::getPayStatus, bizOrder.getPayStatus());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getPayTime())){
|
||||
queryWrapper.like(BizOrder::getPayTime, bizOrder.getPayTime());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getStatus())){
|
||||
queryWrapper.eq(BizOrder::getStatus, bizOrder.getStatus());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getStartTime())){
|
||||
queryWrapper.like(BizOrder::getStartTime, bizOrder.getStartTime());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getArriveTime())){
|
||||
queryWrapper.like(BizOrder::getArriveTime, bizOrder.getArriveTime());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getArriveRemark())){
|
||||
queryWrapper.like(BizOrder::getArriveRemark, bizOrder.getArriveRemark());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getArriveLng())){
|
||||
queryWrapper.eq(BizOrder::getArriveLng, bizOrder.getArriveLng());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(bizOrder.getArriveLat())){
|
||||
queryWrapper.eq(BizOrder::getArriveLat, bizOrder.getArriveLat());
|
||||
}
|
||||
return queryWrapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
|
|
@ -59,6 +265,21 @@ public class BizOrderServiceImpl implements IBizOrderService
|
|||
@Override
|
||||
public int insertBizOrder(BizOrder bizOrder)
|
||||
{
|
||||
Long customerId = bizOrder.getCustomerId(); // 客户id
|
||||
Long routeId = bizOrder.getRouteId(); // 路线id
|
||||
Long warehouseId = bizOrder.getWarehouseId(); // 仓库id
|
||||
Long shopId = bizOrder.getShopId(); // 店铺id
|
||||
Long carId = bizOrder.getCarId(); // 配送车辆id
|
||||
Long driverId = bizOrder.getDriverId(); // 配送司机id
|
||||
Long copilotId = bizOrder.getCopilotId(); // 副驾司机id
|
||||
|
||||
bizOrder.setCustomerName(bizCustomerMapper.selectById(customerId).getName());
|
||||
bizOrder.setRouteName(bizCustomerRouteMapper.selectById(routeId).getName());
|
||||
bizOrder.setWarehouseName(bizCustomerWarehouseMapper.selectById(warehouseId).getName());
|
||||
bizOrder.setShopName(bizCustomerShopMapper.selectById(shopId).getName());
|
||||
bizOrder.setCarNo(bizCarMapper.selectById(carId).getCarNo());
|
||||
bizOrder.setDriverName(bizDriverMapper.selectById(driverId).getName());
|
||||
bizOrder.setCopilotName(bizDriverMapper.selectById(copilotId).getName());
|
||||
return bizOrderMapper.insert(bizOrder);
|
||||
}
|
||||
|
||||
|
|
@ -103,4 +324,5 @@ public class BizOrderServiceImpl implements IBizOrderService
|
|||
updateWrapper.set("status","2"); //状态改为删除
|
||||
return bizOrderMapper.update(null,updateWrapper);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue