feat: 资产管理模块 - 补充客户和停车场字段
This commit is contained in:
23
yudao-module-asset/pom.xml
Normal file
23
yudao-module-asset/pom.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yudao-module-asset</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>资产管理模块,包含车辆、合同、备车、交车、还车、替换车等功能</description>
|
||||
<url>https://github.com/YunaiV/yudao-cloud</url>
|
||||
|
||||
<modules>
|
||||
<module>yudao-module-asset-api</module>
|
||||
<module>yudao-module-asset-biz</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
39
yudao-module-asset/yudao-module-asset-api/pom.xml
Normal file
39
yudao-module-asset/yudao-module-asset-api/pom.xml
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>yudao-module-asset</artifactId>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yudao-module-asset-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>资产管理 API,定义 Feign 接口等</description>
|
||||
<url>https://github.com/YunaiV/yudao-cloud</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-web</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 参数校验 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
132
yudao-module-asset/yudao-module-asset-biz/pom.xml
Normal file
132
yudao-module-asset/yudao-module-asset-biz/pom.xml
Normal file
@@ -0,0 +1,132 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>yudao-module-asset</artifactId>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>yudao-module-asset-biz</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>资产管理业务实现</description>
|
||||
<url>https://github.com/YunaiV/yudao-cloud</url>
|
||||
|
||||
<dependencies>
|
||||
<!-- 资产管理 API -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-asset-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 系统模块 API -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-system-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 工作流模块 API -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-bpm-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 基础设施模块 API -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-module-infra-api</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring Cloud 基础 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-tenant</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- DB 相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- RPC 远程调用相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-rpc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Registry 注册中心相关 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Config 配置中心相关 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Job 定时任务相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-job</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 消息队列相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-mq</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Test 测试相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 工具类相关 -->
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-excel</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-operatelog</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-dict</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.iocoder.cloud</groupId>
|
||||
<artifactId>yudao-spring-boot-starter-biz-error-code</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,18 @@
|
||||
package cn.iocoder.yudao.module.asset;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 资产管理模块 Application
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class AssetServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AssetServerApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.checkitem;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.checkitem.vo.CheckItemRespVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.checkitem.vo.CheckItemSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.checkitem.CheckItemDO;
|
||||
import cn.iocoder.yudao.module.asset.service.checkitem.CheckItemService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 检查项配置管理 Controller
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Tag(name = "管理后台 - 检查项配置管理")
|
||||
@RestController
|
||||
@RequestMapping("/asset/check-item")
|
||||
@Validated
|
||||
public class CheckItemController {
|
||||
|
||||
@Resource
|
||||
private CheckItemService checkItemService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建检查项配置")
|
||||
public CommonResult<Long> createCheckItem(@Valid @RequestBody CheckItemSaveReqVO createReqVO) {
|
||||
return success(checkItemService.createCheckItem(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新检查项配置")
|
||||
public CommonResult<Boolean> updateCheckItem(@Valid @RequestBody CheckItemSaveReqVO updateReqVO) {
|
||||
checkItemService.updateCheckItem(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除检查项配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> deleteCheckItem(@RequestParam("id") Long id) {
|
||||
checkItemService.deleteCheckItem(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得检查项配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1")
|
||||
public CommonResult<CheckItemRespVO> getCheckItem(@RequestParam("id") Long id) {
|
||||
CheckItemDO checkItem = checkItemService.getCheckItem(id);
|
||||
return success(BeanUtils.toBean(checkItem, CheckItemRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/list-by-form")
|
||||
@Operation(summary = "获得检查项配置列表(按表单)", description = "用于动态表单渲染")
|
||||
@Parameter(name = "formCode", description = "表单编码", required = true, example = "preparation")
|
||||
public CommonResult<List<CheckItemRespVO>> getCheckItemListByFormCode(@RequestParam("formCode") String formCode) {
|
||||
List<CheckItemDO> list = checkItemService.getCheckItemListByFormCode(formCode);
|
||||
return success(BeanUtils.toBean(list, CheckItemRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.checkitem.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 检查项配置 Base VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class CheckItemBaseVO {
|
||||
|
||||
@Schema(description = "所属表单:preparation-备车,take-交车,return-还车", requiredMode = Schema.RequiredMode.REQUIRED, example = "preparation")
|
||||
@NotBlank(message = "所属表单不能为空")
|
||||
private String formCode;
|
||||
|
||||
@Schema(description = "检查项类别", requiredMode = Schema.RequiredMode.REQUIRED, example = "启动项")
|
||||
@NotBlank(message = "检查项类别不能为空")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "检查项编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "startup_battery")
|
||||
@NotBlank(message = "检查项编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "检查项名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "启动电池")
|
||||
@NotBlank(message = "检查项名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "数据类型:1-boolean,2-整数,3-小数,4-百分比,5-字符串,6-图片", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "数据类型不能为空")
|
||||
private Integer dataType;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "是否必填:0-否,1-是", example = "1")
|
||||
private Integer required;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.checkitem.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 检查项配置 - Response VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Schema(description = "管理后台 - 检查项配置 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CheckItemRespVO extends CheckItemBaseVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.checkitem.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 检查项配置 - 创建/更新 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Schema(description = "管理后台 - 检查项配置创建/更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CheckItemSaveReqVO extends CheckItemBaseVO {
|
||||
|
||||
@Schema(description = "主键", example = "1")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.customer;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.customer.vo.CustomerPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.customer.vo.CustomerRespVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.customer.vo.CustomerSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.customer.CustomerDO;
|
||||
import cn.iocoder.yudao.module.asset.service.customer.CustomerService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 客户管理 Controller
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Tag(name = "管理后台 - 客户管理")
|
||||
@RestController
|
||||
@RequestMapping("/asset/customer")
|
||||
@Validated
|
||||
public class CustomerController {
|
||||
|
||||
@Resource
|
||||
private CustomerService customerService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建客户信息")
|
||||
public CommonResult<Long> createCustomer(@Valid @RequestBody CustomerSaveReqVO createReqVO) {
|
||||
return success(customerService.createCustomer(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新客户信息")
|
||||
public CommonResult<Boolean> updateCustomer(@Valid @RequestBody CustomerSaveReqVO updateReqVO) {
|
||||
customerService.updateCustomer(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除客户信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> deleteCustomer(@RequestParam("id") Long id) {
|
||||
customerService.deleteCustomer(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得客户信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1")
|
||||
public CommonResult<CustomerRespVO> getCustomer(@RequestParam("id") Long id) {
|
||||
CustomerDO customer = customerService.getCustomer(id);
|
||||
return success(BeanUtils.toBean(customer, CustomerRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得客户信息分页")
|
||||
public CommonResult<PageResult<CustomerRespVO>> getCustomerPage(@Valid CustomerPageReqVO pageReqVO) {
|
||||
PageResult<CustomerDO> pageResult = customerService.getCustomerPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, CustomerRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.customer.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 客户信息 Base VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class CustomerBaseVO {
|
||||
|
||||
@Schema(description = "客户名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "上海某某科技有限公司")
|
||||
@NotBlank(message = "客户名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "统一信用代码", example = "91310000MA1FL5G73X")
|
||||
private String creditCode;
|
||||
|
||||
@Schema(description = "联系人", example = "张三")
|
||||
private String contactName;
|
||||
|
||||
@Schema(description = "联系电话", example = "13800138000")
|
||||
private String contactPhone;
|
||||
|
||||
@Schema(description = "联系地址", example = "上海市浦东新区张江高科技园区")
|
||||
private String contactAddress;
|
||||
|
||||
@Schema(description = "联系邮箱", example = "zhangsan@example.com")
|
||||
private String contactEmail;
|
||||
|
||||
@Schema(description = "企业名称", example = "上海某某科技有限公司")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "企业电话", example = "021-12345678")
|
||||
private String companyPhone;
|
||||
|
||||
@Schema(description = "邮寄地址", example = "上海市浦东新区张江高科技园区")
|
||||
private String mailingAddress;
|
||||
|
||||
@Schema(description = "开户银行", example = "中国工商银行上海张江支行")
|
||||
private String bankName;
|
||||
|
||||
@Schema(description = "银行账号", example = "6222021234567890123")
|
||||
private String bankAccount;
|
||||
|
||||
@Schema(description = "纳税人识别号", example = "91310000MA1FL5G73X")
|
||||
private String taxNumber;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.customer.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
/**
|
||||
* 客户信息 - 分页查询 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Schema(description = "管理后台 - 客户信息分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CustomerPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "客户名称", example = "上海某某科技")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "统一信用代码", example = "91310000MA1FL5G73X")
|
||||
private String creditCode;
|
||||
|
||||
@Schema(description = "联系人", example = "张三")
|
||||
private String contactName;
|
||||
|
||||
@Schema(description = "联系电话", example = "13800138000")
|
||||
private String contactPhone;
|
||||
|
||||
@Schema(description = "企业名称", example = "上海某某科技")
|
||||
private String companyName;
|
||||
|
||||
@Schema(description = "纳税人识别号", example = "91310000MA1FL5G73X")
|
||||
private String taxNumber;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.customer.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 客户信息 - Response VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Schema(description = "管理后台 - 客户信息 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CustomerRespVO extends CustomerBaseVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.customer.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 客户信息 - 创建/更新 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Schema(description = "管理后台 - 客户信息创建/更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class CustomerSaveReqVO extends CustomerBaseVO {
|
||||
|
||||
@Schema(description = "主键", example = "1")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.parking;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.parking.vo.*;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.parking.ParkingDO;
|
||||
import cn.iocoder.yudao.module.asset.service.parking.ParkingService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 停车场管理 Controller
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Tag(name = "管理后台 - 停车场管理")
|
||||
@RestController
|
||||
@RequestMapping("/asset/parking")
|
||||
@Validated
|
||||
public class ParkingController {
|
||||
|
||||
@Resource
|
||||
private ParkingService parkingService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建停车场")
|
||||
public CommonResult<Long> createParking(@Valid @RequestBody ParkingSaveReqVO createReqVO) {
|
||||
return success(parkingService.createParking(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新停车场")
|
||||
public CommonResult<Boolean> updateParking(@Valid @RequestBody ParkingSaveReqVO updateReqVO) {
|
||||
parkingService.updateParking(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除停车场")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> deleteParking(@RequestParam("id") Long id) {
|
||||
parkingService.deleteParking(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得停车场")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1")
|
||||
public CommonResult<ParkingRespVO> getParking(@RequestParam("id") Long id) {
|
||||
ParkingDO parking = parkingService.getParking(id);
|
||||
return success(BeanUtils.toBean(parking, ParkingRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得停车场分页")
|
||||
public CommonResult<PageResult<ParkingRespVO>> getParkingPage(@Valid ParkingPageReqVO pageReqVO) {
|
||||
PageResult<ParkingDO> pageResult = parkingService.getParkingPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ParkingRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/simple-list")
|
||||
@Operation(summary = "获得停车场精简列表", description = "用于下拉选择")
|
||||
public CommonResult<List<ParkingSimpleRespVO>> getParkingSimpleList() {
|
||||
List<ParkingDO> list = parkingService.getParkingSimpleList();
|
||||
return success(BeanUtils.toBean(list, ParkingSimpleRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.parking.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 停车场 Base VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class ParkingBaseVO {
|
||||
|
||||
@Schema(description = "停车场名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张江停车场")
|
||||
@NotBlank(message = "停车场名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "地址", example = "上海市浦东新区张江高科技园区")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "容量", example = "100")
|
||||
private Integer capacity;
|
||||
|
||||
@Schema(description = "省份", example = "浙江省")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "城市", example = "嘉兴市")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "租赁开始时间", example = "2026-01-01")
|
||||
private LocalDate leaseStartDate;
|
||||
|
||||
@Schema(description = "租赁结束时间", example = "2027-01-01")
|
||||
private LocalDate leaseEndDate;
|
||||
|
||||
@Schema(description = "负责人", example = "张三")
|
||||
private String managerName;
|
||||
|
||||
@Schema(description = "负责人联系方式", example = "13800138000")
|
||||
private String managerPhone;
|
||||
|
||||
@Schema(description = "停车场联系人", example = "李四")
|
||||
private String contactName;
|
||||
|
||||
@Schema(description = "停车场联系方式", example = "13900139000")
|
||||
private String contactPhone;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.parking.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
/**
|
||||
* 停车场 - 分页查询 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Schema(description = "管理后台 - 停车场分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ParkingPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "停车场名称", example = "张江停车场")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "地址", example = "上海市浦东新区")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "省份", example = "浙江省")
|
||||
private String province;
|
||||
|
||||
@Schema(description = "城市", example = "嘉兴市")
|
||||
private String city;
|
||||
|
||||
@Schema(description = "负责人", example = "张三")
|
||||
private String managerName;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.parking.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 停车场 - Response VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Schema(description = "管理后台 - 停车场 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ParkingRespVO extends ParkingBaseVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.parking.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 停车场 - 创建/更新 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Schema(description = "管理后台 - 停车场创建/更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ParkingSaveReqVO extends ParkingBaseVO {
|
||||
|
||||
@Schema(description = "主键", example = "1")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.parking.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 停车场 - 精简信息 Response VO
|
||||
* 用于下拉选择
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Schema(description = "管理后台 - 停车场精简信息 Response VO")
|
||||
@Data
|
||||
public class ParkingSimpleRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "停车场名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张江停车场")
|
||||
private String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.preparation;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.preparation.vo.PreparationPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.preparation.vo.PreparationRespVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.preparation.vo.PreparationSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.preparation.PreparationDO;
|
||||
import cn.iocoder.yudao.module.asset.service.preparation.PreparationService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 备车管理 Controller
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Tag(name = "管理后台 - 备车管理")
|
||||
@RestController
|
||||
@RequestMapping("/asset/preparation")
|
||||
@Validated
|
||||
public class PreparationController {
|
||||
|
||||
@Resource
|
||||
private PreparationService preparationService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建备车单(暂存)")
|
||||
public CommonResult<Long> createPreparation(@Valid @RequestBody PreparationSaveReqVO createReqVO) {
|
||||
return success(preparationService.createPreparation(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新备车单")
|
||||
public CommonResult<Boolean> updatePreparation(@Valid @RequestBody PreparationSaveReqVO updateReqVO) {
|
||||
preparationService.updatePreparation(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/submit")
|
||||
@Operation(summary = "提交备车单(完成备车)")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> submitPreparation(@RequestParam("id") Long id) {
|
||||
preparationService.submitPreparation(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除备车单")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> deletePreparation(@RequestParam("id") Long id) {
|
||||
preparationService.deletePreparation(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得备车单")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1")
|
||||
public CommonResult<PreparationRespVO> getPreparation(@RequestParam("id") Long id) {
|
||||
PreparationDO preparation = preparationService.getPreparation(id);
|
||||
return success(BeanUtils.toBean(preparation, PreparationRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得备车单分页")
|
||||
public CommonResult<PageResult<PreparationRespVO>> getPreparationPage(@Valid PreparationPageReqVO pageReqVO) {
|
||||
PageResult<PreparationDO> pageResult = preparationService.getPreparationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, PreparationRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.preparation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 备车单 Base VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class PreparationBaseVO {
|
||||
|
||||
@Schema(description = "车辆ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "车辆ID不能为空")
|
||||
private Long truckId;
|
||||
|
||||
@Schema(description = "状态:0-待整备,1-整备中,2-已完成", example = "0")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "停车场ID", example = "1")
|
||||
private Long parkingId;
|
||||
|
||||
@Schema(description = "仪表盘里程", example = "10000.50")
|
||||
private BigDecimal instrumentRange;
|
||||
|
||||
@Schema(description = "剩余氢量", example = "50.5")
|
||||
private BigDecimal leftHydrogen;
|
||||
|
||||
@Schema(description = "氢气单位(字典)", example = "1")
|
||||
private Integer hydrogenUnit;
|
||||
|
||||
@Schema(description = "剩余电量(%)", example = "80.5")
|
||||
private BigDecimal leftElectricity;
|
||||
|
||||
@Schema(description = "负责人ID", example = "1")
|
||||
private Long handlerId;
|
||||
|
||||
@Schema(description = "完成时间", example = "2024-01-01 12:00:00")
|
||||
private LocalDateTime completionTime;
|
||||
|
||||
@Schema(description = "下次检查日期", example = "2024-02-01 00:00:00")
|
||||
private LocalDateTime nextCheckDate;
|
||||
|
||||
@Schema(description = "备注", example = "备车正常")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "检查项数据列表")
|
||||
private List<PreparationCheckDataVO> checkDataList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.preparation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 备车检查项数据 VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class PreparationCheckDataVO {
|
||||
|
||||
@Schema(description = "主键", example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "检查项ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "检查项ID不能为空")
|
||||
private Long checkItemId;
|
||||
|
||||
@Schema(description = "检查项编码", example = "startup_battery")
|
||||
private String checkItemCode;
|
||||
|
||||
@Schema(description = "检查项名称", example = "启动电池")
|
||||
private String checkItemName;
|
||||
|
||||
@Schema(description = "检查项类别", example = "启动项")
|
||||
private String category;
|
||||
|
||||
@Schema(description = "数据类型:1-boolean,2-整数,3-小数,4-百分比,5-字符串,6-图片", example = "1")
|
||||
private Integer dataType;
|
||||
|
||||
@Schema(description = "检查值", example = "true")
|
||||
private String checkValue;
|
||||
|
||||
@Schema(description = "备注", example = "正常")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "排序", example = "1")
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.preparation.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
/**
|
||||
* 备车单 - 分页查询 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Schema(description = "管理后台 - 备车单分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class PreparationPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "车辆ID", example = "1")
|
||||
private Long truckId;
|
||||
|
||||
@Schema(description = "状态:0-待整备,1-整备中,2-已完成", example = "0")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "负责人ID", example = "1")
|
||||
private Long handlerId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.preparation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 备车单 - Response VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Schema(description = "管理后台 - 备车单 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class PreparationRespVO extends PreparationBaseVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "车牌号", example = "京A12345")
|
||||
private String plateNumber;
|
||||
|
||||
@Schema(description = "负责人姓名", example = "张三")
|
||||
private String handlerName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.preparation.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 备车单 - 创建/更新 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Schema(description = "管理后台 - 备车单创建/更新 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class PreparationSaveReqVO extends PreparationBaseVO {
|
||||
|
||||
@Schema(description = "主键", example = "1")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.truck;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.truck.vo.TruckPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.truck.vo.TruckRespVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.truck.vo.TruckSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.truck.TruckDO;
|
||||
import cn.iocoder.yudao.module.asset.service.truck.TruckService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
/**
|
||||
* 车辆管理 Controller
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Tag(name = "管理后台 - 车辆管理")
|
||||
@RestController
|
||||
@RequestMapping("/asset/truck")
|
||||
@Validated
|
||||
public class TruckController {
|
||||
|
||||
@Resource
|
||||
private TruckService truckService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建车辆信息")
|
||||
public CommonResult<Long> createTruck(@Valid @RequestBody TruckSaveReqVO createReqVO) {
|
||||
return success(truckService.createTruck(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新车辆信息")
|
||||
public CommonResult<Boolean> updateTruck(@Valid @RequestBody TruckSaveReqVO updateReqVO) {
|
||||
truckService.updateTruck(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除车辆信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> deleteTruck(@RequestParam("id") Long id) {
|
||||
truckService.deleteTruck(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得车辆信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1")
|
||||
public CommonResult<TruckRespVO> getTruck(@RequestParam("id") Long id) {
|
||||
TruckDO truck = truckService.getTruck(id);
|
||||
return success(BeanUtils.toBean(truck, TruckRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得车辆信息分页")
|
||||
public CommonResult<PageResult<TruckRespVO>> getTruckPage(@Valid TruckPageReqVO pageReqVO) {
|
||||
PageResult<TruckDO> pageResult = truckService.getTruckPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, TruckRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.truck.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 车辆信息 Base VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Data
|
||||
public class TruckBaseVO {
|
||||
|
||||
@Schema(description = "所属机构", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "所属机构不能为空")
|
||||
private Long orgId;
|
||||
|
||||
@Schema(description = "车牌号", requiredMode = Schema.RequiredMode.REQUIRED, example = "京A12345")
|
||||
@NotBlank(message = "车牌号不能为空")
|
||||
private String plateNumber;
|
||||
|
||||
@Schema(description = "VIN码", requiredMode = Schema.RequiredMode.REQUIRED, example = "LNBSCU2E8JZ123456")
|
||||
@NotBlank(message = "VIN码不能为空")
|
||||
private String vin;
|
||||
|
||||
@Schema(description = "品牌(字典)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "品牌不能为空")
|
||||
private Integer brand;
|
||||
|
||||
@Schema(description = "型号(字典)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "型号不能为空")
|
||||
private Integer model;
|
||||
|
||||
@Schema(description = "颜色", example = "白色")
|
||||
private String color;
|
||||
|
||||
@Schema(description = "电机编号", example = "ENG123456")
|
||||
private String engineNum;
|
||||
|
||||
@Schema(description = "氢瓶容量(L)", example = "165")
|
||||
private Integer hydrogenCapacity;
|
||||
|
||||
@Schema(description = "储电量(kwh)", example = "82.56")
|
||||
private BigDecimal reserveElectricity;
|
||||
|
||||
@Schema(description = "采购时间", example = "2024-01-01 00:00:00")
|
||||
private LocalDateTime buyTime;
|
||||
|
||||
@Schema(description = "里程数(KM)", example = "10000.50")
|
||||
private BigDecimal mileage;
|
||||
|
||||
@Schema(description = "租赁状态:0-未备车,7-已备车,1-已交车,2-已还车", example = "0")
|
||||
private Integer truckRentStatus;
|
||||
|
||||
@Schema(description = "是否营运:0-否,1-是", example = "1")
|
||||
private Integer isOperation;
|
||||
|
||||
@Schema(description = "停车场ID", example = "1")
|
||||
private Long parkingId;
|
||||
|
||||
@Schema(description = "库存区域(字典)", example = "1")
|
||||
private Integer stockArea;
|
||||
|
||||
@Schema(description = "备注", example = "测试车辆")
|
||||
private String remarks;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.truck.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
/**
|
||||
* 车辆信息 - 分页查询 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Schema(description = "管理后台 - 车辆信息分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class TruckPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "车牌号", example = "京A12345")
|
||||
private String plateNumber;
|
||||
|
||||
@Schema(description = "VIN码", example = "LNBSCU2E8JZ123456")
|
||||
private String vin;
|
||||
|
||||
@Schema(description = "品牌(字典)", example = "1")
|
||||
private Integer brand;
|
||||
|
||||
@Schema(description = "型号(字典)", example = "1")
|
||||
private Integer model;
|
||||
|
||||
@Schema(description = "租赁状态:0-未备车,7-已备车,1-已交车,2-已还车", example = "0")
|
||||
private Integer truckRentStatus;
|
||||
|
||||
@Schema(description = "是否营运:0-否,1-是", example = "1")
|
||||
private Integer isOperation;
|
||||
|
||||
@Schema(description = "所属机构", example = "1")
|
||||
private Long orgId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.truck.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 车辆信息 - Response VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Schema(description = "管理后台 - 车辆信息 Response VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class TruckRespVO extends TruckBaseVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.asset.controller.admin.truck.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* 车辆信息 - 创建 Request VO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Schema(description = "管理后台 - 车辆信息创建 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class TruckSaveReqVO extends TruckBaseVO {
|
||||
|
||||
@Schema(description = "主键", example = "1")
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.dataobject.checkitem;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 检查项配置 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("asset_check_item")
|
||||
@KeySequence("asset_check_item_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CheckItemDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属表单:preparation-备车,take-交车,return-还车
|
||||
*/
|
||||
private String formCode;
|
||||
|
||||
/**
|
||||
* 检查项类别
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 检查项编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 检查项名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 数据类型:1-boolean,2-整数,3-小数,4-百分比,5-字符串,6-图片
|
||||
*/
|
||||
private Integer dataType;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 是否必填:0-否,1-是
|
||||
*/
|
||||
private Integer required;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.dataobject.customer;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 客户信息 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("asset_customer")
|
||||
@KeySequence("asset_customer_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CustomerDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 客户名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 统一信用代码
|
||||
*/
|
||||
private String creditCode;
|
||||
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contactName;
|
||||
|
||||
/**
|
||||
* 联系电话
|
||||
*/
|
||||
private String contactPhone;
|
||||
|
||||
/**
|
||||
* 联系地址
|
||||
*/
|
||||
private String contactAddress;
|
||||
|
||||
/**
|
||||
* 联系邮箱
|
||||
*/
|
||||
private String contactEmail;
|
||||
|
||||
/**
|
||||
* 企业名称
|
||||
*/
|
||||
private String companyName;
|
||||
|
||||
/**
|
||||
* 企业电话
|
||||
*/
|
||||
private String companyPhone;
|
||||
|
||||
/**
|
||||
* 邮寄地址
|
||||
*/
|
||||
private String mailingAddress;
|
||||
|
||||
/**
|
||||
* 开户银行
|
||||
*/
|
||||
private String bankName;
|
||||
|
||||
/**
|
||||
* 银行账号
|
||||
*/
|
||||
private String bankAccount;
|
||||
|
||||
/**
|
||||
* 纳税人识别号
|
||||
*/
|
||||
private String taxNumber;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.dataobject.parking;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
/**
|
||||
* 停车场 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("asset_parking")
|
||||
@KeySequence("asset_parking_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ParkingDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 停车场名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 容量
|
||||
*/
|
||||
private Integer capacity;
|
||||
|
||||
/**
|
||||
* 省份
|
||||
*/
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 城市
|
||||
*/
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 租赁开始时间
|
||||
*/
|
||||
private LocalDate leaseStartDate;
|
||||
|
||||
/**
|
||||
* 租赁结束时间
|
||||
*/
|
||||
private LocalDate leaseEndDate;
|
||||
|
||||
/**
|
||||
* 负责人
|
||||
*/
|
||||
private String managerName;
|
||||
|
||||
/**
|
||||
* 负责人联系方式
|
||||
*/
|
||||
private String managerPhone;
|
||||
|
||||
/**
|
||||
* 停车场联系人
|
||||
*/
|
||||
private String contactName;
|
||||
|
||||
/**
|
||||
* 停车场联系方式
|
||||
*/
|
||||
private String contactPhone;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.dataobject.preparation;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
/**
|
||||
* 备车检查项数据 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("asset_preparation_check_data")
|
||||
@KeySequence("asset_preparation_check_data_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PreparationCheckDataDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 备车单ID
|
||||
*/
|
||||
private Long preparationId;
|
||||
|
||||
/**
|
||||
* 检查项ID
|
||||
*/
|
||||
private Long checkItemId;
|
||||
|
||||
/**
|
||||
* 检查项编码
|
||||
*/
|
||||
private String checkItemCode;
|
||||
|
||||
/**
|
||||
* 检查项名称
|
||||
*/
|
||||
private String checkItemName;
|
||||
|
||||
/**
|
||||
* 检查项类别
|
||||
*/
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 数据类型:1-boolean,2-整数,3-小数,4-百分比,5-字符串,6-图片
|
||||
*/
|
||||
private Integer dataType;
|
||||
|
||||
/**
|
||||
* 检查值
|
||||
*/
|
||||
private String checkValue;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.dataobject.preparation;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 备车单 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("asset_preparation")
|
||||
@KeySequence("asset_preparation_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class PreparationDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 车辆ID
|
||||
*/
|
||||
private Long truckId;
|
||||
|
||||
/**
|
||||
* 状态:0-待整备,1-整备中,2-已完成
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 停车场ID
|
||||
*/
|
||||
private Long parkingId;
|
||||
|
||||
/**
|
||||
* 仪表盘里程
|
||||
*/
|
||||
private BigDecimal instrumentRange;
|
||||
|
||||
/**
|
||||
* 剩余氢量
|
||||
*/
|
||||
private BigDecimal leftHydrogen;
|
||||
|
||||
/**
|
||||
* 氢气单位(字典)
|
||||
*/
|
||||
private Integer hydrogenUnit;
|
||||
|
||||
/**
|
||||
* 剩余电量(%)
|
||||
*/
|
||||
private BigDecimal leftElectricity;
|
||||
|
||||
/**
|
||||
* 负责人ID
|
||||
*/
|
||||
private Long handlerId;
|
||||
|
||||
/**
|
||||
* 完成时间
|
||||
*/
|
||||
private LocalDateTime completionTime;
|
||||
|
||||
/**
|
||||
* 下次检查日期
|
||||
*/
|
||||
private LocalDateTime nextCheckDate;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.dataobject.truck;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 车辆信息 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("asset_truck")
|
||||
@KeySequence("asset_truck_seq")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TruckDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 所属机构
|
||||
*/
|
||||
private Long orgId;
|
||||
|
||||
/**
|
||||
* 车牌号
|
||||
*/
|
||||
private String plateNumber;
|
||||
|
||||
/**
|
||||
* VIN码
|
||||
*/
|
||||
private String vin;
|
||||
|
||||
/**
|
||||
* 品牌(字典)
|
||||
*/
|
||||
private Integer brand;
|
||||
|
||||
/**
|
||||
* 型号(字典)
|
||||
*/
|
||||
private Integer model;
|
||||
|
||||
/**
|
||||
* 颜色
|
||||
*/
|
||||
private String color;
|
||||
|
||||
/**
|
||||
* 电机编号
|
||||
*/
|
||||
private String engineNum;
|
||||
|
||||
/**
|
||||
* 氢瓶容量(L)
|
||||
*/
|
||||
private Integer hydrogenCapacity;
|
||||
|
||||
/**
|
||||
* 储电量(kwh)
|
||||
*/
|
||||
private BigDecimal reserveElectricity;
|
||||
|
||||
/**
|
||||
* 采购时间
|
||||
*/
|
||||
private LocalDateTime buyTime;
|
||||
|
||||
/**
|
||||
* 里程数(KM)
|
||||
*/
|
||||
private BigDecimal mileage;
|
||||
|
||||
/**
|
||||
* 租赁状态:0-未备车,7-已备车,1-已交车,2-已还车
|
||||
*/
|
||||
private Integer truckRentStatus;
|
||||
|
||||
/**
|
||||
* 是否营运:0-否,1-是
|
||||
*/
|
||||
private Integer isOperation;
|
||||
|
||||
/**
|
||||
* 停车场ID
|
||||
*/
|
||||
private Long parkingId;
|
||||
|
||||
/**
|
||||
* 库存区域(字典)
|
||||
*/
|
||||
private Integer stockArea;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.mysql.checkitem;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.checkitem.CheckItemDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检查项配置 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface CheckItemMapper extends BaseMapperX<CheckItemDO> {
|
||||
|
||||
default List<CheckItemDO> selectListByFormCode(String formCode) {
|
||||
return selectList(new LambdaQueryWrapperX<CheckItemDO>()
|
||||
.eq(CheckItemDO::getFormCode, formCode)
|
||||
.orderByAsc(CheckItemDO::getSort));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.mysql.customer;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.customer.vo.CustomerPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.customer.CustomerDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 客户信息 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface CustomerMapper extends BaseMapperX<CustomerDO> {
|
||||
|
||||
default PageResult<CustomerDO> selectPage(CustomerPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<CustomerDO>()
|
||||
.likeIfPresent(CustomerDO::getName, reqVO.getName())
|
||||
.likeIfPresent(CustomerDO::getCreditCode, reqVO.getCreditCode())
|
||||
.likeIfPresent(CustomerDO::getContactName, reqVO.getContactName())
|
||||
.likeIfPresent(CustomerDO::getContactPhone, reqVO.getContactPhone())
|
||||
.likeIfPresent(CustomerDO::getCompanyName, reqVO.getCompanyName())
|
||||
.likeIfPresent(CustomerDO::getTaxNumber, reqVO.getTaxNumber())
|
||||
.betweenIfPresent(CustomerDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(CustomerDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.mysql.parking;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.parking.vo.ParkingPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.parking.ParkingDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 停车场 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ParkingMapper extends BaseMapperX<ParkingDO> {
|
||||
|
||||
default PageResult<ParkingDO> selectPage(ParkingPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<ParkingDO>()
|
||||
.likeIfPresent(ParkingDO::getName, reqVO.getName())
|
||||
.likeIfPresent(ParkingDO::getAddress, reqVO.getAddress())
|
||||
.likeIfPresent(ParkingDO::getProvince, reqVO.getProvince())
|
||||
.likeIfPresent(ParkingDO::getCity, reqVO.getCity())
|
||||
.likeIfPresent(ParkingDO::getManagerName, reqVO.getManagerName())
|
||||
.betweenIfPresent(ParkingDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(ParkingDO::getId));
|
||||
}
|
||||
|
||||
default List<ParkingDO> selectSimpleList() {
|
||||
return selectList();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.mysql.preparation;
|
||||
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.preparation.PreparationCheckDataDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 备车检查项数据 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface PreparationCheckDataMapper extends BaseMapperX<PreparationCheckDataDO> {
|
||||
|
||||
default List<PreparationCheckDataDO> selectListByPreparationId(Long preparationId) {
|
||||
return selectList(new LambdaQueryWrapperX<PreparationCheckDataDO>()
|
||||
.eq(PreparationCheckDataDO::getPreparationId, preparationId)
|
||||
.orderByAsc(PreparationCheckDataDO::getSort));
|
||||
}
|
||||
|
||||
default void deleteByPreparationId(Long preparationId) {
|
||||
delete(new LambdaQueryWrapperX<PreparationCheckDataDO>()
|
||||
.eq(PreparationCheckDataDO::getPreparationId, preparationId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.mysql.preparation;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.preparation.vo.PreparationPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.preparation.PreparationDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 备车单 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface PreparationMapper extends BaseMapperX<PreparationDO> {
|
||||
|
||||
default PageResult<PreparationDO> selectPage(PreparationPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<PreparationDO>()
|
||||
.eqIfPresent(PreparationDO::getTruckId, reqVO.getTruckId())
|
||||
.eqIfPresent(PreparationDO::getStatus, reqVO.getStatus())
|
||||
.eqIfPresent(PreparationDO::getHandlerId, reqVO.getHandlerId())
|
||||
.betweenIfPresent(PreparationDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(PreparationDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package cn.iocoder.yudao.module.asset.dal.mysql.truck;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.truck.vo.TruckPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.truck.TruckDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 车辆信息 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface TruckMapper extends BaseMapperX<TruckDO> {
|
||||
|
||||
default PageResult<TruckDO> selectPage(TruckPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<TruckDO>()
|
||||
.likeIfPresent(TruckDO::getPlateNumber, reqVO.getPlateNumber())
|
||||
.likeIfPresent(TruckDO::getVin, reqVO.getVin())
|
||||
.eqIfPresent(TruckDO::getBrand, reqVO.getBrand())
|
||||
.eqIfPresent(TruckDO::getModel, reqVO.getModel())
|
||||
.eqIfPresent(TruckDO::getTruckRentStatus, reqVO.getTruckRentStatus())
|
||||
.eqIfPresent(TruckDO::getIsOperation, reqVO.getIsOperation())
|
||||
.eqIfPresent(TruckDO::getOrgId, reqVO.getOrgId())
|
||||
.betweenIfPresent(TruckDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(TruckDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package cn.iocoder.yudao.module.asset.enums;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.exception.ErrorCode;
|
||||
|
||||
/**
|
||||
* Asset 错误码枚举类
|
||||
*
|
||||
* asset 系统,使用 1-008-000-000 段
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 车辆管理 1-008-001-000 ==========
|
||||
ErrorCode TRUCK_NOT_EXISTS = new ErrorCode(1_008_001_000, "车辆信息不存在");
|
||||
|
||||
// ========== 备车管理 1-008-002-000 ==========
|
||||
ErrorCode PREPARATION_NOT_EXISTS = new ErrorCode(1_008_002_000, "备车单不存在");
|
||||
|
||||
// ========== 合同管理 1-008-003-000 ==========
|
||||
ErrorCode CONTRACT_NOT_EXISTS = new ErrorCode(1_008_003_000, "合同不存在");
|
||||
|
||||
// ========== 客户管理 1-008-004-000 ==========
|
||||
ErrorCode CUSTOMER_NOT_EXISTS = new ErrorCode(1_008_004_000, "客户信息不存在");
|
||||
|
||||
// ========== 停车场管理 1-008-005-000 ==========
|
||||
ErrorCode PARKING_NOT_EXISTS = new ErrorCode(1_008_005_000, "停车场不存在");
|
||||
|
||||
// ========== 检查项配置 1-008-006-000 ==========
|
||||
ErrorCode CHECK_ITEM_NOT_EXISTS = new ErrorCode(1_008_006_000, "检查项配置不存在");
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package cn.iocoder.yudao.module.asset.service.checkitem;
|
||||
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.checkitem.vo.CheckItemSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.checkitem.CheckItemDO;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检查项配置 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface CheckItemService {
|
||||
|
||||
/**
|
||||
* 创建检查项配置
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createCheckItem(@Valid CheckItemSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新检查项配置
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateCheckItem(@Valid CheckItemSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除检查项配置
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteCheckItem(Long id);
|
||||
|
||||
/**
|
||||
* 获得检查项配置
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 检查项配置
|
||||
*/
|
||||
CheckItemDO getCheckItem(Long id);
|
||||
|
||||
/**
|
||||
* 获得检查项配置列表(按表单)
|
||||
*
|
||||
* @param formCode 表单编码
|
||||
* @return 检查项配置列表
|
||||
*/
|
||||
List<CheckItemDO> getCheckItemListByFormCode(String formCode);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package cn.iocoder.yudao.module.asset.service.checkitem;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.checkitem.vo.CheckItemSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.checkitem.CheckItemDO;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.checkitem.CheckItemMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.asset.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 检查项配置 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CheckItemServiceImpl implements CheckItemService {
|
||||
|
||||
@Resource
|
||||
private CheckItemMapper checkItemMapper;
|
||||
|
||||
@Override
|
||||
public Long createCheckItem(CheckItemSaveReqVO createReqVO) {
|
||||
CheckItemDO checkItem = BeanUtils.toBean(createReqVO, CheckItemDO.class);
|
||||
checkItemMapper.insert(checkItem);
|
||||
return checkItem.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCheckItem(CheckItemSaveReqVO updateReqVO) {
|
||||
validateCheckItemExists(updateReqVO.getId());
|
||||
CheckItemDO updateObj = BeanUtils.toBean(updateReqVO, CheckItemDO.class);
|
||||
checkItemMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCheckItem(Long id) {
|
||||
validateCheckItemExists(id);
|
||||
checkItemMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateCheckItemExists(Long id) {
|
||||
if (checkItemMapper.selectById(id) == null) {
|
||||
throw exception(CHECK_ITEM_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CheckItemDO getCheckItem(Long id) {
|
||||
return checkItemMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CheckItemDO> getCheckItemListByFormCode(String formCode) {
|
||||
return checkItemMapper.selectListByFormCode(formCode);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.asset.service.customer;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.customer.vo.CustomerPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.customer.vo.CustomerSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.customer.CustomerDO;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
* 客户信息 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface CustomerService {
|
||||
|
||||
/**
|
||||
* 创建客户信息
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createCustomer(@Valid CustomerSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新客户信息
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateCustomer(@Valid CustomerSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除客户信息
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteCustomer(Long id);
|
||||
|
||||
/**
|
||||
* 获得客户信息
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 客户信息
|
||||
*/
|
||||
CustomerDO getCustomer(Long id);
|
||||
|
||||
/**
|
||||
* 获得客户信息分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 客户信息分页
|
||||
*/
|
||||
PageResult<CustomerDO> getCustomerPage(CustomerPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package cn.iocoder.yudao.module.asset.service.customer;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.customer.vo.CustomerPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.customer.vo.CustomerSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.customer.CustomerDO;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.customer.CustomerMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.asset.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 客户信息 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class CustomerServiceImpl implements CustomerService {
|
||||
|
||||
@Resource
|
||||
private CustomerMapper customerMapper;
|
||||
|
||||
@Override
|
||||
public Long createCustomer(CustomerSaveReqVO createReqVO) {
|
||||
CustomerDO customer = BeanUtils.toBean(createReqVO, CustomerDO.class);
|
||||
customerMapper.insert(customer);
|
||||
return customer.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCustomer(CustomerSaveReqVO updateReqVO) {
|
||||
validateCustomerExists(updateReqVO.getId());
|
||||
CustomerDO updateObj = BeanUtils.toBean(updateReqVO, CustomerDO.class);
|
||||
customerMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCustomer(Long id) {
|
||||
validateCustomerExists(id);
|
||||
customerMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateCustomerExists(Long id) {
|
||||
if (customerMapper.selectById(id) == null) {
|
||||
throw exception(CUSTOMER_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomerDO getCustomer(Long id) {
|
||||
return customerMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<CustomerDO> getCustomerPage(CustomerPageReqVO pageReqVO) {
|
||||
return customerMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package cn.iocoder.yudao.module.asset.service.parking;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.parking.vo.ParkingPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.parking.vo.ParkingSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.parking.ParkingDO;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 停车场 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ParkingService {
|
||||
|
||||
/**
|
||||
* 创建停车场
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createParking(@Valid ParkingSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新停车场
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateParking(@Valid ParkingSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除停车场
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteParking(Long id);
|
||||
|
||||
/**
|
||||
* 获得停车场
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 停车场
|
||||
*/
|
||||
ParkingDO getParking(Long id);
|
||||
|
||||
/**
|
||||
* 获得停车场分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 停车场分页
|
||||
*/
|
||||
PageResult<ParkingDO> getParkingPage(ParkingPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 获得停车场精简列表
|
||||
*
|
||||
* @return 停车场列表
|
||||
*/
|
||||
List<ParkingDO> getParkingSimpleList();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package cn.iocoder.yudao.module.asset.service.parking;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.parking.vo.ParkingPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.parking.vo.ParkingSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.parking.ParkingDO;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.parking.ParkingMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.asset.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 停车场 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ParkingServiceImpl implements ParkingService {
|
||||
|
||||
@Resource
|
||||
private ParkingMapper parkingMapper;
|
||||
|
||||
@Override
|
||||
public Long createParking(ParkingSaveReqVO createReqVO) {
|
||||
ParkingDO parking = BeanUtils.toBean(createReqVO, ParkingDO.class);
|
||||
parkingMapper.insert(parking);
|
||||
return parking.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateParking(ParkingSaveReqVO updateReqVO) {
|
||||
validateParkingExists(updateReqVO.getId());
|
||||
ParkingDO updateObj = BeanUtils.toBean(updateReqVO, ParkingDO.class);
|
||||
parkingMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteParking(Long id) {
|
||||
validateParkingExists(id);
|
||||
parkingMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateParkingExists(Long id) {
|
||||
if (parkingMapper.selectById(id) == null) {
|
||||
throw exception(PARKING_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ParkingDO getParking(Long id) {
|
||||
return parkingMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ParkingDO> getParkingPage(ParkingPageReqVO pageReqVO) {
|
||||
return parkingMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ParkingDO> getParkingSimpleList() {
|
||||
return parkingMapper.selectSimpleList();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.asset.service.preparation;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.preparation.vo.PreparationPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.preparation.vo.PreparationSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.preparation.PreparationDO;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
* 备车单 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface PreparationService {
|
||||
|
||||
/**
|
||||
* 创建备车单(暂存)
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createPreparation(@Valid PreparationSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新备车单
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updatePreparation(@Valid PreparationSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 提交备车单(完成备车,更新车辆状态)
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void submitPreparation(Long id);
|
||||
|
||||
/**
|
||||
* 删除备车单
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deletePreparation(Long id);
|
||||
|
||||
/**
|
||||
* 获得备车单
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 备车单
|
||||
*/
|
||||
PreparationDO getPreparation(Long id);
|
||||
|
||||
/**
|
||||
* 获得备车单分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 备车单分页
|
||||
*/
|
||||
PageResult<PreparationDO> getPreparationPage(PreparationPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,145 @@
|
||||
package cn.iocoder.yudao.module.asset.service.preparation;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.preparation.vo.PreparationCheckDataVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.preparation.vo.PreparationPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.preparation.vo.PreparationSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.preparation.PreparationCheckDataDO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.preparation.PreparationDO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.truck.TruckDO;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.preparation.PreparationCheckDataMapper;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.preparation.PreparationMapper;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.truck.TruckMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.asset.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 备车单 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class PreparationServiceImpl implements PreparationService {
|
||||
|
||||
@Resource
|
||||
private PreparationMapper preparationMapper;
|
||||
|
||||
@Resource
|
||||
private PreparationCheckDataMapper checkDataMapper;
|
||||
|
||||
@Resource
|
||||
private TruckMapper truckMapper;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createPreparation(PreparationSaveReqVO createReqVO) {
|
||||
// 校验车辆存在
|
||||
TruckDO truck = truckMapper.selectById(createReqVO.getTruckId());
|
||||
if (truck == null) {
|
||||
throw exception(TRUCK_NOT_EXISTS);
|
||||
}
|
||||
|
||||
// 插入备车单
|
||||
PreparationDO preparation = BeanUtils.toBean(createReqVO, PreparationDO.class);
|
||||
preparation.setStatus(0); // 待整备
|
||||
preparationMapper.insert(preparation);
|
||||
|
||||
// 插入检查项数据
|
||||
saveCheckDataList(preparation.getId(), createReqVO.getCheckDataList());
|
||||
|
||||
return preparation.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void updatePreparation(PreparationSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validatePreparationExists(updateReqVO.getId());
|
||||
|
||||
// 更新备车单
|
||||
PreparationDO updateObj = BeanUtils.toBean(updateReqVO, PreparationDO.class);
|
||||
preparationMapper.updateById(updateObj);
|
||||
|
||||
// 删除旧检查项数据
|
||||
checkDataMapper.deleteByPreparationId(updateReqVO.getId());
|
||||
|
||||
// 插入新检查项数据
|
||||
saveCheckDataList(updateReqVO.getId(), updateReqVO.getCheckDataList());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void submitPreparation(Long id) {
|
||||
// 校验存在
|
||||
PreparationDO preparation = validatePreparationExists(id);
|
||||
|
||||
// 更新备车单状态
|
||||
PreparationDO updateObj = new PreparationDO();
|
||||
updateObj.setId(id);
|
||||
updateObj.setStatus(2); // 已完成
|
||||
updateObj.setCompletionTime(LocalDateTime.now());
|
||||
preparationMapper.updateById(updateObj);
|
||||
|
||||
// 更新车辆租赁状态:0-未备车 → 7-已备车
|
||||
TruckDO truck = new TruckDO();
|
||||
truck.setId(preparation.getTruckId());
|
||||
truck.setTruckRentStatus(7); // 已备车
|
||||
truckMapper.updateById(truck);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deletePreparation(Long id) {
|
||||
// 校验存在
|
||||
validatePreparationExists(id);
|
||||
|
||||
// 删除备车单
|
||||
preparationMapper.deleteById(id);
|
||||
|
||||
// 删除检查项数据
|
||||
checkDataMapper.deleteByPreparationId(id);
|
||||
}
|
||||
|
||||
private PreparationDO validatePreparationExists(Long id) {
|
||||
PreparationDO preparation = preparationMapper.selectById(id);
|
||||
if (preparation == null) {
|
||||
throw exception(PREPARATION_NOT_EXISTS);
|
||||
}
|
||||
return preparation;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PreparationDO getPreparation(Long id) {
|
||||
return preparationMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<PreparationDO> getPreparationPage(PreparationPageReqVO pageReqVO) {
|
||||
return preparationMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存检查项数据列表
|
||||
*/
|
||||
private void saveCheckDataList(Long preparationId, List<PreparationCheckDataVO> checkDataList) {
|
||||
if (checkDataList == null || checkDataList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (PreparationCheckDataVO vo : checkDataList) {
|
||||
PreparationCheckDataDO checkData = BeanUtils.toBean(vo, PreparationCheckDataDO.class);
|
||||
checkData.setPreparationId(preparationId);
|
||||
checkDataMapper.insert(checkData);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package cn.iocoder.yudao.module.asset.service.truck;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.truck.vo.TruckPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.truck.vo.TruckSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.truck.TruckDO;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
/**
|
||||
* 车辆信息 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface TruckService {
|
||||
|
||||
/**
|
||||
* 创建车辆信息
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createTruck(@Valid TruckSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新车辆信息
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateTruck(@Valid TruckSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除车辆信息
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteTruck(Long id);
|
||||
|
||||
/**
|
||||
* 获得车辆信息
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 车辆信息
|
||||
*/
|
||||
TruckDO getTruck(Long id);
|
||||
|
||||
/**
|
||||
* 获得车辆信息分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 车辆信息分页
|
||||
*/
|
||||
PageResult<TruckDO> getTruckPage(TruckPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package cn.iocoder.yudao.module.asset.service.truck;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.truck.vo.TruckPageReqVO;
|
||||
import cn.iocoder.yudao.module.asset.controller.admin.truck.vo.TruckSaveReqVO;
|
||||
import cn.iocoder.yudao.module.asset.dal.dataobject.truck.TruckDO;
|
||||
import cn.iocoder.yudao.module.asset.dal.mysql.truck.TruckMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.module.asset.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 车辆信息 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class TruckServiceImpl implements TruckService {
|
||||
|
||||
@Resource
|
||||
private TruckMapper truckMapper;
|
||||
|
||||
@Override
|
||||
public Long createTruck(TruckSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
TruckDO truck = BeanUtils.toBean(createReqVO, TruckDO.class);
|
||||
truckMapper.insert(truck);
|
||||
// 返回
|
||||
return truck.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTruck(TruckSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateTruckExists(updateReqVO.getId());
|
||||
// 更新
|
||||
TruckDO updateObj = BeanUtils.toBean(updateReqVO, TruckDO.class);
|
||||
truckMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteTruck(Long id) {
|
||||
// 校验存在
|
||||
validateTruckExists(id);
|
||||
// 删除
|
||||
truckMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateTruckExists(Long id) {
|
||||
if (truckMapper.selectById(id) == null) {
|
||||
throw exception(TRUCK_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public TruckDO getTruck(Long id) {
|
||||
return truckMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<TruckDO> getTruckPage(TruckPageReqVO pageReqVO) {
|
||||
return truckMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
server:
|
||||
port: 48083
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: asset-server
|
||||
|
||||
profiles:
|
||||
active: local
|
||||
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
server-addr: 127.0.0.1:8848
|
||||
config:
|
||||
server-addr: ${spring.cloud.nacos.discovery.server-addr}
|
||||
file-extension: yaml
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.yaml
|
||||
|
||||
--- #################### 数据库相关配置 ####################
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
druid:
|
||||
url: jdbc:mysql://127.0.0.1:3306/ruoyi-vue-pro?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
|
||||
username: root
|
||||
password: 123456
|
||||
|
||||
# Redis 配置
|
||||
data:
|
||||
redis:
|
||||
host: 127.0.0.1
|
||||
port: 6379
|
||||
database: 0
|
||||
password:
|
||||
|
||||
--- #################### 定时任务相关配置 ####################
|
||||
|
||||
xxl:
|
||||
job:
|
||||
enabled: false
|
||||
admin:
|
||||
addresses: http://127.0.0.1:9090/xxl-job-admin
|
||||
executor:
|
||||
appname: ${spring.application.name}
|
||||
logpath: ${user.home}/logs/xxl-job/${spring.application.name}
|
||||
accessToken: default_token
|
||||
|
||||
--- #################### 服务保障相关配置 ####################
|
||||
|
||||
# Lock4j 配置项
|
||||
lock4j:
|
||||
acquire-timeout: 3000
|
||||
expire: 30000
|
||||
|
||||
--- #################### 监控相关配置 ####################
|
||||
|
||||
management:
|
||||
endpoints:
|
||||
web:
|
||||
exposure:
|
||||
include: '*'
|
||||
endpoint:
|
||||
health:
|
||||
show-details: ALWAYS
|
||||
|
||||
--- #################### 芋道相关配置 ####################
|
||||
|
||||
yudao:
|
||||
info:
|
||||
version: 1.0.0
|
||||
base-package: cn.iocoder.yudao.module.asset
|
||||
web:
|
||||
admin-api:
|
||||
prefix: /admin-api
|
||||
controller: '**.controller.admin.**'
|
||||
security:
|
||||
permit-all_urls:
|
||||
- /admin-api/asset/truck/page # 车辆分页查询,示例
|
||||
xss:
|
||||
enable: false
|
||||
exclude-urls:
|
||||
- /admin-api/asset/truck/create # 车辆创建,示例
|
||||
access-log:
|
||||
enable: false
|
||||
error-code:
|
||||
enable: false
|
||||
demo: false
|
||||
Reference in New Issue
Block a user