diff --git a/smart-common/smart-common-core/src/main/java/com/zhentao/common/core/web/page/PageDomain.java b/smart-common/smart-common-core/src/main/java/com/zhentao/common/core/web/page/PageDomain.java index a01bac30df21a231afdecee629b67f618f81d811..8be9711c22926699d5029877ff1fad74cdfa722c 100644 --- a/smart-common/smart-common-core/src/main/java/com/zhentao/common/core/web/page/PageDomain.java +++ b/smart-common/smart-common-core/src/main/java/com/zhentao/common/core/web/page/PageDomain.java @@ -20,6 +20,7 @@ public class PageDomain /** 排序的方向desc或者asc */ private String isAsc = "asc"; + private Boolean reasonable =true; public String getOrderBy() { @@ -69,4 +70,15 @@ public class PageDomain { this.isAsc = isAsc; } + + + public Boolean getReasonable() { + if (StringUtils.isNull(reasonable)) { + return Boolean.TRUE; + } + return reasonable; + } + public void setReasonable(Boolean reasonable) { + this.reasonable = reasonable; + } } diff --git a/smart-modules/smart-system/pom.xml b/smart-modules/smart-system/pom.xml index 00d8b0eb09ab77a752d38711943ebcc18bff3727..172fa73859fd992d423de317ac4bc9e48ffd1930 100644 --- a/smart-modules/smart-system/pom.xml +++ b/smart-modules/smart-system/pom.xml @@ -16,7 +16,16 @@ - + + io.minio + minio + 8.2.2 + + + com.github.pagehelper + pagehelper-spring-boot-starter + 1.4.1 + com.alibaba.cloud @@ -78,6 +87,26 @@ smart-common-swagger + + com.baomidou + mybatis-plus-boot-starter + + + org.projectlombok + lombok + + + io.minio + minio + 8.2.2 + compile + + + io.minio + minio + 8.2.2 + compile + diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/AttendanceRecordController.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/AttendanceRecordController.java new file mode 100644 index 0000000000000000000000000000000000000000..b2c5cc08cd4d142e12fda1385a59f006f7918ac3 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/AttendanceRecordController.java @@ -0,0 +1,63 @@ +package com.zhentao.system.controller; + + + +import com.zhentao.common.core.utils.SecurityUtils; +import com.zhentao.common.core.web.domain.AjaxResult; +import com.zhentao.system.domain.AttendanceRecord; +import com.zhentao.system.service.AttendanceRecordService; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +@RestController +@RequestMapping("/record") +public class AttendanceRecordController { + @Resource + private AttendanceRecordService recordService; + //打卡 + @GetMapping("/today") + public AjaxResult getTodayRecord() { + try { + Long userId = SecurityUtils.getUserId(); + AttendanceRecord record = recordService.getTodayRecord(userId); + return AjaxResult.success(record); + } catch (Exception e) { + return AjaxResult.error("获取今日打卡记录失败"); + } + } + @PostMapping("/check") + public AjaxResult check(@RequestParam String type) { + try { + Long userId = SecurityUtils.getUserId(); + boolean success; + if ("checkIn".equals(type)) { + success = recordService.checkIn(userId); + } else if ("checkOut".equals(type)) { + success = recordService.checkOut(userId); + } else { + return AjaxResult.error("无效的打卡类型"); + } + return success ? AjaxResult.success() : AjaxResult.error("打卡失败"); + } catch (Exception e) { + return AjaxResult.error(e.getMessage()); + } + } + @GetMapping("/list") + public AjaxResult list(Long employeeNo, String yearMonth){ + List all = recordService.all(employeeNo,yearMonth); + return AjaxResult.success(all); + } + @GetMapping("/export") + public AjaxResult export(String yearMonth){ + Long employeeId = SecurityUtils.getUserId(); + List all = recordService.all(employeeId,yearMonth); + for (AttendanceRecord attendanceRecord : all) { + String username = SecurityUtils.getUsername(); + attendanceRecord.setUserName(username); + } + return AjaxResult.success(all); + } + +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/CarAccessRecordController.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/CarAccessRecordController.java new file mode 100644 index 0000000000000000000000000000000000000000..953cb287e2067e540f007bd07b6a2a2eb35417c1 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/CarAccessRecordController.java @@ -0,0 +1,4 @@ +package com.zhentao.system.controller; + +public class CarAccessRecordController { +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/CarBlacklistController.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/CarBlacklistController.java new file mode 100644 index 0000000000000000000000000000000000000000..437fee622fab2fd4b70a4a9e34548357b06b8bc4 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/CarBlacklistController.java @@ -0,0 +1,132 @@ +package com.zhentao.system.controller; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.zhentao.common.core.constant.HttpStatus; +import com.zhentao.common.core.utils.StringUtils; +import com.zhentao.common.core.utils.poi.ExcelUtil; +import com.zhentao.common.core.utils.sql.SqlUtil; +import com.zhentao.common.core.web.domain.AjaxResult; +import com.zhentao.common.core.web.page.PageDomain; +import com.zhentao.common.core.web.page.TableDataInfo; +import com.zhentao.common.core.web.page.TableSupport; +import com.zhentao.common.log.annotation.Log; +import com.zhentao.common.log.enums.BusinessType; +import com.zhentao.common.security.annotation.PreAuthorize; +import com.zhentao.system.domain.CarBlacklist; +import com.zhentao.system.domain.CarWhitelist; +import com.zhentao.system.service.CarBlacklistService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; + +import java.io.IOException; +import java.util.List; + +import static com.github.pagehelper.page.PageMethod.startPage; + +@RestController +@RequestMapping("/blacklist") +public class CarBlacklistController { + @Autowired + private CarBlacklistService carBlacklistService; + + /** + * 查询车辆黑名单列表 + */ + @PreAuthorize(hasAnyPermi = "@ss.hasPermi('system:blacklist:list')") + @GetMapping("/list") + public TableDataInfo list(CarBlacklist carBlacklist) + { + startPage(); + List list = carBlacklistService.selectCarBlacklistList(carBlacklist); + return getDataTable(list); + } + protected TableDataInfo getDataTable(List list) + { + TableDataInfo rspData = new TableDataInfo(); + rspData.setCode(HttpStatus.SUCCESS); + rspData.setRows(list); + rspData.setMsg("查询成功"); + rspData.setTotal(new PageInfo(list).getTotal()); + return rspData; + } + protected void startPage() + { + PageDomain pageDomain = TableSupport.buildPageRequest(); + Integer pageNum = pageDomain.getPageNum(); + Integer pageSize = pageDomain.getPageSize(); + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) + { + String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); + PageHelper.startPage(pageNum, pageSize, orderBy); + } + } + + /** + * 导出车辆黑名单列表 + */ + @PreAuthorize(hasAnyPermi = "@ss.hasPermi('system:blacklist:export')") + @Log(title = "车辆黑名单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, CarBlacklist carBlacklist) throws IOException { + List list = carBlacklistService.selectCarBlacklistList(carBlacklist); + ExcelUtil util = new ExcelUtil(CarBlacklist.class); + util.exportExcel(response, list, "车辆黑名单数据"); + } + + /** + * 获取车辆黑名单详细信息 + */ + @PreAuthorize(hasAnyPermi = "@ss.hasPermi('system:blacklist:query')") + @GetMapping(value = "/{blacklistId}") + public AjaxResult getInfo(@PathVariable("blacklistId") Long blacklistId) + { + return AjaxResult.success(carBlacklistService.selectCarBlacklistByBlacklistId(blacklistId)); + } + + /** + * 新增车辆黑名单 + */ + @PreAuthorize(hasAnyPermi = "@ss.hasPermi('system:blacklist:add')") + @Log(title = "车辆黑名单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody CarBlacklist carBlacklist) + { + if (!carBlacklistService.checkPlateNumberUnique(carBlacklist.getPlateNumber())) + { + return AjaxResult.error("新增车辆黑名单'" + carBlacklist.getPlateNumber() + "'失败,车牌号码已存在"); + } + return toAjax(carBlacklistService.insertCarBlacklist(carBlacklist)); + } + + /** + * 修改车辆黑名单 + */ + @PreAuthorize(hasAnyPermi = "@ss.hasPermi('system:blacklist:edit')") + @Log(title = "车辆黑名单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody CarBlacklist carBlacklist) + { + return toAjax(carBlacklistService.updateCarBlacklist(carBlacklist)); + } + + /** + * 删除车辆黑名单 + */ + @PreAuthorize(hasAnyPermi = "@ss.hasPermi('system:blacklist:remove')") + @Log(title = "车辆黑名单", businessType = BusinessType.DELETE) + @DeleteMapping("/{blacklistIds}") + public AjaxResult remove(@PathVariable Long[] blacklistIds) + { + return toAjax(carBlacklistService.deleteCarBlacklistByBlacklistIds(blacklistIds)); + } + protected AjaxResult toAjax(int rows) + { + return rows > 0 ? AjaxResult.success() : AjaxResult.error(); + } + +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/CarInfoController.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/CarInfoController.java new file mode 100644 index 0000000000000000000000000000000000000000..9cf052fe31258c242471c38be898ad630103ddb4 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/CarInfoController.java @@ -0,0 +1,4 @@ +package com.zhentao.system.controller; + +public class CarInfoController { +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/CarSpecialPlateController.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/CarSpecialPlateController.java new file mode 100644 index 0000000000000000000000000000000000000000..8b732b1f8542c3e37f86836656ea5bfedead9b3c --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/CarSpecialPlateController.java @@ -0,0 +1,4 @@ +package com.zhentao.system.controller; + +public class CarSpecialPlateController { +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/CarWhitelistController.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/CarWhitelistController.java new file mode 100644 index 0000000000000000000000000000000000000000..b653e77a83bc76b9f294327ed18847a36671b1ef --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/CarWhitelistController.java @@ -0,0 +1,94 @@ +package com.zhentao.system.controller; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.zhentao.common.core.utils.StringUtils; +import com.zhentao.common.core.utils.sql.SqlUtil; +import com.zhentao.common.core.web.domain.AjaxResult; +import com.zhentao.common.core.web.page.PageDomain; +import com.zhentao.common.core.web.page.TableDataInfo; +import com.zhentao.common.core.web.page.TableSupport; +import com.zhentao.system.domain.CarWhitelist; +import com.zhentao.system.service.CarWhitelistService; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; +@RestController +@RequestMapping("/whitelist") +public class CarWhitelistController { + @Resource + private CarWhitelistService carWhitelistService; + + /** + * 查询白名单列表 + */ + @GetMapping("/list") + public TableDataInfo list(CarWhitelist carWhitelist) { + startPage(); + List list = carWhitelistService.selectCarWhitelistList(carWhitelist); + return getDataTable(list); + } + private void startPage() { + PageDomain pageDomain = TableSupport.buildPageRequest(); + Integer pageNum = pageDomain.getPageNum(); + Integer pageSize = pageDomain.getPageSize(); + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) { + String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); + Boolean reasonable = pageDomain.getReasonable(); + PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable); + } + } + private TableDataInfo getDataTable(List list) { + TableDataInfo rspData = new TableDataInfo(); + rspData.setCode(200); + rspData.setMsg("查询成功"); + rspData.setRows(list); + rspData.setTotal(new PageInfo(list).getTotal()); + return rspData; + } + + /** + * 获取白名单详细信息 + */ + @GetMapping(value = "/{whitelistId}") + public AjaxResult getInfo(@PathVariable("whitelistId") Long whitelistId) { + return AjaxResult.success(carWhitelistService.selectCarWhitelistByWhitelistId(whitelistId)); + } + + /** + * 新增白名单 + */ + @PostMapping + public AjaxResult add(@RequestBody CarWhitelist carWhitelist) { + return toAjax(carWhitelistService.insertCarWhitelist(carWhitelist)); + } + + /** + * 修改白名单 + */ + @PostMapping("/edit") // 改为 POST 方法 + public AjaxResult edit(@RequestBody CarWhitelist carWhitelist) { + return toAjax(carWhitelistService.updateCarWhitelist(carWhitelist)); + } + + /** + * 删除白名单 + */ + @DeleteMapping("/{whitelistIds}") + public AjaxResult remove(@PathVariable Long[] whitelistIds) { + return toAjax(carWhitelistService.deleteCarWhitelistByWhitelistIds(whitelistIds)); + } + + /** + * 修改状态 + */ + @PostMapping("/changeStatus") + public AjaxResult changeStatus(@RequestBody CarWhitelist carWhitelist) { + return toAjax(carWhitelistService.updateCarWhitelist(carWhitelist)); + } + + protected AjaxResult toAjax(int rows) { + return rows > 0 ? AjaxResult.success() : AjaxResult.error(); + } +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/SysCarouselController.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/SysCarouselController.java new file mode 100644 index 0000000000000000000000000000000000000000..471213e02507e19b126fec146dd5561617d7078b --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/controller/SysCarouselController.java @@ -0,0 +1,90 @@ +package com.zhentao.system.controller; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.zhentao.common.core.utils.StringUtils; +import com.zhentao.common.core.utils.sql.SqlUtil; +import com.zhentao.common.core.web.domain.AjaxResult; +import com.zhentao.common.core.web.page.PageDomain; +import com.zhentao.common.core.web.page.TableDataInfo; +import com.zhentao.common.core.web.page.TableSupport; +import com.zhentao.system.domain.SysCarousel; +import com.zhentao.system.service.SysCarouselService; +import io.minio.*; +import io.minio.http.Method; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.util.List; +import java.util.concurrent.TimeUnit; + +import static com.zhentao.common.core.web.domain.AjaxResult.success; + +@RestController +@RequestMapping("/carousel") +public class SysCarouselController { + @Autowired + private SysCarouselService carouselService; + + @GetMapping("/list") + public TableDataInfo list(SysCarousel carousel) { + startPage(); + List list = carouselService.selectCarouselList(carousel); + System.err.println(list); + return getDataTable(list); + } + + private void startPage() { + PageDomain pageDomain = TableSupport.buildPageRequest(); + Integer pageNum = pageDomain.getPageNum(); + Integer pageSize = pageDomain.getPageSize(); + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) { + String orderBy = SqlUtil.escapeOrderBySql(pageDomain.getOrderBy()); + Boolean reasonable = pageDomain.getReasonable(); + PageHelper.startPage(pageNum, pageSize, orderBy).setReasonable(reasonable); + } + } + + private TableDataInfo getDataTable(List list) { + TableDataInfo rspData = new TableDataInfo(); + rspData.setCode(200); + rspData.setMsg("查询成功"); + rspData.setRows(list); + rspData.setTotal(new PageInfo(list).getTotal()); + return rspData; + } + + + @GetMapping(value = "/{carouselId}") + public AjaxResult getInfo(@PathVariable("carouselId") Long carouselId) { + return success(carouselService.selectCarouselById(carouselId)); + } + + @PostMapping + public AjaxResult add(@RequestBody SysCarousel carousel) { + return toAjax(carouselService.insertCarousel(carousel)); + } + + @PutMapping + public AjaxResult edit(@RequestBody SysCarousel carousel) { + return toAjax(carouselService.updateCarousel(carousel)); + } + + @DeleteMapping("/{carouselIds}") + public AjaxResult remove(@PathVariable Long[] carouselIds) { + return toAjax(carouselService.deleteCarouselByIds(carouselIds)); + } + + @PutMapping("/changeStatus") + public AjaxResult changeStatus(@RequestBody SysCarousel carousel) { + return toAjax(carouselService.changeStatus(carousel)); + } + + /** + * 将操作结果转换为 AjaxResult + */ + private AjaxResult toAjax(int rows) { + return rows > 0 ? success() : AjaxResult.error(); + } +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/AttendanceRecord.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/AttendanceRecord.java new file mode 100644 index 0000000000000000000000000000000000000000..9d5e817d4ef1d2d6de15b039fc4e83acadcc8fce --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/AttendanceRecord.java @@ -0,0 +1,119 @@ +package com.zhentao.system.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * + * @TableName attendance_record + */ +@TableName(value ="attendance_record") +@Data +public class AttendanceRecord implements Serializable { + /** + * + */ + @TableId(type = IdType.AUTO) + private Integer id; + + /** + * 工号 + */ + private String employeeId; + + /** + * 日期 + */ + private Date date; + + /** + * 签到时间 + */ + private Date checkIn; + + /** + * 签退时间 + */ + private Date checkOut; + + /** + * 状态:正常、迟到、早退、缺勤 + */ + private String status; + + /** + * 备注 + */ + private String remark; + + /** + * + */ + private Date createTime; + @TableField(exist = false) + private String userName; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + AttendanceRecord other = (AttendanceRecord) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getEmployeeId() == null ? other.getEmployeeId() == null : this.getEmployeeId().equals(other.getEmployeeId())) + && (this.getDate() == null ? other.getDate() == null : this.getDate().equals(other.getDate())) + && (this.getCheckIn() == null ? other.getCheckIn() == null : this.getCheckIn().equals(other.getCheckIn())) + && (this.getCheckOut() == null ? other.getCheckOut() == null : this.getCheckOut().equals(other.getCheckOut())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getEmployeeId() == null) ? 0 : getEmployeeId().hashCode()); + result = prime * result + ((getDate() == null) ? 0 : getDate().hashCode()); + result = prime * result + ((getCheckIn() == null) ? 0 : getCheckIn().hashCode()); + result = prime * result + ((getCheckOut() == null) ? 0 : getCheckOut().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", employeeId=").append(employeeId); + sb.append(", date=").append(date); + sb.append(", checkIn=").append(checkIn); + sb.append(", checkOut=").append(checkOut); + sb.append(", status=").append(status); + sb.append(", remark=").append(remark); + sb.append(", createTime=").append(createTime); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/BaseEntity.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/BaseEntity.java new file mode 100644 index 0000000000000000000000000000000000000000..16dc52ccf177643dab547218eb7511db5f78cd92 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/BaseEntity.java @@ -0,0 +1,40 @@ +package com.zhentao.system.domain; + +import com.baomidou.mybatisplus.annotation.TableField; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +@Data +public class BaseEntity implements Serializable { + private static final long serialVersionUID = 1L; + + /** 创建者 */ + private String createBy; + + /** 创建时间 */ + private Date createTime; + + /** 更新者 */ + private String updateBy; + + /** 更新时间 */ + private Date updateTime; + + /** 备注 */ + private String remark; + + /** 请求参数 */ + @TableField(exist = false) + private Map params; + + public Map getParams() { + if (params == null) { + params = new HashMap<>(); + } + return params; + } +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/CarAccessRecord.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/CarAccessRecord.java new file mode 100644 index 0000000000000000000000000000000000000000..58321e584c7e33403beb8f58d5bc60a52de9d466 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/CarAccessRecord.java @@ -0,0 +1,133 @@ +package com.zhentao.system.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 车辆进出记录表 + * @TableName car_access_record + */ +@TableName(value ="car_access_record") +@Data +public class CarAccessRecord implements Serializable { + /** + * 记录ID + */ + @TableId(type = IdType.AUTO) + private Long recordId; + + /** + * 车牌号码 + */ + private String plateNumber; + + /** + * 类型(1:进场 2:出场) + */ + private String accessType; + + /** + * 时间 + */ + private Date accessTime; + + /** + * 设备ID + */ + private String deviceId; + + /** + * 设备名称 + */ + private String deviceName; + + /** + * 抓拍图片URL + */ + private String imageUrl; + + /** + * 名单类型(1:黑名单 2:白名单 3:特殊车牌) + */ + private String listType; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 备注 + */ + private String remark; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + CarAccessRecord other = (CarAccessRecord) that; + return (this.getRecordId() == null ? other.getRecordId() == null : this.getRecordId().equals(other.getRecordId())) + && (this.getPlateNumber() == null ? other.getPlateNumber() == null : this.getPlateNumber().equals(other.getPlateNumber())) + && (this.getAccessType() == null ? other.getAccessType() == null : this.getAccessType().equals(other.getAccessType())) + && (this.getAccessTime() == null ? other.getAccessTime() == null : this.getAccessTime().equals(other.getAccessTime())) + && (this.getDeviceId() == null ? other.getDeviceId() == null : this.getDeviceId().equals(other.getDeviceId())) + && (this.getDeviceName() == null ? other.getDeviceName() == null : this.getDeviceName().equals(other.getDeviceName())) + && (this.getImageUrl() == null ? other.getImageUrl() == null : this.getImageUrl().equals(other.getImageUrl())) + && (this.getListType() == null ? other.getListType() == null : this.getListType().equals(other.getListType())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getRecordId() == null) ? 0 : getRecordId().hashCode()); + result = prime * result + ((getPlateNumber() == null) ? 0 : getPlateNumber().hashCode()); + result = prime * result + ((getAccessType() == null) ? 0 : getAccessType().hashCode()); + result = prime * result + ((getAccessTime() == null) ? 0 : getAccessTime().hashCode()); + result = prime * result + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode()); + result = prime * result + ((getDeviceName() == null) ? 0 : getDeviceName().hashCode()); + result = prime * result + ((getImageUrl() == null) ? 0 : getImageUrl().hashCode()); + result = prime * result + ((getListType() == null) ? 0 : getListType().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", recordId=").append(recordId); + sb.append(", plateNumber=").append(plateNumber); + sb.append(", accessType=").append(accessType); + sb.append(", accessTime=").append(accessTime); + sb.append(", deviceId=").append(deviceId); + sb.append(", deviceName=").append(deviceName); + sb.append(", imageUrl=").append(imageUrl); + sb.append(", listType=").append(listType); + sb.append(", createTime=").append(createTime); + sb.append(", remark=").append(remark); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/CarBlacklist.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/CarBlacklist.java new file mode 100644 index 0000000000000000000000000000000000000000..bca5c0dd1dfd7635f612b05523acb685562186ef --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/CarBlacklist.java @@ -0,0 +1,149 @@ +package com.zhentao.system.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.zhentao.common.core.annotation.Excel; +import lombok.Data; + +/** + * 车辆黑名单表 + * @TableName car_blacklist + */ +@TableName(value ="car_blacklist") +@Data +public class CarBlacklist implements Serializable { + /** + * 黑名单ID + */ + @TableId(type = IdType.AUTO) + private Long blacklistId; + + /** + * 车牌号码 + */ + private String plateNumber; + + /** + * 加入原因 + */ + private String reason; + + /** + * 生效时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date startTime; + + /** + * 失效时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date endTime; + + /** + * 状态(0:生效 1:失效) + */ + private String status; + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + + private Date createTime; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 备注 + */ + private String remark; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + CarBlacklist other = (CarBlacklist) that; + return (this.getBlacklistId() == null ? other.getBlacklistId() == null : this.getBlacklistId().equals(other.getBlacklistId())) + && (this.getPlateNumber() == null ? other.getPlateNumber() == null : this.getPlateNumber().equals(other.getPlateNumber())) + && (this.getReason() == null ? other.getReason() == null : this.getReason().equals(other.getReason())) + && (this.getStartTime() == null ? other.getStartTime() == null : this.getStartTime().equals(other.getStartTime())) + && (this.getEndTime() == null ? other.getEndTime() == null : this.getEndTime().equals(other.getEndTime())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getBlacklistId() == null) ? 0 : getBlacklistId().hashCode()); + result = prime * result + ((getPlateNumber() == null) ? 0 : getPlateNumber().hashCode()); + result = prime * result + ((getReason() == null) ? 0 : getReason().hashCode()); + result = prime * result + ((getStartTime() == null) ? 0 : getStartTime().hashCode()); + result = prime * result + ((getEndTime() == null) ? 0 : getEndTime().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", blacklistId=").append(blacklistId); + sb.append(", plateNumber=").append(plateNumber); + sb.append(", reason=").append(reason); + sb.append(", startTime=").append(startTime); + sb.append(", endTime=").append(endTime); + sb.append(", status=").append(status); + sb.append(", createBy=").append(createBy); + sb.append(", createTime=").append(createTime); + sb.append(", updateBy=").append(updateBy); + sb.append(", updateTime=").append(updateTime); + sb.append(", remark=").append(remark); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/CarInfo.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/CarInfo.java new file mode 100644 index 0000000000000000000000000000000000000000..ad8bf771330f130e649893e31bdc46d79d8c932d --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/CarInfo.java @@ -0,0 +1,157 @@ +package com.zhentao.system.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 车辆信息表 + * @TableName car_info + */ +@TableName(value ="car_info") +@Data +public class CarInfo implements Serializable { + /** + * 车辆ID + */ + @TableId(type = IdType.AUTO) + private Long carId; + + /** + * 车牌号码 + */ + private String plateNumber; + + /** + * 车牌颜色 + */ + private String plateColor; + + /** + * 车辆类型(1:小型车 2:中型车 3:大型车) + */ + private String carType; + + /** + * 车主姓名 + */ + private Integer userId; + + /** + * 车主电话 + */ + private String ownerPhone; + + /** + * 绑定时间 + */ + private Date bindTime; + + /** + * 状态(0:正常 1:禁用) + */ + private String status; + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 备注 + */ + private String remark; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + CarInfo other = (CarInfo) that; + return (this.getCarId() == null ? other.getCarId() == null : this.getCarId().equals(other.getCarId())) + && (this.getPlateNumber() == null ? other.getPlateNumber() == null : this.getPlateNumber().equals(other.getPlateNumber())) + && (this.getPlateColor() == null ? other.getPlateColor() == null : this.getPlateColor().equals(other.getPlateColor())) + && (this.getCarType() == null ? other.getCarType() == null : this.getCarType().equals(other.getCarType())) + && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId())) + && (this.getOwnerPhone() == null ? other.getOwnerPhone() == null : this.getOwnerPhone().equals(other.getOwnerPhone())) + && (this.getBindTime() == null ? other.getBindTime() == null : this.getBindTime().equals(other.getBindTime())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getCarId() == null) ? 0 : getCarId().hashCode()); + result = prime * result + ((getPlateNumber() == null) ? 0 : getPlateNumber().hashCode()); + result = prime * result + ((getPlateColor() == null) ? 0 : getPlateColor().hashCode()); + result = prime * result + ((getCarType() == null) ? 0 : getCarType().hashCode()); + result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); + result = prime * result + ((getOwnerPhone() == null) ? 0 : getOwnerPhone().hashCode()); + result = prime * result + ((getBindTime() == null) ? 0 : getBindTime().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", carId=").append(carId); + sb.append(", plateNumber=").append(plateNumber); + sb.append(", plateColor=").append(plateColor); + sb.append(", carType=").append(carType); + sb.append(", ownerName=").append(userId); + sb.append(", ownerPhone=").append(ownerPhone); + sb.append(", bindTime=").append(bindTime); + sb.append(", status=").append(status); + sb.append(", createBy=").append(createBy); + sb.append(", createTime=").append(createTime); + sb.append(", updateBy=").append(updateBy); + sb.append(", updateTime=").append(updateTime); + sb.append(", remark=").append(remark); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/CarSpecialPlate.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/CarSpecialPlate.java new file mode 100644 index 0000000000000000000000000000000000000000..b62fdc7ffc16494caf50080ae2908ec7ea14b058 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/CarSpecialPlate.java @@ -0,0 +1,133 @@ +package com.zhentao.system.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +/** + * 特殊车牌配置表 + * @TableName car_special_plate + */ +@TableName(value ="car_special_plate") +@Data +public class CarSpecialPlate implements Serializable { + /** + * 配置ID + */ + @TableId(type = IdType.AUTO) + private Long plateId; + + /** + * 车牌前缀 + */ + private String platePrefix; + + /** + * 车牌类型(1:军车 2:警车 3:使馆车 4:教练车) + */ + private String plateType; + + /** + * 描述 + */ + private String description; + + /** + * 状态(0:启用 1:停用) + */ + private String status; + + /** + * 创建者 + */ + private String createBy; + + /** + * 创建时间 + */ + private Date createTime; + + /** + * 更新者 + */ + private String updateBy; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 备注 + */ + private String remark; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + CarSpecialPlate other = (CarSpecialPlate) that; + return (this.getPlateId() == null ? other.getPlateId() == null : this.getPlateId().equals(other.getPlateId())) + && (this.getPlatePrefix() == null ? other.getPlatePrefix() == null : this.getPlatePrefix().equals(other.getPlatePrefix())) + && (this.getPlateType() == null ? other.getPlateType() == null : this.getPlateType().equals(other.getPlateType())) + && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription())) + && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus())) + && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy())) + && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime())) + && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy())) + && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime())) + && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getPlateId() == null) ? 0 : getPlateId().hashCode()); + result = prime * result + ((getPlatePrefix() == null) ? 0 : getPlatePrefix().hashCode()); + result = prime * result + ((getPlateType() == null) ? 0 : getPlateType().hashCode()); + result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode()); + result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode()); + result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode()); + result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode()); + result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode()); + result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode()); + result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", plateId=").append(plateId); + sb.append(", platePrefix=").append(platePrefix); + sb.append(", plateType=").append(plateType); + sb.append(", description=").append(description); + sb.append(", status=").append(status); + sb.append(", createBy=").append(createBy); + sb.append(", createTime=").append(createTime); + sb.append(", updateBy=").append(updateBy); + sb.append(", updateTime=").append(updateTime); + sb.append(", remark=").append(remark); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/CarWhitelist.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/CarWhitelist.java new file mode 100644 index 0000000000000000000000000000000000000000..9ba530e0071da489bcdc09b247fdd5a966508fdb --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/CarWhitelist.java @@ -0,0 +1,55 @@ +package com.zhentao.system.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 lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; +import java.util.Map; + +@TableName(value ="car_whitelist") +@Data +public class CarWhitelist implements Serializable { + + @TableId(type = IdType.AUTO) + private Long whitelistId; + + private String plateNumber; + + private String type; + + private String reason; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date startTime; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date endTime; + + private String status; + + private String createBy; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date createTime; + + private String updateBy; + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date updateTime; + + private String remark; + + @TableField(exist = false) + private Map params; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/SysCarousel.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/SysCarousel.java new file mode 100644 index 0000000000000000000000000000000000000000..5a46dd08c4398b6762ba447d27fcca0f5d830777 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/domain/SysCarousel.java @@ -0,0 +1,59 @@ +package com.zhentao.system.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 轮播图管理表 + * @TableName sys_carousel + */ +@TableName(value ="sys_carousel") +@Data +@EqualsAndHashCode(callSuper = true) +public class SysCarousel extends BaseEntity { + /** + * 轮播图ID + */ + @TableId(type = IdType.AUTO) + private Long carouselId; + + /** + * 标题 + */ + private String title; + + /** + * 图片地址 + */ + private String imageUrl; + + /** + * 跳转链接 + */ + private String linkUrl; + + /** + * 排序号 + */ + private Integer sortOrder; + + /** + * 状态(0正常 1停用) + */ + private String status; + + /** + * 展示开始时间 + */ + private Date startTime; + + /** + * 展示结束时间 + */ + private Date endTime; +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/AttendanceRecordMapper.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/AttendanceRecordMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..421f7f110a09421180477a1b913f7e13f9fa0862 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/AttendanceRecordMapper.java @@ -0,0 +1,33 @@ +package com.zhentao.system.mapper; + +import com.zhentao.system.domain.AttendanceRecord; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; + +import java.sql.Time; +import java.util.List; + +/** +* @author 17074 +* @description 针对表【attendance_record】的数据库操作Mapper +* @createDate 2025-02-11 11:10:27 +* @Entity com.zhentao.system.domain.AttendanceRecord +*/ +public interface AttendanceRecordMapper extends BaseMapper { + + AttendanceRecord getTodayRecord(Long userId); + + int updateCheckIn(@Param("userId") Long userId, + @Param("checkInTime") Time checkInTime, + @Param("status") String status); + + int updateCheckOut(@Param("userId") Long userId, + @Param("checkOutTime") Time checkOutTime, + @Param("status") String status); + + List listaa(@Param("employeeId") Long employeeId,@Param("yearMonth") String yearMonth); +} + + + + diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/CarAccessRecordMapper.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/CarAccessRecordMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..0aeb1f479e8dd3b0ef1049720d8892d776ad6fcb --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/CarAccessRecordMapper.java @@ -0,0 +1,18 @@ +package com.zhentao.system.mapper; + +import com.zhentao.system.domain.CarAccessRecord; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author 17074 +* @description 针对表【car_access_record(车辆进出记录表)】的数据库操作Mapper +* @createDate 2025-02-17 09:43:31 +* @Entity com.zhentao.system.domain.CarAccessRecord +*/ +public interface CarAccessRecordMapper extends BaseMapper { + +} + + + + diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/CarBlacklistMapper.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/CarBlacklistMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..307d2c61b932109ccfc4c2066173d8ddf997b265 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/CarBlacklistMapper.java @@ -0,0 +1,76 @@ +package com.zhentao.system.mapper; + +import com.zhentao.system.domain.CarBlacklist; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +import java.util.List; + +/** +* @author 17074 +* @description 针对表【car_blacklist(车辆黑名单表)】的数据库操作Mapper +* @createDate 2025-02-17 09:43:31 +* @Entity com.zhentao.system.domain.CarBlacklist +*/ +public interface CarBlacklistMapper extends BaseMapper { + /** + * 查询车辆黑名单列表 + * + * @param carBlacklist 车辆黑名单 + * @return 车辆黑名单集合 + */ + public List selectCarBlacklistList(CarBlacklist carBlacklist); + + /** + * 查询车辆黑名单详细 + * + * @param blacklistId 车辆黑名单主键 + * @return 车辆黑名单 + */ + public CarBlacklist selectCarBlacklistByBlacklistId(Long blacklistId); + + /** + * 新增车辆黑名单 + * + * @param carBlacklist 车辆黑名单 + * @return 结果 + */ + public int insertCarBlacklist(CarBlacklist carBlacklist); + + /** + * 修改车辆黑名单 + * + * @param carBlacklist 车辆黑名单 + * @return 结果 + */ + public int updateCarBlacklist(CarBlacklist carBlacklist); + + /** + * 删除车辆黑名单 + * + * @param blacklistId 车辆黑名单主键 + * @return 结果 + */ + public int deleteCarBlacklistByBlacklistId(Long blacklistId); + + /** + * 批量删除车辆黑名单 + * + * @param blacklistIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteCarBlacklistByBlacklistIds(Long[] blacklistIds); + + /** + * 校验车牌号码是否唯一 + * + * @param plateNumber 车牌号码 + * @return 结果 + */ + public CarBlacklist checkPlateNumberUnique(String plateNumber); + + +} + + + + diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/CarInfoMapper.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/CarInfoMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..0e19b0ea25043aa2e9e8c5513b8c918a626b9f80 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/CarInfoMapper.java @@ -0,0 +1,18 @@ +package com.zhentao.system.mapper; + +import com.zhentao.system.domain.CarInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author 17074 +* @description 针对表【car_info(车辆信息表)】的数据库操作Mapper +* @createDate 2025-02-17 09:43:31 +* @Entity com.zhentao.system.domain.CarInfo +*/ +public interface CarInfoMapper extends BaseMapper { + +} + + + + diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/CarSpecialPlateMapper.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/CarSpecialPlateMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..22b25f629ba5ca193917d29fb3305f74faf9a87d --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/CarSpecialPlateMapper.java @@ -0,0 +1,18 @@ +package com.zhentao.system.mapper; + +import com.zhentao.system.domain.CarSpecialPlate; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author 17074 +* @description 针对表【car_special_plate(特殊车牌配置表)】的数据库操作Mapper +* @createDate 2025-02-17 09:43:31 +* @Entity com.zhentao.system.domain.CarSpecialPlate +*/ +public interface CarSpecialPlateMapper extends BaseMapper { + +} + + + + diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/CarWhitelistMapper.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/CarWhitelistMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..3f34ac2d2cb51e2006673e7937ad9d29caa465cf --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/CarWhitelistMapper.java @@ -0,0 +1,31 @@ +package com.zhentao.system.mapper; + +import com.zhentao.system.domain.CarWhitelist; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +import java.util.List; + +/** +* @author 17074 +* @description 针对表【car_whitelist(车辆白名单表)】的数据库操作Mapper +* @createDate 2025-02-17 09:43:31 +* @Entity com.zhentao.system.domain.CarWhitelist +*/ +public interface CarWhitelistMapper extends BaseMapper { + + int deleteCarWhitelistByWhitelistId(Long whitelistId); + + int deleteCarWhitelistByWhitelistIds(Long[] whitelistIds); + + int updateCarWhitelist(CarWhitelist carWhitelist); + + int insertCarWhitelist(CarWhitelist carWhitelist); + + List selectCarWhitelistList(CarWhitelist carWhitelist); + + CarWhitelist selectCarWhitelistByWhitelistId(Long whitelistId); +} + + + + diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/SysCarouselMapper.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/SysCarouselMapper.java new file mode 100644 index 0000000000000000000000000000000000000000..50c294ee65064f885b0441d5c6bc3eacafee067e --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/mapper/SysCarouselMapper.java @@ -0,0 +1,29 @@ +package com.zhentao.system.mapper; + +import com.zhentao.system.domain.SysCarousel; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +import java.util.List; + +/** +* @author 17074 +* @description 针对表【sys_carousel(轮播图管理表)】的数据库操作Mapper +* @createDate 2025-02-13 13:57:32 +* @Entity com.zhentao.system.domain.SysCarousel +*/ +public interface SysCarouselMapper extends BaseMapper { + + List selectCarouselList(SysCarousel carousel); + + SysCarousel selectCarouselById(Long carouselId); + + int insertCarousel(SysCarousel carousel); + + int updateCarousel(SysCarousel carousel); + + int deleteCarouselByIds(Long[] carouselIds); +} + + + + diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/service/AttendanceRecordService.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/AttendanceRecordService.java new file mode 100644 index 0000000000000000000000000000000000000000..4167595d242a9dd5e9479e863c5f3360f5fb9c79 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/AttendanceRecordService.java @@ -0,0 +1,22 @@ +package com.zhentao.system.service; + +import com.zhentao.system.domain.AttendanceRecord; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** +* @author 17074 +* @description 针对表【attendance_record】的数据库操作Service +* @createDate 2025-02-11 11:10:27 +*/ +public interface AttendanceRecordService extends IService { + + AttendanceRecord getTodayRecord(Long userId); + + boolean checkIn(Long userId); + + boolean checkOut(Long userId); + + List all(Long employeeId, String yearMonth); +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/service/CarAccessRecordService.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/CarAccessRecordService.java new file mode 100644 index 0000000000000000000000000000000000000000..96ad9fb80506192d234b8214a70846855081e64e --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/CarAccessRecordService.java @@ -0,0 +1,13 @@ +package com.zhentao.system.service; + +import com.zhentao.system.domain.CarAccessRecord; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author 17074 +* @description 针对表【car_access_record(车辆进出记录表)】的数据库操作Service +* @createDate 2025-02-17 09:43:31 +*/ +public interface CarAccessRecordService extends IService { + +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/service/CarBlacklistService.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/CarBlacklistService.java new file mode 100644 index 0000000000000000000000000000000000000000..4ca24503f542edbc0ef07a76797514eb012408e1 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/CarBlacklistService.java @@ -0,0 +1,70 @@ +package com.zhentao.system.service; + +import com.zhentao.system.domain.CarBlacklist; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** +* @author 17074 +* @description 针对表【car_blacklist(车辆黑名单表)】的数据库操作Service +* @createDate 2025-02-17 09:43:31 +*/ +public interface CarBlacklistService extends IService { + + /** + * 查询车辆黑名单列表 + * + * @param carBlacklist 车辆黑名单 + * @return 车辆黑名单集合 + */ + public List selectCarBlacklistList(CarBlacklist carBlacklist); + + /** + * 查询车辆黑名单详细 + * + * @param blacklistId 车辆黑名单主键 + * @return 车辆黑名单 + */ + public CarBlacklist selectCarBlacklistByBlacklistId(Long blacklistId); + + /** + * 新增车辆黑名单 + * + * @param carBlacklist 车辆黑名单 + * @return 结果 + */ + public int insertCarBlacklist(CarBlacklist carBlacklist); + + /** + * 修改车辆黑名单 + * + * @param carBlacklist 车辆黑名单 + * @return 结果 + */ + public int updateCarBlacklist(CarBlacklist carBlacklist); + + /** + * 批量删除车辆黑名单 + * + * @param blacklistIds 需要删除的车辆黑名单主键集合 + * @return 结果 + */ + public int deleteCarBlacklistByBlacklistIds(Long[] blacklistIds); + + /** + * 删除车辆黑名单信息 + * + * @param blacklistId 车辆黑名单主键 + * @return 结果 + */ + public int deleteCarBlacklistByBlacklistId(Long blacklistId); + + /** + * 校验车牌号码是否唯一 + * + * @param plateNumber 车牌号码 + * @return 结果 + */ + public boolean checkPlateNumberUnique(String plateNumber); +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/service/CarInfoService.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/CarInfoService.java new file mode 100644 index 0000000000000000000000000000000000000000..4f6cedbc6689cd42dcea60ba5a65d754e484df39 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/CarInfoService.java @@ -0,0 +1,13 @@ +package com.zhentao.system.service; + +import com.zhentao.system.domain.CarInfo; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author 17074 +* @description 针对表【car_info(车辆信息表)】的数据库操作Service +* @createDate 2025-02-17 09:43:31 +*/ +public interface CarInfoService extends IService { + +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/service/CarSpecialPlateService.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/CarSpecialPlateService.java new file mode 100644 index 0000000000000000000000000000000000000000..a33498a9aec585b04dfdb3b86e84d2c9b75237dc --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/CarSpecialPlateService.java @@ -0,0 +1,13 @@ +package com.zhentao.system.service; + +import com.zhentao.system.domain.CarSpecialPlate; +import com.baomidou.mybatisplus.extension.service.IService; + +/** +* @author 17074 +* @description 针对表【car_special_plate(特殊车牌配置表)】的数据库操作Service +* @createDate 2025-02-17 09:43:31 +*/ +public interface CarSpecialPlateService extends IService { + +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/service/CarWhitelistService.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/CarWhitelistService.java new file mode 100644 index 0000000000000000000000000000000000000000..27617f2bc95d5087ca054156263a18043601d914 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/CarWhitelistService.java @@ -0,0 +1,44 @@ +package com.zhentao.system.service; + +import com.zhentao.system.domain.CarWhitelist; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** +* @author 17074 +* @description 针对表【car_whitelist(车辆白名单表)】的数据库操作Service +* @createDate 2025-02-17 09:43:31 +*/ +public interface CarWhitelistService extends IService { + + /** + * 查询白名单 + */ + public CarWhitelist selectCarWhitelistByWhitelistId(Long whitelistId); + + /** + * 查询白名单列表 + */ + public List selectCarWhitelistList(CarWhitelist carWhitelist); + + /** + * 新增白名单 + */ + public int insertCarWhitelist(CarWhitelist carWhitelist); + + /** + * 修改白名单 + */ + public int updateCarWhitelist(CarWhitelist carWhitelist); + + /** + * 批量删除白名单 + */ + public int deleteCarWhitelistByWhitelistIds(Long[] whitelistIds); + + /** + * 删除白名单信息 + */ + public int deleteCarWhitelistByWhitelistId(Long whitelistId); +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/service/SysCarouselService.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/SysCarouselService.java new file mode 100644 index 0000000000000000000000000000000000000000..adab7d944f1ac553615b84835f5c73e6eff10506 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/SysCarouselService.java @@ -0,0 +1,26 @@ +package com.zhentao.system.service; + +import com.zhentao.system.domain.SysCarousel; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** +* @author 17074 +* @description 针对表【sys_carousel(轮播图管理表)】的数据库操作Service +* @createDate 2025-02-13 13:57:32 +*/ +public interface SysCarouselService extends IService { + + List selectCarouselList(SysCarousel carousel); + + public SysCarousel selectCarouselById(Long carouselId); + + int insertCarousel(SysCarousel carousel); + + int updateCarousel(SysCarousel carousel); + + int deleteCarouselByIds(Long[] carouselIds); + + int changeStatus(SysCarousel carousel); +} diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/AttendanceRecordServiceImpl.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/AttendanceRecordServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..8ba124468d9275a9f4c2e527134ea1ffaab09615 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/AttendanceRecordServiceImpl.java @@ -0,0 +1,97 @@ +package com.zhentao.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zhentao.system.domain.AttendanceRecord; +import com.zhentao.system.service.AttendanceRecordService; +import com.zhentao.system.mapper.AttendanceRecordMapper; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.sql.Time; +import java.time.LocalTime; +import java.util.Date; +import java.util.List; + +/** +* @author 17074 +* @description 针对表【attendance_record】的数据库操作Service实现 +* @createDate 2025-02-11 11:10:27 +*/ +@Service +public class AttendanceRecordServiceImpl extends ServiceImpl + implements AttendanceRecordService{ + @Resource + private AttendanceRecordMapper attendanceRecordMapper; + @Override + public AttendanceRecord getTodayRecord(Long userId) { + AttendanceRecord todayRecord = attendanceRecordMapper.getTodayRecord(userId); + System.err.println(todayRecord); + System.err.println(userId); + return todayRecord; + + } + + @Override + @Transactional + public boolean checkIn(Long userId) { + // 获取当前时间 + LocalTime now = LocalTime.now(); + Time checkInTime = Time.valueOf(now); + + // 判断打卡状态 + String status = "正常"; + if (now.isAfter(LocalTime.of(9, 30))) { + status = "迟到"; + } + System.err.println(userId + " " + checkInTime + " " + status); + // 更新打卡记录 + int rows = attendanceRecordMapper.updateCheckIn(userId, checkInTime, status); + if (rows == 0) { + // 如果没有记录则创建新记录 + AttendanceRecord record = new AttendanceRecord(); + record.setEmployeeId(String.valueOf(userId)); + record.setDate(new Date()); + record.setCheckIn(checkInTime); + record.setStatus(status); + return attendanceRecordMapper.insert(record) > 0; + } + return true; + } + + @Override + @Transactional + public boolean checkOut(Long userId) { + // 获取当前时间 + LocalTime now = LocalTime.now(); + Time checkOutTime = Time.valueOf(now); + + // 获取当前记录 + AttendanceRecord record = getTodayRecord(userId); + if (record == null) { + throw new RuntimeException("未找到上班打卡记录"); + } + + // 判断打卡状态 + String status = record.getStatus(); + if (now.isBefore(LocalTime.of(17, 30))) { + status = "早退"; + } + + // 更新打卡记录 + return attendanceRecordMapper.updateCheckOut(userId, checkOutTime, status)<0; + } + + @Override + public List all(Long employeeId, String yearMonth) { + List listaa = attendanceRecordMapper.listaa(employeeId, yearMonth); + System.out.println(listaa+"--------------------"); + return listaa; + } + + +} + + + + diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/CarAccessRecordServiceImpl.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/CarAccessRecordServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..6018f60a948b0548f6db133b64b8feec3f3bde95 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/CarAccessRecordServiceImpl.java @@ -0,0 +1,22 @@ +package com.zhentao.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zhentao.system.domain.CarAccessRecord; +import com.zhentao.system.service.CarAccessRecordService; +import com.zhentao.system.mapper.CarAccessRecordMapper; +import org.springframework.stereotype.Service; + +/** +* @author 17074 +* @description 针对表【car_access_record(车辆进出记录表)】的数据库操作Service实现 +* @createDate 2025-02-17 09:43:31 +*/ +@Service +public class CarAccessRecordServiceImpl extends ServiceImpl + implements CarAccessRecordService{ + +} + + + + diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/CarBlacklistServiceImpl.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/CarBlacklistServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..f34bb5bf7e404fcbb5c344843d1cb21cf47e15b4 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/CarBlacklistServiceImpl.java @@ -0,0 +1,103 @@ +package com.zhentao.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zhentao.common.core.utils.DateUtils; +import com.zhentao.system.domain.CarBlacklist; +import com.zhentao.system.service.CarBlacklistService; +import com.zhentao.system.mapper.CarBlacklistMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** +* @author 17074 +* @description 针对表【car_blacklist(车辆黑名单表)】的数据库操作Service实现 +* @createDate 2025-02-17 09:43:31 +*/ +@Service +public class CarBlacklistServiceImpl extends ServiceImpl + implements CarBlacklistService{ + + @Resource + private CarBlacklistMapper carBlacklistMapper; + + /** + * 查询车辆黑名单列表 + * + * @param carBlacklist 车辆黑名单 + * @return 车辆黑名单 + */ + @Override + public List selectCarBlacklistList(CarBlacklist carBlacklist) + { + return carBlacklistMapper.selectCarBlacklistList(carBlacklist); + } + + @Override + public boolean checkPlateNumberUnique(String plateNumber) { + return carBlacklistMapper.checkPlateNumberUnique(plateNumber)==null ; + } + + /** + * 查询车辆黑名单详细 + * + * @param blacklistId 车辆黑名单主键 + * @return 车辆黑名单 + */ + @Override + public CarBlacklist selectCarBlacklistByBlacklistId(Long blacklistId) + { + return carBlacklistMapper.selectCarBlacklistByBlacklistId(blacklistId); + } + + /** + * 新增车辆黑名单 + * + * @param carBlacklist 车辆黑名单 + * @return 结果 + */ + @Override + public int insertCarBlacklist(CarBlacklist carBlacklist) + { + carBlacklist.setCreateTime(DateUtils.getNowDate()); + return carBlacklistMapper.insertCarBlacklist(carBlacklist); + } + + /** + * 修改车辆黑名单 + * + * @param carBlacklist 车辆黑名单 + * @return 结果 + */ + @Override + public int updateCarBlacklist(CarBlacklist carBlacklist) + { + carBlacklist.setUpdateTime(DateUtils.getNowDate()); + return carBlacklistMapper.updateCarBlacklist(carBlacklist); + } + + /** + * 批量删除车辆黑名单 + * + * @param blacklistIds 需要删除的车辆黑名单主键 + * @return 结果 + */ + @Override + public int deleteCarBlacklistByBlacklistIds(Long[] blacklistIds) + { + return carBlacklistMapper.deleteCarBlacklistByBlacklistIds(blacklistIds); + } + + @Override + public int deleteCarBlacklistByBlacklistId(Long blacklistId) { + return carBlacklistMapper.deleteCarBlacklistByBlacklistId(blacklistId); + } + + +} + + + + diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/CarInfoServiceImpl.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/CarInfoServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..9b001c755fec02c7fe5288912232acc509ce386b --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/CarInfoServiceImpl.java @@ -0,0 +1,22 @@ +package com.zhentao.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zhentao.system.domain.CarInfo; +import com.zhentao.system.service.CarInfoService; +import com.zhentao.system.mapper.CarInfoMapper; +import org.springframework.stereotype.Service; + +/** +* @author 17074 +* @description 针对表【car_info(车辆信息表)】的数据库操作Service实现 +* @createDate 2025-02-17 09:43:31 +*/ +@Service +public class CarInfoServiceImpl extends ServiceImpl + implements CarInfoService{ + +} + + + + diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/CarSpecialPlateServiceImpl.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/CarSpecialPlateServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..56ccfa7ccb3c147944c1f62af81d37be3915e86f --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/CarSpecialPlateServiceImpl.java @@ -0,0 +1,22 @@ +package com.zhentao.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zhentao.system.domain.CarSpecialPlate; +import com.zhentao.system.service.CarSpecialPlateService; +import com.zhentao.system.mapper.CarSpecialPlateMapper; +import org.springframework.stereotype.Service; + +/** +* @author 17074 +* @description 针对表【car_special_plate(特殊车牌配置表)】的数据库操作Service实现 +* @createDate 2025-02-17 09:43:31 +*/ +@Service +public class CarSpecialPlateServiceImpl extends ServiceImpl + implements CarSpecialPlateService{ + +} + + + + diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/CarWhitelistServiceImpl.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/CarWhitelistServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..1b145239df14e3823186e265a5535713ae6a94e4 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/CarWhitelistServiceImpl.java @@ -0,0 +1,64 @@ +package com.zhentao.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zhentao.system.domain.CarWhitelist; +import com.zhentao.system.service.CarWhitelistService; +import com.zhentao.system.mapper.CarWhitelistMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** +* @author 17074 +* @description 针对表【car_whitelist(车辆白名单表)】的数据库操作Service实现 +* @createDate 2025-02-17 09:43:31 +*/ +@Service +public class CarWhitelistServiceImpl extends ServiceImpl + implements CarWhitelistService{ + @Autowired + private CarWhitelistMapper carWhitelistMapper; + + @Override + public CarWhitelist selectCarWhitelistByWhitelistId(Long whitelistId) { + return carWhitelistMapper.selectCarWhitelistByWhitelistId(whitelistId); + } + + @Override + public List selectCarWhitelistList(CarWhitelist carWhitelist) { + return carWhitelistMapper.selectCarWhitelistList(carWhitelist); + } + + + @Override + public int insertCarWhitelist(CarWhitelist carWhitelist) { + // 设置默认值 + if (carWhitelist.getType() == null) { + carWhitelist.setType("1"); // 默认为新能源车 + } + if (carWhitelist.getStatus() == null) { + carWhitelist.setStatus("0"); // 默认为生效状态 + } + return baseMapper.insert(carWhitelist); // 使用 MyBatis-Plus 的 insert 方法 + } + + @Override + public int updateCarWhitelist(CarWhitelist carWhitelist) { + return carWhitelistMapper.updateCarWhitelist(carWhitelist); + } + + @Override + public int deleteCarWhitelistByWhitelistIds(Long[] whitelistIds) { + return carWhitelistMapper.deleteCarWhitelistByWhitelistIds(whitelistIds); + } + + @Override + public int deleteCarWhitelistByWhitelistId(Long whitelistId) { + return carWhitelistMapper.deleteCarWhitelistByWhitelistId(whitelistId); + } +} + + + + diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/SysCarouselServiceImpl.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/SysCarouselServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..bdb4683fba50a97c29da92061cc6a7a5f7a4baeb --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/service/impl/SysCarouselServiceImpl.java @@ -0,0 +1,62 @@ +package com.zhentao.system.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.zhentao.common.core.utils.DateUtils; +import com.zhentao.common.core.utils.SecurityUtils; +import com.zhentao.system.domain.SysCarousel; +import com.zhentao.system.service.SysCarouselService; +import com.zhentao.system.mapper.SysCarouselMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** +* @author 17074 +* @description 针对表【sys_carousel(轮播图管理表)】的数据库操作Service实现 +* @createDate 2025-02-13 13:57:32 +*/ +@Service +public class SysCarouselServiceImpl extends ServiceImpl + implements SysCarouselService{ + @Autowired + private SysCarouselMapper carouselMapper; + + @Override + public List selectCarouselList(SysCarousel carousel) { + return carouselMapper.selectCarouselList(carousel); + } + + @Override + public SysCarousel selectCarouselById(Long carouselId) { + return carouselMapper.selectCarouselById(carouselId); + } + + @Override + public int insertCarousel(SysCarousel carousel) { + carousel.setCreateBy(SecurityUtils.getUsername()); + carousel.setCreateTime(DateUtils.getNowDate()); + return carouselMapper.insertCarousel(carousel); + } + + @Override + public int updateCarousel(SysCarousel carousel) { + carousel.setUpdateBy(SecurityUtils.getUsername()); + carousel.setUpdateTime(DateUtils.getNowDate()); + return carouselMapper.updateCarousel(carousel); + } + + @Override + public int deleteCarouselByIds(Long[] carouselIds) { + return carouselMapper.deleteCarouselByIds(carouselIds); + } + + @Override + public int changeStatus(SysCarousel carousel) { + return carouselMapper.updateCarousel(carousel); + } +} + + + + diff --git a/smart-modules/smart-system/src/main/java/com/zhentao/system/utils/ServletUtils.java b/smart-modules/smart-system/src/main/java/com/zhentao/system/utils/ServletUtils.java new file mode 100644 index 0000000000000000000000000000000000000000..3a7906082bfed5a1d940d673f48705faa76d8724 --- /dev/null +++ b/smart-modules/smart-system/src/main/java/com/zhentao/system/utils/ServletUtils.java @@ -0,0 +1,84 @@ +package com.ruoyi.common.utils; + +import java.io.IOException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import com.zhentao.common.core.text.Convert; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +/** + * 客户端工具类 + */ +public class ServletUtils { + /** + * 获取String参数 + */ + public static String getParameter(String name) { + return getRequest().getParameter(name); + } + + /** + * 获取String参数 + */ + public static String getParameter(String name, String defaultValue) { + return Convert.toStr(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取Integer参数 + */ + public static Integer getParameterToInt(String name) { + return Convert.toInt(getRequest().getParameter(name)); + } + + /** + * 获取Integer参数 + */ + public static Integer getParameterToInt(String name, Integer defaultValue) { + return Convert.toInt(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取Boolean参数 + */ + public static Boolean getParameterToBool(String name) { + return Convert.toBool(getRequest().getParameter(name)); + } + + /** + * 获取Boolean参数 + */ + public static Boolean getParameterToBool(String name, Boolean defaultValue) { + return Convert.toBool(getRequest().getParameter(name), defaultValue); + } + + /** + * 获取request + */ + public static HttpServletRequest getRequest() { + return getRequestAttributes().getRequest(); + } + + /** + * 获取response + */ + public static HttpServletResponse getResponse() { + return getRequestAttributes().getResponse(); + } + + /** + * 获取session + */ + public static HttpSession getSession() { + return getRequest().getSession(); + } + + public static ServletRequestAttributes getRequestAttributes() { + RequestAttributes attributes = RequestContextHolder.getRequestAttributes(); + return (ServletRequestAttributes) attributes; + } +} diff --git a/smart-modules/smart-system/src/main/resources/mapper/AttendanceRecordMapper.xml b/smart-modules/smart-system/src/main/resources/mapper/AttendanceRecordMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..21a291e22da587b473ea842c2758e9c335ccd01f --- /dev/null +++ b/smart-modules/smart-system/src/main/resources/mapper/AttendanceRecordMapper.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + id,employee_id,date, + check_in,check_out,status, + remark,create_time + + + update attendance_record set check_in = #{checkInTime},status = #{status} where employee_id = #{userId} and date = CURDATE() + + + update attendance_record set check_out = #{checkOutTime},status = #{status} where employee_id = #{userId} and date = CURDATE() + + + + diff --git a/smart-modules/smart-system/src/main/resources/mapper/CarAccessRecordMapper.xml b/smart-modules/smart-system/src/main/resources/mapper/CarAccessRecordMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..4cdced06f5b55a32b2fecf817eb1bc15a4ab43bf --- /dev/null +++ b/smart-modules/smart-system/src/main/resources/mapper/CarAccessRecordMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + record_id,plate_number,access_type, + access_time,device_id,device_name, + image_url,list_type,create_time, + remark + + diff --git a/smart-modules/smart-system/src/main/resources/mapper/CarBlacklistMapper.xml b/smart-modules/smart-system/src/main/resources/mapper/CarBlacklistMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..b5267c02db3a839d2df083675d4c4965e883bdcb --- /dev/null +++ b/smart-modules/smart-system/src/main/resources/mapper/CarBlacklistMapper.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + blacklist_id,plate_number,reason, + start_time,end_time,status, + create_by,create_time,update_by, + update_time,remark + + + + + + + + insert into car_blacklist + + plate_number, + reason, + start_time, + end_time, + status, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{plateNumber}, + #{reason}, + #{startTime}, + #{endTime}, + #{status}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + update car_blacklist + + plate_number = #{plateNumber}, + reason = #{reason}, + start_time = #{startTime}, + end_time = #{endTime}, + status = #{status}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where blacklist_id = #{blacklistId} + + + + delete from car_blacklist where blacklist_id = #{blacklistId} + + + + delete from car_blacklist where blacklist_id in + + #{blacklistId} + + + + delete from car_blacklist where blacklist_id = #{blacklistId} + + + delete from car_blacklist where blacklist_id in + + #{blacklistId} + + + + + + diff --git a/smart-modules/smart-system/src/main/resources/mapper/CarInfoMapper.xml b/smart-modules/smart-system/src/main/resources/mapper/CarInfoMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..dea95bc7e1f0f15bf2569c96c916267a49b8f89f --- /dev/null +++ b/smart-modules/smart-system/src/main/resources/mapper/CarInfoMapper.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + car_id,plate_number,plate_color, + car_type,user_id,owner_phone, + bind_time,status,create_by, + create_time,update_by,update_time, + remark + + diff --git a/smart-modules/smart-system/src/main/resources/mapper/CarSpecialPlateMapper.xml b/smart-modules/smart-system/src/main/resources/mapper/CarSpecialPlateMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..8fc0fc5fe832d1007f0dea17eab9483c4da0b533 --- /dev/null +++ b/smart-modules/smart-system/src/main/resources/mapper/CarSpecialPlateMapper.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + plate_id,plate_prefix,plate_type, + description,status,create_by, + create_time,update_by,update_time, + remark + + diff --git a/smart-modules/smart-system/src/main/resources/mapper/CarWhitelistMapper.xml b/smart-modules/smart-system/src/main/resources/mapper/CarWhitelistMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..a7bb11131bf15f7be755a47d9dce1a0737a9acc1 --- /dev/null +++ b/smart-modules/smart-system/src/main/resources/mapper/CarWhitelistMapper.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + whitelist_id,plate_number,type, + reason,start_time,end_time, + status,create_by,create_time, + update_by,update_time,remark + + + insert into car_whitelist + + plate_number, + type, + reason, + start_time, + end_time, + status, + create_by, + create_time, + update_by, + update_time, + remark, + + + #{plateNumber}, + #{type}, + #{reason}, + #{startTime}, + #{endTime}, + #{status}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{remark}, + + + + + + + + + + update car_whitelist + + plate_number = #{plateNumber}, + reason = #{reason}, + start_time = #{startTime}, + end_time = #{endTime}, + status = #{status}, + update_by = #{updateBy}, + update_time = #{updateTime}, + remark = #{remark}, + + where whitelist_id = #{whitelistId} + + + + delete from car_whitelist where whitelist_id = #{whitelistId} + + + + delete from car_whitelist where whitelist_id in + + #{whitelistId} + + + diff --git a/smart-modules/smart-system/src/main/resources/mapper/SysCarouselMapper.xml b/smart-modules/smart-system/src/main/resources/mapper/SysCarouselMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..0b616ac9f9d6f7e3e5702aca53e764528ce5db9e --- /dev/null +++ b/smart-modules/smart-system/src/main/resources/mapper/SysCarouselMapper.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + select carousel_id, title, image_url, link_url, sort_order, status, start_time, end_time, + create_by, create_time, update_by, update_time, remark + from sys_carousel + + + + carousel_id,title,image_url, + link_url,sort_order,status, + start_time,end_time,create_by, + create_time,update_by,update_time, + remark + + + + + + + insert into sys_carousel + + title, + image_url, + link_url, + sort_order, + status, + start_time, + end_time, + create_by, + remark, + create_time + + + #{title}, + #{imageUrl}, + #{linkUrl}, + #{sortOrder}, + #{status}, + #{startTime}, + #{endTime}, + #{createBy}, + #{remark}, + sysdate() + + + + + update sys_carousel + + title = #{title}, + image_url = #{imageUrl}, + link_url = #{linkUrl}, + sort_order = #{sortOrder}, + status = #{status}, + start_time = #{startTime}, + end_time = #{endTime}, + update_by = #{updateBy}, + remark = #{remark}, + update_time = sysdate() + + where carousel_id = #{carouselId} + + + + delete from sys_carousel where carousel_id = #{carouselId} + + + + delete from sys_carousel where carousel_id in + + #{carouselId} + + +