diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/controller/CarServiceAppController.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/controller/CarServiceAppController.java new file mode 100644 index 00000000..23aa5340 --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/controller/CarServiceAppController.java @@ -0,0 +1,71 @@ +package com.bonus.sharedstation.app.controller; + + +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.sharedstation.app.domain.CarService; +import com.bonus.sharedstation.app.dto.CarServiceDTO; +import com.bonus.sharedstation.app.service.ICarServiceService; +import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.validation.Valid; + +@Tag(name = "app-车辆服务") +@RestController +@RequestMapping("/information/carservice/app") +public class CarServiceAppController { + + @Resource + private ICarServiceService carServiceService; + + + @PostMapping(value = "/add", produces = "application/json; charset=utf-8") + @ApiOperation("车辆服务-新增") + public AjaxResult add(@RequestBody @Valid CarService dto) { + return carServiceService.insert(dto); + } + + + @PostMapping(value = "/delete", produces = "application/json; charset=utf-8") + @ApiOperation("车辆服务-删除") + public AjaxResult deleteById(@RequestBody CarService dto){ + return carServiceService.delete(dto); + } + + @ApiOperation("车辆服务-修改") + @PostMapping("/update") + public AjaxResult update(@RequestBody @Valid CarService dto){ + return carServiceService.updateInfoById(dto); + } + + + /** + * 分页查询 + * @param dto + * @return + */ + @ApiOperation("车辆服务-查询") + @PostMapping("/getList") + public AjaxResult getList(@RequestBody CarServiceDTO dto){ + return carServiceService.getListPageApp(dto); + + } + + /** + * 详情 + * @param + * @return + */ + @PostMapping(value = "selectById", produces = "application/json; charset=utf-8") + @ApiOperation("车辆服务-查询详情") + public AjaxResult selectInfoById(@RequestBody CarService dto){ + return carServiceService.selectInfoById(dto); + } + + +} diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/domain/CarService.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/domain/CarService.java new file mode 100644 index 00000000..8dbf786a --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/domain/CarService.java @@ -0,0 +1,203 @@ +package com.bonus.sharedstation.app.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +/** + * 车辆服务信息实体类 + */ + +@TableName("car_service") +public class CarService { + + private static final long serialVersionUID = 6197622378439433176L; + /** + * 唯一标识符 + */ + @TableId(type = IdType.AUTO) + private Integer id; + + /** + * 服务类型,如车辆年检、车辆保险等 + */ + private String serviceType; + + /** + * 服务描述 + */ + private String serviceDescription; + + /** + * 服务提供商的名称 + */ + private String providerName; + + /** + * 服务提供商的简介 + */ + private String providerDescription; + + /** + * 服务提供商的联系电话 + */ + private String contactPhone; + + /** + * 微信二维码的URL链接 + */ + private String wechatQrcodeUrl; + + private String logAddress; + + public String getLogAddress() { + return logAddress; + } + + public void setLogAddress(String logAddress) { + this.logAddress = logAddress; + } + + /** + * 颜色 + */ + private String color; + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + /** + * 创建人 + */ + private String createdBy; // 创建人 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createdTime; // 创建时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date updatedTime; // 修改时间 + private String updatedBy; // 修改人 + private String isDeleted; // 逻辑删除标识,1表示已删除,0表示未删除 + + @Override + public String toString() { + return "CarService{" + + "id=" + id + + ", serviceType='" + serviceType + '\'' + + ", serviceDescription='" + serviceDescription + '\'' + + ", providerName='" + providerName + '\'' + + ", providerDescription='" + providerDescription + '\'' + + ", contactPhone='" + contactPhone + '\'' + + ", wechatQrcodeUrl='" + wechatQrcodeUrl + '\'' + + ", createdBy='" + createdBy + '\'' + + ", createdTime=" + createdTime + + ", updatedTime=" + updatedTime + + ", updatedBy='" + updatedBy + '\'' + + ", isDeleted='" + isDeleted + '\'' + + '}'; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Date getCreatedTime() { + return createdTime; + } + + public void setCreatedTime(Date createdTime) { + this.createdTime = createdTime; + } + + public Date getUpdatedTime() { + return updatedTime; + } + + public void setUpdatedTime(Date updatedTime) { + this.updatedTime = updatedTime; + } + + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public String getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(String isDeleted) { + this.isDeleted = isDeleted; + } + + // Getters and Setters + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + public String getServiceDescription() { + return serviceDescription; + } + + public void setServiceDescription(String serviceDescription) { + this.serviceDescription = serviceDescription; + } + + public String getProviderName() { + return providerName; + } + + public void setProviderName(String providerName) { + this.providerName = providerName; + } + + public String getProviderDescription() { + return providerDescription; + } + + public void setProviderDescription(String providerDescription) { + this.providerDescription = providerDescription; + } + + public String getContactPhone() { + return contactPhone; + } + + public void setContactPhone(String contactPhone) { + this.contactPhone = contactPhone; + } + + public String getWechatQrcodeUrl() { + return wechatQrcodeUrl; + } + + public void setWechatQrcodeUrl(String wechatQrcodeUrl) { + this.wechatQrcodeUrl = wechatQrcodeUrl; + } +} diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/dto/CarServiceDTO.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/dto/CarServiceDTO.java new file mode 100644 index 00000000..4f558245 --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/dto/CarServiceDTO.java @@ -0,0 +1,200 @@ +package com.bonus.sharedstation.app.dto; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.bonus.sharedstation.common.pojo.PageDTO; +import com.fasterxml.jackson.annotation.JsonFormat; + +import java.util.Date; + +/** + * 车辆服务信息实体类 + */ + +@TableName("car_service") +public class CarServiceDTO extends PageDTO implements java.io.Serializable{ + + private static final long serialVersionUID = 6197622378439433176L; + /** + * 唯一标识符 + */ + private Integer id; + + /** + * 服务类型,如车辆年检、车辆保险等 + */ + private String serviceType; + + /** + * 服务描述 + */ + private String serviceDescription; + + /** + * 服务提供商的名称 + */ + private String providerName; + + /** + * 服务提供商的简介 + */ + private String providerDescription; + + /** + * 服务提供商的联系电话 + */ + private String contactPhone; + + /** + * 颜色 + */ + private String color; + /** + * 微信二维码的URL链接 + */ + private String wechatQrcodeUrl; + + private String logAddress; + + public String getLogAddress() { + return logAddress; + } + + public void setLogAddress(String logAddress) { + this.logAddress = logAddress; + } + + public String getColor() { + return color; + } + + public void setColor(String color) { + this.color = color; + } + + /** + * 创建人 + */ + private String createdBy; // 创建人 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createdTime; // 创建时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date updatedTime; // 修改时间 + private String updatedBy; // 修改人 + private String isDeleted; // 逻辑删除标识,1表示已删除,0表示未删除 + + @Override + public String toString() { + return "CarServiceDTO{" + + "id=" + id + + ", serviceType='" + serviceType + '\'' + + ", serviceDescription='" + serviceDescription + '\'' + + ", providerName='" + providerName + '\'' + + ", providerDescription='" + providerDescription + '\'' + + ", contactPhone='" + contactPhone + '\'' + + ", wechatQrcodeUrl='" + wechatQrcodeUrl + '\'' + + ", logAddress='" + logAddress + '\'' + + ", createdBy='" + createdBy + '\'' + + ", createdTime=" + createdTime + + ", updatedTime=" + updatedTime + + ", updatedBy='" + updatedBy + '\'' + + ", isDeleted='" + isDeleted + '\'' + + '}'; + } + + public String getCreatedBy() { + return createdBy; + } + + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + public Date getCreatedTime() { + return createdTime; + } + + public void setCreatedTime(Date createdTime) { + this.createdTime = createdTime; + } + + public Date getUpdatedTime() { + return updatedTime; + } + + public void setUpdatedTime(Date updatedTime) { + this.updatedTime = updatedTime; + } + + public String getUpdatedBy() { + return updatedBy; + } + + public void setUpdatedBy(String updatedBy) { + this.updatedBy = updatedBy; + } + + public String getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(String isDeleted) { + this.isDeleted = isDeleted; + } + + // Getters and Setters + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + public String getServiceDescription() { + return serviceDescription; + } + + public void setServiceDescription(String serviceDescription) { + this.serviceDescription = serviceDescription; + } + + public String getProviderName() { + return providerName; + } + + public void setProviderName(String providerName) { + this.providerName = providerName; + } + + public String getProviderDescription() { + return providerDescription; + } + + public void setProviderDescription(String providerDescription) { + this.providerDescription = providerDescription; + } + + public String getContactPhone() { + return contactPhone; + } + + public void setContactPhone(String contactPhone) { + this.contactPhone = contactPhone; + } + + public String getWechatQrcodeUrl() { + return wechatQrcodeUrl; + } + + public void setWechatQrcodeUrl(String wechatQrcodeUrl) { + this.wechatQrcodeUrl = wechatQrcodeUrl; + } +} diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/service/ICarServiceService.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/service/ICarServiceService.java new file mode 100644 index 00000000..09fb2c62 --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/service/ICarServiceService.java @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2021, orioc and/or its affiliates. All rights reserved. + * Use, Copy is subject to authorized license. + */ + package com.bonus.sharedstation.app.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.sharedstation.app.domain.CarService; +import com.bonus.sharedstation.app.dto.CarServiceDTO; + +/** + * 汽车服务 Service + * + * @author zhh + * @date 2024-11-15 + */ +public interface ICarServiceService extends IService { + + + + + + /** + * 汽车服务 + * @return 操作影响行数 + */ + AjaxResult insert(CarService carService); + + + /** + * 更新 + * + */ + AjaxResult updateInfoById(CarService carService); + +// + /** + * 删除汽车服务 + * + * @param + + * @return 操作影响行数 + */ + AjaxResult delete(CarService carService); +// + /** + * 分页查询列表 + * @param + * @return + */ + AjaxResult getListPage(CarServiceDTO dto); + + /** + * app + * @param dto + * @return + */ + AjaxResult getListPageApp(CarServiceDTO dto); + + + + + + + AjaxResult selectAll(CarService carService); + + + /** + * 详情 + * @param + * @return + */ + AjaxResult selectInfoById(CarService carService); +} diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/service/impl/CarServiceServiceImpl.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/service/impl/CarServiceServiceImpl.java new file mode 100644 index 00000000..119fc7ff --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/app/service/impl/CarServiceServiceImpl.java @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2021, orioc and/or its affiliates. All rights reserved. + * Use, Copy is subject to authorized license. + */ +package com.bonus.sharedstation.app.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.bonus.common.core.utils.StringUtils; +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.common.security.utils.SecurityUtils; +import com.bonus.sharedstation.app.domain.CarService; +import com.bonus.sharedstation.app.dto.CarServiceDTO; +import com.bonus.sharedstation.app.service.ICarServiceService; +import com.bonus.sharedstation.web.mapper.CarServiceMapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** + * Service实现 + * + * @author hyq + * @date 2024-03-15 + */ +@Service +@Transactional(readOnly = true) +@Slf4j +public class CarServiceServiceImpl extends ServiceImpl implements ICarServiceService { + + + /** + * Dao + */ + @Resource + private CarServiceMapper carServiceMapper; + + @Override + @Transactional(readOnly = false) + public AjaxResult insert(CarService dto) { + log.info("新增汽车服务:{} ", dto); + //得到登录人 + dto.setCreatedBy(SecurityUtils.getUsername()); + dto.setCreatedTime(new Date()); + boolean b = save(dto); + if (!b) { + return AjaxResult.error("新增汽车服务失败"); + } + return AjaxResult.success("新增汽车服务成功"); + } + + @Override + @Transactional(readOnly = false) + public AjaxResult updateInfoById(CarService dto) { + log.info("修改 入参: {}", dto); + dto.setCreatedBy(SecurityUtils.getUsername()); + dto.setCreatedTime(new Date()); + boolean b = updateById(dto); + if (!b) { + return AjaxResult.error("汽车服务修改失败"); + } + return AjaxResult.success( "汽车服务修改成功"); + } + + /** + * 分页查询 + * + * @param dto + * @return + */ + @Override + public AjaxResult getListPage(CarServiceDTO dto) { + log.info("查询 入参: {}", dto); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + // 创建分页对象 + Page page = new Page<>(dto.getCurrentPage(), dto.getLimit()); + queryWrapper + .like(CarService::getServiceType, dto.getServiceType()) + .eq(CarService::getIsDeleted, dto.getIsDeleted()) + .orderByDesc(CarService::getCreatedTime); + + Page result = carServiceMapper.selectPage(page, queryWrapper); + //处理参数问题 + return AjaxResult.success(result); + } + + /** + * 分页查询 + * + * @param dto + * @return + */ + @Override + public AjaxResult getListPageApp(CarServiceDTO dto) { + log.info("查询 入参: {}", dto); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + // 创建分页对象 + Page page = new Page<>(dto.getCurrentPage(), dto.getLimit()); + queryWrapper + .like(CarService::getServiceType, dto.getServiceType()) + .eq(CarService::getIsDeleted, dto.getIsDeleted()) + .orderByDesc(CarService::getCreatedTime); + + Page result = carServiceMapper.selectPage(page, queryWrapper); + //处理参数问题 + return AjaxResult.success(result); + } + + @Override + @Transactional(readOnly = false) + public AjaxResult delete(CarService carService) { + return AjaxResult.success(carServiceMapper.deleteById(carService.getId())); + } + + /** + * 查询全部 + * + * @param + * @return + */ + @Override + public AjaxResult selectAll(CarService carService) { + log.info("查询 入参: {}", carService); + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + // 创建分页对象 + queryWrapper + .like(CarService::getProviderName, carService.getProviderName()) + .eq(CarService::getIsDeleted, carService.getIsDeleted()) + .orderByDesc(CarService::getCreatedTime); + + List result = carServiceMapper.selectList(queryWrapper); + return AjaxResult.success(result); + } + + + /** + * 详情 + * + * @param + * @return + */ + @Override + public AjaxResult selectInfoById(CarService carService) { + CarService result = carServiceMapper.selectById(carService.getId()); + if (StringUtils.isNull(result)) { + return AjaxResult.error( "此汽车服务不存在"); + } + //处理参数问题 + return AjaxResult.success(result); + } +} diff --git a/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/web/mapper/CarServiceMapper.java b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/web/mapper/CarServiceMapper.java new file mode 100644 index 00000000..adc17f8b --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/java/com/bonus/sharedstation/web/mapper/CarServiceMapper.java @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2021, orioc and/or its affiliates. All rights reserved. + * Use, Copy is subject to authorized license. + */ + +package com.bonus.sharedstation.web.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.bonus.sharedstation.app.domain.CarService; +import org.apache.ibatis.annotations.Mapper; + +/** + * 设备位置 Dao + * + * @author zhh + * @date 2024-11-15 + */ +@Mapper +public interface CarServiceMapper extends BaseMapper { + + // 根据 ID 删除 + int deleteById(Integer id); + + +} diff --git a/bonus-modules/bonus-shared-station/src/main/resources/mapper/web/CarServiceMapper.xml b/bonus-modules/bonus-shared-station/src/main/resources/mapper/web/CarServiceMapper.xml new file mode 100644 index 00000000..e3a0869e --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/resources/mapper/web/CarServiceMapper.xml @@ -0,0 +1,11 @@ + + + + + + + update car_service set is_deleted = 1 + where id = #{id} + + + diff --git a/bonus-modules/bonus-shared-station/src/main/resources/mapper/web/EmergencyEquipmentMapper.xml b/bonus-modules/bonus-shared-station/src/main/resources/mapper/web/EmergencyEquipmentMapper.xml new file mode 100644 index 00000000..09a6b73a --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/resources/mapper/web/EmergencyEquipmentMapper.xml @@ -0,0 +1,11 @@ + + + + + + + update emergency_equipment set is_deleted = 1 + where id = #{id} + + + diff --git a/bonus-modules/bonus-shared-station/src/main/resources/mapper/web/FirstAidMapper.xml b/bonus-modules/bonus-shared-station/src/main/resources/mapper/web/FirstAidMapper.xml new file mode 100644 index 00000000..edaa0ec4 --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/resources/mapper/web/FirstAidMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + update first_aid_info set is_deleted = 1 + where id = #{id} + + + diff --git a/bonus-modules/bonus-shared-station/src/main/resources/mapper/web/MlConfigurationDateMapper.xml b/bonus-modules/bonus-shared-station/src/main/resources/mapper/web/MlConfigurationDateMapper.xml new file mode 100644 index 00000000..e762fc93 --- /dev/null +++ b/bonus-modules/bonus-shared-station/src/main/resources/mapper/web/MlConfigurationDateMapper.xml @@ -0,0 +1,11 @@ + + + + + + + update ml_configuration_date set is_deleted = 1 + where id = #{id} + + +