Compare commits
2 Commits
635226f888
...
1fb39e73bf
| Author | SHA1 | Date |
|---|---|---|
|
|
1fb39e73bf | |
|
|
082ac0481e |
|
|
@ -74,7 +74,6 @@ public class BizDriverClockController extends BaseController
|
|||
/**
|
||||
* 新增司机打卡记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:clock:add')")
|
||||
@Log(title = "司机打卡记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BizDriverClock bizDriverClock)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
package com.cpxt.web.controller.biz;
|
||||
|
||||
import com.cpxt.biz.domain.BizCar;
|
||||
import com.cpxt.biz.domain.BizDriverState;
|
||||
import com.cpxt.biz.service.BizDriverStateService;
|
||||
import com.cpxt.common.annotation.Log;
|
||||
import com.cpxt.common.core.domain.AjaxResult;
|
||||
import com.cpxt.common.enums.BusinessType;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/biz/driver/state")
|
||||
public class BizDriverStateController {
|
||||
|
||||
@Autowired
|
||||
private BizDriverStateService bizDriverStateService;
|
||||
|
||||
/**
|
||||
* 新增司机轨迹
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
@Transactional
|
||||
public AjaxResult add(@RequestBody BizDriverState bizDriverState)
|
||||
{
|
||||
// 同步新增到司机对应的轨迹表中
|
||||
bizDriverStateService.insertDriveDriveState(bizDriverState);
|
||||
bizDriverState.setId(null);
|
||||
return AjaxResult.success(bizDriverStateService.save(bizDriverState));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +1,20 @@
|
|||
package com.cpxt.web.controller.biz;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Queue;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.cpxt.biz.domain.*;
|
||||
import com.cpxt.biz.domain.vo.BizCustomerRouteVo;
|
||||
import com.cpxt.biz.domain.vo.BizOrderSubVo;
|
||||
import com.cpxt.biz.domain.vo.BizOrderVo;
|
||||
import com.cpxt.biz.domain.vo.BizOrderVoCustomer;
|
||||
import com.cpxt.biz.mapper.*;
|
||||
|
|
@ -23,6 +28,7 @@ import org.apache.poi.ss.usermodel.Row;
|
|||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -65,6 +71,12 @@ public class BizOrderController extends BaseController {
|
|||
@Autowired
|
||||
private SysDictDataMapper sysDictDataMapper;
|
||||
|
||||
@Autowired
|
||||
private BizOrderMapper bizOrderMapper;
|
||||
|
||||
@Autowired
|
||||
private BizOrderSubMapper bizOrderSubMapper;
|
||||
|
||||
/**
|
||||
* 查询订单列表(分页)
|
||||
*/
|
||||
|
|
@ -271,9 +283,81 @@ public class BizOrderController extends BaseController {
|
|||
@Log(title = "订单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BizOrder bizOrder) {
|
||||
List<BizOrder> list = bizOrderService.selectBizOrderList(bizOrder);
|
||||
ExcelUtil<BizOrder> util = new ExcelUtil<BizOrder>(BizOrder.class);
|
||||
util.exportExcel(response, list, "订单数据");
|
||||
List<Long> importIdList = bizOrder.getImportIdList();
|
||||
if (bizOrder.getImportType().equals("1")){
|
||||
// 导出订单
|
||||
if (importIdList != null && importIdList.size() != 0){
|
||||
// 导出选中订单
|
||||
LambdaQueryWrapper<BizOrder> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(BizOrder::getId,importIdList);
|
||||
List<BizOrder> list = bizOrderMapper.selectList(queryWrapper);
|
||||
ExcelUtil<BizOrder> util = new ExcelUtil<BizOrder>(BizOrder.class);
|
||||
util.exportExcel(response, list, "订单数据");
|
||||
}else {
|
||||
// 导出当前条件订单
|
||||
List<BizOrder> list = bizOrderService.selectBizOrderList(bizOrder);
|
||||
ExcelUtil<BizOrder> util = new ExcelUtil<BizOrder>(BizOrder.class);
|
||||
util.exportExcel(response, list, "订单数据");
|
||||
}
|
||||
}else {
|
||||
// 导出该订单下的运单
|
||||
if (importIdList != null && importIdList.size() != 0){
|
||||
// 导出选中订单下的运单
|
||||
LambdaQueryWrapper<BizOrder> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(BizOrder::getId,importIdList);
|
||||
List<BizOrder> list = bizOrderMapper.selectList(queryWrapper);
|
||||
List<String> orderSnList = list.stream().map(BizOrder::getOrderSn).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<BizOrderSub> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||
queryWrapper1.in(BizOrderSub::getOrderSn,orderSnList);
|
||||
List<BizOrderSub> bizOrderSubList = bizOrderSubMapper.selectList(queryWrapper1);
|
||||
List<BizOrderSubVo> bizOrderSubVoList = new ArrayList<>();
|
||||
for (BizOrderSub bizOrderSub : bizOrderSubList) {
|
||||
BizOrder bizOrder1 = bizOrderMapper.selectByOrderSn(bizOrderSub.getOrderSn());
|
||||
BizOrderSubVo bizOrderSubVo = new BizOrderSubVo();
|
||||
BeanUtils.copyProperties(bizOrder1,bizOrderSubVo);
|
||||
bizOrderSubVo.setSubOrderSn(bizOrderSub.getSubOrderSn());
|
||||
bizOrderSubVo.setSubWeight(bizOrderSub.getWeight());
|
||||
bizOrderSubVo.setSubVolume(bizOrderSub.getVolume());
|
||||
bizOrderSubVo.setSubLength(bizOrderSub.getLength());
|
||||
bizOrderSubVo.setSubWidth(bizOrderSub.getWidth());
|
||||
bizOrderSubVo.setSubHeight(bizOrderSub.getHeight());
|
||||
bizOrderSubVo.setSubGoodsType(bizOrderSub.getGoodsType());
|
||||
bizOrderSubVo.setSubGoodsName(bizOrderSub.getGoodsName());
|
||||
bizOrderSubVo.setSubOrderFee(bizOrderSub.getOrderFee());
|
||||
bizOrderSubVo.setSubRemark(bizOrderSub.getRemark());
|
||||
bizOrderSubVoList.add(bizOrderSubVo);
|
||||
}
|
||||
ExcelUtil<BizOrderSubVo> util = new ExcelUtil<BizOrderSubVo>(BizOrderSubVo.class);
|
||||
util.exportExcel(response, bizOrderSubVoList, "订单及运单数据");
|
||||
}else {
|
||||
// 导出当前条件下订单的运单
|
||||
List<BizOrder> list = bizOrderService.selectBizOrderList(bizOrder);
|
||||
List<String> orderSnList = list.stream().map(BizOrder::getOrderSn).collect(Collectors.toList());
|
||||
LambdaQueryWrapper<BizOrderSub> queryWrapper1 = new LambdaQueryWrapper<>();
|
||||
queryWrapper1.in(BizOrderSub::getOrderSn,orderSnList);
|
||||
List<BizOrderSub> bizOrderSubList = bizOrderSubMapper.selectList(queryWrapper1);
|
||||
List<BizOrderSubVo> bizOrderSubVoList = new ArrayList<>();
|
||||
for (BizOrderSub bizOrderSub : bizOrderSubList) {
|
||||
BizOrder bizOrder1 = bizOrderMapper.selectByOrderSn(bizOrderSub.getOrderSn());
|
||||
BizOrderSubVo bizOrderSubVo = new BizOrderSubVo();
|
||||
BeanUtils.copyProperties(bizOrder1,bizOrderSubVo);
|
||||
bizOrderSubVo.setSubOrderSn(bizOrderSub.getSubOrderSn());
|
||||
bizOrderSubVo.setSubWeight(bizOrderSub.getWeight());
|
||||
bizOrderSubVo.setSubVolume(bizOrderSub.getVolume());
|
||||
bizOrderSubVo.setSubLength(bizOrderSub.getLength());
|
||||
bizOrderSubVo.setSubWidth(bizOrderSub.getWidth());
|
||||
bizOrderSubVo.setSubHeight(bizOrderSub.getHeight());
|
||||
bizOrderSubVo.setSubGoodsType(bizOrderSub.getGoodsType());
|
||||
bizOrderSubVo.setSubGoodsName(bizOrderSub.getGoodsName());
|
||||
bizOrderSubVo.setSubOrderFee(bizOrderSub.getOrderFee());
|
||||
bizOrderSubVo.setSubRemark(bizOrderSub.getRemark());
|
||||
bizOrderSubVoList.add(bizOrderSubVo);
|
||||
}
|
||||
ExcelUtil<BizOrderSubVo> util = new ExcelUtil<BizOrderSubVo>(BizOrderSubVo.class);
|
||||
util.exportExcel(response, bizOrderSubVoList, "订单及运单数据");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@ public class LargeScreenController extends BaseController {
|
|||
@Autowired
|
||||
private BizCustomerRouteMapper bizCustomerRouteMapper;
|
||||
|
||||
@Autowired
|
||||
private StatCarMapper statCarMapper;
|
||||
|
||||
@Autowired
|
||||
private BizCustomerWarehouseMapper bizCustomerWarehouseMapper;
|
||||
|
||||
|
|
@ -188,41 +191,39 @@ public class LargeScreenController extends BaseController {
|
|||
}
|
||||
|
||||
/**
|
||||
* 近30天配送距离top5
|
||||
* 近30天配送里程top5(人)
|
||||
*/
|
||||
@GetMapping("/driver/deliveryDistanceTop5")
|
||||
public AjaxResult deliveryDistanceTop5()
|
||||
public AjaxResult deliveryDistanceTop5Driver()
|
||||
{
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
DateTime offset = DateUtil.offset(new Date(), DateField.MONTH, -1);
|
||||
DateTime dateTime = DateUtil.beginOfDay(offset);
|
||||
String startTime = DateUtil.format(dateTime, DateUtils.YYYY_MM_DD_HH_MM_SS);
|
||||
String endTime = DateUtil.format(new Date(),DateUtils.YYYY_MM_DD_HH_MM_SS);
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
List<String> driverNameList = bizDriverMapper.selectDriverName();
|
||||
Map<String,Double> map = new HashMap<>();
|
||||
for (String driverName : driverNameList) {
|
||||
LambdaQueryWrapper<BizOrder> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(BizOrder::getStatus,1);
|
||||
queryWrapper.ne(BizOrder::getOrderStatus,"3");
|
||||
queryWrapper.and(wq -> wq.eq(BizOrder::getDriverName,driverName).or().eq(BizOrder::getCopilotName,driverName));
|
||||
queryWrapper.ge(BizOrder::getCreateTime,startTime);
|
||||
queryWrapper.le(BizOrder::getCreateTime,endTime);
|
||||
Double distance = bizOrderMapper.selectSumDistance(queryWrapper);
|
||||
if (distance == null){
|
||||
map.put(driverName, (double) 0);
|
||||
}else {
|
||||
map.put(driverName,distance);
|
||||
}
|
||||
}
|
||||
// 倒序
|
||||
List<Map.Entry<String, Double>> entries = new ArrayList<>(map.entrySet());
|
||||
entries.sort(Map.Entry.<String, Double>comparingByValue().reversed());
|
||||
// 取前5个
|
||||
List<Map.Entry<String, Double>> deliveryDistanceTop5 = entries.stream().limit(5).collect(Collectors.toList());
|
||||
String startTime = DateUtil.format(dateTime, DateUtils.YYYY_MM_DD);
|
||||
String endTime = DateUtil.format(new Date(),DateUtils.YYYY_MM_DD);
|
||||
|
||||
// 使用Stream API提取所有的键和值
|
||||
List<String> keyList = deliveryDistanceTop5.stream().map(Map.Entry::getKey).collect(Collectors.toList());
|
||||
List<Double> valueList = deliveryDistanceTop5.stream().map(Map.Entry::getValue).collect(Collectors.toList());
|
||||
List<String> keyList = statCarMapper.selectOdometerTop5CarNo(startTime,endTime);
|
||||
List<Double> valueList = statCarMapper.selectOdometerTop5Odometer(startTime,endTime);
|
||||
result.put("keys",keyList);
|
||||
result.put("values",valueList);
|
||||
largeScreenEntity.setDeliveryDistanceTop5(result);
|
||||
return AjaxResult.success(largeScreenEntity);
|
||||
}
|
||||
|
||||
/**
|
||||
* 近30天配送里程top5(车辆)
|
||||
*/
|
||||
@GetMapping("/car/deliveryDistanceTop5")
|
||||
public AjaxResult deliveryDistanceTop5Car()
|
||||
{
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
DateTime offset = DateUtil.offset(new Date(), DateField.MONTH, -1);
|
||||
DateTime dateTime = DateUtil.beginOfDay(offset);
|
||||
String startTime = DateUtil.format(dateTime, DateUtils.YYYY_MM_DD);
|
||||
String endTime = DateUtil.format(new Date(),DateUtils.YYYY_MM_DD);
|
||||
|
||||
List<String> keyList = statCarMapper.selectOdometerTop5CarNo(startTime,endTime);
|
||||
List<Double> valueList = statCarMapper.selectOdometerTop5Odometer(startTime,endTime);
|
||||
result.put("keys",keyList);
|
||||
result.put("values",valueList);
|
||||
largeScreenEntity.setDeliveryDistanceTop5(result);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class GetLocationTask {
|
|||
if (!Helper.NStr(info.getGpsTime()).equals(""))
|
||||
newstate.setGpsTime(DateUtils.parseDate(Helper.NStr(info.getGpsTime()).replace(".0","")));
|
||||
newstate.setSpeed(Helper.FLong(info.getSpeed()));
|
||||
newstate.setOdometer(new BigDecimal(Helper.FDouble(info.getOdometer())) );
|
||||
newstate.setOdometer(BigDecimal.valueOf(Helper.FDouble(info.getOdometer())));
|
||||
newstate.setLat(info.getLat02());
|
||||
newstate.setLon(info.getLon02());
|
||||
newstate.setDirection(Helper.FInt(info.getDirection()));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,116 @@
|
|||
package com.cpxt.biz.domain;
|
||||
|
||||
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.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 司机定位状态
|
||||
* @TableName biz_driver_state
|
||||
*/
|
||||
@TableName(value ="biz_driver_state")
|
||||
@Data
|
||||
public class BizDriverState implements Serializable {
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
/**
|
||||
* 司机ID
|
||||
*/
|
||||
private Integer driverId;
|
||||
|
||||
/**
|
||||
* 司机姓名
|
||||
*/
|
||||
private String driverName;
|
||||
|
||||
/**
|
||||
* 定位设备ID
|
||||
*/
|
||||
private String vin;
|
||||
|
||||
/**
|
||||
* 定位时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date gpsTime;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private BigDecimal lat;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private BigDecimal lng;
|
||||
|
||||
/**
|
||||
* 速度
|
||||
*/
|
||||
private Double speed;
|
||||
|
||||
/**
|
||||
* 方向
|
||||
*/
|
||||
private Integer direction;
|
||||
|
||||
/**
|
||||
* 位置名称
|
||||
*/
|
||||
private String placeName;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String provice;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 区
|
||||
*/
|
||||
private String district;
|
||||
|
||||
/**
|
||||
* 路名信息
|
||||
*/
|
||||
private String roadName;
|
||||
|
||||
/**
|
||||
* 地标名称
|
||||
*/
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 海拔高度 单位 米
|
||||
*/
|
||||
private Double height;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
@TableField(exist = false)
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@ package com.cpxt.biz.domain;
|
|||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
|
|
@ -30,15 +31,15 @@ public class BizOrder
|
|||
private String orderSn;
|
||||
|
||||
/** 订单状态 */
|
||||
@Excel(name = "订单状态")
|
||||
@Excel(name = "订单状态",dictType = "sys_order_status")
|
||||
private String orderStatus;
|
||||
|
||||
/** 订单类型 */
|
||||
@Excel(name = "订单类型")
|
||||
@Excel(name = "订单类型",dictType = "sys_order_type")
|
||||
private String orderType;
|
||||
|
||||
/** 客户ID */
|
||||
@Excel(name = "客户ID")
|
||||
// @Excel(name = "客户ID")
|
||||
private Long customerId;
|
||||
|
||||
/** 客户名称 */
|
||||
|
|
@ -46,7 +47,7 @@ public class BizOrder
|
|||
private String customerName;
|
||||
|
||||
/** 路线ID */
|
||||
@Excel(name = "路线ID")
|
||||
// @Excel(name = "路线ID")
|
||||
private Long routeId;
|
||||
|
||||
/** 路线名称 */
|
||||
|
|
@ -54,7 +55,7 @@ public class BizOrder
|
|||
private String routeName;
|
||||
|
||||
/** 仓库ID */
|
||||
@Excel(name = "仓库ID")
|
||||
// @Excel(name = "仓库ID")
|
||||
private Long warehouseId;
|
||||
|
||||
/** 仓库名称 */
|
||||
|
|
@ -62,7 +63,7 @@ public class BizOrder
|
|||
private String warehouseName;
|
||||
|
||||
/** 店铺ID */
|
||||
@Excel(name = "店铺ID")
|
||||
// @Excel(name = "店铺ID")
|
||||
private Long shopId;
|
||||
|
||||
/** 店铺名称 */
|
||||
|
|
@ -70,7 +71,7 @@ public class BizOrder
|
|||
private String shopName;
|
||||
|
||||
/** 配送车辆ID */
|
||||
@Excel(name = "配送车辆ID")
|
||||
// @Excel(name = "配送车辆ID")
|
||||
private Long carId;
|
||||
|
||||
/** 配送车牌号 */
|
||||
|
|
@ -78,7 +79,7 @@ public class BizOrder
|
|||
private String carNo;
|
||||
|
||||
/** 配送司机ID */
|
||||
@Excel(name = "配送司机ID")
|
||||
// @Excel(name = "配送司机ID")
|
||||
private Long driverId;
|
||||
|
||||
/** 配送司机名称 */
|
||||
|
|
@ -86,7 +87,7 @@ public class BizOrder
|
|||
private String driverName;
|
||||
|
||||
/** 副驾司机ID */
|
||||
@Excel(name = "副驾司机ID")
|
||||
// @Excel(name = "副驾司机ID")
|
||||
private Long copilotId;
|
||||
|
||||
/** 副驾司机名称 */
|
||||
|
|
@ -106,7 +107,7 @@ public class BizOrder
|
|||
private String senderPhone;
|
||||
|
||||
/** 发件人所属地区 */
|
||||
@Excel(name = "发件人所属地区")
|
||||
// @Excel(name = "发件人所属地区")
|
||||
private String senderArea;
|
||||
|
||||
/** 发件人地址 */
|
||||
|
|
@ -114,11 +115,11 @@ public class BizOrder
|
|||
private String senderAddress;
|
||||
|
||||
/** 发件人经度 */
|
||||
@Excel(name = "发件人经度")
|
||||
// @Excel(name = "发件人经度")
|
||||
private BigDecimal senderLng;
|
||||
|
||||
/** 发件人纬度 */
|
||||
@Excel(name = "发件人纬度")
|
||||
// @Excel(name = "发件人纬度")
|
||||
private BigDecimal senderLat;
|
||||
|
||||
/** 发件人公司名称 */
|
||||
|
|
@ -138,7 +139,7 @@ public class BizOrder
|
|||
private String receiverPhone;
|
||||
|
||||
/** 收件人所属地区 */
|
||||
@Excel(name = "收件人所属地区")
|
||||
// @Excel(name = "收件人所属地区")
|
||||
private String receiverArea;
|
||||
|
||||
/** 收件人地址 */
|
||||
|
|
@ -146,11 +147,11 @@ public class BizOrder
|
|||
private String receiverAddress;
|
||||
|
||||
/** 收件人经度 */
|
||||
@Excel(name = "收件人经度")
|
||||
// @Excel(name = "收件人经度")
|
||||
private BigDecimal receiverLng;
|
||||
|
||||
/** 收件人纬度 */
|
||||
@Excel(name = "收件人纬度")
|
||||
// @Excel(name = "收件人纬度")
|
||||
private BigDecimal receiverLat;
|
||||
|
||||
/** 收件人公司名称 */
|
||||
|
|
@ -158,11 +159,11 @@ public class BizOrder
|
|||
private String receiverCompany;
|
||||
|
||||
/** 直接距离 */
|
||||
@Excel(name = "直接距离")
|
||||
// @Excel(name = "订单距离")
|
||||
private Double lineDistance;
|
||||
|
||||
/** 物品类型 */
|
||||
@Excel(name = "物品类型")
|
||||
@Excel(name = "物品类型",dictType = "sys_goods_type")
|
||||
private String goodsType;
|
||||
|
||||
/** 物品名称 */
|
||||
|
|
@ -194,15 +195,15 @@ public class BizOrder
|
|||
private Integer totalQuantity;
|
||||
|
||||
/** 是否保价 */
|
||||
@Excel(name = "是否保价")
|
||||
// @Excel(name = "是否保价")
|
||||
private Integer insured;
|
||||
|
||||
/** 保价金额 */
|
||||
@Excel(name = "保价金额")
|
||||
// @Excel(name = "保价金额")
|
||||
private BigDecimal insuredMoney;
|
||||
|
||||
/** 保价费用 */
|
||||
@Excel(name = "保价费用")
|
||||
// @Excel(name = "保价费用")
|
||||
private BigDecimal insuredFee;
|
||||
|
||||
/** 订单费用 */
|
||||
|
|
@ -210,41 +211,41 @@ public class BizOrder
|
|||
private BigDecimal orderFee;
|
||||
|
||||
/** 是否取消 */
|
||||
@Excel(name = "是否取消")
|
||||
// @Excel(name = "是否取消")
|
||||
private Integer isCancel;
|
||||
|
||||
/** 取消原因 */
|
||||
@Excel(name = "取消原因")
|
||||
// @Excel(name = "取消原因")
|
||||
private String cancelReason;
|
||||
|
||||
/** 取消时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "取消时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
// @Excel(name = "取消时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date cancelTime;
|
||||
|
||||
/** 支付类型 寄付,到付,月结 */
|
||||
@Excel(name = "支付类型 寄付,到付,月结")
|
||||
@Excel(name = "支付类型 寄付,到付,月结",dictType = "sys_pay_type")
|
||||
private String payType;
|
||||
|
||||
/** 支付方式 支付宝,微信 */
|
||||
@Excel(name = "支付方式 支付宝,微信")
|
||||
@Excel(name = "支付方式 支付宝,微信",dictType = "sys_pay_mode")
|
||||
private String payMode;
|
||||
|
||||
/** 支付系统订单号 */
|
||||
@Excel(name = "支付系统订单号")
|
||||
// @Excel(name = "支付系统订单号")
|
||||
private String payId;
|
||||
|
||||
/** 支付状态 */
|
||||
@Excel(name = "支付状态")
|
||||
// @Excel(name = "支付状态")
|
||||
private Integer payStatus;
|
||||
|
||||
/** 支付时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
// @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date payTime;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
// @Excel(name = "状态")
|
||||
private Integer status;
|
||||
|
||||
/** 开始配送时间 */
|
||||
|
|
@ -262,29 +263,29 @@ public class BizOrder
|
|||
private String arriveRemark;
|
||||
|
||||
/** 现场图片 */
|
||||
@Excel(name = "现场图片")
|
||||
// @Excel(name = "现场图片")
|
||||
private String arriveImg;
|
||||
|
||||
/** 到达经度 */
|
||||
@Excel(name = "到达经度")
|
||||
// @Excel(name = "到达经度")
|
||||
private BigDecimal arriveLng;
|
||||
|
||||
/** 到达纬度 */
|
||||
@Excel(name = "到达纬度")
|
||||
// @Excel(name = "到达纬度")
|
||||
private BigDecimal arriveLat;
|
||||
|
||||
/** 运单状态 */
|
||||
@Excel(name = "运单状态")
|
||||
// @Excel(name = "运单状态")
|
||||
private Integer subStatus;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "创建时间")
|
||||
@Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
@Excel(name = "更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
/** 备注 */
|
||||
|
|
@ -296,4 +297,11 @@ public class BizOrder
|
|||
// 下单结束时间
|
||||
@TableField(exist = false)
|
||||
private String endTime;
|
||||
|
||||
// 导出类型 1 订单 2 运单
|
||||
@TableField(exist = false)
|
||||
private String importType;
|
||||
// 选中订单id
|
||||
@TableField(exist = false)
|
||||
private List<Long> importIdList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,288 @@
|
|||
package com.cpxt.biz.domain.vo;
|
||||
|
||||
import com.cpxt.common.annotation.Excel;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 订单导入模板对象(调度员)
|
||||
*
|
||||
* @author YIN
|
||||
* @date 2024-12-16
|
||||
*/
|
||||
@Data
|
||||
public class BizOrderSubVo
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID */
|
||||
private Long id;
|
||||
|
||||
/** 订单号 */
|
||||
@Excel(name = "订单号")
|
||||
private String orderSn;
|
||||
|
||||
/** 订单状态 */
|
||||
@Excel(name = "订单状态",dictType = "sys_order_status")
|
||||
private String orderStatus;
|
||||
|
||||
/** 订单类型 */
|
||||
@Excel(name = "订单类型",dictType = "sys_order_type")
|
||||
private String orderType;
|
||||
|
||||
/** 客户ID */
|
||||
private Long customerId;
|
||||
|
||||
/** 客户名称 */
|
||||
@Excel(name = "客户名称")
|
||||
private String customerName;
|
||||
|
||||
/** 路线ID */
|
||||
private Long routeId;
|
||||
|
||||
/** 路线名称 */
|
||||
@Excel(name = "路线名称")
|
||||
private String routeName;
|
||||
|
||||
/** 仓库ID */
|
||||
private Long warehouseId;
|
||||
|
||||
/** 仓库名称 */
|
||||
@Excel(name = "仓库名称")
|
||||
private String warehouseName;
|
||||
|
||||
/** 店铺ID */
|
||||
private Long shopId;
|
||||
|
||||
/** 店铺名称 */
|
||||
@Excel(name = "店铺名称")
|
||||
private String shopName;
|
||||
|
||||
/** 配送车辆ID */
|
||||
private Long carId;
|
||||
|
||||
/** 配送车牌号 */
|
||||
@Excel(name = "配送车牌号")
|
||||
private String carNo;
|
||||
|
||||
/** 配送司机ID */
|
||||
private Long driverId;
|
||||
|
||||
/** 配送司机名称 */
|
||||
@Excel(name = "配送司机名称")
|
||||
private String driverName;
|
||||
|
||||
/** 副驾司机ID */
|
||||
private Long copilotId;
|
||||
|
||||
/** 副驾司机名称 */
|
||||
@Excel(name = "副驾司机名称")
|
||||
private String copilotName;
|
||||
|
||||
/** 发件人名称 */
|
||||
@Excel(name = "发件人名称")
|
||||
private String senderName;
|
||||
|
||||
/** 发件联系人 */
|
||||
@Excel(name = "发件联系人")
|
||||
private String senderLinkman;
|
||||
|
||||
/** 发件人电话 */
|
||||
@Excel(name = "发件人电话")
|
||||
private String senderPhone;
|
||||
|
||||
/** 发件人地址 */
|
||||
@Excel(name = "发件人地址")
|
||||
private String senderAddress;
|
||||
|
||||
/** 发件人经度 */
|
||||
private BigDecimal senderLng;
|
||||
|
||||
/** 发件人纬度 */
|
||||
private BigDecimal senderLat;
|
||||
|
||||
/** 发件人公司名称 */
|
||||
@Excel(name = "发件人公司名称")
|
||||
private String senderCompany;
|
||||
|
||||
/** 收件人名称 */
|
||||
@Excel(name = "收件人名称")
|
||||
private String receiverName;
|
||||
|
||||
/** 收件联系人 */
|
||||
@Excel(name = "收件联系人")
|
||||
private String receiverLinkman;
|
||||
|
||||
/** 收件人电话 */
|
||||
@Excel(name = "收件人电话")
|
||||
private String receiverPhone;
|
||||
|
||||
/** 收件人地址 */
|
||||
@Excel(name = "收件人地址")
|
||||
private String receiverAddress;
|
||||
|
||||
/** 收件人经度 */
|
||||
private BigDecimal receiverLng;
|
||||
|
||||
/** 收件人纬度 */
|
||||
private BigDecimal receiverLat;
|
||||
|
||||
/** 收件人公司名称 */
|
||||
@Excel(name = "收件人公司名称")
|
||||
private String receiverCompany;
|
||||
|
||||
/** 订单距离 */
|
||||
// @Excel(name = "订单距离")
|
||||
private Double lineDistance;
|
||||
|
||||
/** 物品类型 */
|
||||
@Excel(name = "物品类型",dictType = "sys_goods_type")
|
||||
private String goodsType;
|
||||
|
||||
/** 物品名称 */
|
||||
@Excel(name = "物品名称")
|
||||
private String goodsName;
|
||||
|
||||
/** 重量 */
|
||||
@Excel(name = "重量")
|
||||
private BigDecimal weight;
|
||||
|
||||
/** 物品体积 */
|
||||
@Excel(name = "体积")
|
||||
private BigDecimal volume;
|
||||
|
||||
/** 长(米) */
|
||||
@Excel(name = "长")
|
||||
private BigDecimal length;
|
||||
|
||||
/** 宽(米) */
|
||||
@Excel(name = "宽")
|
||||
private BigDecimal width;
|
||||
|
||||
/** 高(米) */
|
||||
@Excel(name = "高")
|
||||
private BigDecimal height;
|
||||
|
||||
/** 包裹总件数 */
|
||||
@Excel(name = "包裹总件数")
|
||||
private Integer totalQuantity;
|
||||
|
||||
/** 是否保价 */
|
||||
private Integer insured;
|
||||
|
||||
/** 保价金额 */
|
||||
private BigDecimal insuredMoney;
|
||||
|
||||
/** 保价费用 */
|
||||
private BigDecimal insuredFee;
|
||||
|
||||
/** 订单费用 */
|
||||
@Excel(name = "订单费用")
|
||||
private BigDecimal orderFee;
|
||||
|
||||
/** 是否取消 */
|
||||
private Integer isCancel;
|
||||
|
||||
/** 取消原因 */
|
||||
private String cancelReason;
|
||||
|
||||
/** 取消时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date cancelTime;
|
||||
|
||||
/** 支付类型 寄付,到付,月结 */
|
||||
@Excel(name = "支付类型 寄付,到付,月结",dictType = "sys_pay_type")
|
||||
private String payType;
|
||||
|
||||
/** 支付方式 支付宝,微信 */
|
||||
@Excel(name = "支付方式 支付宝,微信",dictType = "sys_pay_mode")
|
||||
private String payMode;
|
||||
|
||||
/** 支付系统订单号 */
|
||||
private String payId;
|
||||
|
||||
/** 支付状态 */
|
||||
private Integer payStatus;
|
||||
|
||||
/** 支付时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date payTime;
|
||||
|
||||
/** 状态 */
|
||||
private Integer status;
|
||||
|
||||
/** 开始配送时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "开始配送时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date startTime;
|
||||
|
||||
/** 到达时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "到达时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date arriveTime;
|
||||
|
||||
/** 到达备注 */
|
||||
@Excel(name = "到达备注")
|
||||
private String arriveRemark;
|
||||
|
||||
/** 到达经度 */
|
||||
private BigDecimal arriveLng;
|
||||
|
||||
/** 到达纬度 */
|
||||
private BigDecimal arriveLat;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date updateTime;
|
||||
|
||||
/** 订单备注 */
|
||||
@Excel(name = "订单备注")
|
||||
private String remark;
|
||||
|
||||
/** 运单号 */
|
||||
@Excel(name = "子单号")
|
||||
private String subOrderSn;
|
||||
|
||||
/** 运单物品重量 */
|
||||
@Excel(name = "运单物品重量")
|
||||
private BigDecimal subWeight;
|
||||
|
||||
/** 运单物品体积 */
|
||||
@Excel(name = "运单物品体积")
|
||||
private BigDecimal subVolume;
|
||||
|
||||
/** 运单物品长(米) */
|
||||
@Excel(name = "运单物品长", readConverterExp = "米=")
|
||||
private BigDecimal subLength;
|
||||
|
||||
/** 运单物品宽(米) */
|
||||
@Excel(name = "运单物品宽", readConverterExp = "米=")
|
||||
private BigDecimal subWidth;
|
||||
|
||||
/** 运单物品高(米) */
|
||||
@Excel(name = "运单物品高", readConverterExp = "米=")
|
||||
private BigDecimal subHeight;
|
||||
|
||||
/** 运单物品类型 */
|
||||
@Excel(name = "运单物品类型")
|
||||
private String subGoodsType;
|
||||
|
||||
/** 运单物品名称 */
|
||||
@Excel(name = "运单物品名称")
|
||||
private String subGoodsName;
|
||||
|
||||
/** 运单费用 */
|
||||
@Excel(name = "运单费用")
|
||||
private BigDecimal subOrderFee;
|
||||
|
||||
/** 运单备注 */
|
||||
@Excel(name = "运单备注")
|
||||
private String subRemark;
|
||||
}
|
||||
|
|
@ -22,6 +22,7 @@ public class BizOrderVo
|
|||
private Long id;
|
||||
|
||||
/** 订单号 */
|
||||
@Excel(name = "订单号")
|
||||
private String orderSn;
|
||||
|
||||
/** 订单状态 */
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.cpxt.biz.domain.BizDriver;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
/**
|
||||
* 司机Mapper接口
|
||||
|
|
@ -21,4 +22,13 @@ public interface BizDriverMapper extends BaseMapper<BizDriver>
|
|||
|
||||
@Select("select name from biz_driver where status = 1")
|
||||
List<String> selectDriverName();
|
||||
|
||||
@Update("create table ${tableName} as select * from biz_driver_state_temp")
|
||||
void createTable(String tableName);
|
||||
|
||||
@Update("ALTER TABLE ${tableName} MODIFY COLUMN id INT NOT NULL AUTO_INCREMENT")
|
||||
void addPrimaryKey(String tableName);
|
||||
|
||||
@Update("ALTER TABLE ${tableName} ADD PRIMARY KEY (id)")
|
||||
void setAutoIncrement(String tableName);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
package com.cpxt.biz.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cpxt.biz.domain.BizDriverState;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @author LuoJian
|
||||
* @description 针对表【biz_driver_state(司机定位状态)】的数据库操作Mapper
|
||||
* @createDate 2025-01-03 09:28:09
|
||||
* @Entity com.cpxt.biz.domain.BizDriverState
|
||||
*/
|
||||
@Mapper
|
||||
public interface BizDriverStateMapper extends BaseMapper<BizDriverState> {
|
||||
|
||||
int insertBizDriverState(BizDriverState bizDriverState);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -6,8 +6,11 @@ import java.util.Map;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.cpxt.biz.domain.BizDriverClock;
|
||||
import com.cpxt.biz.domain.StatCar;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
|
|
@ -21,6 +24,12 @@ import org.apache.ibatis.annotations.Update;
|
|||
public interface StatCarMapper extends BaseMapper<StatCar>
|
||||
{
|
||||
|
||||
@Select("select t.car_no from (SELECT car_no,SUM(odometer) sumo FROM `stat_car` where stat_date >= #{startTime} and stat_date <= #{endTime} GROUP BY car_no ORDER BY sumo desc limit 5) t")
|
||||
List<String> selectOdometerTop5CarNo(@Param("startTime") String startTime,@Param("endTime") String endTime);
|
||||
|
||||
|
||||
@Select("select t.sumo from (SELECT car_no,SUM(odometer) sumo FROM `stat_car` where stat_date >= #{startTime} and stat_date <= #{endTime} GROUP BY car_no ORDER BY sumo desc limit 5) t")
|
||||
List<Double> selectOdometerTop5Odometer(@Param("startTime")String startTime,@Param("endTime") String endTime);
|
||||
@Insert("insert into stat_car (stat_date, car_id, car_no) select #{statDate}, id, car_no from biz_car where status = 1 ")
|
||||
void initStatCar(String statDate);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
package com.cpxt.biz.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.cpxt.biz.domain.BizDriverState;
|
||||
|
||||
/**
|
||||
* @author LuoJian
|
||||
* @description 针对表【biz_driver_state(司机定位状态)】的数据库操作Service
|
||||
* @createDate 2025-01-03 09:28:09
|
||||
*/
|
||||
public interface BizDriverStateService extends IService<BizDriverState> {
|
||||
|
||||
public int insertDriveDriveState(BizDriverState bizDriverState);
|
||||
}
|
||||
|
|
@ -119,22 +119,24 @@ public class BizDriverServiceImpl implements IBizDriverService
|
|||
public int insertBizDriver(BizDriver bizDriver)
|
||||
{
|
||||
bizDriver.setDeptName(sysDeptMapper.selectDeptById(bizDriver.getDeptId()).getDeptName());
|
||||
SysUser user = sysUserMapper.selectUserByUserName(bizDriver.getPhone());
|
||||
if (ObjectUtil.isEmpty(user)){
|
||||
SysUser sysUser = new SysUser();
|
||||
setSysUser(bizDriver,sysUser);
|
||||
sysUserMapper.insertUser(sysUser);
|
||||
|
||||
SysUserRole sysUserRole = new SysUserRole();
|
||||
sysUserRole.setUserId(sysUser.getUserId());
|
||||
sysUserRole.setRoleId(102L); // 司机
|
||||
sysUserRoleMapper.insert(sysUserRole);
|
||||
|
||||
bizDriver.setUserId(sysUser.getUserId());
|
||||
}else {
|
||||
bizDriver.setUserId(user.getUserId());
|
||||
SysUser sysUser = new SysUser();
|
||||
setSysUser(bizDriver,sysUser);
|
||||
sysUserMapper.insertUser(sysUser);
|
||||
SysUserRole sysUserRole = new SysUserRole();
|
||||
sysUserRole.setUserId(sysUser.getUserId());
|
||||
sysUserRole.setRoleId(102L); // 司机
|
||||
sysUserRoleMapper.insert(sysUserRole);
|
||||
bizDriver.setUserId(sysUser.getUserId());
|
||||
int insert = bizDriverMapper.insert(bizDriver);
|
||||
// 新增完司机后,创建该司机的行驶轨迹表
|
||||
if (insert > 0){
|
||||
Long id = bizDriver.getId();
|
||||
String tableName = "track_driver_" + id;
|
||||
bizDriverMapper.createTable(tableName); // 创建该司机的行驶轨迹表
|
||||
bizDriverMapper.addPrimaryKey(tableName); // 添加主键
|
||||
bizDriverMapper.setAutoIncrement(tableName); // 设置自增
|
||||
}
|
||||
return bizDriverMapper.insert(bizDriver);
|
||||
return insert;
|
||||
}
|
||||
|
||||
private void setSysUser(BizDriver bizDriver, SysUser sysUser) {
|
||||
|
|
@ -158,6 +160,11 @@ public class BizDriverServiceImpl implements IBizDriverService
|
|||
@Override
|
||||
public int updateBizDriver(BizDriver bizDriver)
|
||||
{
|
||||
if (ObjectUtil.isNotEmpty(bizDriver.getPhoto())){
|
||||
SysUser user = sysUserMapper.selectUserById(bizDriver.getUserId());
|
||||
user.setAvatar(bizDriver.getPhoto());
|
||||
sysUserMapper.updateUser(user);
|
||||
}
|
||||
return bizDriverMapper.updateById(bizDriver);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
package com.cpxt.biz.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.cpxt.biz.domain.BizDriverState;
|
||||
import com.cpxt.biz.mapper.BizDriverStateMapper;
|
||||
import com.cpxt.biz.service.BizDriverStateService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author LuoJian
|
||||
* @description 针对表【biz_driver_state(司机定位状态)】的数据库操作Service实现
|
||||
* @createDate 2025-01-03 09:28:09
|
||||
*/
|
||||
@Service
|
||||
public class BizDriverStateServiceImpl extends ServiceImpl<BizDriverStateMapper, BizDriverState>
|
||||
implements BizDriverStateService {
|
||||
|
||||
@Autowired
|
||||
private BizDriverStateMapper bizDriverStateMapper;
|
||||
|
||||
@Override
|
||||
public int insertDriveDriveState(BizDriverState bizDriverState) {
|
||||
return bizDriverStateMapper.insertBizDriverState(bizDriverState);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,6 +1,9 @@
|
|||
package com.cpxt.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.cpxt.common.core.domain.entity.SysDept;
|
||||
|
||||
|
|
@ -9,7 +12,8 @@ import com.cpxt.common.core.domain.entity.SysDept;
|
|||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface SysDeptMapper
|
||||
@Mapper
|
||||
public interface SysDeptMapper extends BaseMapper<SysDept>
|
||||
{
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
<?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.cpxt.biz.mapper.BizDriverStateMapper">
|
||||
|
||||
<resultMap type="BizDriverState" id="BizDriverStateResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="driverId" column="driver_id" />
|
||||
<result property="driverName" column="driver_name" />
|
||||
<result property="vin" column="vin" />
|
||||
<result property="gpsTime" column="gps_time" />
|
||||
<result property="lat" column="lat" />
|
||||
<result property="lng" column="lng" />
|
||||
<result property="speed" column="speed" />
|
||||
<result property="direction" column="direction" />
|
||||
<result property="placeName" column="place_name" />
|
||||
<result property="provice" column="provice" />
|
||||
<result property="city" column="city" />
|
||||
<result property="district" column="district" />
|
||||
<result property="roadName" column="road_name" />
|
||||
<result property="areaName" column="area_name" />
|
||||
<result property="height" column="height" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertBizDriverState" parameterType="BizDriverState" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into track_driver_${driverId}
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="driverId != null">driver_id,</if>
|
||||
<if test="driverName != null">driver_name,</if>
|
||||
<if test="vin != null">vin,</if>
|
||||
<if test="gpsTime != null">gps_time,</if>
|
||||
<if test="lat != null">lat,</if>
|
||||
<if test="lng != null">lng,</if>
|
||||
<if test="speed != null">speed,</if>
|
||||
<if test="direction != null">direction,</if>
|
||||
<if test="placeName != null">place_name,</if>
|
||||
<if test="provice != null">provice,</if>
|
||||
<if test="city != null">city,</if>
|
||||
<if test="district != null">district,</if>
|
||||
<if test="roadName != null">road_name,</if>
|
||||
<if test="areaName != null">area_name,</if>
|
||||
<if test="height != null">height,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="driverId != null">#{driverId},</if>
|
||||
<if test="driverName != null">#{driverName},</if>
|
||||
<if test="vin != null">#{vin},</if>
|
||||
<if test="gpsTime != null">#{gpsTime},</if>
|
||||
<if test="lat != null">#{lat},</if>
|
||||
<if test="lng != null">#{lng},</if>
|
||||
<if test="speed != null">#{speed},</if>
|
||||
<if test="direction != null">#{direction},</if>
|
||||
<if test="placeName != null">#{placeName},</if>
|
||||
<if test="provice != null">#{provice},</if>
|
||||
<if test="city != null">#{city},</if>
|
||||
<if test="district != null">#{district},</if>
|
||||
<if test="roadName != null">#{roadName},</if>
|
||||
<if test="areaName != null">#{areaName},</if>
|
||||
<if test="height != null">#{height},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue