Browse Source

车辆关联

test
0.0 2 years ago
parent
commit
ddc2252447
  1. 50
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java
  2. 75
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehiclePhotoEntity.java
  3. 50
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataVehiclePhotoClient.java
  4. 35
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataVehiclePhotoVO.java
  5. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataVehicleVO.java
  6. 33
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehicleController.java
  7. 150
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehiclePhotoController.java
  8. 34
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataVehiclePhotoDTO.java
  9. 99
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehiclePhotoExcel.java
  10. 53
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataVehiclePhotoClient.java
  11. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.java
  12. 13
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehicleMapper.xml
  13. 54
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehiclePhotoMapper.java
  14. 35
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehiclePhotoMapper.xml
  15. 52
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehiclePhotoService.java
  16. 13
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehicleService.java
  17. 54
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehiclePhotoServiceImpl.java
  18. 10
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehicleServiceImpl.java

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

@ -282,30 +282,30 @@ public class BasicdataVehicleEntity extends TenantEntity {
*/
@ApiModelProperty(value = "GPS型号")
private String gpsModel;
/**
* 预留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;
// /**
// * 预留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;
}

75
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehiclePhotoEntity.java

@ -0,0 +1,75 @@
/*
* 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-05-19
*/
@Data
@TableName("logpm_basicdata_vehicle_photo")
@ApiModel(value = "BasicdataVehiclePhoto对象", description = "车辆照片信息表")
@EqualsAndHashCode(callSuper = true)
public class BasicdataVehiclePhotoEntity extends TenantEntity {
/**
* 关联车辆信息表主键id
*/
@ApiModelProperty(value = "关联车辆信息表主键id")
private Long masterId;
/**
* 车辆历史照片
*/
@ApiModelProperty(value = "车辆历史照片")
private String photoUrl;
/**
*
*/
@ApiModelProperty(value = "")
private String reserve1;
/**
*
*/
@ApiModelProperty(value = "")
private String reserve2;
/**
*
*/
@ApiModelProperty(value = "")
private String reserve3;
/**
*
*/
@ApiModelProperty(value = "")
private String reserve4;
/**
*
*/
@ApiModelProperty(value = "")
private String reserve5;
}

50
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataVehiclePhotoClient.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.LauncherConstant;
import org.springblade.core.mp.support.BladePage;
import com.logpm.basicdata.entity.BasicdataVehiclePhotoEntity;
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-05-19
*/
@FeignClient(
value = LauncherConstant.APPLICATION_BASICDATA_NAME
)
public interface IBasicdataVehiclePhotoClient {
String API_PREFIX = "vehiclephoto/client";
String TOP = API_PREFIX + "/top";
/**
* 获取车辆照片信息表列表
*
* @param current 页号
* @param size 页数
* @return BladePage
*/
@GetMapping(TOP)
BladePage<BasicdataVehiclePhotoEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
}

35
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/BasicdataVehiclePhotoVO.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.BasicdataVehiclePhotoEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 车辆照片信息表 视图实体类
*
* @author lmy
* @since 2023-05-19
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BasicdataVehiclePhotoVO extends BasicdataVehiclePhotoEntity {
private static final long serialVersionUID = 1L;
}

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

@ -17,6 +17,7 @@
package com.logpm.basicdata.vo;
import com.logpm.basicdata.entity.BasicdataVehicleEntity;
import io.swagger.annotations.ApiModelProperty;
import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -31,6 +32,6 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
public class BasicdataVehicleVO extends BasicdataVehicleEntity {
private static final long serialVersionUID = 1L;
//历史照片
@ApiModelProperty(value = "历史照片")
private String historicPhotos;
}

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

@ -16,7 +16,11 @@
*/
package com.logpm.basicdata.controller;
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.IBasicdataVehiclePhotoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -30,6 +34,7 @@ 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.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -61,15 +66,23 @@ public class BasicdataVehicleController extends BladeController {
private final IBasicdataVehicleService basicdataVehicleService;
private final IBasicdataVehiclePhotoService basicdataVehiclePhotoService;
/**
* 车辆信息表 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入basicdataVehicle")
public R<BasicdataVehicleEntity> detail(BasicdataVehicleEntity basicdataVehicle) {
public R<BasicdataVehicleVO> detail(BasicdataVehicleDTO basicdataVehicle) {
BasicdataVehicleEntity detail = basicdataVehicleService.getOne(Condition.getQueryWrapper(basicdataVehicle));
return R.data(detail);
//查询历史照片
BasicdataVehicleVO basicdataVehicleVO = new BasicdataVehicleVO();
BeanUtils.copyProperties(detail,basicdataVehicleVO);
List<String> urls =basicdataVehicleService.selectPhotoBymasterId(basicdataVehicleVO.getId());
if (urls.size()>0){basicdataVehicleVO.setHistoricPhotos(StringUtils.join(urls, ","));}
return R.data(basicdataVehicleVO);
}
/**
* 车辆信息表 分页
@ -89,7 +102,6 @@ public class BasicdataVehicleController extends BladeController {
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分页", notes = "传入basicdataVehicle")
public R<IPage<BasicdataVehicleVO>> page(BasicdataVehicleDTO basicdataVehicle, Query query) {
log.info("接收>>>>>>>>>>>>{}",query);
IPage<BasicdataVehicleVO> pages = basicdataVehicleService.selectBasicdataVehiclePage(Condition.getPage(query), basicdataVehicle);
return R.data(pages);
}
@ -100,7 +112,7 @@ public class BasicdataVehicleController extends BladeController {
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入basicdataVehicle")
public R save(@Valid @RequestBody BasicdataVehicleEntity basicdataVehicle) {
public R save(@Valid @RequestBody BasicdataVehicleDTO basicdataVehicle) {
return R.status(basicdataVehicleService.save(basicdataVehicle));
}
@ -110,7 +122,16 @@ public class BasicdataVehicleController extends BladeController {
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入basicdataVehicle")
public R update(@Valid @RequestBody BasicdataVehicleEntity basicdataVehicle) {
public R update(@Valid @RequestBody BasicdataVehicleDTO basicdataVehicle) {
//查询原有的数据
BasicdataVehicleEntity detail = basicdataVehicleService.getOneById(basicdataVehicle.getId());
if (null != detail.getVehiclePhoto() && !detail.getVehiclePhoto().equals(basicdataVehicle.getVehiclePhoto())){
BasicdataVehiclePhotoDTO basicdataVehiclePhoto = new BasicdataVehiclePhotoDTO();
basicdataVehiclePhoto.setPhotoUrl(basicdataVehicle.getVehiclePhoto());
basicdataVehiclePhoto.setMasterId(basicdataVehicle.getId());
//添加历史照片
basicdataVehiclePhotoService.save(basicdataVehiclePhoto);
}
return R.status(basicdataVehicleService.updateById(basicdataVehicle));
}
@ -120,7 +141,7 @@ public class BasicdataVehicleController extends BladeController {
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入basicdataVehicle")
public R submit(@Valid @RequestBody BasicdataVehicleEntity basicdataVehicle) {
public R submit(@Valid @RequestBody BasicdataVehicleDTO basicdataVehicle) {
return R.status(basicdataVehicleService.saveOrUpdate(basicdataVehicle));
}

150
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataVehiclePhotoController.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.BasicdataVehiclePhotoEntity;
import com.logpm.basicdata.vo.BasicdataVehiclePhotoVO;
import com.logpm.basicdata.excel.BasicdataVehiclePhotoExcel;
import com.logpm.basicdata.service.IBasicdataVehiclePhotoService;
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-05-19
*/
@RestController
@AllArgsConstructor
@RequestMapping("blade-basicdataVehiclePhoto/basicdataVehiclePhoto")
@Api(value = "车辆照片信息表", tags = "车辆照片信息表接口")
public class BasicdataVehiclePhotoController extends BladeController {
private final IBasicdataVehiclePhotoService basicdataVehiclePhotoService;
/**
* 车辆照片信息表 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入basicdataVehiclePhoto")
public R<BasicdataVehiclePhotoEntity> detail(BasicdataVehiclePhotoEntity basicdataVehiclePhoto) {
BasicdataVehiclePhotoEntity detail = basicdataVehiclePhotoService.getOne(Condition.getQueryWrapper(basicdataVehiclePhoto));
return R.data(detail);
}
/**
* 车辆照片信息表 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入basicdataVehiclePhoto")
public R<IPage<BasicdataVehiclePhotoEntity>> list(@ApiIgnore @RequestParam Map<String, Object> basicdataVehiclePhoto, Query query) {
IPage<BasicdataVehiclePhotoEntity> pages = basicdataVehiclePhotoService.page(Condition.getPage(query), Condition.getQueryWrapper(basicdataVehiclePhoto, BasicdataVehiclePhotoEntity.class));
return R.data(pages);
}
/**
* 车辆照片信息表 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分页", notes = "传入basicdataVehiclePhoto")
public R<IPage<BasicdataVehiclePhotoVO>> page(BasicdataVehiclePhotoVO basicdataVehiclePhoto, Query query) {
IPage<BasicdataVehiclePhotoVO> pages = basicdataVehiclePhotoService.selectBasicdataVehiclePhotoPage(Condition.getPage(query), basicdataVehiclePhoto);
return R.data(pages);
}
/**
* 车辆照片信息表 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入basicdataVehiclePhoto")
public R save(@Valid @RequestBody BasicdataVehiclePhotoEntity basicdataVehiclePhoto) {
return R.status(basicdataVehiclePhotoService.save(basicdataVehiclePhoto));
}
/**
* 车辆照片信息表 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改", notes = "传入basicdataVehiclePhoto")
public R update(@Valid @RequestBody BasicdataVehiclePhotoEntity basicdataVehiclePhoto) {
return R.status(basicdataVehiclePhotoService.updateById(basicdataVehiclePhoto));
}
/**
* 车辆照片信息表 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入basicdataVehiclePhoto")
public R submit(@Valid @RequestBody BasicdataVehiclePhotoEntity basicdataVehiclePhoto) {
return R.status(basicdataVehiclePhotoService.saveOrUpdate(basicdataVehiclePhoto));
}
/**
* 车辆照片信息表 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
return R.status(basicdataVehiclePhotoService.deleteLogic(Func.toLongList(ids)));
}
/**
* 导出数据
*/
@GetMapping("/export-basicdataVehiclePhoto")
@ApiOperationSupport(order = 9)
@ApiOperation(value = "导出数据", notes = "传入basicdataVehiclePhoto")
public void exportBasicdataVehiclePhoto(@ApiIgnore @RequestParam Map<String, Object> basicdataVehiclePhoto, BladeUser bladeUser, HttpServletResponse response) {
QueryWrapper<BasicdataVehiclePhotoEntity> queryWrapper = Condition.getQueryWrapper(basicdataVehiclePhoto, BasicdataVehiclePhotoEntity.class);
//if (!AuthUtil.isAdministrator()) {
// queryWrapper.lambda().eq(BasicdataVehiclePhoto::getTenantId, bladeUser.getTenantId());
//}
queryWrapper.lambda().eq(BasicdataVehiclePhotoEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
List<BasicdataVehiclePhotoExcel> list = basicdataVehiclePhotoService.exportBasicdataVehiclePhoto(queryWrapper);
ExcelUtil.export(response, "车辆照片信息表数据" + DateUtil.time(), "车辆照片信息表数据表", list, BasicdataVehiclePhotoExcel.class);
}
}

34
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataVehiclePhotoDTO.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.BasicdataVehiclePhotoEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 车辆照片信息表 数据传输对象实体类
*
* @author lmy
* @since 2023-05-19
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class BasicdataVehiclePhotoDTO extends BasicdataVehiclePhotoEntity {
private static final long serialVersionUID = 1L;
}

99
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataVehiclePhotoExcel.java

@ -0,0 +1,99 @@
/*
* 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-05-19
*/
@Data
@ColumnWidth(25)
@HeadRowHeight(20)
@ContentRowHeight(18)
public class BasicdataVehiclePhotoExcel implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 租户号
*/
@ColumnWidth(20)
@ExcelProperty("租户号")
private String tenantId;
/**
* 是否已删除;1-未删除2-已删除
*/
@ColumnWidth(20)
@ExcelProperty("是否已删除;1-未删除,2-已删除")
private Integer isDeleted;
/**
* 关联车辆信息表主键id
*/
@ColumnWidth(20)
@ExcelProperty("关联车辆信息表主键id")
private String masterId;
/**
* 车辆历史照片
*/
@ColumnWidth(20)
@ExcelProperty("车辆历史照片")
private String photoUrl;
/**
*
*/
@ColumnWidth(20)
@ExcelProperty("")
private String reserve1;
/**
*
*/
@ColumnWidth(20)
@ExcelProperty("")
private String reserve2;
/**
*
*/
@ColumnWidth(20)
@ExcelProperty("")
private String reserve3;
/**
*
*/
@ColumnWidth(20)
@ExcelProperty("")
private String reserve4;
/**
*
*/
@ColumnWidth(20)
@ExcelProperty("")
private String reserve5;
}

53
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataVehiclePhotoClient.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 com.logpm.basicdata.entity.BasicdataVehiclePhotoEntity;
import com.logpm.basicdata.service.IBasicdataVehiclePhotoService;
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 org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
/**
* 车辆照片信息表 Feign实现类
*
* @author lmy
* @since 2023-05-19
*/
@ApiIgnore()
@RestController
@AllArgsConstructor
public class BasicdataVehiclePhotoClient implements IBasicdataVehiclePhotoClient {
private final IBasicdataVehiclePhotoService basicdataVehiclePhotoService;
@Override
@GetMapping(TOP)
public BladePage<BasicdataVehiclePhotoEntity> top(Integer current, Integer size) {
Query query = new Query();
query.setCurrent(current);
query.setSize(size);
IPage<BasicdataVehiclePhotoEntity> page = basicdataVehiclePhotoService.page(Condition.getPage(query));
return BladePage.of(page);
}
}

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

@ -52,4 +52,5 @@ public interface BasicdataVehicleMapper extends BaseMapper<BasicdataVehicleEntit
*/
List<BasicdataVehicleExcel> exportBasicdataVehicle(@Param("ew") Wrapper<BasicdataVehicleEntity> queryWrapper);
List<String> selectPhotoBymasterId(Long id);
}

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

@ -159,5 +159,18 @@
<select id="exportBasicdataVehicle" resultType="com.logpm.basicdata.excel.BasicdataVehicleExcel">
SELECT * FROM logpm_basicdata_vehicle ${ew.customSqlSegment}
</select>
<select id="selectPhotoBymasterId" resultType="java.lang.String">
SELECT
lbvp.photo_url
FROM
logpm_basicdata_vehicle_photo lbvp
where
lbvp.is_deleted=0 and
lbvp.master_id = #{id}
/* AND lbvp.create_time &lt;= DATE_SUB( CURDATE(), INTERVAL 1 YEAR )*/
ORDER BY
lbvp.create_time
LIMIT 3
</select>
</mapper>

54
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehiclePhotoMapper.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.BasicdataVehiclePhotoEntity;
import com.logpm.basicdata.vo.BasicdataVehiclePhotoVO;
import com.logpm.basicdata.excel.BasicdataVehiclePhotoExcel;
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-05-19
*/
public interface BasicdataVehiclePhotoMapper extends BaseMapper<BasicdataVehiclePhotoEntity> {
/**
* 自定义分页
*
* @param page
* @param basicdataVehiclePhoto
* @return
*/
List<BasicdataVehiclePhotoVO> selectBasicdataVehiclePhotoPage(IPage page, BasicdataVehiclePhotoVO basicdataVehiclePhoto);
/**
* 获取导出数据
*
* @param queryWrapper
* @return
*/
List<BasicdataVehiclePhotoExcel> exportBasicdataVehiclePhoto(@Param("ew") Wrapper<BasicdataVehiclePhotoEntity> queryWrapper);
}

35
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataVehiclePhotoMapper.xml

@ -0,0 +1,35 @@
<?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.BasicdataVehiclePhotoMapper">
<!-- 通用查询映射结果 -->
<resultMap id="basicdataVehiclePhotoResultMap" type="com.logpm.basicdata.entity.BasicdataVehiclePhotoEntity">
<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="master_id" property="masterId"/>
<result column="photo_url" property="photoUrl"/>
<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"/>
</resultMap>
<select id="selectBasicdataVehiclePhotoPage" resultMap="basicdataVehiclePhotoResultMap">
select * from logpm_basicdata_vehicle_photo where is_deleted = 0
</select>
<select id="exportBasicdataVehiclePhoto" resultType="com.logpm.basicdata.excel.BasicdataVehiclePhotoExcel">
SELECT * FROM logpm_basicdata_vehicle_photo ${ew.customSqlSegment}
</select>
</mapper>

52
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataVehiclePhotoService.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.BasicdataVehiclePhotoEntity;
import com.logpm.basicdata.vo.BasicdataVehiclePhotoVO;
import com.logpm.basicdata.excel.BasicdataVehiclePhotoExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
/**
* 车辆照片信息表 服务类
*
* @author lmy
* @since 2023-05-19
*/
public interface IBasicdataVehiclePhotoService extends BaseService<BasicdataVehiclePhotoEntity> {
/**
* 自定义分页
*
* @param page
* @param basicdataVehiclePhoto
* @return
*/
IPage<BasicdataVehiclePhotoVO> selectBasicdataVehiclePhotoPage(IPage<BasicdataVehiclePhotoVO> page, BasicdataVehiclePhotoVO basicdataVehiclePhoto);
/**
* 导出数据
*
* @param queryWrapper
* @return
*/
List<BasicdataVehiclePhotoExcel> exportBasicdataVehiclePhoto(Wrapper<BasicdataVehiclePhotoEntity> queryWrapper);
}

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

@ -49,5 +49,16 @@ public interface IBasicdataVehicleService extends BaseService<BasicdataVehicleEn
* @return
*/
List<BasicdataVehicleExcel> exportBasicdataVehicle(Wrapper<BasicdataVehicleEntity> queryWrapper);
/**
* 查询历史照片
*
* @return
*/
List<String> selectPhotoBymasterId(Long id);
/**
* 根据Id查询
*
* @return
*/
BasicdataVehicleEntity getOneById(Long id);
}

54
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataVehiclePhotoServiceImpl.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.BasicdataVehiclePhotoEntity;
import com.logpm.basicdata.vo.BasicdataVehiclePhotoVO;
import com.logpm.basicdata.excel.BasicdataVehiclePhotoExcel;
import com.logpm.basicdata.mapper.BasicdataVehiclePhotoMapper;
import com.logpm.basicdata.service.IBasicdataVehiclePhotoService;
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-05-19
*/
@Service
public class BasicdataVehiclePhotoServiceImpl extends BaseServiceImpl<BasicdataVehiclePhotoMapper, BasicdataVehiclePhotoEntity> implements IBasicdataVehiclePhotoService {
@Override
public IPage<BasicdataVehiclePhotoVO> selectBasicdataVehiclePhotoPage(IPage<BasicdataVehiclePhotoVO> page, BasicdataVehiclePhotoVO basicdataVehiclePhoto) {
return page.setRecords(baseMapper.selectBasicdataVehiclePhotoPage(page, basicdataVehiclePhoto));
}
@Override
public List<BasicdataVehiclePhotoExcel> exportBasicdataVehiclePhoto(Wrapper<BasicdataVehiclePhotoEntity> queryWrapper) {
List<BasicdataVehiclePhotoExcel> basicdataVehiclePhotoList = baseMapper.exportBasicdataVehiclePhoto(queryWrapper);
//basicdataVehiclePhotoList.forEach(basicdataVehiclePhoto -> {
// basicdataVehiclePhoto.setTypeName(DictCache.getValue(DictEnum.YES_NO, BasicdataVehiclePhoto.getType()));
//});
return basicdataVehiclePhotoList;
}
}

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

@ -52,4 +52,14 @@ public class BasicdataVehicleServiceImpl extends BaseServiceImpl<BasicdataVehicl
return basicdataVehicleList;
}
@Override
public List<String> selectPhotoBymasterId(Long id) {
return baseMapper.selectPhotoBymasterId(id);
}
@Override
public BasicdataVehicleEntity getOneById(Long id) {
return baseMapper.selectById(id);
}
}

Loading…
Cancel
Save