Browse Source

1.司机车辆关联

test
0.0 2 years ago
parent
commit
a9e8c97b40
  1. 8
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDriverArteryEntity.java
  2. 80
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDrivermiddleEntity.java
  3. 6
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java
  4. 50
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataDrivermiddleClient.java
  5. 9
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDriverArteryVO.java
  6. 35
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDrivermiddleVO.java
  7. 4
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataVehicleVO.java
  8. 34
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java
  9. 150
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDrivermiddleController.java
  10. 26
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java
  11. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataDriverArteryDTO.java
  12. 34
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataDrivermiddleDTO.java
  13. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataVehicleDTO.java
  14. 105
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataDrivermiddleExcel.java
  15. 53
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDrivermiddleClient.java
  16. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java
  17. 80
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml
  18. 54
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDrivermiddleMapper.java
  19. 36
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDrivermiddleMapper.xml
  20. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java
  21. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml
  22. 12
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataDriverArteryService.java
  23. 52
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataDrivermiddleService.java
  24. 9
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehicleService.java
  25. 39
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java
  26. 54
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDrivermiddleServiceImpl.java
  27. 36
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java
  28. 26
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/BasicdataDriverArteryWrapper.java

8
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDriverArteryEntity.java

@ -68,10 +68,10 @@ public class BasicdataDriverArteryEntity extends TenantEntity {
@ApiModelProperty(value = "备注")
private String notes;
/**
* 绑定车辆
* 绑定车辆状态
*/
@ApiModelProperty(value = "绑定车辆")
private String bindVehicle;
@ApiModelProperty(value = "绑定车辆状态")
private Integer bindVehicle;
/**
* 合同开始时间
*/
@ -170,7 +170,7 @@ public class BasicdataDriverArteryEntity extends TenantEntity {
* 关联承运商Id
*/
@ApiModelProperty(value = "关联承运商Id")
private String carrierId;
private Long carrierId;
/**
* 运输协议
*/

80
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataDrivermiddleEntity.java

@ -0,0 +1,80 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
/**
* 司机中间表 实体类
*
* @author lmy
* @since 2023-06-26
*/
@Data
@TableName("logpm_basicdata_drivermiddle")
@ApiModel(value = "BasicdataDrivermiddle对象", description = "司机中间表")
@EqualsAndHashCode(callSuper = true)
public class BasicdataDrivermiddleEntity extends TenantEntity {
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留2
*/
@ApiModelProperty(value = "预留2")
private String reserve2;
/**
* 预留3
*/
@ApiModelProperty(value = "预留3")
private String reserve3;
/**
* 预留4
*/
@ApiModelProperty(value = "预留4")
private String reserve4;
/**
* 预留5
*/
@ApiModelProperty(value = "预留5")
private String reserve5;
/**
* 司机表ID
*/
@ApiModelProperty(value = "司机表ID")
private Long driverId;
/**
* 车辆表ID
*/
@ApiModelProperty(value = "车辆表ID")
private Long brandId;
/**
* zhufuztai
*/
@ApiModelProperty(value = "zhufuztai")
private String state;
}

6
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java

@ -113,10 +113,10 @@ public class BasicdataVehicleEntity extends TenantEntity {
@ApiModelProperty(value = "备注")
private String notes;
/**
* 车辆所属人
* 车辆所属人状态
*/
@ApiModelProperty(value = "车辆所属人")
private String vehicleOwner;
@ApiModelProperty(value = "车辆所属人状态")
private Integer vehicleOwner;
/**
* 品牌型号
*/

50
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataDrivermiddleClient.java

@ -0,0 +1,50 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.feign;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.mp.support.BladePage;
import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 司机中间表 Feign接口类
*
* @author lmy
* @since 2023-06-26
*/
@FeignClient(
value = ModuleNameConstant.APPLICATION_BASICDATA_NAME
)
public interface IBasicdataDrivermiddleClient {
String API_PREFIX = "drivermiddle/client";
String TOP = API_PREFIX + "/top";
/**
* 获取司机中间表列表
*
* @param current 页号
* @param size 页数
* @return BladePage
*/
@GetMapping(TOP)
BladePage<BasicdataDrivermiddleEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
}

9
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDriverArteryVO.java

@ -22,6 +22,8 @@ import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 司机信息表 视图实体类
*
@ -32,10 +34,11 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
public class BasicdataDriverArteryVO extends BasicdataDriverArteryEntity {
private static final long serialVersionUID = 1L;
/**
* 供应商
* 车辆信息
*/
@ApiModelProperty(value = "供应商")
private String carrier;
@ApiModelProperty(value = "车辆信息")
private String bindVehicles;
}

35
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataDrivermiddleVO.java

@ -0,0 +1,35 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.vo;
import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 司机中间表 视图实体类
*
* @author lmy
* @since 2023-06-26
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BasicdataDrivermiddleVO extends BasicdataDrivermiddleEntity {
private static final long serialVersionUID = 1L;
}

4
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataVehicleVO.java

@ -32,6 +32,10 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
public class BasicdataVehicleVO extends BasicdataVehicleEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "历史照片")
private String historicPhotos;
@ApiModelProperty(value = "车辆所属")
private String vehicleOwners;
}

34
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java

@ -17,6 +17,9 @@
package com.logpm.basicdata.controller;
import com.logpm.basicdata.dto.BasicdataDriverArteryDTO;
import com.logpm.basicdata.entity.BasicdataVehicleEntity;
import com.logpm.basicdata.service.IBasicdataVehicleService;
import com.logpm.basicdata.vo.BasicdataVehicleVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -59,6 +62,8 @@ public class BasicdataDriverArteryController extends BladeController {
private final IBasicdataDriverArteryService basicdataDriverArteryService;
private final IBasicdataVehicleService basicdataVehicleService;
/**
* 司机信息表 详情
*/
@ -91,14 +96,30 @@ public class BasicdataDriverArteryController extends BladeController {
return R.data(pages);
}
/**
* 司机信息表 字典
*/
@GetMapping("/dictionary")
@ApiOperationSupport(order = 10)
@ApiOperation(value = "司机信息表",notes = "传入code")
public R<List<BasicdataDriverArteryVO>> dictionary() {
List<BasicdataDriverArteryVO> dictionary = basicdataDriverArteryService.selectBasicdataDriverArteryDictionary();
return R.data(dictionary);
}
/**
* 司机信息表 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入basicdataDriverArtery")
public R save(@Valid @RequestBody BasicdataDriverArteryEntity basicdataDriverArtery) {
return R.status(basicdataDriverArteryService.save(basicdataDriverArtery));
public R save(@Valid @RequestBody BasicdataDriverArteryDTO basicdataDriverArtery) {
boolean save = basicdataDriverArteryService.save(basicdataDriverArtery);
//加入关联表
if (null !=basicdataDriverArtery.getBindVehicles() && save){
Integer b = basicdataDriverArteryService.updateVehicle(basicdataDriverArtery);
}
return R.status(save);
}
/**
@ -107,7 +128,11 @@ public class BasicdataDriverArteryController extends BladeController {
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入basicdataDriverArtery")
public R update(@Valid @RequestBody BasicdataDriverArteryEntity basicdataDriverArtery) {
public R update(@Valid @RequestBody BasicdataDriverArteryDTO basicdataDriverArtery) {
//加入关联表
if (null !=basicdataDriverArtery.getBindVehicles()){
Integer b = basicdataDriverArteryService.updateVehicle(basicdataDriverArtery);
}
return R.status(basicdataDriverArteryService.updateById(basicdataDriverArtery));
}
@ -117,7 +142,8 @@ public class BasicdataDriverArteryController extends BladeController {
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入basicdataDriverArtery")
public R submit(@Valid @RequestBody BasicdataDriverArteryEntity basicdataDriverArtery) {
public R submit(@Valid @RequestBody BasicdataDriverArteryDTO basicdataDriverArtery) {
return R.status(basicdataDriverArteryService.saveOrUpdate(basicdataDriverArtery));
}

150
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDrivermiddleController.java

@ -0,0 +1,150 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity;
import com.logpm.basicdata.vo.BasicdataDrivermiddleVO;
import com.logpm.basicdata.excel.BasicdataDrivermiddleExcel;
import com.logpm.basicdata.service.IBasicdataDrivermiddleService;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.constant.BladeConstant;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Map;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
/**
* 司机中间表 控制器
*
* @author lmy
* @since 2023-06-26
*/
@RestController
@AllArgsConstructor
@RequestMapping("drivermiddle/basicdataDrivermiddle")
@Api(value = "司机中间表", tags = "司机中间表接口")
public class BasicdataDrivermiddleController extends BladeController {
private final IBasicdataDrivermiddleService basicdataDrivermiddleService;
/**
* 司机中间表 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入basicdataDrivermiddle")
public R<BasicdataDrivermiddleEntity> detail(BasicdataDrivermiddleEntity basicdataDrivermiddle) {
BasicdataDrivermiddleEntity detail = basicdataDrivermiddleService.getOne(Condition.getQueryWrapper(basicdataDrivermiddle));
return R.data(detail);
}
/**
* 司机中间表 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入basicdataDrivermiddle")
public R<IPage<BasicdataDrivermiddleEntity>> list(@ApiIgnore @RequestParam Map<String, Object> basicdataDrivermiddle, Query query) {
IPage<BasicdataDrivermiddleEntity> pages = basicdataDrivermiddleService.page(Condition.getPage(query), Condition.getQueryWrapper(basicdataDrivermiddle, BasicdataDrivermiddleEntity.class));
return R.data(pages);
}
/**
* 司机中间表 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分页", notes = "传入basicdataDrivermiddle")
public R<IPage<BasicdataDrivermiddleVO>> page(BasicdataDrivermiddleVO basicdataDrivermiddle, Query query) {
IPage<BasicdataDrivermiddleVO> pages = basicdataDrivermiddleService.selectBasicdataDrivermiddlePage(Condition.getPage(query), basicdataDrivermiddle);
return R.data(pages);
}
/**
* 司机中间表 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入basicdataDrivermiddle")
public R save(@Valid @RequestBody BasicdataDrivermiddleEntity basicdataDrivermiddle) {
return R.status(basicdataDrivermiddleService.save(basicdataDrivermiddle));
}
/**
* 司机中间表 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入basicdataDrivermiddle")
public R update(@Valid @RequestBody BasicdataDrivermiddleEntity basicdataDrivermiddle) {
return R.status(basicdataDrivermiddleService.updateById(basicdataDrivermiddle));
}
/**
* 司机中间表 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入basicdataDrivermiddle")
public R submit(@Valid @RequestBody BasicdataDrivermiddleEntity basicdataDrivermiddle) {
return R.status(basicdataDrivermiddleService.saveOrUpdate(basicdataDrivermiddle));
}
/**
* 司机中间表 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(basicdataDrivermiddleService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导出数据
*/
@GetMapping("/export-basicdataDrivermiddle")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入basicdataDrivermiddle")
public void exportBasicdataDrivermiddle(@ApiIgnore @RequestParam Map<String, Object> basicdataDrivermiddle, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<BasicdataDrivermiddleEntity> queryWrapper = Condition.getQueryWrapper(basicdataDrivermiddle, BasicdataDrivermiddleEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(BasicdataDrivermiddle::getTenantId, bladeUser.getTenantId());
//}
queryWrapper.lambda().eq(BasicdataDrivermiddleEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<BasicdataDrivermiddleExcel> list = basicdataDrivermiddleService.exportBasicdataDrivermiddle(queryWrapper);
ExcelUtil.export(response, "司机中间表数据" + DateUtil.time(), "司机中间表数据表", list, BasicdataDrivermiddleExcel.class);
}
}

26
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java

@ -20,7 +20,9 @@ import com.alibaba.nacos.common.utils.StringUtils;
import com.logpm.basicdata.dto.BasicdataVehicleDTO;
import com.logpm.basicdata.dto.BasicdataVehiclePhotoDTO;
import com.logpm.basicdata.entity.BasicdataVehiclePhotoEntity;
import com.logpm.basicdata.service.IBasicdataDriverArteryService;
import com.logpm.basicdata.service.IBasicdataVehiclePhotoService;
import com.logpm.basicdata.vo.BasicdataCarrierVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -69,6 +71,8 @@ public class BasicdataVehicleController extends BladeController {
private final IBasicdataVehiclePhotoService basicdataVehiclePhotoService;
private final IBasicdataDriverArteryService basicdataDriverArteryService;
/**
* 车辆信息表 详情
@ -108,6 +112,17 @@ public class BasicdataVehicleController extends BladeController {
return R.data(pages);
}
/**
* 车辆信息表 字典
*/
@GetMapping("/dictionary")
@ApiOperationSupport(order = 10)
@ApiOperation(value = "车辆信息表",notes = "传入code")
public R<List<BasicdataVehicleVO>> dictionary() {
List<BasicdataVehicleVO> dictionary = basicdataVehicleService.selectBasicdataVehicleDictionary();
return R.data(dictionary);
}
/**
* 车辆信息表 新增
*/
@ -115,7 +130,12 @@ public class BasicdataVehicleController extends BladeController {
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入basicdataVehicle")
public R save(@Valid @RequestBody BasicdataVehicleDTO basicdataVehicle) {
return R.status(basicdataVehicleService.save(basicdataVehicle));
boolean save = basicdataVehicleService.save(basicdataVehicle);
//加入关联表
if (null !=basicdataVehicle.getVehicleOwners() && save){
Integer b = basicdataVehicleService.updateOwners(basicdataVehicle);
}
return R.status(save);
}
/**
@ -134,6 +154,10 @@ public class BasicdataVehicleController extends BladeController {
//添加历史照片
basicdataVehiclePhotoService.save(basicdataVehiclePhoto);
}
//加入关联表
if (null !=basicdataVehicle.getVehicleOwners()){
Integer b = basicdataVehicleService.updateOwners(basicdataVehicle);
}
return R.status(basicdataVehicleService.updateById(basicdataVehicle));
}

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataDriverArteryDTO.java

@ -17,6 +17,7 @@
package com.logpm.basicdata.dto;
import com.logpm.basicdata.entity.BasicdataDriverArteryEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -30,5 +31,9 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
public class BasicdataDriverArteryDTO extends BasicdataDriverArteryEntity {
private static final long serialVersionUID = 1L;
/**
* 车辆信息
*/
@ApiModelProperty(value = "车辆信息")
private String bindVehicles;
}

34
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataDrivermiddleDTO.java

@ -0,0 +1,34 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.dto;
import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 司机中间表 数据传输对象实体类
*
* @author lmy
* @since 2023-06-26
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BasicdataDrivermiddleDTO extends BasicdataDrivermiddleEntity {
private static final long serialVersionUID = 1L;
}

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataVehicleDTO.java

@ -17,6 +17,7 @@
package com.logpm.basicdata.dto;
import com.logpm.basicdata.entity.BasicdataVehicleEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -31,4 +32,7 @@ import lombok.EqualsAndHashCode;
public class BasicdataVehicleDTO extends BasicdataVehicleEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "车辆所属")
private String vehicleOwners;
}

105
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataDrivermiddleExcel.java

@ -0,0 +1,105 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.excel;
import lombok.Data;
import java.util.Date;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import java.io.Serializable;
/**
* 司机中间表 Excel实体类
*
* @author lmy
* @since 2023-06-26
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class BasicdataDrivermiddleExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("租户号")
private String tenantId;
/**
* 是否已删除
*/
@ColumnWidth(20)
@ExcelProperty("是否已删除")
private Integer isDeleted;
/**
* 预留1
*/
@ColumnWidth(20)
@ExcelProperty("预留1")
private String reserve1;
/**
* 预留2
*/
@ColumnWidth(20)
@ExcelProperty("预留2")
private String reserve2;
/**
* 预留3
*/
@ColumnWidth(20)
@ExcelProperty("预留3")
private String reserve3;
/**
* 预留4
*/
@ColumnWidth(20)
@ExcelProperty("预留4")
private String reserve4;
/**
* 预留5
*/
@ColumnWidth(20)
@ExcelProperty("预留5")
private String reserve5;
/**
* 司机表ID
*/
@ColumnWidth(20)
@ExcelProperty("司机表ID")
private Long driverId;
/**
* 车辆表ID
*/
@ColumnWidth(20)
@ExcelProperty("车辆表ID")
private Long brandId;
/**
* zhufuztai
*/
@ColumnWidth(20)
@ExcelProperty("zhufuztai")
private String state;
}

53
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataDrivermiddleClient.java

@ -0,0 +1,53 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.feign;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity;
import com.logpm.basicdata.service.IBasicdataDrivermiddleService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
/**
* 司机中间表 Feign实现类
*
* @author lmy
* @since 2023-06-26
*/
@ApiIgnore()
@RestController
@AllArgsConstructor
public class BasicdataDrivermiddleClient implements IBasicdataDrivermiddleClient {
private final IBasicdataDrivermiddleService basicdataDrivermiddleService;
@Override
@GetMapping(TOP)
public BladePage<BasicdataDrivermiddleEntity> top(Integer current, Integer size) {
Query query = new Query();
query.setCurrent(current);
query.setSize(size);
IPage<BasicdataDrivermiddleEntity> page = basicdataDrivermiddleService.page(Condition.getPage(query));
return BladePage.of(page);
}
}

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.java

@ -51,5 +51,10 @@ public interface BasicdataDriverArteryMapper extends BaseMapper<BasicdataDriverA
* @return
*/
List<BasicdataDriverArteryExcel> exportBasicdataDriverArtery(@Param("ew") Wrapper<BasicdataDriverArteryEntity> queryWrapper);
/**
* 查询司机字典
*
* @return
*/
List<BasicdataDriverArteryVO> selectBasicdataDictionary();
}

80
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDriverArteryMapper.xml

@ -50,45 +50,44 @@
<select id="selectBasicdataDriverArteryPage" resultType="com.logpm.basicdata.vo.BasicdataDriverArteryVO">
SELECT
lbda.id id,
lbda.tenant_id tenantId,
lbda.create_user createUser,
lbda.create_time createTime,
lbda.update_user updateUser,
lbda.update_time updateTime,
lbda.STATUS STATUS,
lbda.create_dept createDept,
lbda.NAME NAME,
lbda.phone phone,
lbda.type type,
lbda.job_type jobType,
lbda.driving_type drivingType,
lbda.notes notes,
lbda.bind_vehicle bindVehicle,
lbda.contract_start_time contractStartTime,
lbda.contract_end_time contractEndTime,
lbda.id_card idCard,
lbda.gender gender,
lbda.residential_address residentialAddress,
lbda.bank_type bankType,
lbda.bank_card_nub bankCardNub,
lbda.driver_license_nub driverLicenseNub,
lbda.driver_license_organ driverLicenseOrgan,
lbda.driver_license_start_time driverLicenseStartTime,
lbda.driver_license_end_time driverLicenseEndTime,
lbda.employee_qualification_nub employeeQualificationNub,
lbda.road_operation_license_nub roadOperationLicenseNub,
lbda.id_card_front_photo idCardFrontPhoto,
lbda.id_card_back_photo idCardBackPhoto,
lbda.driver_license_photo driverLicensePhoto,
lbda.driver_license_photo_back driverLicensePhotoBack,
lbda.license_people_photo licensePeoplePhoto,
lbda.carrier_id carrierId,
lbda.transportation_agreement transportationAgreement,
lbc.number carrier
lbda.id id,
lbda.tenant_id tenantId,
lbda.create_user createUser,
lbda.create_time createTime,
lbda.update_user updateUser,
lbda.update_time updateTime,
lbda.STATUS STATUS,
lbda.create_dept createDept,
lbda.NAME NAME,
lbda.phone phone,
lbda.type type,
lbda.job_type jobType,
lbda.driving_type drivingType,
lbda.notes notes,
lbda.bind_vehicle bindVehicle,
lbda.contract_start_time contractStartTime,
lbda.contract_end_time contractEndTime,
lbda.id_card idCard,
lbda.gender gender,
lbda.residential_address residentialAddress,
lbda.bank_type bankType,
lbda.bank_card_nub bankCardNub,
lbda.driver_license_nub driverLicenseNub,
lbda.driver_license_organ driverLicenseOrgan,
lbda.driver_license_start_time driverLicenseStartTime,
lbda.driver_license_end_time driverLicenseEndTime,
lbda.employee_qualification_nub employeeQualificationNub,
lbda.road_operation_license_nub roadOperationLicenseNub,
lbda.id_card_front_photo idCardFrontPhoto,
lbda.id_card_back_photo idCardBackPhoto,
lbda.driver_license_photo driverLicensePhoto,
lbda.driver_license_photo_back driverLicensePhotoBack,
lbda.license_people_photo licensePeoplePhoto,
lbda.carrier_id carrierId,
lbda.transportation_agreement transportationAgreement,
(SELECT GROUP_CONCAT(brand_id SEPARATOR ',') from logpm_basicdata_drivermiddle lbd WHERE lbd.driver_id = lbda.id and lbd.is_deleted = 0) bindVehicles
FROM
logpm_basicdata_driver_artery lbda
JOIN logpm_basicdata_carrier lbc ON lbda.carrier_id = lbc.id
logpm_basicdata_driver_artery lbda
<where>
lbda.is_deleted = 0
<if test="param.name != null ">and lbda.name like
@ -101,7 +100,7 @@
concat('%',#{param.type},'%')
</if>
<if test="param.jobType != null ">and lbda.job_type like concat('%',#{param.jobType},'%')</if>
<if test="param.carrier != null ">and lbc.number like concat('%',#{param.carrier},'%')</if>
<if test="param.carrierId != null ">and lbda.carrier_id = #{param.carrierId}</if>
</where>
</select>
@ -109,5 +108,8 @@
<select id="exportBasicdataDriverArtery" resultType="com.logpm.basicdata.excel.BasicdataDriverArteryExcel">
SELECT * FROM logpm_basicdata_driver_artery ${ew.customSqlSegment}
</select>
<select id="selectBasicdataDictionary" resultType="com.logpm.basicdata.vo.BasicdataDriverArteryVO">
SELECT id,name,bind_vehicle FROM logpm_basicdata_driver_artery
</select>
</mapper>

54
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDrivermiddleMapper.java

@ -0,0 +1,54 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.mapper;
import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity;
import com.logpm.basicdata.vo.BasicdataDrivermiddleVO;
import com.logpm.basicdata.excel.BasicdataDrivermiddleExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 司机中间表 Mapper 接口
*
* @author lmy
* @since 2023-06-26
*/
public interface BasicdataDrivermiddleMapper extends BaseMapper<BasicdataDrivermiddleEntity> {
/**
* 自定义分页
*
* @param page
* @param basicdataDrivermiddle
* @return
*/
List<BasicdataDrivermiddleVO> selectBasicdataDrivermiddlePage(IPage page, BasicdataDrivermiddleVO basicdataDrivermiddle);
/**
* 获取导出数据
*
* @param queryWrapper
* @return
*/
List<BasicdataDrivermiddleExcel> exportBasicdataDrivermiddle(@Param("ew") Wrapper<BasicdataDrivermiddleEntity> queryWrapper);
}

36
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataDrivermiddleMapper.xml

@ -0,0 +1,36 @@
<?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.logpm.basicdata.mapper.BasicdataDrivermiddleMapper">
<!-- 通用查询映射结果 -->
<resultMap id="basicdataDrivermiddleResultMap" type="com.logpm.basicdata.entity.BasicdataDrivermiddleEntity">
<result column="id" property="id"/>
<result column="tenant_id" property="tenantId"/>
<result column="create_user" property="createUser"/>
<result column="create_time" property="createTime"/>
<result column="update_user" property="updateUser"/>
<result column="update_time" property="updateTime"/>
<result column="status" property="status"/>
<result column="is_deleted" property="isDeleted"/>
<result column="create_dept" property="createDept"/>
<result column="reserve1" property="reserve1"/>
<result column="reserve2" property="reserve2"/>
<result column="reserve3" property="reserve3"/>
<result column="reserve4" property="reserve4"/>
<result column="reserve5" property="reserve5"/>
<result column="driver_id" property="driverId"/>
<result column="brand_id" property="brandId"/>
<result column="state" property="state"/>
</resultMap>
<select id="selectBasicdataDrivermiddlePage" resultMap="basicdataDrivermiddleResultMap">
select * from logpm_basicdata_drivermiddle where is_deleted = 0
</select>
<select id="exportBasicdataDrivermiddle" resultType="com.logpm.basicdata.excel.BasicdataDrivermiddleExcel">
SELECT * FROM logpm_basicdata_drivermiddle ${ew.customSqlSegment}
</select>
</mapper>

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java

@ -18,6 +18,7 @@ package com.logpm.basicdata.mapper;
import com.logpm.basicdata.dto.BasicdataVehicleDTO;
import com.logpm.basicdata.entity.BasicdataVehicleEntity;
import com.logpm.basicdata.vo.BasicdataCarrierVO;
import com.logpm.basicdata.vo.BasicdataVehicleVO;
import com.logpm.basicdata.excel.BasicdataVehicleExcel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -53,4 +54,10 @@ public interface BasicdataVehicleMapper extends BaseMapper<BasicdataVehicleEntit
List<BasicdataVehicleExcel> exportBasicdataVehicle(@Param("ew") Wrapper<BasicdataVehicleEntity> queryWrapper);
List<String> selectPhotoBymasterId(Long id);
/**
* 查询车辆字典
*
* @return
*/
List<BasicdataVehicleVO> selectBasicdataDictionary();
}

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml

@ -140,7 +140,8 @@
ORDER BY
lbvp.create_time
LIMIT 3
) historicPhotos
) historicPhotos,
(SELECT GROUP_CONCAT(driver_id SEPARATOR ',') from logpm_basicdata_drivermiddle lbd WHERE lbd.brand_id = lbv.id and lbd.is_deleted = 0) vehicleOwners
FROM
logpm_basicdata_vehicle lbv
<where>
@ -172,5 +173,8 @@
lbvp.create_time
LIMIT 3
</select>
<select id="selectBasicdataDictionary" resultType="com.logpm.basicdata.vo.BasicdataVehicleVO">
select id,vehicle_nub,vehicle_owner from logpm_basicdata_vehicle where is_deleted = 0
</select>
</mapper>

12
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataDriverArteryService.java

@ -49,5 +49,15 @@ public interface IBasicdataDriverArteryService extends BaseService<BasicdataDriv
* @return
*/
List<BasicdataDriverArteryExcel> exportBasicdataDriverArtery(Wrapper<BasicdataDriverArteryEntity> queryWrapper);
/**
* 修改
*
* @param basicdataDriverArtery
* @return
*/
Integer updateVehicle(BasicdataDriverArteryDTO basicdataDriverArtery);
/**
* 司机信息表 字典
*/
List<BasicdataDriverArteryVO> selectBasicdataDriverArteryDictionary();
}

52
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataDrivermiddleService.java

@ -0,0 +1,52 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity;
import com.logpm.basicdata.vo.BasicdataDrivermiddleVO;
import com.logpm.basicdata.excel.BasicdataDrivermiddleExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* 司机中间表 服务类
*
* @author lmy
* @since 2023-06-26
*/
public interface IBasicdataDrivermiddleService extends BaseService<BasicdataDrivermiddleEntity> {
/**
* 自定义分页
*
* @param page
* @param basicdataDrivermiddle
* @return
*/
IPage<BasicdataDrivermiddleVO> selectBasicdataDrivermiddlePage(IPage<BasicdataDrivermiddleVO> page, BasicdataDrivermiddleVO basicdataDrivermiddle);
/**
* 导出数据
*
* @param queryWrapper
* @return
*/
List<BasicdataDrivermiddleExcel> exportBasicdataDrivermiddle(Wrapper<BasicdataDrivermiddleEntity> queryWrapper);
}

9
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehicleService.java

@ -19,6 +19,7 @@ package com.logpm.basicdata.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.logpm.basicdata.dto.BasicdataVehicleDTO;
import com.logpm.basicdata.entity.BasicdataVehicleEntity;
import com.logpm.basicdata.vo.BasicdataCarrierVO;
import com.logpm.basicdata.vo.BasicdataVehicleVO;
import com.logpm.basicdata.excel.BasicdataVehicleExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -61,4 +62,12 @@ public interface IBasicdataVehicleService extends BaseService<BasicdataVehicleEn
* @return
*/
BasicdataVehicleEntity getOneById(Long id);
/**
* 车辆信息表 字典
*/
List<BasicdataVehicleVO> selectBasicdataVehicleDictionary();
/**
* 新增关联表
*/
Integer updateOwners(BasicdataVehicleDTO basicdataVehicle);
}

39
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDriverArteryServiceImpl.java

@ -16,16 +16,25 @@
*/
package com.logpm.basicdata.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.basicdata.dto.BasicdataDriverArteryDTO;
import com.logpm.basicdata.entity.BasicdataDriverArteryEntity;
import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity;
import com.logpm.basicdata.entity.BasicdataVehicleEntity;
import com.logpm.basicdata.mapper.BasicdataDrivermiddleMapper;
import com.logpm.basicdata.mapper.BasicdataVehicleMapper;
import com.logpm.basicdata.vo.BasicdataDriverArteryVO;
import com.logpm.basicdata.excel.BasicdataDriverArteryExcel;
import com.logpm.basicdata.mapper.BasicdataDriverArteryMapper;
import com.logpm.basicdata.service.IBasicdataDriverArteryService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
@ -35,8 +44,14 @@ import java.util.List;
* @since 2023-05-15
*/
@Service
@AllArgsConstructor
public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataDriverArteryMapper, BasicdataDriverArteryEntity> implements IBasicdataDriverArteryService {
private final BasicdataVehicleMapper basicdataVehicleMapper;
private final BasicdataDrivermiddleMapper basicdataDrivermiddleMapper;
private final BasicdataDrivermiddleServiceImpl basicdataDrivermiddleService;
@Override
public IPage<BasicdataDriverArteryVO> selectBasicdataDriverArteryPage(IPage<BasicdataDriverArteryVO> page, BasicdataDriverArteryDTO basicdataDriverArtery) {
return page.setRecords(baseMapper.selectBasicdataDriverArteryPage(page, basicdataDriverArtery));
@ -52,4 +67,28 @@ public class BasicdataDriverArteryServiceImpl extends BaseServiceImpl<BasicdataD
return basicdataDriverArteryList;
}
@Override
public Integer updateVehicle(BasicdataDriverArteryDTO basicdataDriverArtery) {
//删除原有绑定关系
int delete = basicdataDrivermiddleMapper.delete(new QueryWrapper<BasicdataDrivermiddleEntity>().lambda().eq(BasicdataDrivermiddleEntity::getDriverId, basicdataDriverArtery.getId()));
//新增现有的数据
if (delete>0){
List<String> bindVehicles = Arrays.asList(basicdataDriverArtery.getBindVehicles().split(","));
ArrayList<BasicdataDrivermiddleEntity> basicdataDrivermiddleEntities = new ArrayList<>();
bindVehicles.forEach(e->{
BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity();
basicdataDrivermiddleEntity.setDriverId(basicdataDriverArtery.getId());
basicdataDrivermiddleEntity.setBrandId(Long.valueOf(e));
basicdataDrivermiddleEntities.add(basicdataDrivermiddleEntity);
});
basicdataDrivermiddleService.saveBatch(basicdataDrivermiddleEntities);
}
return delete;
}
@Override
public List<BasicdataDriverArteryVO> selectBasicdataDriverArteryDictionary() {
return baseMapper.selectBasicdataDictionary();
}
}

54
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataDrivermiddleServiceImpl.java

@ -0,0 +1,54 @@
/*
* Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the dreamlu.net developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Chill 庄骞 (smallchill@163.com)
*/
package com.logpm.basicdata.service.impl;
import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity;
import com.logpm.basicdata.vo.BasicdataDrivermiddleVO;
import com.logpm.basicdata.excel.BasicdataDrivermiddleExcel;
import com.logpm.basicdata.mapper.BasicdataDrivermiddleMapper;
import com.logpm.basicdata.service.IBasicdataDrivermiddleService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.List;
/**
* 司机中间表 服务实现类
*
* @author lmy
* @since 2023-06-26
*/
@Service
public class BasicdataDrivermiddleServiceImpl extends BaseServiceImpl<BasicdataDrivermiddleMapper, BasicdataDrivermiddleEntity> implements IBasicdataDrivermiddleService {
@Override
public IPage<BasicdataDrivermiddleVO> selectBasicdataDrivermiddlePage(IPage<BasicdataDrivermiddleVO> page, BasicdataDrivermiddleVO basicdataDrivermiddle) {
return page.setRecords(baseMapper.selectBasicdataDrivermiddlePage(page, basicdataDrivermiddle));
}
@Override
public List<BasicdataDrivermiddleExcel> exportBasicdataDrivermiddle(Wrapper<BasicdataDrivermiddleEntity> queryWrapper) {
List<BasicdataDrivermiddleExcel> basicdataDrivermiddleList = baseMapper.exportBasicdataDrivermiddle(queryWrapper);
//basicdataDrivermiddleList.forEach(basicdataDrivermiddle -> {
// basicdataDrivermiddle.setTypeName(DictCache.getValue(DictEnum.YES_NO, BasicdataDrivermiddle.getType()));
//});
return basicdataDrivermiddleList;
}
}

36
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java

@ -16,16 +16,24 @@
*/
package com.logpm.basicdata.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.basicdata.dto.BasicdataVehicleDTO;
import com.logpm.basicdata.entity.BasicdataDrivermiddleEntity;
import com.logpm.basicdata.entity.BasicdataVehicleEntity;
import com.logpm.basicdata.mapper.BasicdataDrivermiddleMapper;
import com.logpm.basicdata.vo.BasicdataCarrierVO;
import com.logpm.basicdata.vo.BasicdataVehicleVO;
import com.logpm.basicdata.excel.BasicdataVehicleExcel;
import com.logpm.basicdata.mapper.BasicdataVehicleMapper;
import com.logpm.basicdata.service.IBasicdataVehicleService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
@ -35,8 +43,12 @@ import java.util.List;
* @since 2023-05-16
*/
@Service
@AllArgsConstructor
public class BasicdataVehicleServiceImpl extends BaseServiceImpl<BasicdataVehicleMapper, BasicdataVehicleEntity> implements IBasicdataVehicleService {
private final BasicdataDrivermiddleMapper basicdataDrivermiddleMapper;
private final BasicdataDrivermiddleServiceImpl basicdataDrivermiddleService;
@Override
public IPage<BasicdataVehicleVO> selectBasicdataVehiclePage(IPage<BasicdataVehicleVO> page, BasicdataVehicleDTO basicdataVehicle) {
return page.setRecords(baseMapper.selectBasicdataVehiclePage(page, basicdataVehicle));
@ -62,4 +74,28 @@ public class BasicdataVehicleServiceImpl extends BaseServiceImpl<BasicdataVehicl
return baseMapper.selectById(id);
}
@Override
public List<BasicdataVehicleVO> selectBasicdataVehicleDictionary() {
return baseMapper.selectBasicdataDictionary();
}
@Override
public Integer updateOwners(BasicdataVehicleDTO basicdataVehicle) {
//删除原有绑定关系
int delete = basicdataDrivermiddleMapper.delete(new QueryWrapper<BasicdataDrivermiddleEntity>().lambda().eq(BasicdataDrivermiddleEntity::getBrandId, basicdataVehicle.getId()));
//新增现有的数据
if (delete>0){
List<String> bindOwners = Arrays.asList(basicdataVehicle.getVehicleOwners().split(","));
ArrayList<BasicdataDrivermiddleEntity> basicdataDrivermiddleEntities = new ArrayList<>();
bindOwners.forEach(e->{
BasicdataDrivermiddleEntity basicdataDrivermiddleEntity = new BasicdataDrivermiddleEntity();
basicdataDrivermiddleEntity.setBrandId(basicdataVehicle.getId());
basicdataDrivermiddleEntity.setDriverId(Long.valueOf(e));
basicdataDrivermiddleEntities.add(basicdataDrivermiddleEntity);
});
basicdataDrivermiddleService.saveBatch(basicdataDrivermiddleEntities);
}
return delete;
}
}

26
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/wrapper/BasicdataDriverArteryWrapper.java

@ -0,0 +1,26 @@
package com.logpm.basicdata.wrapper;
import com.logpm.basicdata.entity.BasicdataBrandEntity;
import com.logpm.basicdata.entity.BasicdataDriverArteryEntity;
import com.logpm.basicdata.vo.BasicdataBrandVO;
import com.logpm.basicdata.vo.BasicdataDriverArteryVO;
import org.springblade.core.mp.support.BaseEntityWrapper;
import org.springblade.core.tool.utils.BeanUtil;
import org.springframework.stereotype.Component;
import java.util.Objects;
@Component
public class BasicdataDriverArteryWrapper extends BaseEntityWrapper<BasicdataDriverArteryEntity, BasicdataDriverArteryVO> {
@Override
public BasicdataDriverArteryVO entityVO(BasicdataDriverArteryEntity entity) {
BasicdataDriverArteryVO stationlinenumVO = Objects.requireNonNull(BeanUtil.copy(entity, BasicdataDriverArteryVO.class));
//
return stationlinenumVO;
}
}
Loading…
Cancel
Save